diff --git a/core/src/main/java/com/dite/znpt/config/CustomLocalDateTimeDeserializer.java b/core/src/main/java/com/dite/znpt/config/CustomLocalDateTimeDeserializer.java index b616b3a..4733233 100644 --- a/core/src/main/java/com/dite/znpt/config/CustomLocalDateTimeDeserializer.java +++ b/core/src/main/java/com/dite/znpt/config/CustomLocalDateTimeDeserializer.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.config; import cn.hutool.core.date.LocalDateTimeUtil; @@ -18,3 +19,25 @@ public class CustomLocalDateTimeDeserializer extends JsonDeserializer { + 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); + } +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/config/ExtUtilConfig.java b/core/src/main/java/com/dite/znpt/config/ExtUtilConfig.java index 9d09043..0c201c7 100644 --- a/core/src/main/java/com/dite/znpt/config/ExtUtilConfig.java +++ b/core/src/main/java/com/dite/znpt/config/ExtUtilConfig.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.config; import cn.hutool.core.io.FileUtil; @@ -78,3 +79,85 @@ public class ExtUtilConfig { } } } +======= +package com.dite.znpt.config; + +import cn.hutool.core.io.FileUtil; +import cn.hutool.core.util.RuntimeUtil; +import com.dite.znpt.constant.Message; +import com.dite.znpt.exception.ServiceException; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.context.annotation.Configuration; + +@Data +@Configuration +@ConfigurationProperties(prefix = "util") +public class ExtUtilConfig { + + @ApiModelProperty("是否开启预处理job") + private Boolean enableImagePreTreatment; + @ApiModelProperty("图片预处理工具路径") + private String imagePreTreatmentPath; + @ApiModelProperty("报告生成工具路径") + private String reportGeneratorPath; + @ApiModelProperty("报告生成工具模板路径") + private String reportGeneratorTemplatePath; + + /** + * 参数 缩写 默认值 说明 + * --input-dir 无 必需 输入图片目录路径 + * --input-file 无 必需 输入的单图,默认输出到输入值同一目录 + * --output-dir 无 输入目录+"+调整" 输出目录路径 + * --gamma 无 180 阴影检测阈值 (0-255) + * --threshold 无 253 高光检测阈值 (0-255) + * --config-file 无 naming_config.json 命名规则配置文件路径 + * --no-auto-bright 无 禁用 RAW文件禁用自动亮度调整 + * --quiet 无 禁用 减少控制台输出 + * --encoder 无 vitl 深度模型编码器类型 (vits/vitb/vitl/vitg) + * --input-size 无 518 模型输入图像尺寸 + * @param inputFile + * @param outputDir + * @return + */ + public String imagePreTreatment(String inputFile, String outputDir) { + boolean directory = FileUtil.isDirectory(inputFile); + try { + Process exec = RuntimeUtil.exec(imagePreTreatmentPath, + directory ? "--input-dir" : "--input-file", inputFile, + "--output-dir", outputDir + ); + exec.waitFor(); + return RuntimeUtil.getResult(exec); + } catch (InterruptedException e) { + throw new ServiceException(Message.UTIL_EXEC_ERROR + e.getMessage()); + } + } + + /** + * 功能描述:报告生成器 + * --turbine_id 是 指定要生成报告的机组ID + * --output_dir 是 指定生成报告的输出目录 + * --template_dir 是 指定Word模板文件所在的目录 + * @param turbineId 机组id + * @param outputDir 输出dir + * @return {@link String } + * @author cuizhibin + * @date 2025/07/17 14:08 + **/ + public String reportGenerator(String turbineId, String outputDir) { + try { + Process exec = RuntimeUtil.exec(reportGeneratorPath, + "--turbine_id", turbineId, + "--output_dir", outputDir, + "--template_dir", reportGeneratorTemplatePath + ); + exec.waitFor(); + return RuntimeUtil.getResult(exec); + } catch (InterruptedException e) { + throw new ServiceException(Message.UTIL_EXEC_ERROR + e.getMessage()); + } + } +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/config/FastJson2JsonRedisSerializer.java b/core/src/main/java/com/dite/znpt/config/FastJson2JsonRedisSerializer.java index 9a711e0..0b29201 100644 --- a/core/src/main/java/com/dite/znpt/config/FastJson2JsonRedisSerializer.java +++ b/core/src/main/java/com/dite/znpt/config/FastJson2JsonRedisSerializer.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.config; @@ -49,4 +50,57 @@ public class FastJson2JsonRedisSerializer implements RedisSerializer { DEFAULT_CHARSET = StandardCharsets.UTF_8; ParserConfig.getGlobalInstance().setAutoTypeSupport(true); } +======= +package com.dite.znpt.config; + + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.parser.ParserConfig; +import com.alibaba.fastjson.serializer.SerializerFeature; +import com.fasterxml.jackson.databind.JavaType; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.type.TypeFactory; +import org.springframework.data.redis.serializer.RedisSerializer; +import org.springframework.data.redis.serializer.SerializationException; +import org.springframework.util.Assert; + +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; + +public class FastJson2JsonRedisSerializer implements RedisSerializer { + private ObjectMapper objectMapper = new ObjectMapper(); + public static final Charset DEFAULT_CHARSET; + private Class clazz; + + public FastJson2JsonRedisSerializer(Class clazz) { + this.clazz = clazz; + } + + public byte[] serialize(T t) throws SerializationException { + return t == null ? new byte[0] : JSON.toJSONString(t, new SerializerFeature[]{SerializerFeature.WriteClassName}).getBytes(DEFAULT_CHARSET); + } + + public T deserialize(byte[] bytes) throws SerializationException { + if (bytes != null && bytes.length > 0) { + String str = new String(bytes, DEFAULT_CHARSET); + return JSON.parseObject(str, this.clazz); + } else { + return null; + } + } + + public void setObjectMapper(ObjectMapper objectMapper) { + Assert.notNull(objectMapper, "'objectMapper' must not be null"); + this.objectMapper = objectMapper; + } + + protected JavaType getJavaType(Class clazz) { + return TypeFactory.defaultInstance().constructType(clazz); + } + + static { + DEFAULT_CHARSET = StandardCharsets.UTF_8; + ParserConfig.getGlobalInstance().setAutoTypeSupport(true); + } +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f } \ No newline at end of file diff --git a/core/src/main/java/com/dite/znpt/config/RedisConfig.java b/core/src/main/java/com/dite/znpt/config/RedisConfig.java index 6b0c737..3be7d3b 100644 --- a/core/src/main/java/com/dite/znpt/config/RedisConfig.java +++ b/core/src/main/java/com/dite/znpt/config/RedisConfig.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.config; import com.fasterxml.jackson.annotation.JsonAutoDetect; @@ -61,3 +62,68 @@ public class RedisConfig extends CachingConfigurerSupport { return "local key = KEYS[1]\nlocal count = tonumber(ARGV[1])\nlocal time = tonumber(ARGV[2])\nlocal current = redis.call('get', key);\nif current and tonumber(current) > count then\n return tonumber(current);\nend\ncurrent = redis.call('incr', key)\nif tonumber(current) == 1 then\n redis.call('expire', key, time)\nend\nreturn tonumber(current);"; } } +======= +package com.dite.znpt.config; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.PropertyAccessor; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.jsontype.impl.LaissezFaireSubTypeValidator; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.cache.annotation.CachingConfigurerSupport; +import org.springframework.cache.annotation.EnableCaching; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Primary; +import org.springframework.data.redis.cache.RedisCacheConfiguration; +import org.springframework.data.redis.cache.RedisCacheManager; +import org.springframework.data.redis.cache.RedisCacheWriter; +import org.springframework.data.redis.connection.RedisConnectionFactory; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.data.redis.core.script.DefaultRedisScript; +import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer; +import org.springframework.data.redis.serializer.RedisSerializationContext; +import org.springframework.data.redis.serializer.StringRedisSerializer; +import org.springframework.stereotype.Component; + +import java.util.Objects; + +@Configuration +@EnableCaching +public class RedisConfig extends CachingConfigurerSupport { + + public RedisConfig() { + } + + @Bean + @Primary + public RedisTemplate redisTemplate(RedisConnectionFactory connectionFactory) { + RedisTemplate template = new RedisTemplate(); + template.setConnectionFactory(connectionFactory); + FastJson2JsonRedisSerializer serializer = new FastJson2JsonRedisSerializer(Object.class); + ObjectMapper mapper = new ObjectMapper(); + mapper.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY); + mapper.activateDefaultTyping(LaissezFaireSubTypeValidator.instance, ObjectMapper.DefaultTyping.NON_FINAL, JsonTypeInfo.As.PROPERTY); + serializer.setObjectMapper(mapper); + template.setKeySerializer(new StringRedisSerializer()); + template.setValueSerializer(serializer); + template.setHashKeySerializer(new StringRedisSerializer()); + template.setHashValueSerializer(serializer); + template.afterPropertiesSet(); + return template; + } + + @Bean + public DefaultRedisScript limitScript() { + DefaultRedisScript redisScript = new DefaultRedisScript(); + redisScript.setScriptText(this.limitScriptText()); + redisScript.setResultType(Long.class); + return redisScript; + } + + private String limitScriptText() { + return "local key = KEYS[1]\nlocal count = tonumber(ARGV[1])\nlocal time = tonumber(ARGV[2])\nlocal current = redis.call('get', key);\nif current and tonumber(current) > count then\n return tonumber(current);\nend\ncurrent = redis.call('incr', key)\nif tonumber(current) == 1 then\n redis.call('expire', key, time)\nend\nreturn tonumber(current);"; + } +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/config/Schedule.java b/core/src/main/java/com/dite/znpt/config/Schedule.java index 8f6a837..030798e 100644 --- a/core/src/main/java/com/dite/znpt/config/Schedule.java +++ b/core/src/main/java/com/dite/znpt/config/Schedule.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.config; import cn.hutool.core.io.FileUtil; @@ -68,3 +69,75 @@ public class Schedule { imageService.updateBatchById(successList); } } +======= +package com.dite.znpt.config; + +import cn.hutool.core.io.FileUtil; +import cn.hutool.core.util.BooleanUtil; +import com.dite.znpt.domain.entity.ImageEntity; +import com.dite.znpt.domain.vo.PartResp; +import com.dite.znpt.enums.FilePathEnum; +import com.dite.znpt.service.ImageService; +import com.dite.znpt.service.PartService; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.stereotype.Component; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.function.Function; +import java.util.stream.Collectors; + +@Slf4j +@Component +@RequiredArgsConstructor +public class Schedule { + + private final ImageService imageService; + private final PartService partService; + private final ExtUtilConfig extUtilConfig; + + /** + * 功能描述:图像预处理,持续运行 + * + * @author cuizhibin + * @date 2025/07/24 14:23 + **/ + @Scheduled(fixedRate = 10_000) + public void imagePreTreatment() { + if (BooleanUtil.isFalse(extUtilConfig.getEnableImagePreTreatment())) { + return; + } + List list = imageService.lambdaQuery().eq(ImageEntity::getPreTreatment, "0") + .isNotNull(ImageEntity::getPartId) + .isNotNull(ImageEntity::getProjectId).list(); + List partIds = list.stream().map(ImageEntity::getPartId).toList(); + Map partRespMap = partService.listInfos(partIds).stream().collect(Collectors.toMap(PartResp::getPartId, Function.identity())); +// 预处理 + List successList = new ArrayList<>(); + for (ImageEntity image : list) { + PartResp partResp = partRespMap.get(image.getPartId()); + FilePathEnum pathEnum = FilePathEnum.getFilePathEnum(image.getImagePath()); + String inputFile = pathEnum.getFileAbsolutePath(image.getImagePath()); + String outputDir = FilePathEnum.IMAGE.getFileAbsolutePathPrefix() + .concat("已调整") + .concat(FileUtil.FILE_SEPARATOR).concat(partResp.getProjectName()) + .concat(FileUtil.FILE_SEPARATOR).concat(partResp.getTurbineName()) + .concat(FileUtil.FILE_SEPARATOR).concat(partResp.getPartName()); + extUtilConfig.imagePreTreatment(inputFile, outputDir); + String outputFile = outputDir.concat(FileUtil.FILE_SEPARATOR).concat(FileUtil.getName(inputFile)); + boolean preSuccess = FileUtil.exist(outputFile); + if(!preSuccess) { + log.warn("图片预处理失败,图片id:{},路径:{}", image.getImageId(), inputFile); + continue; + } + image.setPreTreatment(true); + image.setPreImagePath(FilePathEnum.IMAGE.getFileDownPath(outputFile)); + successList.add(image); + } + imageService.updateBatchById(successList); + } +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/config/WebMvcConfig.java b/core/src/main/java/com/dite/znpt/config/WebMvcConfig.java index e2b42fa..e94abb2 100644 --- a/core/src/main/java/com/dite/znpt/config/WebMvcConfig.java +++ b/core/src/main/java/com/dite/znpt/config/WebMvcConfig.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.config; import cn.hutool.core.collection.ListUtil; @@ -50,3 +51,57 @@ public class WebMvcConfig implements WebMvcConfigurer { } } +======= +package com.dite.znpt.config; + +import cn.hutool.core.collection.ListUtil; +import com.dite.znpt.enums.FilePathEnum; +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.List; + +/** + * @author Bear.G + * @date 2025/5/23/周五 11:19 + * @description + */ + +@Configuration +public class WebMvcConfig implements WebMvcConfigurer { + + @Override + public void addResourceHandlers(ResourceHandlerRegistry registry) { + registry.addResourceHandler("doc.html").addResourceLocations("classpath:/META-INF/resources/"); + 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.getFileAbsolutePathPrefix()); + } + } + +// @Override +// public void addInterceptors(InterceptorRegistry registry) { +// // 注册 Sa-Token 拦截器,定义详细认证规则 +// registry.addInterceptor(new SaInterceptor(handler -> { +// SaRouter +// .match("/**") // 拦截的 path 列表,可以写多个 */ +// .notMatch(excludePaths()) +// .check(r -> StpUtil.checkLogin()); +// })).addPathPatterns("/**"); +// } + + // 动态获取哪些 path 可以忽略鉴权 + public List excludePaths() { + // 此处仅为示例,实际项目你可以写任意代码来查询这些path + ArrayList list = ListUtil.toList("/auth/login", "/favicon.ico", "/favicon.ico", "/doc.html", "/swagger-ui/**", "/swagger-resources", "/webjars/**", "/v3/api-docs/**", "/**/v3/api-docs"); + for (FilePathEnum pathEnum : FilePathEnum.values()) { + list.add(pathEnum.getUrlPath() + "**"); + } + return list; + } + +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/config/YoloModelRegistry.java b/core/src/main/java/com/dite/znpt/config/YoloModelRegistry.java index a93583e..d80afdc 100644 --- a/core/src/main/java/com/dite/znpt/config/YoloModelRegistry.java +++ b/core/src/main/java/com/dite/znpt/config/YoloModelRegistry.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.config; import ai.onnxruntime.OrtEnvironment; @@ -110,3 +111,117 @@ public class YoloModelRegistry { } } +======= +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 sessionMap = new ConcurrentHashMap<>(); + private final Map metaMap = new ConcurrentHashMap<>(); + private final Map modelParamMap = new ConcurrentHashMap<>(); + @Getter + private final OrtEnvironment environment = OrtEnvironment.getEnvironment(); + + static { + // 加载opencv动态库 + nu.pattern.OpenCV.loadLocally(); + } + + @PostConstruct + public void loadModelsOnStartup() throws OrtException { + List 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 labels = new ArrayList<>(); + List 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 colors; + private ModelConfigEntity config; + } +} + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/constant/Message.java b/core/src/main/java/com/dite/znpt/constant/Message.java index 842c55e..5807615 100644 --- a/core/src/main/java/com/dite/znpt/constant/Message.java +++ b/core/src/main/java/com/dite/znpt/constant/Message.java @@ -79,4 +79,13 @@ public class Message implements Serializable { public static final String EQUIPMENT_USE_RECORD_STATUS_ERROR = "设备使用记录状态不合法"; public static final String EQUIPMENT_IS_USED = "设备已被使用"; public static final String EQUIPMENT_IS_RETURN = "设备已归还"; +<<<<<<< HEAD +======= + public static final String DAILY_REPORT_EXISTS = "当日已提交日报"; + public static final String BIDDING_INFO_ID_IS_NOT_EXIST = "招标信息id不存在"; + public static final String TENDER_INFO_ID_IS_NOT_EXIST = "投标信息id不存在"; + public static final String TENDER_INFO_IS_EXIST = "招标[{}]已存中投信息存在"; + public static final String OUTBID_INFO_ID_IS_NOT_EXIST = "中标信息id不存在"; + public static final String OUTBID_INFO_IS_EXIST = "招标[{}]已存中标信息存在"; +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f } diff --git a/core/src/main/java/com/dite/znpt/converts/Converts.java b/core/src/main/java/com/dite/znpt/converts/Converts.java index b373e0f..3d34c72 100644 --- a/core/src/main/java/com/dite/znpt/converts/Converts.java +++ b/core/src/main/java/com/dite/znpt/converts/Converts.java @@ -124,5 +124,12 @@ public interface Converts { EquipmentEntity toEquipmentUseRecordEntity(EquipmentReq req); EquipmentUseRecordEntity toEquipmentUseRecordEntity(EquipmentUseRecordReq req); +<<<<<<< HEAD +======= + BiddingInfoEntity toBiddingInfoReq (BiddingInfoReq req); + List toBiddingInfoReq (List req); + TenderInfoEntity toTenderInfoEntity (TenderInfoReq req); + OutbidInfoEntity toOutbidInfoEntity (OutbidInfoReq req); +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f } diff --git a/core/src/main/java/com/dite/znpt/domain/AuditableEntity.java b/core/src/main/java/com/dite/znpt/domain/AuditableEntity.java index 0eb68a1..f8b851e 100644 --- a/core/src/main/java/com/dite/znpt/domain/AuditableEntity.java +++ b/core/src/main/java/com/dite/znpt/domain/AuditableEntity.java @@ -1,6 +1,7 @@ package com.dite.znpt.domain; import com.alibaba.excel.annotation.ExcelIgnore; +<<<<<<< HEAD import com.baomidou.mybatisplus.annotation.FieldFill; import com.baomidou.mybatisplus.annotation.TableField; import com.fasterxml.jackson.annotation.JsonFormat; @@ -10,11 +11,22 @@ import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; +======= +import com.baomidou.mybatisplus.annotation.TableField; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f import java.io.Serial; import java.io.Serializable; import java.time.LocalDateTime; +<<<<<<< HEAD import java.util.List; +======= +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f /** * @description: 统一定义顶层Entity实体审计 基类 @@ -42,11 +54,14 @@ public class AuditableEntity implements Serializable { private LocalDateTime updateTime; @ExcelIgnore +<<<<<<< HEAD @ApiModelProperty(value = "id集合", example = "[]", notes = "id集合") @TableField(exist = false) private List idList; @ExcelIgnore +======= +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f @ApiModelProperty(value = "当前页", example = "1", notes = "0") @TableField(exist = false) int page = 1; diff --git a/core/src/main/java/com/dite/znpt/domain/PageResult.java b/core/src/main/java/com/dite/znpt/domain/PageResult.java index 91944ae..f4f359e 100644 --- a/core/src/main/java/com/dite/znpt/domain/PageResult.java +++ b/core/src/main/java/com/dite/znpt/domain/PageResult.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain; import com.github.pagehelper.PageInfo; @@ -56,3 +57,63 @@ public class PageResult { } +======= +package com.dite.znpt.domain; + +import com.github.pagehelper.PageInfo; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 分页查询结果 + */ +@Data +public class PageResult { + private static final long serialVersionUID = 1L; + @ApiModelProperty("状态码") + private Integer code; + @ApiModelProperty("返回内容") + private String msg; + @ApiModelProperty("对象列表") + private List rows; + @ApiModelProperty("数据对象") + private Long total; + + public PageResult(int code, String msg) { + this.code = code; + this.msg = msg; + } + + public PageResult(int code, String msg, List rows, Long total) { + this.code = code; + this.msg = msg; + this.rows = rows; + this.total = total; + } + + public static PageResult ok(List rows) { + return ok(rows, (new PageInfo(rows)).getTotal()); + } + + public static PageResult ok(List rows, Long total) { + return new PageResult(200, "操作成功", rows, total); + } + + public static PageResult ok(List rows, Integer total) { + return new PageResult(200, "操作成功", rows, (long)total); + } + + public static PageResult error() { + return error("操作失败"); + } + + public static PageResult error(String msg) { + return new PageResult(500, msg); + } + +} + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/QueryWrapperBuilder.java b/core/src/main/java/com/dite/znpt/domain/QueryWrapperBuilder.java index 68e6f8f..76cb23a 100644 --- a/core/src/main/java/com/dite/znpt/domain/QueryWrapperBuilder.java +++ b/core/src/main/java/com/dite/znpt/domain/QueryWrapperBuilder.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain; import cn.hutool.core.util.ReflectUtil; @@ -75,3 +76,82 @@ public class QueryWrapperBuilder { return wrapper; } } +======= +package com.dite.znpt.domain; + +import cn.hutool.core.util.ReflectUtil; +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.dite.znpt.annotations.QueryCondition; +import org.apache.commons.lang3.StringUtils; +import org.springframework.core.annotation.AnnotationUtils; + +import java.lang.reflect.Field; +import java.util.Arrays; +import java.util.Collection; + +public class QueryWrapperBuilder { + + public static QueryWrapper build(Object queryDTO) { + QueryWrapper wrapper = new QueryWrapper<>(); + Field[] fields = ReflectUtil.getFields(queryDTO.getClass()); + + for (Field field : fields) { + QueryCondition qc = AnnotationUtils.getAnnotation(field, QueryCondition.class); + if (qc == null) continue; + + TableField tf = AnnotationUtils.getAnnotation(field, TableField.class); + field.setAccessible(true); + try { + Object value = field.get(queryDTO); + // 获取列名:优先 QueryCondition.column -> TableField.value -> 字段名 + String column = qc.column(); + if (StringUtils.isBlank(column)) { + TableField tableField = field.getAnnotation(TableField.class); + if (tableField != null && StringUtils.isNotBlank(tableField.value())) { + column = tableField.value(); + } else { + column = StrUtil.toUnderlineCase(field.getName()); + } + } + + // null检查 + if (value == null && !qc.nullable()) continue; + + // empty检查 + if (value instanceof String && ((String) value).isEmpty() && !qc.emptyable()) continue; + + switch (qc.func()) { + case equal: wrapper.eq(column, value); break; + case notEqual: wrapper.ne(column, value); break; + case like: wrapper.like(column, value); break; + case notLike: wrapper.notLike(column, value); break; + case gt: wrapper.gt(column, value); break; + case ge: wrapper.ge(column, value); break; + case lt: wrapper.lt(column, value); break; + case le: wrapper.le(column, value); break; + case greaterThan: wrapper.gt(column, (Comparable) value); break; + case greaterThanOrEqualTo: wrapper.ge(column, (Comparable) value); break; + case lessThan: wrapper.lt(column, (Comparable) value); break; + case lessThanOrEqualTo: wrapper.le(column, (Comparable) value); break; + case in: + case inn: + if (value instanceof Collection) { + wrapper.in(column, (Collection) value); + } else if (value.getClass().isArray()) { + wrapper.in(column, Arrays.asList((Object[]) value)); + } + break; + case isNull: wrapper.isNull(column); break; + case isNotNull: wrapper.isNotNull(column); break; + default: break; + } + + } catch (IllegalAccessException ignored) {} + } + + return wrapper; + } +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/bo/Detection.java b/core/src/main/java/com/dite/znpt/domain/bo/Detection.java index 063a4f3..2f1abd9 100644 --- a/core/src/main/java/com/dite/znpt/domain/bo/Detection.java +++ b/core/src/main/java/com/dite/znpt/domain/bo/Detection.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.bo; import io.swagger.annotations.ApiModelProperty; @@ -19,3 +20,26 @@ public class Detection{ @ApiModelProperty("置信度") private float confidence; } +======= +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; +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/bo/Letterbox.java b/core/src/main/java/com/dite/znpt/domain/bo/Letterbox.java index b709f79..1e24dcb 100644 --- a/core/src/main/java/com/dite/znpt/domain/bo/Letterbox.java +++ b/core/src/main/java/com/dite/znpt/domain/bo/Letterbox.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.bo; import lombok.Getter; @@ -70,4 +71,78 @@ public class Letterbox { this.dw = dw; return im; } +======= +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; + } +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f } \ No newline at end of file diff --git a/core/src/main/java/com/dite/znpt/domain/bo/ODConfig.java b/core/src/main/java/com/dite/znpt/domain/bo/ODConfig.java index 9f9a10b..5c9f29b 100644 --- a/core/src/main/java/com/dite/znpt/domain/bo/ODConfig.java +++ b/core/src/main/java/com/dite/znpt/domain/bo/ODConfig.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.bo; import java.util.*; @@ -52,4 +53,60 @@ public final class ODConfig { public double[] getOtherColor(int clsId) { return colors.get(default_names.get(clsId)); } +======= +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 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 names = new ArrayList<>(Arrays.asList( + "no_helmet", "helmet")); + + private final Map 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)); + } +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f } \ No newline at end of file diff --git a/core/src/main/java/com/dite/znpt/domain/dto/OutWorkDefectDTO.java b/core/src/main/java/com/dite/znpt/domain/dto/OutWorkDefectDTO.java index 86d32c6..8d692cd 100644 --- a/core/src/main/java/com/dite/znpt/domain/dto/OutWorkDefectDTO.java +++ b/core/src/main/java/com/dite/znpt/domain/dto/OutWorkDefectDTO.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.dto; import com.dite.znpt.annotations.MatchType; @@ -48,3 +49,55 @@ public class OutWorkDefectDTO implements Serializable { @ApiModelProperty("缺陷列表") private List defectList; } +======= +package com.dite.znpt.domain.dto; + +import com.dite.znpt.annotations.MatchType; +import com.dite.znpt.annotations.QueryCondition; +import com.dite.znpt.domain.entity.job.DefectDTO; +import com.fasterxml.jackson.annotation.JsonIgnore; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +@Data +public class OutWorkDefectDTO implements Serializable { + + @ApiModelProperty(value = "项目id", example = "797989789797", notes = "项目id") + @QueryCondition(func = MatchType.like) + private String projectId; + + @ApiModelProperty(value = "机组id", example = "797989789797", notes = "机组id") + @QueryCondition(func = MatchType.like) + private String crewId; + + @ApiModelProperty(value = "内业或外业id", example = "797989789797", notes = "内业或外业id") + @QueryCondition(func = MatchType.like) + private String reportId; + + @ApiModelProperty(value = "图片地址", example = "http://www.images/1.png,http://www.images/1.png", notes = "图片地址") + private List urlsList; + + @ApiModelProperty(value = "岗位类型", example = "78979879375", notes = "岗位id") + @QueryCondition(func = MatchType.like) + private String jobCode; + + @ApiModelProperty(value = "部件编号", example = "GG1", notes = "部件编号") + @QueryCondition(func = MatchType.like) + private String code; + + @ApiModelProperty("图片地址") + @QueryCondition(func = MatchType.like) + @JsonIgnore + private String urls; + + @ApiModelProperty("是否有缺陷:1有,0无") + @QueryCondition(func = MatchType.equal) + private Integer status; + + @ApiModelProperty("缺陷列表") + private List defectList; +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/entity/AttachInfoEntity.java b/core/src/main/java/com/dite/znpt/domain/entity/AttachInfoEntity.java index 5e1fb8c..0bf8bf9 100644 --- a/core/src/main/java/com/dite/znpt/domain/entity/AttachInfoEntity.java +++ b/core/src/main/java/com/dite/znpt/domain/entity/AttachInfoEntity.java @@ -43,6 +43,13 @@ public class AttachInfoEntity extends AuditableEntity implements Serializable { @TableField("business_type") private String businessType; +<<<<<<< HEAD +======= + @ApiModelProperty("文件名") + @TableField("file_name") + private String fileName; + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f @ApiModelProperty("文件类型") @TableField("file_type") private String fileType; diff --git a/core/src/main/java/com/dite/znpt/domain/entity/AudioFileInfoEntity.java b/core/src/main/java/com/dite/znpt/domain/entity/AudioFileInfoEntity.java index 0a63151..c43955f 100644 --- a/core/src/main/java/com/dite/znpt/domain/entity/AudioFileInfoEntity.java +++ b/core/src/main/java/com/dite/znpt/domain/entity/AudioFileInfoEntity.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.entity; import java.io.Serial; @@ -42,3 +43,49 @@ public class AudioFileInfoEntity extends AuditableEntity implements Serializable } +======= +package com.dite.znpt.domain.entity; + +import java.io.Serial; +import java.io.Serializable; + +import com.baomidou.mybatisplus.annotation.*; +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; + +/** + * @author huise23 + * @date 2025/06/23 13:39 + * @Description: 音频文件信息表实体类 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("audio_file_info") +@ApiModel(value="AudioFileInfoEntity对象", description="音频文件信息表") +public class AudioFileInfoEntity extends AuditableEntity implements Serializable { + + @Serial + private static final long serialVersionUID = -86870801917845298L; + + @ExcelProperty("id") + @ApiModelProperty("id") + @TableId(value = "audio_id", type = IdType.ASSIGN_ID) + private String audioId; + + @ExcelProperty("图片id") + @ApiModelProperty("图片id") + @TableField("image_id") + private String imageId; + + @ExcelProperty("文件保存路径") + @ApiModelProperty("文件保存路径") + @TableField("file_path") + private String filePath; + +} + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/entity/BiddingInfoEntity.java b/core/src/main/java/com/dite/znpt/domain/entity/BiddingInfoEntity.java new file mode 100644 index 0000000..349ebbd --- /dev/null +++ b/core/src/main/java/com/dite/znpt/domain/entity/BiddingInfoEntity.java @@ -0,0 +1,63 @@ +package com.dite.znpt.domain.entity; + +import com.alibaba.excel.annotation.ExcelProperty; +import com.baomidou.mybatisplus.annotation.IdType; +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.math.BigDecimal; +import java.time.LocalDateTime; + +/** + * @author Bear.G + * @date 2025/7/28/周一 15:42 + * @description + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("bidding_info") +@ApiModel(value="BiddingInfoEntity对象", description="招标信息表") +public class BiddingInfoEntity extends AuditableEntity implements Serializable { + + @Serial + private static final long serialVersionUID = -2451841606051749490L; + + @ApiModelProperty("招标信息id") + @TableId(type = IdType.ASSIGN_UUID) + private String biddingInfoId; + + @ApiModelProperty("招标项目") + private String biddingProject; + + @ApiModelProperty("招标公司") + private String biddingCompany; + + @ApiModelProperty("招标金额") + private BigDecimal biddingAmount; + + @ApiModelProperty("招标截止时间") + private String biddingDeadline; + + @ApiModelProperty("招标信息录入时间") + private LocalDateTime infoEntryTime; + + @ApiModelProperty("招标信息来源") + private String source; + + @ApiModelProperty("招标信息来源网址") + private String sourceWebsite; + + @ApiModelProperty("招标文件id") + private String biddingFileId; + + @ApiModelProperty("状态:0-待报名,1-已报名") + private String status; + +} diff --git a/core/src/main/java/com/dite/znpt/domain/entity/CertificationEntity.java b/core/src/main/java/com/dite/znpt/domain/entity/CertificationEntity.java index 9a92d6b..eca69d4 100644 --- a/core/src/main/java/com/dite/znpt/domain/entity/CertificationEntity.java +++ b/core/src/main/java/com/dite/znpt/domain/entity/CertificationEntity.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.entity; import com.baomidou.mybatisplus.annotation.IdType; @@ -60,3 +61,67 @@ public class CertificationEntity extends AuditableEntity implements Serializable @TableField("certification_image") private String certificationImage; } +======= +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; + +/** + * @author Bear.G + * @date 2025/5/27/周二 15:15 + * @description + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("certification") +@ApiModel(value="CertificationEntity对象", description="人员资质") +public class CertificationEntity extends AuditableEntity implements Serializable { + + @Serial + private static final long serialVersionUID = -5650015300122333342L; + + @ApiModelProperty("证书id") + @TableId(value = "certification_id", type = IdType.ASSIGN_UUID) + private String certificationId; + + @ApiModelProperty("用户id") + @TableField("user_id") + private String userId; + + @ApiModelProperty("证书编号") + @TableField("certification_code") + private String certificationCode; + + @ApiModelProperty("证书名称") + @TableField("certification_name") + private String certificationName; + + @ApiModelProperty("证书类型") + @TableField("certification_type") + private String certificationType; + + @ApiModelProperty("证书有效期-起") + @TableField("validity_date_begin") + private LocalDate validityDateBegin; + + @ApiModelProperty("证书有效期-讫") + @TableField("validity_date_end") + private LocalDate validityDateEnd; + + @ApiModelProperty("证书图片") + @TableField("certification_image") + private String certificationImage; +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/entity/ContractEntity.java b/core/src/main/java/com/dite/znpt/domain/entity/ContractEntity.java index 56a31cf..bb4e76b 100644 --- a/core/src/main/java/com/dite/znpt/domain/entity/ContractEntity.java +++ b/core/src/main/java/com/dite/znpt/domain/entity/ContractEntity.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.entity; import java.math.BigDecimal; @@ -108,3 +109,115 @@ public class ContractEntity extends AuditableEntity implements Serializable { private String contractStatus; } +======= +package com.dite.znpt.domain.entity; + +import java.math.BigDecimal; +import java.util.Date; +import java.io.Serial; +import java.io.Serializable; + +import com.baomidou.mybatisplus.annotation.*; +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; + +/** + * @author huise23 + * @date 2025/07/21 21:13 + * @Description: 合同表实体类 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("contract") +@ApiModel(value="ContractEntity对象", description="合同表") +public class ContractEntity extends AuditableEntity implements Serializable { + + @Serial + private static final long serialVersionUID = 782007452634989148L; + + @ExcelProperty("合同id") + @ApiModelProperty("合同id") + @TableId(value = "contract_id", type = IdType.ASSIGN_ID) + private String contractId; + + @ExcelProperty("客户名称") + @ApiModelProperty("客户名称") + @TableField("customer") + private String customer; + + @ExcelProperty("合同编号") + @ApiModelProperty("合同编号") + @TableField("code") + private String code; + + @ExcelProperty("项目id") + @ApiModelProperty("项目id") + @TableField("project_id") + private String projectId; + + @ExcelProperty("业务员id") + @ApiModelProperty("业务员id") + @TableField("salesperson_id") + private String salespersonId; + + @ExcelProperty("部门id") + @ApiModelProperty("部门id") + @TableField("department_id") + private String departmentId; + + @ExcelProperty("签订日期") + @ApiModelProperty("签订日期") + @TableField("sign_date") + private Date signDate; + + @ExcelProperty("期限") + @ApiModelProperty("期限") + @TableField("duration") + private String duration; + + @ExcelProperty("类型") + @ApiModelProperty("类型") + @TableField("type") + private String type; + + @ExcelProperty("产品或服务") + @ApiModelProperty("产品或服务") + @TableField("product_service") + private String productService; + + @ExcelProperty("付款日期/交付日期") + @ApiModelProperty("付款日期/交付日期") + @TableField("payment_date") + private Date paymentDate; + + @ExcelProperty("付款地址/交付地址") + @ApiModelProperty("付款地址/交付地址") + @TableField("payment_address") + private String paymentAddress; + + @ExcelProperty("金额") + @ApiModelProperty("金额") + @TableField("amount") + private BigDecimal amount; + + @ExcelProperty("收款账号") + @ApiModelProperty("收款账号") + @TableField("account_number") + private String accountNumber; + + @ExcelProperty("备注") + @ApiModelProperty("备注") + @TableField("notes") + private String notes; + + @ExcelProperty("合同状态") + @ApiModelProperty("合同状态") + @TableField("contract_status") + private String contractStatus; +} + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/entity/ContractSettlementEntity.java b/core/src/main/java/com/dite/znpt/domain/entity/ContractSettlementEntity.java index ef53a4c..37ad36c 100644 --- a/core/src/main/java/com/dite/znpt/domain/entity/ContractSettlementEntity.java +++ b/core/src/main/java/com/dite/znpt/domain/entity/ContractSettlementEntity.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.entity; import java.math.BigDecimal; @@ -103,3 +104,110 @@ public class ContractSettlementEntity extends AuditableEntity implements Seriali private String settlementStatus; } +======= +package com.dite.znpt.domain.entity; + +import java.math.BigDecimal; +import java.util.Date; +import java.io.Serial; +import java.io.Serializable; + +import com.baomidou.mybatisplus.annotation.*; +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; + +/** + * @author huise23 + * @date 2025/07/21 21:13 + * @Description: 合同结算表实体类 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("contract_settlement") +@ApiModel(value="ContractSettlementEntity对象", description="合同结算表") +public class ContractSettlementEntity extends AuditableEntity implements Serializable { + + @Serial + private static final long serialVersionUID = -59751771276704650L; + + @ExcelProperty("合同结算id") + @ApiModelProperty("合同结算id") + @TableId(value = "settlement_id", type = IdType.ASSIGN_ID) + private String settlementId; + + @ExcelProperty("合同id") + @ApiModelProperty("合同id") + @TableField("contract_id") + private String contractId; + + @ExcelProperty("客户/供应商名称") + @ApiModelProperty("客户/供应商名称") + @TableField("customer") + private String customer; + + @ExcelProperty("合同结算编号") + @ApiModelProperty("合同结算编号") + @TableField("code") + private String code; + + @ExcelProperty("项目id") + @ApiModelProperty("项目id") + @TableField("project_id") + private String projectId; + + @ExcelProperty("业务员id") + @ApiModelProperty("业务员id") + @TableField("salesperson_id") + private String salespersonId; + + @ExcelProperty("部门id") + @ApiModelProperty("部门id") + @TableField("department_id") + private String departmentId; + + @ExcelProperty("账期") + @ApiModelProperty("账期") + @TableField("payment_period") + private Date paymentPeriod; + + @ExcelProperty("日期") + @ApiModelProperty("日期") + @TableField("payment_date") + private Date paymentDate; + + @ExcelProperty("期限") + @ApiModelProperty("期限") + @TableField("duration") + private String duration; + + @ExcelProperty("产品或服务") + @ApiModelProperty("产品或服务") + @TableField("product_service") + private String productService; + + @ExcelProperty("金额") + @ApiModelProperty("金额") + @TableField("amount") + private BigDecimal amount; + + @ExcelProperty("收款账号") + @ApiModelProperty("收款账号") + @TableField("account_number") + private String accountNumber; + + @ExcelProperty("备注") + @ApiModelProperty("备注") + @TableField("notes") + private String notes; + + @ExcelProperty("合同结算状态") + @ApiModelProperty("合同结算状态") + @TableField("settlement_status") + private String settlementStatus; +} + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/entity/DeptEntity.java b/core/src/main/java/com/dite/znpt/domain/entity/DeptEntity.java index 592aa2f..37ea352 100644 --- a/core/src/main/java/com/dite/znpt/domain/entity/DeptEntity.java +++ b/core/src/main/java/com/dite/znpt/domain/entity/DeptEntity.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.entity; import com.baomidou.mybatisplus.annotation.IdType; @@ -62,3 +63,69 @@ public class DeptEntity extends AuditableEntity implements Serializable { @TableField("del_flag") private String delFlag; } +======= +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 Bear.G + * @date 2025/5/20/周二 9:17 + * @description + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("dept") +@ApiModel(value="DeptEntity对象", description="部门信息表") +public class DeptEntity extends AuditableEntity implements Serializable { + @Serial + private static final long serialVersionUID = -6471015140726790051L; + + @ApiModelProperty("部门id") + @TableId(value = "dept_id", type = IdType.ASSIGN_UUID) + private String deptId; + + @ApiModelProperty("父级部门id") + @TableField("parent_id") + private String parentId; + + @ApiModelProperty("祖籍列表") + @TableField("ancestors") + private String ancestors; + + @ApiModelProperty("部门全路径名称") + @TableField("dept_full_name") + private String deptFullName; + + @ApiModelProperty("部门名称") + @TableField("dept_name") + private String deptName; + + @ApiModelProperty("显示顺序") + @TableField("order_num") + private Integer orderNum; + + @ApiModelProperty("部门负责人") + @TableField("leader_id") + private String leaderId; + + @ApiModelProperty("状态(0正常 1停用)") + @TableField("status") + private Integer status; + + @ApiModelProperty("删除标志(0代表存在 1代表删除)") + @TableField("del_flag") + private String delFlag; +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/entity/DictEntity.java b/core/src/main/java/com/dite/znpt/domain/entity/DictEntity.java index f79ac88..9241caf 100644 --- a/core/src/main/java/com/dite/znpt/domain/entity/DictEntity.java +++ b/core/src/main/java/com/dite/znpt/domain/entity/DictEntity.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.entity; import com.alibaba.excel.annotation.ExcelProperty; @@ -59,3 +60,66 @@ public class DictEntity extends AuditableEntity implements Serializable { private Integer finalState; } +======= +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/06/30 11:38 + * @Description: 字典表实体类 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("dict") +@ApiModel(value="DictEntity对象", description="字典表") +public class DictEntity extends AuditableEntity implements Serializable { + + @Serial + private static final long serialVersionUID = -52191875430786367L; + + @ExcelProperty("字典id") + @ApiModelProperty("字典id") + @TableId(value = "dict_id", type = IdType.ASSIGN_ID) + private String dictId; + + @ExcelProperty("字典类型") + @ApiModelProperty("字典类型") + @TableField("dict_type") + private String dictType; + + @ExcelProperty("字典名称") + @ApiModelProperty("字典名称") + @TableField("dict_name") + private String dictName; + + @ExcelProperty("父级id") + @ApiModelProperty("父级id") + @TableField("parent_id") + private Long parentId; + + @ExcelProperty("字典排序") + @ApiModelProperty("字典排序") + @TableField("sort_order") + private Integer sortOrder; + + @ExcelProperty("是否字典终值") + @ApiModelProperty("是否字典终值") + @TableField("final_state") + private Integer finalState; +} + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/entity/EquipmentEntity.java b/core/src/main/java/com/dite/znpt/domain/entity/EquipmentEntity.java index e1d577e..af4c6ac 100644 --- a/core/src/main/java/com/dite/znpt/domain/entity/EquipmentEntity.java +++ b/core/src/main/java/com/dite/znpt/domain/entity/EquipmentEntity.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.entity; import com.baomidou.mybatisplus.annotation.*; @@ -53,3 +54,60 @@ public class EquipmentEntity extends AuditableEntity implements Serializable { @TableLogic(value = "0", delval = "1") private String delFlag; } +======= +package com.dite.znpt.domain.entity; + +import com.baomidou.mybatisplus.annotation.*; +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 Bear.G + * @date 2025/7/23/周三 17:26 + * @description + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("equipment") +@ApiModel(value="EquipmentEntity对象", description="设备信息表") +public class EquipmentEntity extends AuditableEntity implements Serializable { + @Serial + private static final long serialVersionUID = -6665040704562461286L; + + @ApiModelProperty("设备id") + @TableId(type = IdType.ASSIGN_ID) + private String equipmentId; + + @ApiModelProperty("设备名称") + private String equipmentName; + + @ApiModelProperty("设备型号") + private String equipmentModel; + + @ApiModelProperty("设备类型") + private String equipmentType; + + @ApiModelProperty("设备状态,枚举:EquipmentStatusEnum") + private String equipmentStatus; + + @ApiModelProperty("使用状态,0-空闲中,1-使用中") + private String useStatus; + + @ApiModelProperty("设备序列号") + private String equipmentSn; + + @ApiModelProperty("当前使用记录id") + @TableField(updateStrategy = FieldStrategy.ALWAYS) + private String useRecordId; + + @ApiModelProperty("删除标志(0代表存在 1代表删除)") + @TableLogic(value = "0", delval = "1") + private String delFlag; +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/entity/EquipmentUseRecordEntity.java b/core/src/main/java/com/dite/znpt/domain/entity/EquipmentUseRecordEntity.java index 0fe4696..6e55ff5 100644 --- a/core/src/main/java/com/dite/znpt/domain/entity/EquipmentUseRecordEntity.java +++ b/core/src/main/java/com/dite/znpt/domain/entity/EquipmentUseRecordEntity.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.entity; import com.baomidou.mybatisplus.annotation.IdType; @@ -51,3 +52,58 @@ public class EquipmentUseRecordEntity extends AuditableEntity implements Seriali @ApiModelProperty("备注") private String remark; } +======= +package com.dite.znpt.domain.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +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.LocalDateTime; + +/** + * @author Bear.G + * @date 2025/7/23/周三 17:33 + * @description + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("equipment_use_record") +@ApiModel(value="EquipmentUseRecordEntity对象", description="设备使用记录表") +public class EquipmentUseRecordEntity extends AuditableEntity implements Serializable { + @Serial + private static final long serialVersionUID = -812107257694322222L; + + @ApiModelProperty("设备使用记录id") + @TableId(type = IdType.ASSIGN_UUID) + private String useRecordId; + + @ApiModelProperty("设备id") + private String equipmentId; + + @ApiModelProperty("用户id") + private String userId; + + @ApiModelProperty("项目id") + private String projectId; + + @ApiModelProperty("操作类型:0-借用,1-归还") + private String operateType; + + @ApiModelProperty("操作时间") + private LocalDateTime operateTime; + + @ApiModelProperty("批次id") + private String batchId; + + @ApiModelProperty("备注") + private String remark; +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/entity/ImageEntity.java b/core/src/main/java/com/dite/znpt/domain/entity/ImageEntity.java index 788a75b..7e7a994 100644 --- a/core/src/main/java/com/dite/znpt/domain/entity/ImageEntity.java +++ b/core/src/main/java/com/dite/znpt/domain/entity/ImageEntity.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.entity; import com.baomidou.mybatisplus.annotation.IdType; @@ -137,3 +138,144 @@ public class ImageEntity extends AuditableEntity implements Serializable { private String projectId; } +======= +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.LocalDateTime; + +/** + * @author Bear.G + * @date 2025/4/24/周四 13:15 + * @description + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("image") +@ApiModel(value="ImageEntity对象", description="图像信息表") +public class ImageEntity extends AuditableEntity implements Serializable { + + @Serial + private static final long serialVersionUID = -7702927820673158420L; + + @ApiModelProperty("图像id") + @TableId(value = "image_id", type = IdType.ASSIGN_UUID) + private String imageId; + + @ApiModelProperty("部件id") + @TableField("part_id") + private String partId; + + @ApiModelProperty("图像采集id") + @TableField("collect_id") + private String collectId; + + @ApiModelProperty("图像名称") + @TableField("image_name") + private String imageName; + + @ApiModelProperty("图像大小") + @TableField("image_size") + private String imageSize; + + @ApiModelProperty("图像宽") + @TableField("image_width") + private String imageWidth; + + @ApiModelProperty("图像高") + @TableField("image_height") + private String imageHeight; + + @ApiModelProperty("图像分辨率") + @TableField("image_resolution") + private String imageResolution; + + @ApiModelProperty("焦平面X轴分辨率") + @TableField("x_resolution") + private String xResolution; + + @ApiModelProperty("焦平面Y轴分辨率") + @TableField("y_resolution") + private String YResolution; + + @ApiModelProperty("焦平面分辨率单位") + @TableField("resolution_units") + private String ResolutionUnits; + + @ApiModelProperty("焦距") + @TableField("focal_distance") + private String focalDistance; + + @ApiModelProperty("35毫米焦距") + @TableField("focal_distance35") + private String focalDistance35; + + @ApiModelProperty("拍摄时间") + @TableField("shooting_time") + private LocalDateTime shootingTime; + + @ApiModelProperty("相机制造商") + @TableField("camera_manufacturer") + private String cameraManufacturer; + + @ApiModelProperty("相机型号") + @TableField("camera_model") + private String cameraModel; + + @ApiModelProperty("经度") + @TableField("longitude") + private String longitude; + + @ApiModelProperty("纬度") + @TableField("latitude") + private String latitude; + + @ApiModelProperty("海拔") + @TableField("altitude") + private String altitude; + + @ApiModelProperty("GPS") + @TableField("GPS") + private String GPS; + + @ApiModelProperty("影像类型") + @TableField("image_type") + private String imageType; + + @ApiModelProperty("影像类型描述") + @TableField("image_type_label") + private String imageTypeLabel; + + @ApiModelProperty("图片路径") + @TableField("image_path") + private String imagePath; + + @ApiModelProperty("预处理后的图片路径") + @TableField("pre_image_path") + private String preImagePath; + + @ApiModelProperty("是否已审核,0未审核,1已审核") + @TableField("review_state") + private Boolean reviewState; + + @ApiModelProperty("是否已预处理,0未审核,1已审核") + @TableField("pre_treatment") + private Boolean preTreatment; + + @ApiModelProperty("项目id") + @TableField("project_id") + private String projectId; + +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/entity/InspectionReportEntity.java b/core/src/main/java/com/dite/znpt/domain/entity/InspectionReportEntity.java index edbc9ac..d3bc198 100644 --- a/core/src/main/java/com/dite/znpt/domain/entity/InspectionReportEntity.java +++ b/core/src/main/java/com/dite/znpt/domain/entity/InspectionReportEntity.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.entity; import com.baomidou.mybatisplus.annotation.IdType; @@ -96,3 +97,103 @@ public class InspectionReportEntity extends AuditableEntity implements Serializa @TableField("report_status") private String reportStatus; } +======= +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_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; + + @ApiModelProperty("报告状态") + @TableField("report_status") + private String reportStatus; +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/entity/ModelConfigEntity.java b/core/src/main/java/com/dite/znpt/domain/entity/ModelConfigEntity.java index b001c1f..5e73cf0 100644 --- a/core/src/main/java/com/dite/znpt/domain/entity/ModelConfigEntity.java +++ b/core/src/main/java/com/dite/znpt/domain/entity/ModelConfigEntity.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.entity; import com.alibaba.excel.annotation.ExcelProperty; @@ -54,3 +55,61 @@ public class ModelConfigEntity extends AuditableEntity implements Serializable { private Float nmsThreshold; } +======= +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; +} + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/entity/OutbidInfoEntity.java b/core/src/main/java/com/dite/znpt/domain/entity/OutbidInfoEntity.java new file mode 100644 index 0000000..61230b8 --- /dev/null +++ b/core/src/main/java/com/dite/znpt/domain/entity/OutbidInfoEntity.java @@ -0,0 +1,57 @@ +package com.dite.znpt.domain.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableLogic; +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.math.BigDecimal; +import java.time.LocalDateTime; + +/** + * @author Bear.G + * @date 2025/7/28/周一 15:44 + * @description + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("outbid_info") +@ApiModel(value="OutbidInfoEntity对象", description="中标通知信息表") +public class OutbidInfoEntity extends AuditableEntity implements Serializable { + + @Serial + private static final long serialVersionUID = 6941283868242292970L; + + @ApiModelProperty("中标通知信息id") + @TableId(type = IdType.ASSIGN_UUID) + private String outbidInfoId; + + @ApiModelProperty("招标信息id") + private String biddingInfoId; + + @ApiModelProperty("中标金额,单位元,精确到分") + private BigDecimal outbidAmount; + + @ApiModelProperty("工期,单位天") + private Integer duration; + + @ApiModelProperty("中标通知日期") + private LocalDateTime outbidNotifyDate; + + @ApiModelProperty("中标通知文件") + private String outbidNoticeFileId; + + @ApiModelProperty("状态") + private String status; + + @ApiModelProperty("删除标志(0代表存在 1代表删除)") + @TableLogic(value = "0", delval = "1") + private String delFlag; +} diff --git a/core/src/main/java/com/dite/znpt/domain/entity/PartEntity.java b/core/src/main/java/com/dite/znpt/domain/entity/PartEntity.java index c5614ea..76959d3 100644 --- a/core/src/main/java/com/dite/znpt/domain/entity/PartEntity.java +++ b/core/src/main/java/com/dite/znpt/domain/entity/PartEntity.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.entity; import com.alibaba.excel.annotation.ExcelProperty; @@ -67,3 +68,74 @@ public class PartEntity extends AuditableEntity implements Serializable { private String partModel; } +======= +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.Serializable; + +/** + * @author huise23 + * @date 2025/04/11 23:17 + * @Description: 部件表实体类 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("part") +@ApiModel(value="PartEntity对象", description="部件表") +public class PartEntity extends AuditableEntity implements Serializable { + + private static final long serialVersionUID = -53853862365306266L; + + @ExcelProperty("部件id") + @ApiModelProperty("部件id") + @TableId(value = "part_id", type = IdType.ASSIGN_UUID) + private String partId; + + @ExcelProperty("机组id") + @ApiModelProperty("机组id") + @TableField("turbine_id") + private String turbineId; + + @ExcelProperty("名称") + @ApiModelProperty("名称") + @TableField("part_name") + private String partName; + + @ExcelProperty("编号") + @ApiModelProperty("编号") + @TableField("part_code") + private String partCode; + + @ExcelProperty("类型,枚举PartTypeEnum") + @ApiModelProperty("类型,枚举PartTypeEnum") + @TableField("part_type") + private String partType; + + @ExcelProperty("描述") + @ApiModelProperty("描述") + @TableField("part_desc") + private String partDesc; + + @ExcelProperty("厂商") + @ApiModelProperty("厂商") + @TableField("part_manufacturer") + private String partManufacturer; + + @ExcelProperty("型号") + @ApiModelProperty("型号") + @TableField("part_model") + private String partModel; +} + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/entity/PostEntity.java b/core/src/main/java/com/dite/znpt/domain/entity/PostEntity.java index 0071710..8bbacd8 100644 --- a/core/src/main/java/com/dite/znpt/domain/entity/PostEntity.java +++ b/core/src/main/java/com/dite/znpt/domain/entity/PostEntity.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.entity; import com.alibaba.excel.annotation.ExcelProperty; @@ -47,3 +48,54 @@ public class PostEntity extends AuditableEntity implements Serializable { @TableField("remark") private String remark; } +======= +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 Bear.G + * @date 2025/5/20/周二 9:17 + * @description + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("post") +@ApiModel(value="PostEntity对象", description="表") +public class PostEntity extends AuditableEntity implements Serializable { + @Serial + private static final long serialVersionUID = -5163882523494504223L; + + @ApiModelProperty("岗位id") + @TableId(value = "post_id", type = IdType.ASSIGN_UUID) + private String postId; + + @ApiModelProperty("岗位名称") + @TableField("post_name") + private String postName; + + @ApiModelProperty("显示顺序") + @TableField("post_sort") + private Integer postSort; + + @ApiModelProperty("状态(0正常 1停用)") + @TableField("status") + private Integer status; + + @ApiModelProperty("备注") + @TableField("remark") + private String remark; +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/entity/ProjectBudgetInfoEntity.java b/core/src/main/java/com/dite/znpt/domain/entity/ProjectBudgetInfoEntity.java index 7656d98..0cd825a 100644 --- a/core/src/main/java/com/dite/znpt/domain/entity/ProjectBudgetInfoEntity.java +++ b/core/src/main/java/com/dite/znpt/domain/entity/ProjectBudgetInfoEntity.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.entity; import com.alibaba.excel.annotation.ExcelProperty; @@ -59,3 +60,66 @@ public class ProjectBudgetInfoEntity extends AuditableEntity implements Serializ private String budgetDesc; } +======= +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/17 21:58 + * @Description: 项目预算信息表实体类 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("project_budget_info") +@ApiModel(value="ProjectBudgetInfoEntity对象", description="项目预算信息表") +public class ProjectBudgetInfoEntity extends AuditableEntity implements Serializable { + + @Serial + private static final long serialVersionUID = 514469235298737990L; + + @ExcelProperty("主键") + @ApiModelProperty("主键") + @TableId(value = "budget_id", type = IdType.ASSIGN_ID) + private String budgetId; + + @ExcelProperty("项目id") + @ApiModelProperty("项目id") + @TableField("project_id") + private String projectId; + + @ExcelProperty("预算名称") + @ApiModelProperty("预算名称") + @TableField("budget_name") + private String budgetName; + + @ExcelProperty("预算类型") + @ApiModelProperty("预算类型") + @TableField("budget_type") + private String budgetType; + + @ExcelProperty("预算金额(万元)") + @ApiModelProperty("预算金额(万元)") + @TableField("budget_amount") + private Double budgetAmount; + + @ExcelProperty("预算说明") + @ApiModelProperty("预算说明") + @TableField("budget_desc") + private String budgetDesc; +} + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/entity/ProjectDailyReportEntity.java b/core/src/main/java/com/dite/znpt/domain/entity/ProjectDailyReportEntity.java new file mode 100644 index 0000000..f995b26 --- /dev/null +++ b/core/src/main/java/com/dite/znpt/domain/entity/ProjectDailyReportEntity.java @@ -0,0 +1,52 @@ +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; +import java.time.LocalDate; + +/** + * @author huise23 + * @date 2025/07/27 19:51 + * @Description: 项目日报信息表实体类 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("project_daily_report") +@ApiModel(value="ProjectDailyReportEntity对象", description="项目日报信息表") +public class ProjectDailyReportEntity extends AuditableEntity implements Serializable { + + @Serial + private static final long serialVersionUID = -88597301057742621L; + + @ExcelProperty("主键") + @ApiModelProperty("主键") + @TableId(value = "report_id", type = IdType.ASSIGN_ID) + private String reportId; + + @ExcelProperty("项目id") + @ApiModelProperty("项目id") + @TableField("project_id") + private String projectId; + + @ExcelProperty("日报日期") + @ApiModelProperty("日报日期") + @TableField("report_date") + private LocalDate reportDate; + + @ExcelProperty("日报提交人") + @ApiModelProperty("日报提交人") + @TableField("submit_user") + private String submitUser; +} + diff --git a/core/src/main/java/com/dite/znpt/domain/entity/ProjectEntity.java b/core/src/main/java/com/dite/znpt/domain/entity/ProjectEntity.java index c044195..ce5ddfc 100644 --- a/core/src/main/java/com/dite/znpt/domain/entity/ProjectEntity.java +++ b/core/src/main/java/com/dite/znpt/domain/entity/ProjectEntity.java @@ -1,5 +1,6 @@ package com.dite.znpt.domain.entity; +<<<<<<< HEAD import java.io.Serializable; import java.time.LocalDate; import java.time.LocalDateTime; @@ -7,12 +8,26 @@ import java.time.LocalDateTime; import com.baomidou.mybatisplus.annotation.*; import com.dite.znpt.domain.AuditableEntity; import com.fasterxml.jackson.annotation.JsonFormat; +======= +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; +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f import com.fasterxml.jackson.annotation.JsonIgnore; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; +<<<<<<< HEAD import com.alibaba.excel.annotation.ExcelProperty; +======= + +import java.io.Serializable; +import java.time.LocalDate; +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f /** * @author huise23 @@ -158,7 +173,11 @@ public class ProjectEntity extends AuditableEntity implements Serializable { @ApiModelProperty(value = "开始时间") private LocalDate startDate; +<<<<<<< HEAD +======= +// 施工人员,安全经理,项目经理,商务,财务,高级管理员,项目远程顾问外部协作者,质量经理、现场经理及工作组长。 +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f @ApiModelProperty(value = "结束时间") private LocalDate endDate; } diff --git a/core/src/main/java/com/dite/znpt/domain/entity/ProjectTaskEntity.java b/core/src/main/java/com/dite/znpt/domain/entity/ProjectTaskEntity.java index 6a6ac92..3f0e499 100644 --- a/core/src/main/java/com/dite/znpt/domain/entity/ProjectTaskEntity.java +++ b/core/src/main/java/com/dite/znpt/domain/entity/ProjectTaskEntity.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.entity; import java.time.LocalDate; @@ -87,3 +88,94 @@ public class ProjectTaskEntity extends AuditableEntity implements Serializable { private String projectId; } +======= +package com.dite.znpt.domain.entity; + +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.io.Serial; +import java.io.Serializable; + +import com.baomidou.mybatisplus.annotation.*; +import com.dite.znpt.domain.AuditableEntity; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * @author huise23 + * @date 2025/06/25 21:48 + * @Description: 项目任务信息表实体类 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("project_task") +@ApiModel(value="ProjectTaskEntity对象", description="项目任务信息表") +public class ProjectTaskEntity extends AuditableEntity implements Serializable { + + @Serial + private static final long serialVersionUID = 445818156838153502L; + + @ApiModelProperty("任务id") + @TableId(value = "task_id", type = IdType.ASSIGN_ID) + private String taskId; + + @ApiModelProperty("上级任务id") + @TableField("parent_task_id") + private String parentTaskId; + + @ApiModelProperty("任务组id") + @TableField("task_group_id") + private String taskGroupId; + + @ApiModelProperty("项目任务名称") + @TableField("task_name") + private String taskName; + + @ApiModelProperty("项目任务编号") + @TableField("task_code") + private String taskCode; + + @ApiModelProperty("任务负责人id") + @TableField("main_user_id") + private String mainUserId; + + @ApiModelProperty("任务参与人id,逗号分隔") + @TableField("user_ids") + private String userIds; + + @ApiModelProperty("计划开始时间") + @TableField("plan_start_date") + private LocalDate planStartDate; + + @ApiModelProperty("计划结束时间") + @TableField("plan_end_date") + private LocalDate planEndDate; + + @ApiModelProperty("实际开始时间") + @TableField("actual_start_date") + private LocalDate actualStartDate; + + @ApiModelProperty("实际结束时间") + @TableField("actual_end_date") + private LocalDate actualEndDate; + + @ApiModelProperty("任务状态,0未开始,1进行中,2已结束") + @TableField("status") + private Integer status; + + @ApiModelProperty("是否逾期,默认未逾期") + @TableField("overdue_status") + private Integer overdueStatus; + + @ApiModelProperty("备注") + @TableField("remark") + private String remark; + + @ApiModelProperty("项目id") + @TableField("project_id") + private String projectId; +} + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/entity/ProjectTaskGroupEntity.java b/core/src/main/java/com/dite/znpt/domain/entity/ProjectTaskGroupEntity.java index 7987168..c972880 100644 --- a/core/src/main/java/com/dite/znpt/domain/entity/ProjectTaskGroupEntity.java +++ b/core/src/main/java/com/dite/znpt/domain/entity/ProjectTaskGroupEntity.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.entity; import java.time.LocalDateTime; @@ -39,3 +40,46 @@ public class ProjectTaskGroupEntity extends AuditableEntity implements Serializa private String projectId; } +======= +package com.dite.znpt.domain.entity; + +import java.time.LocalDateTime; +import java.io.Serial; +import java.io.Serializable; + +import com.baomidou.mybatisplus.annotation.*; +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; + +/** + * @author huise23 + * @date 2025/06/24 17:06 + * @Description: 项目任务组信息表实体类 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("project_task_group") +@ApiModel(value="ProjectTaskGroupEntity对象", description="项目任务组信息表") +public class ProjectTaskGroupEntity extends AuditableEntity implements Serializable { + + @Serial + private static final long serialVersionUID = -86904406809616523L; + + @ApiModelProperty("id") + @TableId(value = "group_id", type = IdType.ASSIGN_ID) + private String groupId; + + @ApiModelProperty("项目任务组名") + @TableField("group_name") + private String groupName; + + @ApiModelProperty("项目id") + @TableField("project_id") + private String projectId; +} + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/entity/RegulationTypeEntity.java b/core/src/main/java/com/dite/znpt/domain/entity/RegulationTypeEntity.java new file mode 100644 index 0000000..7d69b98 --- /dev/null +++ b/core/src/main/java/com/dite/znpt/domain/entity/RegulationTypeEntity.java @@ -0,0 +1,48 @@ +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/6/24 23:15 + * @Description: 制度类型实体类 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("regulation_type") +@ApiModel(value="RegulationTypeEntity对象", description="制度类型") +public class RegulationTypeEntity extends AuditableEntity implements Serializable { + @Serial + private static final long serialVersionUID = 3027186714895190416L; + + @ApiModelProperty("制度类型id") + @TableId(value = "regulation_type_id", type = IdType.ASSIGN_UUID) + private String regulationTypeId; + + @ApiModelProperty("制度类型名称") + @TableField("regulation_type_name") + private String regulationTypeName; + + @ApiModelProperty("状态(0正常 1禁用)") + @TableField("status") + private Integer status; + + @ApiModelProperty("备注") + @TableField("remark") + private String remark; + + @ApiModelProperty("删除标志(0代表存在 ,1代表删除)") + @TableField("del_flag") + private String delFlag; +} \ No newline at end of file diff --git a/core/src/main/java/com/dite/znpt/domain/entity/TenderInfoEntity.java b/core/src/main/java/com/dite/znpt/domain/entity/TenderInfoEntity.java new file mode 100644 index 0000000..29ad3e4 --- /dev/null +++ b/core/src/main/java/com/dite/znpt/domain/entity/TenderInfoEntity.java @@ -0,0 +1,63 @@ +package com.dite.znpt.domain.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableLogic; +import com.baomidou.mybatisplus.annotation.TableName; +import com.dite.znpt.domain.AuditableEntity; +import io.swagger.annotations.Api; +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.math.BigDecimal; + +/** + * @author Bear.G + * @date 2025/7/28/周一 15:47 + * @description + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("tender_info") +@ApiModel(value="TenderInfoEntity对象", description="投标信息表") +public class TenderInfoEntity extends AuditableEntity implements Serializable { + + @Serial + private static final long serialVersionUID = -5677009089047831619L; + + @ApiModelProperty("投标信息id") + @TableId(type = IdType.ASSIGN_UUID) + private String tenderInfoId; + + @ApiModelProperty("招标信息id") + private String biddingInfoId; + + @ApiModelProperty("投标金额") + private BigDecimal tenderAmount; + + @ApiModelProperty("项目地址") + private String projectAddress; + + @ApiModelProperty("项目类型") + private String projectType; + + @ApiModelProperty("项目描述") + private String projectDescription; + + @ApiModelProperty("投标负责人") + private String tenderManager; + + @ApiModelProperty("投标负责人手机号") + private String tenderManagerPhone; + + @ApiModelProperty("投标文件") + private String tenderFileId; + + @ApiModelProperty("删除标志(0代表存在 1代表删除)") + @TableLogic(value = "0", delval = "1") + private String delFlag; +} diff --git a/core/src/main/java/com/dite/znpt/domain/entity/VideoFileInfoEntity.java b/core/src/main/java/com/dite/znpt/domain/entity/VideoFileInfoEntity.java index 8b6a9d5..c487b52 100644 --- a/core/src/main/java/com/dite/znpt/domain/entity/VideoFileInfoEntity.java +++ b/core/src/main/java/com/dite/znpt/domain/entity/VideoFileInfoEntity.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.entity; import java.io.Serial; @@ -73,3 +74,80 @@ public class VideoFileInfoEntity extends AuditableEntity implements Serializable private String filePath; } +======= +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; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import com.alibaba.excel.annotation.ExcelProperty; + +/** + * @author huise23 + * @date 2025/06/09 09:44 + * @Description: 视频文件信息表实体类 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("video_file_info") +@ApiModel(value="VideoFileInfoEntity对象", description="视频文件信息表") +public class VideoFileInfoEntity extends AuditableEntity implements Serializable { + + @Serial + private static final long serialVersionUID = 306867911204598834L; + + @ExcelProperty("id") + @ApiModelProperty("id") + @TableId(value = "id", type = IdType.ASSIGN_ID) + private String id; + + @ExcelProperty("部件id") + @ApiModelProperty(value = "部件id",required = true) + @TableField("part_id") + private String partId; + + @ExcelProperty("测试点") + @ApiModelProperty("测试点") + @TableField("test_point") + private String testPoint; + + @ExcelProperty("作业人员id") + @ApiModelProperty("作业人员id") + @TableField("worker_user_id") + private String workerUserId; + + @ExcelProperty("拍摄时间") + @ApiModelProperty("拍摄时间") + @TableField("shooting_time") + private LocalDateTime shootingTime; + + @ExcelProperty("拍摄地点") + @ApiModelProperty("拍摄地点") + @TableField("location") + private String location; + + @ExcelProperty("是否合格,默认合格1") + @ApiModelProperty("是否合格,默认合格1") + @TableField("qualified") + private Integer qualified; + + @ExcelProperty("是否已抓帧,默认未抓帧0") + @ApiModelProperty("是否已抓帧,默认未抓帧0") + @TableField("frame_capture") + private Integer frameCapture; + + @ExcelProperty("文件保存路径") + @ApiModelProperty("文件保存路径") + @TableField("file_path") + private String filePath; +} + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/entity/WorkShiftEntity.java b/core/src/main/java/com/dite/znpt/domain/entity/WorkShiftEntity.java index 6f784ad..d5c4dc3 100644 --- a/core/src/main/java/com/dite/znpt/domain/entity/WorkShiftEntity.java +++ b/core/src/main/java/com/dite/znpt/domain/entity/WorkShiftEntity.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.entity; import com.baomidou.mybatisplus.annotation.IdType; @@ -83,3 +84,90 @@ public class WorkShiftEntity extends AuditableEntity implements Serializable { @TableField("del_flag") private String delFlag; } +======= +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.LocalTime; + +/** + * @author Bear.G + * @date 2025/6/30/周一 10:08 + * @description + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("work_shift") +@ApiModel(value="WorkShitEntity对象", description="班次信息") +public class WorkShiftEntity extends AuditableEntity implements Serializable { + @Serial + private static final long serialVersionUID = 1912356282767651959L; + + @ApiModelProperty("班次id") + @TableId(value = "work_shift_id", type = IdType.ASSIGN_UUID) + private String workShiftId; + + @ApiModelProperty("班次名称") + @TableField("work_shift_name") + private String workShiftName; + + @ApiModelProperty("上班时间") + @TableField("work_time_start") + private LocalTime workTimeStart; + + @ApiModelProperty("迟到豁免时间,单位分钟") + @TableField("late_time_offset") + private Integer lateTimeOffset; + + @ApiModelProperty("迟到时间临界值,单位分钟") + @TableField("late_time_limit") + private Integer lateTimeLimit; + + @ApiModelProperty("下班时间") + @TableField("work_time_end") + private LocalTime workTimeEnd; + + @ApiModelProperty("早退豁免时间,单位分钟") + @TableField("early_time_offset") + private Integer earlyTimeOffset; + + @ApiModelProperty("早退时间临界值,单位分钟") + @TableField("early_time_limit") + private Integer earlyTimeLimit; + + @ApiModelProperty("休息时间开始") + @TableField("rest_time_start") + private LocalTime restTimeStart; + + @ApiModelProperty("休息时间结束") + @TableField("rest_time_end") + private LocalTime restTimeEnd; + + @ApiModelProperty("工作时间长") + @TableField("work_time") + private Integer workTime; + + @ApiModelProperty("状态,0-已发布,1-未发布") + @TableField("status") + private String status; + + @ApiModelProperty("备注") + @TableField("remark") + private String remark; + + @ApiModelProperty("删除标志(0代表存在 1代表删除)") + @TableField("del_flag") + private String delFlag; +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/entity/job/DefectDTO.java b/core/src/main/java/com/dite/znpt/domain/entity/job/DefectDTO.java index d1460bb..645800b 100644 --- a/core/src/main/java/com/dite/znpt/domain/entity/job/DefectDTO.java +++ b/core/src/main/java/com/dite/znpt/domain/entity/job/DefectDTO.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.entity.job; import com.dite.znpt.annotations.MatchType; @@ -56,3 +57,63 @@ public class DefectDTO { @ApiModelProperty(value = "缺陷图片,多个逗号隔开", example = "[https://123.png]", notes = "缺陷图片,多个逗号隔开") private List flawUrlList; } +======= +package com.dite.znpt.domain.entity.job; + +import com.dite.znpt.annotations.MatchType; +import com.dite.znpt.annotations.QueryCondition; +import com.fasterxml.jackson.annotation.JsonIgnore; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.List; + +@Data +@Deprecated +public class DefectDTO { + + @ApiModelProperty(value = "缺陷详情", example = "缺陷详情", notes = "缺陷详情") + @QueryCondition(func = MatchType.like) + private String content; + + @ApiModelProperty(value = "缺陷图片", example = "123.png", notes = "缺陷图片") + @QueryCondition(func = MatchType.like) + @JsonIgnore + private String flawUrl; + + @ApiModelProperty(value = "封面图片", example = "123.png", notes = "封面图片") + @QueryCondition(func = MatchType.like) + private String coverUrl; + + @ApiModelProperty(value = "缺陷类型编码", example = "A123", notes = "缺陷类型编码") + @QueryCondition(func = MatchType.like) + private String defectTypeCode; + + @ApiModelProperty(value = "缺陷位置1", example = "GG1", notes = "缺陷位置1") + @QueryCondition(func = MatchType.like) + private String defectLocation1; + + @ApiModelProperty(value = "缺陷位置1尺寸", example = "1.5", notes = "缺陷位置1尺寸") + @QueryCondition(func = MatchType.like) + private String defectLocation1Size; + + @ApiModelProperty(value = "缺陷位置2", example = "GG1", notes = "缺陷位置2") + @QueryCondition(func = MatchType.like) + private String defectLocation2; + + @ApiModelProperty(value = "缺陷尺寸", example = "10", notes = "缺陷尺寸") + @QueryCondition(func = MatchType.like) + private String defectSize; + + @ApiModelProperty(value = "缺陷尺寸2", example = "10", notes = "缺陷尺寸2") + @QueryCondition(func = MatchType.like) + private String defectSize2; + + @ApiModelProperty(value = "缺陷等级编码", example = "aa", notes = "缺陷等级编码") + @QueryCondition(func = MatchType.equal) + private String criticalityLevelCode; + + @ApiModelProperty(value = "缺陷图片,多个逗号隔开", example = "[https://123.png]", notes = "缺陷图片,多个逗号隔开") + private List flawUrlList; +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/vo/AppImageResp.java b/core/src/main/java/com/dite/znpt/domain/vo/AppImageResp.java index 9967839..6f61778 100644 --- a/core/src/main/java/com/dite/znpt/domain/vo/AppImageResp.java +++ b/core/src/main/java/com/dite/znpt/domain/vo/AppImageResp.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.vo; import com.dite.znpt.domain.entity.ImageEntity; @@ -30,3 +31,37 @@ public class AppImageResp extends ImageEntity { @ApiModelProperty(name = "图像来源,枚举:ImageSourceEnum") private String imageSource; } +======= +package com.dite.znpt.domain.vo; + +import com.dite.znpt.domain.entity.ImageEntity; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +@EqualsAndHashCode(callSuper = true) +@Data +public class AppImageResp extends ImageEntity { + + @ApiModelProperty("部件名称") + private String partName; + + @ApiModelProperty("机组号") + private String turbineId; + + @ApiModelProperty("机组名称") + private String turbineName; + + @ApiModelProperty("项目id") + private String projectId; + + @ApiModelProperty("机组名称") + private String projectName; + + @ApiModelProperty("上传用户") + private String uploadUser; + + @ApiModelProperty(name = "图像来源,枚举:ImageSourceEnum") + private String imageSource; +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/vo/AppImageToPartReq.java b/core/src/main/java/com/dite/znpt/domain/vo/AppImageToPartReq.java index b6d0147..d7caf1f 100644 --- a/core/src/main/java/com/dite/znpt/domain/vo/AppImageToPartReq.java +++ b/core/src/main/java/com/dite/znpt/domain/vo/AppImageToPartReq.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.vo; import com.fasterxml.jackson.annotation.JsonFormat; @@ -51,3 +52,58 @@ public class AppImageToPartReq { @ApiModelProperty("采集员姓名") private String collectorName; } +======= +package com.dite.znpt.domain.vo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.time.LocalDateTime; +import java.util.List; + +@Data +public class AppImageToPartReq { + + @ApiModelProperty(value = "图片路径列表", required = true) + private List imagePaths; + + @ApiModelProperty(value = "部件id", required = true) + private String partId; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty("拍摄时间-起") + private LocalDateTime shootingTimeBegin; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty("拍摄时间-止") + private LocalDateTime shootingTimeEnd; + + @ApiModelProperty("天气,枚举:WeatherEnum") + private String weather; + + @ApiModelProperty("湿度(百分比)") + private Integer humidness; + + @ApiModelProperty("温度-低") + private Double temperatureMin; + + @ApiModelProperty("温度-高") + private Double temperatureMax; + + @ApiModelProperty("风力等级") + private Integer windLevel; + + @ApiModelProperty("拍摄方式,枚举ShootingMethodEnum") + private String shootingMethod; + + @ApiModelProperty("拍摄距离") + private Integer shootingDistance; + + @ApiModelProperty("采集员id") + private String collectorId; + + @ApiModelProperty("采集员姓名") + private String collectorName; +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/vo/AttachInfoReq.java b/core/src/main/java/com/dite/znpt/domain/vo/AttachInfoReq.java index 36c6899..b86ed96 100644 --- a/core/src/main/java/com/dite/znpt/domain/vo/AttachInfoReq.java +++ b/core/src/main/java/com/dite/znpt/domain/vo/AttachInfoReq.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.vo; import io.swagger.annotations.ApiModel; @@ -31,3 +32,41 @@ public class AttachInfoReq implements Serializable { private String remark; } +======= +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; + +/** + * @author huise23 + * @date 2025/06/25 21:59 + * @Description: 附件信息表请求类 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@ApiModel(value="AttachInfo请求对象", description="附件信息表") +public class AttachInfoReq implements Serializable { + + @Serial + private static final long serialVersionUID = -59837569061686176L; + + @ApiModelProperty("自定义路径") + private String userDefinedPath; + + @ApiModelProperty("文件名称") + private String fileName; + + @ApiModelProperty("文件类型") + private String fileType; + + @ApiModelProperty("备注") + private String remark; +} + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/vo/AttachInfoResp.java b/core/src/main/java/com/dite/znpt/domain/vo/AttachInfoResp.java index f747e2b..0d8a928 100644 --- a/core/src/main/java/com/dite/znpt/domain/vo/AttachInfoResp.java +++ b/core/src/main/java/com/dite/znpt/domain/vo/AttachInfoResp.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.vo; import com.fasterxml.jackson.annotation.JsonFormat; @@ -43,3 +44,53 @@ public class AttachInfoResp implements Serializable { private LocalDateTime createTime; } +======= +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 lombok.EqualsAndHashCode; + +import java.io.Serial; +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + * @author huise23 + * @date 2025/06/25 21:59 + * @Description: 附件信息表请求类 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@ApiModel(value="AttachInfo响应对象", description="附件信息表") +public class AttachInfoResp implements Serializable { + + @Serial + private static final long serialVersionUID = -59837569061686176L; + + @ApiModelProperty("附件id") + private String attachId; + + @ApiModelProperty("业务id") + private String businessId; + + @ApiModelProperty("附件路径") + private String attachPath; + + @ApiModelProperty("文件名称") + private String fileName; + + @ApiModelProperty("文件类型") + private String fileType; + + @ApiModelProperty("备注") + private String remark; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty + private LocalDateTime createTime; +} + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/vo/AudioFileInfoListReq.java b/core/src/main/java/com/dite/znpt/domain/vo/AudioFileInfoListReq.java index 5a2b6cd..0f488a1 100644 --- a/core/src/main/java/com/dite/znpt/domain/vo/AudioFileInfoListReq.java +++ b/core/src/main/java/com/dite/znpt/domain/vo/AudioFileInfoListReq.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.vo; import java.time.LocalDateTime; @@ -30,3 +31,37 @@ public class AudioFileInfoListReq implements Serializable { } +======= +package com.dite.znpt.domain.vo; + +import java.time.LocalDateTime; +import java.io.Serializable; +import java.util.List; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @author huise23 + * @date 2025/06/23 13:39 + * @Description: 音频文件信息请求实体 + */ +@Data +@ApiModel("音频文件信息列表请求实体") +public class AudioFileInfoListReq implements Serializable { + + private static final long serialVersionUID = -88739013562163458L; + + @ApiModelProperty("音频文件信息Id") + private String audioId; + + @ApiModelProperty("图片id") + private String imageId; + + @ApiModelProperty("图片ids") + private List imageIds; + +} + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/vo/AudioFileInfoResp.java b/core/src/main/java/com/dite/znpt/domain/vo/AudioFileInfoResp.java index 28ae794..121eee1 100644 --- a/core/src/main/java/com/dite/znpt/domain/vo/AudioFileInfoResp.java +++ b/core/src/main/java/com/dite/znpt/domain/vo/AudioFileInfoResp.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.vo; import com.alibaba.excel.annotation.ExcelProperty; @@ -30,3 +31,37 @@ public class AudioFileInfoResp { private String filePath; } +======= +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; + +/** + * @author huise23 + * @date 2025/06/23 13:39 + * @Description: 音频文件信息响应实体 + */ +@Data +@ApiModel("音频文件信息响应实体") +public class AudioFileInfoResp { + + @ExcelProperty("audioId") + @ApiModelProperty("audioId") + private String audioId; + + @ExcelProperty("图片id") + @ApiModelProperty("图片id") + private String imageId; + + @ExcelProperty("文件保存路径") + @ApiModelProperty("文件保存路径") + private String filePath; +} + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/vo/BiddingInfoReq.java b/core/src/main/java/com/dite/znpt/domain/vo/BiddingInfoReq.java new file mode 100644 index 0000000..54e5aef --- /dev/null +++ b/core/src/main/java/com/dite/znpt/domain/vo/BiddingInfoReq.java @@ -0,0 +1,69 @@ +package com.dite.znpt.domain.vo; + +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.annotation.write.style.ColumnWidth; +import com.fasterxml.jackson.annotation.JsonFormat; +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; +import java.math.BigDecimal; +import java.time.LocalDateTime; + +/** + * @author Bear.G + * @date 2025/7/28/周一 16:18 + * @description + */ +@Data +@ApiModel("招标信息请求实体") +public class BiddingInfoReq implements Serializable { + @Serial + private static final long serialVersionUID = 6967025339487392364L; + @ColumnWidth(40) + @ExcelProperty(index = 0, value = "招标项目") + @ApiModelProperty("招标项目") + @Size(max = 50, message = "招标项目不能超过50个字符") + private String biddingProject; + + @ColumnWidth(40) + @ExcelProperty(index = 1, value = "招标公司") + @ApiModelProperty("招标公司") + @Size(max = 50, message = "招标公司不能超过50个字符") + private String biddingCompany; + + @ColumnWidth(20) + @ExcelProperty(index = 2, value = "招标金额\n(单位元,精确到分)") + @ApiModelProperty("招标金额") + private BigDecimal biddingAmount; + + @ColumnWidth(30) + @ExcelProperty(index = 3, value = "招标截止时间\n(yyyy-MM-dd HH:mm:ss)") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty("招标截止时间") + private LocalDateTime biddingDeadline; + + @ColumnWidth(30) + @ExcelProperty(index = 4, value = "信息录入时间\n(yyyy-MM-dd HH:mm:ss)") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty("信息录入时间") + private LocalDateTime infoEntryTime; + + @ColumnWidth(20) + @ExcelProperty(index = 5, value = "信息来源") + @ApiModelProperty("信息来源") + @NotBlank(message = "信息来源不能为空") + @Size(max = 50, message = "信息来源不能超过50个字符") + private String source; + + @ColumnWidth(60) + @ExcelProperty(index = 6, value = "信息来源网址") + @ApiModelProperty("信息来源网址") + @NotBlank(message = "信息来源网址不能为空") + @Size(max = 100, message = "信息来源网址不能超过100个字符") + private String sourceWebsite; +} diff --git a/core/src/main/java/com/dite/znpt/domain/vo/BiddingInfoResp.java b/core/src/main/java/com/dite/znpt/domain/vo/BiddingInfoResp.java new file mode 100644 index 0000000..64a1797 --- /dev/null +++ b/core/src/main/java/com/dite/znpt/domain/vo/BiddingInfoResp.java @@ -0,0 +1,31 @@ +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 Bear.G + * @date 2025/7/28/周一 16:17 + * @description + */ +@Data +@ApiModel("招标信息响应实体") +public class BiddingInfoResp extends BiddingInfoReq implements Serializable { + @Serial + private static final long serialVersionUID = 2750666223381829115L; + + @ApiModelProperty("招标信息id") + private String biddingInfoId; + + @ApiModelProperty("文件名称") + private String fileName; + + @ApiModelProperty("招标文件地址") + private String attachPath; + + +} diff --git a/core/src/main/java/com/dite/znpt/domain/vo/CertificationListReq.java b/core/src/main/java/com/dite/znpt/domain/vo/CertificationListReq.java index 9c21619..6cce306 100644 --- a/core/src/main/java/com/dite/znpt/domain/vo/CertificationListReq.java +++ b/core/src/main/java/com/dite/znpt/domain/vo/CertificationListReq.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.vo; import io.swagger.annotations.ApiModel; @@ -27,3 +28,34 @@ public class CertificationListReq implements Serializable { @ApiModelProperty("证书类型") private String certificationType; } +======= +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 Bear.G + * @date 2025/5/27/周二 15:25 + * @description + */ +@Data +@ApiModel("人员资质列表请求实体") +public class CertificationListReq implements Serializable { + @Serial + private static final long serialVersionUID = -2663690591627122279L; + + @ApiModelProperty("姓名") + private String userName; + + @ApiModelProperty("证书名称") + private String certificationName; + + @ApiModelProperty("证书类型") + private String certificationType; +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/vo/CertificationReq.java b/core/src/main/java/com/dite/znpt/domain/vo/CertificationReq.java index 2de234b..88c0a43 100644 --- a/core/src/main/java/com/dite/znpt/domain/vo/CertificationReq.java +++ b/core/src/main/java/com/dite/znpt/domain/vo/CertificationReq.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.vo; import com.fasterxml.jackson.annotation.JsonFilter; @@ -53,3 +54,60 @@ public class CertificationReq implements Serializable { @ApiModelProperty("证书图片") private String certificationImage; } +======= +package com.dite.znpt.domain.vo; + +import com.fasterxml.jackson.annotation.JsonFilter; +import com.fasterxml.jackson.annotation.JsonFormat; +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; +import java.time.LocalDate; + +/** + * @author Bear.G + * @date 2025/5/27/周二 15:25 + * @description + */ +@Data +@ApiModel("人员资质请求实体") +public class CertificationReq implements Serializable { + @Serial + private static final long serialVersionUID = 1737569842748352413L; + + @NotBlank(message = "用户id不能为空") + @ApiModelProperty("用户id") + private String userId; + + @NotBlank(message = "证书名称不能为空") + @Size(max = 50, message = "证书名称长度不能超过50") + @ApiModelProperty("证书名称") + private String certificationName; + + @NotBlank(message = "证书编号不能为空") + @Size(max = 50, message = "证书编号长度不能超过50") + @ApiModelProperty("证书编号") + private String certificationCode; + + @NotBlank(message = "证书类型不能为空") + @ApiModelProperty("证书类型") + private String certificationType; + + @JsonFormat(pattern = "yyyy-MM-dd") + @ApiModelProperty("证书有效期-起") + private LocalDate validityDateBegin; + + @JsonFormat(pattern = "yyyy-MM-dd") + @ApiModelProperty("证书有效期-讫") + private LocalDate validityDateEnd; + + @NotBlank(message = "证书图片不能为空") + @ApiModelProperty("证书图片") + private String certificationImage; +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/vo/CertificationResp.java b/core/src/main/java/com/dite/znpt/domain/vo/CertificationResp.java index 26b3818..ae08b3b 100644 --- a/core/src/main/java/com/dite/znpt/domain/vo/CertificationResp.java +++ b/core/src/main/java/com/dite/znpt/domain/vo/CertificationResp.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.vo; import com.fasterxml.jackson.annotation.JsonFormat; @@ -52,3 +53,59 @@ public class CertificationResp implements Serializable { @ApiModelProperty("证书图片") private String certificationImage; } +======= +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 Bear.G + * @date 2025/5/27/周二 15:25 + * @description + */ +@Data +@ApiModel("人员资质响应实体") +public class CertificationResp implements Serializable { + @Serial + private static final long serialVersionUID = 4123163394817757998L; + + @ApiModelProperty("证书id") + private String certificationId; + + @ApiModelProperty("用户id") + private String userId; + + @ApiModelProperty("用户姓名") + private String userName; + + @ApiModelProperty("证书编号") + private String certificationCode; + + @ApiModelProperty("证书名称") + private String certificationName; + + @ApiModelProperty("证书类型") + private String certificationType; + + @ApiModelProperty("证书类型描述") + private String certificationTypeLabel; + + @JsonFormat(pattern = "yyyy-MM-dd") + @ApiModelProperty("证书有效期-起") + private LocalDate validityDateBegin; + + @JsonFormat(pattern = "yyyy-MM-dd") + @ApiModelProperty("证书有效期-讫") + private LocalDate validityDateEnd; + + @ApiModelProperty("证书图片") + private String certificationImage; +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/vo/ContractImportReq.java b/core/src/main/java/com/dite/znpt/domain/vo/ContractImportReq.java index 3a3d675..1867cd6 100644 --- a/core/src/main/java/com/dite/znpt/domain/vo/ContractImportReq.java +++ b/core/src/main/java/com/dite/znpt/domain/vo/ContractImportReq.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.vo; import java.math.BigDecimal; @@ -75,3 +76,82 @@ public class ContractImportReq implements Serializable { @ExcelProperty(value = "合同状态") private String contractStatus; } +======= +package com.dite.znpt.domain.vo; + +import java.math.BigDecimal; +import java.util.Date; +import java.io.Serial; +import java.io.Serializable; + +import com.baomidou.mybatisplus.annotation.*; +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; +/** + * @author huise23 + * @date 2025/07/21 21:13 + * @Description: 合同表导入请求类 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@ApiModel(value="Contract导入请求对象", description="合同表") +public class ContractImportReq implements Serializable { + + @Serial + private static final long serialVersionUID = 416194686656143643L; + + + @ExcelProperty(value = "客户名称") + private String customer; + + @ExcelProperty(value = "合同编号") + private String code; + + @ExcelProperty(value = "项目名称") + private String projectName; + + @ExcelProperty(value = "业务员名称") + private String salespersonName; + + @ExcelProperty(value = "部门名称") + private String departmentName; + + @ExcelProperty(value = "签订日期") + private Date signDate; + + @ExcelProperty(value = "期限") + private String duration; + + @ExcelProperty(value = "类型") + private String type; + + @ExcelProperty(value = "产品或服务") + private String productService; + + @ExcelProperty(value = "付款日期/交付日期") + private Date paymentDate; + + @ExcelProperty(value = "付款地址/交付地址") + private String paymentAddress; + + @ExcelProperty(value = "金额") + private BigDecimal amount; + + @ExcelProperty(value = "收款账号") + private String accountNumber; + + @ExcelProperty(value = "备注") + private String notes; + + @ExcelProperty(value = "合同状态") + private String contractStatus; +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/vo/ContractListReq.java b/core/src/main/java/com/dite/znpt/domain/vo/ContractListReq.java index ce63a67..ebf93ba 100644 --- a/core/src/main/java/com/dite/znpt/domain/vo/ContractListReq.java +++ b/core/src/main/java/com/dite/znpt/domain/vo/ContractListReq.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.vo; import java.math.BigDecimal; @@ -74,3 +75,81 @@ public class ContractListReq implements Serializable { } +======= +package com.dite.znpt.domain.vo; + +import java.math.BigDecimal; +import java.util.Date; +import java.io.Serial; +import java.io.Serializable; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @author huise23 + * @date 2025/07/21 21:13 + * @Description: 合同请求实体 + */ +@Data +@ApiModel("合同列表请求实体") +public class ContractListReq implements Serializable { + + @Serial + private static final long serialVersionUID = 188906332887614727L; + + @ApiModelProperty("查询关键字") + private String keyword; + + @ApiModelProperty("合同Id") + private String contractId; + + @ApiModelProperty("客户名称") + private String customer; + + @ApiModelProperty("合同编号") + private String code; + + @ApiModelProperty("项目id") + private String projectId; + + @ApiModelProperty("业务员id") + private String salespersonId; + + @ApiModelProperty("部门id") + private String departmentId; + + @ApiModelProperty("签订日期") + private Date signDate; + + @ApiModelProperty("期限") + private String duration; + + @ApiModelProperty("类型") + private String type; + + @ApiModelProperty("产品或服务") + private String productService; + + @ApiModelProperty("付款日期/交付日期") + private Date paymentDate; + + @ApiModelProperty("付款地址/交付地址") + private String paymentAddress; + + @ApiModelProperty("金额") + private BigDecimal amount; + + @ApiModelProperty("收款账号") + private String accountNumber; + + @ApiModelProperty("备注") + private String notes; + + @ApiModelProperty("合同状态") + private String contractStatus; + +} + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/vo/ContractReq.java b/core/src/main/java/com/dite/znpt/domain/vo/ContractReq.java index 4f36393..833391c 100644 --- a/core/src/main/java/com/dite/znpt/domain/vo/ContractReq.java +++ b/core/src/main/java/com/dite/znpt/domain/vo/ContractReq.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.vo; import java.math.BigDecimal; @@ -78,3 +79,85 @@ public class ContractReq implements Serializable { private String contractStatus; } +======= +package com.dite.znpt.domain.vo; + +import java.math.BigDecimal; +import java.util.Date; +import java.io.Serial; +import java.io.Serializable; + +import com.baomidou.mybatisplus.annotation.*; +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; +/** + * @author huise23 + * @date 2025/07/21 21:13 + * @Description: 合同表请求类 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@ApiModel(value="Contract请求对象", description="合同表") +public class ContractReq implements Serializable { + + @Serial + private static final long serialVersionUID = -42338861509205617L; + + @ApiModelProperty("合同id") + private String contractId; + + @ApiModelProperty("客户名称") + private String customer; + + @ApiModelProperty("合同编号") + private String code; + + @ApiModelProperty("项目id") + private String projectId; + + @ApiModelProperty("业务员id") + private String salespersonId; + + @ApiModelProperty("部门id") + private String departmentId; + + @ApiModelProperty("签订日期") + private Date signDate; + + @ApiModelProperty("期限") + private String duration; + + @ApiModelProperty("类型") + private String type; + + @ApiModelProperty("产品或服务") + private String productService; + + @ApiModelProperty("付款日期/交付日期") + private Date paymentDate; + + @ApiModelProperty("付款地址/交付地址") + private String paymentAddress; + + @ApiModelProperty("金额") + private BigDecimal amount; + + @ApiModelProperty("收款账号") + private String accountNumber; + + @ApiModelProperty("备注") + private String notes; + + @ApiModelProperty("合同状态") + private String contractStatus; +} + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/vo/ContractResp.java b/core/src/main/java/com/dite/znpt/domain/vo/ContractResp.java index 06da0e6..ce5795e 100644 --- a/core/src/main/java/com/dite/znpt/domain/vo/ContractResp.java +++ b/core/src/main/java/com/dite/znpt/domain/vo/ContractResp.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.vo; import java.math.BigDecimal; @@ -37,3 +38,44 @@ public class ContractResp extends ContractEntity { private BigDecimal receivedAmount; } +======= +package com.dite.znpt.domain.vo; + +import java.math.BigDecimal; +import java.util.Date; + +import com.alibaba.excel.annotation.ExcelProperty; +import com.baomidou.mybatisplus.annotation.TableField; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import com.dite.znpt.domain.entity.ContractEntity; + +/** + * @author huise23 + * @date 2025/07/21 20:29 + * @Description: 合同响应实体 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel("合同响应实体") +public class ContractResp extends ContractEntity { + + @ApiModelProperty("项目名称") + private String projectName; + + @ApiModelProperty("业务员姓名") + private String salespersonName; + + @ApiModelProperty("部门名称") + private String salespersonDeptName; + + @ApiModelProperty("已结算金额") + private BigDecimal settlementAmount; + + @ApiModelProperty("已收款金额") + private BigDecimal receivedAmount; +} + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/vo/ContractSettlementImportReq.java b/core/src/main/java/com/dite/znpt/domain/vo/ContractSettlementImportReq.java index 323d208..f252305 100644 --- a/core/src/main/java/com/dite/znpt/domain/vo/ContractSettlementImportReq.java +++ b/core/src/main/java/com/dite/znpt/domain/vo/ContractSettlementImportReq.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.vo; import java.math.BigDecimal; @@ -72,3 +73,79 @@ public class ContractSettlementImportReq implements Serializable { @ExcelProperty(value = "合同结算状态") private String settlementStatus; } +======= +package com.dite.znpt.domain.vo; + +import java.math.BigDecimal; +import java.util.Date; +import java.io.Serial; +import java.io.Serializable; + +import com.baomidou.mybatisplus.annotation.*; +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; +/** + * @author huise23 + * @date 2025/07/21 21:13 + * @Description: 合同结算表导入请求类 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@ApiModel(value="ContractSettlement导入请求对象", description="合同结算表") +public class ContractSettlementImportReq implements Serializable { + + @Serial + private static final long serialVersionUID = 148613402074177824L; + + + @ExcelProperty(value = "合同名称(不能为空,长度32以内)") + private String contractName; + + @ExcelProperty(value = "客户/供应商名称") + private String customer; + + @ExcelProperty(value = "合同结算编号") + private String code; + + @ExcelProperty(value = "项目名称") + private String projectName; + + @ExcelProperty(value = "业务员名称") + private String salespersonName; + + @ExcelProperty(value = "部门名称") + private String departmentName; + + @ExcelProperty(value = "账期") + private Date paymentPeriod; + + @ExcelProperty(value = "日期") + private Date paymentDate; + + @ExcelProperty(value = "期限") + private String duration; + + @ExcelProperty(value = "产品或服务") + private String productService; + + @ExcelProperty(value = "金额") + private BigDecimal amount; + + @ExcelProperty(value = "收款账号") + private String accountNumber; + + @ExcelProperty(value = "备注") + private String notes; + + @ExcelProperty(value = "合同结算状态") + private String settlementStatus; +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/vo/ContractSettlementListReq.java b/core/src/main/java/com/dite/znpt/domain/vo/ContractSettlementListReq.java index 9e62e57..d49a881 100644 --- a/core/src/main/java/com/dite/znpt/domain/vo/ContractSettlementListReq.java +++ b/core/src/main/java/com/dite/znpt/domain/vo/ContractSettlementListReq.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.vo; import java.math.BigDecimal; @@ -71,3 +72,78 @@ public class ContractSettlementListReq implements Serializable { } +======= +package com.dite.znpt.domain.vo; + +import java.math.BigDecimal; +import java.util.Date; +import java.io.Serial; +import java.io.Serializable; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @author huise23 + * @date 2025/07/21 21:13 + * @Description: 合同结算请求实体 + */ +@Data +@ApiModel("合同结算列表请求实体") +public class ContractSettlementListReq implements Serializable { + + @Serial + private static final long serialVersionUID = -36243842073737072L; + + @ApiModelProperty("查询关键字") + private String keyword; + + @ApiModelProperty("合同结算Id") + private String settlementId; + + @ApiModelProperty("合同id") + private String contractId; + + @ApiModelProperty("客户/供应商名称") + private String customer; + + @ApiModelProperty("合同结算编号") + private String code; + + @ApiModelProperty("项目id") + private String projectId; + + @ApiModelProperty("业务员id") + private String salespersonId; + + @ApiModelProperty("部门id") + private String departmentId; + + @ApiModelProperty("账期") + private Date paymentPeriod; + + @ApiModelProperty("日期") + private Date paymentDate; + + @ApiModelProperty("期限") + private String duration; + + @ApiModelProperty("产品或服务") + private String productService; + + @ApiModelProperty("金额") + private BigDecimal amount; + + @ApiModelProperty("收款账号") + private String accountNumber; + + @ApiModelProperty("备注") + private String notes; + + @ApiModelProperty("合同结算状态") + private String settlementStatus; + +} + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/vo/ContractSettlementReq.java b/core/src/main/java/com/dite/znpt/domain/vo/ContractSettlementReq.java index f1e5ab1..b4ea957 100644 --- a/core/src/main/java/com/dite/znpt/domain/vo/ContractSettlementReq.java +++ b/core/src/main/java/com/dite/znpt/domain/vo/ContractSettlementReq.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.vo; import java.math.BigDecimal; @@ -77,3 +78,84 @@ public class ContractSettlementReq implements Serializable { private String settlementStatus; } +======= +package com.dite.znpt.domain.vo; + +import java.math.BigDecimal; +import java.util.Date; +import java.io.Serial; +import java.io.Serializable; + +import com.baomidou.mybatisplus.annotation.*; +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; +/** + * @author huise23 + * @date 2025/07/21 21:13 + * @Description: 合同结算表请求类 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@ApiModel(value="ContractSettlement请求对象", description="合同结算表") +public class ContractSettlementReq implements Serializable { + + @Serial + private static final long serialVersionUID = -44768849127704946L; + + @ApiModelProperty("合同结算id") + private String settlementId; + + @NotBlank(groups = {ValidationGroup.Insert.class, ValidationGroup.Update.class}, message = "合同id不能为空") + @Size(groups = {ValidationGroup.Insert.class, ValidationGroup.Update.class}, max = 32, message = "合同id长度不能超过32字符") + @ApiModelProperty("合同id") + private String contractId; + + @ApiModelProperty("客户/供应商名称") + private String customer; + + @ApiModelProperty("合同结算编号") + private String code; + + @ApiModelProperty("项目id") + private String projectId; + + @ApiModelProperty("业务员id") + private String salespersonId; + + @ApiModelProperty("部门id") + private String departmentId; + + @ApiModelProperty("账期") + private Date paymentPeriod; + + @ApiModelProperty("日期") + private Date paymentDate; + + @ApiModelProperty("期限") + private String duration; + + @ApiModelProperty("产品或服务") + private String productService; + + @ApiModelProperty("金额") + private BigDecimal amount; + + @ApiModelProperty("收款账号") + private String accountNumber; + + @ApiModelProperty("备注") + private String notes; + + @ApiModelProperty("合同结算状态") + private String settlementStatus; +} + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/vo/ContractSettlementResp.java b/core/src/main/java/com/dite/znpt/domain/vo/ContractSettlementResp.java index 3b1a693..5822546 100644 --- a/core/src/main/java/com/dite/znpt/domain/vo/ContractSettlementResp.java +++ b/core/src/main/java/com/dite/znpt/domain/vo/ContractSettlementResp.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.vo; import java.math.BigDecimal; @@ -18,3 +19,25 @@ import com.dite.znpt.domain.entity.ContractSettlementEntity; public class ContractSettlementResp extends ContractSettlementEntity { } +======= +package com.dite.znpt.domain.vo; + +import java.math.BigDecimal; +import java.util.Date; +import io.swagger.annotations.ApiModel; +import lombok.Data; +import lombok.EqualsAndHashCode; +import com.dite.znpt.domain.entity.ContractSettlementEntity; + +/** + * @author huise23 + * @date 2025/07/21 21:10 + * @Description: 合同结算响应实体 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel("合同结算响应实体") +public class ContractSettlementResp extends ContractSettlementEntity { +} + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/vo/DefectMarkReq.java b/core/src/main/java/com/dite/znpt/domain/vo/DefectMarkReq.java index 4cf3c6d..298282d 100644 --- a/core/src/main/java/com/dite/znpt/domain/vo/DefectMarkReq.java +++ b/core/src/main/java/com/dite/znpt/domain/vo/DefectMarkReq.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.vo; import com.dite.znpt.util.ValidationGroup; @@ -36,3 +37,43 @@ public class DefectMarkReq implements Serializable { @ApiModelProperty("缺陷类型") private List defectTypeList; } +======= +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 defectTypeList; +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/vo/DeptReq.java b/core/src/main/java/com/dite/znpt/domain/vo/DeptReq.java index 740b529..cba811f 100644 --- a/core/src/main/java/com/dite/znpt/domain/vo/DeptReq.java +++ b/core/src/main/java/com/dite/znpt/domain/vo/DeptReq.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.vo; import com.dite.znpt.util.ValidationGroup; @@ -38,3 +39,45 @@ public class DeptReq implements Serializable { @ApiModelProperty("状态") private Integer status; } +======= +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.NotBlank; +import javax.validation.constraints.Size; +import java.io.Serial; +import java.io.Serializable; + +/** + * @author Bear.G + * @date 2025/5/20/周二 9:42 + * @description + */ +@Data +@ApiModel("部门信息请求实体") +public class DeptReq implements Serializable { + @Serial + private static final long serialVersionUID = -8058508810161877848L; + + @ApiModelProperty("父级部门id") + private String parentId; + + @NotBlank(groups = {ValidationGroup.Insert.class, ValidationGroup.Update.class}, message = "部门名称不能为空") + @Size(max = 30, groups = {ValidationGroup.Insert.class, ValidationGroup.Update.class}, message = "部门名称长度不能超过30") + @ApiModelProperty("部门名称") + private String deptName; + + @ApiModelProperty("显示顺序") + private Integer orderNum; + + @ApiModelProperty("负责人id") + private String leaderId; + + @ApiModelProperty("状态") + private Integer status; +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/vo/DeptResp.java b/core/src/main/java/com/dite/znpt/domain/vo/DeptResp.java index ba88d50..d88d834 100644 --- a/core/src/main/java/com/dite/znpt/domain/vo/DeptResp.java +++ b/core/src/main/java/com/dite/znpt/domain/vo/DeptResp.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.vo; import io.swagger.annotations.ApiModel; @@ -37,3 +38,44 @@ public class DeptResp implements Serializable { @ApiModelProperty("部门状态") private String status; } +======= +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 Bear.G + * @date 2025/5/20/周二 9:40 + * @description + */ +@Data +@ApiModel("部门信息响应实体") +public class DeptResp implements Serializable { + + @Serial + private static final long serialVersionUID = 6372397386719274915L; + + @ApiModelProperty("部门id") + private String deptId; + + @ApiModelProperty("部门名称") + private String deptName; + + @ApiModelProperty("父级部门id") + private String parentId; + + @ApiModelProperty("部门排序") + private Integer orderNum; + + @ApiModelProperty("部门负责人id") + private String leaderId; + + @ApiModelProperty("部门状态") + private String status; +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/vo/DictListReq.java b/core/src/main/java/com/dite/znpt/domain/vo/DictListReq.java index 0387f73..8c84f7e 100644 --- a/core/src/main/java/com/dite/znpt/domain/vo/DictListReq.java +++ b/core/src/main/java/com/dite/znpt/domain/vo/DictListReq.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.vo; import io.swagger.annotations.ApiModel; @@ -39,3 +40,46 @@ public class DictListReq implements Serializable { } +======= +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/06/30 11:38 + * @Description: 字典请求实体 + */ +@Data +@ApiModel("字典列表请求实体") +public class DictListReq implements Serializable { + + @Serial + private static final long serialVersionUID = 243104747131701229L; + + @ApiModelProperty("字典Id") + private String dictId; + + @ApiModelProperty("字典类型") + private String dictType; + + @ApiModelProperty("字典名称") + private String dictName; + + @ApiModelProperty("父级id") + private Long parentId; + + @ApiModelProperty("字典排序") + private Integer sortOrder; + + @ApiModelProperty("是否字典终值") + private Integer finalState; + +} + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/vo/DictReq.java b/core/src/main/java/com/dite/znpt/domain/vo/DictReq.java index 2d58bc3..5b7e328 100644 --- a/core/src/main/java/com/dite/znpt/domain/vo/DictReq.java +++ b/core/src/main/java/com/dite/znpt/domain/vo/DictReq.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.vo; import com.dite.znpt.util.ValidationGroup; @@ -46,3 +47,53 @@ public class DictReq implements Serializable { private Integer finalState; } +======= +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.NotBlank; +import javax.validation.constraints.Size; +import java.io.Serial; +import java.io.Serializable; +/** + * @author huise23 + * @date 2025/06/30 11:38 + * @Description: 字典表请求类 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@ApiModel(value="Dict请求对象", description="字典表") +public class DictReq implements Serializable { + + @Serial + private static final long serialVersionUID = 104440023555693334L; + + @ApiModelProperty("字典id") + private String dictId; + + @NotBlank(groups = {ValidationGroup.Insert.class, ValidationGroup.Update.class}, message = "字典类型不能为空") + @Size(max = 20, groups = {ValidationGroup.Insert.class, ValidationGroup.Update.class}, message = "字典类型长度不能超过20") + @ApiModelProperty("字典类型") + private String dictType; + + @NotBlank(groups = {ValidationGroup.Insert.class, ValidationGroup.Update.class}, message = "字典名称不能为空") + @Size(max = 50, groups = {ValidationGroup.Insert.class, ValidationGroup.Update.class}, message = "字典名称长度不能超过50") + @ApiModelProperty("字典名称") + private String dictName; + + @ApiModelProperty("父级id") + private Long parentId; + + @ApiModelProperty("字典排序") + private Integer sortOrder; + + @ApiModelProperty("是否字典终值") + private Integer finalState; +} + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/vo/DictResp.java b/core/src/main/java/com/dite/znpt/domain/vo/DictResp.java index b0c14df..6a3653b 100644 --- a/core/src/main/java/com/dite/znpt/domain/vo/DictResp.java +++ b/core/src/main/java/com/dite/znpt/domain/vo/DictResp.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.vo; import com.dite.znpt.domain.entity.DictEntity; @@ -16,3 +17,23 @@ import lombok.EqualsAndHashCode; public class DictResp extends DictEntity { } +======= +package com.dite.znpt.domain.vo; + +import com.dite.znpt.domain.entity.DictEntity; +import io.swagger.annotations.ApiModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * @author huise23 + * @date 2025/06/30 11:38 + * @Description: 字典响应实体 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel("字典响应实体") +public class DictResp extends DictEntity { +} + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/vo/EquipmentListReq.java b/core/src/main/java/com/dite/znpt/domain/vo/EquipmentListReq.java index 465a86c..3bcfa38 100644 --- a/core/src/main/java/com/dite/znpt/domain/vo/EquipmentListReq.java +++ b/core/src/main/java/com/dite/znpt/domain/vo/EquipmentListReq.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.vo; import io.swagger.annotations.ApiModel; @@ -27,3 +28,34 @@ public class EquipmentListReq implements Serializable { @ApiModelProperty("设备状态,0-空闲中,1-使用,3-保养中,4-维修中,5-已报废") private String equipmentStatus; } +======= +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 Bear.G + * @date 2025/7/23/周三 17:43 + * @description + */ +@Data +@ApiModel("设备信息列表请求") +public class EquipmentListReq implements Serializable { + @Serial + private static final long serialVersionUID = 2407208576252291143L; + + @ApiModelProperty("设备名称") + private String equipmentName; + + @ApiModelProperty("设备类型") + private String equipmentType; + + @ApiModelProperty("设备状态,0-空闲中,1-使用,3-保养中,4-维修中,5-已报废") + private String equipmentStatus; +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/vo/EquipmentReq.java b/core/src/main/java/com/dite/znpt/domain/vo/EquipmentReq.java index 321abe7..26c3624 100644 --- a/core/src/main/java/com/dite/znpt/domain/vo/EquipmentReq.java +++ b/core/src/main/java/com/dite/znpt/domain/vo/EquipmentReq.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.vo; import io.swagger.annotations.ApiModel; @@ -39,3 +40,46 @@ public class EquipmentReq implements Serializable { @Size(max = 50, message = "设备SN长度不能超过50个字") private String equipmentSn; } +======= +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 Bear.G + * @date 2025/7/23/周三 17:43 + * @description + */ +@Data +@ApiModel("设备信息请求对象") +public class EquipmentReq implements Serializable { + @Serial + private static final long serialVersionUID = -1065926558169771082L; + + @ApiModelProperty("设备名称") + @NotBlank(message = "设备名称不能为空") + @Size(max = 100, message = "设备名称长度不能超过100个字") + private String equipmentName; + + @ApiModelProperty("设备类型, 枚举:EquipmentTypeEnum") + @NotBlank(message = "设备类型不能为空") + private String equipmentType; + + @ApiModelProperty("设备型号") + @NotBlank(message = "设备型号不能为空") + @Size(max = 50, message = "设备型号长度不能超过50个字") + private String equipmentModel; + + @ApiModelProperty("设备SN") + @NotBlank(message = "设备SN不能为空") + @Size(max = 50, message = "设备SN长度不能超过50个字") + private String equipmentSn; +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/vo/EquipmentResp.java b/core/src/main/java/com/dite/znpt/domain/vo/EquipmentResp.java index 850ec8a..689bb96 100644 --- a/core/src/main/java/com/dite/znpt/domain/vo/EquipmentResp.java +++ b/core/src/main/java/com/dite/znpt/domain/vo/EquipmentResp.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.vo; import io.swagger.annotations.ApiModel; @@ -57,3 +58,64 @@ public class EquipmentResp implements Serializable { @ApiModelProperty("使用人") private String name; } +======= +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 Bear.G + * @date 2025/7/23/周三 17:43 + * @description + */ +@Data +@ApiModel("设备信息响应") +public class EquipmentResp implements Serializable { + @Serial + private static final long serialVersionUID = 310447373498622767L; + + @ApiModelProperty("设备ID") + private String equipmentId; + + @ApiModelProperty("设备名称") + private String equipmentName; + + @ApiModelProperty("设备类型") + private String equipmentType; + + @ApiModelProperty("设备类型描述") + private String equipmentTypeLabel; + + @ApiModelProperty("设备型号") + private String equipmentModel; + + @ApiModelProperty("设备SN") + private String equipmentSn; + + @ApiModelProperty("设备状态, 枚举:EquipmentStatusEnum") + private String equipmentStatus; + + @ApiModelProperty("设备状态描述") + private String equipmentStatusLabel; + + @ApiModelProperty("设备使用状态,0-空闲中,1-使用中") + private String useStatus; + + @ApiModelProperty("项目id") + private String projectId; + + @ApiModelProperty("项目名称") + private String projectName; + + @ApiModelProperty("使用人id") + private String userId; + + @ApiModelProperty("使用人") + private String name; +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/vo/EquipmentUseRecordListReq.java b/core/src/main/java/com/dite/znpt/domain/vo/EquipmentUseRecordListReq.java index 6270e90..f0dbc11 100644 --- a/core/src/main/java/com/dite/znpt/domain/vo/EquipmentUseRecordListReq.java +++ b/core/src/main/java/com/dite/znpt/domain/vo/EquipmentUseRecordListReq.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.vo; import io.swagger.annotations.ApiModel; @@ -31,3 +32,38 @@ public class EquipmentUseRecordListReq implements Serializable { private String remark; } +======= +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 Bear.G + * @date 2025/7/23/周三 17:44 + * @description + */ +@Data +@ApiModel("设备使用记录列表请求") +public class EquipmentUseRecordListReq implements Serializable { + @Serial + private static final long serialVersionUID = -7403000780666506211L; + + @ApiModelProperty("设备ID") + private String equipmentId; + + @ApiModelProperty("用户ID") + private String userId; + + @ApiModelProperty("项目ID") + private String projectId; + + @ApiModelProperty("备注") + private String remark; + +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/vo/EquipmentUseRecordReq.java b/core/src/main/java/com/dite/znpt/domain/vo/EquipmentUseRecordReq.java index b1749bb..acf3e32 100644 --- a/core/src/main/java/com/dite/znpt/domain/vo/EquipmentUseRecordReq.java +++ b/core/src/main/java/com/dite/znpt/domain/vo/EquipmentUseRecordReq.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.vo; import io.swagger.annotations.ApiModel; @@ -32,3 +33,39 @@ public class EquipmentUseRecordReq implements Serializable { @ApiModelProperty("备注") private String remark; } +======= +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 Bear.G + * @date 2025/7/23/周三 17:44 + * @description + */ +@Data +@ApiModel("设备使用记录请求") +public class EquipmentUseRecordReq implements Serializable { + @Serial + private static final long serialVersionUID = -6615316964696995428L; + + @ApiModelProperty("用户ID") + @NotBlank(message = "用户ID不能为空") + private String userId; + + @ApiModelProperty("项目ID") + @NotBlank(message = "项目ID不能为空") + private String projectId; + + @Size(max = 200, message = "备注长度不能超过200") + @ApiModelProperty("备注") + private String remark; +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/vo/EquipmentUseRecordResp.java b/core/src/main/java/com/dite/znpt/domain/vo/EquipmentUseRecordResp.java index d2589c6..372dd8f 100644 --- a/core/src/main/java/com/dite/znpt/domain/vo/EquipmentUseRecordResp.java +++ b/core/src/main/java/com/dite/znpt/domain/vo/EquipmentUseRecordResp.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.vo; import io.swagger.annotations.ApiModel; @@ -58,3 +59,65 @@ public class EquipmentUseRecordResp implements Serializable { @ApiModelProperty("操作时间") private LocalDateTime operateTime; } +======= +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.time.LocalDateTime; + +/** + * @author Bear.G + * @date 2025/7/23/周三 17:44 + * @description + */ +@Data +@ApiModel("设备使用记录响应") +public class EquipmentUseRecordResp implements Serializable { + @Serial + private static final long serialVersionUID = -6673311877391209692L; + + @ApiModelProperty("记录ID") + private String useRecordId; + + @ApiModelProperty("设备ID") + private String equipmentId; + + @ApiModelProperty("设备名称") + private String equipmentName; + + @ApiModelProperty("设备类型") + private String equipmentType; + + @ApiModelProperty("设备类型描述") + private String equipmentTypeLabel; + + @ApiModelProperty("设备型号") + private String equipmentModel; + + @ApiModelProperty("设备SN") + private String equipmentSn; + + @ApiModelProperty("用户ID") + private String userId; + + @ApiModelProperty("用户姓名") + private String name; + + @ApiModelProperty("项目ID") + private String projectId; + + @ApiModelProperty("项目名称") + private String projectName; + + @ApiModelProperty("操作类型:0-借用,1-归还") + private String operateType; + + @ApiModelProperty("操作时间") + private LocalDateTime operateTime; +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/vo/ImageListReq.java b/core/src/main/java/com/dite/znpt/domain/vo/ImageListReq.java index d700d3a..1497c4e 100644 --- a/core/src/main/java/com/dite/znpt/domain/vo/ImageListReq.java +++ b/core/src/main/java/com/dite/znpt/domain/vo/ImageListReq.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.vo; import io.swagger.annotations.ApiModel; @@ -34,3 +35,44 @@ public class ImageListReq implements Serializable { private Boolean reviewState; } +======= +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 Bear.G + * @date 2025/4/24/周四 14:18 + * @description + */ +@Data +@ApiModel("图像采集信息列表查询实体") +public class ImageListReq implements Serializable { + @Serial + private static final long serialVersionUID = 671014582625089979L; + + @ApiModelProperty("关键字") + private String keyword; + + @ApiModelProperty("机组id") + private String turbineId; + + @ApiModelProperty("部件id") + private String partId; + + @ApiModelProperty("项目id") + private String projectId; + + @ApiModelProperty("图像类型") + private String[] imageTypes; + + @ApiModelProperty("是否已审核,0未审核,1已审核") + private Boolean reviewState; + +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/vo/ImageResp.java b/core/src/main/java/com/dite/znpt/domain/vo/ImageResp.java index 5b32d83..340d95f 100644 --- a/core/src/main/java/com/dite/znpt/domain/vo/ImageResp.java +++ b/core/src/main/java/com/dite/znpt/domain/vo/ImageResp.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.vo; import io.swagger.annotations.ApiModel; @@ -61,3 +62,68 @@ public class ImageResp implements Serializable { @ApiModelProperty("项目id") private String projectId; } +======= +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 Bear.G + * @date 2025/4/24/周四 14:16 + * @description + */ +@Data +@ApiModel("图像信息响应实体") +public class ImageResp implements Serializable { + @Serial + private static final long serialVersionUID = -5215414858454232077L; + + @ApiModelProperty("图像id") + private String imageId; + + @ApiModelProperty("图像名称") + private String imageName; + + @ApiModelProperty("图像路径") + private String imagePath; + + @ApiModelProperty("图像大小") + private String imageSize; + + @ApiModelProperty("图像分辨率") + private String imageResolution; + + @ApiModelProperty("图像Exif信息") + private ImageExifInfo imageExifInfo; + + @ApiModelProperty("图像拍摄信息") + private ImageCollectInfo imageCollectInfo; + + @ApiModelProperty("关联图像的音频列表") + private List audioList; + + @ApiModelProperty("是否已审核,0未审核,1已审核") + private Boolean reviewState; + + @ApiModelProperty("影像类型,枚举ImageTypeEnum") + private String imageType; + + @ApiModelProperty("影像类型描述") + private String imageTypeLabel; + + @ApiModelProperty("预处理后的图片路径") + private String preImagePath; + + @ApiModelProperty("是否已预处理,0未审核,1已审核") + private Boolean preTreatment; + + @ApiModelProperty("项目id") + private String projectId; +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/vo/InspectionReportListReq.java b/core/src/main/java/com/dite/znpt/domain/vo/InspectionReportListReq.java index ba0f1cb..c17a92d 100644 --- a/core/src/main/java/com/dite/znpt/domain/vo/InspectionReportListReq.java +++ b/core/src/main/java/com/dite/znpt/domain/vo/InspectionReportListReq.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.vo; import io.swagger.annotations.ApiModel; @@ -41,3 +42,48 @@ public class InspectionReportListReq implements Serializable { } +======= +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 Bear.G + * @date 2025/7/14/周一 15:32 + * @description + */ +@Data +@ApiModel("检查报告列表请求实体") +public class InspectionReportListReq implements Serializable { + @Serial + private static final long serialVersionUID = -8122588121700840604L; + + @ApiModelProperty("主标题") + private String title; + + @ApiModelProperty("副标题") + private String subTile; + + @ApiModelProperty("项目id") + private String projectId; + + @ApiModelProperty("机组id") + private String turbineId; + + @ApiModelProperty("风场名字") + private String farmName; + + @ApiModelProperty("委托单位") + private String client; + + @ApiModelProperty("报告状态") + private String reportStatus; + + +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/vo/InspectionReportListResp.java b/core/src/main/java/com/dite/znpt/domain/vo/InspectionReportListResp.java index 9649be1..5129eb6 100644 --- a/core/src/main/java/com/dite/znpt/domain/vo/InspectionReportListResp.java +++ b/core/src/main/java/com/dite/znpt/domain/vo/InspectionReportListResp.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.vo; import com.fasterxml.jackson.annotation.JsonFormat; @@ -60,3 +61,67 @@ public class InspectionReportListResp implements Serializable { @ApiModelProperty("机组编码") private String turbineCode; } +======= +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.LocalDateTime; + +/** + * @author Bear.G + * @date 2025/7/14/周一 15:32 + * @description + */ +@Data +@ApiModel("检查报告列表响应实体") +public class InspectionReportListResp implements Serializable { + @Serial + private static final long serialVersionUID = -7652873535955803183L; + + @ApiModelProperty("报告id") + private String reportId; + + @ApiModelProperty("主标题") + private String title; + + @ApiModelProperty("副标题") + private String subTitle; + + @ApiModelProperty("报告编制人员id") + private String reportWriter; + + @ApiModelProperty("报告编制人员") + private String reportWriterName; + + @JsonFormat(pattern = "yyyy-MM-dd") + @ApiModelProperty("报告编制时间") + private LocalDateTime reportWriteTime; + + @ApiModelProperty("项目id") + private String projectId; + + @ApiModelProperty("项目名称") + private String projectName; + + @ApiModelProperty("风场名字") + private String farmName; + + @ApiModelProperty("委托单位") + private String client; + + @ApiModelProperty("机组id") + private String turbineId; + + @ApiModelProperty("机组名称") + private String turbineName; + + @ApiModelProperty("机组编码") + private String turbineCode; +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/vo/InsuranceCompanyListReq.java b/core/src/main/java/com/dite/znpt/domain/vo/InsuranceCompanyListReq.java index 0765f5e..95921fb 100644 --- a/core/src/main/java/com/dite/znpt/domain/vo/InsuranceCompanyListReq.java +++ b/core/src/main/java/com/dite/znpt/domain/vo/InsuranceCompanyListReq.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.vo; /** @@ -34,3 +35,41 @@ public class InsuranceCompanyListReq implements Serializable { @ApiModelProperty("状态,0-合作中,1-终止合作") private String status; } +======= +package com.dite.znpt.domain.vo; + +/** + * @author Bear.G + * @date 2025/6/26/周四 9:39 + * @description + */ + +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; + +@Data +@Accessors(chain = true) +@ApiModel("保险公司列表查询条件") +public class InsuranceCompanyListReq implements Serializable { + + @Serial + private static final long serialVersionUID = -3926269785176954672L; + + @ApiModelProperty("保险公司名称") + private String insuranceCompanyName; + + @ApiModelProperty("联系人") + private String contact; + + @ApiModelProperty("联系人电话") + private String contactPhone; + + @ApiModelProperty("状态,0-合作中,1-终止合作") + private String status; +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/vo/LoginReq.java b/core/src/main/java/com/dite/znpt/domain/vo/LoginReq.java index 9de9006..2de7eac 100644 --- a/core/src/main/java/com/dite/znpt/domain/vo/LoginReq.java +++ b/core/src/main/java/com/dite/znpt/domain/vo/LoginReq.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.vo; import io.swagger.annotations.ApiModel; @@ -28,3 +29,35 @@ public class LoginReq implements Serializable { @ApiModelProperty("密码,密文传输,密码加密采用aes(加密模式ECB,填充方式PKCS#7)加密传输,加密密钥产生逻辑:对账号做md5()计算,然后取值8-24位。") private String password; } +======= +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 LoginReq implements Serializable { + + @Serial + private static final long serialVersionUID = -1782729268877852765L; + + @NotBlank(message = "账号不能为空") + @ApiModelProperty("账号") + private String account; + + @NotBlank(message = "密码不能为空") + @ApiModelProperty("密码,密文传输,密码加密采用aes(加密模式ECB,填充方式PKCS#7)加密传输,加密密钥产生逻辑:对账号做md5()计算,然后取值8-24位。") + private String password; +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/vo/MenuReq.java b/core/src/main/java/com/dite/znpt/domain/vo/MenuReq.java index 536c502..535b59f 100644 --- a/core/src/main/java/com/dite/znpt/domain/vo/MenuReq.java +++ b/core/src/main/java/com/dite/znpt/domain/vo/MenuReq.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.vo; import com.alibaba.excel.annotation.ExcelProperty; @@ -61,3 +62,68 @@ public class MenuReq implements Serializable { } +======= +package com.dite.znpt.domain.vo; + +import com.alibaba.excel.annotation.ExcelProperty; +import com.baomidou.mybatisplus.annotation.TableField; +import com.dite.znpt.util.ValidationGroup; +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 Bear.G + * @date 2025/5/21/周三 12:31 + * @description + */ +@Data +@ApiModel("菜单信息请求实体") +public class MenuReq implements Serializable { + @Serial + private static final long serialVersionUID = -7141367511437222477L; + + @NotBlank(groups = {ValidationGroup.Insert.class, ValidationGroup.Update.class}, message = "菜单名称不能为空") + @Size(max = 10, message = "菜单名称不能超过10个字符") + @ApiModelProperty("菜单名称") + private String menuName; + + @ApiModelProperty("父级菜单id,父级菜单修改无效") + private String parentId; + + @ApiModelProperty("显示顺序") + private Integer orderNum; + + @Size(groups = {ValidationGroup.Insert.class, ValidationGroup.Update.class}, max = 200, message = "路由地址不能超过200个字符") + @ApiModelProperty("路由地址") + private String path; + + @Size(groups = {ValidationGroup.Insert.class, ValidationGroup.Update.class}, max = 200, message = "组件地址不能超过200个字符") + @ExcelProperty("组件地址") + @ApiModelProperty("组件地址") + private String component; + + @NotBlank(groups = {ValidationGroup.Insert.class, ValidationGroup.Update.class}, message = "菜单类型不能为空") + @ApiModelProperty("菜单类型") + private String menuType; + + @ApiModelProperty("显示状态") + private String visible; + + @Size(groups = {ValidationGroup.Insert.class, ValidationGroup.Update.class}, max = 50, message = "备注不能超过50个字符") + @ApiModelProperty("参数") + private String perms; + + @NotBlank(groups = {ValidationGroup.Insert.class, ValidationGroup.Update.class}, message = "终端类型不能为空") + @ApiModelProperty("终端类型") + private String terminalType; + + + +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/vo/MenuResp.java b/core/src/main/java/com/dite/znpt/domain/vo/MenuResp.java index c5ceae2..449b90c 100644 --- a/core/src/main/java/com/dite/znpt/domain/vo/MenuResp.java +++ b/core/src/main/java/com/dite/znpt/domain/vo/MenuResp.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.vo; import io.swagger.annotations.ApiModel; @@ -46,3 +47,53 @@ public class MenuResp implements Serializable { private String perms; } +======= +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 Bear.G + * @date 2025/5/21/周三 12:31 + * @description + */ +@Data +@ApiModel("菜单信息响应实体") +public class MenuResp implements Serializable { + @Serial + private static final long serialVersionUID = -153724438320680595L; + + @ApiModelProperty("菜单id") + private String menuId; + + @ApiModelProperty("菜单名称") + private String menuName; + + @ApiModelProperty("父级菜单id") + private String parentId; + + @ApiModelProperty("显示顺序") + private String orderNum; + + @ApiModelProperty("路由地址") + private String path; + + @ApiModelProperty("组件地址") + private String component; + + @ApiModelProperty("菜单类型") + private String menuType; + + @ApiModelProperty("显示状态") + private String visible; + + @ApiModelProperty("参数") + private String perms; + +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/vo/ModelConfigListReq.java b/core/src/main/java/com/dite/znpt/domain/vo/ModelConfigListReq.java index f42a0c6..7eb8bbe 100644 --- a/core/src/main/java/com/dite/znpt/domain/vo/ModelConfigListReq.java +++ b/core/src/main/java/com/dite/znpt/domain/vo/ModelConfigListReq.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.vo; import io.swagger.annotations.ApiModel; @@ -39,3 +40,46 @@ public class ModelConfigListReq implements Serializable { } +======= +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; + +} + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/vo/ModelConfigReq.java b/core/src/main/java/com/dite/znpt/domain/vo/ModelConfigReq.java index 7e37655..84d74b1 100644 --- a/core/src/main/java/com/dite/znpt/domain/vo/ModelConfigReq.java +++ b/core/src/main/java/com/dite/znpt/domain/vo/ModelConfigReq.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.vo; import com.dite.znpt.util.ValidationGroup; @@ -48,3 +49,55 @@ public class ModelConfigReq implements Serializable { private Float nmsThreshold; } +======= +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; +} + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/vo/ModelConfigResp.java b/core/src/main/java/com/dite/znpt/domain/vo/ModelConfigResp.java index 33d1e20..ffc4cc5 100644 --- a/core/src/main/java/com/dite/znpt/domain/vo/ModelConfigResp.java +++ b/core/src/main/java/com/dite/znpt/domain/vo/ModelConfigResp.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.vo; import com.dite.znpt.domain.entity.ModelConfigEntity; @@ -16,3 +17,23 @@ import lombok.EqualsAndHashCode; public class ModelConfigResp extends ModelConfigEntity { } +======= +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 { +} + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/vo/ModifyPasswordReq.java b/core/src/main/java/com/dite/znpt/domain/vo/ModifyPasswordReq.java index a111b11..05a139b 100644 --- a/core/src/main/java/com/dite/znpt/domain/vo/ModifyPasswordReq.java +++ b/core/src/main/java/com/dite/znpt/domain/vo/ModifyPasswordReq.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.vo; import io.swagger.annotations.ApiModel; @@ -32,3 +33,39 @@ public class ModifyPasswordReq implements Serializable { @ApiModelProperty("新密码,密文传输,密码加密采用aes(加密模式ECB,填充方式PKCS#7)加密传输,加密密钥产生逻辑:对账号做md5()计算,然后取值8-24位。") private String newPassword; } +======= +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; +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/vo/OutbidInfoReq.java b/core/src/main/java/com/dite/znpt/domain/vo/OutbidInfoReq.java new file mode 100644 index 0000000..16386fa --- /dev/null +++ b/core/src/main/java/com/dite/znpt/domain/vo/OutbidInfoReq.java @@ -0,0 +1,45 @@ +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 javax.validation.constraints.NotBlank; +import javax.validation.constraints.Size; +import java.io.Serial; +import java.io.Serializable; +import java.math.BigDecimal; +import java.time.LocalDateTime; + +/** + * @author Bear.G + * @date 2025/7/28/周一 17:05 + * @description + */ +@Data +@ApiModel("中标信息请求实体") +public class OutbidInfoReq implements Serializable { + @Serial + private static final long serialVersionUID = -1781661335173747275L; + + @ApiModelProperty("中标信息ID") + @NotBlank(message = "中标信息ID不能为空") + private String biddingInfoId; + + @ApiModelProperty("中标金额") + private BigDecimal outbidAmount; + + @ApiModelProperty("工期") + private Integer duration; + + @ApiModelProperty("中标通知日期") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime outbidNotifyDate; + + @ApiModelProperty("中标通知文件") + private String outbidNoticeFileId; + + @ApiModelProperty("状态:0-已通知,1-已签约") + private String status; +} diff --git a/core/src/main/java/com/dite/znpt/domain/vo/OutbidInfoResp.java b/core/src/main/java/com/dite/znpt/domain/vo/OutbidInfoResp.java new file mode 100644 index 0000000..bfac3a3 --- /dev/null +++ b/core/src/main/java/com/dite/znpt/domain/vo/OutbidInfoResp.java @@ -0,0 +1,35 @@ +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 Bear.G + * @date 2025/7/28/周一 17:36 + * @description + */ +@Data +@ApiModel("中标信息响应实体") +public class OutbidInfoResp extends OutbidInfoReq implements Serializable { + @Serial + private static final long serialVersionUID = -718886028432322862L; + + @ApiModelProperty("中标信息ID") + private String outbidInfoId; + + @ApiModelProperty("招标项目") + private String biddingProject; + + @ApiModelProperty("招标公司") + private String biddingCompany; + + @ApiModelProperty("文件名称") + private String fileName; + + @ApiModelProperty("中标通知文件地址") + private String attachPath; +} diff --git a/core/src/main/java/com/dite/znpt/domain/vo/PartListReq.java b/core/src/main/java/com/dite/znpt/domain/vo/PartListReq.java index 4de6e88..c74bb92 100644 --- a/core/src/main/java/com/dite/znpt/domain/vo/PartListReq.java +++ b/core/src/main/java/com/dite/znpt/domain/vo/PartListReq.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.vo; import java.io.Serializable; @@ -39,3 +40,46 @@ public class PartListReq implements Serializable { } +======= +package com.dite.znpt.domain.vo; + +import java.io.Serializable; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.experimental.Accessors; + +/** + * @author huise23 + * @date 2025/04/11 23:17 + * @Description: 请求实体 + */ +@Data +@Accessors(chain = true) +@ApiModel("部件列表请求实体") +public class PartListReq implements Serializable { + + private static final long serialVersionUID = 118135700439578757L; + + @ApiModelProperty("查询关键字") + private String keyword; + + @ApiModelProperty(name = "projectId", required = true) + private String projectId; + + @ApiModelProperty(name = "turbineId", required = true) + private String turbineId; + + @ApiModelProperty("类型,枚举PartTypeEnum") + private String partType; + + @ApiModelProperty("厂商") + private String partManufacturer; + + @ApiModelProperty("型号") + private String partModel; + +} + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/vo/PartResp.java b/core/src/main/java/com/dite/znpt/domain/vo/PartResp.java index 5dc70a8..abee29c 100644 --- a/core/src/main/java/com/dite/znpt/domain/vo/PartResp.java +++ b/core/src/main/java/com/dite/znpt/domain/vo/PartResp.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.vo; import io.swagger.annotations.ApiModel; @@ -56,3 +57,63 @@ public class PartResp implements Serializable { private String partModel; } +======= +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/04/11 23:17 + * @Description: 响应实体 + */ +@Data +@ApiModel("部件响应实体") +public class PartResp implements Serializable { + + @Serial + private static final long serialVersionUID = -4457194361289992312L; + + @ApiModelProperty("部件id") + private String partId; + + @ApiModelProperty("项目id") + private String projectId; + + @ApiModelProperty("机组") + private String projectName; + + @ApiModelProperty("机组id") + private String turbineId; + + @ApiModelProperty("机组名称") + private String turbineName; + + @ApiModelProperty("名称") + private String partName; + + @ApiModelProperty("编号") + private String partCode; + + @ApiModelProperty("类型,枚举PartTypeEnum") + private String partType; + + @ApiModelProperty("类型描述") + private String partTypeLabel; + + @ApiModelProperty("描述") + private String partDesc; + + @ApiModelProperty("厂商") + private String partManufacturer; + + @ApiModelProperty("型号") + private String partModel; +} + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/vo/PostReq.java b/core/src/main/java/com/dite/znpt/domain/vo/PostReq.java index 754da01..ee0971e 100644 --- a/core/src/main/java/com/dite/znpt/domain/vo/PostReq.java +++ b/core/src/main/java/com/dite/znpt/domain/vo/PostReq.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.vo; import com.dite.znpt.util.ValidationGroup; @@ -35,3 +36,42 @@ public class PostReq implements Serializable { @ApiModelProperty("备注") private String remark; } +======= +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.NotBlank; +import javax.validation.constraints.Size; +import java.io.Serial; +import java.io.Serializable; + +/** + * @author Bear.G + * @date 2025/5/20/周二 9:43 + * @description + */ +@Data +@ApiModel("岗位信息请求实体") +public class PostReq implements Serializable { + @Serial + private static final long serialVersionUID = -149328762675637911L; + + @NotBlank(groups = {ValidationGroup.Insert.class, ValidationGroup.Update.class}, message = "岗位名称不能为空") + @Size(max = 30, groups = {ValidationGroup.Insert.class, ValidationGroup.Update.class}, message = "岗位名称长度不能超过30个字符") + @ApiModelProperty("岗位名称") + private String postName; + + @ApiModelProperty("显示顺序") + private Integer postSort; + + @ApiModelProperty("状态(0正常 1停用)") + private Integer status; + + @ApiModelProperty("备注") + private String remark; +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/vo/PostResp.java b/core/src/main/java/com/dite/znpt/domain/vo/PostResp.java index 031e793..a04e90e 100644 --- a/core/src/main/java/com/dite/znpt/domain/vo/PostResp.java +++ b/core/src/main/java/com/dite/znpt/domain/vo/PostResp.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.vo; import io.swagger.annotations.ApiModel; @@ -36,3 +37,43 @@ public class PostResp implements Serializable { private String remark; } +======= +package com.dite.znpt.domain.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.Size; +import java.io.Serial; +import java.io.Serializable; + +/** + * @author Bear.G + * @date 2025/5/20/周二 9:42 + * @description + */ +@Data +@ApiModel("岗位信息响应实体") +public class PostResp implements Serializable { + @Serial + private static final long serialVersionUID = 8836143545716686582L; + + @ApiModelProperty("岗位id") + private String postId; + + @ApiModelProperty("岗位名称") + private String postName; + + @ApiModelProperty("显示顺序") + private Integer postSort; + + @ApiModelProperty("状态") + private String status; + + @Size(max = 200, message = "备注长度不能超过200个字符") + @ApiModelProperty("备注") + private String remark; + +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/vo/ProjectBudgetInfoListReq.java b/core/src/main/java/com/dite/znpt/domain/vo/ProjectBudgetInfoListReq.java index c557777..53777f2 100644 --- a/core/src/main/java/com/dite/znpt/domain/vo/ProjectBudgetInfoListReq.java +++ b/core/src/main/java/com/dite/znpt/domain/vo/ProjectBudgetInfoListReq.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.vo; import io.swagger.annotations.ApiModel; @@ -42,3 +43,49 @@ public class ProjectBudgetInfoListReq implements Serializable { } +======= +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/17 21:58 + * @Description: 项目预算信息请求实体 + */ +@Data +@ApiModel("项目预算信息列表请求实体") +public class ProjectBudgetInfoListReq implements Serializable { + + @Serial + private static final long serialVersionUID = 539751666379021505L; + + @ApiModelProperty("查询关键字") + private String keyword; + + @ApiModelProperty("项目预算信息Id") + private String budgetId; + + @ApiModelProperty("项目id") + private String projectId; + + @ApiModelProperty("预算名称") + private String budgetName; + + @ApiModelProperty("预算类型") + private String budgetType; + + @ApiModelProperty("预算金额(万元)") + private Double budgetAmount; + + @ApiModelProperty("预算说明") + private String budgetDesc; + +} + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/vo/ProjectBudgetInfoListResp.java b/core/src/main/java/com/dite/znpt/domain/vo/ProjectBudgetInfoListResp.java index ed6e165..055b414 100644 --- a/core/src/main/java/com/dite/znpt/domain/vo/ProjectBudgetInfoListResp.java +++ b/core/src/main/java/com/dite/znpt/domain/vo/ProjectBudgetInfoListResp.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.vo; import com.dite.znpt.domain.entity.ProjectBudgetInfoEntity; @@ -17,3 +18,24 @@ public class ProjectBudgetInfoListResp extends ProjectBudgetInfoEntity { } +======= +package com.dite.znpt.domain.vo; + +import com.dite.znpt.domain.entity.ProjectBudgetInfoEntity; +import io.swagger.annotations.ApiModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * @author huise23 + * @date 2025/07/17 21:58 + * @Description: 项目预算信息列表响应实体 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel("项目预算信息列表响应实体") +public class ProjectBudgetInfoListResp extends ProjectBudgetInfoEntity { + +} + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/vo/ProjectBudgetInfoReq.java b/core/src/main/java/com/dite/znpt/domain/vo/ProjectBudgetInfoReq.java index 7b8dfb3..6369efd 100644 --- a/core/src/main/java/com/dite/znpt/domain/vo/ProjectBudgetInfoReq.java +++ b/core/src/main/java/com/dite/znpt/domain/vo/ProjectBudgetInfoReq.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.vo; import io.swagger.annotations.ApiModel; @@ -39,3 +40,46 @@ public class ProjectBudgetInfoReq implements Serializable { private String attachId; } +======= +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; +/** + * @author huise23 + * @date 2025/07/17 21:58 + * @Description: 项目预算信息表请求类 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@ApiModel(value="ProjectBudgetInfo请求对象", description="项目预算信息表") +public class ProjectBudgetInfoReq implements Serializable { + + @Serial + private static final long serialVersionUID = 778519049897573879L; + + @ApiModelProperty("项目id") + private String projectId; + + @ApiModelProperty("预算名称") + private String budgetName; + + @ApiModelProperty("预算类型") + private String budgetType; + + @ApiModelProperty("预算金额(万元)") + private Double budgetAmount; + + @ApiModelProperty("预算说明") + private String budgetDesc; + + @ApiModelProperty("附件id") + private String attachId; +} + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/vo/ProjectBudgetInfoResp.java b/core/src/main/java/com/dite/znpt/domain/vo/ProjectBudgetInfoResp.java index a442d35..7fbc9ab 100644 --- a/core/src/main/java/com/dite/znpt/domain/vo/ProjectBudgetInfoResp.java +++ b/core/src/main/java/com/dite/znpt/domain/vo/ProjectBudgetInfoResp.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.vo; import com.dite.znpt.domain.entity.ProjectBudgetInfoEntity; @@ -20,3 +21,27 @@ public class ProjectBudgetInfoResp extends ProjectBudgetInfoEntity { private String budgetTypeDesc; } +======= +package com.dite.znpt.domain.vo; + +import com.dite.znpt.domain.entity.ProjectBudgetInfoEntity; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * @author huise23 + * @date 2025/07/17 21:58 + * @Description: 项目预算信息响应实体 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel("项目预算信息响应实体") +public class ProjectBudgetInfoResp extends ProjectBudgetInfoEntity { + + @ApiModelProperty("预算类型描述") + private String budgetTypeDesc; +} + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/vo/ProjectDailyReportListReq.java b/core/src/main/java/com/dite/znpt/domain/vo/ProjectDailyReportListReq.java new file mode 100644 index 0000000..17aff44 --- /dev/null +++ b/core/src/main/java/com/dite/znpt/domain/vo/ProjectDailyReportListReq.java @@ -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.time.LocalDate; + +/** + * @author huise23 + * @date 2025/07/27 19:51 + * @Description: 项目日报信息请求实体 + */ +@Data +@ApiModel("项目日报信息列表请求实体") +public class ProjectDailyReportListReq implements Serializable { + + @Serial + private static final long serialVersionUID = 913060537944500760L; + + @ApiModelProperty("查询关键字") + private String keyword; + + @ApiModelProperty("项目日报信息Id") + private String reportId; + + @ApiModelProperty("项目id") + private String projectId; + + @ApiModelProperty("日报日期") + private LocalDate reportDate; + + @ApiModelProperty("日报提交人") + private String submitUser; + +} + diff --git a/core/src/main/java/com/dite/znpt/domain/vo/ProjectDailyReportReq.java b/core/src/main/java/com/dite/znpt/domain/vo/ProjectDailyReportReq.java new file mode 100644 index 0000000..53b2aad --- /dev/null +++ b/core/src/main/java/com/dite/znpt/domain/vo/ProjectDailyReportReq.java @@ -0,0 +1,47 @@ +package com.dite.znpt.domain.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +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/07/27 19:51 + * @Description: 项目日报信息表请求类 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@ApiModel(value="ProjectDailyReport请求对象", description="项目日报信息表") +public class ProjectDailyReportReq implements Serializable { + + @Serial + private static final long serialVersionUID = -35936236241363317L; + + @ApiModelProperty("主键") + private String reportId; + + @NotNull(message = "项目id不能为空") + @ApiModelProperty("项目id") + private String projectId; + + @NotNull(message = "日报日期不能为空") + @ApiModelProperty("日报日期") + private LocalDate reportDate; + + @NotBlank(message = "日报提交人不能为空") + @Size(max = 32, message = "日报提交人长度不能超过32字符") + @ApiModelProperty("日报提交人") + private String submitUser; + + @NotBlank(message = "日报附件id不能为空") + @ApiModelProperty("日报附件id") + private String reportAttachId; +} + diff --git a/core/src/main/java/com/dite/znpt/domain/vo/ProjectDailyReportResp.java b/core/src/main/java/com/dite/znpt/domain/vo/ProjectDailyReportResp.java new file mode 100644 index 0000000..c41bdff --- /dev/null +++ b/core/src/main/java/com/dite/znpt/domain/vo/ProjectDailyReportResp.java @@ -0,0 +1,23 @@ +package com.dite.znpt.domain.vo; + +import com.dite.znpt.domain.entity.AttachInfoEntity; +import com.dite.znpt.domain.entity.ProjectDailyReportEntity; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * @author huise23 + * @date 2025/07/27 19:51 + * @Description: 项目日报信息响应实体 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel("项目日报信息响应实体") +public class ProjectDailyReportResp extends ProjectDailyReportEntity { + + @ApiModelProperty("日报附件") + private AttachInfoEntity reportAttach; +} + diff --git a/core/src/main/java/com/dite/znpt/domain/vo/ProjectTaskGroupListReq.java b/core/src/main/java/com/dite/znpt/domain/vo/ProjectTaskGroupListReq.java index f338798..8c778d9 100644 --- a/core/src/main/java/com/dite/znpt/domain/vo/ProjectTaskGroupListReq.java +++ b/core/src/main/java/com/dite/znpt/domain/vo/ProjectTaskGroupListReq.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.vo; import java.time.LocalDateTime; @@ -34,3 +35,41 @@ public class ProjectTaskGroupListReq implements Serializable { } +======= +package com.dite.znpt.domain.vo; + +import java.time.LocalDateTime; +import java.io.Serial; +import java.io.Serializable; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @author huise23 + * @date 2025/06/24 17:06 + * @Description: 项目任务组信息请求实体 + */ +@Data +@ApiModel("项目任务组信息列表请求实体") +public class ProjectTaskGroupListReq implements Serializable { + + @Serial + private static final long serialVersionUID = -99072074587210624L; + + @ApiModelProperty("项目任务组信息Id") + private String groupId; + + @ApiModelProperty("项目任务组名") + private String groupName; + + @ApiModelProperty("任务名称/负责人") + private String keyword; + + @ApiModelProperty("项目id") + private String projectId; + +} + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/vo/ProjectTaskGroupReq.java b/core/src/main/java/com/dite/znpt/domain/vo/ProjectTaskGroupReq.java index a08f226..0498bb7 100644 --- a/core/src/main/java/com/dite/znpt/domain/vo/ProjectTaskGroupReq.java +++ b/core/src/main/java/com/dite/znpt/domain/vo/ProjectTaskGroupReq.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.vo; import java.io.Serial; @@ -41,3 +42,48 @@ public class ProjectTaskGroupReq implements Serializable { private String projectId; } +======= +package com.dite.znpt.domain.vo; + +import java.io.Serial; +import java.io.Serializable; + +import com.baomidou.mybatisplus.annotation.*; +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.NotBlank; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; + +/** + * @author huise23 + * @date 2025/06/25 17:18 + * @Description: 项目任务组信息表请求类 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("project_task_group") +@ApiModel(value="ProjectTaskGroup请求对象", description="项目任务组信息表") +public class ProjectTaskGroupReq implements Serializable { + + @Serial + private static final long serialVersionUID = -57817993612481804L; + + @ApiModelProperty("id") + private String groupId; + + @NotBlank(groups = {ValidationGroup.Insert.class, ValidationGroup.Update.class}, message = "项目任务组名不能为空") + @Size(groups = {ValidationGroup.Insert.class, ValidationGroup.Update.class}, max = 100, message = "项目任务组名长度不能超过100字符") + @ApiModelProperty("项目任务组名") + private String groupName; + + @NotNull(groups = {ValidationGroup.Insert.class, ValidationGroup.Update.class}, message = "项目id不能为空") + @ApiModelProperty("项目id") + private String projectId; +} + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/vo/ProjectTaskGroupResp.java b/core/src/main/java/com/dite/znpt/domain/vo/ProjectTaskGroupResp.java index b7ad031..96f7517 100644 --- a/core/src/main/java/com/dite/znpt/domain/vo/ProjectTaskGroupResp.java +++ b/core/src/main/java/com/dite/znpt/domain/vo/ProjectTaskGroupResp.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.vo; import java.time.LocalDateTime; @@ -25,3 +26,32 @@ public class ProjectTaskGroupResp extends ProjectTaskGroupEntity { private String projectName; } +======= +package com.dite.znpt.domain.vo; + +import java.time.LocalDateTime; +import java.util.List; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import com.dite.znpt.domain.entity.ProjectTaskGroupEntity; + +/** + * @author huise23 + * @date 2025/06/24 16:44 + * @Description: 项目任务组信息响应实体 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel("项目任务组信息响应实体") +public class ProjectTaskGroupResp extends ProjectTaskGroupEntity { + + @ApiModelProperty("任务列表") + private List taskList; + @ApiModelProperty("项目名称") + private String projectName; +} + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/vo/ProjectTaskImportReq.java b/core/src/main/java/com/dite/znpt/domain/vo/ProjectTaskImportReq.java index 287973a..5dbb16a 100644 --- a/core/src/main/java/com/dite/znpt/domain/vo/ProjectTaskImportReq.java +++ b/core/src/main/java/com/dite/znpt/domain/vo/ProjectTaskImportReq.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.vo; import com.alibaba.excel.annotation.ExcelProperty; @@ -65,3 +66,72 @@ public class ProjectTaskImportReq implements Serializable { @ApiModelProperty("项目id") private String projectId; } +======= +package com.dite.znpt.domain.vo; + +import com.alibaba.excel.annotation.ExcelProperty; +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; +/** + * @author huise23 + * @date 2025/06/27 14:21 + * @Description: 项目任务信息表导入请求类 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@ApiModel(value="ProjectTask导入请求对象", description="项目任务信息表") +public class ProjectTaskImportReq implements Serializable { + + @Serial + private static final long serialVersionUID = -86440098932860558L; + + + @ExcelProperty(value = "上级任务名称") + private String parentTaskName; + + @ExcelProperty(value = "任务组名称(不能为空,长度32以内)") + private String taskGroupName; + + @ExcelProperty(value = "项目任务名称(不能为空,长度100以内)") + private String taskName; + + @ExcelProperty(value = "项目任务编号(不能为空,长度100以内)") + private String taskCode; + + @ExcelProperty(value = "任务负责人名称(不能为空,长度100以内)") + private String mainUserName; + + @ExcelProperty(value = "任务参与人名称,逗号分隔") + private String userName; + + @ExcelProperty(value = "计划开始时间(不能为空)") + private LocalDate planStartDate; + + @ExcelProperty(value = "计划结束时间(不能为空)") + private LocalDate planEndDate; + + @ExcelProperty(value = "实际开始时间") + private LocalDate actualStartDate; + + @ExcelProperty(value = "实际结束时间") + private LocalDate actualEndDate; + + @ExcelProperty(value = "任务状态(未开始,进行中,已结束)") + private String status; + + @ExcelProperty(value = "是否逾期(已逾期,未逾期)") + private String overdueStatus; + + @ExcelProperty(value = "备注") + private String remark; + + @ApiModelProperty("项目id") + private String projectId; +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/vo/ProjectTaskListReq.java b/core/src/main/java/com/dite/znpt/domain/vo/ProjectTaskListReq.java index 187301c..c3fb5c1 100644 --- a/core/src/main/java/com/dite/znpt/domain/vo/ProjectTaskListReq.java +++ b/core/src/main/java/com/dite/znpt/domain/vo/ProjectTaskListReq.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.vo; import java.time.LocalDate; @@ -73,3 +74,80 @@ public class ProjectTaskListReq implements Serializable { private String userId; } +======= +package com.dite.znpt.domain.vo; + +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.io.Serial; +import java.io.Serializable; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @author huise23 + * @date 2025/06/25 17:31 + * @Description: 项目任务信息请求实体 + */ +@Data +@ApiModel("项目任务信息列表请求实体") +public class ProjectTaskListReq implements Serializable { + + @Serial + private static final long serialVersionUID = 971346092554199471L; + + @ApiModelProperty("查询关键字") + private String keyword; + + @ApiModelProperty("项目任务信息Id") + private String taskId; + + @ApiModelProperty("任务组id") + private String taskGroupId; + + @ApiModelProperty("项目任务名称") + private String taskName; + + @ApiModelProperty("项目任务编号") + private String taskCode; + + @ApiModelProperty("任务负责人id") + private String mainUserId; + + @ApiModelProperty("任务参与人id,逗号分隔") + private String userIds; + + @ApiModelProperty("计划开始时间") + private LocalDate planStartDate; + + @ApiModelProperty("计划结束时间") + private LocalDate planEndDate; + + @ApiModelProperty("实际开始时间") + private LocalDate actualStartDate; + + @ApiModelProperty("实际结束时间") + private LocalDate actualEndDate; + + @ApiModelProperty("任务状态,0未开始,1进行中,2已结束") + private Integer status; + + @ApiModelProperty("是否逾期,默认未逾期") + private Integer overdueStatus; + + @ApiModelProperty("任务名称/负责人名称") + private String taskNameOrMainUser; + + @ApiModelProperty(value = "导出?", hidden = true) + private Boolean isExport; + + @ApiModelProperty("项目id") + private String projectId; + + @ApiModelProperty(value = "用户id", hidden = true) + private String userId; +} + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/vo/ProjectTaskReq.java b/core/src/main/java/com/dite/znpt/domain/vo/ProjectTaskReq.java index c4439d1..730d7f5 100644 --- a/core/src/main/java/com/dite/znpt/domain/vo/ProjectTaskReq.java +++ b/core/src/main/java/com/dite/znpt/domain/vo/ProjectTaskReq.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.vo; import com.dite.znpt.util.ValidationGroup; @@ -86,3 +87,93 @@ public class ProjectTaskReq implements Serializable { private String projectId; } +======= +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.NotBlank; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; +import java.io.Serial; +import java.io.Serializable; +import java.time.LocalDate; +import java.util.List; +/** + * @author huise23 + * @date 2025/06/25 21:48 + * @Description: 项目任务信息表请求类 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@ApiModel(value="ProjectTask请求对象", description="项目任务信息表") +public class ProjectTaskReq implements Serializable { + + @Serial + private static final long serialVersionUID = 899180318567127648L; + + @ApiModelProperty("任务id") + private String taskId; + + @ApiModelProperty("上级任务id") + private String parentTaskId; + + @NotBlank(groups = {ValidationGroup.Insert.class, ValidationGroup.Update.class}, message = "任务组id不能为空") + @Size(groups = {ValidationGroup.Insert.class, ValidationGroup.Update.class}, max = 32, message = "任务组id长度不能超过32字符") + @ApiModelProperty("任务组id") + private String taskGroupId; + + @NotBlank(groups = {ValidationGroup.Insert.class, ValidationGroup.Update.class}, message = "项目任务名称不能为空") + @Size(groups = {ValidationGroup.Insert.class, ValidationGroup.Update.class}, max = 100, message = "项目任务名称长度不能超过100字符") + @ApiModelProperty("项目任务名称") + private String taskName; + + @NotBlank(groups = {ValidationGroup.Insert.class, ValidationGroup.Update.class}, message = "项目任务编号不能为空") + @Size(groups = {ValidationGroup.Insert.class, ValidationGroup.Update.class}, max = 100, message = "项目任务编号长度不能超过100字符") + @ApiModelProperty("项目任务编号") + private String taskCode; + + @NotBlank(groups = {ValidationGroup.Insert.class, ValidationGroup.Update.class}, message = "任务负责人id不能为空") + @Size(groups = {ValidationGroup.Insert.class, ValidationGroup.Update.class}, max = 100, message = "任务负责人id长度不能超过100字符") + @ApiModelProperty("任务负责人id") + private String mainUserId; + + @ApiModelProperty("任务参与人id,逗号分隔") + private String userIds; + + @NotNull(groups = {ValidationGroup.Insert.class, ValidationGroup.Update.class}, message = "计划开始时间不能为空") + @ApiModelProperty("计划开始时间") + private LocalDate planStartDate; + + @NotNull(groups = {ValidationGroup.Insert.class, ValidationGroup.Update.class}, message = "计划结束时间不能为空") + @ApiModelProperty("计划结束时间") + private LocalDate planEndDate; + + @ApiModelProperty("实际开始时间") + private LocalDate actualStartDate; + + @ApiModelProperty("实际结束时间") + private LocalDate actualEndDate; + + @ApiModelProperty("任务状态,0未开始,1进行中,2已结束") + private Integer status; + + @ApiModelProperty("是否逾期,默认未逾期") + private Integer overdueStatus; + + @ApiModelProperty("附件列表") + private List attachFileIds; + + @ApiModelProperty("备注") + private String remark; + + @NotNull(groups = {ValidationGroup.Insert.class, ValidationGroup.Update.class}, message = "项目id不能为空") + @ApiModelProperty("项目id") + private String projectId; +} + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/vo/ProjectTaskResp.java b/core/src/main/java/com/dite/znpt/domain/vo/ProjectTaskResp.java index 05271f7..63d6271 100644 --- a/core/src/main/java/com/dite/znpt/domain/vo/ProjectTaskResp.java +++ b/core/src/main/java/com/dite/znpt/domain/vo/ProjectTaskResp.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.vo; import java.time.LocalDate; @@ -27,3 +28,34 @@ public class ProjectTaskResp extends ProjectTaskEntity { private String projectName; } +======= +package com.dite.znpt.domain.vo; + +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.util.List; + +import com.dite.znpt.domain.entity.AttachInfoEntity; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import com.dite.znpt.domain.entity.ProjectTaskEntity; + +/** + * @author huise23 + * @date 2025/06/25 21:48 + * @Description: 项目任务信息响应实体 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel("项目任务信息响应实体") +public class ProjectTaskResp extends ProjectTaskEntity { + + @ApiModelProperty("附件列表") + private List attachList; + @ApiModelProperty("项目名称") + private String projectName; +} + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/vo/ProjectTaskStartReq.java b/core/src/main/java/com/dite/znpt/domain/vo/ProjectTaskStartReq.java index e83a1b4..af940ce 100644 --- a/core/src/main/java/com/dite/znpt/domain/vo/ProjectTaskStartReq.java +++ b/core/src/main/java/com/dite/znpt/domain/vo/ProjectTaskStartReq.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.vo; import com.baomidou.mybatisplus.annotation.TableName; @@ -35,3 +36,42 @@ public class ProjectTaskStartReq implements Serializable { private String taskGroupId; } +======= +package com.dite.znpt.domain.vo; + +import com.baomidou.mybatisplus.annotation.TableName; +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.Max; +import javax.validation.constraints.Min; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.Size; +import java.io.Serial; +import java.io.Serializable; +import java.time.LocalDate; + +/** + * @author huise23 + * @date 2025/06/25 17:31 + * @Description: 项目任务信息表请求类 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@ApiModel(value="ProjectTask开始/结束任务请求对象", description="项目任务信息表") +public class ProjectTaskStartReq implements Serializable { + + @Serial + private static final long serialVersionUID = 862660085007390976L; + + @ApiModelProperty("任务id") + private String taskId; + + @ApiModelProperty("任务组id") + private String taskGroupId; +} + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/vo/RegulationTypeReq.java b/core/src/main/java/com/dite/znpt/domain/vo/RegulationTypeReq.java new file mode 100644 index 0000000..ebe1aab --- /dev/null +++ b/core/src/main/java/com/dite/znpt/domain/vo/RegulationTypeReq.java @@ -0,0 +1,36 @@ +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/6/24 23:44 + * @Description: 制度类型请求实体 + */ +@Data +@Accessors(chain = true) +@ApiModel("制度类型请求实体") +public class RegulationTypeReq implements Serializable { + @Serial + private static final long serialVersionUID = -47047804822030641L; + + @NotBlank(message = "制度类型名称不能为空") + @Size(max = 50, message = "制度类型名称不能超过50个字符") + @ApiModelProperty("制度类型名称") + private String regulationTypeName; + + @ApiModelProperty("状态(0正常 1禁用)") + private Integer status; + + @Size(max = 200, message = "备注信息不能超过200个字符") + @ApiModelProperty("备注信息") + private String remark; +} \ No newline at end of file diff --git a/core/src/main/java/com/dite/znpt/domain/vo/RegulationTypeResp.java b/core/src/main/java/com/dite/znpt/domain/vo/RegulationTypeResp.java new file mode 100644 index 0000000..d6093c2 --- /dev/null +++ b/core/src/main/java/com/dite/znpt/domain/vo/RegulationTypeResp.java @@ -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 java.io.Serial; +import java.io.Serializable; + +/** + * @Author: gaoxiong + * @Date: 2025/6/24 23:46 + * @Description: 制度类型响应实体 + */ +@Data +@Accessors(chain = true) +@ApiModel("制度类型响应实体") +public class RegulationTypeResp implements Serializable { + @Serial + private static final long serialVersionUID = -2745493272695038596L; + + @ApiModelProperty("制度类型id") + private String regulationTypeId; + + @ApiModelProperty("制度类型名称") + private String regulationTypeName; + + @ApiModelProperty("状态(0正常 1禁用)") + private Integer status; + + @ApiModelProperty("状态描述") + private String statusDesc; + + @ApiModelProperty("备注信息") + private String remark; +} \ No newline at end of file diff --git a/core/src/main/java/com/dite/znpt/domain/vo/RoleMenuReq.java b/core/src/main/java/com/dite/znpt/domain/vo/RoleMenuReq.java index 84c852a..07cd16f 100644 --- a/core/src/main/java/com/dite/znpt/domain/vo/RoleMenuReq.java +++ b/core/src/main/java/com/dite/znpt/domain/vo/RoleMenuReq.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.vo; import com.dite.znpt.util.ValidationGroup; @@ -30,3 +31,37 @@ public class RoleMenuReq implements Serializable { @ApiModelProperty(value = "菜单id", required = true) private List menuIds; } +======= +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.NotBlank; +import javax.validation.constraints.NotEmpty; +import java.io.Serial; +import java.io.Serializable; +import java.util.List; + +/** + * @author Bear.G + * @date 2025/5/21/周三 17:33 + * @description + */ +@Data +@ApiModel("角色菜单绑定请求实体") +public class RoleMenuReq implements Serializable { + @Serial + private static final long serialVersionUID = -7759529835730562338L; + + @NotBlank(groups = {ValidationGroup.Insert.class, ValidationGroup.Update.class}, message = "角色id不能为空") + @ApiModelProperty(value = "角色id", required = true) + private String roleId; + + @NotEmpty(groups = {ValidationGroup.Insert.class, ValidationGroup.Update.class}, message = "菜单id不能为空") + @ApiModelProperty(value = "菜单id", required = true) + private List menuIds; +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/vo/RoleReq.java b/core/src/main/java/com/dite/znpt/domain/vo/RoleReq.java index 62267f9..9a39840 100644 --- a/core/src/main/java/com/dite/znpt/domain/vo/RoleReq.java +++ b/core/src/main/java/com/dite/znpt/domain/vo/RoleReq.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.vo; import com.dite.znpt.util.ValidationGroup; @@ -43,3 +44,50 @@ public class RoleReq implements Serializable { @ApiModelProperty("备注") private String remark; } +======= +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.NotBlank; +import javax.validation.constraints.Size; +import java.io.Serial; +import java.io.Serializable; + +/** + * @author Bear.G + * @date 2025/5/21/周三 12:29 + * @description + */ +@Data +@ApiModel("角色信息请求实体") +public class RoleReq implements Serializable { + @Serial + private static final long serialVersionUID = -4581059117664119614L; + + @NotBlank(groups = {ValidationGroup.Insert.class, ValidationGroup.Update.class}, message = "角色名称不能为空") + @Size(max = 30, message = "角色名称不能超过30个字符") + @ApiModelProperty("角色名称") + private String roleName; + + @NotBlank(groups = {ValidationGroup.Insert.class, ValidationGroup.Update.class}, message = "角色编码不能为空") + @Size(max = 20, message = "角色编码不能超过20个字符") + @ApiModelProperty("角色编码") + private String roleCode; + + @NotBlank(groups = {ValidationGroup.Insert.class}, message = "角色权限字符不能为空") + @Size(groups = {ValidationGroup.Insert.class}, max = 20, message = "角色权限字符不能超过20个字符") + @ApiModelProperty("角色权限字符") + private String roleKey; + + @ApiModelProperty("状态") + private Integer status; + + @Size(groups = {ValidationGroup.Insert.class, ValidationGroup.Update.class}, max = 200, message = "备注不能超过200个字符") + @ApiModelProperty("备注") + private String remark; +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/vo/RoleResp.java b/core/src/main/java/com/dite/znpt/domain/vo/RoleResp.java index 1bf3278..c384256 100644 --- a/core/src/main/java/com/dite/znpt/domain/vo/RoleResp.java +++ b/core/src/main/java/com/dite/znpt/domain/vo/RoleResp.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.vo; import io.swagger.annotations.ApiModel; @@ -37,3 +38,44 @@ public class RoleResp implements Serializable { @ApiModelProperty("备注") private String remark; } +======= +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 Bear.G + * @date 2025/5/21/周三 12:26 + * @description + */ +@Data +@ApiModel("角色信息响应实体") +public class RoleResp implements Serializable { + + @Serial + private static final long serialVersionUID = -144489103121775926L; + + @ApiModelProperty("角色id") + private String roleId; + + @ApiModelProperty("角色名称") + private String roleName; + + @ApiModelProperty("角色编码") + private String roleCode; + + @ApiModelProperty("角色权限字符") + private String roleKey; + + @ApiModelProperty("状态") + private String status; + + @ApiModelProperty("备注") + private String remark; +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/vo/TConstructionReq.java b/core/src/main/java/com/dite/znpt/domain/vo/TConstructionReq.java index 89e196b..e967f67 100644 --- a/core/src/main/java/com/dite/znpt/domain/vo/TConstructionReq.java +++ b/core/src/main/java/com/dite/znpt/domain/vo/TConstructionReq.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.vo; import io.swagger.annotations.ApiModel; @@ -55,3 +56,62 @@ public class TConstructionReq implements Serializable { private LocalDateTime createdAt; } +======= +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; +} + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/vo/TenderInfoReq.java b/core/src/main/java/com/dite/znpt/domain/vo/TenderInfoReq.java new file mode 100644 index 0000000..30f7f53 --- /dev/null +++ b/core/src/main/java/com/dite/znpt/domain/vo/TenderInfoReq.java @@ -0,0 +1,53 @@ +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; +import java.math.BigDecimal; + +/** + * @author Bear.G + * @date 2025/7/28/周一 16:23 + * @description + */ +@Data +@ApiModel("投标信息请求实体") +public class TenderInfoReq implements Serializable { + @Serial + private static final long serialVersionUID = -5653933337345116548L; + + @ApiModelProperty("招标信息id") + @NotBlank(message = "招标信息id不能为空") + private String biddingInfoId; + + @ApiModelProperty("投标金额") + private BigDecimal tenderAmount; + + @ApiModelProperty("项目地址") + @Size(max = 500, message = "项目地址不能超过500个字符") + private String projectAddress; + + @ApiModelProperty("项目类型,枚举:ProjectTypeEnum") + private String projectType; + + @ApiModelProperty("招标负责人") + @Size(min = 32, max = 32, message = "招标负责人长度必须为32个字符") + private String tenderManager; + + @Size(min = 11, max = 11, message = "招标负责人联系方式长度必须为11个字符") + @ApiModelProperty("招标负责人联系方式") + private String tenderManagerPhone; + + @ApiModelProperty("投标文件") + private String tenderFileId; + + @Size(max = 500, message = "项目描述不能超过500个字符") + @ApiModelProperty("项目描述") + private String projectDescription; + +} diff --git a/core/src/main/java/com/dite/znpt/domain/vo/TenderInfoResp.java b/core/src/main/java/com/dite/znpt/domain/vo/TenderInfoResp.java new file mode 100644 index 0000000..97e8028 --- /dev/null +++ b/core/src/main/java/com/dite/znpt/domain/vo/TenderInfoResp.java @@ -0,0 +1,45 @@ +package com.dite.znpt.domain.vo; + +/** + * @author Bear.G + * @date 2025/7/28/周一 16:50 + * @description + */ + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serial; +import java.io.Serializable; + +/** + * @author Bear.G + * @date 2025/7/28/周一 16:49 + * @description + */ +@Data +@ApiModel("投标信息响应实体") +public class TenderInfoResp extends TenderInfoReq implements Serializable { + @Serial + private static final long serialVersionUID = -8445413467535624096L; + + @ApiModelProperty("投标标信息ID") + private String tenderInfoId; + + @ApiModelProperty("招标项目") + private String biddingProject; + + @ApiModelProperty("招标公司") + private String biddingCompany; + + @ApiModelProperty("文件名称") + private String fileName; + + @ApiModelProperty("投标文件地址") + private String attachPath; + + @ApiModelProperty("投标负责人姓名") + private String tenderManagerName; + +} \ No newline at end of file diff --git a/core/src/main/java/com/dite/znpt/domain/vo/UserInfo.java b/core/src/main/java/com/dite/znpt/domain/vo/UserInfo.java index 8096927..464847f 100644 --- a/core/src/main/java/com/dite/znpt/domain/vo/UserInfo.java +++ b/core/src/main/java/com/dite/znpt/domain/vo/UserInfo.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.vo; import io.swagger.annotations.ApiModel; @@ -32,3 +33,39 @@ public class UserInfo implements Serializable { @ApiModelProperty("角色信息") private List roles; } +======= +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 Bear.G + * @date 2025/5/23/周五 14:54 + * @description + */ +@Data +@ApiModel("用户信息") +public class UserInfo implements Serializable { + + @Serial + private static final long serialVersionUID = 1433874497843073028L; + + @ApiModelProperty("用户信息") + private UserListResp user; + + @ApiModelProperty("部门信息") + private DeptResp dept; + + @ApiModelProperty("岗位信息") + private List posts; + + @ApiModelProperty("角色信息") + private List roles; +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/vo/UserRoleReq.java b/core/src/main/java/com/dite/znpt/domain/vo/UserRoleReq.java index 16fc3c0..75260ff 100644 --- a/core/src/main/java/com/dite/znpt/domain/vo/UserRoleReq.java +++ b/core/src/main/java/com/dite/znpt/domain/vo/UserRoleReq.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.vo; import com.dite.znpt.util.ValidationGroup; @@ -32,3 +33,39 @@ public class UserRoleReq implements Serializable { @ApiModelProperty("角色id") private List roleIds; } +======= +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.experimental.Accessors; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotEmpty; +import java.io.Serial; +import java.io.Serializable; +import java.util.List; + +/** + * @author Bear.G + * @date 2025/5/21/周三 17:41 + * @description + */ +@Data +@Accessors(chain = true) +@ApiModel("用户角色绑定请求实体") +public class UserRoleReq implements Serializable { + @Serial + private static final long serialVersionUID = -1334908025320245685L; + + @NotBlank(groups = {ValidationGroup.Insert.class, ValidationGroup.Update.class}, message = "用户id不能为空") + @ApiModelProperty("用户id") + private String userId; + + @NotEmpty(groups = {ValidationGroup.Insert.class, ValidationGroup.Update.class}, message = "角色id不能为空") + @ApiModelProperty("角色id") + private List roleIds; +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/vo/VideoFileInfoListReq.java b/core/src/main/java/com/dite/znpt/domain/vo/VideoFileInfoListReq.java index 931741c..40341b3 100644 --- a/core/src/main/java/com/dite/znpt/domain/vo/VideoFileInfoListReq.java +++ b/core/src/main/java/com/dite/znpt/domain/vo/VideoFileInfoListReq.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.vo; import java.time.LocalDateTime; @@ -47,3 +48,54 @@ public class VideoFileInfoListReq implements Serializable { } +======= +package com.dite.znpt.domain.vo; + +import java.time.LocalDateTime; +import java.io.Serializable; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @author huise23 + * @date 2025/06/09 09:44 + * @Description: 视频文件信息请求实体 + */ +@Data +@ApiModel("视频文件信息列表请求实体") +public class VideoFileInfoListReq implements Serializable { + + private static final long serialVersionUID = 499752243735301115L; + + @ApiModelProperty("查询关键字") + private String keyword; + + @ApiModelProperty("视频文件信息Id") + private String id; + + @ApiModelProperty("机组id") + private String partId; + + @ApiModelProperty("测试点") + private String testPoint; + + @ApiModelProperty("作业人员id") + private String workerUserId; + + @ApiModelProperty("拍摄时间") + private LocalDateTime shootingTime; + + @ApiModelProperty("拍摄地点") + private String location; + + @ApiModelProperty("是否合格,默认合格1") + private Integer qualified; + + @ApiModelProperty("是否已抓帧,默认未抓帧0") + private Integer frameCapture; + +} + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/vo/VideoFileInfoReq.java b/core/src/main/java/com/dite/znpt/domain/vo/VideoFileInfoReq.java index a04b3b9..f057e88 100644 --- a/core/src/main/java/com/dite/znpt/domain/vo/VideoFileInfoReq.java +++ b/core/src/main/java/com/dite/znpt/domain/vo/VideoFileInfoReq.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.vo; import io.swagger.annotations.ApiModel; @@ -41,3 +42,48 @@ public class VideoFileInfoReq implements Serializable { @ApiModelProperty("是否合格,默认合格1") private Integer qualified; } +======= +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; +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + * @author cuizhibin + * @date 2025/06/23 11:04 + * @description 视频文件信息要求 + */ +@Data +@ApiModel("视频文件请求实体") +public class VideoFileInfoReq implements Serializable { + @Serial + private static final long serialVersionUID = 1737569842748352413L; + + @NotBlank(message = "部件id不能为空") + @ApiModelProperty(value = "部件id",required = true) + private String partId; + + @ApiModelProperty("测试点") + private String testPoint; + + @ApiModelProperty("作业人员id") + private String workerUserId; + + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty("拍摄时间") + private LocalDateTime shootingTime; + + @ApiModelProperty("拍摄地点") + private String location; + + @ApiModelProperty("是否合格,默认合格1") + private Integer qualified; +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/vo/VideoFileInfoResp.java b/core/src/main/java/com/dite/znpt/domain/vo/VideoFileInfoResp.java index 76b7a80..449f834 100644 --- a/core/src/main/java/com/dite/znpt/domain/vo/VideoFileInfoResp.java +++ b/core/src/main/java/com/dite/znpt/domain/vo/VideoFileInfoResp.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.vo; import java.time.LocalDateTime; @@ -17,3 +18,24 @@ import com.dite.znpt.domain.entity.VideoFileInfoEntity; public class VideoFileInfoResp extends VideoFileInfoEntity { } +======= +package com.dite.znpt.domain.vo; + +import java.time.LocalDateTime; +import io.swagger.annotations.ApiModel; +import lombok.Data; +import lombok.EqualsAndHashCode; +import com.dite.znpt.domain.entity.VideoFileInfoEntity; + +/** + * @author huise23 + * @date 2025/06/09 09:45 + * @Description: 视频文件信息响应实体 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel("视频文件信息响应实体") +public class VideoFileInfoResp extends VideoFileInfoEntity { +} + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/vo/WorkShiftListResp.java b/core/src/main/java/com/dite/znpt/domain/vo/WorkShiftListResp.java index 9f61afd..df08138 100644 --- a/core/src/main/java/com/dite/znpt/domain/vo/WorkShiftListResp.java +++ b/core/src/main/java/com/dite/znpt/domain/vo/WorkShiftListResp.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.vo; import com.fasterxml.jackson.annotation.JsonFormat; @@ -52,3 +53,59 @@ public class WorkShiftListResp implements Serializable { private LocalDateTime updateTime; } +======= +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.LocalDateTime; +import java.time.LocalTime; + +/** + * @author Bear.G + * @date 2025/6/30/周一 10:39 + * @description + */ +@Data +@ApiModel("班次信息列表响应实体") +public class WorkShiftListResp implements Serializable { + @Serial + private static final long serialVersionUID = 530703326351692657L; + + @ApiModelProperty("班次id") + private String workShiftId; + + @ApiModelProperty("班次名称") + private String workShiftName; + + @JsonFormat(pattern = "HH:mm") + @ApiModelProperty("上班时间") + private LocalTime workTimeStart; + + @JsonFormat(pattern = "HH:mm") + @ApiModelProperty("下班时间") + private LocalTime workTimeEnd; + + @ApiModelProperty("状态") + private String status; + + @ApiModelProperty("状态描述") + private String statusLabel; + + @ApiModelProperty("创建人id") + private String createBy; + + @ApiModelProperty("创建人名称") + private String createUserName; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty("修改时间") + private LocalDateTime updateTime; + +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/vo/WorkShiftReq.java b/core/src/main/java/com/dite/znpt/domain/vo/WorkShiftReq.java index 763c453..b9047ce 100644 --- a/core/src/main/java/com/dite/znpt/domain/vo/WorkShiftReq.java +++ b/core/src/main/java/com/dite/znpt/domain/vo/WorkShiftReq.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.vo; import com.fasterxml.jackson.annotation.JsonFormat; @@ -57,3 +58,64 @@ public class WorkShiftReq implements Serializable { @ApiModelProperty("休息时间结束") private LocalTime restTimeEnd; } +======= +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 javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serial; +import java.io.Serializable; +import java.time.LocalTime; + +/** + * @author Bear.G + * @date 2025/6/30/周一 10:39 + * @description + */ +@Data +@ApiModel("班次信息请求实体") +public class WorkShiftReq implements Serializable { + + @Serial + private static final long serialVersionUID = 3008068678585003135L; + + @NotBlank(message = "班次名称不能为空") + @ApiModelProperty("班次名称") + private String workShiftName; + + @NotNull(message = "上班时间不能为空") + @JsonFormat(pattern = "HH:mm") + @ApiModelProperty("上班时间") + private LocalTime workTimeStart; + + @ApiModelProperty("迟到豁免时间,单位分钟") + private Integer lateTimeOffset; + + @ApiModelProperty("迟到时间临界值,单位分钟") + private Integer lateTimeLimit; + + @NotNull(message = "下班时间不能为空") + @JsonFormat(pattern = "HH:mm") + @ApiModelProperty("下班时间") + private LocalTime workTimeEnd; + + @ApiModelProperty("早退豁免时间,单位分钟") + private Integer earlyTimeOffset; + + @ApiModelProperty("早退时间临界值,单位分钟") + private Integer earlyTimeLimit; + + @JsonFormat(pattern = "HH:mm") + @ApiModelProperty("休息时间开始") + private LocalTime restTimeStart; + + @JsonFormat(pattern = "HH:mm") + @ApiModelProperty("休息时间结束") + private LocalTime restTimeEnd; +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/vo/WorkShiftResp.java b/core/src/main/java/com/dite/znpt/domain/vo/WorkShiftResp.java index b50f2c5..29ae31e 100644 --- a/core/src/main/java/com/dite/znpt/domain/vo/WorkShiftResp.java +++ b/core/src/main/java/com/dite/znpt/domain/vo/WorkShiftResp.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.vo; import com.fasterxml.jackson.annotation.JsonFormat; @@ -65,3 +66,72 @@ public class WorkShiftResp implements Serializable { } +======= +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.LocalTime; + +/** + * @author Bear.G + * @date 2025/6/30/周一 10:39 + * @description + */ +@Data +@ApiModel("班次信息响应实体") +public class WorkShiftResp implements Serializable { + @Serial + private static final long serialVersionUID = 7000086760170568103L; + + @ApiModelProperty("班次id") + private String workShiftId; + + @ApiModelProperty("班次名称") + private String workShiftName; + + @JsonFormat(pattern = "HH:mm") + @ApiModelProperty("上班时间") + private LocalTime workTimeStart; + + @ApiModelProperty("迟到豁免时间,单位分钟") + private Integer lateTimeOffset; + + @ApiModelProperty("迟到时间临界值,单位分钟") + private Integer lateTimeLimit; + + @JsonFormat(pattern = "HH:mm") + @ApiModelProperty("下班时间") + private LocalTime workTimeEnd; + + @ApiModelProperty("早退豁免时间,单位分钟") + private Integer earlyTimeOffset; + + @ApiModelProperty("早退时间临界值,单位分钟") + private Integer earlyTimeLimit; + + @JsonFormat(pattern = "HH:mm") + @ApiModelProperty("休息时间开始") + private LocalTime restTimeStart; + + @JsonFormat(pattern = "HH:mm") + @ApiModelProperty("休息时间结束") + private LocalTime restTimeEnd; + + @ApiModelProperty("工作时间长") + private Integer workTime; + + @ApiModelProperty("状态,0-已发布,1-未发布") + private String status; + + @ApiModelProperty("状态,0-已发布,1-未发布") + private String statusLabel; + + +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/vo/job/req/JobAllContentReq.java b/core/src/main/java/com/dite/znpt/domain/vo/job/req/JobAllContentReq.java index a508c21..2930548 100644 --- a/core/src/main/java/com/dite/znpt/domain/vo/job/req/JobAllContentReq.java +++ b/core/src/main/java/com/dite/znpt/domain/vo/job/req/JobAllContentReq.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.vo.job.req; import com.dite.znpt.domain.AuditableEntity; @@ -21,3 +22,28 @@ public class JobAllContentReq extends AuditableEntity implements Serializable { private String workType; } +======= +package com.dite.znpt.domain.vo.job.req; + +import com.dite.znpt.domain.AuditableEntity; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; + +/** + * @author cuizhibin + * @date 2023/10/30 20:38 + * @description jobq + */ +@Data +public class JobAllContentReq extends AuditableEntity implements Serializable { + + @ApiModelProperty(value = "机组id", example = "78979879375", notes = "机组id") + private String crewId; + + @ApiModelProperty(value = "工作类型", example = "工作类型", notes = "工作类型") + private String workType; + +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/vo/job/req/JobAntiThunderWorkReq.java b/core/src/main/java/com/dite/znpt/domain/vo/job/req/JobAntiThunderWorkReq.java index b91153b..3e8118d 100644 --- a/core/src/main/java/com/dite/znpt/domain/vo/job/req/JobAntiThunderWorkReq.java +++ b/core/src/main/java/com/dite/znpt/domain/vo/job/req/JobAntiThunderWorkReq.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.vo.job.req; import com.dite.znpt.domain.entity.job.JobAntiThunderWork; @@ -11,3 +12,18 @@ import lombok.Data; @Data public class JobAntiThunderWorkReq extends JobAntiThunderWork { } +======= +package com.dite.znpt.domain.vo.job.req; + +import com.dite.znpt.domain.entity.job.JobAntiThunderWork; +import lombok.Data; + +/** + * @author cuizhibin + * @date 2023/10/30 20:38 + * @description jobq + */ +@Data +public class JobAntiThunderWorkReq extends JobAntiThunderWork { +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/vo/job/req/JobInWorkPartsReq.java b/core/src/main/java/com/dite/znpt/domain/vo/job/req/JobInWorkPartsReq.java index 821f600..d4fd059 100644 --- a/core/src/main/java/com/dite/znpt/domain/vo/job/req/JobInWorkPartsReq.java +++ b/core/src/main/java/com/dite/znpt/domain/vo/job/req/JobInWorkPartsReq.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.vo.job.req; import com.dite.znpt.domain.entity.job.JobInWorkParts; @@ -11,3 +12,18 @@ import lombok.Data; @Data public class JobInWorkPartsReq extends JobInWorkParts { } +======= +package com.dite.znpt.domain.vo.job.req; + +import com.dite.znpt.domain.entity.job.JobInWorkParts; +import lombok.Data; + +/** + * @author wujinsong + * @date 2023/2/17 09:47 + * @description: 部件 + */ +@Data +public class JobInWorkPartsReq extends JobInWorkParts { +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/vo/job/req/JobInWorkReq.java b/core/src/main/java/com/dite/znpt/domain/vo/job/req/JobInWorkReq.java index d18a3f6..f321676 100644 --- a/core/src/main/java/com/dite/znpt/domain/vo/job/req/JobInWorkReq.java +++ b/core/src/main/java/com/dite/znpt/domain/vo/job/req/JobInWorkReq.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.vo.job.req; import com.dite.znpt.domain.entity.job.JobInWork; @@ -11,3 +12,18 @@ import lombok.Data; @Data public class JobInWorkReq extends JobInWork { } +======= +package com.dite.znpt.domain.vo.job.req; + +import com.dite.znpt.domain.entity.job.JobInWork; +import lombok.Data; + +/** + * @author cuizhibin + * @date 2023/10/30 20:38 + * @description jobq + */ +@Data +public class JobInWorkReq extends JobInWork { +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/vo/job/req/JobInfoReq.java b/core/src/main/java/com/dite/znpt/domain/vo/job/req/JobInfoReq.java index e4e6e47..f01bdc6 100644 --- a/core/src/main/java/com/dite/znpt/domain/vo/job/req/JobInfoReq.java +++ b/core/src/main/java/com/dite/znpt/domain/vo/job/req/JobInfoReq.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.vo.job.req; import com.dite.znpt.domain.entity.job.JobInfo; @@ -24,3 +25,31 @@ public class JobInfoReq extends JobInfo { private Date submitTimeEnd; } +======= +package com.dite.znpt.domain.vo.job.req; + +import com.dite.znpt.domain.entity.job.JobInfo; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.util.Date; + +/** + * @author cuizhibin + * @date 2023/10/30 20:38 + * @description jobq + */ +@Data +public class JobInfoReq extends JobInfo { + + @ApiModelProperty(value = "提交开始时间", example = "1653764367643", notes = "提交开始时间") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date submitTimeStart; + + @ApiModelProperty(value = "提交结束时间", example = "1653764327643", notes = "提交结束时间") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date submitTimeEnd; + +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/vo/job/req/JobOutWorkReq.java b/core/src/main/java/com/dite/znpt/domain/vo/job/req/JobOutWorkReq.java index 6414138..271a24f 100644 --- a/core/src/main/java/com/dite/znpt/domain/vo/job/req/JobOutWorkReq.java +++ b/core/src/main/java/com/dite/znpt/domain/vo/job/req/JobOutWorkReq.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.vo.job.req; import com.dite.znpt.domain.entity.job.JobOutWork; @@ -11,3 +12,18 @@ import lombok.Data; @Data public class JobOutWorkReq extends JobOutWork { } +======= +package com.dite.znpt.domain.vo.job.req; + +import com.dite.znpt.domain.entity.job.JobOutWork; +import lombok.Data; + +/** + * @author cuizhibin + * @date 2023/10/30 20:38 + * @description jobq + */ +@Data +public class JobOutWorkReq extends JobOutWork { +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/vo/job/req/JobSummaryWorkReq.java b/core/src/main/java/com/dite/znpt/domain/vo/job/req/JobSummaryWorkReq.java index fe63da3..2295c22 100644 --- a/core/src/main/java/com/dite/znpt/domain/vo/job/req/JobSummaryWorkReq.java +++ b/core/src/main/java/com/dite/znpt/domain/vo/job/req/JobSummaryWorkReq.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.vo.job.req; import com.dite.znpt.domain.entity.job.JobSummaryWork; @@ -11,3 +12,18 @@ import lombok.Data; @Data public class JobSummaryWorkReq extends JobSummaryWork { } +======= +package com.dite.znpt.domain.vo.job.req; + +import com.dite.znpt.domain.entity.job.JobSummaryWork; +import lombok.Data; + +/** + * @author cuizhibin + * @date 2023/10/30 20:38 + * @description jobq + */ +@Data +public class JobSummaryWorkReq extends JobSummaryWork { +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/domain/vo/job/resp/TurbineStatusResp.java b/core/src/main/java/com/dite/znpt/domain/vo/job/resp/TurbineStatusResp.java index 0738403..5dc5c33 100644 --- a/core/src/main/java/com/dite/znpt/domain/vo/job/resp/TurbineStatusResp.java +++ b/core/src/main/java/com/dite/znpt/domain/vo/job/resp/TurbineStatusResp.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.domain.vo.job.resp; import io.swagger.annotations.ApiModel; @@ -47,3 +48,54 @@ public class TurbineStatusResp { @ApiModelProperty(value = "防雷是否不合格,1不合格,0合格", example = "{}", notes = "防雷是否不合格,1不合格,0合格") private Boolean lightningUnqualifiedAll; } +======= +package com.dite.znpt.domain.vo.job.resp; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@NoArgsConstructor +@AllArgsConstructor +@ApiModel("机组下各工作类型状态处理类") +public class TurbineStatusResp { + + private String id; + + @ApiModelProperty(value = "内部工作状态, -1不存在,0未开始、1开始施工、2已提交报告、3审核通过", example = "{}", notes = "内部工作状态, -1不存在,0未开始、1开始施工、2已提交报告、3审核通过") + private String antiThunderWorkStatus; + + @ApiModelProperty(value = "外部工作状态, -1不存在,0未开始、1开始施工、2已提交报告、3审核通过", example = "{}", notes = "外部工作状态, -1不存在,0未开始、1开始施工、2已提交报告、3审核通过") + private String inWorkStatus; + + @ApiModelProperty(value = "防雷工作状态, -1不存在,0未开始、1开始施工、2已提交报告、3审核通过", example = "{}", notes = "防雷工作状态, -1不存在,0未开始、1开始施工、2已提交报告、3审核通过") + private String outWorkStatus; + + @ApiModelProperty(value = "数据报告工作状态, -1不存在,0未开始、1开始施工、2已提交报告、3审核通过", example = "{}", notes = "数据报告工作状态, -1不存在,0未开始、1开始施工、2已提交报告、3审核通过") + private String summaryWorkStatus; + + @ApiModelProperty(value = "内部工作安全员审核状态, -1不存在,0未审核、1审核通过", example = "{}", notes = "内部工作安全员审核状态, -1不存在,0未审核、1审核通过") + private String antiThunderWorkSafetyStatus; + + @ApiModelProperty(value = "外部工作安全员审核状态, -1不存在,0未审核、1审核通过", example = "{}", notes = "外部工作安全员审核状态, -1不存在,0未审核、1审核通过") + private String inWorkSafetyStatus; + + @ApiModelProperty(value = "防雷工作安全员审核状态, -1不存在,0未审核、1审核通过", example = "{}", notes = "防雷工作安全员审核状态, -1不存在,0未审核、1审核通过") + private String outWorkSafetyStatus; + + @ApiModelProperty(value = "内部工作质量员审核状态, -1不存在,0未审核、1审核通过", example = "{}", notes = "内部工作质量员审核状态, -1不存在,0未审核、1审核通过") + private String antiThunderWorkQualityStatus; + + @ApiModelProperty(value = "外部工作质量员审核状态, -1不存在,0未审核、1审核通过", example = "{}", notes = "外部工作质量员审核状态, -1不存在,0未审核、1审核通过") + private String inWorkQualityStatus; + + @ApiModelProperty(value = "防雷工作质量员审核状态, -1不存在,0未审核、1审核通过", example = "{}", notes = "防雷工作质量员审核状态, -1不存在,0未审核、1审核通过") + private String outWorkQualityStatus; + + @ApiModelProperty(value = "防雷是否不合格,1不合格,0合格", example = "{}", notes = "防雷是否不合格,1不合格,0合格") + private Boolean lightningUnqualifiedAll; +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/enums/AttachBusinessTypeEnum.java b/core/src/main/java/com/dite/znpt/enums/AttachBusinessTypeEnum.java index 4e008b3..9ce9ec5 100644 --- a/core/src/main/java/com/dite/znpt/enums/AttachBusinessTypeEnum.java +++ b/core/src/main/java/com/dite/znpt/enums/AttachBusinessTypeEnum.java @@ -19,6 +19,13 @@ public enum AttachBusinessTypeEnum { DEFECT_MARK_PIC("defect_mark_pic", "缺陷标注图片"), REPORT("report", "报告"), PROJECT_BUDGE("project_budge", "预算文件"), +<<<<<<< HEAD +======= + PROJECT_DAILY_REPORT("project_daily_report", "项目日报文件"), + BIDDING_INFO("bidding_info", "招标信息"), + TENDER_INFO("tender_info", "投标信息"), + OUTBID_INFO("outbid_info", "中标信息"), +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f ; private final String code; private final String desc; diff --git a/core/src/main/java/com/dite/znpt/enums/BudgeTypeEnum.java b/core/src/main/java/com/dite/znpt/enums/BudgeTypeEnum.java index 123f023..68afeb2 100644 --- a/core/src/main/java/com/dite/znpt/enums/BudgeTypeEnum.java +++ b/core/src/main/java/com/dite/znpt/enums/BudgeTypeEnum.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.enums; import cn.hutool.json.JSONObject; @@ -50,3 +51,57 @@ public enum BudgeTypeEnum { return list; } } +======= +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/5/7 21:22 + * @Description: + */ +@Getter +public enum BudgeTypeEnum { + PROCUREMENT("procurement", "采购"), + ARTIFICIAL("artificial", "人工"), + MANAGEMENT_FEE("managementFee", "管理费"), + ; + + private final String code; + private final String desc; + + BudgeTypeEnum(String code, String desc){ + this.code = code; + this.desc = desc; + } + + public static BudgeTypeEnum getByCode(String code){ + for (BudgeTypeEnum e : BudgeTypeEnum.values() ) { + if(e.code.equals(code)){ + return e; + } + } + return null; + } + + public static String getDescByCode(String code){ + BudgeTypeEnum e = getByCode(code); + return null == e ? null : e.desc; + } + + public static List listAll(){ + List list = new ArrayList<>(BudgeTypeEnum.values().length); + for (BudgeTypeEnum e : BudgeTypeEnum.values() ) { + JSONObject jsonObject = new JSONObject(); + jsonObject.set(e.code, e.desc); + list.add(jsonObject); + } + return list; + } +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/enums/CertificationEnum.java b/core/src/main/java/com/dite/znpt/enums/CertificationEnum.java index d08bd2a..d7e7fdf 100644 --- a/core/src/main/java/com/dite/znpt/enums/CertificationEnum.java +++ b/core/src/main/java/com/dite/znpt/enums/CertificationEnum.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.enums; import cn.hutool.json.JSONObject; @@ -54,3 +55,61 @@ public enum CertificationEnum { return list; } } +======= +package com.dite.znpt.enums; + +import cn.hutool.json.JSONObject; +import lombok.Getter; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author Bear.G + * @date 2025/5/27/周二 15:33 + * @description + */ +@Getter +public enum CertificationEnum { + + HEIGHT_OPERATION("height-operation", "高处作业"), + LOW_VOLTAGE_OPERATION("low-voltage-operation", "低压电工"), + HIGH_VOLTAGE_OPERATION("high-voltage-operation", "高压电工"), + MARITIME_TRAFFIC_SAFETY("maritime-traffic-safety", "海上交通安全"), + DRIVING_LICENSE("driving-license", "驾驶证"), + LIGHTNING_PROTECTION_DETECTION("lightning-protection-detection", "防雷检测"), + DRONE_DRIVING("drone-driving", "无人机驾驶"); + + private final String code; + private final String desc; + + CertificationEnum(String code, String desc){ + this.code = code; + this.desc = desc; + } + + public static CertificationEnum getByCode(String code){ + for (CertificationEnum e : CertificationEnum.values() ) { + if(e.code.equals(code)){ + return e; + } + } + return null; + } + + public static String getDescByCode(String code){ + CertificationEnum e = getByCode(code); + return null == e ? null : e.desc; + } + + public static List listAll(){ + List list = new ArrayList<>(CertificationEnum.values().length); + for (CertificationEnum e : CertificationEnum.values() ) { + JSONObject jsonObject = new JSONObject(); + jsonObject.set(e.code, e.desc); + list.add(jsonObject); + } + return list; + } +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/enums/EquipmentStatusEnum.java b/core/src/main/java/com/dite/znpt/enums/EquipmentStatusEnum.java index 91e3ac5..a77e6e2 100644 --- a/core/src/main/java/com/dite/znpt/enums/EquipmentStatusEnum.java +++ b/core/src/main/java/com/dite/znpt/enums/EquipmentStatusEnum.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.enums; import cn.hutool.json.JSONObject; @@ -52,3 +53,59 @@ public enum EquipmentStatusEnum { return list; } } +======= +package com.dite.znpt.enums; + +import cn.hutool.json.JSONObject; +import lombok.Getter; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author Bear.G + * @date 2025/7/24/周四 14:35 + * @description + */ +@Getter +public enum EquipmentStatusEnum { + NORMAL("normal","正常"), + REPAIR("repair","维修中"), + MAINTAIN(" maintain","保养中"), + SCRAP("scrap","报废"); + + private final String code; + + private final String desc; + + EquipmentStatusEnum(String code, String desc){ + this.code = code; + this.desc = desc; + } + + + public static EquipmentStatusEnum getByCode(String code){ + for (EquipmentStatusEnum e : EquipmentStatusEnum.values() ) { + if(e.code.equals(code)){ + return e; + } + } + return null; + } + + public static String getDescByCode(String code){ + EquipmentStatusEnum e = getByCode(code); + return null == e ? null : e.desc; + } + + public static List listAll(){ + List list = new ArrayList<>(EquipmentStatusEnum.values().length); + for (EquipmentStatusEnum e : EquipmentStatusEnum.values() ) { + JSONObject jsonObject = new JSONObject(); + jsonObject.set(e.code, e.desc); + list.add(jsonObject); + } + return list; + } +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/enums/EquipmentTypeEnum.java b/core/src/main/java/com/dite/znpt/enums/EquipmentTypeEnum.java index 1aa9f12..67b1f2c 100644 --- a/core/src/main/java/com/dite/znpt/enums/EquipmentTypeEnum.java +++ b/core/src/main/java/com/dite/znpt/enums/EquipmentTypeEnum.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.enums; import cn.hutool.json.JSONObject; @@ -52,3 +53,59 @@ public enum EquipmentTypeEnum { return list; } } +======= +package com.dite.znpt.enums; + +import cn.hutool.json.JSONObject; +import lombok.Getter; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author Bear.G + * @date 2025/7/24/周四 9:33 + * @description + */ +@Getter +public enum EquipmentTypeEnum { + DETECTION("detection","检测设备"), + MAINTAIN("maintain","维修设备"), + SECURITY("security","安全设备"), + OFFICE(" office","办公设备"), + CAR("car","车辆"); + + private final String code; + private final String desc; + + EquipmentTypeEnum(String code, String desc){ + this.code = code; + this.desc = desc; + } + + + public static EquipmentTypeEnum getByCode(String code){ + for (EquipmentTypeEnum e : EquipmentTypeEnum.values() ) { + if(e.code.equals(code)){ + return e; + } + } + return null; + } + + public static String getDescByCode(String code){ + EquipmentTypeEnum e = getByCode(code); + return null == e ? null : e.desc; + } + + public static List listAll(){ + List list = new ArrayList<>(EquipmentTypeEnum.values().length); + for (EquipmentTypeEnum e : EquipmentTypeEnum.values() ) { + JSONObject jsonObject = new JSONObject(); + jsonObject.set(e.code, e.desc); + list.add(jsonObject); + } + return list; + } +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/enums/FilePathEnum.java b/core/src/main/java/com/dite/znpt/enums/FilePathEnum.java index 0b21606..2cf822b 100644 --- a/core/src/main/java/com/dite/znpt/enums/FilePathEnum.java +++ b/core/src/main/java/com/dite/znpt/enums/FilePathEnum.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.enums; import cn.hutool.core.io.FileUtil; @@ -56,3 +57,82 @@ public enum FilePathEnum { } } +======= +package com.dite.znpt.enums; + +import cn.hutool.core.io.FileUtil; +import cn.hutool.core.util.StrUtil; +import cn.hutool.extra.spring.SpringUtil; +import lombok.AllArgsConstructor; +import lombok.Getter; +import org.springframework.core.env.Environment; + +@AllArgsConstructor +public enum FilePathEnum { + + IMAGE("/static/image/", "image"), + IMAGE_TEMP("/static/image/temp/", "image-temp"), + VIDEO("/static/video/", "video"), + AUDIO("/static/audio/", "audio"), + 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 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 getFileDownPath(String absolutePath) { + String relativePath = StrUtil.removePrefix(absolutePath, getFileAbsolutePathPrefix()); + return StrUtil.replace(urlPath.concat(relativePath), FileUtil.FILE_SEPARATOR, StrUtil.SLASH); + } + + /** + * 功能描述:根据文件路径前缀获取文件路径ENUM + * + * @param fileDownPath 文件路径 + * @return {@link FilePathEnum } + * @author cuizhibin + * @date 2025/07/27 16:00 + **/ + public static FilePathEnum getFilePathEnum(String fileDownPath) { + if (StrUtil.startWith(fileDownPath, FilePathEnum.IMAGE_TEMP.getUrlPath())) { + return FilePathEnum.IMAGE_TEMP; + } + for (FilePathEnum pathEnum : FilePathEnum.values()) { + if (StrUtil.startWith(fileDownPath, FilePathEnum.IMAGE_TEMP.getUrlPath())) { + return pathEnum; + } + } + return FilePathEnum.ATTACH; + } +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/enums/InspectionReportStatusEnum.java b/core/src/main/java/com/dite/znpt/enums/InspectionReportStatusEnum.java index 5d9e517..29a132a 100644 --- a/core/src/main/java/com/dite/znpt/enums/InspectionReportStatusEnum.java +++ b/core/src/main/java/com/dite/znpt/enums/InspectionReportStatusEnum.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.enums; import cn.hutool.json.JSONObject; @@ -49,3 +50,56 @@ public enum InspectionReportStatusEnum { return list; } } +======= +package com.dite.znpt.enums; + +import cn.hutool.json.JSONObject; +import lombok.Getter; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author Bear.G + * @date 2025/6/26/周四 10:49 + * @description + */ +@Getter +public enum InspectionReportStatusEnum { + + PENDING("PENDING","待审核"), + PUBLISH("PUBLISH","已发布"); + + private final String code; + private final String desc; + + InspectionReportStatusEnum(String code, String desc){ + this.code = code; + this.desc = desc; + } + + public static InspectionReportStatusEnum getByCode(String code){ + for (InspectionReportStatusEnum e : InspectionReportStatusEnum.values() ) { + if(e.code.equals(code)){ + return e; + } + } + return null; + } + + public static String getDescByCode(String code){ + InspectionReportStatusEnum e = getByCode(code); + return null == e ? null : e.desc; + } + + public static List listAll(){ + List list = new ArrayList<>(InspectionReportStatusEnum.values().length); + for (InspectionReportStatusEnum e : InspectionReportStatusEnum.values() ) { + JSONObject jsonObject = new JSONObject(); + jsonObject.set(e.code, e.desc); + list.add(jsonObject); + } + return list; + } +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/enums/InsuranceStatusEnum.java b/core/src/main/java/com/dite/znpt/enums/InsuranceStatusEnum.java index 9c491fb..e572362 100644 --- a/core/src/main/java/com/dite/znpt/enums/InsuranceStatusEnum.java +++ b/core/src/main/java/com/dite/znpt/enums/InsuranceStatusEnum.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.enums; import cn.hutool.json.JSONObject; @@ -49,3 +50,56 @@ public enum InsuranceStatusEnum { return list; } } +======= +package com.dite.znpt.enums; + +import cn.hutool.json.JSONObject; +import lombok.Getter; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author Bear.G + * @date 2025/6/26/周四 10:49 + * @description + */ +@Getter +public enum InsuranceStatusEnum { + + EFFECTIVE("EFFECTIVE","有效"), + EXPIRED("EXPIRED","过期"); + + private final String code; + private final String desc; + + InsuranceStatusEnum(String code, String desc){ + this.code = code; + this.desc = desc; + } + + public static InsuranceStatusEnum getByCode(String code){ + for (InsuranceStatusEnum e : InsuranceStatusEnum.values() ) { + if(e.code.equals(code)){ + return e; + } + } + return null; + } + + public static String getDescByCode(String code){ + InsuranceStatusEnum e = getByCode(code); + return null == e ? null : e.desc; + } + + public static List listAll(){ + List list = new ArrayList<>(InsuranceStatusEnum.values().length); + for (InsuranceStatusEnum e : InsuranceStatusEnum.values() ) { + JSONObject jsonObject = new JSONObject(); + jsonObject.set(e.code, e.desc); + list.add(jsonObject); + } + return list; + } +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/enums/MenuTypeEnum.java b/core/src/main/java/com/dite/znpt/enums/MenuTypeEnum.java index a0ce12e..1f81ea2 100644 --- a/core/src/main/java/com/dite/znpt/enums/MenuTypeEnum.java +++ b/core/src/main/java/com/dite/znpt/enums/MenuTypeEnum.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.enums; import cn.hutool.json.JSONObject; @@ -50,3 +51,57 @@ public enum MenuTypeEnum { return list; } } +======= +package com.dite.znpt.enums; + +import cn.hutool.json.JSONObject; +import lombok.Getter; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author Bear.G + * @date 2025/5/21/周三 14:44 + * @description + */ +@Getter +public enum MenuTypeEnum { + + CATALOG("catalog", "目录"), + ROUTE("route", "菜单"), + BUTTON("button", "按钮"); + + private final String code; + private final String desc; + + MenuTypeEnum(String code, String desc){ + this.code = code; + this.desc = desc; + } + + public static MenuTypeEnum getByCode(String code){ + for (MenuTypeEnum e : MenuTypeEnum.values() ) { + if(e.code.equals(code)){ + return e; + } + } + return null; + } + + public static String getDescByCode(String code){ + MenuTypeEnum e = getByCode(code); + return null == e ? null : e.desc; + } + + public static List listAll(){ + List list = new ArrayList<>(MenuTypeEnum.values().length); + for (MenuTypeEnum e : MenuTypeEnum.values() ) { + JSONObject jsonObject = new JSONObject(); + jsonObject.set(e.code, e.desc); + list.add(jsonObject); + } + return list; + } +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/enums/ProjectTypeEnum.java b/core/src/main/java/com/dite/znpt/enums/ProjectTypeEnum.java new file mode 100644 index 0000000..c5e19b4 --- /dev/null +++ b/core/src/main/java/com/dite/znpt/enums/ProjectTypeEnum.java @@ -0,0 +1,49 @@ +package com.dite.znpt.enums; + +import cn.hutool.json.JSONObject; +import lombok.AllArgsConstructor; +import lombok.Getter; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author Bear.G + * @date 2025/7/28/周一 16:35 + * @description + */ +@Getter +@AllArgsConstructor +public enum ProjectTypeEnum { + BLADE_CHECK("blade_check", "风电叶片检查"), + OPERATION("operation", "风电运维"), + INSTALL("install", "风电安装"), + OTHER("other", "其他"); + + private final String code; + private final String desc; + + public static ProjectTypeEnum getByCode(String code){ + for (ProjectTypeEnum e : ProjectTypeEnum.values() ) { + if(e.code.equals(code)){ + return e; + } + } + return null; + } + + public static String getDescByCode(String code){ + ProjectTypeEnum e = getByCode(code); + return null == e ? null : e.desc; + } + + public static List listAll(){ + List list = new ArrayList<>(ProjectTypeEnum.values().length); + for (ProjectTypeEnum e : ProjectTypeEnum.values() ) { + JSONObject jsonObject = new JSONObject(); + jsonObject.set(String.valueOf(e.code), e.desc); + list.add(jsonObject); + } + return list; + } +} diff --git a/core/src/main/java/com/dite/znpt/mapper/AudioFileInfoMapper.java b/core/src/main/java/com/dite/znpt/mapper/AudioFileInfoMapper.java index fd1cea5..8a196c9 100644 --- a/core/src/main/java/com/dite/znpt/mapper/AudioFileInfoMapper.java +++ b/core/src/main/java/com/dite/znpt/mapper/AudioFileInfoMapper.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; @@ -17,3 +18,24 @@ public interface AudioFileInfoMapper extends BaseMapper { List queryBySelective(AudioFileInfoListReq audioFileInfoReq); } +======= +package com.dite.znpt.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.dite.znpt.domain.entity.AudioFileInfoEntity; +import com.dite.znpt.domain.vo.AudioFileInfoListReq; +import com.dite.znpt.domain.vo.AudioFileInfoResp; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * @author huise23 + * @date 2025/06/23 13:39 + * @Description: 音频文件信息表数据库访问层 + */ +public interface AudioFileInfoMapper extends BaseMapper { + List queryBySelective(AudioFileInfoListReq audioFileInfoReq); +} + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/mapper/BiddingInfoMapper.java b/core/src/main/java/com/dite/znpt/mapper/BiddingInfoMapper.java new file mode 100644 index 0000000..58e377f --- /dev/null +++ b/core/src/main/java/com/dite/znpt/mapper/BiddingInfoMapper.java @@ -0,0 +1,18 @@ +package com.dite.znpt.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.dite.znpt.domain.entity.BiddingInfoEntity; +import com.dite.znpt.domain.vo.BiddingInfoResp; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * @author Bear.G + * @date 2025/7/28/周一 16:06 + * @description + */ +public interface BiddingInfoMapper extends BaseMapper { + + List listBiddingInfoResp(@Param("projectName") String projectName); +} diff --git a/core/src/main/java/com/dite/znpt/mapper/CertificationMapper.java b/core/src/main/java/com/dite/znpt/mapper/CertificationMapper.java index 68d46a6..4a28c36 100644 --- a/core/src/main/java/com/dite/znpt/mapper/CertificationMapper.java +++ b/core/src/main/java/com/dite/znpt/mapper/CertificationMapper.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; @@ -15,3 +16,22 @@ import java.util.List; public interface CertificationMapper extends BaseMapper { List selectCertification(CertificationListReq req); } +======= +package com.dite.znpt.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.dite.znpt.domain.entity.CertificationEntity; +import com.dite.znpt.domain.vo.CertificationListReq; +import com.dite.znpt.domain.vo.CertificationResp; + +import java.util.List; + +/** + * @author Bear.G + * @date 2025/5/27/周二 15:21 + * @description + */ +public interface CertificationMapper extends BaseMapper { + List selectCertification(CertificationListReq req); +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/mapper/ContractMapper.java b/core/src/main/java/com/dite/znpt/mapper/ContractMapper.java index 77d1a91..a208e10 100644 --- a/core/src/main/java/com/dite/znpt/mapper/ContractMapper.java +++ b/core/src/main/java/com/dite/znpt/mapper/ContractMapper.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; @@ -17,3 +18,24 @@ public interface ContractMapper extends BaseMapper { List queryBySelective(ContractListReq contractReq); } +======= +package com.dite.znpt.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.dite.znpt.domain.entity.ContractEntity; +import com.dite.znpt.domain.vo.ContractListReq; +import com.dite.znpt.domain.vo.ContractResp; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * @author huise23 + * @date 2025/07/21 20:29 + * @Description: 合同表数据库访问层 + */ +public interface ContractMapper extends BaseMapper { + List queryBySelective(ContractListReq contractReq); +} + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/mapper/ContractSettlementMapper.java b/core/src/main/java/com/dite/znpt/mapper/ContractSettlementMapper.java index c1a4b39..ee415b2 100644 --- a/core/src/main/java/com/dite/znpt/mapper/ContractSettlementMapper.java +++ b/core/src/main/java/com/dite/znpt/mapper/ContractSettlementMapper.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; @@ -17,3 +18,24 @@ public interface ContractSettlementMapper extends BaseMapper queryBySelective(ContractSettlementListReq contractSettlementReq); } +======= +package com.dite.znpt.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.dite.znpt.domain.entity.ContractSettlementEntity; +import com.dite.znpt.domain.vo.ContractSettlementListReq; +import com.dite.znpt.domain.vo.ContractSettlementResp; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * @author huise23 + * @date 2025/07/21 21:10 + * @Description: 合同结算表数据库访问层 + */ +public interface ContractSettlementMapper extends BaseMapper { + List queryBySelective(ContractSettlementListReq contractSettlementReq); +} + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/mapper/DeptMapper.java b/core/src/main/java/com/dite/znpt/mapper/DeptMapper.java index 252b547..6fe9568 100644 --- a/core/src/main/java/com/dite/znpt/mapper/DeptMapper.java +++ b/core/src/main/java/com/dite/znpt/mapper/DeptMapper.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; @@ -30,3 +31,37 @@ public interface DeptMapper extends BaseMapper { **/ List downwardRecursionSelect(@Param("deptId") String deptId); } +======= +package com.dite.znpt.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.dite.znpt.domain.entity.DeptEntity; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * @author Bear.G + * @date 2025/5/20/周二 10:16 + * @description + */ +public interface DeptMapper extends BaseMapper { + /** + * @Author Bear.G + * @Date 2025/5/20/周二 15:49 + * @description 向上递归查询部门树 + * @param deptName + * @return + **/ + List upwardRecursionSelect(@Param("deptName") String deptName); + + /** + * @Author Bear.G + * @Date 2025/5/20/周二 15:49 + * @description 向下递归查询部门树 + * @param deptId + * @return + **/ + List downwardRecursionSelect(@Param("deptId") String deptId); +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/mapper/DictMapper.java b/core/src/main/java/com/dite/znpt/mapper/DictMapper.java index 4e071cf..cb8b54b 100644 --- a/core/src/main/java/com/dite/znpt/mapper/DictMapper.java +++ b/core/src/main/java/com/dite/znpt/mapper/DictMapper.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; @@ -16,3 +17,23 @@ public interface DictMapper extends BaseMapper { List queryBySelective(DictListReq dictReq); } +======= +package com.dite.znpt.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.dite.znpt.domain.entity.DictEntity; +import com.dite.znpt.domain.vo.DictListReq; +import com.dite.znpt.domain.vo.DictResp; + +import java.util.List; + +/** + * @author huise23 + * @date 2025/06/30 11:38 + * @Description: 字典表数据库访问层 + */ +public interface DictMapper extends BaseMapper { + List queryBySelective(DictListReq dictReq); +} + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/mapper/EquipmentMapper.java b/core/src/main/java/com/dite/znpt/mapper/EquipmentMapper.java index 10ccb80..8bcbb10 100644 --- a/core/src/main/java/com/dite/znpt/mapper/EquipmentMapper.java +++ b/core/src/main/java/com/dite/znpt/mapper/EquipmentMapper.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; @@ -19,3 +20,26 @@ public interface EquipmentMapper extends BaseMapper { EquipmentResp getEquipmentRespByEquipmentId(@Param("equipmentId") String equipmentId); } +======= +package com.dite.znpt.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.dite.znpt.domain.entity.EquipmentEntity; +import com.dite.znpt.domain.vo.EquipmentListReq; +import com.dite.znpt.domain.vo.EquipmentResp; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * @author Bear.G + * @date 2025/7/23/周三 17:38 + * @description + */ +public interface EquipmentMapper extends BaseMapper { + + List selectEquipmentResp(@Param("req") EquipmentListReq req); + + EquipmentResp getEquipmentRespByEquipmentId(@Param("equipmentId") String equipmentId); +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/mapper/EquipmentUseRecordMapper.java b/core/src/main/java/com/dite/znpt/mapper/EquipmentUseRecordMapper.java index ea8eacc..c9b9938 100644 --- a/core/src/main/java/com/dite/znpt/mapper/EquipmentUseRecordMapper.java +++ b/core/src/main/java/com/dite/znpt/mapper/EquipmentUseRecordMapper.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; @@ -18,3 +19,25 @@ public interface EquipmentUseRecordMapper extends BaseMapper selectEquipmentUseRecordResp(@Param("req") EquipmentUseRecordListReq req); List getEquipmentUseRecordResp(@Param("equipmentId") String equipmentId); } +======= +package com.dite.znpt.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.dite.znpt.domain.entity.EquipmentUseRecordEntity; +import com.dite.znpt.domain.vo.EquipmentUseRecordListReq; +import com.dite.znpt.domain.vo.EquipmentUseRecordResp; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * @author Bear.G + * @date 2025/7/23/周三 17:38 + * @description + */ +public interface EquipmentUseRecordMapper extends BaseMapper { + + List selectEquipmentUseRecordResp(@Param("req") EquipmentUseRecordListReq req); + List getEquipmentUseRecordResp(@Param("equipmentId") String equipmentId); +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/mapper/ImageMapper.java b/core/src/main/java/com/dite/znpt/mapper/ImageMapper.java index 5bd57f8..a741c5e 100644 --- a/core/src/main/java/com/dite/znpt/mapper/ImageMapper.java +++ b/core/src/main/java/com/dite/znpt/mapper/ImageMapper.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; @@ -16,3 +17,23 @@ public interface ImageMapper extends BaseMapper { ImageResp detail(String imageId); } +======= +package com.dite.znpt.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.dite.znpt.domain.entity.ImageEntity; +import com.dite.znpt.domain.vo.*; + +import java.util.List; + +/** + * @author Bear.G + * @date 2025/4/24/周四 13:17 + * @description + */ +public interface ImageMapper extends BaseMapper { + List queryImageList(ImageListReq req); + + ImageResp detail(String imageId); +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/mapper/InspectionReportMapper.java b/core/src/main/java/com/dite/znpt/mapper/InspectionReportMapper.java index db0d5b6..0f3df03 100644 --- a/core/src/main/java/com/dite/znpt/mapper/InspectionReportMapper.java +++ b/core/src/main/java/com/dite/znpt/mapper/InspectionReportMapper.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; @@ -19,3 +20,26 @@ public interface InspectionReportMapper extends BaseMapper listInspectionReportListResp(@Param("req") InspectionReportListReq req); InspectionReportResp getInspectionReportResp(@Param("reportId") String reportId); } +======= +package com.dite.znpt.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.dite.znpt.domain.entity.InspectionReportEntity; +import com.dite.znpt.domain.vo.InspectionReportListReq; +import com.dite.znpt.domain.vo.InspectionReportListResp; +import com.dite.znpt.domain.vo.InspectionReportResp; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * @author Bear.G + * @date 2025/7/7/周一 17:34 + * @description + */ +public interface InspectionReportMapper extends BaseMapper { + + List listInspectionReportListResp(@Param("req") InspectionReportListReq req); + InspectionReportResp getInspectionReportResp(@Param("reportId") String reportId); +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/mapper/InsuranceCompanyMapper.java b/core/src/main/java/com/dite/znpt/mapper/InsuranceCompanyMapper.java index 8035a5b..f668983 100644 --- a/core/src/main/java/com/dite/znpt/mapper/InsuranceCompanyMapper.java +++ b/core/src/main/java/com/dite/znpt/mapper/InsuranceCompanyMapper.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; @@ -10,3 +11,17 @@ import com.dite.znpt.domain.entity.InsuranceCompanyEntity; */ public interface InsuranceCompanyMapper extends BaseMapper { } +======= +package com.dite.znpt.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.dite.znpt.domain.entity.InsuranceCompanyEntity; + +/** + * @author Bear.G + * @date 2025/6/26/周四 9:30 + * @description + */ +public interface InsuranceCompanyMapper extends BaseMapper { +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/mapper/InsuranceInfoMapper.java b/core/src/main/java/com/dite/znpt/mapper/InsuranceInfoMapper.java index f2cabae..d8c9770 100644 --- a/core/src/main/java/com/dite/znpt/mapper/InsuranceInfoMapper.java +++ b/core/src/main/java/com/dite/znpt/mapper/InsuranceInfoMapper.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; @@ -10,3 +11,17 @@ import com.dite.znpt.domain.entity.InsuranceInfoEntity; */ public interface InsuranceInfoMapper extends BaseMapper { } +======= +package com.dite.znpt.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.dite.znpt.domain.entity.InsuranceInfoEntity; + +/** + * @author Bear.G + * @date 2025/6/26/周四 9:29 + * @description + */ +public interface InsuranceInfoMapper extends BaseMapper { +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/mapper/InsuranceTypeMapper.java b/core/src/main/java/com/dite/znpt/mapper/InsuranceTypeMapper.java index a21ddce..44b4d1a 100644 --- a/core/src/main/java/com/dite/znpt/mapper/InsuranceTypeMapper.java +++ b/core/src/main/java/com/dite/znpt/mapper/InsuranceTypeMapper.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; @@ -10,3 +11,17 @@ import com.dite.znpt.domain.entity.InsuranceTypeEntity; */ public interface InsuranceTypeMapper extends BaseMapper { } +======= +package com.dite.znpt.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.dite.znpt.domain.entity.InsuranceTypeEntity; + +/** + * @author Bear.G + * @date 2025/6/26/周四 9:29 + * @description + */ +public interface InsuranceTypeMapper extends BaseMapper { +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/mapper/JobAntiThunderWorkMapper.java b/core/src/main/java/com/dite/znpt/mapper/JobAntiThunderWorkMapper.java index 416df59..65247d5 100644 --- a/core/src/main/java/com/dite/znpt/mapper/JobAntiThunderWorkMapper.java +++ b/core/src/main/java/com/dite/znpt/mapper/JobAntiThunderWorkMapper.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; @@ -16,3 +17,23 @@ public interface JobAntiThunderWorkMapper extends BaseMapper List queryBySelective(JobAntiThunderWorkReq jobAntiThunderWorkReq); } +======= +package com.dite.znpt.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.dite.znpt.domain.entity.job.JobAntiThunderWork; +import com.dite.znpt.domain.vo.job.req.JobAntiThunderWorkReq; +import com.dite.znpt.domain.vo.job.resp.JobAntiThunderWorkResp; + +import java.util.List; + +/** + * @author huise23 + * @date 2025/04/24 14:52 + * @Description: 表数据库访问层 + */ +public interface JobAntiThunderWorkMapper extends BaseMapper { + List queryBySelective(JobAntiThunderWorkReq jobAntiThunderWorkReq); +} + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/mapper/JobInWorkMapper.java b/core/src/main/java/com/dite/znpt/mapper/JobInWorkMapper.java index 415cb93..ffeae19 100644 --- a/core/src/main/java/com/dite/znpt/mapper/JobInWorkMapper.java +++ b/core/src/main/java/com/dite/znpt/mapper/JobInWorkMapper.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; @@ -16,3 +17,23 @@ public interface JobInWorkMapper extends BaseMapper { List queryBySelective(JobInWorkReq gaeaJobInWorkReq); } +======= +package com.dite.znpt.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.dite.znpt.domain.entity.job.JobInWork; +import com.dite.znpt.domain.vo.job.req.JobInWorkReq; +import com.dite.znpt.domain.vo.job.resp.JobInWorkResp; + +import java.util.List; + +/** + * @author huise23 + * @date 2025/04/24 14:52 + * @Description: 表数据库访问层 + */ +public interface JobInWorkMapper extends BaseMapper { + List queryBySelective(JobInWorkReq gaeaJobInWorkReq); +} + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/mapper/JobInWorkPartsMapper.java b/core/src/main/java/com/dite/znpt/mapper/JobInWorkPartsMapper.java index 29a9305..6299a1b 100644 --- a/core/src/main/java/com/dite/znpt/mapper/JobInWorkPartsMapper.java +++ b/core/src/main/java/com/dite/znpt/mapper/JobInWorkPartsMapper.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; @@ -16,3 +17,23 @@ public interface JobInWorkPartsMapper extends BaseMapper { List queryBySelective(JobInWorkPartsReq gaeaJobInWorkPartsReq); } +======= +package com.dite.znpt.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.dite.znpt.domain.entity.job.JobInWorkParts; +import com.dite.znpt.domain.vo.job.req.JobInWorkPartsReq; +import com.dite.znpt.domain.vo.job.resp.JobInWorkPartsResp; + +import java.util.List; + +/** + * @author huise23 + * @date 2025/04/24 14:52 + * @Description: 表数据库访问层 + */ +public interface JobInWorkPartsMapper extends BaseMapper { + List queryBySelective(JobInWorkPartsReq gaeaJobInWorkPartsReq); +} + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/mapper/JobInfoMapper.java b/core/src/main/java/com/dite/znpt/mapper/JobInfoMapper.java index 3ca0655..e2089f3 100644 --- a/core/src/main/java/com/dite/znpt/mapper/JobInfoMapper.java +++ b/core/src/main/java/com/dite/znpt/mapper/JobInfoMapper.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; @@ -18,3 +19,25 @@ public interface JobInfoMapper extends BaseMapper { List calCrewStatus(@Param("crewIds") List crewIds); } +======= +package com.dite.znpt.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.dite.znpt.domain.entity.job.JobInfo; +import com.dite.znpt.domain.vo.job.req.JobInfoReq; +import com.dite.znpt.domain.vo.job.resp.JobInfoResp; +import com.dite.znpt.domain.vo.job.resp.TurbineStatusResp; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * @author huise23 + * @date 2025/04/24 14:52 + * @Description: 表数据库访问层 + */ +public interface JobInfoMapper extends BaseMapper { + List calCrewStatus(@Param("crewIds") List crewIds); +} + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/mapper/JobOutWorkMapper.java b/core/src/main/java/com/dite/znpt/mapper/JobOutWorkMapper.java index 068969e..6f0beda 100644 --- a/core/src/main/java/com/dite/znpt/mapper/JobOutWorkMapper.java +++ b/core/src/main/java/com/dite/znpt/mapper/JobOutWorkMapper.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.mapper; @@ -17,3 +18,24 @@ public interface JobOutWorkMapper extends BaseMapper { List queryBySelective(JobOutWorkReq gaeaJobOutWorkReq); } +======= +package com.dite.znpt.mapper; + + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.dite.znpt.domain.entity.job.JobOutWork; +import com.dite.znpt.domain.vo.job.req.JobOutWorkReq; +import com.dite.znpt.domain.vo.job.resp.JobOutWorkResp; + +import java.util.List; + +/** + * @author huise23 + * @date 2025/04/24 14:52 + * @Description: 表数据库访问层 + */ +public interface JobOutWorkMapper extends BaseMapper { + List queryBySelective(JobOutWorkReq gaeaJobOutWorkReq); +} + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/mapper/JobSummaryWorkMapper.java b/core/src/main/java/com/dite/znpt/mapper/JobSummaryWorkMapper.java index a8c1598..c6773e3 100644 --- a/core/src/main/java/com/dite/znpt/mapper/JobSummaryWorkMapper.java +++ b/core/src/main/java/com/dite/znpt/mapper/JobSummaryWorkMapper.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; @@ -16,3 +17,23 @@ public interface JobSummaryWorkMapper extends BaseMapper { List queryBySelective(JobSummaryWorkReq gaeaJobSummaryWorkReq); } +======= +package com.dite.znpt.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.dite.znpt.domain.entity.job.JobSummaryWork; +import com.dite.znpt.domain.vo.job.req.JobSummaryWorkReq; +import com.dite.znpt.domain.vo.job.resp.JobSummaryWorkResp; + +import java.util.List; + +/** + * @author huise23 + * @date 2025/04/24 14:52 + * @Description: 表数据库访问层 + */ +public interface JobSummaryWorkMapper extends BaseMapper { + List queryBySelective(JobSummaryWorkReq gaeaJobSummaryWorkReq); +} + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/mapper/MenuMapper.java b/core/src/main/java/com/dite/znpt/mapper/MenuMapper.java index be4a879..78f6844 100644 --- a/core/src/main/java/com/dite/znpt/mapper/MenuMapper.java +++ b/core/src/main/java/com/dite/znpt/mapper/MenuMapper.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; @@ -31,3 +32,38 @@ public interface MenuMapper extends BaseMapper { **/ List downwardRecursionSelect(@Param("menuId") String menuId, @Param("terminalType") String terminalType); } +======= +package com.dite.znpt.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.dite.znpt.domain.entity.DeptEntity; +import com.dite.znpt.domain.entity.MenuEntity; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * @author Bear.G + * @date 2025/5/21/周三 10:16 + * @description + */ +public interface MenuMapper extends BaseMapper { + /** + * @Author Bear.G + * @Date 2025/5/20/周二 15:49 + * @description 向上递归查询菜单树 + * @param menuName + * @return + **/ + List upwardRecursionSelect(@Param("menuName") String menuName, @Param("terminalType") String terminalType); + + /** + * @Author Bear.G + * @Date 2025/5/20/周二 15:49 + * @description 向下递归查询菜单树 + * @param menuId + * @return + **/ + List downwardRecursionSelect(@Param("menuId") String menuId, @Param("terminalType") String terminalType); +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/mapper/ModelConfigMapper.java b/core/src/main/java/com/dite/znpt/mapper/ModelConfigMapper.java index 18c04a1..4bedbe8 100644 --- a/core/src/main/java/com/dite/znpt/mapper/ModelConfigMapper.java +++ b/core/src/main/java/com/dite/znpt/mapper/ModelConfigMapper.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; @@ -16,3 +17,23 @@ public interface ModelConfigMapper extends BaseMapper { List queryBySelective(ModelConfigListReq modelConfigReq); } +======= +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 { + List queryBySelective(ModelConfigListReq modelConfigReq); +} + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/mapper/OutbidInfoMapper.java b/core/src/main/java/com/dite/znpt/mapper/OutbidInfoMapper.java new file mode 100644 index 0000000..4c51729 --- /dev/null +++ b/core/src/main/java/com/dite/znpt/mapper/OutbidInfoMapper.java @@ -0,0 +1,19 @@ +package com.dite.znpt.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.dite.znpt.domain.entity.OutbidInfoEntity; +import com.dite.znpt.domain.vo.OutbidInfoResp; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * @author Bear.G + * @date 2025/7/28/周一 16:11 + * @description + */ +public interface OutbidInfoMapper extends BaseMapper { + List listOutbidInfoResp(@Param("projectName") String projectName); + + OutbidInfoResp getOutbidInfoResp(@Param("outbidInfoId") String outbidInfoId); +} diff --git a/core/src/main/java/com/dite/znpt/mapper/PartMapper.java b/core/src/main/java/com/dite/znpt/mapper/PartMapper.java index bcbb2cf..21b2202 100644 --- a/core/src/main/java/com/dite/znpt/mapper/PartMapper.java +++ b/core/src/main/java/com/dite/znpt/mapper/PartMapper.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; @@ -16,3 +17,23 @@ public interface PartMapper extends BaseMapper { List queryBySelective(PartListReq partReq); } +======= +package com.dite.znpt.mapper; + +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 java.util.List; + +/** + * @author huise23 + * @date 2025/04/11 23:17 + * @Description: 部件表数据库访问层 + */ +public interface PartMapper extends BaseMapper { + List queryBySelective(PartListReq partReq); +} + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/mapper/PostMapper.java b/core/src/main/java/com/dite/znpt/mapper/PostMapper.java index 9c2ddb4..05ca108 100644 --- a/core/src/main/java/com/dite/znpt/mapper/PostMapper.java +++ b/core/src/main/java/com/dite/znpt/mapper/PostMapper.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; @@ -10,3 +11,17 @@ import com.dite.znpt.domain.entity.PostEntity; */ public interface PostMapper extends BaseMapper { } +======= +package com.dite.znpt.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.dite.znpt.domain.entity.PostEntity; + +/** + * @author Bear.G + * @date 2025/5/20/周二 10:16 + * @description + */ +public interface PostMapper extends BaseMapper { +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/mapper/ProjectBudgetInfoMapper.java b/core/src/main/java/com/dite/znpt/mapper/ProjectBudgetInfoMapper.java index 306663c..897dbe9 100644 --- a/core/src/main/java/com/dite/znpt/mapper/ProjectBudgetInfoMapper.java +++ b/core/src/main/java/com/dite/znpt/mapper/ProjectBudgetInfoMapper.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; @@ -18,3 +19,25 @@ public interface ProjectBudgetInfoMapper extends BaseMapper detailByProjectId(String projectId); } +======= +package com.dite.znpt.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.dite.znpt.domain.entity.ProjectBudgetInfoEntity; +import com.dite.znpt.domain.vo.ProjectBudgetInfoListReq; +import com.dite.znpt.domain.vo.ProjectBudgetInfoListResp; +import com.dite.znpt.domain.vo.ProjectBudgetInfoResp; + +import java.util.List; + +/** + * @author huise23 + * @date 2025/07/17 21:58 + * @Description: 项目预算信息表数据库访问层 + */ +public interface ProjectBudgetInfoMapper extends BaseMapper { + List queryBySelective(ProjectBudgetInfoListReq projectBudgetInfoReq); + List detailByProjectId(String projectId); +} + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/mapper/ProjectDailyReportMapper.java b/core/src/main/java/com/dite/znpt/mapper/ProjectDailyReportMapper.java new file mode 100644 index 0000000..be32858 --- /dev/null +++ b/core/src/main/java/com/dite/znpt/mapper/ProjectDailyReportMapper.java @@ -0,0 +1,18 @@ +package com.dite.znpt.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.dite.znpt.domain.entity.ProjectDailyReportEntity; +import com.dite.znpt.domain.vo.ProjectDailyReportListReq; +import com.dite.znpt.domain.vo.ProjectDailyReportResp; + +import java.util.List; + +/** + * @author huise23 + * @date 2025/07/27 19:51 + * @Description: 项目日报信息表数据库访问层 + */ +public interface ProjectDailyReportMapper extends BaseMapper { + List queryBySelective(ProjectDailyReportListReq projectDailyReportReq); +} + diff --git a/core/src/main/java/com/dite/znpt/mapper/ProjectTaskGroupMapper.java b/core/src/main/java/com/dite/znpt/mapper/ProjectTaskGroupMapper.java index fd14acc..187e716 100644 --- a/core/src/main/java/com/dite/znpt/mapper/ProjectTaskGroupMapper.java +++ b/core/src/main/java/com/dite/znpt/mapper/ProjectTaskGroupMapper.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; @@ -17,3 +18,24 @@ public interface ProjectTaskGroupMapper extends BaseMapper queryBySelective(ProjectTaskGroupListReq projectTaskGroupReq); } +======= +package com.dite.znpt.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.dite.znpt.domain.entity.ProjectTaskGroupEntity; +import com.dite.znpt.domain.vo.ProjectTaskGroupListReq; +import com.dite.znpt.domain.vo.ProjectTaskGroupResp; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * @author huise23 + * @date 2025/06/24 16:44 + * @Description: 项目任务组信息表数据库访问层 + */ +public interface ProjectTaskGroupMapper extends BaseMapper { + List queryBySelective(ProjectTaskGroupListReq projectTaskGroupReq); +} + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/mapper/ProjectTaskMapper.java b/core/src/main/java/com/dite/znpt/mapper/ProjectTaskMapper.java index 231d82f..98fb09d 100644 --- a/core/src/main/java/com/dite/znpt/mapper/ProjectTaskMapper.java +++ b/core/src/main/java/com/dite/znpt/mapper/ProjectTaskMapper.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; @@ -19,3 +20,26 @@ public interface ProjectTaskMapper extends BaseMapper { List listAllParents(String taskId); } +======= +package com.dite.znpt.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.dite.znpt.domain.entity.ProjectTaskEntity; +import com.dite.znpt.domain.vo.ProjectTaskListReq; +import com.dite.znpt.domain.vo.ProjectTaskResp; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * @author huise23 + * @date 2025/06/24 16:44 + * @Description: 项目任务信息表数据库访问层 + */ +public interface ProjectTaskMapper extends BaseMapper { + List queryBySelective(ProjectTaskListReq projectTaskReq); + + List listAllParents(String taskId); +} + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/mapper/RegulationTypeMapper.java b/core/src/main/java/com/dite/znpt/mapper/RegulationTypeMapper.java new file mode 100644 index 0000000..02d48b8 --- /dev/null +++ b/core/src/main/java/com/dite/znpt/mapper/RegulationTypeMapper.java @@ -0,0 +1,14 @@ +package com.dite.znpt.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.dite.znpt.domain.entity.RegulationTypeEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * @author Bear.G + * @date 2025/6/26/周四 9:28 + * @description 制度类型Mapper接口 + */ +@Mapper +public interface RegulationTypeMapper extends BaseMapper { +} \ No newline at end of file diff --git a/core/src/main/java/com/dite/znpt/mapper/RoleMapper.java b/core/src/main/java/com/dite/znpt/mapper/RoleMapper.java index d586f11..2cb5c83 100644 --- a/core/src/main/java/com/dite/znpt/mapper/RoleMapper.java +++ b/core/src/main/java/com/dite/znpt/mapper/RoleMapper.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; @@ -10,3 +11,17 @@ import com.dite.znpt.domain.entity.RoleEntity; */ public interface RoleMapper extends BaseMapper { } +======= +package com.dite.znpt.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.dite.znpt.domain.entity.RoleEntity; + +/** + * @author Bear.G + * @date 2025/5/21/周三 10:16 + * @description + */ +public interface RoleMapper extends BaseMapper { +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/mapper/RoleMenuMapper.java b/core/src/main/java/com/dite/znpt/mapper/RoleMenuMapper.java index 8e4e567..0845441 100644 --- a/core/src/main/java/com/dite/znpt/mapper/RoleMenuMapper.java +++ b/core/src/main/java/com/dite/znpt/mapper/RoleMenuMapper.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; @@ -10,3 +11,17 @@ import com.dite.znpt.domain.entity.RoleMenuEntity; */ public interface RoleMenuMapper extends BaseMapper { } +======= +package com.dite.znpt.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.dite.znpt.domain.entity.RoleMenuEntity; + +/** + * @author Bear.G + * @date 2025/5/21/周三 10:17 + * @description + */ +public interface RoleMenuMapper extends BaseMapper { +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/mapper/TenderInfoMapper.java b/core/src/main/java/com/dite/znpt/mapper/TenderInfoMapper.java new file mode 100644 index 0000000..a3f004c --- /dev/null +++ b/core/src/main/java/com/dite/znpt/mapper/TenderInfoMapper.java @@ -0,0 +1,20 @@ +package com.dite.znpt.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.dite.znpt.domain.entity.TenderInfoEntity; +import com.dite.znpt.domain.vo.TenderInfoResp; +import org.apache.ibatis.annotations.Param; +import org.springframework.web.bind.annotation.PathVariable; + +import java.util.List; + +/** + * @author Bear.G + * @date 2025/7/28/周一 16:08 + * @description + */ +public interface TenderInfoMapper extends BaseMapper { + List listTenderInfoResp(@Param("projectName") String projectName); + + TenderInfoResp getTenderInfoResp(@Param("tenderInfoId") String tenderInfoId); +} diff --git a/core/src/main/java/com/dite/znpt/mapper/UserPostMapper.java b/core/src/main/java/com/dite/znpt/mapper/UserPostMapper.java index 92fb7b2..35d037a 100644 --- a/core/src/main/java/com/dite/znpt/mapper/UserPostMapper.java +++ b/core/src/main/java/com/dite/znpt/mapper/UserPostMapper.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; @@ -10,3 +11,17 @@ import com.dite.znpt.domain.entity.UserPostEntity; */ public interface UserPostMapper extends BaseMapper { } +======= +package com.dite.znpt.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.dite.znpt.domain.entity.UserPostEntity; + +/** + * @author Bear.G + * @date 2025/5/21/周三 10:15 + * @description + */ +public interface UserPostMapper extends BaseMapper { +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/mapper/UserRoleMapper.java b/core/src/main/java/com/dite/znpt/mapper/UserRoleMapper.java index 8cbb15c..1779596 100644 --- a/core/src/main/java/com/dite/znpt/mapper/UserRoleMapper.java +++ b/core/src/main/java/com/dite/znpt/mapper/UserRoleMapper.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; @@ -10,3 +11,17 @@ import com.dite.znpt.domain.entity.UserRoleEntity; */ public interface UserRoleMapper extends BaseMapper { } +======= +package com.dite.znpt.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.dite.znpt.domain.entity.UserRoleEntity; + +/** + * @author Bear.G + * @date 2025/5/21/周三 10:16 + * @description + */ +public interface UserRoleMapper extends BaseMapper { +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/mapper/VideoFileInfoMapper.java b/core/src/main/java/com/dite/znpt/mapper/VideoFileInfoMapper.java index f6623cd..4120aa4 100644 --- a/core/src/main/java/com/dite/znpt/mapper/VideoFileInfoMapper.java +++ b/core/src/main/java/com/dite/znpt/mapper/VideoFileInfoMapper.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; @@ -17,3 +18,24 @@ public interface VideoFileInfoMapper extends BaseMapper { List queryBySelective(VideoFileInfoListReq videoFileInfoReq); } +======= +package com.dite.znpt.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.dite.znpt.domain.entity.VideoFileInfoEntity; +import com.dite.znpt.domain.vo.VideoFileInfoListReq; +import com.dite.znpt.domain.vo.VideoFileInfoResp; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * @author huise23 + * @date 2025/06/09 09:45 + * @Description: 视频文件信息表数据库访问层 + */ +public interface VideoFileInfoMapper extends BaseMapper { + List queryBySelective(VideoFileInfoListReq videoFileInfoReq); +} + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/mapper/WorkShiftMapper.java b/core/src/main/java/com/dite/znpt/mapper/WorkShiftMapper.java index 26e8cf9..c94852e 100644 --- a/core/src/main/java/com/dite/znpt/mapper/WorkShiftMapper.java +++ b/core/src/main/java/com/dite/znpt/mapper/WorkShiftMapper.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; @@ -10,3 +11,17 @@ import com.dite.znpt.domain.entity.WorkShiftEntity; */ public interface WorkShiftMapper extends BaseMapper { } +======= +package com.dite.znpt.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.dite.znpt.domain.entity.WorkShiftEntity; + +/** + * @author Bear.G + * @date 2025/6/30/周一 10:26 + * @description + */ +public interface WorkShiftMapper extends BaseMapper { +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/service/AttachInfoService.java b/core/src/main/java/com/dite/znpt/service/AttachInfoService.java index 3c4987f..9441586 100644 --- a/core/src/main/java/com/dite/znpt/service/AttachInfoService.java +++ b/core/src/main/java/com/dite/znpt/service/AttachInfoService.java @@ -23,7 +23,11 @@ public interface AttachInfoService extends IService { * @author huise23 * @date 2025/04/11 23:17 **/ +<<<<<<< HEAD List listByBusinessIds(List businessIds, String businessType); +======= + List listByBusinessIds(List businessIds, AttachBusinessTypeEnum businessType); +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f /** * 功能描述:新增附件信息 diff --git a/core/src/main/java/com/dite/znpt/service/AudioFileInfoService.java b/core/src/main/java/com/dite/znpt/service/AudioFileInfoService.java index 4c3234d..eb26046 100644 --- a/core/src/main/java/com/dite/znpt/service/AudioFileInfoService.java +++ b/core/src/main/java/com/dite/znpt/service/AudioFileInfoService.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.service; import com.baomidou.mybatisplus.extension.service.IService; @@ -66,3 +67,73 @@ public interface AudioFileInfoService extends IService { List batchUpload(String imageId, MultipartFile[] files); } +======= +package com.dite.znpt.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.dite.znpt.domain.entity.AudioFileInfoEntity; +import com.dite.znpt.domain.vo.AudioFileInfoListReq; +import com.dite.znpt.domain.vo.AudioFileInfoResp; +import org.springframework.web.multipart.MultipartFile; + +import java.util.List; + +/** + * @author huise23 + * @date 2025/06/23 13:39 + * @Description: 音频文件信息表服务接口 + */ +public interface AudioFileInfoService extends IService { + + /** + * 功能描述:查询音频文件信息列表 + * + * @param audioFileInfoReq 音频文件信息 + * @return {@link List }<{@link AudioFileInfoEntity }> + * @author huise23 + * @date 2025/06/23 13:39 + **/ + List selectList(AudioFileInfoListReq audioFileInfoReq); + + /** + * 功能描述:查询单条音频文件信息 + * + * @param audioId 音频文件信息Id + * @return {@link AudioFileInfoResp } + * @author huise23 + * @date 2025/06/23 13:39 + **/ + AudioFileInfoResp selectById(String audioId); + + /** + * 功能描述:查询单条音频文件信息 + * + * @param imageIds 图像id列表 + * @return {@link List } + * @author huise23 + * @date 2025/06/23 13:39 + **/ + List selectByImageIds(List imageIds); + + /** + * 功能描述:删除音频文件信息 + * + * @param audioId 音频文件信息Id + * @author huise23 + * @date 2025/06/23 13:39 + **/ + void deleteById(String audioId); + + /** + * 功能描述:批量上传 + * + * @param imageId 图像id + * @param files 文件 + * @return {@link List }<{@link AudioFileInfoResp }> + * @author cuizhibin + * @date 2025/06/23 13:57 + **/ + List batchUpload(String imageId, MultipartFile[] files); +} + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/service/AuthService.java b/core/src/main/java/com/dite/znpt/service/AuthService.java index 68a972d..aaa67a8 100644 --- a/core/src/main/java/com/dite/znpt/service/AuthService.java +++ b/core/src/main/java/com/dite/znpt/service/AuthService.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.service; import cn.dev33.satoken.stp.SaTokenInfo; @@ -26,3 +27,33 @@ public interface AuthService { UserInfo getUserInfo(String userId); } +======= +package com.dite.znpt.service; + +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; + +/** + * @author Bear.G + * @date 2025/5/23/周五 14:31 + * @description + */ +public interface AuthService { + + Result doLogin(LoginReq req); + + void modifyPassword(ModifyPasswordReq req); + + void doLogout(); + + List> getMenuInfo(String userId); + + UserInfo getUserInfo(String userId); +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/service/BiddingInfoService.java b/core/src/main/java/com/dite/znpt/service/BiddingInfoService.java new file mode 100644 index 0000000..b4d67d0 --- /dev/null +++ b/core/src/main/java/com/dite/znpt/service/BiddingInfoService.java @@ -0,0 +1,26 @@ +package com.dite.znpt.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.dite.znpt.domain.Result; +import com.dite.znpt.domain.entity.BiddingInfoEntity; +import com.dite.znpt.domain.vo.BiddingInfoReq; +import com.dite.znpt.domain.vo.BiddingInfoResp; +import org.springframework.validation.BindingResult; + +import java.util.List; + +/** + * @author Bear.G + * @date 2025/7/28/周一 16:06 + * @description + */ +public interface BiddingInfoService extends IService { + + List page(String projectName); + List list(String projectName); + void save(BiddingInfoReq req); + void update(String biddingInfoId, BiddingInfoReq req); + void uploadBiddingInfoFile(String biddingInfoId, String biddingFileId); + void apply(String biddingInfoId); + Result importData(List dataList, BindingResult bindingResult); +} diff --git a/core/src/main/java/com/dite/znpt/service/CertificationService.java b/core/src/main/java/com/dite/znpt/service/CertificationService.java index b777a16..595a650 100644 --- a/core/src/main/java/com/dite/znpt/service/CertificationService.java +++ b/core/src/main/java/com/dite/znpt/service/CertificationService.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.service; import com.baomidou.mybatisplus.extension.service.IService; @@ -22,3 +23,29 @@ public interface CertificationService extends IService { void update(String certificationId, CertificationReq req); void deleteById(String certificationId); } +======= +package com.dite.znpt.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.dite.znpt.domain.entity.CertificationEntity; +import com.dite.znpt.domain.vo.CertificationListReq; +import com.dite.znpt.domain.vo.CertificationReq; +import com.dite.znpt.domain.vo.CertificationResp; + +import java.util.List; + +/** + * @author Bear.G + * @date 2025/5/27/周二 15:22 + * @description + */ +public interface CertificationService extends IService { + + List page(CertificationListReq req); + List list(CertificationListReq req); + CertificationResp detail(String certificationId); + void save(CertificationReq req); + void update(String certificationId, CertificationReq req); + void deleteById(String certificationId); +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/service/ContractService.java b/core/src/main/java/com/dite/znpt/service/ContractService.java index fcb0f79..38c3e6b 100644 --- a/core/src/main/java/com/dite/znpt/service/ContractService.java +++ b/core/src/main/java/com/dite/znpt/service/ContractService.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.service; import com.baomidou.mybatisplus.extension.service.IService; @@ -63,3 +64,70 @@ public interface ContractService extends IService { void deleteById(String contractId); } +======= +package com.dite.znpt.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.dite.znpt.domain.entity.ContractEntity; +import com.dite.znpt.domain.vo.ContractListReq; +import com.dite.znpt.domain.vo.ContractResp; +import com.dite.znpt.domain.vo.ContractReq; + +import java.util.List; + +/** + * @author huise23 + * @date 2025/07/21 20:29 + * @Description: 合同表服务接口 + */ +public interface ContractService extends IService { + + /** + * 功能描述:查询合同列表 + * + * @param contractReq 合同 + * @return {@link List }<{@link ContractResp }> + * @author huise23 + * @date 2025/07/21 20:29 + **/ + List selectList(ContractListReq contractReq); + + /** + * 功能描述:查询单条合同 + * + * @param contractId 合同Id + * @return {@link ContractResp } + * @author huise23 + * @date 2025/07/21 20:29 + **/ + ContractResp selectById(String contractId); + + /** + * 功能描述:新增合同 + * + * @param contractReq 合同 + * @author huise23 + * @date 2025/07/21 20:29 + **/ + void saveData(ContractReq contractReq); + + /** + * 功能描述:更新合同 + * + * @param contractReq 合同 + * @author huise23 + * @date 2025/07/21 20:29 + **/ + void updateData(ContractReq contractReq); + + /** + * 功能描述:删除合同 + * + * @param contractId 合同Id + * @author huise23 + * @date 2025/07/21 20:29 + **/ + void deleteById(String contractId); +} + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/service/ContractSettlementService.java b/core/src/main/java/com/dite/znpt/service/ContractSettlementService.java index ecba511..2294d0b 100644 --- a/core/src/main/java/com/dite/znpt/service/ContractSettlementService.java +++ b/core/src/main/java/com/dite/znpt/service/ContractSettlementService.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.service; import com.baomidou.mybatisplus.extension.service.IService; @@ -45,3 +46,52 @@ public interface ContractSettlementService extends IService { + + /** + * 功能描述:查询合同结算列表 + * + * @param contractSettlementReq 合同结算 + * @return {@link List }<{@link ContractSettlementResp }> + * @author huise23 + * @date 2025/07/21 21:10 + **/ + List selectList(ContractSettlementListReq contractSettlementReq); + + /** + * 功能描述:查询单条合同结算 + * + * @param settlementId 合同结算Id + * @return {@link ContractSettlementResp } + * @author huise23 + * @date 2025/07/21 21:10 + **/ + ContractSettlementResp selectById(String settlementId); + + /** + * 功能描述:新增合同结算 + * + * @param contractSettlementReq 合同结算 + * @author huise23 + * @date 2025/07/21 21:10 + **/ + void saveData(ContractSettlementReq contractSettlementReq); +} + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/service/DeptService.java b/core/src/main/java/com/dite/znpt/service/DeptService.java index fa87e6b..0da40d8 100644 --- a/core/src/main/java/com/dite/znpt/service/DeptService.java +++ b/core/src/main/java/com/dite/znpt/service/DeptService.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.service; import cn.hutool.core.lang.tree.Tree; @@ -25,3 +26,32 @@ public interface DeptService extends IService { void deleteById(String deptId); } +======= +package com.dite.znpt.service; + +import cn.hutool.core.lang.tree.Tree; +import com.baomidou.mybatisplus.extension.service.IService; +import com.dite.znpt.domain.entity.DeptEntity; +import com.dite.znpt.domain.vo.DeptReq; +import com.dite.znpt.domain.vo.DeptResp; + +import java.util.List; + +/** + * @author Bear.G + * @date 2025/5/20/周二 10:14 + * @description + */ +public interface DeptService extends IService { + + List> tree(String deptName); + + DeptResp detail(String deptId); + + void save(DeptReq req); + + void update(String deptId, DeptReq req); + + void deleteById(String deptId); +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/service/DictService.java b/core/src/main/java/com/dite/znpt/service/DictService.java index ad952a9..29ea5f0 100644 --- a/core/src/main/java/com/dite/znpt/service/DictService.java +++ b/core/src/main/java/com/dite/znpt/service/DictService.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.service; import com.baomidou.mybatisplus.extension.service.IService; @@ -63,3 +64,70 @@ public interface DictService extends IService { void deleteById(String dictId); } +======= +package com.dite.znpt.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.dite.znpt.domain.entity.DictEntity; +import com.dite.znpt.domain.vo.DictListReq; +import com.dite.znpt.domain.vo.DictReq; +import com.dite.znpt.domain.vo.DictResp; + +import java.util.List; + +/** + * @author huise23 + * @date 2025/06/30 11:38 + * @Description: 字典表服务接口 + */ +public interface DictService extends IService { + + /** + * 功能描述:查询字典列表 + * + * @param dictReq 字典 + * @return {@link List }<{@link DictResp }> + * @author huise23 + * @date 2025/06/30 11:38 + **/ + List selectList(DictListReq dictReq); + + /** + * 功能描述:查询单条字典 + * + * @param dictId 字典Id + * @return {@link DictResp } + * @author huise23 + * @date 2025/06/30 11:38 + **/ + DictResp selectById(String dictId); + + /** + * 功能描述:新增字典 + * + * @param dictReq 字典 + * @author huise23 + * @date 2025/06/30 11:38 + **/ + void saveData(DictReq dictReq); + + /** + * 功能描述:更新字典 + * + * @param dictReq 字典 + * @author huise23 + * @date 2025/06/30 11:38 + **/ + void updateData(DictReq dictReq); + + /** + * 功能描述:删除字典 + * + * @param dictId 字典Id + * @author huise23 + * @date 2025/06/30 11:38 + **/ + void deleteById(String dictId); +} + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/service/EquipmentService.java b/core/src/main/java/com/dite/znpt/service/EquipmentService.java index 04d023b..53c6324 100644 --- a/core/src/main/java/com/dite/znpt/service/EquipmentService.java +++ b/core/src/main/java/com/dite/znpt/service/EquipmentService.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.service; import com.baomidou.mybatisplus.extension.service.IService; @@ -22,3 +23,29 @@ public interface EquipmentService extends IService { void update(String equipmentId, EquipmentReq req); void deleteById(String equipmentId); } +======= +package com.dite.znpt.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.dite.znpt.domain.entity.EquipmentEntity; +import com.dite.znpt.domain.vo.EquipmentListReq; +import com.dite.znpt.domain.vo.EquipmentReq; +import com.dite.znpt.domain.vo.EquipmentResp; +import com.dite.znpt.domain.vo.EquipmentUseRecordReq; + +import java.util.List; + +/** + * @author Bear.G + * @date 2025/7/23/周三 17:39 + * @description + */ +public interface EquipmentService extends IService { + List page(EquipmentListReq req); + List list(EquipmentListReq req); + EquipmentResp detail(String equipmentId); + void save(EquipmentReq req); + void update(String equipmentId, EquipmentReq req); + void deleteById(String equipmentId); +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/service/EquipmentUseRecordService.java b/core/src/main/java/com/dite/znpt/service/EquipmentUseRecordService.java index 00a5528..72e983e 100644 --- a/core/src/main/java/com/dite/znpt/service/EquipmentUseRecordService.java +++ b/core/src/main/java/com/dite/znpt/service/EquipmentUseRecordService.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.service; import com.baomidou.mybatisplus.extension.service.IService; @@ -20,3 +21,27 @@ public interface EquipmentUseRecordService extends IService { + List page(EquipmentUseRecordListReq req); + List list(EquipmentUseRecordListReq req); + List detail(String equipmentId); + void borrowEquipment(String equipmentId, EquipmentUseRecordReq req); + void returnEquipment(String userRecordId, EquipmentUseRecordReq req); +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/service/ImageService.java b/core/src/main/java/com/dite/znpt/service/ImageService.java index 19653c5..3f7b387 100644 --- a/core/src/main/java/com/dite/znpt/service/ImageService.java +++ b/core/src/main/java/com/dite/znpt/service/ImageService.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.service; import com.baomidou.mybatisplus.extension.service.IService; @@ -54,3 +55,61 @@ public interface ImageService extends IService { **/ void reviewImages(List imageIds); } +======= +package com.dite.znpt.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.dite.znpt.domain.entity.ImageEntity; +import com.dite.znpt.domain.vo.*; +import org.springframework.web.multipart.MultipartFile; + +import java.io.IOException; +import java.util.List; + +/** + * @author Bear.G + * @date 2025/4/24/周四 13:14 + * @description + */ +public interface ImageService extends IService { + + List list(ImageListReq req); + + List page(ImageListReq req); + + List batchSaveByImageSimpleReq(List list); + + ImageResp detail(String imageId); + + List batchUploadDefectImage(String partId, String imageSource, ImageCollectReq collectReq, MultipartFile[] files); + + List uploadProjectBatch(String projectId, String imageSource, ImageCollectReq collectReq, MultipartFile[] files); + + List batchUploadCommonImage(String imageSource, ImageWorkReq imageWorkReq, MultipartFile[] file) throws IOException; + + void delete(String imageId); + + /** + * 分页列出APP上传的图片,并关联查询机组信息 + * @return {@link List }<{@link AppImageResp }> + */ + List listAppUploadImages(); + + /** + * 功能描述:链接APP上传的图像到部件 + * + * @author cuizhibin + * @date 2025/06/06 09:44 + **/ + void linkAppImagesToPart(AppImageToPartReq partReq); + + /** + * 功能描述:审核图片 + * + * @param imageIds 图片id列表 + * @author cuizhibin + * @date 2025/07/16 15:28 + **/ + void reviewImages(List imageIds); +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/service/InspectionReportService.java b/core/src/main/java/com/dite/znpt/service/InspectionReportService.java index 7b75565..55effd9 100644 --- a/core/src/main/java/com/dite/znpt/service/InspectionReportService.java +++ b/core/src/main/java/com/dite/znpt/service/InspectionReportService.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.service; import com.baomidou.mybatisplus.extension.service.IService; @@ -39,3 +40,46 @@ public interface InspectionReportService extends IService { + List page(InspectionReportListReq req); + List list(InspectionReportListReq req); + InspectionReportResp detail(String reportId); + void save(InspectionReportReq req); + void update(String reportId, InspectionReportReq req); + + /** + * 功能描述:报告生成器 + * + * @param turbineId 机组id + * @author cuizhibin + * @date 2025/07/17 10:49 + **/ + void reportGenerator(String turbineId); + + /** + * 功能描述:发布 + * + * @param reportId 报告id + * @author cuizhibin + * @date 2025/07/17 21:25 + **/ + void publish(String reportId); +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/service/InsuranceCompanyService.java b/core/src/main/java/com/dite/znpt/service/InsuranceCompanyService.java index 220f2a9..985c955 100644 --- a/core/src/main/java/com/dite/znpt/service/InsuranceCompanyService.java +++ b/core/src/main/java/com/dite/znpt/service/InsuranceCompanyService.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.service; import com.baomidou.mybatisplus.extension.service.IService; @@ -21,3 +22,28 @@ public interface InsuranceCompanyService extends IService { + List page(InsuranceCompanyListReq req); + List list(InsuranceCompanyListReq req); + InsuranceCompanyResp detail(String insuranceCompanyId); + void save(InsuranceCompanyReq req); + void update(String insuranceCompanyId, InsuranceCompanyReq req); + void deleteById(String insuranceCompanyId); +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/service/InsuranceInfoService.java b/core/src/main/java/com/dite/znpt/service/InsuranceInfoService.java index e556a26..cee3240 100644 --- a/core/src/main/java/com/dite/znpt/service/InsuranceInfoService.java +++ b/core/src/main/java/com/dite/znpt/service/InsuranceInfoService.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.service; import com.baomidou.mybatisplus.extension.service.IService; @@ -25,3 +26,32 @@ public interface InsuranceInfoService extends IService { void update(String insuranceInfoId, InsuranceInfoReq req); void deleteById(String insuranceInfoId); } +======= +package com.dite.znpt.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.dite.znpt.domain.entity.InsuranceInfoEntity; +import com.dite.znpt.domain.vo.InsuranceAttachResp; +import com.dite.znpt.domain.vo.InsuranceInfoListReq; +import com.dite.znpt.domain.vo.InsuranceInfoReq; +import com.dite.znpt.domain.vo.InsuranceInfoResp; +import org.springframework.web.multipart.MultipartFile; + +import java.util.List; + +/** + * @author Bear.G + * @date 2025/6/26/周四 9:28 + * @description + */ +public interface InsuranceInfoService extends IService { + List page(InsuranceInfoListReq req); + List list(InsuranceInfoListReq req); + List pageAttach(InsuranceInfoListReq req); + List listAttach(InsuranceInfoListReq req); + InsuranceInfoResp detail(String insuranceInfoId); + void save(InsuranceInfoReq req); + void update(String insuranceInfoId, InsuranceInfoReq req); + void deleteById(String insuranceInfoId); +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/service/InsuranceTypeService.java b/core/src/main/java/com/dite/znpt/service/InsuranceTypeService.java index 8402d28..3ee309b 100644 --- a/core/src/main/java/com/dite/znpt/service/InsuranceTypeService.java +++ b/core/src/main/java/com/dite/znpt/service/InsuranceTypeService.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.service; import com.baomidou.mybatisplus.extension.service.IService; @@ -21,3 +22,28 @@ public interface InsuranceTypeService extends IService { void update(String insuranceTypeId, InsuranceTypeReq req); void deleteById(String insuranceTypeId); } +======= +package com.dite.znpt.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.dite.znpt.domain.entity.InsuranceTypeEntity; +import com.dite.znpt.domain.vo.InsuranceTypeReq; +import com.dite.znpt.domain.vo.InsuranceTypeResp; + +import java.util.List; + +/** + * @author Bear.G + * @date 2025/6/26/周四 9:28 + * @description + */ +public interface InsuranceTypeService extends IService { + + List page(String insuranceTypeName); + List list(String insuranceTypeName); + InsuranceTypeResp detail(String insuranceTypeId); + void save(InsuranceTypeReq req); + void update(String insuranceTypeId, InsuranceTypeReq req); + void deleteById(String insuranceTypeId); +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/service/MenuService.java b/core/src/main/java/com/dite/znpt/service/MenuService.java index 1cfd010..1d0e434 100644 --- a/core/src/main/java/com/dite/znpt/service/MenuService.java +++ b/core/src/main/java/com/dite/znpt/service/MenuService.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.service; import cn.hutool.core.lang.tree.Tree; @@ -21,3 +22,28 @@ public interface MenuService extends IService { void update(String menuId, MenuReq req); void deleteById(String menuId); } +======= +package com.dite.znpt.service; + +import cn.hutool.core.lang.tree.Tree; +import com.baomidou.mybatisplus.extension.service.IService; +import com.dite.znpt.domain.entity.MenuEntity; +import com.dite.znpt.domain.vo.MenuReq; +import com.dite.znpt.domain.vo.MenuResp; + +import java.util.List; + +/** + * @author Bear.G + * @date 2025/5/21/周三 10:24 + * @description + */ +public interface MenuService extends IService { + + List> tree(String menuName, String terminalType); + MenuResp detail(String menuId); + void save(MenuReq req); + void update(String menuId, MenuReq req); + void deleteById(String menuId); +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/service/ModelConfigService.java b/core/src/main/java/com/dite/znpt/service/ModelConfigService.java index 1ae7fb5..14b6589 100644 --- a/core/src/main/java/com/dite/znpt/service/ModelConfigService.java +++ b/core/src/main/java/com/dite/znpt/service/ModelConfigService.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.service; import com.baomidou.mybatisplus.extension.service.IService; @@ -63,3 +64,70 @@ public interface ModelConfigService extends IService { void deleteById(String modelId); } +======= +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 { + + /** + * 功能描述:查询列表 + * + * @param modelConfigReq + * @return {@link List }<{@link ModelConfigResp }> + * @author huise23 + * @date 2025/07/02 20:57 + **/ + List 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); +} + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/service/OutbidInfoService.java b/core/src/main/java/com/dite/znpt/service/OutbidInfoService.java new file mode 100644 index 0000000..0325149 --- /dev/null +++ b/core/src/main/java/com/dite/znpt/service/OutbidInfoService.java @@ -0,0 +1,25 @@ +package com.dite.znpt.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.dite.znpt.domain.entity.OutbidInfoEntity; +import com.dite.znpt.domain.vo.OutbidInfoReq; +import com.dite.znpt.domain.vo.OutbidInfoResp; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; + +/** + * @author Bear.G + * @date 2025/7/28/周一 16:11 + * @description + */ +public interface OutbidInfoService extends IService { + + List page(String projectName); + List list(String projectName); + OutbidInfoResp detail(String outbidInfoId); + void save(OutbidInfoReq req); + void update(String outbidInfoId, OutbidInfoReq req); + void deleteById(String outbidInfoId); + void downLoadOutbidNoticeFile(String outbidFileId, HttpServletResponse response) throws Exception; +} diff --git a/core/src/main/java/com/dite/znpt/service/PartService.java b/core/src/main/java/com/dite/znpt/service/PartService.java index 19c72ff..b626549 100644 --- a/core/src/main/java/com/dite/znpt/service/PartService.java +++ b/core/src/main/java/com/dite/znpt/service/PartService.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.service; import com.baomidou.mybatisplus.extension.service.IService; @@ -90,3 +91,97 @@ public interface PartService extends IService { List listInfos(List partIds); } +======= +package com.dite.znpt.service; + +import com.baomidou.mybatisplus.extension.service.IService; +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.PartReq; +import com.dite.znpt.domain.vo.PartResp; + +import java.util.List; + +/** + * @author huise23 + * @date 2025/04/11 23:17 + * @Description: 部件表服务接口 + */ +public interface PartService extends IService { + + /** + * 功能描述:分页查询列表 + * + * @param partReq + * @return {@link List }<{@link PartListResp }> + * @author huise23 + * @date 2025/04/11 23:17 + **/ + List page(PartListReq partReq); + + /** + * 功能描述:查询列表 + * + * @param partReq + * @return {@link List }<{@link PartListResp }> + * @author huise23 + * @date 2025/04/11 23:17 + **/ + List list(PartListReq partReq); + + /** + * 功能描述:查询单条 + * + * @param partId Id + * @return {@link PartResp } + * @author huise23 + * @date 2025/04/11 23:17 + **/ + PartResp detail(String partId); + + /** + * 功能描述:新增 + * + * @param req + * @author huise23 + * @date 2025/04/11 23:17 + **/ + void save(PartReq req); + + /** + * 功能描述:更新 + * + * @param req + * @author huise23 + * @date 2025/04/11 23:17 + **/ + void update(String partId, PartReq req); + + /** + * 功能描述:删除 + * + * @param partId Id + * @author huise23 + * @date 2025/04/11 23:17 + **/ + void deleteById(String partId); + + /** + * 功能描述:删除 + * + * @param turbineIds 机组id + * @author huise23 + * @date 2025/04/11 23:17 + **/ + void deleteByTurbineIds(List turbineIds); + + /** + * 查询完整部件信息,包含机组、项目 + * @param partIds + * @return {@link List }<{@link PartResp }> + */ + List listInfos(List partIds); +} + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/service/PostService.java b/core/src/main/java/com/dite/znpt/service/PostService.java index 397c998..2ed84af 100644 --- a/core/src/main/java/com/dite/znpt/service/PostService.java +++ b/core/src/main/java/com/dite/znpt/service/PostService.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.service; import com.baomidou.mybatisplus.extension.service.IService; @@ -26,3 +27,33 @@ public interface PostService extends IService { void deleteById(String postId); } +======= +package com.dite.znpt.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.dite.znpt.domain.entity.PostEntity; +import com.dite.znpt.domain.vo.PostReq; +import com.dite.znpt.domain.vo.PostResp; + +import java.util.List; + +/** + * @author Bear.G + * @date 2025/5/20/周二 10:20 + * @description + */ +public interface PostService extends IService { + + List page(String postName); + + List list(String postName); + + PostResp detail(String postId); + + void save(PostReq req); + + void update(String postId, PostReq req); + + void deleteById(String postId); +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/service/ProjectBudgetInfoService.java b/core/src/main/java/com/dite/znpt/service/ProjectBudgetInfoService.java index bddb3c4..166caee 100644 --- a/core/src/main/java/com/dite/znpt/service/ProjectBudgetInfoService.java +++ b/core/src/main/java/com/dite/znpt/service/ProjectBudgetInfoService.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.service; import com.baomidou.mybatisplus.extension.service.IService; @@ -46,3 +47,53 @@ public interface ProjectBudgetInfoService extends IService projectBudgetInfoReq); } +======= +package com.dite.znpt.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.dite.znpt.domain.entity.ProjectBudgetInfoEntity; +import com.dite.znpt.domain.vo.ProjectBudgetInfoListReq; +import com.dite.znpt.domain.vo.ProjectBudgetInfoListResp; +import com.dite.znpt.domain.vo.ProjectBudgetInfoReq; +import com.dite.znpt.domain.vo.ProjectBudgetInfoResp; + +import java.util.List; + +/** + * @author huise23 + * @date 2025/07/17 21:58 + * @Description: 项目预算信息表服务接口 + */ +public interface ProjectBudgetInfoService extends IService { + + /** + * 功能描述:查询项目预算信息列表 + * + * @param projectBudgetInfoReq 项目预算信息 + * @return {@link List }<{@link ProjectBudgetInfoListResp }> + * @author huise23 + * @date 2025/07/17 21:58 + **/ + List selectList(ProjectBudgetInfoListReq projectBudgetInfoReq); + + /** + * 功能描述:根据项目id获取项目预算信息列表 + * + * @param projectId 项目id + * @return {@link List }<{@link ProjectBudgetInfoListResp }> + * @author huise23 + * @date 2025/07/17 21:58 + **/ + List detailByProjectId(String projectId); + + /** + * 功能描述:新增项目预算信息 + * + * @param projectBudgetInfoReq 项目预算信息 + * @author huise23 + * @date 2025/07/17 21:58 + **/ + void saveData(List projectBudgetInfoReq); +} + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/service/ProjectDailyReportService.java b/core/src/main/java/com/dite/znpt/service/ProjectDailyReportService.java new file mode 100644 index 0000000..e11a964 --- /dev/null +++ b/core/src/main/java/com/dite/znpt/service/ProjectDailyReportService.java @@ -0,0 +1,74 @@ +package com.dite.znpt.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.dite.znpt.domain.entity.ProjectDailyReportEntity; +import com.dite.znpt.domain.vo.ProjectDailyReportListReq; +import com.dite.znpt.domain.vo.ProjectDailyReportReq; +import com.dite.znpt.domain.vo.ProjectDailyReportResp; + +import java.util.List; + +/** + * @author huise23 + * @date 2025/07/27 19:51 + * @Description: 项目日报信息表服务接口 + */ +public interface ProjectDailyReportService extends IService { + + /** + * 功能描述:查询项目日报信息列表 + * + * @param projectDailyReportReq 项目日报信息 + * @return {@link List }<{@link ProjectDailyReportResp }> + * @author huise23 + * @date 2025/07/27 19:51 + **/ + List selectList(ProjectDailyReportListReq projectDailyReportReq); + + /** + * 功能描述:查询单条项目日报信息 + * + * @param reportId 项目日报信息Id + * @return {@link ProjectDailyReportResp } + * @author huise23 + * @date 2025/07/27 19:51 + **/ + ProjectDailyReportResp selectById(String reportId); + + /** + * 功能描述:新增项目日报信息 + * + * @param projectDailyReportReq 项目日报信息 + * @author huise23 + * @date 2025/07/27 19:51 + **/ + void saveData(ProjectDailyReportReq projectDailyReportReq); + + /** + * 功能描述:更新项目日报信息 + * + * @param projectDailyReportReq 项目日报信息 + * @author huise23 + * @date 2025/07/27 19:51 + **/ + void updateData(ProjectDailyReportReq projectDailyReportReq); + + /** + * 功能描述:删除项目日报信息 + * + * @param reportId 项目日报信息Id + * @author huise23 + * @date 2025/07/27 19:51 + **/ + void deleteById(String reportId); + + /** + * 功能描述:我今天 + * + * @return {@link ProjectDailyReportResp } + * @author cuizhibin + * @date 2025/07/27 19:53 + **/ + ProjectDailyReportResp myToday(String projectId); +} + diff --git a/core/src/main/java/com/dite/znpt/service/ProjectTaskGroupService.java b/core/src/main/java/com/dite/znpt/service/ProjectTaskGroupService.java index fac0fa2..a59d409 100644 --- a/core/src/main/java/com/dite/znpt/service/ProjectTaskGroupService.java +++ b/core/src/main/java/com/dite/znpt/service/ProjectTaskGroupService.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.service; import com.baomidou.mybatisplus.extension.service.IService; @@ -53,3 +54,60 @@ public interface ProjectTaskGroupService extends IService { + + /** + * 功能描述:查询项目任务组信息列表 + * + * @param projectTaskGroupReq 项目任务组信息 + * @return {@link List }<{@link ProjectTaskGroupResp }> + * @author huise23 + * @date 2025/06/25 17:21 + **/ + List selectList(ProjectTaskGroupListReq projectTaskGroupReq); + + /** + * 功能描述:新增项目任务组信息 + * + * @param projectTaskGroupReq 项目任务组信息 + * @author huise23 + * @date 2025/06/25 17:21 + **/ + void saveData(ProjectTaskGroupReq projectTaskGroupReq); + + /** + * 功能描述:更新项目任务组信息 + * + * @param projectTaskGroupReq 项目任务组信息 + * @author huise23 + * @date 2025/06/25 17:21 + **/ + void updateData(ProjectTaskGroupReq projectTaskGroupReq); + + /** + * 功能描述:删除项目任务组信息 + * + * @param groupId 项目任务组信息Id + * @author huise23 + * @date 2025/06/25 17:21 + **/ + void deleteById(String groupId); +} + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/service/ProjectTaskService.java b/core/src/main/java/com/dite/znpt/service/ProjectTaskService.java index 4d47b66..712bb45 100644 --- a/core/src/main/java/com/dite/znpt/service/ProjectTaskService.java +++ b/core/src/main/java/com/dite/znpt/service/ProjectTaskService.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.service; import com.baomidou.mybatisplus.extension.service.IService; @@ -91,3 +92,98 @@ public interface ProjectTaskService extends IService { void endTask(ProjectTaskStartReq taskStartReq); } +======= +package com.dite.znpt.service; + +import com.baomidou.mybatisplus.extension.service.IService; +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.ProjectTaskStartReq; + +import java.util.List; + +/** + * @author huise23 + * @date 2025/06/25 17:21 + * @Description: 项目任务信息表服务接口 + */ +public interface ProjectTaskService extends IService { + + /** + * 功能描述:查询项目任务信息列表 + * + * @param projectTaskReq 项目任务信息 + * @return {@link List }<{@link ProjectTaskResp }> + * @author huise23 + * @date 2025/06/25 17:21 + **/ + List selectList(ProjectTaskListReq projectTaskReq); + + /** + * 功能描述:查询单条项目任务信息 + * + * @param taskId 项目任务信息Id + * @return {@link ProjectTaskResp } + * @author huise23 + * @date 2025/06/25 17:21 + **/ + ProjectTaskResp selectById(String taskId); + + /** + * 功能描述:新增项目任务信息 + * + * @param projectTaskReq 项目任务信息 + * @author huise23 + * @date 2025/06/25 17:21 + **/ + void saveData(ProjectTaskReq projectTaskReq); + + /** + * 功能描述:更新项目任务信息 + * + * @param projectTaskReq 项目任务信息 + * @author huise23 + * @date 2025/06/25 17:21 + **/ + void updateData(ProjectTaskReq projectTaskReq); + + /** + * 功能描述:删除项目任务信息 + * + * @param taskId 项目任务信息Id + * @author huise23 + * @date 2025/06/25 17:21 + **/ + void deleteById(String taskId); + + /** + * 功能描述:删除项目任务信息 + * + * @param groupId 项目任务组信息Id + * @author huise23 + * @date 2025/06/25 17:21 + **/ + void deleteByGroupId(String groupId); + + /** + * 功能描述:开始任务/任务组开始任务 + * + * @param taskStartReq 任务启动请求类 + * @author cuizhibin + * @date 2025/06/25 21:16 + **/ + void startTask(ProjectTaskStartReq taskStartReq); + + /** + * 功能描述:结束任务/任务组结束任务 + * + * @param taskStartReq 任务启动请求类 + * @author cuizhibin + * @date 2025/06/25 21:16 + **/ + void endTask(ProjectTaskStartReq taskStartReq); +} + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/service/RegulationTypeService.java b/core/src/main/java/com/dite/znpt/service/RegulationTypeService.java new file mode 100644 index 0000000..9eadc8c --- /dev/null +++ b/core/src/main/java/com/dite/znpt/service/RegulationTypeService.java @@ -0,0 +1,23 @@ +package com.dite.znpt.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.dite.znpt.domain.entity.RegulationTypeEntity; +import com.dite.znpt.domain.vo.RegulationTypeReq; +import com.dite.znpt.domain.vo.RegulationTypeResp; + +import java.util.List; + +/** + * @author Bear.G + * @date 2025/6/26/周四 9:28 + * @description 制度类型Service接口 + */ +public interface RegulationTypeService extends IService { + + List page(String regulationTypeName, Integer status, String remark); + List list(String regulationTypeName, Integer status, String remark); + RegulationTypeResp detail(String regulationTypeId); + void save(RegulationTypeReq req); + void update(String regulationTypeId, RegulationTypeReq req); + void deleteById(String regulationTypeId); +} \ No newline at end of file diff --git a/core/src/main/java/com/dite/znpt/service/RoleMenuService.java b/core/src/main/java/com/dite/znpt/service/RoleMenuService.java index f786b41..6f037fd 100644 --- a/core/src/main/java/com/dite/znpt/service/RoleMenuService.java +++ b/core/src/main/java/com/dite/znpt/service/RoleMenuService.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.service; import com.baomidou.mybatisplus.extension.service.IService; @@ -15,3 +16,22 @@ public interface RoleMenuService extends IService { void bindRoleMenu(RoleMenuReq req); } +======= +package com.dite.znpt.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.dite.znpt.domain.entity.RoleMenuEntity; +import com.dite.znpt.domain.vo.RoleMenuReq; + +import java.util.List; + +/** + * @author Bear.G + * @date 2025/5/21/周三 16:01 + * @description + */ +public interface RoleMenuService extends IService { + + void bindRoleMenu(RoleMenuReq req); +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/service/RoleService.java b/core/src/main/java/com/dite/znpt/service/RoleService.java index d4cd45b..243e48a 100644 --- a/core/src/main/java/com/dite/znpt/service/RoleService.java +++ b/core/src/main/java/com/dite/znpt/service/RoleService.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.service; import com.baomidou.mybatisplus.extension.service.IService; @@ -26,3 +27,33 @@ public interface RoleService extends IService { RoleResp detail(String roleId); } +======= +package com.dite.znpt.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.dite.znpt.domain.entity.RoleEntity; +import com.dite.znpt.domain.vo.RoleReq; +import com.dite.znpt.domain.vo.RoleResp; + +import java.util.List; + +/** + * @author Bear.G + * @date 2025/5/21/周三 10:24 + * @description + */ +public interface RoleService extends IService { + + List page(String roleName); + + List list(String roleName); + + void save(RoleReq req); + + void update(String roleId, RoleReq req); + + void deleteById(String id); + + RoleResp detail(String roleId); +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/service/TenderInfoService.java b/core/src/main/java/com/dite/znpt/service/TenderInfoService.java new file mode 100644 index 0000000..a767f49 --- /dev/null +++ b/core/src/main/java/com/dite/znpt/service/TenderInfoService.java @@ -0,0 +1,23 @@ +package com.dite.znpt.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.dite.znpt.domain.entity.TenderInfoEntity; +import com.dite.znpt.domain.vo.TenderInfoReq; +import com.dite.znpt.domain.vo.TenderInfoResp; + +import java.util.List; + +/** + * @author Bear.G + * @date 2025/7/28/周一 16:09 + * @description + */ +public interface TenderInfoService extends IService { + List page(String projectName); + List list(String projectName); + TenderInfoResp detail(String tenderInfoId); + void save(TenderInfoReq req); + void update(String tenderInfoId, TenderInfoReq req); + void deleteById(String tenderInfoId); + +} diff --git a/core/src/main/java/com/dite/znpt/service/UserPostService.java b/core/src/main/java/com/dite/znpt/service/UserPostService.java index ea3dcda..28a207b 100644 --- a/core/src/main/java/com/dite/znpt/service/UserPostService.java +++ b/core/src/main/java/com/dite/znpt/service/UserPostService.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.service; import com.baomidou.mybatisplus.extension.service.IService; @@ -17,3 +18,24 @@ public interface UserPostService extends IService { void bindUserPost(String userId, List postIds); void bindPostUser(String postId, List userIds); } +======= +package com.dite.znpt.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.dite.znpt.domain.entity.PostEntity; +import com.dite.znpt.domain.entity.UserPostEntity; +import com.dite.znpt.domain.vo.PostResp; + +import java.util.List; + +/** + * @author Bear.G + * @date 2025/5/21/周三 15:39 + * @description + */ +public interface UserPostService extends IService { + List getPostsByUserId(String userId); + void bindUserPost(String userId, List postIds); + void bindPostUser(String postId, List userIds); +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/service/UserRoleService.java b/core/src/main/java/com/dite/znpt/service/UserRoleService.java index c5ab0d8..2008d74 100644 --- a/core/src/main/java/com/dite/znpt/service/UserRoleService.java +++ b/core/src/main/java/com/dite/znpt/service/UserRoleService.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.service; import com.baomidou.mybatisplus.extension.service.IService; @@ -20,3 +21,27 @@ public interface UserRoleService extends IService { void bindRoleUser(String roleId, List userIds); } +======= +package com.dite.znpt.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.dite.znpt.domain.entity.UserRoleEntity; +import com.dite.znpt.domain.vo.RoleResp; +import com.dite.znpt.domain.vo.UserRoleReq; + +import java.util.List; + +/** + * @author Bear.G + * @date 2025/5/21/周三 15:33 + * @description + */ +public interface UserRoleService extends IService { + + List getRolesByUserId(String userId); + + void bindUserRole(UserRoleReq req); + + void bindRoleUser(String roleId, List userIds); +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/service/VideoFileInfoService.java b/core/src/main/java/com/dite/znpt/service/VideoFileInfoService.java index 9fa7047..faed4e5 100644 --- a/core/src/main/java/com/dite/znpt/service/VideoFileInfoService.java +++ b/core/src/main/java/com/dite/znpt/service/VideoFileInfoService.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.service; import com.baomidou.mybatisplus.extension.service.IService; @@ -66,3 +67,73 @@ public interface VideoFileInfoService extends IService { List batchUpload(VideoFileInfoReq infoReq, MultipartFile[] files); } +======= +package com.dite.znpt.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.dite.znpt.domain.entity.VideoFileInfoEntity; +import com.dite.znpt.domain.vo.VideoFileInfoListReq; +import com.dite.znpt.domain.vo.VideoFileInfoReq; +import com.dite.znpt.domain.vo.VideoFileInfoResp; +import org.springframework.web.multipart.MultipartFile; + +import java.util.List; + +/** + * @author huise23 + * @date 2025/06/09 09:45 + * @Description: 视频文件信息表服务接口 + */ +public interface VideoFileInfoService extends IService { + + /** + * 功能描述:查询视频文件信息列表 + * + * @param videoFileInfoReq 视频文件信息 + * @return {@link List }<{@link VideoFileInfoEntity }> + * @author huise23 + * @date 2025/06/09 09:45 + **/ + List selectList(VideoFileInfoListReq videoFileInfoReq); + + /** + * 功能描述:查询单条视频文件信息 + * + * @param id 视频文件信息Id + * @return {@link VideoFileInfoResp } + * @author huise23 + * @date 2025/06/09 09:45 + **/ + VideoFileInfoResp selectById(String id); + + /** + * 功能描述:更新视频文件信息 + * + * @param videoFileInfo 视频文件信息 + * @author huise23 + * @date 2025/06/09 09:45 + **/ + void updateData(VideoFileInfoEntity videoFileInfo); + + /** + * 功能描述:删除视频文件信息 + * + * @param id 视频文件信息Id + * @author huise23 + * @date 2025/06/09 09:45 + **/ + void deleteById(String id); + + /** + * 功能描述:批量上传 + * + * @param infoReq 视频文件信息实体 + * @param files 文件 + * @return + * @author cuizhibin + * @date 2025/06/09 10:14 + */ + List batchUpload(VideoFileInfoReq infoReq, MultipartFile[] files); +} + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/service/WorkShiftService.java b/core/src/main/java/com/dite/znpt/service/WorkShiftService.java index 7e9d7d7..0faf56d 100644 --- a/core/src/main/java/com/dite/znpt/service/WorkShiftService.java +++ b/core/src/main/java/com/dite/znpt/service/WorkShiftService.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.service; import com.baomidou.mybatisplus.extension.service.IService; @@ -31,3 +32,38 @@ public interface WorkShiftService extends IService { } +======= +package com.dite.znpt.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.dite.znpt.domain.entity.WorkShiftEntity; +import com.dite.znpt.domain.vo.WorkShiftListResp; +import com.dite.znpt.domain.vo.WorkShiftReq; +import com.dite.znpt.domain.vo.WorkShiftResp; + +import java.util.List; + +/** + * @author Bear.G + * @date 2025/6/30/周一 10:27 + * @description + */ +public interface WorkShiftService extends IService { + + List page(String workShitName); + + List list(String workShitName); + + WorkShiftResp detail(String workShiftId); + + void save(WorkShiftReq req); + + void update(String workShiftId, WorkShiftReq req); + + void publish(String workShiftId); + + void delete(String workShiftId); + + +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/service/WorkbenchService.java b/core/src/main/java/com/dite/znpt/service/WorkbenchService.java index e615915..8561e2d 100644 --- a/core/src/main/java/com/dite/znpt/service/WorkbenchService.java +++ b/core/src/main/java/com/dite/znpt/service/WorkbenchService.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.service; import com.dite.znpt.domain.vo.WorkbenchInfoResp; @@ -13,3 +14,20 @@ public interface WorkbenchService { **/ WorkbenchInfoResp getInfo(); } +======= +package com.dite.znpt.service; + +import com.dite.znpt.domain.vo.WorkbenchInfoResp; + +public interface WorkbenchService { + + /** + * 功能描述:获取工作台信息 + * + * @return {@link WorkbenchInfoResp } + * @author cuizhibin + * @date 2025/07/21 21:27 + **/ + WorkbenchInfoResp getInfo(); +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/service/impl/AttachInfoServiceImpl.java b/core/src/main/java/com/dite/znpt/service/impl/AttachInfoServiceImpl.java index 93c77dd..a865eba 100644 --- a/core/src/main/java/com/dite/znpt/service/impl/AttachInfoServiceImpl.java +++ b/core/src/main/java/com/dite/znpt/service/impl/AttachInfoServiceImpl.java @@ -30,6 +30,10 @@ import java.net.URLEncoder; import java.rmi.ServerException; import java.util.ArrayList; import java.util.List; +<<<<<<< HEAD +======= +import java.util.Objects; +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f import java.util.stream.Collectors; /** @@ -51,9 +55,15 @@ public class AttachInfoServiceImpl extends ServiceImpl listByBusinessIds(List businessIds, String businessType) { return lambdaQuery().in(AttachInfoEntity::getBusinessId, businessIds) .eq(StrUtil.isNotEmpty(businessType), AttachInfoEntity::getBusinessType, businessType) +======= + public List listByBusinessIds(List businessIds, AttachBusinessTypeEnum businessType) { + return lambdaQuery().in(AttachInfoEntity::getBusinessId, businessIds) + .eq(Objects.nonNull(businessType), AttachInfoEntity::getBusinessType, businessType.getCode()) +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f .list(); } @@ -81,9 +91,17 @@ public class AttachInfoServiceImpl extends ServiceImpl>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f .fileType(infoReq.getFileType()) .remark(infoReq.getRemark()) .build(); diff --git a/core/src/main/java/com/dite/znpt/service/impl/AudioFileInfoServiceImpl.java b/core/src/main/java/com/dite/znpt/service/impl/AudioFileInfoServiceImpl.java index d6714b9..5cf2401 100644 --- a/core/src/main/java/com/dite/znpt/service/impl/AudioFileInfoServiceImpl.java +++ b/core/src/main/java/com/dite/znpt/service/impl/AudioFileInfoServiceImpl.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.service.impl; import cn.hutool.core.bean.BeanUtil; @@ -124,3 +125,131 @@ public class AudioFileInfoServiceImpl extends ServiceImpl implements AudioFileInfoService { + + private final PartService partService; + private final ImageMapper imageMapper; + + /** + * 功能描述:查询音频文件信息列表 + * + * @param audioFileInfoReq 音频文件信息信息 + * @return {@link List }<{@link AudioFileInfoEntity }> + * @author huise23 + * @date 2025/06/23 13:39 + **/ + @Override + public List selectList(AudioFileInfoListReq audioFileInfoReq) { + PageUtil.startPage(); + 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::getAudioId, audioFileInfoReq.getAudioId()).list(); + } + + /** + * 功能描述:查询单条音频文件信息 + * + * @param audioId 音频文件信息Id + * @return {@link AudioFileInfoEntity } + * @author huise23 + * @date 2025/06/23 13:39 + **/ + @Override + public AudioFileInfoResp selectById(String audioId) { + AudioFileInfoListReq req = new AudioFileInfoListReq(); + req.setAudioId(audioId); + List list = baseMapper.queryBySelective(req); + return CollUtil.isNotEmpty(list) ? CollUtil.getFirst(list) : null; + } + + /** + * 功能描述:查询单条音频文件信息 + * + * @param imageIds 图像id列表 + * @return {@link List } + * @author huise23 + * @date 2025/06/23 13:39 + **/ + @Override + public List selectByImageIds(List imageIds) { + AudioFileInfoListReq req = new AudioFileInfoListReq(); + req.setImageIds(imageIds); + return baseMapper.queryBySelective(req); + } + + /** + * 功能描述:删除音频文件信息 + * + * @param audioId 音频文件信息Id + * @author huise23 + * @date 2025/06/23 13:39 + **/ + @Override + public void deleteById(String audioId) { + removeById(audioId); + } + + @Override + public List batchUpload(String imageId, MultipartFile[] files) { + ImageEntity image = imageMapper.selectById(imageId); + if(null == image){ + throw new ServiceException(Message.IMAGE_ID_IS_NOT_EXIST); + } + PartResp partResp = partService.detail(image.getPartId()); + String audioFilePrefix = FilePathEnum.AUDIO.getFileAbsolutePathPrefix() + partResp.getProjectName().concat(FileUtil.FILE_SEPARATOR).concat(partResp.getTurbineName()).concat(FileUtil.FILE_SEPARATOR); + List list = new ArrayList<>(); + for (MultipartFile file : files) { + AudioFileInfoEntity audio = new AudioFileInfoEntity(); + audio.setImageId(imageId); + if (!file.isEmpty()) { + try { + String path = audioFilePrefix + file.getOriginalFilename(); + FileUtil.writeBytes(file.getBytes(),path); + audio.setFilePath(FilePathEnum.AUDIO.getFileDownPath(path)); + list.add(audio); + } catch (Exception e) { + e.printStackTrace(); + } + } + } + baseMapper.insert(list); + return BeanUtil.copyToList(list, AudioFileInfoResp.class); + } +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/service/impl/AuthServiceImpl.java b/core/src/main/java/com/dite/znpt/service/impl/AuthServiceImpl.java index c375840..d116480 100644 --- a/core/src/main/java/com/dite/znpt/service/impl/AuthServiceImpl.java +++ b/core/src/main/java/com/dite/znpt/service/impl/AuthServiceImpl.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.service.impl; import cn.dev33.satoken.secure.SaSecureUtil; @@ -166,3 +167,173 @@ public class AuthServiceImpl implements AuthService { return MenuServiceImpl.buildMenuTree(menuList); } } +======= +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.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.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; + +import javax.servlet.http.HttpServletRequest; +import java.util.ArrayList; +import java.util.List; + +/** + * @author Bear.G + * @date 2025/5/23/周五 14:31 + * @description + */ +@AllArgsConstructor +@Service +public class AuthServiceImpl implements AuthService { + + private final UserService userService; + + private final UserRoleService userRoleService; + + private final UserPostService userPostService; + + private final MenuService menuService; + + private final RoleMenuService roleMenuService; + + private final DeptService deptService; + + @Override + public Result doLogin(LoginReq req) { + 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); + } + 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); + } + ServletRequestAttributes servletRequestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); + HttpServletRequest request = servletRequestAttributes.getRequest(); + UserAgent userAgent = UserAgentUtil.parse(request .getHeader("User-Agent")); + StpUtil.login(user.getUserId(), new SaLoginParameter().setDeviceType(userAgent.isMobile() ? TerminalTypeEnum.APP.getCode() : TerminalTypeEnum.PC.getCode())); + saveSession(user.getUserId()); + 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(); + } + + @Override + public List> getMenuInfo(String userId) { + return (List>) StpUtil.getSession().get("menuInfo"); + } + + @Override + public UserInfo getUserInfo(String userId) { + return (UserInfo)StpUtil.getSession().get("userInfo"); + } + + private void saveSession(String userId){ + StpUtil.getSession().set("userInfo", queryUserInfo(userId)); + List> menuInfo = queryMenuInfo(userId); + if(!menuInfo.isEmpty()){ + StpUtil.getSession().set("menuInfo", menuInfo); + } + } + + private UserInfo queryUserInfo(String userId){ + UserInfo userInfo = new UserInfo(); + UserEntity user = userService.getOne(Wrappers.lambdaQuery(UserEntity.class).eq(UserEntity::getUserId, userId).eq(UserEntity::getDelFlag, Constants.DEL_FLAG_0)); + userInfo.setUser(Converts.INSTANCE.toUserListResp(user)); + if(StrUtil.isNotBlank(user.getDeptId())){ + DeptEntity dept = deptService.getOne(Wrappers.lambdaQuery(DeptEntity.class).eq(DeptEntity::getDeptId, user.getDeptId()).eq(DeptEntity::getDelFlag, Constants.DEL_FLAG_0)); + userInfo.setDept(Converts.INSTANCE.toDeptResp(dept)); + } + userInfo.setRoles(userRoleService.getRolesByUserId(userId)); + userInfo.setPosts(userPostService.getPostsByUserId(userId)); + return userInfo; + } + + private List> queryMenuInfo(String userId){ + List roleIds = userRoleService.getRolesByUserId(userId).stream().map(RoleResp::getRoleId).toList(); + if(CollUtil.isEmpty(roleIds)){ + return new ArrayList<>(); + } + List menuIds = roleMenuService.list( + Wrappers.lambdaQuery(RoleMenuEntity.class) + .in(CollUtil.isNotEmpty(roleIds), RoleMenuEntity::getRoleId, roleIds) + ).stream().map(RoleMenuEntity::getMenuId).toList(); + List menuList = menuService.list( + Wrappers.lambdaQuery(MenuEntity.class) + .in(CollUtil.isNotEmpty(menuIds), MenuEntity::getMenuId,menuIds).eq(MenuEntity::getTerminalType, StpUtil.getLoginDeviceType()) + ).stream().filter(menu -> Constants.VISIBLE_0.equals(menu.getVisible())).toList(); + return MenuServiceImpl.buildMenuTree(menuList); + } +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/service/impl/BiddingInfoServiceImpl.java b/core/src/main/java/com/dite/znpt/service/impl/BiddingInfoServiceImpl.java new file mode 100644 index 0000000..52e974b --- /dev/null +++ b/core/src/main/java/com/dite/znpt/service/impl/BiddingInfoServiceImpl.java @@ -0,0 +1,112 @@ +package com.dite.znpt.service.impl; + +import cn.hutool.core.collection.CollUtil; +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.Result; +import com.dite.znpt.domain.entity.AttachInfoEntity; +import com.dite.znpt.domain.entity.BiddingInfoEntity; +import com.dite.znpt.domain.vo.BiddingInfoReq; +import com.dite.znpt.domain.vo.BiddingInfoResp; +import com.dite.znpt.exception.ServiceException; +import com.dite.znpt.mapper.BiddingInfoMapper; +import com.dite.znpt.service.AttachInfoService; +import com.dite.znpt.service.BiddingInfoService; +import com.dite.znpt.util.PageUtil; +import com.pig4cloud.plugin.excel.vo.ErrorMessage; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.validation.BindingResult; + +import javax.annotation.Resource; +import java.util.List; +import java.util.Map; +import java.util.function.Function; +import java.util.stream.Collectors; + +/** + * @author Bear.G + * @date 2025/7/28/周一 16:07 + * @description + */ +@Service +public class BiddingInfoServiceImpl extends ServiceImpl implements BiddingInfoService { + + @Resource + private AttachInfoService attachInfoService; + @Override + public List page(String projectName) { + PageUtil.startPage(); + return this.list(projectName); + } + + @Override + public List list(String projectName) { + return this.baseMapper.listBiddingInfoResp(projectName); + } + + @Transactional(rollbackFor = Exception.class) + @Override + public void save(BiddingInfoReq req) { + BiddingInfoEntity entity = Converts.INSTANCE.toBiddingInfoReq(req); + this.save(entity); + } + + @Transactional(rollbackFor = Exception.class) + @Override + public void update(String biddingInfoId, BiddingInfoReq req) { + BiddingInfoEntity biddingInfo = this.getById(biddingInfoId); + if(null ==biddingInfo){ + throw new ServiceException(Message.BIDDING_INFO_ID_IS_NOT_EXIST); + } + BiddingInfoEntity entity = Converts.INSTANCE.toBiddingInfoReq(req); + entity.setBiddingInfoId(biddingInfoId); + this.updateById(entity); + } + + @Transactional(rollbackFor = Exception.class) + @Override + public void uploadBiddingInfoFile(String biddingInfoId, String biddingFileId) { + BiddingInfoEntity entity = this.getById(biddingInfoId); + if(null ==entity){ + throw new ServiceException(Message.BIDDING_INFO_ID_IS_NOT_EXIST); + } + AttachInfoEntity attachInfo = attachInfoService.getById(biddingFileId); + if(null == attachInfo || !Constants.DEL_FLAG_0.equals(attachInfo.getDelFlag())){ + throw new ServiceException(Message.ATTACH_INFO_IS_NOT_EXIST); + } + entity.setBiddingFileId(biddingFileId); + this.updateById(entity); + + attachInfo.setBusinessId(biddingInfoId); + attachInfoService.updateById(attachInfo); + } + + @Transactional(rollbackFor = Exception.class) + @Override + public void apply(String biddingInfoId) { + BiddingInfoEntity entity = this.getById(biddingInfoId); + if(null ==entity){ + throw new ServiceException(Message.BIDDING_INFO_ID_IS_NOT_EXIST); + } + entity.setStatus("1"); + this.updateById(entity); + } + + @Transactional(rollbackFor = Exception.class) + @Override + public Result importData(List dataList, BindingResult bindingResult) { + List sourceWebsites = dataList.stream().map(BiddingInfoReq::getSourceWebsite).distinct().toList(); + if(sourceWebsites.size() != dataList.size()){ + return Result.error(Constants.SERVICE_EXCEPTION, "导入失败,存在重复数据"); + } + List existSourceWebsites = this.list().stream().map(BiddingInfoEntity::getSourceWebsite).toList(); + if(CollUtil.containsAny(existSourceWebsites, sourceWebsites)){ + return Result.error(Constants.SERVICE_EXCEPTION, "导入失败,存在重复数据"); + } + this.saveBatch(Converts.INSTANCE.toBiddingInfoReq(dataList)); + return Result.okM("导入"+ dataList.size()+"条数据"); + } +} diff --git a/core/src/main/java/com/dite/znpt/service/impl/CertificationServiceImpl.java b/core/src/main/java/com/dite/znpt/service/impl/CertificationServiceImpl.java index bdc4320..22fb6fc 100644 --- a/core/src/main/java/com/dite/znpt/service/impl/CertificationServiceImpl.java +++ b/core/src/main/java/com/dite/znpt/service/impl/CertificationServiceImpl.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.service.impl; import cn.hutool.core.collection.CollUtil; @@ -114,3 +115,121 @@ public class CertificationServiceImpl extends ServiceImpl implements CertificationService { + + private final UserService userService; + + @Override + public List page(CertificationListReq req) { + PageUtil.startPage(); + return this.list(req); + } + + @Override + public List list(CertificationListReq req) { + List list = this.baseMapper.selectCertification(req); + list.stream().forEach(resp -> { + resp.setCertificationTypeLabel(CertificationEnum.getDescByCode(resp.getCertificationType())); + }); + return list; + } + + @Override + public CertificationResp detail(String certificationId) { + CertificationResp resp = Converts.INSTANCE.toCertificationResp(this.getById(certificationId)); + resp.setCertificationTypeLabel(CertificationEnum.getDescByCode(resp.getCertificationType())); + resp.setUserName(userService.getById(resp.getUserId()).getName()); + return resp; + } + + @Transactional(rollbackFor = Exception.class) + @Override + public void save(CertificationReq req) { + this.save(validation(null, req)); + } + + private CertificationEntity validation(String certificationId, CertificationReq req) { + UserEntity user = userService.getById(req.getUserId()); + if(null == user || !Constants.DEL_FLAG_0.equals(user.getDelFlag()) || !Constants.STATUS_0.equals(user.getStatus())){ + throw new ServiceException(Message.USER_ID_NOT_EXIST_OR_ILLEGAL); + } + if(null == CertificationEnum.getByCode(req.getCertificationType())){ + throw new ServiceException(Message.CERTIFICATION_TYPE_ILLEGAL); + } + List userIdTypeList = this.list(Wrappers.lambdaQuery(CertificationEntity.class).eq(CertificationEntity::getCertificationType, req.getCertificationType()).eq(CertificationEntity::getUserId, req.getUserId())); + List codeList = this.list(Wrappers.lambdaQuery(CertificationEntity.class).eq(CertificationEntity::getCertificationCode, req.getCertificationCode())); + if(StrUtil.isBlank(certificationId)){ + if(CollUtil.isNotEmpty(userIdTypeList)){ + throw new ServiceException(StrUtil.format(Message.USER_CERTIFICATION_EXIST, user.getName(), CertificationEnum.getDescByCode(req.getCertificationType()))); + } + if(CollUtil.isNotEmpty(codeList)){ + throw new ServiceException(Message.CERTIFICATION_CODE_EXIST); + } + }else{ + CertificationEntity entity = this.getById(certificationId); + if(null == entity){ + throw new ServiceException(Message.CERTIFICATION_ID_NOT_EXIST); + } + if((!entity.getUserId().equals(req.getUserId()) ||!entity.getCertificationType().equals(req.getCertificationType())) && CollUtil.isNotEmpty(userIdTypeList)){ + throw new ServiceException(StrUtil.format(Message.USER_CERTIFICATION_EXIST, user.getName(), CertificationEnum.getDescByCode(req.getCertificationType()))); + } + if(!entity.getCertificationCode().equals(req.getCertificationCode()) && CollUtil.isNotEmpty(codeList)){ + throw new ServiceException(Message.CERTIFICATION_CODE_EXIST); + } + } + return Converts.INSTANCE.toCertificationEntity(req); + } + + + @Transactional(rollbackFor = Exception.class) + @Override + public void update(String certificationId, CertificationReq req) { + CertificationEntity entity = validation(certificationId, req); + entity.setCertificationId(certificationId); + this.updateById(entity); + } + + @Transactional(rollbackFor = Exception.class) + @Override + public void deleteById(String certificationId) { + if(null == this.getById(certificationId)){ + throw new ServiceException(Message.CERTIFICATION_ID_NOT_EXIST); + } + this.removeById(certificationId); + } +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/service/impl/ContractServiceImpl.java b/core/src/main/java/com/dite/znpt/service/impl/ContractServiceImpl.java index 3c44205..2bb21ba 100644 --- a/core/src/main/java/com/dite/znpt/service/impl/ContractServiceImpl.java +++ b/core/src/main/java/com/dite/znpt/service/impl/ContractServiceImpl.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.service.impl; import cn.hutool.core.bean.BeanUtil; @@ -101,3 +102,108 @@ public class ContractServiceImpl extends ServiceImpl implements ContractService { + + /** + * 功能描述:查询合同列表 + * + * @param contractReq 合同信息 + * @return {@link List }<{@link ContractResp }> + * @author huise23 + * @date 2025/07/21 20:29 + **/ + @Override + public List selectList(ContractListReq contractReq) { + PageUtil.startPage(); + List contractList= this.baseMapper.queryBySelective(contractReq); + contractList.forEach(resp -> { + + }); + return contractList; + } + + /** + * 功能描述:查询单条合同 + * + * @param contractId 合同Id + * @return {@link ContractResp } + * @author huise23 + * @date 2025/07/21 20:29 + **/ + @Override + public ContractResp selectById(String contractId) { + ContractListReq contractReq = new ContractListReq(); + contractReq.setContractId(contractId); + + List list = selectList(contractReq); + return CollUtil.isNotEmpty(list) ? CollUtil.getFirst(list) : new ContractResp(); + } + + /** + * 功能描述:新增合同 + * + * @param contractReq 合同 + * @author huise23 + * @date 2025/07/21 20:29 + **/ + @Override + public void saveData(ContractReq contractReq) { +// todo 校验 + ContractEntity entity = BeanUtil.copyProperties(contractReq, ContractEntity.class); + save(entity); + } + + /** + * 功能描述:更新合同 + * + * @param contractReq 合同 + * @author huise23 + * @date 2025/07/21 20:29 + **/ + @Override + public void updateData(ContractReq contractReq) { +// todo 校验 + ContractEntity entity = BeanUtil.copyProperties(contractReq, ContractEntity.class); + updateById(entity); + } + + /** + * 功能描述:删除合同 + * + * @param contractId 合同Id + * @author huise23 + * @date 2025/07/21 20:29 + **/ + @Override + public void deleteById(String contractId) { +// todo 校验 + removeById(contractId); + } + +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/service/impl/ContractSettlementServiceImpl.java b/core/src/main/java/com/dite/znpt/service/impl/ContractSettlementServiceImpl.java index 23c29c5..8e79a63 100644 --- a/core/src/main/java/com/dite/znpt/service/impl/ContractSettlementServiceImpl.java +++ b/core/src/main/java/com/dite/znpt/service/impl/ContractSettlementServiceImpl.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.service.impl; import cn.hutool.core.bean.BeanUtil; @@ -74,3 +75,81 @@ public class ContractSettlementServiceImpl extends ServiceImpl implements ContractSettlementService { + + /** + * 功能描述:查询合同结算列表 + * + * @param contractSettlementReq 合同结算信息 + * @return {@link List }<{@link ContractSettlementResp }> + * @author huise23 + * @date 2025/07/21 21:10 + **/ + @Override + public List selectList(ContractSettlementListReq contractSettlementReq) { + PageUtil.startPage(); + List contractSettlementList= this.baseMapper.queryBySelective(contractSettlementReq); + contractSettlementList.forEach(resp -> { + + }); + return contractSettlementList; + } + + /** + * 功能描述:查询单条合同结算 + * + * @param settlementId 合同结算Id + * @return {@link ContractSettlementResp } + * @author huise23 + * @date 2025/07/21 21:10 + **/ + @Override + public ContractSettlementResp selectById(String settlementId) { + ContractSettlementListReq contractSettlementReq = new ContractSettlementListReq(); + contractSettlementReq.setSettlementId(settlementId); + + List list = selectList(contractSettlementReq); + return CollUtil.isNotEmpty(list) ? CollUtil.getFirst(list) : new ContractSettlementResp(); + } + + /** + * 功能描述:新增合同结算 + * + * @param contractSettlementReq 合同结算 + * @author huise23 + * @date 2025/07/21 21:10 + **/ + @Override + public void saveData(ContractSettlementReq contractSettlementReq) { +// todo 校验 + ContractSettlementEntity entity = BeanUtil.copyProperties(contractSettlementReq, ContractSettlementEntity.class); + save(entity); + } + +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/service/impl/DefectServiceImpl.java b/core/src/main/java/com/dite/znpt/service/impl/DefectServiceImpl.java index f20ee9f..bbcc0aa 100644 --- a/core/src/main/java/com/dite/znpt/service/impl/DefectServiceImpl.java +++ b/core/src/main/java/com/dite/znpt/service/impl/DefectServiceImpl.java @@ -198,7 +198,11 @@ public class DefectServiceImpl extends ServiceImpl i } image.setImageType(ImageTypeEnum.DEFECT.getCode()); imageService.updateById(image); +<<<<<<< HEAD FilePathEnum pathEnum = image.getImagePath().contains("temp") ? FilePathEnum.IMAGE_TEMP : FilePathEnum.IMAGE; +======= + FilePathEnum pathEnum = FilePathEnum.getFilePathEnum(image.getImagePath()); +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f String inputPath = pathEnum.getFileAbsolutePath(image.getImagePath()); // 写入attach同层级文件夹下 String attachPath = FilePathEnum.ATTACH.getUrlPath() + StrUtil.removePrefix(image.getImagePath(), pathEnum.getUrlPath()); diff --git a/core/src/main/java/com/dite/znpt/service/impl/DeptServiceImpl.java b/core/src/main/java/com/dite/znpt/service/impl/DeptServiceImpl.java index 79df0e3..eab3863 100644 --- a/core/src/main/java/com/dite/znpt/service/impl/DeptServiceImpl.java +++ b/core/src/main/java/com/dite/znpt/service/impl/DeptServiceImpl.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.service.impl; import cn.hutool.core.lang.tree.Tree; @@ -118,3 +119,125 @@ public class DeptServiceImpl extends ServiceImpl impleme this.updateById(entity); } } +======= +package com.dite.znpt.service.impl; + +import cn.hutool.core.lang.tree.Tree; +import cn.hutool.core.lang.tree.TreeNodeConfig; +import cn.hutool.core.lang.tree.TreeUtil; +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.converts.Converts; +import com.dite.znpt.domain.entity.DeptEntity; +import com.dite.znpt.domain.entity.UserEntity; +import com.dite.znpt.domain.vo.DeptReq; +import com.dite.znpt.domain.vo.DeptResp; +import com.dite.znpt.exception.ServiceException; +import com.dite.znpt.mapper.DeptMapper; +import com.dite.znpt.service.DeptService; +import com.dite.znpt.service.UserService; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.util.List; + +/** + * @author Bear.G + * @date 2025/5/20/周二 10:14 + * @description + */ +@Service +public class DeptServiceImpl extends ServiceImpl implements DeptService { + + @Resource + private UserService userService; + + @Override + public List> tree(String deptName) { + List deptList = StrUtil.isBlank(deptName) ? this.baseMapper.downwardRecursionSelect(null) : this.baseMapper.upwardRecursionSelect(deptName); + return buildDeptTree(deptList); + } + + public static List> buildDeptTree(List deptList) { + //配置 + TreeNodeConfig treeNodeConfig = new TreeNodeConfig(); + treeNodeConfig.setIdKey("deptId"); + treeNodeConfig.setNameKey("deptName"); + treeNodeConfig.setParentIdKey("parentId"); + treeNodeConfig.setWeightKey("orderNum"); + //转换器 + return TreeUtil.build(deptList, "0", treeNodeConfig, + (treeNode, tree) -> { + tree.setId(treeNode.getDeptId()); + tree.setParentId(treeNode.getParentId()); + tree.setName(treeNode.getDeptName()); + tree.putExtra("status",treeNode.getStatus()); + tree.putExtra("orderNum",treeNode.getOrderNum()); + }); + } + + @Override + public DeptResp detail(String deptId) { + DeptEntity entity = this.getById(deptId); + if (null == entity || !entity.getDelFlag().equals(Constants.DEL_FLAG_0)){ + throw new ServiceException(Message.DEPT_ID_NOT_EXIST); + } + return Converts.INSTANCE.toDeptResp(entity); + } + + @Transactional(rollbackFor = Exception.class) + @Override + public void save(DeptReq req) { + this.save(dealDept(req)); + } + + @Transactional(rollbackFor = Exception.class) + @Override + public void update(String deptId, DeptReq req) { + DeptEntity originalEntity = this.getById(deptId); + if (null == originalEntity || !originalEntity.getDelFlag().equals(Constants.DEL_FLAG_0)){ + throw new ServiceException(Message.DEPT_ID_NOT_EXIST); + } + DeptEntity entity = dealDept(req); + entity.setDeptId(deptId); + this.updateById(entity); + } + + private DeptEntity dealDept(DeptReq req){ + DeptEntity entity = Converts.INSTANCE.toDeptEntity(req); + if(StrUtil.isNotBlank(req.getLeaderId())){ + UserEntity user = userService.getById(req.getLeaderId()); + if(null == user || !user.getDelFlag().equals(Constants.DEL_FLAG_0)){ + throw new ServiceException(Message.USER_ID_NOT_EXIST); + } + } + if(StrUtil.isNotBlank(req.getParentId())){ + DeptEntity parent = this.getById(req.getParentId()); + if(null == parent || !parent.getDelFlag().equals(Constants.DEL_FLAG_0)){ + throw new ServiceException(Message.DEPT_PARENT_NOT_EXIST); + } + entity.setAncestors(parent.getAncestors() + StrUtil.COMMA + parent.getDeptId()); + entity.setDeptFullName(parent.getDeptFullName() + StrUtil.SLASH + entity.getDeptName()); + }else{ + entity.setParentId("0"); + entity.setAncestors("0"); + entity.setDeptFullName(req.getDeptName()); + } + return entity; + } + + @Transactional(rollbackFor = Exception.class) + @Override + public void deleteById(String deptId) { + DeptEntity entity = this.getById(deptId); + if (null == entity || !entity.getDelFlag().equals(Constants.DEL_FLAG_0)){ + throw new ServiceException(Message.DEPT_ID_NOT_EXIST); + } + entity.setDelFlag(Constants.DEL_FLAG_1); + this.updateById(entity); + } +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/service/impl/DictServiceImpl.java b/core/src/main/java/com/dite/znpt/service/impl/DictServiceImpl.java index 5acbf79..6687037 100644 --- a/core/src/main/java/com/dite/znpt/service/impl/DictServiceImpl.java +++ b/core/src/main/java/com/dite/znpt/service/impl/DictServiceImpl.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.service.impl; import cn.hutool.core.bean.BeanUtil; @@ -101,3 +102,108 @@ public class DictServiceImpl extends ServiceImpl impleme } } +======= +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.DictEntity; +import com.dite.znpt.domain.vo.DictListReq; +import com.dite.znpt.domain.vo.DictReq; +import com.dite.znpt.domain.vo.DictResp; +import com.dite.znpt.mapper.DictMapper; +import com.dite.znpt.service.DictService; +import com.dite.znpt.util.PageUtil; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * @author huise23 + * @date 2025/06/30 11:38 + * @Description: 字典表服务实现类 + */ +@Service +@RequiredArgsConstructor +public class DictServiceImpl extends ServiceImpl implements DictService { + + /** + * 功能描述:查询字典列表 + * + * @param dictReq 字典信息 + * @return {@link List }<{@link DictResp }> + * @author huise23 + * @date 2025/06/30 11:38 + **/ + @Override + public List selectList(DictListReq dictReq) { + PageUtil.startPage(); + List dictList= this.baseMapper.queryBySelective(dictReq); + dictList.forEach(resp -> { + + }); + return dictList; + } + + /** + * 功能描述:查询单条字典 + * + * @param dictId 字典Id + * @return {@link DictResp } + * @author huise23 + * @date 2025/06/30 11:38 + **/ + @Override + public DictResp selectById(String dictId) { + DictListReq dictReq = new DictListReq(); + dictReq.setDictId(dictId); + + List list = selectList(dictReq); + return CollUtil.isNotEmpty(list) ? CollUtil.getFirst(list) : new DictResp(); + } + + /** + * 功能描述:新增字典 + * + * @param dictReq 字典 + * @author huise23 + * @date 2025/06/30 11:38 + **/ + @Override + public void saveData(DictReq dictReq) { +// todo 校验 + DictEntity entity = BeanUtil.copyProperties(dictReq, DictEntity.class); + save(entity); + } + + /** + * 功能描述:更新字典 + * + * @param dictReq 字典 + * @author huise23 + * @date 2025/06/30 11:38 + **/ + @Override + public void updateData(DictReq dictReq) { +// todo 校验 + DictEntity entity = BeanUtil.copyProperties(dictReq, DictEntity.class); + updateById(entity); + } + + /** + * 功能描述:删除字典 + * + * @param dictId 字典Id + * @author huise23 + * @date 2025/06/30 11:38 + **/ + @Override + public void deleteById(String dictId) { +// todo 校验 + removeById(dictId); + } + +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/service/impl/EquipmentServiceImpl.java b/core/src/main/java/com/dite/znpt/service/impl/EquipmentServiceImpl.java index 374563e..ca05a5f 100644 --- a/core/src/main/java/com/dite/znpt/service/impl/EquipmentServiceImpl.java +++ b/core/src/main/java/com/dite/znpt/service/impl/EquipmentServiceImpl.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.service.impl; import com.baomidou.mybatisplus.core.toolkit.Wrappers; @@ -106,3 +107,113 @@ public class EquipmentServiceImpl extends ServiceImpl implements EquipmentService { + + @Resource + private EquipmentUseRecordService equipmentUseRecordService; + + @Resource + private UserService userService; + + @Resource + private ProjectService projectService; + + @Override + public List page(EquipmentListReq req) { + PageUtil.startPage(); + return this.list(req); + } + + @Override + public List list(EquipmentListReq req) { + List list = this.baseMapper.selectEquipmentResp(req); + list.forEach(resp -> { + resp.setEquipmentTypeLabel(EquipmentTypeEnum.getDescByCode(resp.getEquipmentType())); + resp.setEquipmentStatusLabel(EquipmentStatusEnum.getDescByCode(resp.getEquipmentStatus())); + }); + return list; + } + + @Override + public EquipmentResp detail(String equipmentId) { + EquipmentResp resp = this.baseMapper.getEquipmentRespByEquipmentId(equipmentId); + resp.setEquipmentTypeLabel(EquipmentTypeEnum.getDescByCode(resp.getEquipmentType())); + resp.setEquipmentStatusLabel(EquipmentStatusEnum.getDescByCode(resp.getEquipmentStatus())); + return resp; + } + + @Transactional(rollbackFor = Exception.class) + @Override + public void save(EquipmentReq req) { + EquipmentEntity entity = Converts.INSTANCE.toEquipmentUseRecordEntity(req); + if(null != getByEquipmentSn(entity.getEquipmentSn())){ + throw new ServiceException(Message.EQUIPMENT_SN_EXIST); + } + this.save(entity); + } + + private EquipmentEntity getByEquipmentSn(String equipmentSn){ + return this.getOne(Wrappers.lambdaQuery(EquipmentEntity.class).eq(EquipmentEntity::getEquipmentSn, equipmentSn)); + } + + @Transactional(rollbackFor = Exception.class) + @Override + public void update(String equipmentId, EquipmentReq req) { + EquipmentEntity equipment = this.getById(equipmentId); + if(null == equipment){ + throw new ServiceException(Message.EQUIPMENT_ID_NOT_EXIST); + } + if(!equipment.getEquipmentSn().equals(req.getEquipmentSn()) && null != getByEquipmentSn(req.getEquipmentSn())){ + throw new ServiceException(Message.EQUIPMENT_SN_EXIST); + } + EquipmentEntity entity = Converts.INSTANCE.toEquipmentUseRecordEntity(req); + entity.setEquipmentId(equipmentId); + this.updateById(entity); + } + + @Transactional(rollbackFor = Exception.class) + @Override + public void deleteById(String equipmentId) { + EquipmentEntity equipment = this.getById(equipmentId); + if(null == equipment){ + throw new ServiceException(Message.EQUIPMENT_ID_NOT_EXIST); + } + this.removeById(equipmentId); + } +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/service/impl/EquipmentUseRecordServiceImpl.java b/core/src/main/java/com/dite/znpt/service/impl/EquipmentUseRecordServiceImpl.java index 7ee486c..210e602 100644 --- a/core/src/main/java/com/dite/znpt/service/impl/EquipmentUseRecordServiceImpl.java +++ b/core/src/main/java/com/dite/znpt/service/impl/EquipmentUseRecordServiceImpl.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.service.impl; import cn.hutool.core.lang.Snowflake; @@ -135,3 +136,142 @@ public class EquipmentUseRecordServiceImpl extends ServiceImpl implements EquipmentUseRecordService { + + @Resource + private EquipmentService equipmentService; + + @Resource + private ProjectService projectService; + + @Resource + private UserService userService; + + @Override + public List page(EquipmentUseRecordListReq req) { + PageUtil.startPage(); + return this.list(req); + } + + @Override + public List list(EquipmentUseRecordListReq req) { + return this.baseMapper.selectEquipmentUseRecordResp(req); + } + + @Override + public List detail(String equipmentId) { + return this.baseMapper.getEquipmentUseRecordResp(equipmentId); + } + + @Transactional(rollbackFor = Exception.class) + @Override + public void borrowEquipment(String equipmentId, EquipmentUseRecordReq req) { + EquipmentEntity equipment = equipmentService.getById(equipmentId); + if(null == equipment || !EquipmentStatusEnum.NORMAL.getCode().equals(equipment.getEquipmentStatus())){ + throw new ServiceException(Message.EQUIPMENT_STATUS_ERROR_FORBIDDEN_USE); + } + if("1".equals(equipment.getUseStatus())){ + throw new ServiceException(Message.EQUIPMENT_IS_USED); + } + UserEntity user = userService.getById(req.getUserId()); + if(null == user || !Constants.DEL_FLAG_0.equals(user.getDelFlag())){ + throw new ServiceException(Message.USER_ID_NOT_EXIST); + } + ProjectEntity project = projectService.getById(req.getProjectId()); + if(null == project){ + throw new ServiceException(Message.PROJECT_ID_IS_NOT_EXIST); + } + EquipmentUseRecordEntity equipmentUseRecordEntity = Converts.INSTANCE.toEquipmentUseRecordEntity(req); + equipmentUseRecordEntity.setEquipmentId(equipmentId); + equipmentUseRecordEntity.setOperateTime(LocalDateTime.now()); + equipmentUseRecordEntity.setOperateType("0"); + equipmentUseRecordEntity.setBatchId(new SnowflakeGenerator().next().toString()); + this.save(equipmentUseRecordEntity); + + equipment.setUseStatus("1"); + equipment.setUseRecordId(equipmentUseRecordEntity.getUseRecordId()); + equipmentService.updateById(equipment); + + } + + @Transactional(rollbackFor = Exception.class) + @Override + public void returnEquipment(String userRecordId, EquipmentUseRecordReq req) { + EquipmentUseRecordEntity equipmentUseRecord = this.getById(userRecordId); + if(null == equipmentUseRecord){ + throw new ServiceException(Message.EQUIPMENT_USE_RECORD_ID_NOT_EXIST); + } + EquipmentEntity equipment = equipmentService.getById(equipmentUseRecord.getEquipmentId()); + if(null == equipment){ + throw new ServiceException(Message.EQUIPMENT_ID_NOT_EXIST); + } + if("0".equals(equipment.getUseStatus())){ + throw new ServiceException(Message.EQUIPMENT_IS_RETURN); + } + this.getOneOpt( + Wrappers.lambdaQuery() + .eq(EquipmentUseRecordEntity::getBatchId, equipmentUseRecord.getBatchId()) + .eq(EquipmentUseRecordEntity::getOperateType, "1") + ).ifPresent(equipmentUseRecordEntity -> {throw new ServiceException(Message.EQUIPMENT_IS_RETURN);}); + + UserEntity user = userService.getById(req.getUserId()); + if(null == user || !Constants.DEL_FLAG_0.equals(user.getDelFlag())){ + throw new ServiceException(Message.USER_ID_NOT_EXIST); + } + ProjectEntity project = projectService.getById(req.getProjectId()); + if(null == project){ + throw new ServiceException(Message.PROJECT_ID_IS_NOT_EXIST); + } + EquipmentUseRecordEntity equipmentUseRecordEntity = Converts.INSTANCE.toEquipmentUseRecordEntity(req); + equipmentUseRecordEntity.setEquipmentId(equipmentUseRecord.getEquipmentId()); + equipmentUseRecordEntity.setOperateTime(LocalDateTime.now()); + equipmentUseRecordEntity.setOperateType("1"); + equipmentUseRecordEntity.setBatchId(equipmentUseRecord.getBatchId()); + this.save(equipmentUseRecordEntity); + + equipment.setUseRecordId(null); + equipment.setUseStatus("0"); + equipmentService.updateById(equipment); + } +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/service/impl/ImageCollectServiceImpl.java b/core/src/main/java/com/dite/znpt/service/impl/ImageCollectServiceImpl.java index 1aac248..8a4cca5 100644 --- a/core/src/main/java/com/dite/znpt/service/impl/ImageCollectServiceImpl.java +++ b/core/src/main/java/com/dite/znpt/service/impl/ImageCollectServiceImpl.java @@ -8,8 +8,13 @@ import com.dite.znpt.converts.Converts; import com.dite.znpt.domain.entity.ImageCollectEntity; import com.dite.znpt.domain.entity.ImageEntity; import com.dite.znpt.domain.vo.ImageCollectReq; +<<<<<<< HEAD import com.dite.znpt.enums.FilePathEnum; import com.dite.znpt.enums.ImageSourceEnum; +======= +import com.dite.znpt.domain.vo.ImageReq; +import com.dite.znpt.enums.FilePathEnum; +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f import com.dite.znpt.exception.ServiceException; import com.dite.znpt.mapper.ImageCollectMapper; import com.dite.znpt.service.ImageCollectService; @@ -20,9 +25,16 @@ import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; import java.io.File; +<<<<<<< HEAD import java.time.LocalDate; import java.time.format.DateTimeFormatter; import java.util.List; +======= +import java.util.List; +import java.util.Map; +import java.util.function.Function; +import java.util.stream.Collectors; +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f /** * @Author: gaoxiong @@ -49,14 +61,20 @@ public class ImageCollectServiceImpl extends ServiceImpl imageList = Converts.INSTANCE.toImageEntity(req.getImageList()); 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); +======= + Map imageMap = req.getImageList().stream().collect(Collectors.toMap(ImageReq::getImageId, Function.identity(), (a,b) -> b)); + List imageList = imageService.listByIds(imageMap.keySet()); +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f imageList.forEach(image -> { image.setPartId(partId); image.setCollectId(imageCollect.getCollectId()); image.setImageType(req.getImageType()); image.setImageTypeLabel(req.getImageTypeLabel()); +<<<<<<< HEAD String path = permPathPrefix + image.getImageName(); String fileAbsolutePath = FilePathEnum.IMAGE_TEMP.getFileAbsolutePath(image.getImagePath()); File file = FileUtil.file(fileAbsolutePath); @@ -64,6 +82,16 @@ public class ImageCollectServiceImpl extends ServiceImpl>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f } }); imageService.saveOrUpdateBatch(imageList); diff --git a/core/src/main/java/com/dite/znpt/service/impl/ImageServiceImpl.java b/core/src/main/java/com/dite/znpt/service/impl/ImageServiceImpl.java index 3c7a393..667e517 100644 --- a/core/src/main/java/com/dite/znpt/service/impl/ImageServiceImpl.java +++ b/core/src/main/java/com/dite/znpt/service/impl/ImageServiceImpl.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.service.impl; import cn.dev33.satoken.stp.StpUtil; @@ -503,3 +504,514 @@ public class ImageServiceImpl extends ServiceImpl impl lambdaUpdate().in(ImageEntity::getImageId, imageIds).set(ImageEntity::getReviewState, "1").update(); } } +======= +package com.dite.znpt.service.impl; + +import cn.dev33.satoken.stp.StpUtil; +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.collection.ListUtil; +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.io.FileUtil; +import cn.hutool.core.io.file.PathUtil; +import cn.hutool.core.util.IdUtil; +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.Message; +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.vo.*; +import com.dite.znpt.enums.*; +import com.dite.znpt.exception.ServiceException; +import com.dite.znpt.mapper.ImageMapper; +import com.dite.znpt.service.*; +import com.dite.znpt.util.EXIFUtil; +import com.dite.znpt.util.PageUtil; +import lombok.SneakyThrows; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.multipart.MultipartFile; + +import javax.annotation.Resource; +import java.io.File; +import java.io.IOException; +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.nio.file.FileVisitResult; +import java.nio.file.Path; +import java.nio.file.SimpleFileVisitor; +import java.nio.file.attribute.BasicFileAttributes; +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; +import java.util.*; +import java.util.function.Function; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import java.util.stream.Collectors; + +/** + * @author Bear.G + * @date 2025/4/24/周四 13:23 + * @description + */ +@Slf4j +@Service +public class ImageServiceImpl extends ServiceImpl implements ImageService { + + @Resource + private ImageCollectService imageCollectService; + + @Resource + private PartService partService; + @Autowired + private AudioFileInfoService audioFileInfoService; + @Autowired + private ProjectService projectService; + @Autowired + private UserService userService; + + @Override + public List list(ImageListReq req) { + List list = this.baseMapper.queryImageList(req); + if (CollUtil.isNotEmpty(list)) { + Map> audioMap = audioFileInfoService.selectByImageIds(list.stream().map(ImageListResp::getImageId).collect(Collectors.toList())) + .stream().collect(Collectors.groupingBy(AudioFileInfoResp::getImageId)); + 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())); + if (StrUtil.isEmpty(resp.getImageTypeLabel())) { + resp.setImageTypeLabel(ImageTypeEnum.getDescByCode(resp.getImageType())); + } + resp.setImageSourceLabel(ImageSourceEnum.getDescByCode(resp.getImageSource())); + }); + } + return list; + } + + @Override + public List page(ImageListReq req) { + PageUtil.startPage(); + return this.list(req); + } + + @Override + public List batchSaveByImageSimpleReq(List list){ + List imageList = new ArrayList<>(); + List partIds = list.stream().map(ImageSimpleReq::getPartId).collect(Collectors.toList()); + Map 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.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(); + entity.setPartId(req.getPartId()); + String path = path_prefix + StrUtil.removePrefix(req.getImagePath(), temp_path_prefix); + byte[] bytes = FileUtil.readBytes(file); + FileUtil.writeBytes(bytes, path); + FileUtil.del(file); + entity.setImagePath(path); + imageList.add(entity); + } + } + }); + baseMapper.insert(imageList); + return imageList; + } + + @Override + public ImageResp detail(String imageId) { + ImageResp imageResp = this.baseMapper.detail(imageId); + if (null != imageResp) { + List list = audioFileInfoService.selectByImageIds(ListUtil.toList(imageId)); + imageResp.setAudioList(list); + 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; + } + + @Transactional(rollbackFor = Exception.class) + @Override + public List 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 == files || files.length == 0){ + throw new ServiceException(Message.IMAGE_IS_EMPTY); + } + PartResp partResp = partService.detail(partId); + if (Objects.isNull(partResp)) { + throw new ServiceException(Message.PART_ID_IS_NOT_EXIST); + } + List list = new ArrayList<>(files.length); + File temCategory = new File(FilePathEnum.IMAGE_TEMP.getFileAbsolutePathPrefix()); + if (!temCategory.exists()) { + // 创建完整的目录 + temCategory.mkdirs(); + } + String temPathPrefix = FilePathEnum.IMAGE_TEMP.getFileAbsolutePathPrefix().concat(imageSource).concat(FileUtil.FILE_SEPARATOR).concat(partId).concat(FileUtil.FILE_SEPARATOR); + ImageCollectEntity imageCollect = Optional.ofNullable(BeanUtil.copyProperties(collectReq, ImageCollectEntity.class)).orElse(new ImageCollectEntity()); + imageCollect.setCollectId(IdUtil.simpleUUID()); + imageCollect.setImageSource(imageSource); + List imageList = new ArrayList<>(); + for (MultipartFile file : files) { + ImageEntity imageEntity = new ImageEntity(); + if (!file.isEmpty()) { + try { + String path = temPathPrefix + file.getOriginalFilename(); + FileUtil.writeFromStream(file.getInputStream(),path); + String fileDownPath = FilePathEnum.IMAGE_TEMP.getFileDownPath(path); + ImageReq imageReq = imageRespBuilder(path, fileDownPath); + imageReq.setImageId(IdUtil.simpleUUID()); + BeanUtil.copyProperties(imageReq, imageEntity); + list.add(imageReq); + imageEntity.setPartId(partId); + imageEntity.setProjectId(partResp.getProjectId()); + imageEntity.setCollectId(imageCollect.getCollectId()); + imageEntity.setImageType(collectReq.getImageType()); + imageEntity.setImageTypeLabel(collectReq.getImageTypeLabel()); + imageList.add(imageEntity); + } catch (Exception e) { + e.printStackTrace(); + } + } + } + imageCollectService.save(imageCollect); + baseMapper.insert(imageList); + return list; + } + + @SneakyThrows + @Override + public List uploadProjectBatch(String projectId, String imageSource, ImageCollectReq collectReq, MultipartFile[] files) { + if (Objects.isNull(projectService.getById(projectId))) { + throw new ServiceException(Message.PROJECT_ID_IS_NOT_EXIST); + } + if(null == files || files.length == 0){ + throw new ServiceException(Message.IMAGE_IS_EMPTY); + } + String dateStr = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")); + String path_prefix = FilePathEnum.IMAGE.getFileAbsolutePathPrefix().concat(imageSource).concat(FileUtil.FILE_SEPARATOR) + .concat(projectId).concat(FileUtil.FILE_SEPARATOR) + .concat(dateStr).concat(FileUtil.FILE_SEPARATOR); + if (!FileUtil.exist(path_prefix)) { + FileUtil.mkdir(path_prefix); + } + List list = new ArrayList<>(files.length); + List imageList = new ArrayList<>(); + + ImageCollectEntity imageCollect = Optional.ofNullable(BeanUtil.copyProperties(collectReq, ImageCollectEntity.class)).orElse(new ImageCollectEntity()); + imageCollect.setCollectId(IdUtil.simpleUUID()); + imageCollect.setCollectorId(StpUtil.getLoginIdAsString()); + imageCollect.setCollectorName(userService.getById(StpUtil.getLoginIdAsString()).getName()); + for (MultipartFile multipartFile : files) { + String absolutePath = path_prefix + multipartFile.getOriginalFilename(); + FileUtil.writeFromStream(multipartFile.getInputStream(),absolutePath); + String fileDownPath = FilePathEnum.IMAGE.getFileDownPath(absolutePath); + ImageEntity imageEntity = new ImageEntity(); + try { + ImageReq imageReq = imageRespBuilder(absolutePath, fileDownPath); + BeanUtil.copyProperties(imageReq, imageEntity); + list.add(imageReq); + imageEntity.setProjectId(projectId); + imageEntity.setCollectId(imageCollect.getCollectId()); + imageList.add(imageEntity); + } catch (Exception e) { + e.printStackTrace(); + } + } + imageCollectService.save(imageCollect); + baseMapper.insert(imageList); + return list; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public List batchUploadCommonImage(String imageSource, ImageWorkReq imageWorkReq, MultipartFile[] files) throws IOException { + if(null == files || files.length == 0){ + throw new ServiceException(Message.IMAGE_IS_EMPTY); + } + String dateStr = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")); + 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")) + .concat(" ").concat(StrUtil.emptyToDefault(imageWorkReq.getLatitude(), "0")) + .concat(" ").concat(StrUtil.emptyToDefault(imageWorkReq.getAltitude(), "0")) + .concat(FileUtil.FILE_SEPARATOR); + } + if (!FileUtil.exist(path_prefix)) { + FileUtil.mkdir(path_prefix); + } + List result = new ArrayList<>(files.length); + for (MultipartFile multipartFile : files) { + String path = path_prefix + multipartFile.getOriginalFilename(); + FileUtil.writeBytes(multipartFile.getBytes(),path); + result.add(FilePathEnum.IMAGE.getFileDownPath(path)); + } + String partId = imageWorkReq.getPartId(); + if (StrUtil.isNotEmpty(partId)) { + ImageCollectEntity imageCollect = new ImageCollectEntity(); + imageCollect.setCollectId(IdUtil.simpleUUID()); + imageCollect.setCollectorName(imageWorkReq.getUploadUser()); + PartResp part = partService.detail(partId); + List imageList = new ArrayList<>(); + result.forEach(path -> { + ImageEntity imageEntity = new ImageEntity(); + String absolutePath = FilePathEnum.IMAGE.getFileAbsolutePath(path); + try { + ImageReq imageReq = imageRespBuilder(absolutePath, path); + BeanUtil.copyProperties(imageReq, imageEntity); + } catch (Exception e) { + log.debug("读取文件信息失败:{}", path); + imageEntity.setImageName(FileUtil.getName(absolutePath)); + BigDecimal imageSize = new BigDecimal(FileUtil.size(FileUtil.file(absolutePath))).divide(new BigDecimal(1024*1024), 4, RoundingMode.HALF_UP); + imageEntity.setImageSize(imageSize.toString().concat("M")); + } + imageEntity.setLongitude(imageWorkReq.getLongitude()); + imageEntity.setLatitude(imageWorkReq.getLatitude()); + imageEntity.setAltitude(imageWorkReq.getAltitude()); + imageEntity.setImagePath(path); + imageEntity.setPartId(partId); + imageEntity.setProjectId(part.getProjectId()); + imageEntity.setCollectId(imageCollect.getCollectId()); + imageList.add(imageEntity); + }); + imageCollectService.save(imageCollect); + baseMapper.insert(imageList); + } + return result; + } + + @Transactional(rollbackFor = Exception.class) + @Override + public void delete(String imageId) { + ImageEntity image = this.getById(imageId); + if(null ==image){ + throw new ServiceException(Message.IMAGE_ID_IS_NOT_EXIST); + } + this.removeById(image); + List imageList = this.list(Wrappers.lambdaQuery().eq(ImageEntity::getCollectId, image.getCollectId())); + if(CollUtil.isEmpty(imageList)){ + imageCollectService.removeById(image.getCollectId()); + } + FilePathEnum pathEnum = FilePathEnum.getFilePathEnum(image.getImagePath()); + FileUtil.del(pathEnum.getFileAbsolutePath(image.getImagePath())); + FileUtil.del(FilePathEnum.IMAGE.getFileAbsolutePath(image.getPreImagePath())); + } + + private ImageReq imageRespBuilder(String absolutePath, String downloadPath) throws Exception { + ImageReq req = new ImageReq(); + File file = new File(absolutePath); + JSONObject obj = EXIFUtil.printImageTags(file); + req.setCameraManufacturer(obj.getStr("Make")); + req.setCameraModel(obj.getStr("Model")); + req.setImageName(obj.getStr("File Name")); + req.setImagePath(downloadPath); + BigDecimal imageSize = new BigDecimal(extractDigit(obj.getStr("File Size"))).divide(new BigDecimal(1024*1024), 4, RoundingMode.HALF_UP); + req.setImageSize(imageSize.toString().concat("M")); + req.setImageWidth(extractDigit(obj.getStr("Image Width"))); + req.setImageHeight(extractDigit(obj.getStr("Image Height"))); + req.setImageResolution(req.getImageWidth().concat("x").concat(req.getImageHeight())); + req.setFocalDistance35(extractDigit(obj.getStr("Focal Length 35"))); + req.setXResolution(extractDigit(obj.getStr("X Resolution"))); + req.setYResolution(extractDigit(obj.getStr("Y Resolution"))); + req.setResolutionUnits(obj.getStr("Resolution Units")); + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy:MM:dd HH:mm:ss"); + if(StrUtil.isNotBlank(obj.getStr("Date/Time Original"))){ + req.setShootingTime(LocalDateTime.parse(obj.getStr("Date/Time Original"), formatter)); + } + req.setFocalDistance(extractDigit(obj.getStr("Focal Length"))); + req.setLatitude(obj.getStr("GPS Latitude")); + req.setLongitude(obj.getStr("GPS Longitude")); + req.setAltitude(extractDigit(obj.getStr("GPS Altitude"))); + if(StrUtil.isNotBlank(req.getLatitude()) && StrUtil.isNotBlank(req.getLongitude()) && StrUtil.isNotBlank(req.getAltitude())){ + String gps = req.getLatitude().concat("°").concat(directionTranslator(obj.getStr("GPS Latitude Ref"))).concat(StrUtil.COMMA) + .concat(req.getLongitude()).concat("°").concat(directionTranslator(obj.getStr("GPS Longitude Ref"))).concat(StrUtil.COMMA) + .concat("海拔").concat(req.getAltitude()).concat("m"); + req.setGPS(gps); + } + return req; + } + + private String directionTranslator(String direction){ + if(direction.equalsIgnoreCase("N")){ + return "北"; + } else if (direction.equalsIgnoreCase("S")) { + return "南"; + } else if (direction.equalsIgnoreCase("E")) { + return "东"; + }else if (direction.equalsIgnoreCase("W")) { + return "西"; + }else { + return "未知"; + } + } + + private static String extractDigit(String str) { + if(StrUtil.isEmpty(str)){ + return null; + } + Pattern pattern = Pattern.compile("\\d+(\\.\\d+)?"); + Matcher matcher = pattern.matcher(str); + if (matcher.find()) { + return matcher.group(); + } else { + return null; + } + } + + @Override + public List listAppUploadImages() { + List filePaths = new ArrayList<>(); + 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.getFileDownPath(path.toFile().getAbsolutePath()); + List split = StrUtil.split(imageDownPath, StrUtil.SLASH, true, true); +// /static/image/source/date + try { + DateUtil.parseDate(split.get(3)); + filePaths.add(imageDownPath); + } catch (Exception ignore) {} + } + return FileVisitResult.CONTINUE; + } + }); + +// 查询图片关联记录 + List imageList = new ArrayList<>(); + CollUtil.split(filePaths, 1000).forEach(paths -> { + imageList.addAll(lambdaQuery().in(ImageEntity::getImagePath, paths).list()); + }); + Map imageMap = imageList.stream() + .collect(Collectors.toMap(ImageEntity::getImagePath, Function.identity(), (a, b) -> a)); + +// 查询部件信息 + Map partInfoMap = new HashMap<>(); + CollUtil.split(imageList, 1000).forEach(images -> { + List partIds = images.stream().map(ImageEntity::getPartId).collect(Collectors.toList()); + List partList = partService.listInfos(partIds); + partInfoMap.putAll(partList.stream().collect(Collectors.toMap(PartResp::getPartId, Function.identity()))); + }); + +// 将信息写入返回实体 + List respList = new ArrayList<>(); + for (String filePath : filePaths) { + AppImageResp resp = new AppImageResp(); + resp.setImagePath(filePath); + + List split = StrUtil.split(filePath, StrUtil.SLASH, true, true); + + ImageEntity image = imageMap.get(filePath); + if (image != null) { + BeanUtil.copyProperties(image, resp); + PartResp part = partInfoMap.get(image.getPartId()); + if (part != null) { + resp.setPartId(part.getPartId()); + resp.setPartName(part.getPartName()); + resp.setTurbineId(part.getTurbineId()); + resp.setTurbineName(part.getTurbineName()); + resp.setProjectId(part.getProjectId()); + resp.setProjectName(part.getProjectName()); + } + } else { + List gps = StrUtil.split(split.get(5), " "); + if (gps.size() > 1) { + resp.setLongitude(gps.get(0)); + resp.setLatitude(gps.get(1)); + resp.setAltitude(gps.get(2)); + } + } + resp.setUploadUser(split.get(4)); + resp.setImageSource(split.get(2)); + + respList.add(resp); + } + return respList; + } + + /** + * 功能描述:链接APP上传的图像到部件 + * + * @author cuizhibin + * @date 2025/06/06 09:44 + **/ + @Transactional(rollbackFor = Exception.class) + public void linkAppImagesToPart(AppImageToPartReq partReq) { + PartEntity part = partService.getById(partReq.getPartId()); + if (Objects.isNull(part)) { + throw new ServiceException(Message.PART_ID_IS_NOT_EXIST); + } +// 查询图片关联记录 + List imageList = new ArrayList<>(); + CollUtil.split(partReq.getImagePaths(), 1000).forEach(paths -> { + imageList.addAll(lambdaQuery().in(ImageEntity::getImagePath, paths).list()); + }); + partReq.getImagePaths().removeAll(imageList.stream().map(ImageEntity::getImagePath).toList()); + + String collectId = IdUtil.simpleUUID(); + imageList.forEach(imageEntity -> { + imageEntity.setPartId(partReq.getPartId()); + imageEntity.setCollectId(collectId); + }); + baseMapper.updateById(imageList); +// 新增 + List newImageList = new ArrayList<>(); + partReq.getImagePaths().forEach(path -> { + ImageEntity imageEntity = new ImageEntity(); + String absolutePath = FilePathEnum.IMAGE.getFileAbsolutePath(path); + try { + ImageReq imageReq = imageRespBuilder(absolutePath, path); + BeanUtil.copyProperties(imageReq, imageEntity); + } catch (Exception e) { + log.debug("读取文件信息失败:{}", path); + imageEntity.setImageName(FileUtil.getName(absolutePath)); + BigDecimal imageSize = new BigDecimal(FileUtil.size(FileUtil.file(absolutePath))).divide(new BigDecimal(1024*1024), 4, RoundingMode.HALF_UP); + imageEntity.setImageSize(imageSize.toString().concat("M")); + } + if (StrUtil.isEmpty(imageEntity.getLongitude()) || imageEntity.getLongitude().equals("0.0")) { + List split = StrUtil.split(path, StrUtil.SLASH, true, true); + List gps = StrUtil.split(split.get(5), " "); + imageEntity.setLongitude(gps.get(0)); + imageEntity.setLatitude(gps.get(1)); + imageEntity.setAltitude(gps.get(2)); + } + imageEntity.setImagePath(path); + imageEntity.setPartId(partReq.getPartId()); + imageEntity.setCollectId(collectId); + newImageList.add(imageEntity); + }); + 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 imageIds) { + if (CollUtil.isEmpty(imageIds)) { + throw new ServiceException(Message.IMAGE_IS_EMPTY); + } + lambdaUpdate().in(ImageEntity::getImageId, imageIds).set(ImageEntity::getReviewState, "1").update(); + } +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/service/impl/InspectionReportServiceImpl.java b/core/src/main/java/com/dite/znpt/service/impl/InspectionReportServiceImpl.java index 9e81bef..10c0870 100644 --- a/core/src/main/java/com/dite/znpt/service/impl/InspectionReportServiceImpl.java +++ b/core/src/main/java/com/dite/znpt/service/impl/InspectionReportServiceImpl.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.service.impl; import cn.dev33.satoken.stp.StpUtil; @@ -199,3 +200,206 @@ public class InspectionReportServiceImpl extends ServiceImpl implements InspectionReportService { + + @Resource + private ProjectService projectService; + + @Resource + private TurbineService turbineService; + + @Resource + private DefectService defectService; + + @Resource + private CheckSchemeService checkSchemeService; + + + @Resource + private UserService userService; + private final ExtUtilConfig extUtilConfig; + private final AttachInfoService attachInfoService; + + @Override + public List page(InspectionReportListReq req) { + PageUtil.startPage(); + return this.list(req); + } + + @Override + public List list(InspectionReportListReq req) { + return this.baseMapper.listInspectionReportListResp(req); + } + + @Override + public InspectionReportResp detail(String reportId) { + InspectionReportEntity inspectionReport = this.getById(reportId); + if(null == inspectionReport){ + throw new ServiceException(Message.INSPECTION_REPORT_ID_IS_NOT_EXIST); + } + InspectionReportResp result = new InspectionReportResp(); + List userIds = new ArrayList<>(); + InspectionReportReportInfo reportInfo = Converts.INSTANCE.toInspectionReportReportInfo(inspectionReport); + userIds.add(reportInfo.getReportAuditor()); + userIds.add(reportInfo.getReportWriter()); + userIds.add(reportInfo.getReportReviewer()); + ProjectResp projectInfo = projectService.detail(inspectionReport.getProjectId()); + result.setProjectInfo(projectInfo); + TurbineInfoResp turbineInfo = turbineService.info(inspectionReport.getTurbineId()); + result.setTurbineInfo(turbineInfo); + List schemeInfoList = checkSchemeService.list(List.of(inspectionReport.getCheckMethod().split(StrUtil.COMMA))); + result.setSchemeInfoList(schemeInfoList); + InspectionReportCheckInfo checkInfo = Converts.INSTANCE.toInspectionReportCheckInfo(inspectionReport); + userIds.addAll(List.of(checkInfo.getCheckUserId().split(StrUtil.COMMA))); + Map userIdMap = userService.listByIds(userIds).stream().collect(Collectors.toMap(UserEntity::getUserId, Function.identity())); + if(userIdMap.containsKey(reportInfo.getReportAuditor())){ + reportInfo.setReportAuditName(userIdMap.get(reportInfo.getReportAuditor()).getName()); + } + if(userIdMap.containsKey(reportInfo.getReportWriter())){ + reportInfo.setReportWriterName(userIdMap.get(reportInfo.getReportWriter()).getName()); + } + if(userIdMap.containsKey(reportInfo.getReportReviewer())){ + reportInfo.setReportReviewerName(userIdMap.get(reportInfo.getReportReviewer()).getName()); + } + result.setReportInfo(reportInfo); + StringBuilder checkUserName = new StringBuilder(); + Arrays.stream(checkInfo.getCheckUserId().split(StrUtil.COMMA)).forEach(userId ->{ + if(userIdMap.containsKey(userId)){ + checkUserName.append(userIdMap.get(userId).getUserId()).append(StrUtil.COMMA); + } + }); + checkInfo.setCheckUserName(checkUserName.toString()); + checkInfo.setCheckMethodLabel(CheckMethodEnum.getDescByCode(checkInfo.getCheckMethod())); + result.setCheckInfo(checkInfo); + List defectInfoList = defectService.list(new DefectListReq().setTurbineId(inspectionReport.getTurbineId())); + result.setDefectInfoList(defectInfoList); + return result; + } + + @Transactional(rollbackFor = Exception.class) + @Override + public void save(InspectionReportReq req) { + this.save(validation(req)); + } + + @Transactional(rollbackFor = Exception.class) + @Override + public void update(String reportId, InspectionReportReq req) { + if(this.getById(reportId) == null){ + throw new ServiceException(Message.INSPECTION_REPORT_ID_IS_NOT_EXIST); + } + InspectionReportEntity entity = validation(req); + entity.setReportId(reportId); + this.updateById(entity); + } + + private InspectionReportEntity validation(InspectionReportReq req){ + ProjectEntity project = projectService.getById(req.getProjectId()); + if(null == project){ + throw new ServiceException(Message.PROJECT_ID_IS_NOT_EXIST); + } + if(ProjectStatusEnum.COMPLETED.getCode() != project.getStatus()){ + throw new ServiceException(StrUtil.format(Message.PROJECT_STATUS_IS_NOT_COMPLETED, project.getProjectName())); + } + TurbineEntity turbine = turbineService.getById(req.getTurbineId()); + if(null == turbine){ + throw new ServiceException(Message.TURBINE_ID_IS_NOT_EXIST); + } + if(ProjectStatusEnum.COMPLETED.getCode() != turbine.getStatus()){ + throw new ServiceException(StrUtil.format(Message.TURBINE_STATUS_IS_NOT_COMPLETED, turbine.getTurbineName())); + } + return Converts.INSTANCE.toInspectionReportEntity(req); + } + /** + * 功能描述:报告生成器 + * + * @param turbineId 机组id + * @author cuizhibin + * @date 2025/07/17 10:49 + **/ + @Override + @Transactional(rollbackFor = Exception.class) + public void reportGenerator(String turbineId) { + TurbineEntity turbine = turbineService.getById(turbineId); + if (Objects.isNull(turbine)) { + throw new ServiceException(Message.TURBINE_ID_IS_NOT_EXIST); + } + String outputDir = FilePathEnum.ATTACH.getFileAbsolutePathPrefix().concat(AttachBusinessTypeEnum.REPORT.getCode()).concat(FileUtil.FILE_SEPARATOR) + .concat(turbineId).concat(FileUtil.FILE_SEPARATOR); + String output = extUtilConfig.reportGenerator(turbineId, outputDir); + log.debug(output); + List list = FileUtil.listFileNames(outputDir); + if (CollUtil.isEmpty(list)) { + throw new ServiceException(Message.REPORT_GENERATOR_ERROR); + } + AttachInfoEntity attachInfo = new AttachInfoEntity(); + attachInfo.setBusinessId(turbineId); + attachInfo.setAttachPath(FilePathEnum.ATTACH.getFileDownPath(outputDir + list.get(0))); + attachInfo.setBusinessType(AttachBusinessTypeEnum.REPORT.getCode()); + attachInfoService.save(attachInfo); + + ProjectEntity project = projectService.getById(turbine.getProjectId()); + InspectionReportEntity inspectionReport = new InspectionReportEntity(); + inspectionReport.setTitle(project.getProjectName() + turbine.getTurbineName()); + inspectionReport.setProjectId(project.getProjectId()); + inspectionReport.setTurbineId(turbineId); + inspectionReport.setReportWriteTime(LocalDateTime.now()); + inspectionReport.setReportStatus(InspectionReportStatusEnum.PENDING.getCode()); + baseMapper.insert(inspectionReport); + } + + /** + * 功能描述:发布 + * + * @param reportId 报告id + * @author cuizhibin + * @date 2025/07/17 21:25 + **/ + @Override + public void publish(String reportId) { + InspectionReportEntity report = getById(reportId); + if (Objects.isNull(report)) { + throw new ServiceException(Message.REPORT_GENERATOR_ERROR); + } + report.setReportStatus(InspectionReportStatusEnum.PUBLISH.getCode()); + report.setReportAuditor(StpUtil.getLoginIdAsString()); + report.setReportAuditTime(LocalDateTime.now()); + baseMapper.updateById(report); + } +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/service/impl/InsuranceCompanyServiceImpl.java b/core/src/main/java/com/dite/znpt/service/impl/InsuranceCompanyServiceImpl.java index ace29b0..a4d79ae 100644 --- a/core/src/main/java/com/dite/znpt/service/impl/InsuranceCompanyServiceImpl.java +++ b/core/src/main/java/com/dite/znpt/service/impl/InsuranceCompanyServiceImpl.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.service.impl; import cn.hutool.core.util.StrUtil; @@ -94,3 +95,101 @@ public class InsuranceCompanyServiceImpl extends ServiceImpl implements InsuranceCompanyService { + @Override + public List page(InsuranceCompanyListReq req) { + PageUtil.startPage(); + return this.list(req); + } + + @Override + public List list(InsuranceCompanyListReq req) { + return Converts.INSTANCE.toInsuranceCompanyResp(this.list( + Wrappers.lambdaQuery(InsuranceCompanyEntity.class) + .eq(InsuranceCompanyEntity::getDelFlag, Constants.DEL_FLAG_0) + .like(StrUtil.isNotBlank(req.getInsuranceCompanyName()), InsuranceCompanyEntity::getInsuranceCompanyName, req.getInsuranceCompanyName()) + .like(StrUtil.isNotBlank(req.getContact()), InsuranceCompanyEntity::getContact, req.getContact()) + .like(StrUtil.isNotBlank(req.getContactPhone()), InsuranceCompanyEntity::getContactPhone, req.getContactPhone()) + .eq(StrUtil.isNotBlank(req.getStatus()), InsuranceCompanyEntity::getStatus, req.getStatus()) + )); + } + + @Override + public InsuranceCompanyResp detail(String insuranceCompanyId) { + InsuranceCompanyEntity entity = this.getById(insuranceCompanyId); + if(null == entity || !entity.getDelFlag().equals(Constants.DEL_FLAG_0)){ + throw new ServiceException(Message.INSURANCE_COMPANY_ID_IS_NOT_EXIST); + } + return Converts.INSTANCE.toInsuranceCompanyResp(entity); + } + + @Transactional(rollbackFor = Exception.class) + @Override + public void save(InsuranceCompanyReq req) { + this.getOneOpt( + Wrappers.lambdaQuery(InsuranceCompanyEntity.class) + .eq(InsuranceCompanyEntity::getDelFlag, Constants.DEL_FLAG_0) + .eq(InsuranceCompanyEntity::getInsuranceCompanyName, req.getInsuranceCompanyName()) + ).ifPresent(insuranceCompany -> {throw new ServiceException(Message.INSURANCE_COMPANY_NAME_IS_EXIST);}); + this.save(Converts.INSTANCE.toInsuranceCompanyEntity(req)); + } + + @Transactional(rollbackFor = Exception.class) + @Override + public void update(String insuranceCompanyId, InsuranceCompanyReq req) { + InsuranceCompanyEntity insuranceCompany = this.getById(insuranceCompanyId); + if(null == insuranceCompany || !insuranceCompany.getDelFlag().equals(Constants.DEL_FLAG_0)){ + throw new ServiceException(Message.INSURANCE_COMPANY_ID_IS_NOT_EXIST); + } + if(!req.getInsuranceCompanyName().equals(insuranceCompany.getInsuranceCompanyName())){ + this.getOneOpt( + Wrappers.lambdaQuery(InsuranceCompanyEntity.class) + .eq(InsuranceCompanyEntity::getDelFlag, Constants.DEL_FLAG_0) + .eq(InsuranceCompanyEntity::getInsuranceCompanyName, req.getInsuranceCompanyName()) + ).ifPresent(company -> {throw new ServiceException(Message.INSURANCE_COMPANY_NAME_IS_EXIST);}); + } + InsuranceCompanyEntity entity = Converts.INSTANCE.toInsuranceCompanyEntity(req); + entity.setInsuranceCompanyId(insuranceCompanyId); + this.updateById(entity); + } + + @Transactional(rollbackFor = Exception.class) + @Override + public void deleteById(String insuranceCompanyId) { + InsuranceCompanyEntity entity = this.getById(insuranceCompanyId); + if(null == entity || !entity.getDelFlag().equals(Constants.DEL_FLAG_0)){ + throw new ServiceException(Message.INSURANCE_COMPANY_ID_IS_NOT_EXIST); + } + entity.setDelFlag(Constants.DEL_FLAG_1); + this.updateById(entity); + } +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/service/impl/InsuranceInfoServiceImpl.java b/core/src/main/java/com/dite/znpt/service/impl/InsuranceInfoServiceImpl.java index d8c01f0..3ff4eab 100644 --- a/core/src/main/java/com/dite/znpt/service/impl/InsuranceInfoServiceImpl.java +++ b/core/src/main/java/com/dite/znpt/service/impl/InsuranceInfoServiceImpl.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.service.impl; import cn.hutool.core.bean.BeanUtil; @@ -198,3 +199,205 @@ public class InsuranceInfoServiceImpl extends ServiceImpl implements InsuranceInfoService { + + @Resource + private InsuranceCompanyService insuranceCompanyService; + + @Resource + private InsuranceTypeService insuranceTypeService; + + @Resource + private UserService userService; + + @Resource + private AttachInfoService attacheInfoService; + + @Override + public List page(InsuranceInfoListReq req) { + PageUtil.startPage(); + return this.list(req); + } + + @Override + public List list(InsuranceInfoListReq req) { + List result = Converts.INSTANCE.toInsuranceInfoResp( + this.list(Wrappers.lambdaQuery(InsuranceInfoEntity.class) + .like(StrUtil.isNotBlank(req.getName()), InsuranceInfoEntity::getName, req.getName()) + .like(StrUtil.isNotBlank(req.getUserCode()), InsuranceInfoEntity::getUserCode, req.getUserCode()) + .eq(StrUtil.isNotBlank(req.getInsuranceTypeId()), InsuranceInfoEntity::getInsuranceTypeId, req.getInsuranceCompanyId()) + .eq(StrUtil.isNotBlank(req.getInsuranceCompanyId()), InsuranceInfoEntity::getInsuranceCompanyId, req.getInsuranceCompanyId()) + .eq(StrUtil.isNotBlank(req.getInsuranceStatus()), InsuranceInfoEntity::getInsuranceStatus, req.getInsuranceStatus()) + )); + return result; + } + + @Override + public List pageAttach(InsuranceInfoListReq req) { + PageUtil.startPage(); + return this.listAttach(req); + } + + @Override + public List listAttach(InsuranceInfoListReq req) { + List result = Converts.INSTANCE.toInsuranceAttachResp( + this.list(Wrappers.lambdaQuery(InsuranceInfoEntity.class) + .like(StrUtil.isNotBlank(req.getName()), InsuranceInfoEntity::getName, req.getName()) + .like(StrUtil.isNotBlank(req.getUserCode()), InsuranceInfoEntity::getUserCode, req.getUserCode()) + .eq(StrUtil.isNotBlank(req.getInsuranceTypeId()), InsuranceInfoEntity::getInsuranceTypeId, req.getInsuranceCompanyId()) + .eq(StrUtil.isNotBlank(req.getInsuranceCompanyId()), InsuranceInfoEntity::getInsuranceCompanyId, req.getInsuranceCompanyId()) + .eq(StrUtil.isNotBlank(req.getInsuranceStatus()), InsuranceInfoEntity::getInsuranceStatus, req.getInsuranceStatus()) + ) + ); + + List attachInfoIds = result.stream().map(InsuranceAttachResp::getAttachInfoId).filter(StrUtil::isNotBlank).toList(); + if(CollUtil.isNotEmpty(attachInfoIds)){ + Map attachIdMap = attacheInfoService.list( + Wrappers.lambdaQuery(AttachInfoEntity.class).in(AttachInfoEntity::getAttachId, attachInfoIds).eq(AttachInfoEntity::getDelFlag, Constants.DEL_FLAG_0) + ).stream().collect(Collectors.toMap(AttachInfoEntity::getAttachId, Function.identity())); + result.forEach(resp -> { + if(StrUtil.isNotBlank(resp.getAttachInfoId()) && attachIdMap.containsKey(resp.getAttachInfoId())){ + resp.setAttachPath(attachIdMap.get(resp.getAttachInfoId()).getAttachPath()); + resp.setCreateTime(attachIdMap.get(resp.getAttachInfoId()).getCreateTime()); + resp.setFileType(attachIdMap.get(resp.getAttachInfoId()).getFileType()); + resp.setRemark(attachIdMap.get(resp.getAttachInfoId()).getRemark()); + } + }); + } + return result; + } + + @Override + public InsuranceInfoResp detail(String insuranceInfoId) { + InsuranceInfoEntity insuranceInfoEntity = this.getById(insuranceInfoId); + if(null == insuranceInfoEntity || !Constants.DEL_FLAG_0.equals(insuranceInfoEntity.getDelFlag())){ + throw new ServiceException(Message.INSURANCE_INFO_ID_IS_NOT_EXIST); + } + InsuranceInfoResp result = Converts.INSTANCE.toInsuranceInfoResp(insuranceInfoEntity); + if(StrUtil.isNotBlank(insuranceInfoEntity.getAttachInfoId())){ + AttachInfoEntity attachInfoEntity = attacheInfoService.getById(insuranceInfoEntity.getAttachInfoId()); + result.setAttachInfoResp(Converts.INSTANCE.toAttacheInfoResp(attachInfoEntity)); + } + return result; + } + + @Transactional(rollbackFor = Exception.class) + @Override + public void save(InsuranceInfoReq req) { + InsuranceInfoEntity entity = validation(Converts.INSTANCE.toInsuranceInfoEntity(req)); + this.save(entity); + if(StrUtil.isNotBlank(entity.getAttachInfoId())){ + attacheInfoService.updateBusinessIdByAttachIds(entity.getInsuranceInfoId(), Arrays.asList(entity.getAttachInfoId()), AttachBusinessTypeEnum.INSURANCE_FILE); + } + + } + + @Transactional(rollbackFor = Exception.class) + @Override + public void update(String insuranceInfoId, InsuranceInfoReq req) { + InsuranceInfoEntity insuranceInfoEntity = this.getById(insuranceInfoId); + if(null == insuranceInfoEntity || !Constants.DEL_FLAG_0.equals(insuranceInfoEntity.getDelFlag())){ + throw new ServiceException(Message.INSURANCE_INFO_ID_IS_NOT_EXIST); + } + InsuranceInfoEntity entity = Converts.INSTANCE.toInsuranceInfoEntity(req); + entity.setInsuranceInfoId(insuranceInfoId); + this.updateById(validation(entity)); + if(StrUtil.isNotBlank(entity.getAttachInfoId())){ + attacheInfoService.updateBusinessIdByAttachIds(entity.getInsuranceInfoId(), Arrays.asList(entity.getAttachInfoId()), AttachBusinessTypeEnum.INSURANCE_FILE); + } + } + + + private InsuranceInfoEntity validation(InsuranceInfoEntity entity) { + UserEntity user = userService.getById(entity.getUserId()); + if(null == user || !Constants.STATUS_0.equals(user.getStatus()) + || !Constants.DEL_FLAG_0.equals(user.getDelFlag()) + || !UserStatusEnum.EMPLOYED.getCode().equals(user.getUserStatus())){ + throw new ServiceException(Message.USER_ID_NOT_EXIST_OR_ILLEGAL); + } + entity.setName(user.getName()); + entity.setUserCode(user.getUserCode()); + InsuranceCompanyEntity company = insuranceCompanyService.getById(entity.getInsuranceCompanyId()); + if(null == company ||!Constants.DEL_FLAG_0.equals(company.getDelFlag())){ + throw new ServiceException(Message.INSURANCE_COMPANY_ID_IS_NOT_EXIST); + } + entity.setInsuranceCompanyName(company.getInsuranceCompanyName()); + InsuranceTypeEntity type = insuranceTypeService.getById(entity.getInsuranceTypeId()); + if(null == type || !Constants.DEL_FLAG_0.equals(type.getDelFlag())){ + throw new ServiceException(Message.INSURANCE_TYPE_ID_IS_NOT_EXIST); + } + entity.setInsuranceTypeName(type.getInsuranceTypeName()); + entity.setInsuranceStatus(entity.getExpireDate().isBefore(LocalDate.now()) ? InsuranceStatusEnum.EXPIRED.getCode() : InsuranceStatusEnum.EFFECTIVE.getCode()); + return entity; + } + + @Transactional(rollbackFor = Exception.class) + @Override + public void deleteById(String insuranceInfoId) { + InsuranceInfoEntity entity = this.getById(insuranceInfoId); + if(null == entity || !Constants.DEL_FLAG_0.equals(entity.getDelFlag())){ + throw new ServiceException(Message.INSURANCE_INFO_ID_IS_NOT_EXIST); + } + entity.setDelFlag(Constants.DEL_FLAG_1); + attacheInfoService.deleteByAttachInfoId(entity.getAttachInfoId()); + this.updateById(entity); + } + + @Transactional(rollbackFor = Exception.class) + @Scheduled(cron = "0 15 0 * * ?") + public void updateInsuranceStatus(){ + List list = this.list( + Wrappers.lambdaQuery(InsuranceInfoEntity.class) + .eq(InsuranceInfoEntity::getInsuranceStatus, InsuranceStatusEnum.EFFECTIVE.getCode()) + .lt(InsuranceInfoEntity::getExpireDate, LocalDate.now()) + ); + list.forEach(entity -> { + entity.setInsuranceStatus(InsuranceStatusEnum.EXPIRED.getCode()); + }); + this.updateBatchById(list); + } +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/service/impl/InsuranceTypeServiceImpl.java b/core/src/main/java/com/dite/znpt/service/impl/InsuranceTypeServiceImpl.java index ae2a9a8..ef8ac36 100644 --- a/core/src/main/java/com/dite/znpt/service/impl/InsuranceTypeServiceImpl.java +++ b/core/src/main/java/com/dite/znpt/service/impl/InsuranceTypeServiceImpl.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.service.impl; import cn.hutool.core.util.StrUtil; @@ -91,3 +92,98 @@ public class InsuranceTypeServiceImpl extends ServiceImpl implements InsuranceTypeService { + + @Override + public List page(String insuranceTypeName) { + PageUtil.startPage(); + return this.list(insuranceTypeName); + } + + @Override + public List list(String insuranceTypeName) { + return Converts.INSTANCE.toInsuranceTypeResp( + this.list(Wrappers.lambdaQuery(InsuranceTypeEntity.class) + .eq(InsuranceTypeEntity::getDelFlag, Constants.DEL_FLAG_0) + .like(StrUtil.isNotBlank(insuranceTypeName), InsuranceTypeEntity::getInsuranceTypeName, insuranceTypeName)) + ); + } + + @Override + public InsuranceTypeResp detail(String insuranceTypeId) { + InsuranceTypeEntity entity = this.getById(insuranceTypeId); + if(null == entity || !entity.getDelFlag().equals(Constants.DEL_FLAG_0)){ + throw new ServiceException(Message.INSURANCE_TYPE_ID_IS_NOT_EXIST); + } + return Converts.INSTANCE.toInsuranceTypeResp(entity); + } + + @Transactional(rollbackFor = Exception.class) + @Override + public void save(InsuranceTypeReq req) { + this.getOneOpt( + Wrappers.lambdaQuery(InsuranceTypeEntity.class) + .eq(InsuranceTypeEntity::getDelFlag, Constants.DEL_FLAG_0) + .eq(InsuranceTypeEntity::getInsuranceTypeName, req.getInsuranceTypeName()) + ).ifPresent( insuranceTypeEntity -> {throw new ServiceException(Message.INSURANCE_TYPE_NAME_IS_EXIST);}); + this.save(Converts.INSTANCE.toInsuranceTypeEntity(req)); + } + + @Transactional(rollbackFor = Exception.class) + @Override + public void update(String insuranceTypeId, InsuranceTypeReq req) { + InsuranceTypeEntity insurance = this.getById(insuranceTypeId); + if(null == insurance || !insurance.getDelFlag().equals(Constants.DEL_FLAG_0)){ + throw new ServiceException(Message.INSURANCE_TYPE_ID_IS_NOT_EXIST); + } + if(!insurance.getInsuranceTypeName().equals(req.getInsuranceTypeName())){ + this.getOneOpt( + Wrappers.lambdaQuery(InsuranceTypeEntity.class) + .eq(InsuranceTypeEntity::getDelFlag, Constants.DEL_FLAG_0) + .eq(InsuranceTypeEntity::getInsuranceTypeName, req.getInsuranceTypeName()) + ).ifPresent( insuranceTypeEntity -> {throw new ServiceException(Message.INSURANCE_TYPE_NAME_IS_EXIST);}); + } + InsuranceTypeEntity entity = Converts.INSTANCE.toInsuranceTypeEntity(req); + entity.setInsuranceTypeId(insuranceTypeId); + this.updateById(entity); + } + + @Transactional(rollbackFor = Exception.class) + @Override + public void deleteById(String insuranceTypeId) { + InsuranceTypeEntity insurance = this.getById(insuranceTypeId); + if(null == insurance || !insurance.getDelFlag().equals(Constants.DEL_FLAG_0)){ + throw new ServiceException(Message.INSURANCE_TYPE_ID_IS_NOT_EXIST); + } + insurance.setDelFlag(Constants.DEL_FLAG_1); + this.updateById(insurance); + } +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/service/impl/MenuServiceImpl.java b/core/src/main/java/com/dite/znpt/service/impl/MenuServiceImpl.java index 65c93ee..5df981d 100644 --- a/core/src/main/java/com/dite/znpt/service/impl/MenuServiceImpl.java +++ b/core/src/main/java/com/dite/znpt/service/impl/MenuServiceImpl.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.service.impl; import cn.dev33.satoken.stp.StpUtil; @@ -92,3 +93,99 @@ public class MenuServiceImpl extends ServiceImpl impleme this.removeById(menuId); } } +======= +package com.dite.znpt.service.impl; + +import cn.dev33.satoken.stp.StpUtil; +import cn.hutool.core.lang.tree.Tree; +import cn.hutool.core.lang.tree.TreeNodeConfig; +import cn.hutool.core.lang.tree.TreeUtil; +import cn.hutool.core.util.StrUtil; +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.MenuEntity; +import com.dite.znpt.domain.vo.MenuReq; +import com.dite.znpt.domain.vo.MenuResp; +import com.dite.znpt.exception.ServiceException; +import com.dite.znpt.mapper.MenuMapper; +import com.dite.znpt.service.MenuService; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; + +/** + * @author Bear.G + * @date 2025/5/21/周三 10:27 + * @description + */ +@Service +public class MenuServiceImpl extends ServiceImpl implements MenuService { + + @Override + public List> tree(String menuName, String terminalType) { + List menuList = StrUtil.isBlank(menuName) ? this.baseMapper.downwardRecursionSelect(null, terminalType) : this.baseMapper.upwardRecursionSelect(menuName, terminalType); + return buildMenuTree(menuList); + } + + public static List> buildMenuTree(List menuList) { + //配置 + TreeNodeConfig treeNodeConfig = new TreeNodeConfig(); + treeNodeConfig.setIdKey("menuId"); + treeNodeConfig.setNameKey("menuName"); + treeNodeConfig.setParentIdKey("parentId"); + treeNodeConfig.setWeightKey("orderNum"); + //转换器 + return TreeUtil.build(menuList, "0", treeNodeConfig, + (treeNode, tree) -> { + tree.setId(treeNode.getMenuId()); + tree.setParentId(treeNode.getParentId()); + tree.setName(treeNode.getMenuName()); + tree.setWeight(treeNode.getOrderNum()); + tree.putExtra("menuType",treeNode.getMenuType()); + tree.putExtra("visible",treeNode.getVisible()); + tree.putExtra("orderNum",treeNode.getOrderNum()); + tree.putExtra("path",treeNode.getPath()); + tree.putExtra("component",treeNode.getComponent()); + tree.putExtra("perms",treeNode.getPerms()); + }); + } + + @Override + public MenuResp detail(String menuId) { + return Converts.INSTANCE.toMenuResp(this.getById(menuId)); + } + + @Transactional(rollbackFor = Exception.class) + @Override + public void save(MenuReq req) { + MenuEntity entity = Converts.INSTANCE.toMenuEntity(req); + entity.setParentId(StrUtil.isBlank(req.getParentId()) ? "0" : req.getParentId()); + entity.setVisible(StrUtil.isBlank(req.getVisible()) ? "0" : req.getVisible()); + this.save(entity); + } + + @Transactional(rollbackFor = Exception.class) + @Override + public void update(String menuId, MenuReq req) { + 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"); + } + this.updateById(entity); + } + + @Transactional(rollbackFor = Exception.class) + @Override + public void deleteById(String menuId) { + this.removeById(menuId); + } +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/service/impl/ModelConfigServiceImpl.java b/core/src/main/java/com/dite/znpt/service/impl/ModelConfigServiceImpl.java index 0b70f88..0511c36 100644 --- a/core/src/main/java/com/dite/znpt/service/impl/ModelConfigServiceImpl.java +++ b/core/src/main/java/com/dite/znpt/service/impl/ModelConfigServiceImpl.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.service.impl; import cn.hutool.core.bean.BeanUtil; @@ -121,3 +122,128 @@ public class ModelConfigServiceImpl extends ServiceImpl 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 selectList(ModelConfigListReq modelConfigReq) { + PageUtil.startPage(); + List 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 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); + } + +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/service/impl/MultiModelYoloService.java b/core/src/main/java/com/dite/znpt/service/impl/MultiModelYoloService.java index f25f0f9..323e3d2 100644 --- a/core/src/main/java/com/dite/znpt/service/impl/MultiModelYoloService.java +++ b/core/src/main/java/com/dite/znpt/service/impl/MultiModelYoloService.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.service.impl; import ai.onnxruntime.OnnxTensor; @@ -145,3 +146,152 @@ public class MultiModelYoloService { } +======= +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 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 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> 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 detections = new ArrayList<>(); + for (Map.Entry> entry : class2Bbox.entrySet()) { + int label = entry.getKey(); + List 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 fileList = FileUtil.loopFiles(inputFolder, file -> { + String extName = FileUtil.extName(file); + return StrUtil.equalsAnyIgnoreCase(extName, "jpg", "png"); + }); + for (File file : fileList) { + List detections = detect(modelId, file.getAbsolutePath(), outputFolder+ FileUtil.FILE_SEPARATOR+FileUtil.getName(file), confThreshold); + } + } + +} + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/service/impl/OutbidInfoServiceImpl.java b/core/src/main/java/com/dite/znpt/service/impl/OutbidInfoServiceImpl.java new file mode 100644 index 0000000..ffee7fa --- /dev/null +++ b/core/src/main/java/com/dite/znpt/service/impl/OutbidInfoServiceImpl.java @@ -0,0 +1,125 @@ +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.AttachInfoEntity; +import com.dite.znpt.domain.entity.OutbidInfoEntity; +import com.dite.znpt.domain.vo.OutbidInfoReq; +import com.dite.znpt.domain.vo.OutbidInfoResp; +import com.dite.znpt.exception.ServiceException; +import com.dite.znpt.mapper.OutbidInfoMapper; +import com.dite.znpt.service.AttachInfoService; +import com.dite.znpt.service.BiddingInfoService; +import com.dite.znpt.service.OutbidInfoService; +import com.dite.znpt.util.PageUtil; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletResponse; +import java.util.List; + +/** + * @author Bear.G + * @date 2025/7/28/周一 16:12 + * @description + */ +@Service +public class OutbidInfoServiceImpl extends ServiceImpl implements OutbidInfoService { + + @Resource + private BiddingInfoService biddingInfoService; + + @Resource + private AttachInfoService attachInfoService; + + @Override + public List page(String projectName) { + PageUtil.startPage(); + return this.list(projectName); + } + + @Override + public List list(String projectName) { + return this.baseMapper.listOutbidInfoResp(projectName); + } + + @Override + public OutbidInfoResp detail(String outbidInfoId) { + return this.baseMapper.getOutbidInfoResp(outbidInfoId); + } + + @Transactional(rollbackFor = Exception.class) + @Override + public void save(OutbidInfoReq req) { + OutbidInfoEntity entity = Converts.INSTANCE.toOutbidInfoEntity(req); + if(!listByBiddingInfoId(req.getBiddingInfoId()).isEmpty()){ + throw new ServiceException(StrUtil.format(Message.OUTBID_INFO_IS_EXIST, req.getBiddingInfoId())); + } + this.save(entity); + if(StrUtil.isNotBlank(req.getOutbidNoticeFileId())){ + AttachInfoEntity attachInfo = attachInfoService.getById(req.getOutbidNoticeFileId()); + if(null == attachInfo || !Constants.DEL_FLAG_0.equals(attachInfo.getDelFlag())){ + throw new ServiceException(Message.ATTACH_INFO_IS_NOT_EXIST); + } + attachInfo.setBusinessId(entity.getOutbidInfoId()); + attachInfoService.updateById(attachInfo); + } + } + + private List listByBiddingInfoId(String biddingInfoId){ + return this.list(Wrappers.lambdaQuery().eq(OutbidInfoEntity::getBiddingInfoId, biddingInfoId)); + } + + @Transactional(rollbackFor = Exception.class) + @Override + public void update(String outbidInfoId, OutbidInfoReq req) { + OutbidInfoEntity outbidInfo = this.getById(outbidInfoId); + if(null == outbidInfo){ + throw new ServiceException(Message.OUTBID_INFO_ID_IS_NOT_EXIST); + } + if(!outbidInfo.getBiddingInfoId().equals(req.getBiddingInfoId())){ + if(!listByBiddingInfoId(req.getBiddingInfoId()).isEmpty()){ + throw new ServiceException(StrUtil.format(Message.OUTBID_INFO_IS_EXIST, req.getBiddingInfoId())); + } + } + OutbidInfoEntity entity = Converts.INSTANCE.toOutbidInfoEntity(req); + entity.setOutbidInfoId(outbidInfoId); + this.updateById(entity); + if(StrUtil.isNotBlank(req.getOutbidNoticeFileId())){ + AttachInfoEntity attachInfo = attachInfoService.getById(req.getOutbidNoticeFileId()); + if(null == attachInfo || !Constants.DEL_FLAG_0.equals(attachInfo.getDelFlag())){ + throw new ServiceException(Message.ATTACH_INFO_IS_NOT_EXIST); + } + attachInfo.setBusinessId(outbidInfoId); + attachInfoService.updateById(attachInfo); + }else { + if(StrUtil.isNotBlank(outbidInfo.getOutbidNoticeFileId())){ + attachInfoService.deleteByAttachInfoId(outbidInfo.getOutbidNoticeFileId()); + } + } + } + + @Transactional(rollbackFor = Exception.class) + @Override + public void deleteById(String outbidInfoId) { + OutbidInfoEntity outbidInfo = this.getById(outbidInfoId); + if(null == outbidInfo){ + throw new ServiceException(Message.OUTBID_INFO_ID_IS_NOT_EXIST); + } + this.removeById(outbidInfoId); + if(StrUtil.isNotBlank(outbidInfo.getOutbidNoticeFileId())){ + attachInfoService.deleteByAttachInfoId(outbidInfo.getOutbidNoticeFileId()); + } + } + + @Override + public void downLoadOutbidNoticeFile(String outbidNoticeFileId, HttpServletResponse response) throws Exception { + attachInfoService.download(outbidNoticeFileId, response); + } + +} diff --git a/core/src/main/java/com/dite/znpt/service/impl/PartServiceImpl.java b/core/src/main/java/com/dite/znpt/service/impl/PartServiceImpl.java index 331a8da..0bbbc9e 100644 --- a/core/src/main/java/com/dite/znpt/service/impl/PartServiceImpl.java +++ b/core/src/main/java/com/dite/znpt/service/impl/PartServiceImpl.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.service.impl; import cn.hutool.core.bean.BeanUtil; @@ -184,3 +185,191 @@ public class PartServiceImpl extends ServiceImpl impleme }).collect(Collectors.toList()); } } +======= +package com.dite.znpt.service.impl; + +import cn.hutool.core.bean.BeanUtil; +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.PartEntity; +import com.dite.znpt.domain.entity.ProjectEntity; +import com.dite.znpt.domain.entity.TurbineEntity; +import com.dite.znpt.domain.vo.PartListReq; +import com.dite.znpt.domain.vo.PartListResp; +import com.dite.znpt.domain.vo.PartReq; +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.service.PartService; +import com.dite.znpt.service.ProjectService; +import com.dite.znpt.service.TurbineService; +import com.dite.znpt.util.PageUtil; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.util.List; +import java.util.Map; +import java.util.function.Function; +import java.util.stream.Collectors; + +/** + * @author huise23 + * @date 2025/04/11 23:17 + * @Description: 部件表服务实现类 + */ +@Service +@RequiredArgsConstructor +public class PartServiceImpl extends ServiceImpl implements PartService { + + @Resource + private ProjectService projectService; + + @Resource + private TurbineService turbineService; + + /** + * 功能描述:分页查询列表 + * + * @param req 信息 + * @return {@link List }<{@link PartListResp }> + * @author huise23 + * @date 2025/04/11 23:17 + **/ + @Override + public List page(PartListReq req) { + PageUtil.startPage(); + return this.list(req); + } + + /** + * 功能描述:查询列表 + * + * @param req 信息 + * @return {@link List }<{@link PartListResp }> + * @author huise23 + * @date 2025/04/11 23:17 + **/ + @Override + public List list(PartListReq req) { + PageUtil.startPage(); + List list= this.baseMapper.queryBySelective(req); + list.forEach(resp -> { + resp.setPartTypeLabel(PartTypeEnum.getDescByCode(resp.getPartType())); + }); + return list; + } + + /** + * 功能描述:查询单条 + * + * @param partId Id + * @return {@link PartResp } + * @author huise23 + * @date 2025/04/11 23:17 + **/ + @Override + public PartResp detail(String partId) { + PartEntity entity = this.baseMapper.selectById(partId); + if(null == entity){ + throw new ServiceException(Message.PART_ID_IS_NOT_EXIST); + } + PartResp resp = Converts.INSTANCE.toPartResp(entity); + if(StrUtil.isNotEmpty(resp.getTurbineId())){ + TurbineEntity turbine = turbineService.getById(resp.getTurbineId()); + if(null != turbine){ + resp.setTurbineName(turbine.getTurbineName()); + if(StrUtil.isNotEmpty(turbine.getProjectId())){ + ProjectEntity project = projectService.getById(turbine.getProjectId()); + if(null != project){ + resp.setProjectId(resp.getProjectId()); + resp.setProjectName(project.getProjectName()); + } + } + } + } + return resp; + } + + /** + * 功能描述:新增 + * + * @param req + * @author huise23 + * @date 2025/04/11 23:17 + **/ + @Transactional(rollbackFor = Exception.class) + @Override + public void save(PartReq req) { + PartEntity entity = Converts.INSTANCE.toPartEntity(req); + this.save(entity); + } + + /** + * 功能描述:更新 + * + * @param partId + * @param req + * @author huise23 + * @date 2025/04/11 23:17 + **/ + @Transactional(rollbackFor = Exception.class) + @Override + public void update(String partId, PartReq req) { + if(null == this.baseMapper.selectById(partId)){ + throw new ServiceException(Message.PART_ID_IS_NOT_EXIST); + } + PartEntity entity = Converts.INSTANCE.toPartEntity(req); + entity.setPartId(partId); + this.updateById(entity); + } + + /** + * 功能描述:删除 + * + * @param partId Id + * @author huise23 + * @date 2025/04/11 23:17 + **/ + + @Transactional(rollbackFor = Exception.class) + @Override + public void deleteById(String partId) { + removeById(partId); + } + + /** + * 功能描述:删除 + * + * @param turbineIds 机组id + * @author huise23 + * @date 2025/04/11 23:17 + **/ + @Transactional(rollbackFor = Exception.class) + @Override + public void deleteByTurbineIds(List turbineIds) { + this.baseMapper.delete(Wrappers.lambdaQuery().in(PartEntity::getTurbineId, turbineIds)); + } + + @Override + public List listInfos(List partIds) { + List list = lambdaQuery().in(PartEntity::getPartId, partIds).list(); + List turbineList = turbineService.lambdaQuery().in(TurbineEntity::getTurbineId, list.stream().map(PartEntity::getTurbineId).collect(Collectors.toList())).list(); + Map turbineMap = turbineList.stream().collect(Collectors.toMap(TurbineEntity::getTurbineId, Function.identity())); + Map projectMap = projectService.lambdaQuery().in(ProjectEntity::getProjectId, turbineList.stream().map(TurbineEntity::getProjectId).collect(Collectors.toList())).list() + .stream().collect(Collectors.toMap(ProjectEntity::getProjectId, Function.identity())); + return BeanUtil.copyToList(list, PartResp.class).stream().peek(resp -> { + TurbineEntity turbineEntity = turbineMap.get(resp.getTurbineId()); + ProjectEntity projectEntity = projectMap.get(turbineEntity.getProjectId()); + resp.setTurbineName(turbineEntity.getTurbineName()); + resp.setProjectId(projectEntity.getProjectId()); + resp.setProjectName(projectEntity.getProjectName()); + }).collect(Collectors.toList()); + } +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/service/impl/PostServiceImpl.java b/core/src/main/java/com/dite/znpt/service/impl/PostServiceImpl.java index 3c55c3b..5b3a97d 100644 --- a/core/src/main/java/com/dite/znpt/service/impl/PostServiceImpl.java +++ b/core/src/main/java/com/dite/znpt/service/impl/PostServiceImpl.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.service.impl; import cn.hutool.core.util.StrUtil; @@ -68,3 +69,75 @@ public class PostServiceImpl extends ServiceImpl impleme this.removeById(postId); } } +======= +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.PostEntity; +import com.dite.znpt.domain.vo.PostReq; +import com.dite.znpt.domain.vo.PostResp; +import com.dite.znpt.exception.ServiceException; +import com.dite.znpt.mapper.PostMapper; +import com.dite.znpt.service.PostService; +import com.dite.znpt.util.PageUtil; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; + +/** + * @author Bear.G + * @date 2025/5/20/周二 10:20 + * @description + */ +@Service +public class PostServiceImpl extends ServiceImpl implements PostService { + + @Override + public List page(String postName) { + PageUtil.startPage(); + return this.list(postName); + } + + @Override + public List list(String postName) { + return Converts.INSTANCE.toPostResp(this.list(Wrappers.lambdaQuery(PostEntity.class).like(StrUtil.isNotBlank(postName), PostEntity::getPostName, postName))); + } + + @Override + public PostResp detail(String postId) { + return Converts.INSTANCE.toPostResp(this.getById(postId)); + } + + @Transactional(rollbackFor = Exception.class) + @Override + public void save(PostReq req) { + PostEntity entity = Converts.INSTANCE.toPostEntity(req); + this.save(entity); + } + + @Transactional(rollbackFor = Exception.class) + @Override + public void update(String postId, PostReq req) { + if(null == this.getById(postId)){ + throw new ServiceException(Message.POST_ID_NOT_EXIST); + } + PostEntity entity = Converts.INSTANCE.toPostEntity(req); + entity.setPostId(postId); + this.updateById(entity); + } + + @Transactional(rollbackFor = Exception.class) + @Override + public void deleteById(String postId) { + if(null == this.getById(postId)){ + throw new ServiceException(Message.POST_ID_NOT_EXIST); + } + this.removeById(postId); + } +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/service/impl/ProjectBudgetInfoServiceImpl.java b/core/src/main/java/com/dite/znpt/service/impl/ProjectBudgetInfoServiceImpl.java index 0bb4ede..0f1ed6b 100644 --- a/core/src/main/java/com/dite/znpt/service/impl/ProjectBudgetInfoServiceImpl.java +++ b/core/src/main/java/com/dite/znpt/service/impl/ProjectBudgetInfoServiceImpl.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.service.impl; import cn.hutool.core.bean.BeanUtil; @@ -90,3 +91,97 @@ public class ProjectBudgetInfoServiceImpl extends ServiceImpl implements ProjectBudgetInfoService { + + private final AttachInfoService attachInfoService; + + /** + * 功能描述:查询项目预算信息列表 + * + * @param projectBudgetInfoReq 项目预算信息信息 + * @return {@link List }<{@link ProjectBudgetInfoResp }> + * @author huise23 + * @date 2025/07/17 21:58 + **/ + @Override + public List selectList(ProjectBudgetInfoListReq projectBudgetInfoReq) { + PageUtil.startPage(); + List projectBudgetInfoList= this.baseMapper.queryBySelective(projectBudgetInfoReq); + projectBudgetInfoList.forEach(resp -> { + + }); + return projectBudgetInfoList; + } + + /** + * 功能描述:根据项目id获取项目预算信息列表 + * + * @param projectId 项目id + * @return {@link List }<{@link ProjectBudgetInfoListResp }> + * @author huise23 + * @date 2025/07/17 21:58 + **/ + @Override + public List detailByProjectId(String projectId) { + List projectBudgetInfoList= this.baseMapper.detailByProjectId(projectId); + projectBudgetInfoList.forEach(resp -> { + resp.setBudgetTypeDesc(BudgeTypeEnum.getDescByCode(resp.getBudgetType())); + }); + return projectBudgetInfoList; + } + + /** + * 功能描述:新增项目预算信息 + * + * @param projectBudgetInfoReq 项目预算信息 + * @author huise23 + * @date 2025/07/17 21:58 + **/ + @Override + @Transactional(rollbackFor = Exception.class) + public void saveData(List projectBudgetInfoReq) { + List list = new ArrayList<>(); + for (ProjectBudgetInfoReq req : projectBudgetInfoReq) { + ProjectBudgetInfoEntity info = BeanUtil.copyProperties(req, ProjectBudgetInfoEntity.class); + info.setBudgetId(IdUtil.simpleUUID()); + attachInfoService.updateBusinessIdByAttachIds(info.getBudgetId(), ListUtil.of(req.getAttachId()), AttachBusinessTypeEnum.PROJECT_BUDGE); + list.add(info); + } + lambdaUpdate().eq(ProjectBudgetInfoEntity::getProjectId, list.get(0).getProjectId()).remove(); + baseMapper.insert(list); + } + +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/service/impl/ProjectDailyReportServiceImpl.java b/core/src/main/java/com/dite/znpt/service/impl/ProjectDailyReportServiceImpl.java new file mode 100644 index 0000000..f04dfca --- /dev/null +++ b/core/src/main/java/com/dite/znpt/service/impl/ProjectDailyReportServiceImpl.java @@ -0,0 +1,138 @@ +package com.dite.znpt.service.impl; + +import cn.dev33.satoken.stp.StpUtil; +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.constant.Message; +import com.dite.znpt.domain.entity.AttachInfoEntity; +import com.dite.znpt.domain.entity.ProjectDailyReportEntity; +import com.dite.znpt.domain.vo.ProjectDailyReportListReq; +import com.dite.znpt.domain.vo.ProjectDailyReportReq; +import com.dite.znpt.domain.vo.ProjectDailyReportResp; +import com.dite.znpt.enums.AttachBusinessTypeEnum; +import com.dite.znpt.exception.ServiceException; +import com.dite.znpt.mapper.ProjectDailyReportMapper; +import com.dite.znpt.service.AttachInfoService; +import com.dite.znpt.service.ProjectDailyReportService; +import com.dite.znpt.util.PageUtil; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; + +import java.time.LocalDate; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.function.Function; +import java.util.stream.Collectors; + +/** + * @author huise23 + * @date 2025/07/27 19:51 + * @Description: 项目日报信息表服务实现类 + */ +@Service +@RequiredArgsConstructor +public class ProjectDailyReportServiceImpl extends ServiceImpl implements ProjectDailyReportService { + + private final AttachInfoService attachInfoService; + + /** + * 功能描述:查询项目日报信息列表 + * + * @param projectDailyReportReq 项目日报信息信息 + * @return {@link List }<{@link ProjectDailyReportResp }> + * @author huise23 + * @date 2025/07/27 19:51 + **/ + @Override + public List selectList(ProjectDailyReportListReq projectDailyReportReq) { + PageUtil.startPage(); + List respList= this.baseMapper.queryBySelective(projectDailyReportReq); + if (CollUtil.isNotEmpty(respList)) { + List reportIds = respList.stream().map(ProjectDailyReportResp::getReportId).toList(); + Map attachMap = attachInfoService.listByBusinessIds(reportIds, AttachBusinessTypeEnum.PROJECT_DAILY_REPORT) + .stream().collect(Collectors.toMap(AttachInfoEntity::getBusinessId, Function.identity())); + respList.forEach(resp -> { + resp.setReportAttach(attachMap.get(resp.getReportId())); + }); + } + return respList; + } + + /** + * 功能描述:查询单条项目日报信息 + * + * @param reportId 项目日报信息Id + * @return {@link ProjectDailyReportResp } + * @author huise23 + * @date 2025/07/27 19:51 + **/ + @Override + public ProjectDailyReportResp selectById(String reportId) { + ProjectDailyReportListReq projectDailyReportReq = new ProjectDailyReportListReq(); + projectDailyReportReq.setReportId(reportId); + + List list = selectList(projectDailyReportReq); + return CollUtil.isNotEmpty(list) ? CollUtil.getFirst(list) : new ProjectDailyReportResp(); + } + + /** + * 功能描述:新增项目日报信息 + * + * @param projectDailyReportReq 项目日报信息 + * @author huise23 + * @date 2025/07/27 19:51 + **/ + @Override + public void saveData(ProjectDailyReportReq projectDailyReportReq) { + ProjectDailyReportResp myToday = myToday(projectDailyReportReq.getProjectId()); + if (Objects.nonNull(myToday)) { + throw new ServiceException(Message.DAILY_REPORT_EXISTS); + } + ProjectDailyReportEntity entity = BeanUtil.copyProperties(projectDailyReportReq, ProjectDailyReportEntity.class); + save(entity); + attachInfoService.updateBusinessIdByAttachIds(entity.getReportId(), ListUtil.of(projectDailyReportReq.getReportAttachId()), AttachBusinessTypeEnum.PROJECT_DAILY_REPORT); + } + + /** + * 功能描述:更新项目日报信息 + * + * @param projectDailyReportReq 项目日报信息 + * @author huise23 + * @date 2025/07/27 19:51 + **/ + @Override + public void updateData(ProjectDailyReportReq projectDailyReportReq) { + ProjectDailyReportEntity entity = BeanUtil.copyProperties(projectDailyReportReq, ProjectDailyReportEntity.class); + updateById(entity); + attachInfoService.updateBusinessIdByAttachIds(entity.getReportId(), ListUtil.of(projectDailyReportReq.getReportAttachId()), AttachBusinessTypeEnum.PROJECT_DAILY_REPORT); + } + + /** + * 功能描述:删除项目日报信息 + * + * @param reportId 项目日报信息Id + * @author huise23 + * @date 2025/07/27 19:51 + **/ + @Override + public void deleteById(String reportId) { + removeById(reportId); + } + + @Override + public ProjectDailyReportResp myToday(String projectId) { + ProjectDailyReportListReq req = new ProjectDailyReportListReq(); + req.setProjectId(projectId); + req.setSubmitUser(StpUtil.getLoginIdAsString()); + req.setReportDate(LocalDate.now()); + List list = selectList(req); + if (CollUtil.isNotEmpty(list)){ + return CollUtil.getFirst(list); + } + return null; + } + +} diff --git a/core/src/main/java/com/dite/znpt/service/impl/ProjectServiceImpl.java b/core/src/main/java/com/dite/znpt/service/impl/ProjectServiceImpl.java index faf5a4a..c68f56a 100644 --- a/core/src/main/java/com/dite/znpt/service/impl/ProjectServiceImpl.java +++ b/core/src/main/java/com/dite/znpt/service/impl/ProjectServiceImpl.java @@ -5,20 +5,34 @@ import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.dite.znpt.constant.Message; import com.dite.znpt.converts.Converts; +<<<<<<< HEAD import com.dite.znpt.domain.entity.UserEntity; import com.dite.znpt.domain.entity.ProjectEntity; +======= +import com.dite.znpt.domain.entity.ProjectEntity; +import com.dite.znpt.domain.entity.UserEntity; +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f import com.dite.znpt.domain.vo.ProjectListReq; import com.dite.znpt.domain.vo.ProjectListResp; import com.dite.znpt.domain.vo.ProjectReq; import com.dite.znpt.domain.vo.ProjectResp; import com.dite.znpt.enums.ProjectStatusEnum; import com.dite.znpt.exception.ServiceException; +<<<<<<< HEAD import com.dite.znpt.service.UserService; import com.dite.znpt.service.ProjectService; import com.dite.znpt.mapper.ProjectMapper; import org.springframework.stereotype.Service; import lombok.RequiredArgsConstructor; import com.dite.znpt.util.PageUtil; +======= +import com.dite.znpt.mapper.ProjectMapper; +import com.dite.znpt.service.ProjectService; +import com.dite.znpt.service.UserService; +import com.dite.znpt.util.PageUtil; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; @@ -59,6 +73,10 @@ public class ProjectServiceImpl extends ServiceImpl list= this.baseMapper.queryBySelective(req); list.forEach(resp -> { resp.setStatusLabel(ProjectStatusEnum.getDescByCode(resp.getStatus())); +<<<<<<< HEAD +======= +// 判断人员类型 +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f }); return list; } diff --git a/core/src/main/java/com/dite/znpt/service/impl/ProjectTaskGroupServiceImpl.java b/core/src/main/java/com/dite/znpt/service/impl/ProjectTaskGroupServiceImpl.java index cd5c531..d66f7b4 100644 --- a/core/src/main/java/com/dite/znpt/service/impl/ProjectTaskGroupServiceImpl.java +++ b/core/src/main/java/com/dite/znpt/service/impl/ProjectTaskGroupServiceImpl.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.service.impl; import cn.hutool.core.bean.BeanUtil; @@ -93,3 +94,100 @@ public class ProjectTaskGroupServiceImpl extends ServiceImpl implements ProjectTaskGroupService { + + private final ProjectTaskService projectTaskService; + + /** + * 功能描述:查询项目任务组信息列表 + * + * @param projectTaskGroupReq 项目任务组信息信息 + * @return {@link List }<{@link ProjectTaskGroupResp }> + * @author huise23 + * @date 2025/06/25 17:21 + **/ + @Override + public List selectList(ProjectTaskGroupListReq projectTaskGroupReq) { + PageUtil.startPage(); + List projectTaskGroupList= this.baseMapper.queryBySelective(projectTaskGroupReq); + ProjectTaskListReq listReq = new ProjectTaskListReq(); + listReq.setTaskNameOrMainUser(projectTaskGroupReq.getKeyword()); + Map> taskMap = projectTaskService.selectList(listReq).stream().collect(Collectors.groupingBy(ProjectTaskResp::getTaskGroupId)); + projectTaskGroupList.forEach(resp -> { + resp.setTaskList(taskMap.get(resp.getGroupId())); + }); + return projectTaskGroupList; + } + + /** + * 功能描述:新增项目任务组信息 + * + * @param projectTaskGroupReq 项目任务组信息 + * @author huise23 + * @date 2025/06/25 17:21 + **/ + @Override + public void saveData(ProjectTaskGroupReq projectTaskGroupReq) { +// todo 校验 + ProjectTaskGroupEntity entity = BeanUtil.copyProperties(projectTaskGroupReq, ProjectTaskGroupEntity.class); + save(entity); + } + + /** + * 功能描述:更新项目任务组信息 + * + * @param projectTaskGroupReq 项目任务组信息 + * @author huise23 + * @date 2025/06/25 17:21 + **/ + @Override + public void updateData(ProjectTaskGroupReq projectTaskGroupReq) { +// todo 校验 + ProjectTaskGroupEntity entity = BeanUtil.copyProperties(projectTaskGroupReq, ProjectTaskGroupEntity.class); + updateById(entity); + } + + /** + * 功能描述:删除项目任务组信息 + * + * @param groupId 项目任务组信息Id + * @author huise23 + * @date 2025/06/25 17:21 + **/ + @Override + @Transactional(rollbackFor = Exception.class) + public void deleteById(String groupId) { +// todo 校验 + removeById(groupId); + projectTaskService.deleteByGroupId(groupId); + } + +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/service/impl/ProjectTaskServiceImpl.java b/core/src/main/java/com/dite/znpt/service/impl/ProjectTaskServiceImpl.java index e913698..204352c 100644 --- a/core/src/main/java/com/dite/znpt/service/impl/ProjectTaskServiceImpl.java +++ b/core/src/main/java/com/dite/znpt/service/impl/ProjectTaskServiceImpl.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.service.impl; import cn.hutool.core.bean.BeanUtil; @@ -267,3 +268,273 @@ public class ProjectTaskServiceImpl extends ServiceImpl implements ProjectTaskService { + + private final AttachInfoService attachInfoService; + private final ProjectTaskGroupMapper projectTaskGroupMapper; + + /** + * 功能描述:查询项目任务信息列表 + * + * @param projectTaskReq 项目任务信息信息 + * @return {@link List }<{@link ProjectTaskResp }> + * @author huise23 + * @date 2025/06/25 17:21 + **/ + @Override + public List selectList(ProjectTaskListReq projectTaskReq) { + List projectTaskList = this.baseMapper.queryBySelective(projectTaskReq); + Map> attachMap; + if (!BooleanUtil.isTrue(projectTaskReq.getIsExport())) { + attachMap = attachInfoService.listByBusinessIds(projectTaskList.stream().map(ProjectTaskResp::getTaskId).collect(Collectors.toList()), AttachBusinessTypeEnum.PROJECT_TASK) + .stream().collect(Collectors.groupingBy(AttachInfoEntity::getBusinessId)); + } else { + attachMap = new HashMap<>(); + } + projectTaskList.forEach(resp -> { + resp.setAttachList(attachMap.get(resp.getTaskId())); + }); + return projectTaskList; + } + + /** + * 功能描述:查询单条项目任务信息 + * + * @param taskId 项目任务信息Id + * @return {@link ProjectTaskResp } + * @author huise23 + * @date 2025/06/25 17:21 + **/ + @Override + public ProjectTaskResp selectById(String taskId) { + ProjectTaskListReq projectTaskReq = new ProjectTaskListReq(); + projectTaskReq.setTaskId(taskId); + + List list = selectList(projectTaskReq); + return CollUtil.isNotEmpty(list) ? CollUtil.getFirst(list) : new ProjectTaskResp(); + } + + /** + * 功能描述:新增项目任务信息 + * + * @param projectTaskReq 项目任务信息 + * @author huise23 + * @date 2025/06/25 17:21 + **/ + @Override + @Transactional(rollbackFor = Exception.class) + public void saveData(ProjectTaskReq projectTaskReq) { + ProjectTaskEntity entity = BeanUtil.copyProperties(projectTaskReq, ProjectTaskEntity.class); + checkTask(projectTaskReq); + save(entity); + attachInfoService.updateBusinessIdByAttachIds(entity.getTaskId(), projectTaskReq.getAttachFileIds(), AttachBusinessTypeEnum.PROJECT_TASK); + } + + /** + * 功能描述:更新项目任务信息 + * + * @param projectTaskReq 项目任务信息 + * @author huise23 + * @date 2025/06/25 17:21 + **/ + @Override + @Transactional(rollbackFor = Exception.class) + public void updateData(ProjectTaskReq projectTaskReq) { + ProjectTaskEntity entity = BeanUtil.copyProperties(projectTaskReq, ProjectTaskEntity.class); + checkTask(projectTaskReq); + updateById(entity); + attachInfoService.updateBusinessIdByAttachIds(projectTaskReq.getTaskId(), projectTaskReq.getAttachFileIds(), AttachBusinessTypeEnum.PROJECT_TASK); + } + + /** + * 功能描述:检查任务 + * + * @param taskReq 任务请求类 + * @author cuizhibin + * @date 2025/06/27 10:53 + **/ + private void checkTask(ProjectTaskReq taskReq) { + if (Objects.isNull(projectTaskGroupMapper.selectById(taskReq.getTaskGroupId()))) { + throw new ServiceException(Message.TASK_GROUP_ID_NOT_EXIST); + } + if (StrUtil.isEmpty(taskReq.getParentTaskId())) { + return; + } + Map taskMap = baseMapper.listAllParents(taskReq.getParentTaskId()).stream().collect(Collectors.toMap(ProjectTaskEntity::getTaskId, Function.identity())); +// 判断是否有循环父级 + if (StrUtil.isNotEmpty(taskReq.getTaskId())) { + if (taskMap.containsKey(taskReq.getTaskId())) { + String parentTaskId = taskReq.getParentTaskId(); + List strList = ListUtil.toList(taskReq.getTaskName()); + do { + ProjectTaskEntity task = taskMap.get(parentTaskId); + parentTaskId = task.getParentTaskId(); + if (StrUtil.isEmpty(parentTaskId)) { + break; + } + strList.add(task.getTaskName()); + } while (StrUtil.isNotEmpty(parentTaskId)); + throw new ServiceException(Message.TASK_IN_CYCLE + CollUtil.join(strList, "--")); + } + } +// 更新父级任务的计划起始/结束时间 + String parentTaskId = taskReq.getParentTaskId(); + LocalDate planStartDate = taskReq.getPlanStartDate(); + LocalDate planEndDate = taskReq.getPlanEndDate(); + Set updateTaskSet = new HashSet<>(); + do { + ProjectTaskEntity task = taskMap.get(parentTaskId); + parentTaskId = task.getParentTaskId(); + if (task.getPlanStartDate().isAfter(planStartDate)) { + task.setPlanStartDate(planStartDate); + updateTaskSet.add(task); + } else { + planStartDate = task.getPlanStartDate(); + } + if (task.getPlanEndDate().isBefore(planEndDate)) { + task.setPlanEndDate(planEndDate); + updateTaskSet.add(task); + } else { + planEndDate = task.getPlanEndDate(); + } + } while (StrUtil.isNotEmpty(parentTaskId)); + baseMapper.updateById(updateTaskSet); + } + + /** + * 功能描述:删除项目任务信息 + * + * @param taskId 项目任务信息Id + * @author huise23 + * @date 2025/06/25 17:21 + **/ + @Override + @Transactional(rollbackFor = Exception.class) + public void deleteById(String taskId) { + removeById(taskId); + attachInfoService.deleteByBusinessId(taskId, AttachBusinessTypeEnum.PROJECT_TASK); + } + + /** + * 功能描述:删除项目任务信息 + * + * @param groupId 项目任务组信息Id + * @author huise23 + * @date 2025/06/25 17:21 + **/ + @Override + @Transactional(rollbackFor = Exception.class) + public void deleteByGroupId(String groupId) { + List list = lambdaQuery().eq(ProjectTaskEntity::getTaskGroupId, groupId).list().stream().map(ProjectTaskEntity::getTaskId).toList(); + attachInfoService.deleteByBusinessIds(list, AttachBusinessTypeEnum.PROJECT_TASK); + baseMapper.deleteByIds(list); + } + + /** + * 功能描述:开始任务/任务组开始任务 + * + * @param taskStartReq 任务启动请求类 + * @author cuizhibin + * @date 2025/06/25 21:16 + **/ + @Override + @Transactional(rollbackFor = Exception.class) + public void startTask(ProjectTaskStartReq taskStartReq) { + if (StrUtil.isBlank(taskStartReq.getTaskId()) && StrUtil.isBlank(taskStartReq.getTaskGroupId())) { + throw new ServiceException(Message.TASK_ID_GROUP_ID_ALL_EMPTY); + } + List list; + if (StrUtil.isNotBlank(taskStartReq.getTaskGroupId())) { + list = lambdaQuery().eq(ProjectTaskEntity::getTaskGroupId, taskStartReq.getTaskGroupId()) + .eq(ProjectTaskEntity::getStatus, ProjectTaskStateEnum.PENDING.getCode()) + .list(); + if (CollUtil.isEmpty(list)) { + return; + } + } else { + list = List.of(getById(taskStartReq.getTaskId())); + if (!list.get(0).getStatus().equals(ProjectTaskStateEnum.PENDING.getCode())) { + throw new ServiceException(Message.TASK_STATUS_NOT_PENDING); + } + } + list.forEach(entity -> { + entity.setStatus(ProjectTaskStateEnum.IN_PROGRESS.getCode()); + entity.setActualStartDate(LocalDate.now()); + }); + baseMapper.updateById(list); + } + + /** + * 功能描述:结束任务/任务组结束任务 + * + * @param taskStartReq 任务启动请求类 + * @author cuizhibin + * @date 2025/06/25 21:16 + **/ + @Override + @Transactional(rollbackFor = Exception.class) + public void endTask(ProjectTaskStartReq taskStartReq) { + if (StrUtil.isBlank(taskStartReq.getTaskId()) && StrUtil.isBlank(taskStartReq.getTaskGroupId())) { + throw new ServiceException(Message.TASK_ID_GROUP_ID_ALL_EMPTY); + } + List list; + if (StrUtil.isNotBlank(taskStartReq.getTaskGroupId())) { + list = lambdaQuery().eq(ProjectTaskEntity::getTaskGroupId, taskStartReq.getTaskGroupId()) + .eq(ProjectTaskEntity::getStatus, ProjectTaskStateEnum.IN_PROGRESS.getCode()) + .list(); + if (CollUtil.isEmpty(list)) { + return; + } + } else { + list = List.of(getById(taskStartReq.getTaskId())); + if (!list.get(0).getStatus().equals(ProjectTaskStateEnum.IN_PROGRESS.getCode())) { + throw new ServiceException(Message.TASK_STATUS_NOT_IN_PROGRESS); + } + } + list.forEach(entity -> { + entity.setStatus(ProjectTaskStateEnum.COMPLETED.getCode()); + entity.setActualStartDate(LocalDate.now()); + }); + baseMapper.updateById(list); + } +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/service/impl/RoleMenuServiceImpl.java b/core/src/main/java/com/dite/znpt/service/impl/RoleMenuServiceImpl.java index b0303d9..30ecaf1 100644 --- a/core/src/main/java/com/dite/znpt/service/impl/RoleMenuServiceImpl.java +++ b/core/src/main/java/com/dite/znpt/service/impl/RoleMenuServiceImpl.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.service.impl; import cn.hutool.core.collection.CollUtil; @@ -57,3 +58,64 @@ public class RoleMenuServiceImpl extends ServiceImpl implements RoleMenuService { + + @Resource + private RoleService roleService; + @Resource + private MenuService menuService; + + @Transactional(rollbackFor = Exception.class) + @Override + public void bindRoleMenu(RoleMenuReq req) { + RoleEntity role = roleService.getById(req.getRoleId()); + if (role == null || !Constants.DEL_FLAG_0.equals(role.getDelFlag())) { + throw new ServiceException(Message.ROLE_ID_NOT_EXIST_OR_ILLEGAL); + } + List menuList = menuService.listByIds(req.getMenuIds()); + if(CollUtil.isEmpty(menuList) || menuList.size() != req.getMenuIds().size()){ + throw new ServiceException(Message.MENU_ID_NOT_EXIST_OR_ILLEGAL); + } + this.remove(Wrappers.lambdaQuery(RoleMenuEntity.class).eq(RoleMenuEntity::getRoleId, req.getRoleId())); + List roleMenuList =new ArrayList<>(req.getMenuIds().size()); + for (String menuId : req.getMenuIds()) { + RoleMenuEntity roleMenu = new RoleMenuEntity(); + roleMenu.setRoleId(req.getRoleId()); + roleMenu.setMenuId(menuId); + roleMenuList.add(roleMenu); + } + this.saveBatch(roleMenuList); + } +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/service/impl/RoleServiceImpl.java b/core/src/main/java/com/dite/znpt/service/impl/RoleServiceImpl.java index 9d8ec2f..96694f6 100644 --- a/core/src/main/java/com/dite/znpt/service/impl/RoleServiceImpl.java +++ b/core/src/main/java/com/dite/znpt/service/impl/RoleServiceImpl.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.service.impl; import cn.hutool.core.collection.CollUtil; @@ -90,3 +91,97 @@ public class RoleServiceImpl extends ServiceImpl impleme } } +======= +package com.dite.znpt.service.impl; + +import cn.hutool.core.collection.CollUtil; +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.RoleEntity; +import com.dite.znpt.domain.vo.RoleReq; +import com.dite.znpt.domain.vo.RoleResp; +import com.dite.znpt.exception.ServiceException; +import com.dite.znpt.mapper.RoleMapper; +import com.dite.znpt.service.RoleService; +import com.dite.znpt.util.PageUtil; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; + +/** + * @author Bear.G + * @date 2025/5/21/周三 10:25 + * @description + */ +@Service +public class RoleServiceImpl extends ServiceImpl implements RoleService { + + @Override + public List page(String roleName) { + PageUtil.startPage(); + return this.list(roleName); + } + + @Override + public List list(String roleName) { + List list = this.list( + Wrappers.lambdaQuery(RoleEntity.class) + .eq(RoleEntity::getDelFlag, Constants.DEL_FLAG_0) + .like(StrUtil.isNotBlank(roleName), RoleEntity::getRoleName, roleName) + ); + return Converts.INSTANCE.toRoleResp(list); + } + + @Transactional(rollbackFor = Exception.class) + @Override + public void save(RoleReq req) { + List roles = this.list(Wrappers.lambdaQuery(RoleEntity.class).eq(RoleEntity::getRoleCode, req.getRoleCode()).eq(RoleEntity::getDelFlag, Constants.DEL_FLAG_0)); + if(CollUtil.isNotEmpty(roles)){ + throw new ServiceException(Message.ROLE_CODE_EXIST); + } + RoleEntity entity = Converts.INSTANCE.toRoleEntity(req); + this.save(entity); + } + + @Transactional(rollbackFor = Exception.class) + @Override + public void update(String roleId, RoleReq req) { + RoleEntity role = this.getById(roleId); + if(null == role || !Constants.DEL_FLAG_0.equals(role.getDelFlag())) { + throw new ServiceException(Message.ROLE_ID_NOT_EXIST); + } + if(!role.getRoleCode().equals(req.getRoleCode())){ + List roles = this.list(Wrappers.lambdaQuery(RoleEntity.class).eq(RoleEntity::getRoleCode, req.getRoleCode()).eq(RoleEntity::getDelFlag, Constants.DEL_FLAG_0)); + if(CollUtil.isNotEmpty(roles)){ + throw new ServiceException(Message.ROLE_CODE_EXIST); + } + } + RoleEntity entity = Converts.INSTANCE.toRoleEntity(req); + entity.setRoleId(roleId); + entity.setRoleKey(null); + this.updateById(entity); + } + + @Transactional(rollbackFor = Exception.class) + @Override + public void deleteById(String roleId) { + RoleEntity entity = this.getById(roleId); + if(null == entity || !Constants.DEL_FLAG_0.equals(entity.getDelFlag())) { + throw new ServiceException(Message.ROLE_ID_NOT_EXIST); + } + entity.setDelFlag(Constants.DEL_FLAG_1); + this.updateById(entity); + } + + @Override + public RoleResp detail(String roleId) { + return Converts.INSTANCE.toRoleResp(this.getById(roleId)); + } + +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/service/impl/TenderInfoServiceImpl.java b/core/src/main/java/com/dite/znpt/service/impl/TenderInfoServiceImpl.java new file mode 100644 index 0000000..ae91c6a --- /dev/null +++ b/core/src/main/java/com/dite/znpt/service/impl/TenderInfoServiceImpl.java @@ -0,0 +1,135 @@ +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.AttachInfoEntity; +import com.dite.znpt.domain.entity.OutbidInfoEntity; +import com.dite.znpt.domain.entity.TenderInfoEntity; +import com.dite.znpt.domain.entity.UserEntity; +import com.dite.znpt.domain.vo.TenderInfoReq; +import com.dite.znpt.domain.vo.TenderInfoResp; +import com.dite.znpt.enums.AttachBusinessTypeEnum; +import com.dite.znpt.exception.ServiceException; +import com.dite.znpt.mapper.TenderInfoMapper; +import com.dite.znpt.service.AttachInfoService; +import com.dite.znpt.service.TenderInfoService; +import com.dite.znpt.service.UserService; +import com.dite.znpt.util.PageUtil; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.util.List; + +/** + * @author Bear.G + * @date 2025/7/28/周一 16:09 + * @description + */ +@Service +public class TenderInfoServiceImpl extends ServiceImpl implements TenderInfoService { + + @Resource + private UserService userService; + + @Resource + private AttachInfoService attachInfoService; + + @Override + public List page(String projectName) { + PageUtil.startPage(); + return this.list(projectName); + } + + @Override + public List list(String projectName) { + return this.baseMapper.listTenderInfoResp(projectName); + } + + @Override + public TenderInfoResp detail(String tenderInfoId) { + return this.baseMapper.getTenderInfoResp(tenderInfoId); + } + + @Transactional(rollbackFor = Exception.class) + @Override + public void save(TenderInfoReq req) { + TenderInfoEntity entity = Converts.INSTANCE.toTenderInfoEntity(req); + if(StrUtil.isNotBlank(req.getTenderManager())){ + UserEntity user = userService.getById(req.getTenderManager()); + if(null == user || !Constants.DEL_FLAG_0.equals(user.getDelFlag())){ + throw new ServiceException(Message.USER_ID_NOT_EXIST); + } + } + if(!listByBiddingInfoId(req.getBiddingInfoId()).isEmpty()){ + throw new ServiceException(StrUtil.format(Message.TENDER_INFO_IS_EXIST,req.getBiddingInfoId())); + } + this.save(entity); + if(StrUtil.isNotBlank(req.getTenderFileId())){ + AttachInfoEntity attachInfo = attachInfoService.getById(req.getTenderFileId()); + if(null == attachInfo || !Constants.DEL_FLAG_0.equals(attachInfo.getDelFlag())){ + throw new ServiceException(Message.ATTACH_INFO_IS_NOT_EXIST); + } + attachInfo.setBusinessId(entity.getTenderInfoId()); + attachInfoService.updateById(attachInfo); + } + } + + @Transactional(rollbackFor = Exception.class) + @Override + public void update(String tenderInfoId, TenderInfoReq req) { + TenderInfoEntity tenderInfo = this.getById(tenderInfoId); + if(null == tenderInfo){ + throw new ServiceException(Message.TENDER_INFO_ID_IS_NOT_EXIST); + } + if(!tenderInfo.getBiddingInfoId().equals(req.getBiddingInfoId())){ + if(!listByBiddingInfoId(req.getBiddingInfoId()).isEmpty()){ + throw new ServiceException(StrUtil.format(Message.TENDER_INFO_IS_EXIST,req.getBiddingInfoId())); + } + } + if(StrUtil.isNotBlank(req.getTenderFileId())){ + AttachInfoEntity attachInfo = attachInfoService.getById(req.getTenderFileId()); + if(null == attachInfo || !Constants.DEL_FLAG_0.equals(attachInfo.getDelFlag())){ + throw new ServiceException(Message.ATTACH_INFO_IS_NOT_EXIST); + } + attachInfo.setBusinessId(tenderInfoId); + attachInfoService.updateById(attachInfo); + }else{ + if(StrUtil.isNotBlank(tenderInfo.getTenderFileId())){ + attachInfoService.deleteByAttachInfoId(tenderInfo.getTenderFileId()); + } + } + TenderInfoEntity entity = Converts.INSTANCE.toTenderInfoEntity(req); + if(StrUtil.isNotBlank(req.getTenderManager())){ + UserEntity user = userService.getById(req.getTenderManager()); + if(null == user || !Constants.DEL_FLAG_0.equals(user.getDelFlag())){ + throw new ServiceException(Message.USER_ID_NOT_EXIST); + } + } + entity.setTenderInfoId(tenderInfoId); + this.updateById(entity); + + } + + private List listByBiddingInfoId(String biddingInfoId){ + return this.list(Wrappers.lambdaQuery().eq(TenderInfoEntity::getBiddingInfoId, biddingInfoId)); + } + + @Transactional(rollbackFor = Exception.class) + @Override + public void deleteById(String tenderInfoId) { + TenderInfoEntity tenderInfo = this.getById(tenderInfoId); + if(null ==tenderInfo){ + throw new ServiceException(Message.TENDER_INFO_ID_IS_NOT_EXIST); + } + this.removeById(tenderInfoId); + if(StrUtil.isNotBlank(tenderInfo.getTenderFileId())){ + attachInfoService.deleteByAttachInfoId(tenderInfo.getTenderFileId()); + } + } + +} diff --git a/core/src/main/java/com/dite/znpt/service/impl/UserPostServiceImpl.java b/core/src/main/java/com/dite/znpt/service/impl/UserPostServiceImpl.java index 24ad3a7..b10db1d 100644 --- a/core/src/main/java/com/dite/znpt/service/impl/UserPostServiceImpl.java +++ b/core/src/main/java/com/dite/znpt/service/impl/UserPostServiceImpl.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.service.impl; import cn.hutool.core.collection.CollUtil; @@ -89,3 +90,96 @@ public class UserPostServiceImpl extends ServiceImpl implements UserPostService { + + @Resource + private PostService postService; + @Resource + private UserService userService; + + @Override + public List getPostsByUserId(String userId) { + List postIds = this.list(Wrappers.lambdaQuery(UserPostEntity.class).eq(UserPostEntity::getUserId, userId)).stream().map(UserPostEntity::getPostId).toList(); + if (CollUtil.isEmpty(postIds)) { + return new ArrayList<>(); + } + List posts= postService.listByIds(postIds).stream().filter(post -> Constants.STATUS_1.equals(post.getStatus())).toList(); + return Converts.INSTANCE.toPostResp(posts); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void bindUserPost(String userId, List postIds) { + List postList = postService.listByIds(postIds); + if(CollUtil.isEmpty(postList) || postList.size() != postIds.size()){ + throw new ServiceException(Message.POST_ID_NOT_EXIST_OR_ILLEGAL); + } + UserEntity user = userService.getById(userId); + if(null == user || Constants.DEL_FLAG_1.equals(user.getDelFlag())){ + throw new ServiceException(Message.USER_ID_NOT_EXIST); + } + this.remove(Wrappers.lambdaQuery(UserPostEntity.class).eq(UserPostEntity::getUserId, userId)); + List userPostList = new ArrayList<>(); + postIds.forEach(postId -> { + UserPostEntity userPostEntity = new UserPostEntity(); + userPostEntity.setUserId(userId); + userPostEntity.setPostId(postId); + userPostList.add(userPostEntity); + }); + this.saveBatch(userPostList); + } + + @Transactional(rollbackFor = Exception.class) + @Override + public void bindPostUser(String postId, List userIds) { + PostEntity post = postService.getById(postId); + if(null == post || !Constants.STATUS_1.equals(post.getStatus())){ + throw new ServiceException(Message.POST_ID_NOT_EXIST_OR_ILLEGAL); + } + List userList = userService.listByIds(userIds).stream().filter(userEntity -> !Constants.DEL_FLAG_1.equals(userEntity.getDelFlag())).toList(); + if(CollUtil.isEmpty(userList) || userIds.size() != userList.size()){ + throw new ServiceException(Message.USER_ID_NOT_EXIST_OR_ILLEGAL); + } + this.remove(Wrappers.lambdaQuery(UserPostEntity.class).eq(UserPostEntity::getPostId, postId)); + List userPostList = new ArrayList<>(); + userIds.forEach(userId -> { + UserPostEntity userPostEntity = new UserPostEntity(); + userPostEntity.setUserId(userId); + userPostEntity.setPostId(postId); + userPostList.add(userPostEntity); + }); + this.saveBatch(userPostList); + } +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/service/impl/UserRoleServiceImpl.java b/core/src/main/java/com/dite/znpt/service/impl/UserRoleServiceImpl.java index 6b78b37..6796580 100644 --- a/core/src/main/java/com/dite/znpt/service/impl/UserRoleServiceImpl.java +++ b/core/src/main/java/com/dite/znpt/service/impl/UserRoleServiceImpl.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.service.impl; import cn.hutool.core.collection.CollUtil; @@ -89,3 +90,96 @@ public class UserRoleServiceImpl extends ServiceImpl implements UserRoleService { + + @Resource + private UserService userService; + + @Resource + private RoleService roleService; + + @Override + public List getRolesByUserId(String userId) { + List roleIds = this.list(Wrappers.lambdaQuery(UserRoleEntity.class).eq(UserRoleEntity::getUserId, userId)).stream().map(UserRoleEntity::getRoleId).toList(); + if (CollUtil.isEmpty(roleIds)) { + return new ArrayList<>(); + } + List roles = roleService.listByIds(roleIds).stream().filter(role -> Constants.DEL_FLAG_0.equals(role.getDelFlag()) && Constants.STATUS_1.equals(role.getStatus())).toList(); + return Converts.INSTANCE.toRoleResp(roles); + } + + @Transactional(rollbackFor = Exception.class) + @Override + public void bindUserRole(UserRoleReq req) { + UserEntity user = userService.getById(req.getUserId()); + if(null == user || !Constants.DEL_FLAG_0.equals(user.getDelFlag())){ + throw new ServiceException(Message.USER_ID_NOT_EXIST_OR_ILLEGAL); + } + List roleList = roleService.listByIds(req.getRoleIds()).stream().filter(role -> Constants.DEL_FLAG_0.equals(role.getDelFlag())).toList(); + if(CollUtil.isEmpty(roleList) || req.getRoleIds().size() != roleList.size()){ + throw new ServiceException(Message.ROLE_ID_NOT_EXIST_OR_ILLEGAL); + } + List userRoleList = new ArrayList<>(); + req.getRoleIds().forEach(roleId -> { + UserRoleEntity userRole = new UserRoleEntity(); + userRole.setUserId(req.getUserId()); + userRole.setRoleId(roleId); + userRoleList.add(userRole); + }); + this.saveBatch(userRoleList); + } + + @Transactional(rollbackFor = Exception.class) + @Override + public void bindRoleUser(String roleId, List userIds) { + RoleEntity role = roleService.getById(roleId); + if(role == null || !Constants.DEL_FLAG_0.equals(role.getDelFlag())){ + throw new ServiceException(Message.ROLE_ID_NOT_EXIST_OR_ILLEGAL); + } + List userList = userService.listByIds(userIds).stream().filter(user -> Constants.DEL_FLAG_0.equals(user.getDelFlag())).toList(); + if(CollUtil.isEmpty(userList) || userIds.size()!= userList.size()){ + throw new ServiceException(Message.USER_ID_NOT_EXIST_OR_ILLEGAL); + } + List userRoleList = new ArrayList<>(); + userIds.forEach(userId -> { + UserRoleEntity userRole = new UserRoleEntity(); + userRole.setUserId(userId); + userRole.setRoleId(roleId); + userRoleList.add(userRole); + }); + this.saveBatch(userRoleList); + } +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/service/impl/UserServiceImpl.java b/core/src/main/java/com/dite/znpt/service/impl/UserServiceImpl.java index 820eb5e..4dfc0a5 100644 --- a/core/src/main/java/com/dite/znpt/service/impl/UserServiceImpl.java +++ b/core/src/main/java/com/dite/znpt/service/impl/UserServiceImpl.java @@ -88,9 +88,15 @@ public class UserServiceImpl extends ServiceImpl impleme @Override public List list(UserListReq req) { return this.baseMapper.queryBySelective(req).stream().map(resp -> { +<<<<<<< HEAD resp.setUserTypeLabel(UserTypeEnum.getDescByCode(resp.getUserType())); resp.setUserStatusLabel(UserStatusEnum.getDescByCode(resp.getUserStatus())); return resp; +======= + resp.setUserTypeLabel(UserTypeEnum.getDescByCode(resp.getUserType())); + resp.setUserStatusLabel(UserStatusEnum.getDescByCode(resp.getUserStatus())); + return resp; +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f }).collect(Collectors.toList()); } @@ -107,7 +113,11 @@ public class UserServiceImpl extends ServiceImpl impleme UserEntity entity = this.getById(userId); UserResp userResp= Converts.INSTANCE.toUserResp(entity); if(StrUtil.isNotBlank(userResp.getDeptId())){ +<<<<<<< HEAD userResp.setDeptName(deptService.getById(userResp.getDeptId()).getDeptName()); +======= + userResp.setUserId(deptService.getById(userResp.getDeptId()).getDeptName()); +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f } userResp.setUserTypeLabel(UserTypeEnum.getDescByCode(userResp.getUserType())); userResp.setUserStatusLabel(UserStatusEnum.getDescByCode(userResp.getUserStatus())); @@ -252,4 +262,9 @@ public class UserServiceImpl extends ServiceImpl impleme entity.setDelFlag(Constants.DEL_FLAG_1); this.updateById(entity); } +<<<<<<< HEAD +======= + + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f } diff --git a/core/src/main/java/com/dite/znpt/service/impl/VideoFileInfoServiceImpl.java b/core/src/main/java/com/dite/znpt/service/impl/VideoFileInfoServiceImpl.java index b6f7055..cc44b96 100644 --- a/core/src/main/java/com/dite/znpt/service/impl/VideoFileInfoServiceImpl.java +++ b/core/src/main/java/com/dite/znpt/service/impl/VideoFileInfoServiceImpl.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.service.impl; import cn.hutool.core.bean.BeanUtil; @@ -134,3 +135,141 @@ public class VideoFileInfoServiceImpl extends ServiceImpl implements VideoFileInfoService { + + private final PartService partService; + + /** + * 功能描述:查询视频文件信息列表 + * + * @param videoFileInfoReq 视频文件信息信息 + * @return {@link List }<{@link VideoFileInfoResp }> + * @author huise23 + * @date 2025/06/09 09:45 + **/ + @Override + public List selectList(VideoFileInfoListReq videoFileInfoReq) { + PageUtil.startPage(); + List videoFileInfoList = this.baseMapper.queryBySelective(videoFileInfoReq); + videoFileInfoList.forEach(resp -> { + + }); + return videoFileInfoList; + } + + /** + * 功能描述:查询单条视频文件信息 + * + * @param id 视频文件信息Id + * @return {@link VideoFileInfoResp } + * @author huise23 + * @date 2025/06/09 09:45 + **/ + @Override + public VideoFileInfoResp selectById(String id) { + VideoFileInfoListReq videoFileInfoReq = new VideoFileInfoListReq(); + videoFileInfoReq.setId(id); + + List list = selectList(videoFileInfoReq); + return CollUtil.isNotEmpty(list) ? CollUtil.getFirst(list) : new VideoFileInfoResp(); + } + + /** + * 功能描述:更新视频文件信息 + * + * @param videoFileInfo 视频文件信息 + * @author huise23 + * @date 2025/06/09 09:45 + **/ + @Override + public void updateData(VideoFileInfoEntity videoFileInfo) { + updateById(videoFileInfo); + } + + /** + * 功能描述:删除视频文件信息 + * + * @param id 视频文件信息Id + * @author huise23 + * @date 2025/06/09 09:45 + **/ + @Override + public void deleteById(String id) { + removeById(id); + } + + /** + * 功能描述:批量上传 + * + * @param infoReq 视频文件信息实体 + * @param files 文件 + * @return + * @author cuizhibin + * @date 2025/06/09 10:14 + */ + @SneakyThrows + @Override + @Transactional(rollbackFor = Exception.class) + public List batchUpload(VideoFileInfoReq infoReq, MultipartFile[] files) { + if (null == partService.getById(infoReq.getPartId())) { + throw new ServiceException(Message.PART_ID_IS_NOT_EXIST); + } + if (null == files || files.length == 0) { + throw new ServiceException(Message.IMAGE_IS_EMPTY); + } + String dateStr = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")); + String path_prefix = FilePathEnum.VIDEO.getFileAbsolutePathPrefix().concat(dateStr).concat(FileUtil.FILE_SEPARATOR); + if (!FileUtil.exist(path_prefix)) { + FileUtil.mkdir(path_prefix); + } + List result = new ArrayList<>(files.length); + for (MultipartFile multipartFile : files) { + 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.getFileAbsolutePathPrefix()).replace(FileUtil.FILE_SEPARATOR, StrUtil.SLASH)); + result.add(info); + } + baseMapper.insert(result); + return result.stream().map(VideoFileInfoEntity::getFilePath).collect(Collectors.toList()); + } +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/service/impl/WorkShitServiceImpl.java b/core/src/main/java/com/dite/znpt/service/impl/WorkShitServiceImpl.java index 58ca006..3108e71 100644 --- a/core/src/main/java/com/dite/znpt/service/impl/WorkShitServiceImpl.java +++ b/core/src/main/java/com/dite/znpt/service/impl/WorkShitServiceImpl.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.service.impl; import cn.hutool.core.util.StrUtil; @@ -155,3 +156,162 @@ public class WorkShitServiceImpl extends ServiceImpl implements WorkShiftService { + + @Resource + private UserService userService; + + @Override + public List page(String workShitName) { + PageUtil.startPage(); + return this.list(workShitName); + } + + @Override + public List list(String workShitName) { + List list = this.list(Wrappers.lambdaQuery(WorkShiftEntity.class).eq(WorkShiftEntity::getDelFlag, Constants.DEL_FLAG_0).like(StrUtil.isNotBlank(workShitName), WorkShiftEntity::getWorkShiftName, workShitName)); + List userIds = list.stream().map(WorkShiftEntity::getCreateBy).toList(); + Map userIdMap = !userIds.isEmpty() ? userService.listByIds(userIds).stream().collect(Collectors.toMap(UserEntity::getUserId, Function.identity())): new HashMap<>(); + List result = Converts.INSTANCE.toWorkShiftListResp(list); + result.forEach(workShiftListResp -> { + workShiftListResp.setStatusLabel(Constants.STATUS_UNPUBLISH.equals(workShiftListResp.getStatus()) ? "未发布" : "已发布"); + if(userIdMap.containsKey(workShiftListResp.getCreateBy())){ + workShiftListResp.setCreateUserName(userIdMap.get(workShiftListResp.getCreateBy()).getName()); + } + }); + return result; + } + + @Override + public WorkShiftResp detail(String workShiftId) { + WorkShiftEntity workShift = this.getById(workShiftId); + if(workShift == null || !Constants.DEL_FLAG_0.equals(workShift.getDelFlag())){ + throw new ServiceException(Message.WORK_SHIFT_NOT_EXIST); + } + WorkShiftResp workShiftResp = Converts.INSTANCE.toWorkShiftResp(workShift); + workShiftResp.setStatusLabel(Constants.STATUS_UNPUBLISH.equals(workShiftResp.getStatus()) ? "未发布" : "已发布"); + return workShiftResp; + } + + @Transactional(rollbackFor = Exception.class) + @Override + public void save(WorkShiftReq req) { + List list = this.list(Wrappers.lambdaQuery(WorkShiftEntity.class).eq(WorkShiftEntity::getDelFlag, Constants.DEL_FLAG_0).eq(WorkShiftEntity::getWorkShiftName, req.getWorkShiftName())); + if(!list.isEmpty()){ + throw new ServiceException(Message.WORK_SHIFT_NAME_EXIST); + } + WorkShiftEntity entity = validation(req); + entity.setStatus(Constants.STATUS_UNPUBLISH); + this.save(entity); + } + + private WorkShiftEntity validation(WorkShiftReq req) { + if(req.getWorkTimeEnd().isBefore(req.getWorkTimeStart())){ + throw new ServiceException(Message.WORK_TIME_START_CAN_NOT_BEFORE_WORK_TIME_END); + } + int workTime = req.getWorkTimeEnd().toSecondOfDay() - req.getWorkTimeStart().toSecondOfDay() ; + if(req.getRestTimeEnd() != null && req.getRestTimeStart()!= null){ + if(req.getRestTimeEnd().isBefore(req.getRestTimeStart())){ + throw new ServiceException(Message.REST_TIME_START_CAN_NOT_BEFORE_REST_TIME_END); + } + if(!(req.getRestTimeStart().isAfter(req.getWorkTimeStart()) && req.getRestTimeStart().isBefore(req.getWorkTimeEnd()))){ + throw new ServiceException(Message.REST_TIME_START_MUST_BETWEEN_WORK_TIME); + } + if(!(req.getRestTimeEnd().isAfter(req.getWorkTimeStart()) && req.getRestTimeEnd().isBefore(req.getWorkTimeEnd()))){ + throw new ServiceException(Message.REST_TIME_END_MUST_BETWEEN_WORK_TIME); + } + workTime = workTime - (req.getRestTimeEnd().toSecondOfDay() - req.getRestTimeStart().toSecondOfDay()); + }else { + req.setRestTimeEnd(null); + req.setRestTimeEnd(null); + } + if(req.getEarlyTimeLimit() != null && req.getEarlyTimeOffset()!= null && req.getEarlyTimeLimit() <= req.getEarlyTimeOffset()){ + throw new ServiceException(Message.EARLY_TIME_LIMIT_CAN_NOT_BEFORE_EARLY_TIME_OFFSET); + } + if(req.getLateTimeLimit() != null && req.getLateTimeOffset() != null && req.getLateTimeLimit() <= req.getLateTimeOffset()){ + throw new ServiceException(Message.LATE_TIME_LIMIT_CAN_NOT_BEFORE_LATE_TIME_OFFSET); + } + + WorkShiftEntity entity = Converts.INSTANCE.toWorkShiftEntity(req); + entity.setWorkTime(workTime/60); + return entity; + } + + @Transactional(rollbackFor = Exception.class) + @Override + public void update(String workShiftId, WorkShiftReq req) { + WorkShiftEntity workShift = this.getById(workShiftId); + if(workShift == null || !Constants.DEL_FLAG_0.equals(workShift.getDelFlag())){ + throw new ServiceException(Message.WORK_SHIFT_NOT_EXIST); + } + List list = this.list(Wrappers.lambdaQuery(WorkShiftEntity.class).eq(WorkShiftEntity::getDelFlag, Constants.DEL_FLAG_0).eq(WorkShiftEntity::getWorkShiftName, req.getWorkShiftName())); + if(!req.getWorkShiftName().equals(workShift.getWorkShiftName()) && !list.isEmpty()){ + throw new ServiceException(Message.WORK_SHIFT_NAME_EXIST); + } + WorkShiftEntity entity = validation(req); + entity.setWorkShiftId(workShiftId); + this.updateById(entity); + } + + + @Transactional(rollbackFor = Exception.class) + @Override + public void publish(String workShiftId) { + WorkShiftEntity workShift = this.getById(workShiftId); + if(workShift == null || !Constants.DEL_FLAG_0.equals(workShift.getDelFlag())){ + throw new ServiceException(Message.WORK_SHIFT_NOT_EXIST); + } + if(!Constants.STATUS_UNPUBLISH.equals(workShift.getStatus())){ + throw new ServiceException(Message.WORK_SHIFT_IS_NOT_UNPUBLISH); + } + workShift.setStatus(Constants.STATUS_PUBLISH); + this.updateById(workShift); + } + + @Transactional(rollbackFor = Exception.class) + @Override + public void delete(String workShiftId) { + WorkShiftEntity workShift = this.getById(workShiftId); + if(workShift == null || !Constants.DEL_FLAG_0.equals(workShift.getDelFlag())){ + throw new ServiceException(Message.WORK_SHIFT_NOT_EXIST); + } + workShift.setDelFlag(Constants.DEL_FLAG_1); + this.updateById(workShift); + } +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/service/impl/WorkbenchServiceImpl.java b/core/src/main/java/com/dite/znpt/service/impl/WorkbenchServiceImpl.java index de0772a..53bac1e 100644 --- a/core/src/main/java/com/dite/znpt/service/impl/WorkbenchServiceImpl.java +++ b/core/src/main/java/com/dite/znpt/service/impl/WorkbenchServiceImpl.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.service.impl; import cn.dev33.satoken.stp.StpUtil; @@ -51,3 +52,58 @@ public class WorkbenchServiceImpl implements WorkbenchService { return resp; } } +======= +package com.dite.znpt.service.impl; + +import cn.dev33.satoken.stp.StpUtil; +import com.dite.znpt.domain.entity.DefectEntity; +import com.dite.znpt.domain.entity.InspectionReportEntity; +import com.dite.znpt.domain.entity.ProjectEntity; +import com.dite.znpt.domain.entity.ProjectTaskEntity; +import com.dite.znpt.domain.vo.WorkbenchInfoResp; +import com.dite.znpt.service.*; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +@Slf4j +@Service +@RequiredArgsConstructor +public class WorkbenchServiceImpl implements WorkbenchService { + private final ProjectService projectService; + private final ProjectTaskService projectTaskService; + private final InspectionReportService inspectionReportService; + private final DefectService defectService; + + @Override + public WorkbenchInfoResp getInfo() { + WorkbenchInfoResp resp = new WorkbenchInfoResp(); + String userId = StpUtil.getLoginIdAsString(); +// 项目数量 + Long projectCount = projectService.lambdaQuery() + .eq(ProjectEntity::getProjectManagerId, userId).or() + .eq(ProjectEntity::getAuditorId, userId).or() + .like(ProjectEntity::getConstructorIds, userId).or() + .eq(ProjectEntity::getQualityOfficerId, userId).or() + .eq(ProjectEntity::getConstructTeamLeaderId, userId) + .count(); + resp.setProjectCount(projectCount); + +// 进行中任务 + Long progressTaskCount = projectTaskService.lambdaQuery() + .eq(ProjectTaskEntity::getMainUserId, userId).or() + .like(ProjectTaskEntity::getUserIds, userId).count(); + resp.setProgressTaskCount(progressTaskCount); + +// 待审核报告数 + Long approvalReportCount = inspectionReportService.lambdaQuery().eq(InspectionReportEntity::getReportAuditor, userId).count(); + resp.setApprovalReportCount(approvalReportCount); + +// 发现缺陷数 + Long findDefectCount = defectService.lambdaQuery() + .eq(DefectEntity::getCreateBy, userId).count(); + resp.setFindDefectCount(findDefectCount); + return resp; + } +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/service/job/JobAntiThunderWorkService.java b/core/src/main/java/com/dite/znpt/service/job/JobAntiThunderWorkService.java index ea8fef9..a343da0 100644 --- a/core/src/main/java/com/dite/znpt/service/job/JobAntiThunderWorkService.java +++ b/core/src/main/java/com/dite/znpt/service/job/JobAntiThunderWorkService.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.service.job; import com.baomidou.mybatisplus.extension.service.IService; @@ -39,3 +40,46 @@ public interface JobAntiThunderWorkService extends IService List listByJobId(JobAntiThunderWorkReq dto); } +======= +package com.dite.znpt.service.job; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.dite.znpt.domain.entity.job.JobAntiThunderWork; +import com.dite.znpt.domain.vo.job.req.JobAntiThunderWorkReq; +import com.dite.znpt.domain.vo.job.req.JobInfoReq; + +import java.util.List; + +public interface JobAntiThunderWorkService extends IService { + + JobAntiThunderWork saveInfo(JobAntiThunderWork entity); + + /** + * 功能描述:列表查询 + * + * @param request 请求 + * @return {@link List }<{@link JobAntiThunderWork }> + * @author cuizhibin + * @date 2023/11/02 13:28 + **/ + List list(JobInfoReq request); + /** + * 功能描述:组长提交/项目经理审批 + * + * @param request 请求 + * @author cuizhibin + * @date 2023/11/06 10:32 + **/ + public void submit(JobInfoReq request); + /** + * 功能描述:组长驳回/项目经理驳回 + * + * @param request 请求 + * @author cuizhibin + * @date 2023/11/06 10:32 + **/ + public void reject(JobInfoReq request); + + List listByJobId(JobAntiThunderWorkReq dto); +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/service/job/JobInWorkPartsService.java b/core/src/main/java/com/dite/znpt/service/job/JobInWorkPartsService.java index cb557a3..21539b2 100644 --- a/core/src/main/java/com/dite/znpt/service/job/JobInWorkPartsService.java +++ b/core/src/main/java/com/dite/znpt/service/job/JobInWorkPartsService.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.service.job; import com.baomidou.mybatisplus.extension.service.IService; @@ -6,3 +7,13 @@ import com.dite.znpt.domain.entity.job.JobInWorkParts; public interface JobInWorkPartsService extends IService { } +======= +package com.dite.znpt.service.job; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.dite.znpt.domain.entity.job.JobAntiThunderWork; +import com.dite.znpt.domain.entity.job.JobInWorkParts; + +public interface JobInWorkPartsService extends IService { +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/service/job/JobInWorkService.java b/core/src/main/java/com/dite/znpt/service/job/JobInWorkService.java index c4cb0b8..b7cffc8 100644 --- a/core/src/main/java/com/dite/znpt/service/job/JobInWorkService.java +++ b/core/src/main/java/com/dite/znpt/service/job/JobInWorkService.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.service.job; import com.baomidou.mybatisplus.extension.service.IService; @@ -40,3 +41,47 @@ public interface JobInWorkService extends IService { List listByJobId(JobInWorkReq dto); } +======= +package com.dite.znpt.service.job; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.dite.znpt.domain.entity.job.JobInWork; +import com.dite.znpt.domain.entity.job.JobInWork; +import com.dite.znpt.domain.vo.job.req.JobInWorkReq; +import com.dite.znpt.domain.vo.job.req.JobInfoReq; + +import java.util.List; + +public interface JobInWorkService extends IService { + + JobInWork saveInfo(JobInWork entity); + + /** + * 功能描述:列表查询 + * + * @param request 请求 + * @return {@link List }<{@link JobInWork }> + * @author cuizhibin + * @date 2023/11/02 13:28 + **/ + List list(JobInfoReq request); + /** + * 功能描述:组长提交/项目经理审批 + * + * @param request 请求 + * @author cuizhibin + * @date 2023/11/06 10:32 + **/ + public void submit(JobInfoReq request); + /** + * 功能描述:组长驳回/项目经理驳回 + * + * @param request 请求 + * @author cuizhibin + * @date 2023/11/06 10:32 + **/ + public void reject(JobInfoReq request); + + List listByJobId(JobInWorkReq dto); +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/service/job/JobOutWorkService.java b/core/src/main/java/com/dite/znpt/service/job/JobOutWorkService.java index 782f101..31fd1a5 100644 --- a/core/src/main/java/com/dite/znpt/service/job/JobOutWorkService.java +++ b/core/src/main/java/com/dite/znpt/service/job/JobOutWorkService.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.service.job; import com.baomidou.mybatisplus.extension.service.IService; @@ -39,3 +40,46 @@ public interface JobOutWorkService extends IService { JobOutWork getByJobId(JobOutWorkReq dto); } +======= +package com.dite.znpt.service.job; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.dite.znpt.domain.entity.job.JobOutWork; +import com.dite.znpt.domain.vo.job.req.JobInfoReq; +import com.dite.znpt.domain.vo.job.req.JobOutWorkReq; + +import java.util.List; + +public interface JobOutWorkService extends IService { + + JobOutWork saveInfo(JobOutWork entity); + + /** + * 功能描述:列表查询 + * + * @param request 请求 + * @return {@link List }<{@link JobOutWork }> + * @author cuizhibin + * @date 2023/11/02 13:28 + **/ + List list(JobInfoReq request); + /** + * 功能描述:组长提交/项目经理审批 + * + * @param request 请求 + * @author cuizhibin + * @date 2023/11/06 10:32 + **/ + public void submit(JobInfoReq request); + /** + * 功能描述:组长驳回/项目经理驳回 + * + * @param request 请求 + * @author cuizhibin + * @date 2023/11/06 10:32 + **/ + public void reject(JobInfoReq request); + + JobOutWork getByJobId(JobOutWorkReq dto); +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/service/job/JobService.java b/core/src/main/java/com/dite/znpt/service/job/JobService.java index 5b7a9a8..2b33a61 100644 --- a/core/src/main/java/com/dite/znpt/service/job/JobService.java +++ b/core/src/main/java/com/dite/znpt/service/job/JobService.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.service.job; import com.baomidou.mybatisplus.extension.service.IService; @@ -13,3 +14,20 @@ public interface JobService extends IService { List calCrewStatus(List crewIds); } +======= +package com.dite.znpt.service.job; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.dite.znpt.domain.entity.job.JobInfo; +import com.dite.znpt.domain.vo.job.req.JobInfoReq; +import com.dite.znpt.domain.vo.job.resp.TurbineStatusResp; + +import java.util.List; + +public interface JobService extends IService { + + List page(JobInfoReq jobInfoReq); + + List calCrewStatus(List crewIds); +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/service/job/JobSummaryWorkService.java b/core/src/main/java/com/dite/znpt/service/job/JobSummaryWorkService.java index 151c9e0..0d4f543 100644 --- a/core/src/main/java/com/dite/znpt/service/job/JobSummaryWorkService.java +++ b/core/src/main/java/com/dite/znpt/service/job/JobSummaryWorkService.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.service.job; import com.baomidou.mybatisplus.extension.service.IService; @@ -39,3 +40,46 @@ public interface JobSummaryWorkService extends IService { List listByJobId(JobSummaryWorkReq dto); } +======= +package com.dite.znpt.service.job; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.dite.znpt.domain.entity.job.JobSummaryWork; +import com.dite.znpt.domain.vo.job.req.JobInfoReq; +import com.dite.znpt.domain.vo.job.req.JobSummaryWorkReq; + +import java.util.List; + +public interface JobSummaryWorkService extends IService { + + JobSummaryWork saveInfo(JobSummaryWork entity); + + /** + * 功能描述:列表查询 + * + * @param request 请求 + * @return {@link List }<{@link JobSummaryWork }> + * @author cuizhibin + * @date 2023/11/02 13:28 + **/ + List list(JobInfoReq request); + /** + * 功能描述:组长提交/项目经理审批 + * + * @param request 请求 + * @author cuizhibin + * @date 2023/11/06 10:32 + **/ + public void submit(JobInfoReq request); + /** + * 功能描述:组长驳回/项目经理驳回 + * + * @param request 请求 + * @author cuizhibin + * @date 2023/11/06 10:32 + **/ + public void reject(JobInfoReq request); + + List listByJobId(JobSummaryWorkReq dto); +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/service/job/impl/JobAntiThunderWorkServiceImpl.java b/core/src/main/java/com/dite/znpt/service/job/impl/JobAntiThunderWorkServiceImpl.java index ae436bf..baa7bcf 100644 --- a/core/src/main/java/com/dite/znpt/service/job/impl/JobAntiThunderWorkServiceImpl.java +++ b/core/src/main/java/com/dite/znpt/service/job/impl/JobAntiThunderWorkServiceImpl.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.service.job.impl; import cn.hutool.core.collection.ListUtil; @@ -171,3 +172,178 @@ public class JobAntiThunderWorkServiceImpl extends ServiceImpl implements JobAntiThunderWorkService { + @Autowired + private TurbineService turbineService; + @Autowired + private JobService jobService; + @Autowired + private ProjectService projectService; + + @Override + public JobAntiThunderWork saveInfo(JobAntiThunderWork entity) { + if (StrUtil.isNotBlank(entity.getId())) { + JobAntiThunderWork oldEntity = getById(entity.getId()); + if (!"0".equals(oldEntity.getStatus())) { + throw new ServiceException("内容已提交,不可修改"); + } + } + entity.preSave(); + saveOrUpdate(entity); + JobInfo jobInfo = jobService.getById(entity.getJobId()); + turbineService.updateStatus(jobInfo.getCrewId()); +// 施工人员提交后更新该工作类型状态及提交时间 + if (entity.getStatus().equals(Enums.EWorkStatus.SUBMITTED.getValue())) { + jobInfo.setStatus(Enums.EWorkStatus.SUBMITTED.getValue()); + jobInfo.setSubmitTime(new Date()); + jobService.updateById(jobInfo); + } + return entity; + } + + /** + * 功能描述:列表查询 + * + * @param request 请求 + * @return {@link List }<{@link JobAntiThunderWork }> + * @author cuizhibin + * @date 2023/11/02 13:28 + **/ + @Override + public List list(JobInfoReq request) { + List jobInfoList = jobService.list(QueryWrapperBuilder.build(request)); + if (!jobInfoList.isEmpty()) { + List statusList = ListUtil.of("1", "2", "3"); + if (!Enums.ERoleCode.Builder.getName().equals(UserContext.getRoleCode())) { + statusList = ListUtil.of("2", "3"); + } + List jobIds = jobInfoList.stream().map(JobInfo::getId).collect(Collectors.toList()); + Map jobId2Job = jobInfoList.stream().collect(Collectors.toMap(JobInfo::getId, i -> i)); + List list = lambdaQuery().in(JobAntiThunderWork::getJobId, jobIds).in(JobAntiThunderWork::getStatus, statusList).list(); + list.forEach(work -> { + JobInfo jobInfo = jobId2Job.get(work.getJobId()); + work.setConstructionPersonnel(jobInfo.getConstructionPersonnel()); + work.setJobCode(jobInfo.getJobCode()); + }); + return list; + } + return new ArrayList<>(); + } + + /** + * 功能描述:组长提交/项目经理审批 + * + * @param request 请求 + * @author cuizhibin + * @date 2023/11/06 10:32 + **/ + @Override + public void submit(JobInfoReq request) { + request.setWorkType(Enums.EWorkType.AntiThunderWork.getValue()); + List jobInfoList = jobService.list(QueryWrapperBuilder.build(request)); + if (jobInfoList.isEmpty()) { + throw new ServiceException("未找到数据"); + } +// 这里只会有一条数据 + JobInfo jobInfo = jobInfoList.get(0); + ProjectEntity project = projectService.getById(jobInfo.getProjectId()); + List workList = lambdaQuery().in(JobAntiThunderWork::getJobId, jobInfoList.stream().map(JobInfo::getId).collect(Collectors.toList())).list(); +// 如果是项目经理 + if (Enums.ERoleCode.ProjectManager.getName().equals(UserContext.getRoleCode())) { + if (StrUtil.isNotBlank(project.getAuditorId())) { + Optional any = workList.stream().filter(item -> !Objects.equals(item.getSafetyOfficerStatus(), Enums.EAuthStatus.APPROVAL.getVal())).findAny(); + if (any.isPresent()) { + throw new ServiceException("安全员未审核"); + } + } + if (StrUtil.isNotBlank(project.getQualityOfficerId())) { + Optional any = workList.stream().filter(item -> !Objects.equals(item.getQualityOfficerStatus(), Enums.EAuthStatus.APPROVAL.getVal())).findAny(); + if (any.isPresent()) { + throw new ServiceException("质量员未审核"); + } + } + workList.forEach(item -> item.setStatus(Enums.EWorkStatus.MANAGER_APPROVAL.getValue())); + jobInfo.setStatus(Enums.EWorkStatus.MANAGER_APPROVAL.getValue()); + } else if (Enums.ERoleCode.SafetyOfficer.getName().equals(UserContext.getRoleCode())) { + workList.forEach(item -> item.setSafetyOfficerStatus(Enums.EAuthStatus.APPROVAL.getVal())); + jobInfo.setSafetyOfficerStatus(Enums.EAuthStatus.APPROVAL.getVal()); + } else if (Enums.ERoleCode.QualityOfficer.getName().equals(UserContext.getRoleCode())) { + workList.forEach(item -> item.setQualityOfficerStatus(Enums.EAuthStatus.APPROVAL.getVal())); + jobInfo.setQualityOfficerStatus(Enums.EAuthStatus.APPROVAL.getVal()); + } else if (project.getConstructTeamLeaderId().equals(UserContext.getUserInfo().getUserId())) { + workList.forEach(item -> item.setStatus(Enums.EWorkStatus.LEADER_SUBMITTED.getValue())); + jobInfo.setStatus(Enums.EWorkStatus.LEADER_SUBMITTED.getValue()); + } + updateBatchById(workList); + turbineService.updateStatus(jobInfo.getCrewId()); + jobService.updateById(jobInfo); + } + + /** + * 功能描述:组长驳回/项目经理驳回 + * + * @param request 请求 + * @author cuizhibin + * @date 2023/11/06 10:32 + **/ + @Override + public void reject(JobInfoReq request) { + request.setWorkType(Enums.EWorkType.AntiThunderWork.getValue()); + List jobInfoList = jobService.list(QueryWrapperBuilder.build(request)); + if (jobInfoList.isEmpty()) { + throw new ServiceException("未找到数据"); + } +// 这里只会有一条数据 + JobInfo jobInfo = jobInfoList.get(0); + ProjectEntity project = projectService.getById(jobInfo.getProjectId()); + List workList = lambdaQuery().in(JobAntiThunderWork::getJobId, jobInfoList.stream().map(JobInfo::getId).collect(Collectors.toList())).list(); +// 如果是项目经理 + if (Enums.ERoleCode.ProjectManager.getName().equals(UserContext.getRoleCode())) { + workList.forEach(item -> item.setStatus(Enums.EWorkStatus.SUBMITTED.getValue())); + jobInfo.setStatus(Enums.EWorkStatus.SUBMITTED.getValue()); + } else if (Enums.ERoleCode.SafetyOfficer.getName().equals(UserContext.getRoleCode()) + || Enums.ERoleCode.QualityOfficer.getName().equals(UserContext.getRoleCode()) + || project.getConstructTeamLeaderId().equals(UserContext.getUserInfo().getUserId())) { + workList.forEach(item -> item.setStatus(Enums.EWorkStatus.DRAFT.getValue())); + jobInfo.setStatus(Enums.EWorkStatus.DRAFT.getValue()); + } + updateBatchById(workList); + turbineService.updateStatus(jobInfo.getCrewId()); + jobService.updateById(jobInfo); + } + + @Override + public List listByJobId(JobAntiThunderWorkReq dto) { + return lambdaQuery().eq(JobAntiThunderWork::getJobId, dto.getJobId()).list(); + } +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/service/job/impl/JobInWorkServiceImpl.java b/core/src/main/java/com/dite/znpt/service/job/impl/JobInWorkServiceImpl.java index de18bae..58555a9 100644 --- a/core/src/main/java/com/dite/znpt/service/job/impl/JobInWorkServiceImpl.java +++ b/core/src/main/java/com/dite/znpt/service/job/impl/JobInWorkServiceImpl.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.service.job.impl; import cn.hutool.core.collection.CollUtil; @@ -190,3 +191,197 @@ public class JobInWorkServiceImpl extends ServiceImpl implements JobInWorkService { + @Autowired + private TurbineService turbineService; + @Autowired + private JobService jobService; + @Autowired + private JobInWorkPartsService jobInWorkPartsService; + @Autowired + private ProjectService projectService; + + @Override + public JobInWork saveInfo(JobInWork entity) { + if (StrUtil.isNotBlank(entity.getId())) { + JobInWork oldEntity = this.getById(entity.getId()); + if (!"0".equals(oldEntity.getStatus())) { + throw new ServiceException("内容已提交,不可修改"); + } + } + saveOrUpdate(entity); + if (CollUtil.isNotEmpty(entity.getAscendingPartsList())) { + List idList = entity.getAscendingPartsList().stream().map(JobInWorkParts::getId).filter(StringUtils::isNotEmpty).distinct().collect(Collectors.toList()); + if (CollUtil.isEmpty(idList)) { + jobInWorkPartsService.lambdaUpdate().eq(JobInWorkParts::getJobId, entity.getJobId()).remove(); + } else { + jobInWorkPartsService.lambdaUpdate().eq(JobInWorkParts::getJobId, entity.getJobId()) + .ne(JobInWorkParts::getId, idList).remove(); + } + entity.getAscendingPartsList().forEach(item -> item.setJobId(entity.getJobId())); + jobInWorkPartsService.saveOrUpdateBatch(entity.getAscendingPartsList()); + } else { + jobInWorkPartsService.lambdaUpdate().eq(JobInWorkParts::getJobId, entity.getJobId()).remove(); + } + JobInfo jobInfo = jobService.getById(entity.getJobId()); + turbineService.updateStatus(jobInfo.getCrewId()); +// 施工人员提交后更新该工作类型状态及提交时间 + if (entity.getStatus().equals(Enums.EWorkStatus.SUBMITTED.getValue())) { + jobInfo.setStatus(Enums.EWorkStatus.SUBMITTED.getValue()); + jobInfo.setSubmitTime(new Date()); + jobService.updateById(jobInfo); + } + return entity; + } + + /** + * 功能描述:列表查询 + * + * @param request 请求 + * @return {@link List }<{@link JobInWork }> + * @author cuizhibin + * @date 2023/11/02 13:28 + **/ + public List list(JobInfoReq request) { + List jobList = jobService.list(QueryWrapperBuilder.build(request)); + if (!jobList.isEmpty()) { + List statusList = ListUtil.of("1", "2", "3"); + if (!Enums.ERoleCode.Builder.getName().equals(UserContext.getRoleCode())) { + statusList = ListUtil.of("2", "3"); + } + List jobIds = jobList.stream().map(JobInfo::getId).collect(Collectors.toList()); + Map jobId2Job = jobList.stream().collect(Collectors.toMap(JobInfo::getId, Function.identity())); + List list = lambdaQuery().in(JobInWork::getJobId, jobIds).in(JobInWork::getStatus, statusList).list(); + + list.forEach(work -> { + JobInfo job = jobId2Job.get(work.getJobId()); + work.setConstructionPersonnel(job.getConstructionPersonnel()); + work.setJobCode(job.getJobCode()); + + List workParts = jobInWorkPartsService.lambdaQuery().eq(JobInWorkParts::getJobId, work.getJobId()).list(); + work.setAscendingPartsList(workParts); + }); + return list; + } + return new ArrayList<>(); + } + + /** + * 功能描述:组长提交/项目经理审批 + * + * @param request 请求 + * @author cuizhibin + * @date 2023/11/06 10:32 + **/ + public void submit(JobInfoReq request) { + request.setWorkType(Enums.EWorkType.InWork.getValue()); + List jobList = jobService.list(QueryWrapperBuilder.build(request)); + if (jobList.isEmpty()) { + throw new ServiceException("未找到数据"); + } +// 这里只会有一条数据 + JobInfo jobInfo = jobList.get(0); + ProjectEntity project = projectService.getById(jobInfo.getProjectId()); + List workList = lambdaQuery().in(JobInWork::getJobId, jobList.stream().map(JobInfo::getId).collect(Collectors.toList())).list(); +// 如果是项目经理 + if (Enums.ERoleCode.ProjectManager.getName().equals(UserContext.getRoleCode())) { + if (StrUtil.isNotBlank(project.getAuditorId())) { + Optional any = workList.stream().filter(item -> !Objects.equals(item.getSafetyOfficerStatus(), Enums.EAuthStatus.APPROVAL.getVal())).findAny(); + if (any.isPresent()) { + throw new ServiceException("安全员未审核"); + } + } + if (StrUtil.isNotBlank(project.getQualityOfficerId())) { + Optional any = workList.stream().filter(item -> !Objects.equals(item.getQualityOfficerStatus(), Enums.EAuthStatus.APPROVAL.getVal())).findAny(); + if (any.isPresent()) { + throw new ServiceException("质量员未审核"); + } + } + workList.forEach(item -> item.setStatus(Enums.EWorkStatus.MANAGER_APPROVAL.getValue())); + jobInfo.setStatus(Enums.EWorkStatus.MANAGER_APPROVAL.getValue()); + } else if (Enums.ERoleCode.SafetyOfficer.getName().equals(UserContext.getRoleCode())) { + workList.forEach(item -> item.setSafetyOfficerStatus(Enums.EAuthStatus.APPROVAL.getVal())); + jobInfo.setSafetyOfficerStatus(Enums.EAuthStatus.APPROVAL.getVal()); + } else if (Enums.ERoleCode.QualityOfficer.getName().equals(UserContext.getRoleCode())) { + workList.forEach(item -> item.setQualityOfficerStatus(Enums.EAuthStatus.APPROVAL.getVal())); + jobInfo.setQualityOfficerStatus(Enums.EAuthStatus.APPROVAL.getVal()); + } else if (project.getConstructTeamLeaderId().equals(UserContext.getUserInfo().getUserId())) { + workList.forEach(item -> item.setStatus(Enums.EWorkStatus.LEADER_SUBMITTED.getValue())); + jobInfo.setStatus(Enums.EWorkStatus.LEADER_SUBMITTED.getValue()); + } + updateBatchById(workList); + turbineService.updateStatus(jobInfo.getCrewId()); + jobService.updateById(jobInfo); + } + + /** + * 功能描述:组长驳回/项目经理驳回 + * + * @param request 请求 + * @author cuizhibin + * @date 2023/11/06 10:32 + **/ + public void reject(JobInfoReq request) { + request.setWorkType(Enums.EWorkType.InWork.getValue()); + List jobInfoList = jobService.list(QueryWrapperBuilder.build(request)); + if (jobInfoList.isEmpty()) { + throw new ServiceException("未找到数据"); + } +// 这里只会有一条数据 + JobInfo jobInfo = jobInfoList.get(0); + ProjectEntity project = projectService.getById(jobInfo.getProjectId()); + List workList = lambdaQuery().in(JobInWork::getJobId, jobInfoList.stream().map(JobInfo::getId).collect(Collectors.toList())).list(); +// 如果是项目经理 + if (Enums.ERoleCode.ProjectManager.getName().equals(UserContext.getRoleCode())) { + workList.forEach(item -> item.setStatus(Enums.EWorkStatus.SUBMITTED.getValue())); + jobInfo.setStatus(Enums.EWorkStatus.SUBMITTED.getValue()); + } else if (Enums.ERoleCode.SafetyOfficer.getName().equals(UserContext.getRoleCode()) + || Enums.ERoleCode.QualityOfficer.getName().equals(UserContext.getRoleCode()) + || project.getConstructTeamLeaderId().equals(UserContext.getUserInfo().getUserId())) { + workList.forEach(item -> item.setStatus(Enums.EWorkStatus.DRAFT.getValue())); + jobInfo.setStatus(Enums.EWorkStatus.DRAFT.getValue()); + } + updateBatchById(workList); + turbineService.updateStatus(jobInfo.getCrewId()); + jobService.updateById(jobInfo); + } + + @Override + public List listByJobId(JobInWorkReq dto) { + return lambdaQuery().eq(JobInWork::getJobId, dto.getJobId()).list(); + } +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/service/job/impl/JobOutWorkServiceImpl.java b/core/src/main/java/com/dite/znpt/service/job/impl/JobOutWorkServiceImpl.java index 652a2e9..a9493a4 100644 --- a/core/src/main/java/com/dite/znpt/service/job/impl/JobOutWorkServiceImpl.java +++ b/core/src/main/java/com/dite/znpt/service/job/impl/JobOutWorkServiceImpl.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.service.job.impl; import java.util.ArrayList; @@ -292,3 +293,299 @@ public class JobOutWorkServiceImpl extends ServiceImpl implements JobOutWorkService { + @Autowired + private TurbineService turbineService; + @Autowired + private PartService partService; + @Autowired + private JobService jobService; + @Autowired + private ProjectService projectService; + @Autowired + private DefectService defectService; + + /** + * 旧版系统是直接使用在部件表中使用工作id关联,新版:外部工作:使用部件编码关联,若无则写入第一个部件,内部工作(暂时沿用gaea_job_in_work_parts表):使用叶片编码关联,若无,写入第一个叶片 + * + * @param entity + * @return + */ + @Override + public JobOutWork saveInfo(JobOutWork entity) { + if (StrUtil.isNotBlank(entity.getId())) { + JobOutWork oldEntity = this.getById(entity.getId()); + if (!"0".equals(oldEntity.getStatus())) { + throw new ServiceException("内容已提交,不可修改"); + } + } + saveOrUpdate(entity); + + JobInfo jobInfo = jobService.getById(entity.getJobId()); + turbineService.updateStatus(jobInfo.getCrewId()); +// 施工人员提交后更新该工作类型状态及提交时间 + if (entity.getStatus().equals(Enums.EWorkStatus.SUBMITTED.getValue())) { + jobInfo.setStatus(Enums.EWorkStatus.SUBMITTED.getValue()); + jobInfo.setSubmitTime(new Date()); + jobService.updateById(jobInfo); + } + return entity; + } + + /** + * 功能描述:保存缺陷 + * + * @param jobInfo + * @param defectDTOList 实体 + * @param outWorkId outWorkId + * @param workType 无人机飞行 + * @return + * @author cuizhibin + * @date 2025/04/30 16:37 + */ + private List generateDefectList(JobInfo jobInfo, List defectDTOList, String outWorkId, Enums.EOutWorkType workType) { + List list = new ArrayList<>(); + if (CollUtil.isNotEmpty(defectDTOList)) { + return list; + } + List partList = partService.lambdaQuery() + .eq(PartEntity::getTurbineId, jobInfo.getCrewId()) + .in(PartEntity::getPartCode, defectDTOList.stream().map(OutWorkDefectDTO::getCode).toList()) + .list(); + Map partMap = partList.stream().collect(Collectors.toMap(PartEntity::getPartCode, Function.identity())); + Map turbinePartMap = partList.stream().filter(part -> part.getPartType().equals(PartTypeEnum.VANE_1.getCode())) + .collect(Collectors.toMap(PartEntity::getTurbineId, Function.identity(), (v1, v2) -> v1)); + List newPartList = new ArrayList<>(); + for (OutWorkDefectDTO dto : defectDTOList) { + if (dto.getStatus() != 1) { + continue; + } + PartEntity partEntity = partMap.get(dto.getCode()); +// 若部件不存在,还需要创建部件或查询第一个部件,此处只有叶片的 + if (Objects.isNull(partEntity)) { +// 取第一个部件,若不存在则创建 + partEntity = turbinePartMap.get(jobInfo.getCrewId()); + if (Objects.isNull(partEntity)) { + partEntity = new PartEntity(); + partEntity.setTurbineId(jobInfo.getCrewId()); + partEntity.setPartId(IdUtil.simpleUUID()); + partEntity.setPartName("叶片"); + partEntity.setPartCode(dto.getCode()); + partEntity.setPartType(PartTypeEnum.VANE_1.getCode()); + partEntity.setPartDesc("外部工作自动生成"); + partMap.put(partEntity.getPartCode(), partEntity); + newPartList.add(partEntity); + turbinePartMap.put(jobInfo.getCrewId(), partEntity); + } + } + for (DefectDTO defectDTO : dto.getDefectList()) { + OutWorkDefectReq defectReq = new OutWorkDefectReq(); + defectReq.setDescription(defectDTO.getContent()); + defectReq.setDefectType(defectDTO.getDefectTypeCode()); + defectReq.setDefectLevel(defectDTO.getCriticalityLevelCode()); + if (StrUtil.isNotBlank(defectDTO.getDefectLocation1())) { +// 1叶根或2叶尖 + Dict dict = Dict.of("1", "叶根", "2", "叶尖"); + defectReq.setDefectPosition(StrUtil.format("距{} {}米", dict.getStr(defectDTO.getDefectLocation1()), defectDTO.getDefectLocation1Size())); + } else { +// 1前缘、2后缘、3 PS面、4 SS面 + Dict dict = Dict.of("1", "前缘", "2", "后缘", "3", "PS面", "4", "SS面"); + defectReq.setDefectPosition(dict.getStr(defectDTO.getDefectLocation2())); + + defectReq.setAxial(Integer.valueOf(defectDTO.getDefectSize())); + defectReq.setChordwise(Integer.valueOf(defectDTO.getDefectSize2())); + } + defectReq.setPartId(partEntity.getPartId()); + defectReq.setImagePath(defectDTO.getFlawUrlList().get(0)); + defectReq.setRepairStatus(RepairStatusEnum.UNKNOWN.getCode()); + defectReq.setSource(DefectSourceEnum.OUT_WORK.getCode()); + list.add(defectReq); + } + } + + if (CollUtil.isNotEmpty(newPartList)) { + partService.saveBatch(newPartList); + } + return list; + } + + @Override + public JobOutWork getByJobId(JobOutWorkReq dto) { + List list = lambdaQuery().eq(JobOutWork::getJobId, dto.getJobId()).list(); + if (CollUtil.isEmpty(list)) { + return new JobOutWork(); + } + return list.get(0); + } + + /** + * 功能描述:列表查询 + * + * @param request 请求 + * @return {@link List }<{@link JobOutWork }> + * @author cuizhibin + * @date 2023/11/02 13:28 + **/ + public List list(JobInfoReq request) { + List jobList = jobService.list(QueryWrapperBuilder.build(request)); + if (!jobList.isEmpty()) { + List statusList = ListUtil.of("1", "2", "3"); + if (!Enums.ERoleCode.Builder.getName().equals(UserContext.getRoleCode())) { + statusList = ListUtil.of("2", "3"); + } + List jobIds = jobList.stream().map(JobInfo::getId).collect(Collectors.toList()); + Map jobId2Job = jobList.stream().collect(Collectors.toMap(JobInfo::getId, i -> i)); + List workList = lambdaQuery().in(JobOutWork::getStatus, statusList).in(JobOutWork::getJobId, jobList.stream().map(JobInfo::getId).collect(Collectors.toList())).list(); + workList.forEach(work -> { + JobInfo job = jobId2Job.get(work.getJobId()); + work.setConstructionPersonnel(job.getConstructionPersonnel()); + work.setJobCode(job.getJobCode()); + }); + return workList; + } + return new ArrayList<>(); + } + + /** + * 功能描述:组长提交/项目经理审批 + * + * @param request 请求 + * @author cuizhibin + * @date 2023/11/06 10:32 + **/ + public void submit(JobInfoReq request) { + request.setWorkType(Enums.EWorkType.OutWork.getValue()); + List jobList = jobService.list(QueryWrapperBuilder.build(request)); + if (jobList.isEmpty()) { + throw new ServiceException("未找到数据"); + } +// 这里只会有一条数据 + JobInfo jobInfo = jobList.get(0); + ProjectEntity project = projectService.getById(jobInfo.getProjectId()); + List workList = lambdaQuery().in(JobOutWork::getJobId, jobList.stream().map(JobInfo::getId).collect(Collectors.toList())).list(); +// 如果是项目经理 + if (Enums.ERoleCode.ProjectManager.getName().equals(UserContext.getRoleCode())) { + if (StrUtil.isNotBlank(project.getAuditorId())) { + Optional any = workList.stream().filter(item -> !Objects.equals(item.getSafetyOfficerStatus(), Enums.EAuthStatus.APPROVAL.getVal())).findAny(); + if (any.isPresent()) { + throw new ServiceException("安全员未审核"); + } + } + if (StrUtil.isNotBlank(project.getQualityOfficerId())) { + Optional any = workList.stream().filter(item -> !Objects.equals(item.getQualityOfficerStatus(), Enums.EAuthStatus.APPROVAL.getVal())).findAny(); + if (any.isPresent()) { + throw new ServiceException("质量员未审核"); + } + } + workList.forEach(item -> item.setStatus(Enums.EWorkStatus.MANAGER_APPROVAL.getValue())); + jobInfo.setStatus(Enums.EWorkStatus.MANAGER_APPROVAL.getValue()); + +// 项目经理审批后入缺陷库 + List defectReqList = new ArrayList<>(); + for (JobOutWork work : workList) { +// 飞手部件列表 + if (CollUtil.isNotEmpty(work.getDroneFlyerPartsList())) { + defectReqList.addAll(generateDefectList(jobInfo, work.getDroneFlyerPartsList(), work.getId(), Enums.EOutWorkType.DRONE_FLYER)); + } +// 飞助部件列表 + if (CollUtil.isNotEmpty(work.getFlyAidPartsList())) { + defectReqList.addAll(generateDefectList(jobInfo, work.getFlyAidPartsList(), work.getId(), Enums.EOutWorkType.FLYAID)); + } +// 登高部件列表 + if (CollUtil.isNotEmpty(work.getAscendingPartsList())) { + defectReqList.addAll(generateDefectList(jobInfo, work.getAscendingPartsList(), work.getId(), Enums.EOutWorkType.ASCEND_HEIGHT)); + } + } + if (CollUtil.isNotEmpty(defectReqList)) { + defectService.saveOutWorkDefect(defectReqList); + } + } else if (Enums.ERoleCode.SafetyOfficer.getName().equals(UserContext.getRoleCode())) { + workList.forEach(item -> item.setSafetyOfficerStatus(Enums.EAuthStatus.APPROVAL.getVal())); + jobInfo.setSafetyOfficerStatus(Enums.EAuthStatus.APPROVAL.getVal()); + } else if (Enums.ERoleCode.QualityOfficer.getName().equals(UserContext.getRoleCode())) { + workList.forEach(item -> item.setQualityOfficerStatus(Enums.EAuthStatus.APPROVAL.getVal())); + jobInfo.setQualityOfficerStatus(Enums.EAuthStatus.APPROVAL.getVal()); + } else if (project.getConstructTeamLeaderId().equals(UserContext.getUserInfo().getUserId())) { + workList.forEach(item -> item.setStatus(Enums.EWorkStatus.LEADER_SUBMITTED.getValue())); + jobInfo.setStatus(Enums.EWorkStatus.LEADER_SUBMITTED.getValue()); + } + saveOrUpdateBatch(workList); + turbineService.updateStatus(jobInfo.getCrewId()); + jobService.save(jobInfo); + } + + /** + * 功能描述:组长驳回/项目经理驳回 + * + * @param request 请求 + * @author cuizhibin + * @date 2023/11/06 10:32 + **/ + public void reject(JobInfoReq request) { + request.setWorkType(Enums.EWorkType.OutWork.getValue()); + List jobList = jobService.list(QueryWrapperBuilder.build(request)); + if (jobList.isEmpty()) { + throw new ServiceException("未找到数据"); + } +// 这里只会有一条数据 + JobInfo jobInfo = jobList.get(0); + ProjectEntity project = projectService.getById(jobInfo.getProjectId()); + List workList = lambdaQuery().in(JobOutWork::getJobId, jobList.stream().map(JobInfo::getId).collect(Collectors.toList())).list(); +// 如果是项目经理 + if (Enums.ERoleCode.ProjectManager.getName().equals(UserContext.getRoleCode())) { + workList.forEach(item -> item.setStatus(Enums.EWorkStatus.SUBMITTED.getValue())); + jobInfo.setStatus(Enums.EWorkStatus.SUBMITTED.getValue()); + } else if (Enums.ERoleCode.SafetyOfficer.getName().equals(UserContext.getRoleCode()) + || Enums.ERoleCode.QualityOfficer.getName().equals(UserContext.getRoleCode()) + || project.getConstructTeamLeaderId().equals(UserContext.getUserInfo().getUserId())) { + workList.forEach(item -> item.setStatus(Enums.EWorkStatus.DRAFT.getValue())); + jobInfo.setStatus(Enums.EWorkStatus.DRAFT.getValue()); + } + saveOrUpdateBatch(workList); + turbineService.updateStatus(jobInfo.getCrewId()); + jobService.save(jobInfo); + } + +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/service/job/impl/JobServiceImpl.java b/core/src/main/java/com/dite/znpt/service/job/impl/JobServiceImpl.java index fdb19c9..4088608 100644 --- a/core/src/main/java/com/dite/znpt/service/job/impl/JobServiceImpl.java +++ b/core/src/main/java/com/dite/znpt/service/job/impl/JobServiceImpl.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.service.job.impl; import cn.hutool.core.util.StrUtil; @@ -29,3 +30,36 @@ public class JobServiceImpl extends ServiceImpl implemen return baseMapper.calCrewStatus(crewIds); } } +======= +package com.dite.znpt.service.job.impl; + +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.dite.znpt.domain.entity.job.JobInfo; +import com.dite.znpt.domain.vo.job.req.JobInfoReq; +import com.dite.znpt.domain.vo.job.resp.TurbineStatusResp; +import com.dite.znpt.mapper.JobInfoMapper; +import com.dite.znpt.service.job.JobService; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; + +@Service +@Transactional(rollbackFor = Exception.class) +public class JobServiceImpl extends ServiceImpl implements JobService { + @Override + public List page(JobInfoReq req) { + return lambdaQuery() + .eq(StrUtil.isNotEmpty(req.getJobCode()), JobInfo::getJobCode, req.getJobCode()) + .eq(StrUtil.isNotEmpty(req.getProjectId()), JobInfo::getProjectId, req.getProjectId()) + .eq(StrUtil.isNotEmpty(req.getCrewId()), JobInfo::getCrewId, req.getCrewId()) + .eq(StrUtil.isNotEmpty(req.getConstructionPersonnelId()), JobInfo::getConstructionPersonnelId, req.getConstructionPersonnelId()) + .list(); + } + + public List calCrewStatus(List crewIds) { + return baseMapper.calCrewStatus(crewIds); + } +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/service/job/impl/JobSummaryWorkServiceImpl.java b/core/src/main/java/com/dite/znpt/service/job/impl/JobSummaryWorkServiceImpl.java index 2ba436e..e705dc1 100644 --- a/core/src/main/java/com/dite/znpt/service/job/impl/JobSummaryWorkServiceImpl.java +++ b/core/src/main/java/com/dite/znpt/service/job/impl/JobSummaryWorkServiceImpl.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.service.job.impl; import cn.hutool.core.collection.ListUtil; @@ -147,3 +148,154 @@ public class JobSummaryWorkServiceImpl extends ServiceImpl implements JobSummaryWorkService { + @Autowired + private TurbineService turbineService; + @Autowired + private JobService jobService; + @Autowired + private ProjectService projectService; + + @Override + public JobSummaryWork saveInfo(JobSummaryWork entity) { + if (StrUtil.isNotBlank(entity.getId())) { + JobSummaryWork oldEntity = this.getById(entity.getId()); + if (!"0".equals(oldEntity.getStatus())) { + throw new ServiceException("内容已提交,不可修改"); + } + } + saveOrUpdate(entity); + JobInfo jobInfo = jobService.getById(entity.getJobId()); + turbineService.updateStatus(jobInfo.getCrewId()); +// 施工人员提交后更新该工作类型状态及提交时间 + if (entity.getStatus().equals(Enums.EWorkStatus.SUBMITTED.getValue())) { + jobInfo.setStatus(Enums.EWorkStatus.SUBMITTED.getValue()); + jobInfo.setSubmitTime(new Date()); + jobService.updateById(jobInfo); + } + return entity; + } + + /** + * 功能描述:列表查询 + * + * @param request 请求 + * @return {@link List }<{@link JobSummaryWork }> + * @author cuizhibin + * @date 2023/11/02 13:28 + **/ + public List list(JobInfoReq request) { + List jobList = jobService.list(QueryWrapperBuilder.build(request)); + if (!jobList.isEmpty()) { + List statusList = ListUtil.of("1", "2", "3"); + if (!Enums.ERoleCode.Builder.getName().equals(UserContext.getRoleCode())) { + statusList = ListUtil.of("2", "3"); + } + List jobIds = jobList.stream().map(JobInfo::getId).collect(Collectors.toList()); + Map jobId2Job = jobList.stream().collect(Collectors.toMap(JobInfo::getId, i -> i)); + List workList = lambdaQuery().in(JobSummaryWork::getStatus, statusList).in(JobSummaryWork::getJobId, jobIds).list(); + workList.forEach(work -> { + JobInfo job = jobId2Job.get(work.getJobId()); + work.setConstructionPersonnel(job.getConstructionPersonnel()); + work.setJobCode(job.getJobCode()); + }); + return workList; + } + return new ArrayList<>(); + } + + /** + * 功能描述:组长提交/项目经理审批 + * + * @param request 请求 + * @author cuizhibin + * @date 2023/11/06 10:32 + **/ + public void submit(JobInfoReq request) { + request.setWorkType(Enums.EWorkType.SummaryWork.getValue()); + List jobList = jobService.list(QueryWrapperBuilder.build(request)); + if (jobList.isEmpty()) { + throw new ServiceException("未找到数据"); + } +// 这里只会有一条数据 + JobInfo jobInfo = jobList.get(0); + ProjectEntity project = projectService.getById(jobInfo.getProjectId()); + List workList = lambdaQuery().in(JobSummaryWork::getJobId, jobList.stream().map(JobInfo::getId).collect(Collectors.toList())).list(); +// 如果是项目经理 + if (Enums.ERoleCode.ProjectManager.getName().equals(UserContext.getRoleCode())) { + workList.forEach(item -> item.setStatus(Enums.EWorkStatus.MANAGER_APPROVAL.getValue())); + jobInfo.setStatus(Enums.EWorkStatus.MANAGER_APPROVAL.getValue()); + } else if (project.getConstructTeamLeaderId().equals(UserContext.getUserInfo().getUserId())) { + workList.forEach(item -> item.setStatus(Enums.EWorkStatus.LEADER_SUBMITTED.getValue())); + jobInfo.setStatus(Enums.EWorkStatus.LEADER_SUBMITTED.getValue()); + } + saveOrUpdateBatch(workList); + turbineService.updateStatus(jobInfo.getCrewId()); + jobService.save(jobInfo); + } + + /** + * 功能描述:组长驳回/项目经理驳回 + * + * @param request 请求 + * @author cuizhibin + * @date 2023/11/06 10:32 + **/ + public void reject(JobInfoReq request) { + request.setWorkType(Enums.EWorkType.SummaryWork.getValue()); + List jobList = jobService.list(QueryWrapperBuilder.build(request)); + if (jobList.isEmpty()) { + throw new ServiceException("未找到数据"); + } +// 这里只会有一条数据 + JobInfo jobInfo = jobList.get(0); + ProjectEntity project = projectService.getById(jobInfo.getProjectId()); + List workList = lambdaQuery().in(JobSummaryWork::getJobId, jobList.stream().map(JobInfo::getId).collect(Collectors.toList())).list(); +// 如果是项目经理 + if (Enums.ERoleCode.ProjectManager.getName().equals(UserContext.getRoleCode())) { + workList.forEach(item -> item.setStatus(Enums.EWorkStatus.SUBMITTED.getValue())); + jobInfo.setStatus(Enums.EWorkStatus.SUBMITTED.getValue()); + } else if (project.getConstructTeamLeaderId().equals(UserContext.getUserInfo().getUserId())) { + workList.forEach(item -> item.setStatus(Enums.EWorkStatus.DRAFT.getValue())); + jobInfo.setStatus(Enums.EWorkStatus.DRAFT.getValue()); + } + saveOrUpdateBatch(workList); + turbineService.updateStatus(jobInfo.getCrewId()); + jobService.save(jobInfo); + } + + @Override + public List listByJobId(JobSummaryWorkReq dto) { + return lambdaQuery().eq(JobSummaryWork::getJobId, dto.getJobId()).list(); + } +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/util/EXIFUtil.java b/core/src/main/java/com/dite/znpt/util/EXIFUtil.java index cefab10..66ba3a0 100644 --- a/core/src/main/java/com/dite/znpt/util/EXIFUtil.java +++ b/core/src/main/java/com/dite/znpt/util/EXIFUtil.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.util; import cn.hutool.json.JSONObject; @@ -66,3 +67,73 @@ public class EXIFUtil { return duStr.toString(); } } +======= +package com.dite.znpt.util; + +import cn.hutool.json.JSONObject; +import com.drew.imaging.ImageMetadataReader; +import com.drew.metadata.Directory; +import com.drew.metadata.Metadata; +import com.drew.metadata.Tag; + +import java.io.File; + +/** + * @author Bear.G + * @date 2025/4/24/周四 14:10 + * @description + */ +public class EXIFUtil { + + public static void main(String[] args) throws Exception { + File file = new File("C:\\Users\\Administrator\\Desktop\\水杯.jpg"); + printImageTags(file); + } + /** + * 读取照片里面的信息 + */ + public static JSONObject printImageTags(File file) throws Exception { + Metadata metadata = ImageMetadataReader.readMetadata(file); + JSONObject jsonObject = new JSONObject(); + String lat = ""; + String log = ""; + for (Directory directory : metadata.getDirectories()) { + for (Tag tag : directory.getTags()) { + // 标签名 + String tagName = tag.getTagName(); + // 标签信息 + String desc = tag.getDescription(); + System.out.println(tagName + "=" + desc); + switch (tagName) { + // 经度 + case "GPS Longitude": + lat = pointToLatlong(desc); + jsonObject.put(tagName, lat); + break; + // 纬度 + case "GPS Latitude": + log = pointToLatlong(desc); + jsonObject.put(tagName, log); + break; + default: + jsonObject.put(tagName, desc); + break; + } + } + } + return jsonObject; + } + + /*** + * 经纬度坐标格式转换(* °转十进制格式) + * @param point + */ + public static String pointToLatlong(String point) { + Double du = Double.parseDouble(point.substring(0, point.indexOf("°")).trim()); + Double fen = Double.parseDouble(point.substring(point.indexOf("°") + 1, point.indexOf("'")).trim()); + Double miao = Double.parseDouble(point.substring(point.indexOf("'") + 1, point.indexOf("\"")).trim()); + Double duStr = du + fen / 60 + miao / 60 / 60; + return duStr.toString(); + } +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/util/ModelUtil.java b/core/src/main/java/com/dite/znpt/util/ModelUtil.java index caec663..9066dfa 100644 --- a/core/src/main/java/com/dite/znpt/util/ModelUtil.java +++ b/core/src/main/java/com/dite/znpt/util/ModelUtil.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.util; import java.util.ArrayList; @@ -72,3 +73,79 @@ public class ModelUtil { } } +======= +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 nonMaxSuppression(List bboxes, float iouThreshold) { + + List 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); + + } + +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/java/com/dite/znpt/util/ValidationGroup.java b/core/src/main/java/com/dite/znpt/util/ValidationGroup.java index ea4d3b5..d632692 100644 --- a/core/src/main/java/com/dite/znpt/util/ValidationGroup.java +++ b/core/src/main/java/com/dite/znpt/util/ValidationGroup.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.util; /** @@ -11,3 +12,18 @@ public interface ValidationGroup { interface Update {} // 改 interface Request {} // 其他类型 } +======= +package com.dite.znpt.util; + +/** + * @author Bear.G + * @date 2025/5/19/周一 15:09 + * @description + */ + +public interface ValidationGroup { + interface Insert {} // 增 + interface Update {} // 改 + interface Request {} // 其他类型 +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/resources/mapper/AudioFileInfoMapper.xml b/core/src/main/resources/mapper/AudioFileInfoMapper.xml index 6542146..757f67e 100644 --- a/core/src/main/resources/mapper/AudioFileInfoMapper.xml +++ b/core/src/main/resources/mapper/AudioFileInfoMapper.xml @@ -1,3 +1,4 @@ +<<<<<<< HEAD @@ -28,3 +29,35 @@ +======= + + + + + + a.audio_id, a.image_id, a.file_path, a.update_by, + a.create_time, a.create_by, a.update_time + + + + + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/resources/mapper/BiddingInfoMapper.xml b/core/src/main/resources/mapper/BiddingInfoMapper.xml new file mode 100644 index 0000000..fc9e1a6 --- /dev/null +++ b/core/src/main/resources/mapper/BiddingInfoMapper.xml @@ -0,0 +1,15 @@ + + + + + + \ No newline at end of file diff --git a/core/src/main/resources/mapper/CertificationMapper.xml b/core/src/main/resources/mapper/CertificationMapper.xml index bf41920..9b40bc4 100644 --- a/core/src/main/resources/mapper/CertificationMapper.xml +++ b/core/src/main/resources/mapper/CertificationMapper.xml @@ -1,3 +1,4 @@ +<<<<<<< HEAD @@ -18,4 +19,26 @@ +======= + + + + + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f \ No newline at end of file diff --git a/core/src/main/resources/mapper/ContractMapper.xml b/core/src/main/resources/mapper/ContractMapper.xml index dfd83ad..3c4402d 100644 --- a/core/src/main/resources/mapper/ContractMapper.xml +++ b/core/src/main/resources/mapper/ContractMapper.xml @@ -1,3 +1,4 @@ +<<<<<<< HEAD @@ -72,3 +73,79 @@ +======= + + + + + + a.contract_id, a.customer, a.code, a.project_id, + a.salesperson_id, a.department_id, a.sign_date, a.duration, + a.type, a.product_service, a.payment_date, a.payment_address, + a.amount, a.account_number, a.notes, a.contract_status, + a.create_time, a.create_by, a.update_time, a.update_by + + + + + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/resources/mapper/ContractSettlementMapper.xml b/core/src/main/resources/mapper/ContractSettlementMapper.xml index f05f488..6b0377a 100644 --- a/core/src/main/resources/mapper/ContractSettlementMapper.xml +++ b/core/src/main/resources/mapper/ContractSettlementMapper.xml @@ -1,3 +1,4 @@ +<<<<<<< HEAD @@ -67,3 +68,74 @@ +======= + + + + + + a.settlement_id, a.contract_id, a.customer, a.code, + a.project_id, a.salesperson_id, a.department_id, a.payment_period, + a.payment_date, a.duration, a.product_service, a.amount, + a.account_number, a.notes, a.settlement_status, a.create_time, + a.create_by, a.update_time, a.update_by + + + + + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/resources/mapper/DeptMapper.xml b/core/src/main/resources/mapper/DeptMapper.xml index 0cfd625..74b4266 100644 --- a/core/src/main/resources/mapper/DeptMapper.xml +++ b/core/src/main/resources/mapper/DeptMapper.xml @@ -1,3 +1,4 @@ +<<<<<<< HEAD @@ -36,4 +37,44 @@ +======= + + + + + + + + + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f \ No newline at end of file diff --git a/core/src/main/resources/mapper/DictMapper.xml b/core/src/main/resources/mapper/DictMapper.xml index 5c42977..2590d79 100644 --- a/core/src/main/resources/mapper/DictMapper.xml +++ b/core/src/main/resources/mapper/DictMapper.xml @@ -1,3 +1,4 @@ +<<<<<<< HEAD @@ -35,3 +36,42 @@ +======= + + + + + + a.dict_id, a.dict_type, a.dict_name, a.parent_id, + a.sort_order, a.final_state, a.create_time, a.create_by, + a.update_time, a.update_by + + + + + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/resources/mapper/EquipmentMapper.xml b/core/src/main/resources/mapper/EquipmentMapper.xml index 37e7bbf..7060bd0 100644 --- a/core/src/main/resources/mapper/EquipmentMapper.xml +++ b/core/src/main/resources/mapper/EquipmentMapper.xml @@ -1,3 +1,4 @@ +<<<<<<< HEAD @@ -28,4 +29,36 @@ LEFT JOIN user u ON u.user_id = equr.user_id WHERE eq.equipment_id = #{equipmentId} AND eq.del_flag = '0' +======= + + + + + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f \ No newline at end of file diff --git a/core/src/main/resources/mapper/EquipmentUseRecordMapper.xml b/core/src/main/resources/mapper/EquipmentUseRecordMapper.xml index 9b0652b..d7e5c79 100644 --- a/core/src/main/resources/mapper/EquipmentUseRecordMapper.xml +++ b/core/src/main/resources/mapper/EquipmentUseRecordMapper.xml @@ -1,3 +1,4 @@ +<<<<<<< HEAD @@ -31,4 +32,39 @@ WHERE equr.equipment_id = #{equipmentId} ORDER BY equr.batch_id DESC, equr.operate_time ASC +======= + + + + + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f \ No newline at end of file diff --git a/core/src/main/resources/mapper/ImageMapper.xml b/core/src/main/resources/mapper/ImageMapper.xml index 2233431..bb4baee 100644 --- a/core/src/main/resources/mapper/ImageMapper.xml +++ b/core/src/main/resources/mapper/ImageMapper.xml @@ -1,3 +1,4 @@ +<<<<<<< HEAD @@ -80,4 +81,91 @@ LEFT JOIN image_collect ic ON i.collect_id = ic.collect_id WHERE i.image_id = #{imageId} +======= + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f \ No newline at end of file diff --git a/core/src/main/resources/mapper/InspectionReportMapper.xml b/core/src/main/resources/mapper/InspectionReportMapper.xml index a335c61..7350789 100644 --- a/core/src/main/resources/mapper/InspectionReportMapper.xml +++ b/core/src/main/resources/mapper/InspectionReportMapper.xml @@ -1,3 +1,4 @@ +<<<<<<< HEAD @@ -34,4 +35,42 @@ +======= + + + + + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f \ No newline at end of file diff --git a/core/src/main/resources/mapper/JobInfoMapper.xml b/core/src/main/resources/mapper/JobInfoMapper.xml index bd254c2..79c55dd 100644 --- a/core/src/main/resources/mapper/JobInfoMapper.xml +++ b/core/src/main/resources/mapper/JobInfoMapper.xml @@ -1,3 +1,4 @@ +<<<<<<< HEAD @@ -97,3 +98,104 @@ +======= + + + + + + a.id, a.construction_personnel, a.construction_personnel_id, a.crew_id, + a.job_code, a.project_id, a.work_type, a.quality_officer_status, + a.safety_officer_status, a.status, a.submit_time, a.create_time, + a.create_by, a.update_time, a.update_by + + + + + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/resources/mapper/MenuMapper.xml b/core/src/main/resources/mapper/MenuMapper.xml index 2085e41..bab5890 100644 --- a/core/src/main/resources/mapper/MenuMapper.xml +++ b/core/src/main/resources/mapper/MenuMapper.xml @@ -1,3 +1,4 @@ +<<<<<<< HEAD @@ -36,4 +37,44 @@ SELECT d.* FROM menu d INNER JOIN SubMenus sd ON d.parent_id = sd.menu_id ) SELECT * FROM SubMenus; +======= + + + + + + + + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f \ No newline at end of file diff --git a/core/src/main/resources/mapper/ModelConfigMapper.xml b/core/src/main/resources/mapper/ModelConfigMapper.xml index aac6032..67c8afa 100644 --- a/core/src/main/resources/mapper/ModelConfigMapper.xml +++ b/core/src/main/resources/mapper/ModelConfigMapper.xml @@ -1,3 +1,4 @@ +<<<<<<< HEAD @@ -32,3 +33,39 @@ +======= + + + + + + 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 + + + + + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/resources/mapper/OutbidInfoMapper.xml b/core/src/main/resources/mapper/OutbidInfoMapper.xml new file mode 100644 index 0000000..d58a51d --- /dev/null +++ b/core/src/main/resources/mapper/OutbidInfoMapper.xml @@ -0,0 +1,24 @@ + + + + + + + \ No newline at end of file diff --git a/core/src/main/resources/mapper/PartMapper.xml b/core/src/main/resources/mapper/PartMapper.xml index 6625bc4..614b93a 100644 --- a/core/src/main/resources/mapper/PartMapper.xml +++ b/core/src/main/resources/mapper/PartMapper.xml @@ -1,3 +1,4 @@ +<<<<<<< HEAD @@ -32,3 +33,39 @@ +======= + + + + + + + + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/resources/mapper/PostMapper.xml b/core/src/main/resources/mapper/PostMapper.xml index 1230755..4b9cb7c 100644 --- a/core/src/main/resources/mapper/PostMapper.xml +++ b/core/src/main/resources/mapper/PostMapper.xml @@ -1,5 +1,12 @@ +<<<<<<< HEAD +======= + + + + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f \ No newline at end of file diff --git a/core/src/main/resources/mapper/ProjectBudgetInfoMapper.xml b/core/src/main/resources/mapper/ProjectBudgetInfoMapper.xml index ebb1f6b..83366e7 100644 --- a/core/src/main/resources/mapper/ProjectBudgetInfoMapper.xml +++ b/core/src/main/resources/mapper/ProjectBudgetInfoMapper.xml @@ -1,3 +1,4 @@ +<<<<<<< HEAD @@ -47,3 +48,54 @@ +======= + + + + + + a.budget_id, a.project_id, a.budget_name, a.budget_type, + a.budget_amount, a.budget_desc, a.update_by, a.create_time, + a.create_by, a.update_time + + + + + + + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/resources/mapper/ProjectDailyReportMapper.xml b/core/src/main/resources/mapper/ProjectDailyReportMapper.xml new file mode 100644 index 0000000..3102523 --- /dev/null +++ b/core/src/main/resources/mapper/ProjectDailyReportMapper.xml @@ -0,0 +1,30 @@ + + + + + + a.report_id, a.project_id, a.report_date, a.submit_user, + a.update_by, a.create_time, a.create_by, a.update_time + + + + + diff --git a/core/src/main/resources/mapper/ProjectMapper.xml b/core/src/main/resources/mapper/ProjectMapper.xml index 25aabf1..6e8b6b2 100644 --- a/core/src/main/resources/mapper/ProjectMapper.xml +++ b/core/src/main/resources/mapper/ProjectMapper.xml @@ -2,6 +2,7 @@ diff --git a/core/src/main/resources/mapper/ProjectTaskGroupMapper.xml b/core/src/main/resources/mapper/ProjectTaskGroupMapper.xml index c18ba46..b3c0c4b 100644 --- a/core/src/main/resources/mapper/ProjectTaskGroupMapper.xml +++ b/core/src/main/resources/mapper/ProjectTaskGroupMapper.xml @@ -1,3 +1,4 @@ +<<<<<<< HEAD @@ -26,3 +27,33 @@ +======= + + + + + + a.group_id, a.group_name, a.update_by, a.create_time, + a.create_by, a.update_time + + + + + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/resources/mapper/ProjectTaskMapper.xml b/core/src/main/resources/mapper/ProjectTaskMapper.xml index 1a79c17..0fe42c7 100644 --- a/core/src/main/resources/mapper/ProjectTaskMapper.xml +++ b/core/src/main/resources/mapper/ProjectTaskMapper.xml @@ -1,3 +1,4 @@ +<<<<<<< HEAD @@ -82,3 +83,89 @@ +======= + + + + + + a.task_id, a.task_group_id, a.task_name, a.task_code, + a.main_user_id, a.user_ids, a.plan_start_date, a.plan_end_date, + a.actual_start_date, a.actual_end_date, a.status, a.overdue_status, + a.update_by, a.create_time, a.create_by, a.update_time + + + + + + + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/resources/mapper/RoleMapper.xml b/core/src/main/resources/mapper/RoleMapper.xml index 01a753e..4c5cb03 100644 --- a/core/src/main/resources/mapper/RoleMapper.xml +++ b/core/src/main/resources/mapper/RoleMapper.xml @@ -1,5 +1,12 @@ +<<<<<<< HEAD +======= + + + + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f \ No newline at end of file diff --git a/core/src/main/resources/mapper/RoleMenuMapper.xml b/core/src/main/resources/mapper/RoleMenuMapper.xml index de52249..f05c4d5 100644 --- a/core/src/main/resources/mapper/RoleMenuMapper.xml +++ b/core/src/main/resources/mapper/RoleMenuMapper.xml @@ -1,5 +1,12 @@ +<<<<<<< HEAD +======= + + + + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f \ No newline at end of file diff --git a/core/src/main/resources/mapper/TenderInfoMapper.xml b/core/src/main/resources/mapper/TenderInfoMapper.xml new file mode 100644 index 0000000..98b8a89 --- /dev/null +++ b/core/src/main/resources/mapper/TenderInfoMapper.xml @@ -0,0 +1,28 @@ + + + + + + + \ No newline at end of file diff --git a/core/src/main/resources/mapper/UserMapper.xml b/core/src/main/resources/mapper/UserMapper.xml index d61f50d..7bdaaae 100644 --- a/core/src/main/resources/mapper/UserMapper.xml +++ b/core/src/main/resources/mapper/UserMapper.xml @@ -16,7 +16,11 @@ LEFT JOIN role r ON ur.role_id = r.role_id LEFT JOIN user_post up ON up.user_id = u.user_id LEFT JOIN post p ON p.post_id = up.post_id +<<<<<<< HEAD +======= + WHERE u.del_flag = '0' +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f AND u.user_code LIKE concat ('%', #{userCode}, '%') @@ -38,7 +42,10 @@ AND u.user_Type = #{userType} +<<<<<<< HEAD +======= +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f GROUP BY u.user_id, u.account, u.status, u.name, u.user_code, u.user_type, u.user_status, d.dept_name, u.mobile, u.create_time diff --git a/core/src/main/resources/mapper/UserPostMapper.xml b/core/src/main/resources/mapper/UserPostMapper.xml index 71fd551..71d6add 100644 --- a/core/src/main/resources/mapper/UserPostMapper.xml +++ b/core/src/main/resources/mapper/UserPostMapper.xml @@ -1,5 +1,12 @@ +<<<<<<< HEAD +======= + + + + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f \ No newline at end of file diff --git a/core/src/main/resources/mapper/UserRoleMapper.xml b/core/src/main/resources/mapper/UserRoleMapper.xml index 6cec1d3..bec853b 100644 --- a/core/src/main/resources/mapper/UserRoleMapper.xml +++ b/core/src/main/resources/mapper/UserRoleMapper.xml @@ -1,5 +1,12 @@ +<<<<<<< HEAD +======= + + + + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f \ No newline at end of file diff --git a/core/src/main/resources/mapper/VideoFileInfoMapper.xml b/core/src/main/resources/mapper/VideoFileInfoMapper.xml index a87b0ed..2547ee6 100644 --- a/core/src/main/resources/mapper/VideoFileInfoMapper.xml +++ b/core/src/main/resources/mapper/VideoFileInfoMapper.xml @@ -1,3 +1,4 @@ +<<<<<<< HEAD @@ -42,3 +43,49 @@ +======= + + + + + + a.id, a.part_id, a.test_point, a.worker_user_id, + a.shooting_time, a.location, a.qualified, a.frame_capture, + a.file_path, a.update_by, a.create_time, a.create_by, + a.update_time + + + + + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/core/src/main/resources/mapper/WorkShiftMapper.xml b/core/src/main/resources/mapper/WorkShiftMapper.xml index 57ed61a..1e33e4c 100644 --- a/core/src/main/resources/mapper/WorkShiftMapper.xml +++ b/core/src/main/resources/mapper/WorkShiftMapper.xml @@ -1,5 +1,12 @@ +<<<<<<< HEAD +======= + + + + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f \ No newline at end of file diff --git a/doc/aesDemo.html b/doc/aesDemo.html new file mode 100644 index 0000000..6f84f51 --- /dev/null +++ b/doc/aesDemo.html @@ -0,0 +1,459 @@ + + + + + + AES加密解密工具 + + + + + + + +
+ +
+

+ AES加密解密工具 +

+

+ 使用先进的AES加密算法保护您的数据安全,支持多种加密模式和密钥长度 +

+
+ + +
+ +
+

+ 加密 +

+
+
+ + +
+ +
+ +
+ + +
+
+ +
+ +
+
+ + +
+
+ + +
+
+
+ + + + +
+
+ + +
+

+ 解密 +

+
+
+ + +
+ +
+ + +
+ +
+ +
+
+ + +
+
+ + +
+
+
+ + + + +
+
+
+ + +
+

+ 结果 +

+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+
+ + +
+ + 操作成功 +
+
+ + + + + \ No newline at end of file diff --git a/pom.xml b/pom.xml index 87d23f2..68d2e42 100644 --- a/pom.xml +++ b/pom.xml @@ -1,3 +1,4 @@ +<<<<<<< HEAD @@ -52,3 +53,59 @@ +======= + + + 4.0.0 + + com.dite.znpt + parent + 1.0.0-SNAPSHOT + + + 17 + + + core + sip + web + flowable + + pom + + + + + + org.springframework.boot + spring-boot-starter-parent + 2.7.18 + pom + import + + + + cn.hutool + hutool-all + 5.8.24 + + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 17 + 17 + + + + + + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/sa-token-demo/pom.xml b/sa-token-demo/pom.xml new file mode 100644 index 0000000..a54c2e0 --- /dev/null +++ b/sa-token-demo/pom.xml @@ -0,0 +1,103 @@ + + + 4.0.0 + + + org.springframework.boot + spring-boot-starter-parent + 2.7.18 + + + com.example + sa-token-demo + 1.0.0 + jar + + + 17 + 1.37.0 + + + + + + org.springframework.boot + spring-boot-starter-web + + + + + cn.dev33 + sa-token-spring-boot-starter + ${sa-token.version} + + + + + cn.dev33 + sa-token-redis-jackson + ${sa-token.version} + + + + + org.springframework.boot + spring-boot-starter-data-redis + + + + + com.baomidou + mybatis-plus-boot-starter + 3.5.3.1 + + + + + mysql + mysql-connector-java + 8.0.33 + + + + + org.projectlombok + lombok + true + + + + + cn.hutool + hutool-all + 5.8.24 + + + + + io.springfox + springfox-boot-starter + 3.0.0 + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + org.projectlombok + lombok + + + + + + + \ No newline at end of file diff --git a/sa-token-demo/src/main/java/com/example/SaTokenDemoApplication.java b/sa-token-demo/src/main/java/com/example/SaTokenDemoApplication.java new file mode 100644 index 0000000..db7b848 --- /dev/null +++ b/sa-token-demo/src/main/java/com/example/SaTokenDemoApplication.java @@ -0,0 +1,17 @@ +package com.example; + +import org.mybatis.spring.annotation.MapperScan; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * Sa-Token Demo 启动类 + */ +@SpringBootApplication +@MapperScan("com.example.mapper") +public class SaTokenDemoApplication { + + public static void main(String[] args) { + SpringApplication.run(SaTokenDemoApplication.class, args); + } +} \ No newline at end of file diff --git a/sa-token-demo/src/main/java/com/example/config/SaTokenConfig.java b/sa-token-demo/src/main/java/com/example/config/SaTokenConfig.java new file mode 100644 index 0000000..df491bb --- /dev/null +++ b/sa-token-demo/src/main/java/com/example/config/SaTokenConfig.java @@ -0,0 +1,49 @@ +package com.example.config; + +import cn.dev33.satoken.interceptor.SaInterceptor; +import cn.dev33.satoken.router.SaRouter; +import cn.dev33.satoken.stp.StpUtil; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.servlet.config.annotation.InterceptorRegistry; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; + +import java.util.Arrays; +import java.util.List; + +/** + * Sa-Token配置类 + */ +@Configuration +public class SaTokenConfig implements WebMvcConfigurer { + + /** + * 注册Sa-Token拦截器,打开注解式鉴权功能 + */ + @Override + public void addInterceptors(InterceptorRegistry registry) { + // 注册Sa-Token拦截器,定义详细认证规则 + registry.addInterceptor(new SaInterceptor(handler -> { + // 指定哪些接口需要登录认证 + SaRouter.match("/**") + .notMatch(getExcludePaths()) + .check(r -> StpUtil.checkLogin()); + })).addPathPatterns("/**"); + } + + /** + * 获取不需要登录认证的路径 + */ + private List getExcludePaths() { + return Arrays.asList( + "/auth/login", // 登录接口 + "/auth/logout", // 登出接口 + "/doc.html", // Swagger文档 + "/swagger-ui/**", // Swagger UI + "/swagger-resources/**", // Swagger资源 + "/v3/api-docs/**", // OpenAPI文档 + "/webjars/**", // WebJars + "/error", // 错误页面 + "/favicon.ico" // 网站图标 + ); + } +} \ No newline at end of file diff --git a/sa-token-demo/src/main/java/com/example/config/StpInterfaceImpl.java b/sa-token-demo/src/main/java/com/example/config/StpInterfaceImpl.java new file mode 100644 index 0000000..5f9b31e --- /dev/null +++ b/sa-token-demo/src/main/java/com/example/config/StpInterfaceImpl.java @@ -0,0 +1,34 @@ +package com.example.config; + +import cn.dev33.satoken.stp.StpInterface; +import com.example.service.UserService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * 自定义权限验证接口扩展 + */ +@Component +public class StpInterfaceImpl implements StpInterface { + + @Autowired + private UserService userService; + + /** + * 返回指定账号id所拥有的权限码集合 + */ + @Override + public List getPermissionList(Object loginId, String loginType) { + return userService.getPermissionList(Long.valueOf(loginId.toString())); + } + + /** + * 返回指定账号id所拥有的角色标识集合 + */ + @Override + public List getRoleList(Object loginId, String loginType) { + return userService.getRoleList(Long.valueOf(loginId.toString())); + } +} \ No newline at end of file diff --git a/sa-token-demo/src/main/java/com/example/controller/AuthController.java b/sa-token-demo/src/main/java/com/example/controller/AuthController.java new file mode 100644 index 0000000..1b4dcc1 --- /dev/null +++ b/sa-token-demo/src/main/java/com/example/controller/AuthController.java @@ -0,0 +1,81 @@ +package com.example.controller; + +import cn.dev33.satoken.annotation.SaCheckLogin; +import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.dev33.satoken.annotation.SaCheckRole; +import cn.dev33.satoken.stp.StpUtil; +import com.example.service.UserService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.HashMap; +import java.util.Map; + +/** + * 认证控制器 + */ +@Api(tags = "认证管理") +@RestController +@RequestMapping("/auth") +public class AuthController { + + @Autowired + private UserService userService; + + @ApiOperation("用户登录") + @PostMapping("/login") + public Map login(@RequestParam String username, @RequestParam String password) { + String token = userService.login(username, password); + Map result = new HashMap<>(); + result.put("code", 200); + result.put("message", "登录成功"); + result.put("token", token); + return result; + } + + @ApiOperation("用户登出") + @SaCheckLogin + @PostMapping("/logout") + public Map logout() { + userService.logout(); + Map result = new HashMap<>(); + result.put("code", 200); + result.put("message", "登出成功"); + return result; + } + + @ApiOperation("获取当前用户信息") + @SaCheckLogin + @GetMapping("/info") + public Map getUserInfo() { + Long userId = StpUtil.getLoginIdAsLong(); + Map result = new HashMap<>(); + result.put("code", 200); + result.put("userId", userId); + result.put("roles", StpUtil.getRoleList()); + result.put("permissions", StpUtil.getPermissionList()); + return result; + } + + @ApiOperation("测试权限 - 需要ADMIN角色") + @SaCheckRole("ADMIN") + @GetMapping("/test/admin") + public Map testAdmin() { + Map result = new HashMap<>(); + result.put("code", 200); + result.put("message", "您有ADMIN角色权限"); + return result; + } + + @ApiOperation("测试权限 - 需要user:add权限") + @SaCheckPermission("user:add") + @GetMapping("/test/permission") + public Map testPermission() { + Map result = new HashMap<>(); + result.put("code", 200); + result.put("message", "您有user:add权限"); + return result; + } +} \ No newline at end of file diff --git a/sa-token-demo/src/main/java/com/example/mapper/UserMapper.java b/sa-token-demo/src/main/java/com/example/mapper/UserMapper.java new file mode 100644 index 0000000..1883a7d --- /dev/null +++ b/sa-token-demo/src/main/java/com/example/mapper/UserMapper.java @@ -0,0 +1,37 @@ +package com.example.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.example.entity.SysUser; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; + +import java.util.List; + +/** + * 用户Mapper接口 + */ +@Mapper +public interface UserMapper extends BaseMapper { + + /** + * 获取用户权限列表 + */ + @Select("SELECT DISTINCT p.permission_code " + + "FROM sys_user u " + + "LEFT JOIN sys_user_role ur ON u.id = ur.user_id " + + "LEFT JOIN sys_role_permission rp ON ur.role_id = rp.role_id " + + "LEFT JOIN sys_permission p ON rp.permission_id = p.id " + + "WHERE u.id = #{userId} AND u.status = 1 AND p.status = 1") + List getPermissionList(@Param("userId") Long userId); + + /** + * 获取用户角色列表 + */ + @Select("SELECT DISTINCT r.role_code " + + "FROM sys_user u " + + "LEFT JOIN sys_user_role ur ON u.id = ur.user_id " + + "LEFT JOIN sys_role r ON ur.role_id = r.id " + + "WHERE u.id = #{userId} AND u.status = 1 AND r.status = 1") + List getRoleList(@Param("userId") Long userId); +} \ No newline at end of file diff --git a/sa-token-demo/src/main/resources/application.yml b/sa-token-demo/src/main/resources/application.yml new file mode 100644 index 0000000..9a06268 --- /dev/null +++ b/sa-token-demo/src/main/resources/application.yml @@ -0,0 +1,61 @@ +server: + port: 8080 + +spring: + application: + name: sa-token-demo + + # 数据库配置 + datasource: + driver-class-name: com.mysql.cj.jdbc.Driver + url: jdbc:mysql://localhost:3306/sa_token_demo?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8 + username: root + password: 123456 + + # Redis配置 + redis: + host: localhost + port: 6379 + password: + database: 0 + timeout: 3000ms + lettuce: + pool: + max-active: 8 + max-wait: -1ms + max-idle: 8 + min-idle: 0 + +# MyBatis Plus配置 +mybatis-plus: + configuration: + map-underscore-to-camel-case: true + log-impl: org.apache.ibatis.logging.stdout.StdOutImpl + global-config: + db-config: + logic-delete-field: deleted + logic-delete-value: 1 + logic-not-delete-value: 0 + +# Sa-Token配置 +sa-token: + # token名称 (同时也是cookie名称) + token-name: Authorization + # token有效期,单位s 默认30天, -1代表永不过期 + timeout: 2592000 + # token临时有效期 (指定时间内无操作就视为token过期) 单位: 秒 + active-timeout: -1 + # 是否允许同一账号并发登录 (为true时允许一起登录, 为false时新登录挤掉旧登录) + is-concurrent: true + # 在多人登录同一账号时,是否共用一个token (为true时所有登录共用一个token, 为false时每次登录新建一个token) + is-share: false + # token风格 + token-style: uuid + # 是否输出操作日志 + is-log: true + # 是否从cookie中读取token + is-read-cookie: false + # 是否从header中读取token + is-read-header: true + # 是否从body中读取token + is-read-body: false \ No newline at end of file diff --git a/sa-token-demo/src/main/resources/sql/init.sql b/sa-token-demo/src/main/resources/sql/init.sql new file mode 100644 index 0000000..cbfa97a --- /dev/null +++ b/sa-token-demo/src/main/resources/sql/init.sql @@ -0,0 +1,104 @@ +-- 创建数据库 +CREATE DATABASE IF NOT EXISTS sa_token_demo DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; + +USE sa_token_demo; + +-- 用户表 +CREATE TABLE `sys_user` ( + `id` bigint NOT NULL AUTO_INCREMENT COMMENT '用户ID', + `username` varchar(50) NOT NULL COMMENT '用户名', + `password` varchar(100) NOT NULL COMMENT '密码', + `nickname` varchar(50) DEFAULT NULL COMMENT '昵称', + `email` varchar(100) DEFAULT NULL COMMENT '邮箱', + `phone` varchar(20) DEFAULT NULL COMMENT '手机号', + `status` tinyint DEFAULT '1' COMMENT '状态:0-禁用,1-启用', + `deleted` tinyint DEFAULT '0' COMMENT '是否删除:0-否,1-是', + `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', + PRIMARY KEY (`id`), + UNIQUE KEY `uk_username` (`username`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户表'; + +-- 角色表 +CREATE TABLE `sys_role` ( + `id` bigint NOT NULL AUTO_INCREMENT COMMENT '角色ID', + `role_name` varchar(50) NOT NULL COMMENT '角色名称', + `role_code` varchar(50) NOT NULL COMMENT '角色编码', + `description` varchar(200) DEFAULT NULL COMMENT '角色描述', + `status` tinyint DEFAULT '1' COMMENT '状态:0-禁用,1-启用', + `deleted` tinyint DEFAULT '0' COMMENT '是否删除:0-否,1-是', + `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', + PRIMARY KEY (`id`), + UNIQUE KEY `uk_role_code` (`role_code`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='角色表'; + +-- 权限表 +CREATE TABLE `sys_permission` ( + `id` bigint NOT NULL AUTO_INCREMENT COMMENT '权限ID', + `permission_name` varchar(50) NOT NULL COMMENT '权限名称', + `permission_code` varchar(50) NOT NULL COMMENT '权限编码', + `permission_type` tinyint DEFAULT '1' COMMENT '权限类型:1-菜单,2-按钮', + `parent_id` bigint DEFAULT '0' COMMENT '父权限ID', + `path` varchar(200) DEFAULT NULL COMMENT '路径', + `component` varchar(200) DEFAULT NULL COMMENT '组件', + `icon` varchar(100) DEFAULT NULL COMMENT '图标', + `sort` int DEFAULT '0' COMMENT '排序', + `status` tinyint DEFAULT '1' COMMENT '状态:0-禁用,1-启用', + `deleted` tinyint DEFAULT '0' COMMENT '是否删除:0-否,1-是', + `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', + PRIMARY KEY (`id`), + UNIQUE KEY `uk_permission_code` (`permission_code`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='权限表'; + +-- 用户角色关联表 +CREATE TABLE `sys_user_role` ( + `id` bigint NOT NULL AUTO_INCREMENT COMMENT 'ID', + `user_id` bigint NOT NULL COMMENT '用户ID', + `role_id` bigint NOT NULL COMMENT '角色ID', + `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + PRIMARY KEY (`id`), + UNIQUE KEY `uk_user_role` (`user_id`,`role_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户角色关联表'; + +-- 角色权限关联表 +CREATE TABLE `sys_role_permission` ( + `id` bigint NOT NULL AUTO_INCREMENT COMMENT 'ID', + `role_id` bigint NOT NULL COMMENT '角色ID', + `permission_id` bigint NOT NULL COMMENT '权限ID', + `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + PRIMARY KEY (`id`), + UNIQUE KEY `uk_role_permission` (`role_id`,`permission_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='角色权限关联表'; + +-- 插入测试数据 +INSERT INTO `sys_user` (`username`, `password`, `nickname`, `email`) VALUES +('admin', '$2a$10$7JB720yubVSOfvVWdBYoOeymFJgxVqQqHqKjqKjqKjqKjqKjqKjqK', '管理员', 'admin@example.com'), +('user', '$2a$10$7JB720yubVSOfvVWdBYoOeymFJgxVqQqHqKjqKjqKjqKjqKjqKjqK', '普通用户', 'user@example.com'); + +INSERT INTO `sys_role` (`role_name`, `role_code`, `description`) VALUES +('超级管理员', 'SUPER_ADMIN', '系统超级管理员'), +('管理员', 'ADMIN', '系统管理员'), +('普通用户', 'USER', '普通用户'); + +INSERT INTO `sys_permission` (`permission_name`, `permission_code`, `permission_type`, `parent_id`, `path`, `component`, `icon`, `sort`) VALUES +('用户管理', 'user:view', 1, 0, '/user', 'User', 'user', 1), +('用户列表', 'user:list', 2, 1, NULL, NULL, NULL, 1), +('用户新增', 'user:add', 2, 1, NULL, NULL, NULL, 2), +('用户编辑', 'user:edit', 2, 1, NULL, NULL, NULL, 3), +('用户删除', 'user:delete', 2, 1, NULL, NULL, NULL, 4), +('角色管理', 'role:view', 1, 0, '/role', 'Role', 'team', 2), +('角色列表', 'role:list', 2, 6, NULL, NULL, NULL, 1), +('角色新增', 'role:add', 2, 6, NULL, NULL, NULL, 2), +('角色编辑', 'role:edit', 2, 6, NULL, NULL, NULL, 3), +('角色删除', 'role:delete', 2, 6, NULL, NULL, NULL, 4); + +INSERT INTO `sys_user_role` (`user_id`, `role_id`) VALUES +(1, 1), +(2, 3); + +INSERT INTO `sys_role_permission` (`role_id`, `permission_id`) VALUES +(1, 1), (1, 2), (1, 3), (1, 4), (1, 5), (1, 6), (1, 7), (1, 8), (1, 9), (1, 10), +(2, 1), (2, 2), (2, 3), (2, 4), (2, 5), (2, 6), (2, 7), (2, 8), (2, 9), (2, 10), +(3, 1), (3, 2); \ No newline at end of file diff --git a/sip/pom.xml b/sip/pom.xml new file mode 100644 index 0000000..7e62790 --- /dev/null +++ b/sip/pom.xml @@ -0,0 +1,52 @@ + + + 4.0.0 + + + com.dite.znpt + parent + 1.0.0-SNAPSHOT + + sip + 1.0.0-SNAPSHOT + + + 17 + 17 + UTF-8 + + + + com.dite.znpt + core + 1.0.0-SNAPSHOT + + + + org.projectlombok + lombok + + + + + javax.sip + jain-sip-ri + 1.3.0-91 + + + + + org.dom4j + dom4j + 2.1.3 + + + org.slf4j + log4j-over-slf4j + 1.7.36 + + + + \ No newline at end of file diff --git a/sip/src/main/java/com/dite/znpt/monitor/config/MediaFormatConfig.java b/sip/src/main/java/com/dite/znpt/monitor/config/MediaFormatConfig.java new file mode 100644 index 0000000..2c0dd0c --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/config/MediaFormatConfig.java @@ -0,0 +1,30 @@ +package com.dite.znpt.monitor.config; + +import cn.hutool.core.collection.CollUtil; +import com.dite.znpt.monitor.domain.vo.video.StreamMediaFormat; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +import java.util.List; + +/** + * 媒体格式配置 + * + * @author huise23 + * @since 2023-07-31 09:08:05 + */ +@Configuration +public class MediaFormatConfig { + + @Bean + public static List streamMediaFormatList() { + List formatList = CollUtil.newArrayList(); + formatList.add(new StreamMediaFormat("flv",null,"1")); + formatList.add(new StreamMediaFormat("mp4",null,"0")); + formatList.add(new StreamMediaFormat("hls",null,"0")); + formatList.add(new StreamMediaFormat("webrtc",null,"1")); + return formatList; + } + + +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/constant/Constants.java b/sip/src/main/java/com/dite/znpt/monitor/constant/Constants.java new file mode 100644 index 0000000..d1ee938 --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/constant/Constants.java @@ -0,0 +1,37 @@ +package com.dite.znpt.monitor.constant; + +/** + * @author yunp + * @since 2022/7/14 + */ +public class Constants { + /** + * UTF-8 字符集 + */ + public static final String UTF8 = "UTF-8"; + + /** + * GBK 字符集 + */ + public static final String GBK = "GBK"; + + /** + * 路径拼接符 / + */ + public static final String File_SEPARATOR = "/"; + + /** + * http请求 + */ + public static final String HTTP = "http://"; + + /** + * https请求 + */ + public static final String HTTPS = "https://"; + + /** + * 默认字符串分隔符 + */ + public static final String DEFAULT_DELIMITER = ","; +} \ No newline at end of file diff --git a/sip/src/main/java/com/dite/znpt/monitor/constant/IotCacheConstants.java b/sip/src/main/java/com/dite/znpt/monitor/constant/IotCacheConstants.java new file mode 100644 index 0000000..743494a --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/constant/IotCacheConstants.java @@ -0,0 +1,37 @@ +package com.dite.znpt.monitor.constant; + +/** + * @author yunp + * @since 2022/8/4 + * @description 缓存key定义:key全部以iot开头 + */ +public class IotCacheConstants { + + /** + * 参数管理 cache key + */ + public static final String SYS_CONFIG_KEY = "sys_config:"; + + /** + * 字典管理 cache key + */ + public static final String SYS_DICT_KEY = "sys_dict:"; + + /** + * 图标库 cache key + */ + public static final String SYS_ICON_KEY = "sys_icon"; + + private static final String IOT_DEVICE_VIDEO_PREFIX = "vs_device_video:"; + + public static String getIotDeviceVideoKey(String deviceCode){ + return IOT_DEVICE_VIDEO_PREFIX + deviceCode; + } + + private final static String CLIENT_TRANSACTION_CACHE_PREFIX = "IOT_CLIENT_TRANSACTION_CACHE:"; + + public static String getClientTransactionCacheKey(String ssrc){ + return CLIENT_TRANSACTION_CACHE_PREFIX + ssrc; + } + +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/constant/IotDictConstants.java b/sip/src/main/java/com/dite/znpt/monitor/constant/IotDictConstants.java new file mode 100644 index 0000000..4e3d10d --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/constant/IotDictConstants.java @@ -0,0 +1,20 @@ +package com.dite.znpt.monitor.constant; + +/** + * @author yunp + * @since 2022/8/4 + * @description 字典类型定义 + */ +public class IotDictConstants { + + /** + * 设备状态-在线 + */ + public static final String IOT_DEVICE_STATUS_ONLINE = "2"; + + /** + * 设备状态-离线 + */ + public static final String IOT_DEVICE_STATUS_OFFLINE = "3"; + +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/constant/IotRespMessage.java b/sip/src/main/java/com/dite/znpt/monitor/constant/IotRespMessage.java new file mode 100644 index 0000000..7cdf9eb --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/constant/IotRespMessage.java @@ -0,0 +1,113 @@ +package com.dite.znpt.monitor.constant; + +/** + * @author yunp + * @since 2022/8/4 + * @description 响应文案定义 + */ +public class IotRespMessage { + + public static final String UNKNOWN_FAIL = "未知错误"; + + public static final String ID_NOT_FOUND = "数据不存在"; + + public static final String PARAMETER_ERROR = "参数有误"; + + public static final String NO_PERMISSION = "没有访问权限"; + + public static final String PARENT_AREA_NOT_FOUND = "上级分区不存在"; + + public static final String CAR_TYPE_HAS_CARS = "该车型下仍有车辆,无法删除"; + + public static final String CAR_BRAND_HAS_CARS = "该品牌下仍有车辆,无法删除"; + + public static final String CAR_PLATE_NUMBER_EXIST = "该车牌号车辆已存在"; + + public static final String CAR_PLATE_NUMBER_NOT_EXIST = "该车牌号车辆不存在"; + + public static final String CAR_HAS_BIND_TAG_OR_SPEED_MONITOR = "车辆已绑定车载标签或速度检测仪,禁止删除"; + + public static final String CAR_FREIGHT_NOT_EXIST = "货物不存在"; + + public static final String CAR_HAS_BIND_ALARM_TEMPLATE = "该车辆已绑定其他告警模板"; + + public static final String USER_HAS_BIND_ALARM_TEMPLATE = "该人员已绑定其他告警模板"; + + public static final String REPETITION_ALARM_FOR_AREA = "该厂区分区下已有同类型告警,无法重复添加"; + + public static final String REPETITION_ALARM_NOTIFY_CONFIG = "已存在相同部门层级的告警消息推送配置"; + + public static final String DEVICE_TERMINAL_HAS_BEEN_BIND = "该标签卡已被其他人绑定"; + + public static final String DEVICE_TERMINAL_TYPE_ERROR = "标签卡类型有误"; + + public static final String DEVICE_TERMINAL_NOT_FOUND_OR_STATUS_ERROR = "标签卡未找到或状态异常"; + + public static final String DEVICE_CANNOT_EDIT = "设备未启用或已停用才可编辑"; + + public static final String VIDEO_DEVICE_CANNOT_DELETE = "视频设备禁止删除"; + + public static final String DEVICE_CANNOT_DELETE = "未启用的设备才可删除"; + + public static final String DEVICE_HAS_BIND_TO_GROUP = "设备已经绑定至该分组"; + + public static final String DEVICE_VIDEO_CANNOT_DELETE = "禁止删除在线视频设备"; + + public static final String DEVICE_VIDEO_CANNOT_SYNC = "禁止更新离线视频设备"; + + public static final String DEVICE_INACTIVE = "设备未启用"; + + public static final String CODE_HAS_BEEN_USED = "编号已被占用"; + + public static final String NAME_HAS_BEEN_USED = "名称已被占用"; + + public static final String FLAG_HAS_BEEN_USED = "标识已被占用"; + + public static final String GROUP_HAS_CHILD_CANNOT_REMOVE = "分组有下级分组,无法删除"; + + public static final String GROUP_HAS_DEVICE_CANNOT_REMOVE = "分组下有绑定设备,无法删除"; + + public static final String PRODUCT_PUBLISH_CANNOT_DELETE = "该产品已发布,不可删除"; + + public static final String PRODUCT_HAS_DEVICE_CANNOT_REMOVE = "产品下存在设备关联,需删除设备后进行操作"; + + public static final String MSG_PROTOCOL_PUBLISH_CANNOT_DELETE = "消息协议未发布,发布协议后操作"; + + public static final String CATEGORY_CANNOT_DELETE = "该产品分类信息已被产品关联,不可删除"; + + public static final String SCENE_CANNOT_DELETE = "该场景信息已被产品关联,不可删除"; + + public static final String SWITCH_PARAM_HAS_BEEN_USED = "该参数在设备服务中只能定义一个"; + + public static final String CONFIG_CANNOT_DELETE = "该配置已被通知模板关联,不可删除, 请取消关联后重试。"; + + public static final String TEMPLATE_CANNOT_DELETE = "该通知模板已被场景联动关联,不可删除, 请取消关联后操作。"; + + public static final String PROTOCOL_CANNOT_DELETE_BY_PUBLISHED = "当前协议状态为已发布,不可删除."; + + public static final String PROTOCOL_CANNOT_DELETE_WITH_PRODUCT = "该协议已被产品关联,不可删除,请删除关联后操作!"; + + public static final String PROTOCOL_CANNOT_UN_PUBLISH = "协议已被产品发布,不可取消!"; + + public static final String PROTOCOL_TYPE_CANNOT_NULL = "协议类型不能为空"; + + public static final String PROTOCOL_CLASS_NAME_CANNOT_EMPTY = "协议类型为Jar或者Local类型时,必须指定协议类名."; + + public static final String PROTOCOL_FILE_PATH_CANNOT_EMPTY = "协议类型为Jar或者Local类型时,必须上传或者指定协议文件路径."; + + public static final String DATA_ILLEGAL = "数据非法"; + + public static final String IMPORT_ERROR = "导入出错"; + + public static final String COMMON_DEVICE_ATTR_DUPLICATE_ERROR = "订阅的通用设备点位全局不唯一"; + + public static final String PROTOCOL_NOT_EXISTS = "协议不存在"; + + public static final String RULE_NOT_EXISTS = "上报规则不存在"; + + public static final String DEVICE_NOT_EXISTS = "设备不存在"; + + public static final String DATA_DATA_TREND_TIME_TYPE_NOT_EXISTS = "设备数据趋势时间类型不存在"; + public static final String DATA_DATA_TREND_DATA_TYPE_NOT_EXISTS = "设备数据趋势数据类型不存在"; + public static final String CRON_ERROR = "cron表达式输入错误:"; +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/constant/dict/CameraType.java b/sip/src/main/java/com/dite/znpt/monitor/constant/dict/CameraType.java new file mode 100644 index 0000000..a05e191 --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/constant/dict/CameraType.java @@ -0,0 +1,32 @@ +package com.dite.znpt.monitor.constant.dict; + +/** + * 摄像头类型 + * + * @author huise23 + * @since 2023-07-28 15:30:10 + */ +public enum CameraType implements ValueAndLabel { + + UNKNOWN("0","未知"), + BALLHEAD("1","球机"); + + private final String value; + private final String label; + + CameraType(String value, String label) { + this.value = value; + this.label = label; + } + + @Override + public String getValue() { + return value; + } + + @Override + public String getLabel() { + return label; + } + +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/constant/dict/DeviceStatus.java b/sip/src/main/java/com/dite/znpt/monitor/constant/dict/DeviceStatus.java new file mode 100644 index 0000000..2101f2b --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/constant/dict/DeviceStatus.java @@ -0,0 +1,34 @@ +package com.dite.znpt.monitor.constant.dict; + +/** + * 设备状态 + * + * @author huise23 + * @since 2023-07-28 15:30:10 + */ +public enum DeviceStatus implements ValueAndLabel { + + INACTIV("1", "未启用"), + ONLINE("2", "在线"), + OFFLINE("3", "离线"), + STOP("4", "停用"); + + private final String value; + private final String label; + + DeviceStatus(String value, String label) { + this.value = value; + this.label = label; + } + + @Override + public String getValue() { + return value; + } + + @Override + public String getLabel() { + return label; + } + +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/constant/dict/SipTransferMode.java b/sip/src/main/java/com/dite/znpt/monitor/constant/dict/SipTransferMode.java new file mode 100644 index 0000000..e621c06 --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/constant/dict/SipTransferMode.java @@ -0,0 +1,26 @@ +package com.dite.znpt.monitor.constant.dict; + +public enum SipTransferMode implements ValueAndLabel { + + UDP("UDP","UDP"), + TCP("TCP","TCP"); + + private final String value; + private final String label; + + SipTransferMode(String value, String label) { + this.value = value; + this.label = label; + } + + @Override + public String getValue() { + return value; + } + + @Override + public String getLabel() { + return label; + } + +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/constant/dict/StreamTransferMode.java b/sip/src/main/java/com/dite/znpt/monitor/constant/dict/StreamTransferMode.java new file mode 100644 index 0000000..fea526a --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/constant/dict/StreamTransferMode.java @@ -0,0 +1,27 @@ +package com.dite.znpt.monitor.constant.dict; + +public enum StreamTransferMode implements ValueAndLabel { + + UDP("UDP","UDP"), + TCP_ACTIVE("TCP-ACTIVE","TCP主动"), + TCP_PASSIVE("TCP-PASSIVE", "TCP被动"); + + private final String value; + private final String label; + + StreamTransferMode(String value, String label) { + this.value = value; + this.label = label; + } + + @Override + public String getValue() { + return value; + } + + @Override + public String getLabel() { + return label; + } + +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/constant/dict/ValueAndLabel.java b/sip/src/main/java/com/dite/znpt/monitor/constant/dict/ValueAndLabel.java new file mode 100644 index 0000000..88b5b1b --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/constant/dict/ValueAndLabel.java @@ -0,0 +1,14 @@ +package com.dite.znpt.monitor.constant.dict; + + +/** + * 字典常量接口 + * + * @author huise23 + * @since 2023-07-28 15:28:55 + */ +public interface ValueAndLabel { + String getValue(); + String getLabel(); + +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/constant/dict/YesOrNo.java b/sip/src/main/java/com/dite/znpt/monitor/constant/dict/YesOrNo.java new file mode 100644 index 0000000..62889fd --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/constant/dict/YesOrNo.java @@ -0,0 +1,32 @@ +package com.dite.znpt.monitor.constant.dict; + +/** + * YesOrNo + * + * @author huise23 + * @since 2023-07-28 15:30:10 + */ +public enum YesOrNo implements ValueAndLabel { + + YES("Y","是"), + NO("N", "否"); + + private final String value; + private final String label; + + YesOrNo(String value, String label) { + this.value = value; + this.label = label; + } + + @Override + public String getValue() { + return value; + } + + @Override + public String getLabel() { + return label; + } + +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/domain/CustomFunction.java b/sip/src/main/java/com/dite/znpt/monitor/domain/CustomFunction.java new file mode 100644 index 0000000..bf145cc --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/domain/CustomFunction.java @@ -0,0 +1,14 @@ +package com.dite.znpt.monitor.domain; + +/** + * @Author: cuizhibin + * @Date: 2023/1/16 14:36:36 + * @Description: + */ +public interface CustomFunction { + /** + * 执行的方法 + * @return + */ + T get(); +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/domain/entity/DeviceVideoChannelEntity.java b/sip/src/main/java/com/dite/znpt/monitor/domain/entity/DeviceVideoChannelEntity.java new file mode 100644 index 0000000..4b263aa --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/domain/entity/DeviceVideoChannelEntity.java @@ -0,0 +1,124 @@ +package com.dite.znpt.monitor.domain.entity; + +import com.baomidou.mybatisplus.annotation.*; +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: huise23 + * @Date: 2022/8/11 17:29 + * @Description: + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("vs_device_video_channel") +@ApiModel(value="DeviceVideoChannelEntity", description="视频通道表") +public class DeviceVideoChannelEntity implements Serializable { + + private static final long serialVersionUID = -4175177624487756818L; + + @ApiModelProperty(value = "主键id") + @TableId(value = "channel_id", type = IdType.AUTO) + private Long channelId; + + @ApiModelProperty(value = "视频设备id") + private Long videoId; + + @ApiModelProperty(value = "通道国标编号") + private String channelCode; + + @ApiModelProperty(value = "通道名") + private String channelName; + + @ApiModelProperty(value = "生产厂商") + private String manufacture; + + @ApiModelProperty(value = "型号") + private String model; + + @ApiModelProperty(value = "设备归属") + private String owner; + + @ApiModelProperty(value = "行政区域") + private String civilCode; + + @ApiModelProperty(value = "警区") + private String block; + + @ApiModelProperty(value = "安装位置") + private String address; + + @ApiModelProperty(value = "是否有子设备 1有, 0没有") + private int parental; + + @ApiModelProperty(value = "父级id") + private String parentId; + + @ApiModelProperty(value = "信令安全模式 缺省为0; 0:不采用; 2: S/MIME签名方式; 3: S/ MIME加密签名同时采用方式; 4:数字摘要方式") + private int safetyWay; + + @ApiModelProperty(value = "注册方式 缺省为1;1:符合IETFRFC3261标准的认证注册模 式; 2:基于口令的双向认证注册模式; 3:基于数字证书的双向认证注册模式") + private int registerWay; + + @ApiModelProperty("证书序列号") + private String certNum; + + @ApiModelProperty("证书有效标识 缺省为0;证书有效标识:0:无效1: 有效") + private int certifiable; + + @ApiModelProperty("证书无效原因码") + private int errCode; + + @ApiModelProperty( "证书终止有效期") + private String endTime; + + @ApiModelProperty("保密属性 缺省为0; 0:不涉密, 1:涉密") + private String secrecy; + + @ApiModelProperty("IP地址") + private String ipAddress; + + @ApiModelProperty("端口号") + private int port; + + @ApiModelProperty("密码") + private String password; + + @ApiModelProperty("摄像头类型") + private String cameraType; + + @ApiModelProperty("云台控制") + private String ptzControl; + + @ApiModelProperty(value = "状态") + private String status; + + @ApiModelProperty("经度") + private double longitude; + + @ApiModelProperty("纬度") + private double latitude; + + @ApiModelProperty(value = "备注") + private String remark; + + @ApiModelProperty("创建时间") + private LocalDateTime createTime; + + @ApiModelProperty("创建人id") + @TableField(fill = FieldFill.INSERT) + private Long createBy; + + @ApiModelProperty("更新时间") + private LocalDateTime updateTime; + + @ApiModelProperty("更新人id") + @TableField(fill = FieldFill.INSERT_UPDATE) + private Long updateBy; + +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/domain/entity/DeviceVideoEntity.java b/sip/src/main/java/com/dite/znpt/monitor/domain/entity/DeviceVideoEntity.java new file mode 100644 index 0000000..049e324 --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/domain/entity/DeviceVideoEntity.java @@ -0,0 +1,97 @@ +package com.dite.znpt.monitor.domain.entity; + +import com.baomidou.mybatisplus.annotation.*; +import com.fasterxml.jackson.annotation.JsonFormat; +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: huise23 + * @Date: 2022/8/11 10:24 + * @Description: + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("vs_device_video") +@ApiModel(value="DeviceVideoEntity", description="视频设备表") +public class DeviceVideoEntity implements Serializable { + + private static final long serialVersionUID = -182441901641147882L; + + @ApiModelProperty(value = "主键id") + @TableId(value = "video_id", type = IdType.AUTO) + private Long videoId; + + @ApiModelProperty(value = "视频设备国标编码") + private String videoCode; + + @ApiModelProperty(value = "视频设备名称") + private String videoName; + + @ApiModelProperty(value = "生产厂商") + private String manufacturer; + + @ApiModelProperty(value = "型号") + private String model; + + @ApiModelProperty(value = "固件版本") + private String firmware; + + @ApiModelProperty(value = "传输协议(UDP/TCP),默认UDP") + private String transport; + + @ApiModelProperty(value = "数据流传输模式(默认UDP)") + private String streamMode; + + @ApiModelProperty(value = "设备状态") + private String status; + + @ApiModelProperty(value = "注册时间") + private LocalDateTime registerTime; + + @ApiModelProperty(value = "心跳时间") + private LocalDateTime KeepaliveTime; + + @ApiModelProperty("通道个数") + private int channelCount; + + @ApiModelProperty(value = "ip") + private String ip; + + @ApiModelProperty(value = "端口") + private Integer port; + + @ApiModelProperty(value = "地址") + private String hostAddress; + + @ApiModelProperty(value = "注册有效期") + private Integer expires; + + @ApiModelProperty(value = "符集, 支持 UTF-8 与 GB2312") + private String charset; + + @ApiModelProperty(value = "产品id") + private Long productId; + + @ApiModelProperty(value = "备注") + private String remark; + + @ApiModelProperty("创建时间") + private LocalDateTime createTime; + + @ApiModelProperty("创建人id") + @TableField(fill = FieldFill.INSERT) + private Long createBy; + + @ApiModelProperty("更新时间") + private LocalDateTime updateTime; + + @ApiModelProperty("更新人id") + @TableField(fill = FieldFill.INSERT_UPDATE) + private Long updateBy; +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/domain/entity/IpConfigEntity.java b/sip/src/main/java/com/dite/znpt/monitor/domain/entity/IpConfigEntity.java new file mode 100644 index 0000000..0259688 --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/domain/entity/IpConfigEntity.java @@ -0,0 +1,35 @@ +package com.dite.znpt.monitor.domain.entity; + +import java.io.Serializable; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * @Date: 2023/09/05 16:39 + * @Description: 监控设备IP配置表实体类 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("vs_ip_config") +@ApiModel(value="VsIpConfigEntity对象", description="监控设备IP配置表") +public class IpConfigEntity implements Serializable { + + @ApiModelProperty("${column.comment}") + @TableId(type = IdType.AUTO) + private Long configId; + + @ApiModelProperty("ip地址") + private String ip; + + @ApiModelProperty("ip地址前三位") + private String ipTopThree; + + +} + diff --git a/sip/src/main/java/com/dite/znpt/monitor/domain/req/MonitorConfigAddReq.java b/sip/src/main/java/com/dite/znpt/monitor/domain/req/MonitorConfigAddReq.java new file mode 100644 index 0000000..be2a92e --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/domain/req/MonitorConfigAddReq.java @@ -0,0 +1,14 @@ +package com.dite.znpt.monitor.domain.req; + +import lombok.Data; + +import java.util.List; + +/** + * @Date:2023/9/5 16:19 + * @Description: 视频服务配置新增对象 + */ +@Data +public class MonitorConfigAddReq { + private List ipAddresses; +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/domain/req/VideoInfoReq.java b/sip/src/main/java/com/dite/znpt/monitor/domain/req/VideoInfoReq.java new file mode 100644 index 0000000..0dc809c --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/domain/req/VideoInfoReq.java @@ -0,0 +1,23 @@ +package com.dite.znpt.monitor.domain.req; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; + +/** + * 查询视频信息参数 + * + * @author huise23 + * @since 2024-12-03 14:03:29 + */ +@Data +public class VideoInfoReq implements Serializable { + + @ApiModelProperty(value = "视频对接方式 1.摄像头直连 2.级联") + private Integer videoConnection; + + @ApiModelProperty(value = "级联分隔符(默认/)") + private String cascadeSeparator = "/"; + +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/domain/resp/DeviceVideoResp.java b/sip/src/main/java/com/dite/znpt/monitor/domain/resp/DeviceVideoResp.java new file mode 100644 index 0000000..f8a76ae --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/domain/resp/DeviceVideoResp.java @@ -0,0 +1,19 @@ +package com.dite.znpt.monitor.domain.resp; + +import com.dite.znpt.monitor.domain.entity.DeviceVideoEntity; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @Date:2023/9/7 10:26 + * @Description: + */ +@Data +public class DeviceVideoResp extends DeviceVideoEntity { + @ApiModelProperty(value = "设备状态label") + private String statusLabel; + @ApiModelProperty(value = "流传输模式label") + private String streamModeLabel; + @ApiModelProperty(value = "传输模式label") + private String transportLabel; +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/domain/resp/VideoInfoResp.java b/sip/src/main/java/com/dite/znpt/monitor/domain/resp/VideoInfoResp.java new file mode 100644 index 0000000..7ba594c --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/domain/resp/VideoInfoResp.java @@ -0,0 +1,58 @@ +package com.dite.znpt.monitor.domain.resp; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; + +/** + * 查询视频信息返回信息 + * + * @author huise23 + * @since 2024-12-03 14:03:29 + */ +@Data +public class VideoInfoResp implements Serializable { + + @ApiModelProperty(value = "视频设备id") + private Long videoId; + + @ApiModelProperty(value = "视频设备名称") + private String videoName; + + @ApiModelProperty(value = "通道id") + private Long channelId; + + @ApiModelProperty(value = "国标编码") + private String channelCode; + + @ApiModelProperty(value = "通道名称") + private String channelName; + + @ApiModelProperty(value = "生产厂商") + private String manufacture; + + @ApiModelProperty(value = "型号") + private String model; + + @ApiModelProperty(value = "安装位置") + private String address; + + @ApiModelProperty("IP地址") + private String ipAddress; + + @ApiModelProperty("端口号") + private int port; + + @ApiModelProperty(value = "云台控制label") + private String ptzControl; + + @ApiModelProperty("经度") + private double longitude; + + @ApiModelProperty("纬度") + private double latitude; + + @ApiModelProperty(value = "状态 DeviceStatus") + private String status; +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/domain/vo/video/DeviceVideoChannelEditReq.java b/sip/src/main/java/com/dite/znpt/monitor/domain/vo/video/DeviceVideoChannelEditReq.java new file mode 100644 index 0000000..1ec735a --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/domain/vo/video/DeviceVideoChannelEditReq.java @@ -0,0 +1,34 @@ +package com.dite.znpt.monitor.domain.vo.video; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author: huise23 + * @Date: 2022/8/11 18:12 + * @Description: + */ +@Data +@ApiModel("视频通道编辑请求") +public class DeviceVideoChannelEditReq implements Serializable { + + private static final long serialVersionUID = 719557164910393807L; + + @ApiModelProperty(value = "通道名称") + private String channelName; + + @ApiModelProperty(value = "安装位置") + private String address; + + @ApiModelProperty(value = "摄像头类型") + private String cameraType; + + @ApiModelProperty(value = "云台控制,Y表示是,N表示否") + private String ptzControl; + + @ApiModelProperty(value = "描述") + private String remark; +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/domain/vo/video/DeviceVideoChannelListResp.java b/sip/src/main/java/com/dite/znpt/monitor/domain/vo/video/DeviceVideoChannelListResp.java new file mode 100644 index 0000000..31234fb --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/domain/vo/video/DeviceVideoChannelListResp.java @@ -0,0 +1,55 @@ +package com.dite.znpt.monitor.domain.vo.video; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author: huise23 + * @Date: 2022/8/11 18:12 + * @Description: + */ +@Data +@ApiModel("视频通道列表响应") +public class DeviceVideoChannelListResp implements Serializable { + + private static final long serialVersionUID = -8053965410352257803L; + + @ApiModelProperty(value = "主键id") + private Long channelId; + + @ApiModelProperty(value = "所属产品id") + private Long productId; + + @ApiModelProperty(value = "通道国标编码") + private String channelCode; + + @ApiModelProperty(value = "通道名称") + private String channelName; + + @ApiModelProperty(value = "安装位置") + private String address; + + @ApiModelProperty(value = "摄像头类型label") + private String cameraType; + + @ApiModelProperty(value = "摄像头类型") + private String cameraTypeLabel; + + @ApiModelProperty(value = "云台控制label") + private String ptzControl; + + @ApiModelProperty(value = "云台控制,Y表示是,N表示否") + private String ptzControlLabel; + + @ApiModelProperty(value = "状态") + private String status; + + @ApiModelProperty(value = "状态label") + private String statusLabel; + + @ApiModelProperty(value = "描述") + private String remark; +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/domain/vo/video/DeviceVideoChannelResp.java b/sip/src/main/java/com/dite/znpt/monitor/domain/vo/video/DeviceVideoChannelResp.java new file mode 100644 index 0000000..1f22085 --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/domain/vo/video/DeviceVideoChannelResp.java @@ -0,0 +1,43 @@ +package com.dite.znpt.monitor.domain.vo.video; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author: huise23 + * @Date: 2022/8/11 18:12 + * @Description: + */ +@Data +@ApiModel("视频通道响应") +public class DeviceVideoChannelResp implements Serializable { + + private static final long serialVersionUID = 1140851083577845760L; + + @ApiModelProperty(value = "主键id") + private Long channelId; + + @ApiModelProperty(value = "通道国标编码") + private String channelCode; + + @ApiModelProperty(value = "通道名称") + private String channelName; + + @ApiModelProperty(value = "安装位置") + private String address; + + @ApiModelProperty(value = "摄像头类型") + private String cameraType; + + @ApiModelProperty(value = "云台控制,Y表示是,N表示否") + private String ptzControl; + + @ApiModelProperty(value = "状态") + private String status; + + @ApiModelProperty(value = "描述") + private String remark; +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/domain/vo/video/DeviceVideoEditReq.java b/sip/src/main/java/com/dite/znpt/monitor/domain/vo/video/DeviceVideoEditReq.java new file mode 100644 index 0000000..a1f2b8e --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/domain/vo/video/DeviceVideoEditReq.java @@ -0,0 +1,29 @@ +package com.dite.znpt.monitor.domain.vo.video; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author: huise23 + * @Date: 2022/8/11 18:13 + * @Description: + */ +@Data +@ApiModel("视频设备编辑请求参数") +public class DeviceVideoEditReq implements Serializable { + + private static final long serialVersionUID = -3387666090991548317L; + + @ApiModelProperty(value = "设备名称") + private String videoName; + + @ApiModelProperty(value = "所属产品") + private Long productId; + + @ApiModelProperty(value = "说明") + private String remark; + +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/domain/vo/video/DeviceVideoListResp.java b/sip/src/main/java/com/dite/znpt/monitor/domain/vo/video/DeviceVideoListResp.java new file mode 100644 index 0000000..026f873 --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/domain/vo/video/DeviceVideoListResp.java @@ -0,0 +1,74 @@ +package com.dite.znpt.monitor.domain.vo.video; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + * @Author: huise23 + * @Date: 2022/8/11 18:13 + * @Description: + */ +@Data +@ApiModel("视频设备列表响应") +public class DeviceVideoListResp implements Serializable { + + private static final long serialVersionUID = -5568664011265192343L; + + @ApiModelProperty(value = "主键id") + private Long videoId; + + @ApiModelProperty(value = "视频设备国标编码") + private String videoCode; + + @ApiModelProperty(value = "视频设备名称") + private String videoName; + + @ApiModelProperty(value = "传输模式") + private String transport; + + @ApiModelProperty(value = "传输模式label") + private String transportLabel; + + @ApiModelProperty(value = "流传输模式") + private String streamMode; + + @ApiModelProperty(value = "流传输模式label") + private String streamModeLabel; + + @ApiModelProperty(value = "通道数量") + private Integer channelCount; + + @ApiModelProperty(value = "设备状态") + private String status; + + @ApiModelProperty(value = "设备状态label") + private String statusLabel; + + @ApiModelProperty(value = "设备ip") + private String ip; + + @ApiModelProperty(value = "设备端口") + private String port; + + @ApiModelProperty(value = "设备地址(ip+端口)") + private String hostAddress; + + @ApiModelProperty(value = "生产厂商") + private String manufacturer; + + @ApiModelProperty(value = "备注") + private String remark; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "创建时间") + private LocalDateTime createTime; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "心跳时间") + private LocalDateTime keepAliveTime; +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/domain/vo/video/DeviceVideoNumResp.java b/sip/src/main/java/com/dite/znpt/monitor/domain/vo/video/DeviceVideoNumResp.java new file mode 100644 index 0000000..f56b8c1 --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/domain/vo/video/DeviceVideoNumResp.java @@ -0,0 +1,24 @@ +package com.dite.znpt.monitor.domain.vo.video; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @Author: huise23 + * @Date: 2022/8/16 9:34 + * @Description: + */ +@Data +@ApiModel("视频设备数量响应") +public class DeviceVideoNumResp { + + @ApiModelProperty(value = "设备总数量") + private Long allDevice; + + @ApiModelProperty(value = "设备在线数量") + private Long onlineDevice; + + @ApiModelProperty(value = "设备离线数量") + private Long offlineDevice; +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/domain/vo/video/StreamMediaFormat.java b/sip/src/main/java/com/dite/znpt/monitor/domain/vo/video/StreamMediaFormat.java new file mode 100644 index 0000000..5c5f457 --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/domain/vo/video/StreamMediaFormat.java @@ -0,0 +1,77 @@ +package com.dite.znpt.monitor.domain.vo.video; + +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.annotation.TableField; +import com.dite.znpt.monitor.media.zlm.dto.ServerConfig; +import com.dite.znpt.monitor.media.zlm.enums.MediaFormatType; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; + +/** + * @Author: huise23 + * @Date: 2022/8/11 10:25 + * @Description: + */ +@Data +@EqualsAndHashCode(callSuper = false) +@ApiModel(value = "StreamMediaFormat对象", description = "流媒体格式") +public class StreamMediaFormat implements Serializable { + + private static final long serialVersionUID = -4177962876536716643L; + + @ApiModelProperty(value = "流媒体格式") + private String mediaFormat; + + @ApiModelProperty(value = "端口") + private Integer port; + + @ApiModelProperty(value = "是否开启tls,1表示ture,0表示false") + private String openTls; + + @TableField(exist = false) + @ApiModelProperty(value = "WebSocket播放地址") + private String wsUrl; + + @TableField(exist = false) + @ApiModelProperty(value = "Http播放地址") + private String httpUrl; + + @TableField(exist = false) + @ApiModelProperty(value = "WebSocket播放地址") + private String wssUrl; + + @TableField(exist = false) + @ApiModelProperty(value = "Http播放地址") + private String httpsUrl; + + @TableField(exist = false) + @ApiModelProperty(value = "相对播放地址") + private String relativePath; + + public StreamMediaFormat(String mediaFormat,Integer port,String openTls){ + this.mediaFormat = mediaFormat; + this.port = port; + this.openTls = openTls; + } + + public void generateUrl(String host, String streamId, ServerConfig config, String mediaRouter) { + if("webrtc".equals(this.mediaFormat)){ + this.httpUrl = StrUtil.format("http://{}:{}/index/api/webrtc?app=rtp&stream={}&type=play", host, config.getHttpPort(), streamId); + this.httpsUrl = StrUtil.format("https://{}:{}/index/api/webrtc?app=rtp&stream={}&type=play", host, config.getHttpSslPort(), streamId); + this.relativePath = StrUtil.format("{}/index/api/webrtc?app=rtp&stream={}&type=play", mediaRouter, streamId); + return; + } + String suffix = MediaFormatType.getSuffix(this.mediaFormat); + if (config.getHttpSslPort() != null && config.getHttpSslPort() > 0) { + this.wssUrl = StrUtil.format("wss://{}:{}/rtp/{}{}", host, config.getHttpSslPort(), streamId, suffix); + this.httpsUrl = StrUtil.format("https://{}:{}/rtp/{}{}", host, config.getHttpSslPort(), streamId, suffix); + } + this.wsUrl = StrUtil.format("ws://{}:{}/rtp/{}{}", host, config.getHttpPort(), streamId, suffix); + this.httpUrl = StrUtil.format("http://{}:{}/rtp/{}{}", host, config.getHttpPort(), streamId, suffix); + this.relativePath = StrUtil.format("{}/rtp/{}{}", mediaRouter, streamId, suffix); + } +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/domain/vo/video/StreamMediaFormatReq.java b/sip/src/main/java/com/dite/znpt/monitor/domain/vo/video/StreamMediaFormatReq.java new file mode 100644 index 0000000..d3ce278 --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/domain/vo/video/StreamMediaFormatReq.java @@ -0,0 +1,28 @@ +package com.dite.znpt.monitor.domain.vo.video; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author: huise23 + * @Date: 2022/8/11 14:40 + * @Description: + */ +@Data +@ApiModel("流媒体格式请求") +public class StreamMediaFormatReq implements Serializable { + + private static final long serialVersionUID = 6627383994019834279L; + + @ApiModelProperty(value = "流媒体格式") + private String mediaFormat; + + @ApiModelProperty(value = "端口") + private Integer port; + + @ApiModelProperty(value = "是否开启TLS,1表示true,0表示false") + private String openTls; +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/domain/vo/video/StreamMediaFormatResp.java b/sip/src/main/java/com/dite/znpt/monitor/domain/vo/video/StreamMediaFormatResp.java new file mode 100644 index 0000000..ad9304b --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/domain/vo/video/StreamMediaFormatResp.java @@ -0,0 +1,31 @@ +package com.dite.znpt.monitor.domain.vo.video; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author: huise23 + * @Date: 2022/8/11 14:40 + * @Description: + */ +@Data +@ApiModel("流媒体格式响应") +public class StreamMediaFormatResp implements Serializable { + + private static final long serialVersionUID = -5714327034173930078L; + + @ApiModelProperty(value = "流媒体格式主键") + private Long formatId; + + @ApiModelProperty(value = "流媒体格式") + private String mediaFormat; + + @ApiModelProperty(value = "端口") + private Integer port; + + @ApiModelProperty(value = "是否开启TLS,1表示true,0表示false") + private String openTls; +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/domain/vo/video/StreamMediaServerConfigReq.java b/sip/src/main/java/com/dite/znpt/monitor/domain/vo/video/StreamMediaServerConfigReq.java new file mode 100644 index 0000000..36c15fd --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/domain/vo/video/StreamMediaServerConfigReq.java @@ -0,0 +1,59 @@ +package com.dite.znpt.monitor.domain.vo.video; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.util.List; + +/** + * @Author: huise23 + * @Date: 2022/8/11 14:16 + * @Description: + */ +@Data +@ApiModel("流媒体服务配置请求") +public class StreamMediaServerConfigReq implements Serializable { + + private static final long serialVersionUID = -1228005085084886474L; + + @NotNull(message = "流媒体名称不能为空") + @ApiModelProperty(value = "流媒体名称") + private String mediaName; + + @ApiModelProperty(value = "流媒体服务") + private String mediaService; + + @ApiModelProperty(value = "公网 HOST") + private String publicHost; + + @ApiModelProperty(value = "API HOST") + private String apiHost; + + @ApiModelProperty(value = "API 端口") + private Integer apiPort; + + @ApiModelProperty(value = "密钥") + private Integer secretKey; + + @ApiModelProperty(value = "流ID前缀") + private String streamPrefix; + + @ApiModelProperty(value = "RTP IP") + private String rtpHost; + + @ApiModelProperty(value = "RTP 端口") + private Integer rtpPort; + + @ApiModelProperty(value = "动态端口起始值") + private Integer dynamicPortStart; + + @ApiModelProperty(value = "动态端口结束值") + private Integer dynamicPortEnd; + + @ApiModelProperty(value = "流媒体格式") + private List streamMediaFormatReqList; + +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/domain/vo/video/StreamMediaServerConfigResp.java b/sip/src/main/java/com/dite/znpt/monitor/domain/vo/video/StreamMediaServerConfigResp.java new file mode 100644 index 0000000..6e3b185 --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/domain/vo/video/StreamMediaServerConfigResp.java @@ -0,0 +1,60 @@ +package com.dite.znpt.monitor.domain.vo.video; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Author: huise23 + * @Date: 2022/8/11 14:16 + * @Description: + */ +@Data +@ApiModel("流媒体服务配置响应") +public class StreamMediaServerConfigResp implements Serializable { + + private static final long serialVersionUID = 3464085768355214710L; + + @ApiModelProperty(value = "'流媒体配置主键'") + private Long configId; + + @ApiModelProperty(value = "'流媒体名称'") + private String mediaName; + + @ApiModelProperty(value = "流媒体服务") + private String mediaService; + + @ApiModelProperty(value = "公网 HOST") + private String publicHost; + + @ApiModelProperty(value = "API HOST") + private String apiHost; + + @ApiModelProperty(value = "API 端口") + private Integer apiPort; + + @ApiModelProperty(value = "密钥") + private String secretKey; + + @ApiModelProperty(value = "流ID前缀") + private String streamPrefix; + + @ApiModelProperty(value = "RTP IP") + private String rtpHost; + + @ApiModelProperty(value = "RTP 端口") + private Integer rtpPort; + + @ApiModelProperty(value = "动态端口起始值") + private Integer dynamicPortStart; + + @ApiModelProperty(value = "动态端口结束值") + private Integer dynamicPortEnd; + + @ApiModelProperty(value = "流媒体格式") + private List streamMediaFormatRespList; + +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/domain/vo/video/VideoPayResp.java b/sip/src/main/java/com/dite/znpt/monitor/domain/vo/video/VideoPayResp.java new file mode 100644 index 0000000..26809bc --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/domain/vo/video/VideoPayResp.java @@ -0,0 +1,24 @@ +package com.dite.znpt.monitor.domain.vo.video; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Builder; +import lombok.Data; + +import java.util.List; + +/** + * 视频播放响应 + * @author huise23 + * @since 2024-11-26 14:03:41 + */ +@Data +@Builder +public class VideoPayResp { + + @ApiModelProperty(value = "播放方式") + private String mediaType; + + @ApiModelProperty(value = "流媒体播放地址") + private List streamMediaFormatList; + +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/mapper/DeviceVideoChannelMapper.java b/sip/src/main/java/com/dite/znpt/monitor/mapper/DeviceVideoChannelMapper.java new file mode 100644 index 0000000..2c211e8 --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/mapper/DeviceVideoChannelMapper.java @@ -0,0 +1,55 @@ +package com.dite.znpt.monitor.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.dite.znpt.monitor.domain.entity.DeviceVideoChannelEntity; +import com.dite.znpt.monitor.domain.req.VideoInfoReq; +import com.dite.znpt.monitor.domain.resp.VideoInfoResp; +import com.dite.znpt.monitor.domain.vo.video.DeviceVideoChannelListResp; +import com.dite.znpt.monitor.domain.vo.video.DeviceVideoChannelResp; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * @Author: huise23 + * @Date: 2022/8/11 18:08 + * @Description: + */ +public interface DeviceVideoChannelMapper extends BaseMapper { + + /** + * 查询视频通道列表 + * + * @param videoId 视频id + * @param keyword 插叙条件 + * @return {@link List< DeviceVideoChannelListResp>} + */ + List selectDeviceVideoChannel(@Param("videoId") Long videoId, @Param("keyword") String keyword); + + /** + * 查询所有视频通道列表 + * + * @param keyword 插叙条件 + * @return {@link List< DeviceVideoChannelListResp>} + */ + List selectAllDeviceVideoChannel(@Param("keyword") String keyword); + + /** + * 查询视频通道详情 + * + * @param channelCode 通道code + * @return {@link DeviceVideoChannelResp} + */ + DeviceVideoChannelResp getDeviceVideoChannelDetail(@Param("channelCode") String channelCode); + + /** + * 查询通道及视频信息 + * + * @param videoInfoReq 查询参数 + * @return {@link VideoInfoResp } + * @author huise23 + * @since 2024-12-03 13:54:52 + */ + List selectVideoInfoList(VideoInfoReq videoInfoReq); + +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/mapper/DeviceVideoMapper.java b/sip/src/main/java/com/dite/znpt/monitor/mapper/DeviceVideoMapper.java new file mode 100644 index 0000000..cc14697 --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/mapper/DeviceVideoMapper.java @@ -0,0 +1,24 @@ +package com.dite.znpt.monitor.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.dite.znpt.monitor.domain.entity.DeviceVideoEntity; +import com.dite.znpt.monitor.domain.vo.video.DeviceVideoListResp; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * @Author: huise23 + * @Date: 2022/8/11 18:09 + * @Description: + */ +public interface DeviceVideoMapper extends BaseMapper { + /** + * 条件查询视频设备列表 + * @param status 是否在线 + * @param keyword 设备名称或者编码 + * @return {@link List< DeviceVideoListResp>} + */ + List selectDeviceVideoList(@Param("status") String status, @Param("keyword") String keyword, @Param("hostAddress") String hostAddress); + +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/mapper/IpConfigMapper.java b/sip/src/main/java/com/dite/znpt/monitor/mapper/IpConfigMapper.java new file mode 100644 index 0000000..1332af0 --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/mapper/IpConfigMapper.java @@ -0,0 +1,13 @@ +package com.dite.znpt.monitor.mapper; + + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.dite.znpt.monitor.domain.entity.IpConfigEntity; + +/** + * @Date: 2023/09/05 16:39 + * @Description: 监控设备IP配置表数据库访问层 + */ +public interface IpConfigMapper extends BaseMapper { +} + diff --git a/sip/src/main/java/com/dite/znpt/monitor/mapper/StreamMediaFormatMapper.java b/sip/src/main/java/com/dite/znpt/monitor/mapper/StreamMediaFormatMapper.java new file mode 100644 index 0000000..a3ce77a --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/mapper/StreamMediaFormatMapper.java @@ -0,0 +1,12 @@ +package com.dite.znpt.monitor.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.dite.znpt.monitor.domain.vo.video.StreamMediaFormat; + +/** + * @Author: huise23 + * @Date: 2022/8/11 15:00 + * @Description: + */ +public interface StreamMediaFormatMapper extends BaseMapper { +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/media/zlm/ZlmApi.java b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/ZlmApi.java new file mode 100644 index 0000000..f8604da --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/ZlmApi.java @@ -0,0 +1 @@ +package com.dite.znpt.monitor.media.zlm; import com.dite.znpt.monitor.media.zlm.dto.ServerConfig; import com.dite.znpt.monitor.media.zlm.dto.ServerInfo; import com.dite.znpt.monitor.media.zlm.dto.req.*; import com.dite.znpt.monitor.media.zlm.dto.resp.*; import java.io.IOException; import java.util.List; /** * @Author: huise23 * @Date: 2022/8/29 10:14 * @Description: Zlm客户端启动类 */ public interface ZlmApi { /** * 获取API列表 * api: /index/api/getApiList * * @return Api列表 */ List getApiList(ServerInfo server); /** * 获取各epoll(或select)线程负载以及延时 * api: /index/api/getThreadsLoad * * @return 各epoll(或select)线程负载以及延时 */ List getThreadsLoad(ServerInfo server); /** * 获取各后台epoll(或select)线程负载以及延时 * api: /index/api/getWorkThreadsLoad * * @return 各后台epoll(或select)线程负载以及延时 */ List getWorkThreadsLoad(ServerInfo server); /** * 获取服务器配置 * api: /index/api/getServerConfig * * @return 服务器配置 */ List getServerConfig(ServerInfo server); /** * 设置服务器配置 * api: /index/api/setServerConfig * * @param config 服务器配置 * @return 操作结果 */ Integer setServerConfig(ServerInfo server, ServerConfig config); /** * 重启服务器,只有Daemon方式才能重启,否则是直接关闭! * api: /index/api/restartServer * * @return 操作结果 */ Boolean restartServer(ServerInfo server); /** * 获取流列表,可选筛选参数 * api: /index/api/getMediaList * * @param req 请求参数 * @return 操作结果 */ List getMediaList(ServerInfo server, StreamReq req); /** * 关闭流(目前所有类型的流都支持关闭) * api: /index/api/close_streams * * @param req 请求参数 * @return 操作结果 */ CloseStreamResp closeStreams(ServerInfo server, CloseStreamReq req); /** * 获取所有TcpSession列表(获取所有tcp客户端相关信息) * api: /index/api/getAllSession * * @param req 请求参数 * @return 所有TcpSession列表 */ List getAllSession(ServerInfo server, GetAllSessionReq req); /** * 断开tcp连接,比如说可以断开rtsp、rtmp播放器等 * api: /index/api/kick_session * * @param id 客户端唯一id,可以通过getAllSession接口获取 * @return 操作结果 */ Boolean kickSession(ServerInfo server, Long id); /** * 断开tcp连接,比如说可以断开rtsp、rtmp播放器等 * api: /index/api/kick_sessions * * @param req 请求参数 * @return 操作结果 */ Integer kickSession(ServerInfo server, GetAllSessionReq req); /** * 动态添加rtsp/rtmp/hls拉流代理(只支持H264/H265/aac/G711负载) * api: /index/api/addStreamProxy * * @param req 请求参数 * @return 唯一Key */ String addStreamProxy(ServerInfo server, StreamProxyReq req); /** * 关闭拉流代理 * api: /index/api/delStreamProxy * * @param key addStreamProxy接口返回的key * @return 操作结果 */ Boolean delStreamProxy(ServerInfo server, String key); /** * 通过fork FFmpeg进程的方式拉流代理,支持任意协议 * api: /index/api/addFFmpegSource * * @param req 请求参数 * @return 唯一Key */ String addFfMpegSource(ServerInfo server, FFmpegSourceReq req); /** * 关闭ffmpeg拉流代理 * api: /index/api/delFFmpegSource * * @param key addFFmpegSource接口返回的key * @return 操作结果 */ Boolean delFfMpegSource(ServerInfo server, String key); /** * 获取rtp代理时的某路ssrc rtp信息 * api: /index/api/getRtpInfo * * @param streamId RTP的ssrc,16进制字符串或者是流的id(openRtpServer接口指定) * @return 操作结果 */ RtpInfoResp getRtpInfo(ServerInfo server, String streamId); /** * 搜索文件系统,获取流对应的录像文件列表或日期文件夹列表 * api: /index/api/getMp4RecordFile * * @param req 请求参数 * @return 操作结果 */ Mp4RecordFileResp getMp4RecordFile(ServerInfo server, GetMp4RecordFileReq req); /** * 开始录制hls或MP4 * api: /index/api/startRecord * * @param req 请求参数 * @return 操作结果 */ Boolean startRecord(ServerInfo server, RecordReq req); /** * 停止录制流 * api: /index/api/stopRecord * * @param req 请求参数 * @return 操作结果 */ Boolean stopRecord(ServerInfo server, RecordReq req); /** * 获取流录制状态 * api: /index/api/isRecording * * @param req 请求参数 * @return 操作结果 */ Boolean isRecording(ServerInfo server, RecordReq req); /** * 获取截图或生成实时截图并返回 * api: /index/api/getSnap * * @param req 请求参数 * @return jpeg格式的图片,可以在浏览器直接打开 */ void getSnap(ServerInfo server, SnapReq req) throws IOException; /** * 创建GB28181 RTP接收端口,如果该端口接收数据超时,则会自动被回收(不用调用closeRtpServer接口) * api: /index/api/openRtpServer * * @param req 请求参数 * @return 接收端口,方便获取随机端口号 */ Integer openRtpServer(ServerInfo server, RtpServerReq req); /** * 关闭GB28181 RTP接收端口 * api: /index/api/closeRtpServer * * @param streamId 该端口绑定的流ID,该端口只能创建这一个流(而不是根据ssrc创建多个) * @return 是否找到记录并关闭 */ Boolean closeRtpServer(ServerInfo server, String streamId); /** * 获取openRtpServer接口创建的所有RTP服务器 * api: /index/api/listRtpServer * * @return 是否找到记录并关闭 */ List listRtpServer(ServerInfo server); /** * 作为GB28181客户端,启动ps-rtp推流,支持rtp/udp方式; * 该接口支持rtsp/rtmp等协议转ps-rtp推流。第一次推流失败会直接返回错误,成功一次后,后续失败也将无限重试。 * api: /index/api/startSendRtp * * @param req 请求参数 * @return 使用的本地端口号 */ Integer startSendRtp(ServerInfo server, SendRtpReq req); /** * 作为GB28181 Passive TCP服务器; * 该接口支持rtsp/rtmp等协议转ps-rtp被动推流。 * 调用该接口,zlm会启动tcp服务器等待连接请求, * 连接建立后,zlm会关闭tcp服务器,然后源源不断的往客户端推流。 * 第一次推流失败会直接返回错误,成功一次后,后续失败也将无限重试(不停地建立tcp监听,超时后再关闭)。 * api: /index/api/startSendRtpPassive * * @param req 请求参数 * @return 使用的本地端口号 */ Integer startSendRtpPassive(ServerInfo server, SendRtpReq req); /** * 停止GB28181 ps-rtp推流 * api: /index/api/stopSendRtp * * @param req 请求参数 * @return 操作结果 */ Boolean stopSendRtp(ServerInfo server, SendRtpReq req); /** * 获取主要对象个数统计,主要用于分析内存性能 * api: /index/api/getStatistic * * @return 操作结果 */ StatisticResp getStatistic(ServerInfo server); /** * 添加rtsp/rtmp主动推流(把本服务器的直播流推送到其他服务器去) * api: /index/api/addStreamPusherProxy * * @param req 请求参数 * @return 流的唯一标识 */ String addStreamPusherProxy(ServerInfo server, StreamPusherProxyReq req); /** * 关闭推流 * api: /index/api/delStreamPusherProxy * * @param key 流的唯一标识 * @return 操作结果 */ Boolean delStreamPusherProxy(ServerInfo server, String key); } \ No newline at end of file diff --git a/sip/src/main/java/com/dite/znpt/monitor/media/zlm/ZlmHook.java b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/ZlmHook.java new file mode 100644 index 0000000..a9c1b11 --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/ZlmHook.java @@ -0,0 +1,135 @@ +package com.dite.znpt.monitor.media.zlm; + +import com.dite.znpt.monitor.media.zlm.dto.ServerConfig; +import com.dite.znpt.monitor.media.zlm.dto.event.*; +import com.dite.znpt.monitor.media.zlm.impl.ZlmHookService; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @Author: huise23 + * @Date: 2022/8/29 10:22 + * @Description: + */ +@Slf4j +@RestController +@RequestMapping("/index/hook") +@RequiredArgsConstructor(onConstructor = @__(@Autowired)) +public class ZlmHook { + private final ZlmHookService service; + + /** + * 流量统计事件,播放器或推流器断开时并且耗用流量超过特定阈值时会触发此事件, + * 阈值通过配置文件general.flowThreshold配置;此事件对回复不敏感。 + */ + @PostMapping(value = "/on_flow_report") + public BaseEventResp onFlowReport(@RequestBody FlowReportReq req) { + return service.onFlowReport(req); + } + + /** + * 访问http文件服务器上hls之外的文件时触发。 + */ + @PostMapping(value = "/on_http_access") + public HttpAccessResp onHttpAccess(@RequestBody HttpAccessReq req) { + return service.onHttpAccess(req); + } + + /** + * 播放器鉴权事件,rtsp/rtmp/http-flv/ws-flv/hls的播放都将触发此鉴权事件; + * 如果流不存在,那么先触发on_play事件然后触发on_stream_not_found事件。 + * 播放rtsp流时,如果该流启动了rtsp专属鉴权(on_rtsp_realm)那么将不再触发on_play事件。 + */ + @PostMapping(value = "/on_play") + public BaseEventResp onPlay(@RequestBody PlayReq req) { + return service.onPlay(req); + } + + /** + * rtsp/rtmp/rtp推流鉴权事件。 + */ + @PostMapping(value = "/on_publish") + public PublishResp onPublish(@RequestBody PublishReq req) { + return service.onPublish(req); + } + + + /** + * 录制mp4完成后通知事件;此事件对回复不敏感。 + */ + @PostMapping(value = "/on_record_mp4") + public BaseEventResp onRecordMp4(@RequestBody RecordMp4Req req) { + return service.onRecordMp4(req); + } + + /** + * 该rtsp流是否开启rtsp专用方式的鉴权事件,开启后才会触发on_rtsp_auth事件。 + * 需要指出的是rtsp也支持url参数鉴权,它支持两种方式鉴权。 + */ + @PostMapping(value = "/on_rtsp_realm") + public BaseEventResp onRtspRealm(@RequestBody RtspRealmReq req) { + return service.onRtspRealm(req); + } + + /** + * rtsp专用的鉴权事件,先触发on_rtsp_realm事件然后才会触发on_rtsp_auth事件。 + */ + @PostMapping(value = "/on_rtsp_auth") + public RtspAuthResp onRtspAuth(@RequestBody RtspAuthReq req) { + return service.onRtspAuth(req); + } + + /** + * shell登录鉴权,ZLMediaKit提供简单的telnet调试方式 + * 使用telnet 127.0.0.1 9000能进入MediaServer进程的shell界面。 + */ + @PostMapping(value = "/on_shell_login") + public BaseEventResp onShellLogin(@RequestBody ShellLoginReq req) { + return service.onShellLogin(req); + } + + /** + * rtsp/rtmp流注册或注销时触发此事件;此事件对回复不敏感。 + */ + @PostMapping(value = "/on_stream_changed") + public BaseEventResp onStreamChanged(@RequestBody StreamChangedReq req) { + return service.onStreamChanged(req); + } + + /** + * 流无人观看时事件,用户可以通过此事件选择是否关闭无人看的流。 + */ + @PostMapping(value = "/on_stream_none_reader") + public BaseEventResp onStreamNoneReader(@RequestBody StreamNoneReaderReq req) { + return service.onStreamNoneReader(req); + } + + /** + * 流未找到事件,用户可以在此事件触发时,立即去拉流,这样可以实现按需拉流;此事件对回复不敏感。 + */ + @PostMapping(value = "/on_stream_not_found") + public BaseEventResp onStreamNotFound(@RequestBody StreamNotFoundReq req) { + return service.onStreamNotFound(req); + } + + /** + * 服务器启动事件,可以用于监听服务器崩溃重启;此事件对回复不敏感。 + */ + @PostMapping(value = "/on_server_started") + public BaseEventResp onServerStarted(@RequestBody ServerConfig req) { + return service.onServerStarted(req); + } + + /** + * 服务器定时上报时间,上报间隔可配置,默认10s上报一次 + */ + @PostMapping(value = "/on_server_keepalive") + public BaseEventResp onServerKeepalive(@RequestBody ServerKeepaliveReq req) { + return service.onServerKeepalive(req); + } +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/media/zlm/ZlmService.java b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/ZlmService.java new file mode 100644 index 0000000..b56e1e1 --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/ZlmService.java @@ -0,0 +1,42 @@ +package com.dite.znpt.monitor.media.zlm; + +import com.dite.znpt.monitor.media.zlm.dto.MediaItem; + +/** + * @Author: huise23 + * @Date: 2022/8/30 10:39 + * @Description: 流媒体服务管理主业务 + */ +public interface ZlmService { + /** + * 点播视频 + * + * @param deviceCode 设备编码 + * @param channelCode 通道编码 + * @return 流信息 + */ + MediaItem play(String deviceCode, String channelCode); + + /** + * 失败的时候释放流媒体资源 + * + * @param deviceCode 设备编码 + * @param channelCode 通道编码 + */ + void release(String deviceCode, String channelCode); + + /** + * 失败的时候释放流媒体资源 + * + * @param media 流媒体信息 + */ + void release(MediaItem media); + + /** + * 停止点播 + * + * @param mediaServerId 流媒体服务器id,通过配置文件设置 + * @param streamId 流ID + */ + void display(String mediaServerId, String streamId); +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/media/zlm/cache/MediaServerCache.java b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/cache/MediaServerCache.java new file mode 100644 index 0000000..4f13dad --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/cache/MediaServerCache.java @@ -0,0 +1,38 @@ +package com.dite.znpt.monitor.media.zlm.cache; + +import com.dite.znpt.monitor.media.zlm.dto.ServerItem; +import com.dite.znpt.service.impl.RedisService; +import lombok.RequiredArgsConstructor; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * @Author: huise23 + * @Date: 2022/8/30 15:46 + * @Description: + */ +@Component +@RequiredArgsConstructor(onConstructor = @__(@Autowired)) +public class MediaServerCache { + private final RedisService redisService; + private final String zlm_key = "zlm_media_server"; + + + public void putLoad(ServerItem serverItem) { + redisService.setCacheObject(zlm_key, serverItem); + } + + /** + * 获取zlm节点 + */ + public ServerItem getLoad() { + return redisService.getCacheObject(zlm_key); + } + + public void releaseSsrc(String ssrc) { + ServerItem item = getLoad(); + item.releaseSsrc(ssrc); + putLoad(item); + } + +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/media/zlm/cache/MediaServerChannelCache.java b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/cache/MediaServerChannelCache.java new file mode 100644 index 0000000..27b7fbb --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/cache/MediaServerChannelCache.java @@ -0,0 +1,54 @@ +package com.dite.znpt.monitor.media.zlm.cache; + +import cn.hutool.core.util.StrUtil; +import com.dite.znpt.monitor.media.zlm.dto.MediaItem; +import com.dite.znpt.service.impl.RedisService; +import lombok.RequiredArgsConstructor; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * @Author: huise23 + * @Date: 2022/8/30 15:46 + * @Description: + */ +@Component +@RequiredArgsConstructor(onConstructor = @__(@Autowired)) +public class MediaServerChannelCache { + private final RedisService redisService; + + private String getKey(String deviceCode, String channelCode) { + return StrUtil.format("zlm_media_server_channel:{}:{}", deviceCode, channelCode); + } + + private String getStreamKey(String mediaServerId, String streamId) { + return StrUtil.format("zlm_media_server_channel_stream_key:{}:{}", mediaServerId, streamId); + } + + public boolean has(String deviceCode, String channelCode) { + return redisService.hasKey(getKey(deviceCode, channelCode)); + } + + public MediaItem get(String deviceCode, String channelCode) { + return redisService.getCacheObject(getKey(deviceCode, channelCode)); + } + + public void put(String deviceCode, String channelCode, MediaItem media) { + String key = getKey(deviceCode, channelCode); + redisService.setCacheObject(key, media); + redisService.setCacheObject(getStreamKey(media.getConfig().getGeneralMediaServerId(), media.getStreamId()), key); + } + + public void delete(MediaItem media) { + redisService.deleteObject(getKey(media.getDeviceCode(), media.getChannelCode())); + redisService.deleteObject(getStreamKey(media.getConfig().getGeneralMediaServerId(), media.getStreamId())); + } + + public MediaItem getByStream(String mediaServerId, String streamId) { + String key = redisService.getCacheObject(getStreamKey(mediaServerId, streamId)); + if (StrUtil.isNotBlank(key)) { + return redisService.getCacheObject(key); + } + return null; + } +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/media/zlm/config/StreamMediaServerConfig.java b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/config/StreamMediaServerConfig.java new file mode 100644 index 0000000..e2a7d07 --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/config/StreamMediaServerConfig.java @@ -0,0 +1,46 @@ +package com.dite.znpt.monitor.media.zlm.config; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.context.annotation.Configuration; + +@Data +@Configuration +@ConfigurationProperties(prefix = "zlm-config") +public class StreamMediaServerConfig { + + @ApiModelProperty(value = "'流媒体名称'") + private String mediaName; + + @ApiModelProperty(value = "流媒体服务商") + private String mediaService; + + @ApiModelProperty(value = "公网ip") + private String publicHost; + + @ApiModelProperty(value = "接口ip") + private String apiHost; + + @ApiModelProperty(value = "接口端口") + private Integer apiPort; + + @ApiModelProperty(value = "密钥") + private String secretKey; + + @ApiModelProperty(value = "流id前缀") + private String streamPrefix; + + @ApiModelProperty(value = "rtp ip") + private String rtpHost; + + @ApiModelProperty(value = "rtp 端口") + private Integer rtpPort; + + @ApiModelProperty(value = "动态端口起始值") + private String dynamicPortStart; + + @ApiModelProperty(value = "动态端口结束值") + private String dynamicPortEnd; + +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/MediaItem.java b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/MediaItem.java new file mode 100644 index 0000000..a39c8c4 --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/MediaItem.java @@ -0,0 +1,130 @@ +package com.dite.znpt.monitor.media.zlm.dto; + +import cn.hutool.core.util.StrUtil; +import com.dite.znpt.monitor.domain.vo.video.StreamMediaFormat; +import com.dite.znpt.monitor.media.zlm.dto.resp.RtpInfoResp; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import java.io.Serializable; +import java.util.List; + +/** + * @Author: huise23 + * @Date: 2022/8/29 15:41 + * @Description: + */ +@Data +@NoArgsConstructor +@Accessors(chain = true) +public class MediaItem implements Serializable { + private static final long serialVersionUID = -6679610697837602559L; + /** + * 设备编码 + */ + private String deviceCode; + /** + * 通道编码 + */ + private String channelCode; + /** + * 节点信息ID + */ + private String configId; + /** + * 节点信息ID + */ + private ServerInfo server; + /** + * 节点格式信息 + */ + private List formatList; + /** + * 节点配置信息 + */ + private ServerConfig config; + /** + * 流ID + */ + private String streamId; + /** + * 播放流信息 + */ + private RtpInfoResp rtp; + /** + * Rtp服务监听端口 + */ + private Integer rtpPort; + /** + * SSRC源地址 + */ + private String ssrc; + /** + * rtmp播放地址 + */ + private String rtmpUrl; + /** + * rtmpSsl播放地址 + */ + private String rtmpSslUrl; + /** + * rtsp播放地址 + */ + private String rtspUrl; + /** + * rtspSsl播放地址 + */ + private String rtspSslUrl; + + /** + * rtc流地址 + */ + private String rtc; + + /** + * rtcs流地址 + */ + private String rtcs; + + /** + * 是否缓存 + */ + private Boolean isCache; + + public List getFormatList(String mediaRouter) { + if (StrUtil.isNotBlank(streamId)) { + formatList.forEach(item -> item.generateUrl(server.getApiHost(), streamId, config, mediaRouter)); + } + return formatList; + } + + public String getRtmpUrl() { + if (StrUtil.isBlank(streamId)) { + return ""; + } + return StrUtil.format("rtmp://{}:{}/rtp/{}", server.getApiHost(), config.getRtmpPort(), streamId); + } + + public String getRtmpSslUrl() { + if (StrUtil.isBlank(streamId)) { + return ""; + } + return config.getRtspSslPort() > 0 ? StrUtil.format("rtmps://{}:{}/rtp/{}", server.getApiHost(), config.getRtspSslPort(), streamId) : ""; + } + + + public String getRtspUrl() { + if (StrUtil.isBlank(streamId)) { + return ""; + } + return StrUtil.format("rtsp://{}:{}/rtp/{}", server.getApiHost(), config.getRtspPort(), streamId); + } + + public String getRtspSslUrl() { + if (StrUtil.isBlank(streamId)) { + return ""; + } + return config.getRtspSslPort() > 0 ? StrUtil.format("rtsps://{}:{}/rtp/{}", server.getApiHost(), config.getRtspSslPort(), streamId) : ""; + } +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/ServerConfig.java b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/ServerConfig.java new file mode 100644 index 0000000..62b51d7 --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/ServerConfig.java @@ -0,0 +1,852 @@ +package com.dite.znpt.monitor.media.zlm.dto; + +import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.annotation.JSONField; +import com.dite.znpt.monitor.media.zlm.config.StreamMediaServerConfig; +import com.dite.znpt.monitor.media.zlm.dto.req.BaseReq; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + * @Author: huise23 + * @Date: 2022/8/29 10:54 + * @Description: 服务器配置 + */ +@EqualsAndHashCode(callSuper = true) +@Data +@Accessors(chain = true) +public class ServerConfig extends BaseReq { + // ----------------------------------------------- api ----------------------------------------------- + /** + * 是否调试http api,启用调试后,会打印每次http请求的内容和回复 + * apiDebug=1 + */ + @JSONField(name = "api.apiDebug") + private Integer apiDebug; + /** + * 一些比较敏感的http api在访问时需要提供secret,否则无权限调用 + * 如果是通过127.0.0.1访问,那么可以不提供secret + * secret=035c73f7-bb6b-4889-a715-d9eb2d1925cc + */ + @JSONField(name = "api.secret") + private String apiSecret; + /** + * 截图保存路径根目录,截图通过http api(/index/api/getSnap)生成和获取 + * snapRoot=./www/snap/ + */ + @JSONField(name = "api.snapRoot") + private String apiSnapRoot; + /** + * 默认截图图片,在启动FFmpeg截图后但是截图还未生成时,可以返回默认的预设图片 + * defaultSnap=./www/logo.png + */ + @JSONField(name = "api.defaultSnap") + private String apiDefaultSnap; + // ----------------------------------------------- ffmpeg ----------------------------------------------- + /** + * FFmpeg可执行程序路径,支持相对路径/绝对路径 + * bin=/usr/bin/ffmpeg + */ + @JSONField(name = "ffmpeg.bin") + private String ffmpegBin; + /** + * FFmpeg拉流再推流的命令模板,通过该模板可以设置再编码的一些参数 + * cmd=%s -re -i %s -c:a aac -strict -2 -ar 44100 -ab 48k -c:v libx264 -f flv %s + */ + @JSONField(name = "ffmpeg.cmd") + private String ffmpegCmd; + /** + * FFmpeg生成截图的命令,可以通过修改该配置改变截图分辨率或质量 + * snap=%s -i %s -y -f mjpeg -t 0.001 %s + */ + @JSONField(name = "ffmpeg.snap") + private String ffmpegSnap; + /** + * FFmpeg日志的路径,如果置空则不生成FFmpeg日志 + * 可以为相对(相对于本可执行程序目录)或绝对路径 + * log=./ffmpeg/ffmpeg.log + */ + @JSONField(name = "ffmpeg.log") + private String ffmpegLog; + /** + * 自动重启的时间(秒), 默认为0, 也就是不自动重启. 主要是为了避免长时间ffmpeg拉流导致的不同步现象 + * restart_sec=0 + */ + @JSONField(name = "ffmpeg.restart_sec") + private String ffmpegRestartSec; + // ----------------------------------------------- general ----------------------------------------------- + /** + * 是否启用虚拟主机 + * enableVhost=0 + */ + @JSONField(name = "general.enableVhost") + private Integer enableVhost; + /** + * 播放器或推流器在断开后会触发hook.on_flow_report事件(使用多少流量事件), + * flowThreshold参数控制触发hook.on_flow_report事件阈值,使用流量超过该阈值后才触发,单位KB + * flowThreshold=1024 + */ + @JSONField(name = "general.flowThreshold") + private Integer generalFlowThreshold; + /** + * 播放最多等待时间,单位毫秒 + * 播放在播放某个流时,如果该流不存在, + * ZLMediaKit会最多让播放器等待maxStreamWaitMS毫秒 + * 如果在这个时间内,该流注册成功,那么会立即返回播放器播放成功 + * 否则返回播放器未找到该流,该机制的目的是可以先播放再推流 + * maxStreamWaitMS=15000 + */ + @JSONField(name = "general.maxStreamWaitMS") + private Integer generalMaxStreamWaitMs; + /** + * 某个流无人观看时,触发hook.on_stream_none_reader事件的最大等待时间,单位毫秒 + * 在配合hook.on_stream_none_reader事件时,可以做到无人观看自动停止拉流或停止接收推流 + * streamNoneReaderDelayMS=20000 + */ + @JSONField(name = "general.streamNoneReaderDelayMS") + private Integer generalStreamNoneReaderDelayMs; + /** + * 是否全局添加静音aac音频,转协议时有效 + * 有些播放器在打开单视频流时不能秒开,添加静音音频可以加快秒开速度 + * addMuteAudio=1 + */ + @JSONField(name = "general.addMuteAudio") + private Integer generalAddMuteAudio; + /** + * 拉流代理时如果断流再重连成功是否删除前一次的媒体流数据,如果删除将重新开始, + * 如果不删除将会接着上一次的数据继续写(录制hls/mp4时会继续在前一个文件后面写) + * resetWhenRePlay=1 + */ + @JSONField(name = "general.resetWhenRePlay") + private Integer generalResetWhenRePlay; + /** + * 是否默认推流时转换成hls,hook接口(on_publish)中可以覆盖该设置 + * publishToHls=1 + */ + @JSONField(name = "general.publishToHls") + private Integer generalPublishToHls; + /** + * 是否默认推流时mp4录像,hook接口(on_publish)中可以覆盖该设置 + * publishToMP4=0 + */ + @JSONField(name = "general.publishToMP4") + private Integer generalPublishToMP4; + /** + * 合并写缓存大小(单位毫秒),合并写指服务器缓存一定的数据后才会一次性写入socket,这样能提高性能,但是会提高延时 + * 开启后会同时关闭TCP_NODELAY并开启MSG_MORE + * mergeWriteMS=0 + */ + @JSONField(name = "general.mergeWriteMS") + private Integer generalMergeWriteMS; + /** + * 全局的时间戳覆盖开关,在转协议时,对frame进行时间戳覆盖 + * 该开关对rtsp/rtmp/rtp推流、rtsp/rtmp/hls拉流代理转协议时生效 + * 会直接影响rtsp/rtmp/hls/mp4/flv等协议的时间戳 + * 同协议情况下不影响(例如rtsp/rtmp推流,那么播放rtsp/rtmp时不会影响时间戳) + * modifyStamp=0 + */ + @JSONField(name = "general.modifyStamp") + private Integer generalModifyStamp; + /** + * 服务器唯一id,用于触发hook时区别是哪台服务器 + * mediaServerId=your_server_id + */ + @JSONField(name = "general.mediaServerId") + private String generalMediaServerId; + /** + * 转协议是否全局开启或关闭音频 + * enable_audio=1 + */ + @JSONField(name = "general.enable_audio") + private Integer generalEnableAudio; + // ###### 以下是按需转协议的开关,在测试ZLMediaKit的接收推流性能时,请把下面开关置1 + // ###### 如果某种协议你用不到,你可以把以下开关置1以便节省资源(但是还是可以播放,只是第一个播放者体验稍微差点), + // ###### 如果某种协议你想获取最好的用户体验,请置0(第一个播放者可以秒开,且不花屏) + /** + * hls协议是否按需生成,如果hls.segNum配置为0(意味着hls录制),那么hls将一直生成(不管此开关) + * hls_demand=0 + */ + @JSONField(name = "general.hls_demand") + private Integer generalHlsDemand; + /** + * rtsp[s]协议是否按需生成 + * rtsp_demand=0 + */ + @JSONField(name = "general.rtsp_demand") + private Integer generalRtspDemand; + /** + * rtmp[s]、http[s]-flv、ws[s]-flv协议是否按需生成 + * rtmp_demand=0 + */ + @JSONField(name = "general.rtmp_demand") + private Integer generalRtmpDemand; + /** + * http[s]-ts协议是否按需生成 + * ts_demand=0 + */ + @JSONField(name = "general.ts_demand") + private Integer generalTsDemand; + /** + * http[s]-fmp4、ws[s]-fmp4协议是否按需生成 + * fmp4_demand=0 + */ + @JSONField(name = "general.fmp4_demand") + private Integer generalFmp4Demand; + /** + * 最多等待未初始化的Track时间,单位毫秒,超时之后会忽略未初始化的Track + * wait_track_ready_ms=10000 + */ + @JSONField(name = "general.wait_track_ready_ms") + private Integer generalWaitTrackReadyMs; + /** + * 如果流只有单Track,最多等待若干毫秒,超时后未收到其他Track的数据,则认为是单Track + * 如果协议元数据有声明特定track数,那么无此等待时间 + * wait_add_track_ms=3000 + */ + @JSONField(name = "general.wait_add_track_ms") + private Integer generalWaitAddTrackMs; + /** + * 如果track未就绪,我们先缓存帧数据,但是有最大个数限制,防止内存溢出 + * unready_frame_cache=100 + */ + @JSONField(name = "general.unready_frame_cache") + private Integer generalUnreadyFrameCache; + /** + * 推流断开后可以在超时时间内重新连接上继续推流,这样播放器会接着播放。 + * 置0关闭此特性(推流断开会导致立即断开播放器) + * 此参数不应大于播放器超时时间 + * continue_push_ms=15000 + */ + @JSONField(name = "general.continue_push_ms") + private Integer generalContinuePushMs; + // ----------------------------------------------- hls ----------------------------------------------- + /** + * hls写文件的buf大小,调整参数可以提高文件io性能 + * fileBufSize=65536 + */ + @JSONField(name = "hls.fileBufSize") + private Integer hlsFileBufSize; + /** + * hls保存文件路径 + * 可以为相对(相对于本可执行程序目录)或绝对路径 + * filePath=./www + */ + @JSONField(name = "hls.filePath") + private String hlsFilePath; + /** + * hls最大切片时间 + * segDur=2 + */ + @JSONField(name = "hls.segDur") + private Integer hlsSegDur; + /** + * m3u8索引中,hls保留切片个数(实际保留切片个数大2~3个) + * 如果设置为0,则不删除切片,而是保存为点播 + * segNum=3 + */ + @JSONField(name = "hls.segNum") + private Integer hlsSegNum; + /** + * HLS切片从m3u8文件中移除后,继续保留在磁盘上的个数 + * segRetain=5 + */ + @JSONField(name = "hls.segRetain") + private Integer hlsSegRetain; + /** + * 是否广播 ts 切片完成通知 + * broadcastRecordTs=0 + */ + @JSONField(name = "hls.broadcastRecordTs") + private Integer hlsBroadcastRecordTs; + /** + * 直播hls文件删除延时,单位秒,issue: #913 + * deleteDelaySec=0 + */ + @JSONField(name = "hls.deleteDelaySec") + private Integer hlsDeleteDelaySec; + /** + * 是否保留hls文件,此功能部分等效于segNum=0的情况 + * 不同的是这个保留不会在m3u8文件中体现 + * 0为不保留,不起作用 + * 1为保留,则不删除hls文件,如果开启此功能,注意磁盘大小,或者定期手动清理hls文件 + * segKeep=0 + */ + @JSONField(name = "hls.segKeep") + private Integer hlsSegKeep; + // ----------------------------------------------- hook ----------------------------------------------- + /** + * 在推流时,如果url参数匹对admin_params,那么可以不经过hook鉴权直接推流成功,播放时亦然 + * 该配置项的目的是为了开发者自己调试测试,该参数暴露后会有泄露隐私的安全隐患 + * admin_params=secret=035c73f7-bb6b-4889-a715-d9eb2d1925cc + */ + @JSONField(name = "hook.admin_params") + private String hookAdminParams; + /** + * 是否启用hook事件,启用后,推拉流都将进行鉴权 + * enable=0 + */ + @JSONField(name = "hook.enable") + private Integer hookHookEnable; + /** + * 播放器或推流器使用流量事件,置空则关闭 + * on_flow_report=https://127.0.0.1/index/hook/on_flow_report + */ + @JSONField(name = "hook.on_flow_report") + private String hookOnFlowReport; + /** + * 访问http文件鉴权事件,置空则关闭鉴权 + * on_http_access=https://127.0.0.1/index/hook/on_http_access + */ + @JSONField(name = "hook.on_http_access") + private String hookOnHttpAccess; + /** + * 播放鉴权事件,置空则关闭鉴权 + * on_play=https://127.0.0.1/index/hook/on_play + */ + @JSONField(name = "hook.on_play") + private String hookOnPlay; + /** + * 推流鉴权事件,置空则关闭鉴权 + * on_publish=https://127.0.0.1/index/hook/on_publish + */ + @JSONField(name = "hook.on_publish") + private String hookOnPublish; + /** + * 录制mp4切片完成事件 + * on_record_mp4=https://127.0.0.1/index/hook/on_record_mp4 + */ + @JSONField(name = "hook.on_record_mp4") + private String hookOnRecordMp4; + /** + * 录制 hls ts 切片完成事件 + * on_record_ts=https://127.0.0.1/index/hook/on_record_ts + */ + @JSONField(name = "hook.on_record_ts") + private String hookOnRecordTs; + /** + * rtsp播放鉴权事件,此事件中比对rtsp的用户名密码 + * on_rtsp_auth=https://127.0.0.1/index/hook/on_rtsp_auth + */ + @JSONField(name = "hook.on_rtsp_auth") + private String hookOnRtspAuth; + /** + * rtsp播放是否开启专属鉴权事件,置空则关闭rtsp鉴权。rtsp播放鉴权还支持url方式鉴权 + * 建议开发者统一采用url参数方式鉴权,rtsp用户名密码鉴权一般在设备上用的比较多 + * 开启rtsp专属鉴权后,将不再触发on_play鉴权事件 + * on_rtsp_realm=https://127.0.0.1/index/hook/on_rtsp_realm + */ + @JSONField(name = "hook.on_rtsp_realm") + private String hookOnRtspRealm; + /** + * 远程telnet调试鉴权事件 + * on_shell_login=https://127.0.0.1/index/hook/on_shell_login + */ + @JSONField(name = "hook.on_shell_login") + private String hookOnShellLogin; + /** + * 直播流注册或注销事件 + * on_stream_changed=https://127.0.0.1/index/hook/on_stream_changed + */ + @JSONField(name = "hook.on_stream_changed") + private String hookOnStreamChanged; + /** + * 服务器启动报告,可以用于服务器的崩溃重启事件监听 + * on_server_started=https://127.0.0.1/index/hook/on_server_started + */ + @JSONField(name = "hook.on_server_started") + private String hookOnServerStarted; + /** + * server保活上报 + * on_server_keepalive=https://127.0.0.1/index/hook/on_server_keepalive + */ + @JSONField(name = "hook.on_server_keepalive") + private String hookOnServerKeepalive; + /** + * 无人观看流事件,通过该事件,可以选择是否关闭无人观看的流。配合general.streamNoneReaderDelayMS选项一起使用 + * on_stream_none_reader=https://127.0.0.1/index/hook/on_stream_none_reader + */ + @JSONField(name = "hook.on_stream_none_reader") + private String hookOnStreamNoneReader; + /** + * 播放时,未找到流事件,通过配合hook.on_stream_none_reader事件可以完成按需拉流 + * on_stream_not_found=https://127.0.0.1/index/hook/on_stream_not_found + */ + @JSONField(name = "hook.on_stream_not_found") + private String hookOnStreamNotFound; + /** + * 发送rtp(startSendRtp)被动关闭时回调 + * on_send_rtp_stopped=https://127.0.0.1/index/hook/on_send_rtp_stopped + */ + @JSONField(name = "hook.on_send_rtp_stopped") + private String hookOnSendRtpStopped; + /** + * hook api最大等待回复时间,单位秒 + * timeoutSec=10 + */ + @JSONField(name = "hook.timeoutSec") + private Integer hookTimeoutSec; + /** + * keepalive hook触发间隔,单位秒,float类型 + * alive_interval=10.0 + */ + @JSONField(name = "hook.alive_interval") + private Float hookAliveInterval; + /** + * hook通知失败重试次数,正整数。为0不重试,1时重试一次,以此类推 + * retry=1 + */ + @JSONField(name = "hook.retry") + private Integer hookRetry; + /** + * hook通知失败重试延时,单位秒,float型 + * retry_delay=3.0 + */ + @JSONField(name = "hook.retry_delay") + private Float hookRetryDelay; + // ----------------------------------------------- cluster ----------------------------------------------- + /** + * 设置源站拉流url模板, 格式跟printf类似,第一个%s指定app,第二个%s指定stream_id, + * 开启集群模式后,on_stream_not_found和on_stream_none_reader hook将无效. + * 溯源模式支持以下类型: + * rtmp方式: rtmp://127.0.0.1:1935/%s/%s + * rtsp方式: rtsp://127.0.0.1:554/%s/%s + * hls方式: http://127.0.0.1:80/%s/%s/hls.m3u8 + * http-ts方式: http://127.0.0.1:80/%s/%s.live.ts + * 支持多个源站,不同源站通过分号(;)分隔 + * origin_url= + */ + @JSONField(name = "cluster.origin_url") + private String clusterOriginUrl; + /** + * 溯源总超时时长,单位秒,float型;假如源站有3个,那么单次溯源超时时间为timeout_sec除以3 + * 单次溯源超时时间不要超过general.maxStreamWaitMS配置 + * timeout_sec=15 + */ + @JSONField(name = "cluster.timeout_sec") + private Integer clusterTimeoutSec; + /** + * 溯源失败尝试次数,-1时永久尝试 + * retry_count=3 + */ + @JSONField(name = "cluster.retry_count") + private Integer clusterRetryCount; + // ----------------------------------------------- http ----------------------------------------------- + /** + * http服务器字符编码,windows上默认gb2312 + * charSet=utf-8 + */ + @JSONField(name = "http.charSet") + private String httpCharSet; + /** + * http链接超时时间 + * keepAliveSecond=30 + */ + @JSONField(name = "http.keepAliveSecond") + private Integer httpKeepAliveSecond; + /** + * http请求体最大字节数,如果post的body太大,则不适合缓存body在内存 + * maxReqSize=40960 + */ + @JSONField(name = "http.maxReqSize") + private Integer httpMaxReqSize; + /** + * 404网页内容,用户可以自定义404网页 + * notFound=404 Not Found

您访问的资源不存在!


ZLMediaKit-4.0
+ */ + @JSONField(name = "http.notFound") + private String httpNotFound; + /** + * http服务器监听端口 + * port=80 + */ + @JSONField(name = "http.port") + private Integer httpPort; + /** + * http文件服务器根目录 + * 可以为相对(相对于本可执行程序目录)或绝对路径 + * rootPath=./www + */ + @JSONField(name = "http.rootPath") + private String httpRootPath; + /** + * http文件服务器读文件缓存大小,单位BYTE,调整该参数可以优化文件io性能 + * sendBufSize=65536 + */ + @JSONField(name = "http.sendBufSize") + private Integer httpSendBufSize; + /** + * https服务器监听端口 + * sslport=443 + */ + @JSONField(name = "http.sslport") + private Integer httpSslPort; + /** + * 是否显示文件夹菜单,开启后可以浏览文件夹 + * dirMenu=1 + */ + @JSONField(name = "http.dirMenu") + private Integer httpDirMenu; + /** + * 虚拟目录, 虚拟目录名和文件路径使用","隔开,多个配置路径间用";"隔开 + * 例如赋值为 app_a,/path/to/a;app_b,/path/to/b 那么 + * 访问 http://127.0.0.1/app_a/file_a 对应的文件路径为 /path/to/a/file_a + * 访问 http://127.0.0.1/app_b/file_b 对应的文件路径为 /path/to/b/file_b + * 访问其他http路径,对应的文件路径还是在rootPath内 + * virtualPath= + */ + @JSONField(name = "http.virtualPath") + private String httpVirtualPath; + /** + * 禁止后缀的文件使用mmap缓存,使用“,”隔开 + * 例如赋值为 .mp4,.flv + * 那么访问后缀为.mp4与.flv 的文件不缓存 + * forbidCacheSuffix= + */ + @JSONField(name = "http.forbidCacheSuffix") + private String httpForbidCacheSuffix; + /** + * 可以把http代理前真实客户端ip放在http头中:https://github.com/ZLMediaKit/ZLMediaKit/issues/1388 + * 切勿暴露此key,否则可能导致伪造客户端ip + * forwarded_ip_header= + */ + @JSONField(name = "http.forwarded_ip_header") + private String httpForwardedIpHeader; + // ----------------------------------------------- multicast ----------------------------------------------- + /** + * rtp组播截止组播ip地址 + * addrMax=239.255.255.255 + */ + @JSONField(name = "multicast.addrMax") + private String multicastAddrMax; + /** + * rtp组播起始组播ip地址 + * addrMin=239.0.0.0 + */ + @JSONField(name = "multicast.addrMin") + private String multicastAddrMin; + /** + * 组播udp ttl + * udpTTL=64 + */ + @JSONField(name = "multicast.udpTTL") + private Integer multicastUdpTtl; + // ----------------------------------------------- record ----------------------------------------------- + /** + * mp4录制或mp4点播的应用名,通过限制应用名,可以防止随意点播 + * 点播的文件必须放置在此文件夹下 + * appName=record + */ + @JSONField(name = "record.appName") + private String recordAppName; + /** + * mp4录制写文件缓存,单位BYTE,调整参数可以提高文件io性能 + * fileBufSize=65536 + */ + @JSONField(name = "record.fileBufSize") + private Integer recordFileBufSize; + /** + * mp4录制保存、mp4点播根路径 + * 可以为相对(相对于本可执行程序目录)或绝对路径 + * filePath=./www + */ + @JSONField(name = "record.filePath") + private String recordFilePath; + /** + * mp4录制切片时间,单位秒 + * fileSecond=3600 + */ + @JSONField(name = "record.fileSecond") + private Integer recordFileSecond; + /** + * mp4点播每次流化数据量,单位毫秒, + * 减少该值可以让点播数据发送量更平滑,增大该值则更节省cpu资源 + * sampleMS=500 + */ + @JSONField(name = "record.sampleMS") + private Integer recordSampleMs; + /** + * mp4录制完成后是否进行二次关键帧索引写入头部 + * fastStart=0 + */ + @JSONField(name = "record.fastStart") + private Integer recordFastStart; + /** + * MP4点播(rtsp/rtmp/http-flv/ws-flv)是否循环播放文件 + * fileRepeat=0 + */ + @JSONField(name = "record.fileRepeat") + private Integer recordFileRepeat; + /** + * MP4录制是否当做播放器参与播放人数统计 + * mp4_as_player=0 + */ + @JSONField(name = "record.mp4_as_player") + private Integer recordMp4AsPlayer; + // ----------------------------------------------- rtmp ----------------------------------------------- + /** + * rtmp必须在此时间内完成握手,否则服务器会断开链接,单位秒 + * handshakeSecond=15 + */ + @JSONField(name = "rtmp.handshakeSecond") + private Integer rtmpHandshakeSecond; + /** + * rtmp超时时间,如果该时间内未收到客户端的数据, + * 或者tcp发送缓存超过这个时间,则会断开连接,单位秒 + * keepAliveSecond=15 + */ + @JSONField(name = "rtmp.keepAliveSecond") + private Integer rtmpKeepAliveSecond; + /** + * 在接收rtmp推流时,是否重新生成时间戳(很多推流器的时间戳着实很烂) + * modifyStamp=0 + */ + @JSONField(name = "rtmp.modifyStamp") + private Integer rtmpModifyStamp; + /** + * rtmp服务器监听端口 + * port=1935 + */ + @JSONField(name = "rtmp.port") + private Integer rtmpPort = 0; + /** + * rtmps服务器监听地址 + * sslport=0 + */ + @JSONField(name = "rtmp.sslport") + private Integer rtmpSslPort = 0; + // ----------------------------------------------- rtp ----------------------------------------------- + /** + * 音频mtu大小,该参数限制rtp最大字节数,推荐不要超过1400 + * 加大该值会明显增加直播延时 + * audioMtuSize=600 + */ + @JSONField(name = "rtp.audioMtuSize") + private Integer rtpAudioMtuSize; + /** + * 视频mtu大小,该参数限制rtp最大字节数,推荐不要超过1400 + * videoMtuSize=1400 + */ + @JSONField(name = "rtp.videoMtuSize") + private Integer rtpVideoMtuSize; + /** + * rtp包最大长度限制,单位KB,主要用于识别TCP上下文破坏时,获取到错误的rtp + * rtpMaxSize=10 + */ + @JSONField(name = "rtp.rtpMaxSize") + private Integer rtpMaxSize; + // ----------------------------------------------- rtp_proxy ----------------------------------------------- + /** + * 导出调试数据(包括rtp/ps/h264)至该目录,置空则关闭数据导出 + * dumpDir= + */ + @JSONField(name = "rtp_proxy.dumpDir") + private String proxyDumpDir; + /** + * udp和tcp代理服务器,支持rtp(必须是ts或ps类型)代理 + * port=10000 + */ + @JSONField(name = "rtp_proxy.port") + private Integer proxyPort; + /** + * rtp超时时间,单位秒 + * timeoutSec=15 + */ + @JSONField(name = "rtp_proxy.timeoutSec") + private Integer proxyTimeoutSec; + /** + * 随机端口范围,最少确保36个端口 + * 该范围同时限制rtsp服务器udp端口范围 + * port_range=30000-35000 + */ + @JSONField(name = "rtp_proxy.port_range") + private String proxyPortRange; + /** + * rtp h264 负载的pt + * h264_pt=98 + */ + @JSONField(name = "rtp_proxy.h264_pt") + private Integer proxyH264Pt; + /** + * rtp h265 负载的pt + * h265_pt=99 + */ + @JSONField(name = "rtp_proxy.h265_pt") + private Integer proxyH265Pt; + /** + * rtp ps 负载的pt + * ps_pt=96 + */ + @JSONField(name = "rtp_proxy.ps_pt") + private Integer proxyPsPt; + /** + * rtp ts 负载的pt + * ts_pt=33 + */ + @JSONField(name = "rtp_proxy.ts_pt") + private Integer proxyTsPt; + /** + * rtp opus 负载的pt + * opus_pt=100 + */ + @JSONField(name = "rtp_proxy.opus_pt") + private Integer proxyOpusPt; + /** + * rtp g711u 负载的pt + * g711u_pt=0 + */ + @JSONField(name = "rtp_proxy.g711u_pt") + private Integer proxyG711UPt; + /** + * rtp g711a 负载的pt + * g711a_pt=8 + */ + @JSONField(name = "rtp_proxy.g711a_pt") + private Integer proxyG711APt; + // ----------------------------------------------- rtc ----------------------------------------------- + /** + * rtc播放推流、播放超时时间 + * timeoutSec=15 + */ + @JSONField(name = "rtc.timeoutSec") + private Integer rtcTimeoutSec; + /** + * 本机对rtc客户端的可见ip,作为服务器时一般为公网ip,可有多个,用','分开,当置空时,会自动获取网卡ip + * 同时支持环境变量,以$开头,如"$EXTERN_IP"; 请参考:https://github.com/ZLMediaKit/ZLMediaKit/pull/1786 + * externIP= + */ + @JSONField(name = "rtc.externIP") + private String rtcExternIp; + /** + * rtc udp服务器监听端口号,所有rtc客户端将通过该端口传输stun/dtls/srtp/srtcp数据, + * 该端口是多线程的,同时支持客户端网络切换导致的连接迁移 + * 需要注意的是,如果服务器在nat内,需要做端口映射时,必须确保外网映射端口跟该端口一致 + * port=8000 + */ + @JSONField(name = "rtc.port") + private Integer rtcPort; + /** + * 设置remb比特率,非0时关闭twcc并开启remb。该设置在rtc推流时有效,可以控制推流画质 + * 目前已经实现twcc自动调整码率,关闭remb根据真实网络状况调整码率 + * rembBitRate=0 + */ + @JSONField(name = "rtc.rembBitRate") + private Integer rtcRembBitRate; + /** + * rtc支持的音频codec类型,在前面的优先级更高 + * 以下范例为所有支持的音频codec + * preferredCodecA=PCMU,PCMA,opus,mpeg4-generic + */ + @JSONField(name = "rtc.preferredCodecA") + private String rtcPreferredCodecA; + /** + * rtc支持的视频codec类型,在前面的优先级更高 + * 以下范例为所有支持的视频codec + * preferredCodecV=H264,H265,AV1X,VP9,VP8 + */ + @JSONField(name = "rtc.preferredCodecV") + private String rtcPreferredCodecV; + // ----------------------------------------------- srt ----------------------------------------------- + /** + * srt播放推流、播放超时时间,单位秒 + * timeoutSec=5 + */ + @JSONField(name = "srt.timeoutSec") + private Integer srtTimeoutSec; + /** + * srt udp服务器监听端口号,所有srt客户端将通过该端口传输srt数据, + * 该端口是多线程的,同时支持客户端网络切换导致的连接迁移 + * port=9000 + */ + @JSONField(name = "srt.port") + private Integer srtPort; + /** + * srt 协议中延迟缓存的估算参数,在握手阶段估算rtt ,然后latencyMul*rtt 为最大缓存时长,此参数越大,表示等待重传的时长就越大 + * latencyMul=4 + */ + @JSONField(name = "srt.latencyMul") + private Integer srtLatencyMul; + /** + * 包缓存的大小 + * pktBufSize=8192 + */ + @JSONField(name = "srt.pktBufSize") + private Integer srtPktBufSize; + // ----------------------------------------------- rtsp ----------------------------------------------- + /** + * rtsp专有鉴权方式是采用base64还是md5方式 + * authBasic=0 + */ + @JSONField(name = "rtsp.authBasic") + private Integer rtspAuthBasic; + /** + * rtsp拉流、推流代理是否是直接代理模式 + * 直接代理后支持任意编码格式,但是会导致GOP缓存无法定位到I帧,可能会导致开播花屏 + * 并且如果是tcp方式拉流,如果rtp大于mtu会导致无法使用udp方式代理 + * 假定您的拉流源地址不是264或265或AAC,那么你可以使用直接代理的方式来支持rtsp代理 + * 如果你是rtsp推拉流,但是webrtc播放,也建议关闭直接代理模式, + * 因为直接代理时,rtp中可能没有sps pps,会导致webrtc无法播放; 另外webrtc也不支持Single NAL Unit Packets类型rtp + * 默认开启rtsp直接代理,rtmp由于没有这些问题,是强制开启直接代理的 + * directProxy=1 + */ + @JSONField(name = "rtsp.directProxy") + private Integer rtspDirectProxy; + /** + * rtsp必须在此时间内完成握手,否则服务器会断开链接,单位秒 + * handshakeSecond=15 + */ + @JSONField(name = "rtsp.handshakeSecond") + private Integer rtspHandshakeSecond; + /** + * rtsp超时时间,如果该时间内未收到客户端的数据, + * 或者tcp发送缓存超过这个时间,则会断开连接,单位秒 + * keepAliveSecond=15 + */ + @JSONField(name = "rtsp.keepAliveSecond") + private Integer rtspKeepAliveSecond; + /** + * rtsp服务器监听地址 + * port=554 + */ + @JSONField(name = "rtsp.port") + private Integer rtspPort = 0; + /** + * rtsps服务器监听地址 + * sslport=0 + */ + @JSONField(name = "rtsp.sslport") + private Integer rtspSslPort = 0; + // ----------------------------------------------- shell ----------------------------------------------- + /** + * 调试telnet服务器接受最大bufffer大小 + * maxReqSize=1024 + */ + @JSONField(name = "shell.maxReqSize") + private Integer shellMaxReqSize; + /** + * 调试telnet服务器监听端口 + * port=0 + */ + @JSONField(name = "shell.port") + private Integer shellPort; + + public void refreshHook(String ip, String port, StreamMediaServerConfig server) { + String host = ip + ":" + port; + this.hookOnFlowReport = StrUtil.format("http://{}/index/hook/on_flow_report", host); + this.hookOnHttpAccess = StrUtil.format("http://{}/index/hook/on_http_access", host); + this.hookOnPlay = StrUtil.format("http://{}/index/hook/on_play", host); + this.hookOnPublish = StrUtil.format("http://{}/index/hook/on_publish", host); + this.hookOnRecordMp4 = StrUtil.format("http://{}/index/hook/on_record_mp4", host); + this.hookOnRecordTs = StrUtil.format("http://{}/index/hook/on_record_ts", host); + this.hookOnRtspAuth = StrUtil.format("http://{}/index/hook/on_rtsp_auth", host); + this.hookOnRtspRealm = StrUtil.format("http://{}/index/hook/on_rtsp_realm", host); + this.hookOnShellLogin = StrUtil.format("http://{}/index/hook/on_shell_login", host); + this.hookOnStreamChanged = StrUtil.format("http://{}/index/hook/on_stream_changed", host); + this.hookOnStreamNoneReader = StrUtil.format("http://{}/index/hook/on_stream_none_reader", host); + this.hookOnStreamNotFound = StrUtil.format("http://{}/index/hook/on_stream_not_found", host); + this.hookOnServerStarted = StrUtil.format("http://{}/index/hook/on_server_started", host); + this.hookOnServerKeepalive = StrUtil.format("http://{}/index/hook/on_server_keepalive", host); +// this.hookOnSendRtpStopped = StrUtil.format("http://{}/index/hook/on_send_rtp_stopped", host); + this.hookOnSendRtpStopped = ""; + } +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/ServerInfo.java b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/ServerInfo.java new file mode 100644 index 0000000..143b1fc --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/ServerInfo.java @@ -0,0 +1,30 @@ +package com.dite.znpt.monitor.media.zlm.dto; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @Author: huise23 + * @Date: 2022/8/30 10:50 + * @Description: 节点基础信息 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +public class ServerInfo implements Serializable { + /** + * 节点地址 + */ + private String apiHost; + /** + * 节点端口 + */ + private Integer apiPort; + /** + * 节点秘钥 + */ + private String secretKey; +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/ServerItem.java b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/ServerItem.java new file mode 100644 index 0000000..d590d3f --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/ServerItem.java @@ -0,0 +1,108 @@ +package com.dite.znpt.monitor.media.zlm.dto; + +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.NumberUtil; +import cn.hutool.core.util.StrUtil; +import com.dite.znpt.exception.ServiceException; +import com.dite.znpt.monitor.domain.vo.video.StreamMediaFormat; +import com.dite.znpt.monitor.media.zlm.config.StreamMediaServerConfig; +import com.dite.znpt.monitor.media.zlm.dto.resp.MediaResp; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +/** + * @Author: huise23 + * @Date: 2022/8/30 10:50 + * @Description: 节点信息 + */ +@Data +@NoArgsConstructor +public class ServerItem implements Serializable { + + private static final long serialVersionUID = 2460404295026548536L; + /** + * 播流最大并发个数 + */ + public static final Integer MAX_PLAY_COUNT = 10000; + /** + * 节点信息ID + */ + private String configId; + /** + * 流ID前缀 + */ + private String streamPrefix; + /** + * 节点信息ID + */ + private ServerInfo server; + /** + * 节点格式信息 + */ + private List formatList; + /** + * 节点配置信息 + */ + private ServerConfig config; + /** + * 当前流信息 + */ + private List media; + /** + * 节点状态是否正常 + */ + private Boolean status; + /** + * 流媒体服务器已用的会话句柄 + */ + private Set usedSn; + + public ServerItem(StreamMediaServerConfig server, List formatList) { + this.streamPrefix = server.getStreamPrefix(); + this.server = new ServerInfo(server.getApiHost(), server.getApiPort(), server.getSecretKey()); + this.formatList = formatList; + this.status = false; + this.usedSn = new HashSet<>(); + } + + public String genPlaySsrc(String channelCode) { + if (this.usedSn.size() >= MAX_PLAY_COUNT) { + throw new ServiceException("ssrc已经用完!"); + } + int sn; + for (sn = 0; sn < MAX_PLAY_COUNT; sn++) { + if (!this.usedSn.contains(sn)) { + this.usedSn.add(sn); + break; + } + } + //return StrUtil.format("0{}{}", StrUtil.blankToDefault(streamPrefix, channelCode.substring(3, 8)), NumberUtil.decimalFormat("0000", sn)); + return channelCode; + } + + public void releaseSsrc(String ssrc) { + try { + Integer sn = NumberUtil.parseInt(ssrc.substring(6)); + usedSn.remove(sn); + } catch (Exception ignored) { + } + } + + public void setMedia(List media) { + this.media = media; + if (CollUtil.isNotEmpty(media)) { + media.forEach(item -> { + try { + Integer sn = NumberUtil.parseInt(StrUtil.isBlank(streamPrefix) ? item.getStream().substring(6) : item.getStream().replace("0" + streamPrefix, "")); + usedSn.add(sn); + } catch (Exception ignored) { + } + }); + } + } +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/event/BaseEventReq.java b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/event/BaseEventReq.java new file mode 100644 index 0000000..a4125ae --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/event/BaseEventReq.java @@ -0,0 +1,48 @@ +package com.dite.znpt.monitor.media.zlm.dto.event; + +import lombok.Data; + +/** + * @Author: huise23 + * @Date: 2022/8/30 9:24 + * @Description: + */ +@Data +public class BaseEventReq { + /** + * 服务器id,通过配置文件设置 + */ + private String mediaServerId; + /** + * 流应用名 + */ + private String app; + /** + * TCP链接唯一ID + */ + private String id; + /** + * 播放器ip + */ + private String ip; + /** + * 播放url参数 + */ + private String params; + /** + * 播放器端口号 + */ + private Integer port; + /** + * 播放的协议,可能是rtsp、rtmp、http + */ + private String schema; + /** + * 流ID + */ + private String stream; + /** + * 流虚拟主机 + */ + private String vhost; +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/event/BaseEventResp.java b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/event/BaseEventResp.java new file mode 100644 index 0000000..04b573f --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/event/BaseEventResp.java @@ -0,0 +1,42 @@ +package com.dite.znpt.monitor.media.zlm.dto.event; + +import lombok.Data; +import lombok.experimental.Accessors; + +/** + * @Author: huise23 + * @Date: 2022/8/29 10:33 + * @Description: 请求响应基类 + */ +@Data +@Accessors(chain = true) +public class BaseEventResp { + /** + * code == 0时代表完全成功 + */ + private Integer code; + /** + * 失败提示 + */ + private String msg; + /** + * 失败具体原因 + */ + private String err; + /** + * 该rtsp流是否需要rtsp专有鉴权,空字符串代码不需要鉴权 + */ + private String realm; + /** + * 是否关闭推流或拉流 + */ + private Boolean close; + + public BaseEventResp setSuccess(){ + return this.setCode(0).setMsg("success").setErr(""); + } + + public static BaseEventResp success() { + return new BaseEventResp().setSuccess(); + } +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/event/FlowReportReq.java b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/event/FlowReportReq.java new file mode 100644 index 0000000..1661a94 --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/event/FlowReportReq.java @@ -0,0 +1,26 @@ +package com.dite.znpt.monitor.media.zlm.dto.event; + +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * @Author: huise23 + * @Date: 2022/8/30 9:04 + * @Description: + */ +@EqualsAndHashCode(callSuper = true) +@Data +public class FlowReportReq extends BaseEventReq { + /** + * tcp链接维持时间,单位秒 + */ + private Integer duration; + /** + * true为播放器,false为推流器 + */ + private Boolean player; + /** + * 耗费上下行流量总和,单位字节 + */ + private Integer totalBytes; +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/event/HttpAccessReq.java b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/event/HttpAccessReq.java new file mode 100644 index 0000000..dfae6d6 --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/event/HttpAccessReq.java @@ -0,0 +1,29 @@ +package com.dite.znpt.monitor.media.zlm.dto.event; + +import cn.hutool.core.lang.Dict; +import com.alibaba.fastjson.annotation.JSONField; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * @Author: huise23 + * @Date: 2022/8/30 9:10 + * @Description: + */ +@EqualsAndHashCode(callSuper = true) +@Data +public class HttpAccessReq extends BaseEventReq { + /** + * http客户端请求header + */ + private Dict header; + /** + * 访问路径是文件还是目录 + */ + @JSONField(name = "is_dir") + private Boolean isDir; + /** + * 请求访问的文件或目录 + */ + private String path; +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/event/HttpAccessResp.java b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/event/HttpAccessResp.java new file mode 100644 index 0000000..51424d8 --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/event/HttpAccessResp.java @@ -0,0 +1,34 @@ +package com.dite.znpt.monitor.media.zlm.dto.event; + +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + * @Author: huise23 + * @Date: 2022/8/30 9:15 + * @Description: + */ +@EqualsAndHashCode(callSuper = true) +@Data +@Accessors(chain = true) +public class HttpAccessResp extends BaseEventResp { + /** + * 该客户端能访问或被禁止的顶端目录,如果为空字符串,则表述为当前目录 + */ + private String path; + /** + * 本次授权结果的有效期,单位秒 + */ + private Integer second; + /** + * 服务器id,通过配置文件设置 + */ + private String mediaServerId; + + public static HttpAccessResp success() { + HttpAccessResp resp = new HttpAccessResp(); + resp.setSuccess(); + return resp.setSecond(600).setPath(""); + } +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/event/PlayReq.java b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/event/PlayReq.java new file mode 100644 index 0000000..2531052 --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/event/PlayReq.java @@ -0,0 +1,14 @@ +package com.dite.znpt.monitor.media.zlm.dto.event; + +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * @Author: huise23 + * @Date: 2022/8/30 9:19 + * @Description: + */ +@EqualsAndHashCode(callSuper = true) +@Data +public class PlayReq extends BaseEventReq { +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/event/PublishReq.java b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/event/PublishReq.java new file mode 100644 index 0000000..de324dc --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/event/PublishReq.java @@ -0,0 +1,14 @@ +package com.dite.znpt.monitor.media.zlm.dto.event; + +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * @Author: huise23 + * @Date: 2022/8/30 9:57 + * @Description: + */ +@EqualsAndHashCode(callSuper = true) +@Data +public class PublishReq extends BaseEventReq{ +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/event/PublishResp.java b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/event/PublishResp.java new file mode 100644 index 0000000..f16d943 --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/event/PublishResp.java @@ -0,0 +1,81 @@ +package com.dite.znpt.monitor.media.zlm.dto.event; + +import com.alibaba.fastjson.annotation.JSONField; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * @Author: huise23 + * @Date: 2022/8/30 9:27 + * @Description: + */ +@EqualsAndHashCode(callSuper = true) +@Data +public class PublishResp extends BaseEventResp { + /** + * 是否转换成hls协议 + */ + @JSONField(name = "enable_hls") + private Boolean enableHls; + /** + * 是否允许mp4录制 + */ + @JSONField(name = "enable_mp4") + private Boolean enableMp4; + /** + * 是否转rtsp协议 + */ + @JSONField(name = "enable_rtsp") + private Boolean enableRtsp; + /** + * 是否转rtmp/flv协议 + */ + @JSONField(name = "enable_rtmp") + private Boolean enableRtmp; + /** + * 是否转http-ts/ws-ts协议 + */ + @JSONField(name = "enable_ts") + private Boolean enableTs; + /** + * 是否转http-fmp4/ws-fmp4协议 + */ + @JSONField(name = "enable_fmp4") + private Boolean enableFmp4; + /** + * 转协议时是否开启音频 + */ + @JSONField(name = "enable_audio") + private Boolean enableAudio; + /** + * 转协议时,无音频是否添加静音aac音频 + */ + @JSONField(name = "add_mute_audio") + private Boolean addMuteAudio; + /** + * mp4录制文件保存根目录,置空使用默认 + */ + @JSONField(name = "mp4_save_path") + private String mp4SavePath; + /** + * mp4录制切片大小,单位秒 + */ + @JSONField(name = "mp4_max_second") + private Integer mp4MaxSecond; + /** + * hls文件保存保存根目录,置空使用默认 + */ + @JSONField(name = "hls_save_path") + private String hlsSavePath; + /** + * 断连续推延时,单位毫秒,置空使用配置文件默认值 + */ + @JSONField(name = "continue_push_ms") + private Long continuePushMs; + + public static PublishResp success() { + PublishResp resp = new PublishResp(); + resp.setSuccess(); + return resp; + } +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/event/RecordMp4Req.java b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/event/RecordMp4Req.java new file mode 100644 index 0000000..50142ec --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/event/RecordMp4Req.java @@ -0,0 +1,48 @@ +package com.dite.znpt.monitor.media.zlm.dto.event; + +import com.alibaba.fastjson.annotation.JSONField; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * @Author: huise23 + * @Date: 2022/8/30 9:32 + * @Description: + */ +@EqualsAndHashCode(callSuper = true) +@Data +public class RecordMp4Req extends BaseEventReq { + /** + * 文件名 + */ + @JSONField(name = "file_name") + private String fileName; + /** + * 文件绝对路径 + */ + @JSONField(name = "file_path") + private String filePath; + /** + * 文件大小,单位字节 + */ + @JSONField(name = "file_size") + private Integer fileSize; + /** + * 文件所在目录路径 + */ + private String folder; + /** + * 开始录制时间戳 + */ + @JSONField(name = "start_time") + private Integer startTime; + /** + * 录制时长,单位秒 + */ + @JSONField(name = "time_len") + private Integer timeLen; + /** + * http/rtsp/rtmp点播相对url路径 + */ + private String url; +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/event/RtspAuthReq.java b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/event/RtspAuthReq.java new file mode 100644 index 0000000..bcb51e5 --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/event/RtspAuthReq.java @@ -0,0 +1,30 @@ +package com.dite.znpt.monitor.media.zlm.dto.event; + +import com.alibaba.fastjson.annotation.JSONField; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * @Author: huise23 + * @Date: 2022/8/30 9:35 + * @Description: + */ +@EqualsAndHashCode(callSuper = true) +@Data +public class RtspAuthReq extends BaseEventReq { + /** + * 请求的密码是否必须为明文(base64鉴权需要明文密码) + */ + @JSONField(name = "must_no_encrypt") + private Boolean mustNoEncrypt; + /** + * rtsp播放鉴权加密realm + */ + private String realm; + /** + * 播放用户名 + */ + @JSONField(name = "user_name") + private String userName; + +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/event/RtspAuthResp.java b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/event/RtspAuthResp.java new file mode 100644 index 0000000..2021549 --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/event/RtspAuthResp.java @@ -0,0 +1,30 @@ +package com.dite.znpt.monitor.media.zlm.dto.event; + +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + * @Author: huise23 + * @Date: 2022/8/30 9:35 + * @Description: + */ +@EqualsAndHashCode(callSuper = true) +@Data +@Accessors(chain = true) +public class RtspAuthResp extends BaseEventResp { + /** + * 用户密码 + */ + private String passwd; + /** + * 用户密码是否已加密 + */ + private Boolean encrypted; + + public static RtspAuthResp success() { + RtspAuthResp resp = new RtspAuthResp(); + resp.setSuccess(); + return resp.setEncrypted(false); + } +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/event/RtspRealmReq.java b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/event/RtspRealmReq.java new file mode 100644 index 0000000..8d6547f --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/event/RtspRealmReq.java @@ -0,0 +1,14 @@ +package com.dite.znpt.monitor.media.zlm.dto.event; + +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * @Author: huise23 + * @Date: 2022/8/30 9:33 + * @Description: + */ +@EqualsAndHashCode(callSuper = true) +@Data +public class RtspRealmReq extends BaseEventReq { +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/event/ServerKeepaliveReq.java b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/event/ServerKeepaliveReq.java new file mode 100644 index 0000000..d023328 --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/event/ServerKeepaliveReq.java @@ -0,0 +1,16 @@ +package com.dite.znpt.monitor.media.zlm.dto.event; + +import com.dite.znpt.monitor.media.zlm.dto.resp.StatisticResp; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * @Author: huise23 + * @Date: 2022/8/30 9:43 + * @Description: + */ +@EqualsAndHashCode(callSuper = true) +@Data +public class ServerKeepaliveReq extends BaseEventReq { + private StatisticResp data; +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/event/ShellLoginReq.java b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/event/ShellLoginReq.java new file mode 100644 index 0000000..86016eb --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/event/ShellLoginReq.java @@ -0,0 +1,24 @@ +package com.dite.znpt.monitor.media.zlm.dto.event; + +import com.alibaba.fastjson.annotation.JSONField; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * @Author: huise23 + * @Date: 2022/8/30 9:37 + * @Description: + */ +@EqualsAndHashCode(callSuper = true) +@Data +public class ShellLoginReq extends BaseEventReq { + /** + * 终端登录用户密码 + */ + private String passwd; + /** + * 终端登录用户名 + */ + @JSONField(name = "user_name") + private String userName; +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/event/StreamChangedReq.java b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/event/StreamChangedReq.java new file mode 100644 index 0000000..cd90632 --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/event/StreamChangedReq.java @@ -0,0 +1,19 @@ +package com.dite.znpt.monitor.media.zlm.dto.event; + +import com.dite.znpt.monitor.media.zlm.dto.resp.MediaResp; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * @Author: huise23 + * @Date: 2022/8/30 9:38 + * @Description: + */ +@EqualsAndHashCode(callSuper = true) +@Data +public class StreamChangedReq extends MediaResp { + /** + * 流注册或注销 + */ + private Boolean regist; +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/event/StreamNoneReaderReq.java b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/event/StreamNoneReaderReq.java new file mode 100644 index 0000000..65e34bf --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/event/StreamNoneReaderReq.java @@ -0,0 +1,14 @@ +package com.dite.znpt.monitor.media.zlm.dto.event; + +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * @Author: huise23 + * @Date: 2022/8/30 9:40 + * @Description: + */ +@EqualsAndHashCode(callSuper = true) +@Data +public class StreamNoneReaderReq extends BaseEventReq { +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/event/StreamNotFoundReq.java b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/event/StreamNotFoundReq.java new file mode 100644 index 0000000..0ead9cc --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/event/StreamNotFoundReq.java @@ -0,0 +1,14 @@ +package com.dite.znpt.monitor.media.zlm.dto.event; + +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * @Author: huise23 + * @Date: 2022/8/30 9:42 + * @Description: + */ +@EqualsAndHashCode(callSuper = true) +@Data +public class StreamNotFoundReq extends BaseEventReq { +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/req/BaseReq.java b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/req/BaseReq.java new file mode 100644 index 0000000..445aef0 --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/req/BaseReq.java @@ -0,0 +1,18 @@ +package com.dite.znpt.monitor.media.zlm.dto.req; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author: huise23 + * @Date: 2022/8/29 10:33 + * @Description: 请求响应基类 + */ +@Data +public class BaseReq implements Serializable { + /** + * api操作密钥(配置文件配置),如果操作ip是127.0.0.1,则不需要此参数 + */ + private String secret; +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/req/CloseStreamReq.java b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/req/CloseStreamReq.java new file mode 100644 index 0000000..2eb3044 --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/req/CloseStreamReq.java @@ -0,0 +1,18 @@ +package com.dite.znpt.monitor.media.zlm.dto.req; + +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * @Author: huise23 + * @Date: 2022/8/29 10:51 + * @Description: + */ +@EqualsAndHashCode(callSuper = true) +@Data +public class CloseStreamReq extends StreamReq { + /** + * 是否强制关闭(有人在观看是否还关闭) + */ + private Integer force; +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/req/FFmpegSourceReq.java b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/req/FFmpegSourceReq.java new file mode 100644 index 0000000..54de5d0 --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/req/FFmpegSourceReq.java @@ -0,0 +1,45 @@ +package com.dite.znpt.monitor.media.zlm.dto.req; + +import com.alibaba.fastjson.annotation.JSONField; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * @Author: huise23 + * @Date: 2022/8/29 12:26 + * @Description: + */ +@EqualsAndHashCode(callSuper = true) +@Data +public class FFmpegSourceReq extends BaseReq { + /** + * FFmpeg拉流地址,支持任意协议或格式(只要FFmpeg支持即可) + */ + @JSONField(name = "src_url") + private String srcUrl; + /** + * FFmpeg rtmp推流地址,一般都是推给自己,例如rtmp://127.0.0.1/live/stream_form_ffmpeg + */ + @JSONField(name = "dst_url") + private String dstUrl; + /** + * FFmpeg推流成功超时时间 + */ + @JSONField(name = "timeout_ms") + private Integer timeoutMs; + /** + * 是否开启hls录制 + */ + @JSONField(name = "enable_hls") + private Integer enableHls; + /** + * 是否开启mp4录制 + */ + @JSONField(name = "enable_mp4") + private Integer enableMp4; + /** + * 配置文件中FFmpeg命令参数模板key(非内容),置空则采用默认模板:ffmpeg.cmd + */ + @JSONField(name = "ffmpeg_cmd_key") + private String ffmpegCmdKey; +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/req/GetAllSessionReq.java b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/req/GetAllSessionReq.java new file mode 100644 index 0000000..dd01aa5 --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/req/GetAllSessionReq.java @@ -0,0 +1,25 @@ +package com.dite.znpt.monitor.media.zlm.dto.req; + +import com.alibaba.fastjson.annotation.JSONField; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * @Author: huise23 + * @Date: 2022/8/29 17:21 + * @Description: + */ +@EqualsAndHashCode(callSuper = true) +@Data +public class GetAllSessionReq extends BaseReq{ + /** + *筛选本机端口,例如筛选rtsp链接:554 + */ + @JSONField(name = "local_port") + private Integer localPort; + /** + *筛选客户端ip + */ + @JSONField(name = "peer_ip") + private String peerIp; +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/req/GetMp4RecordFileReq.java b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/req/GetMp4RecordFileReq.java new file mode 100644 index 0000000..6b05d35 --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/req/GetMp4RecordFileReq.java @@ -0,0 +1,24 @@ +package com.dite.znpt.monitor.media.zlm.dto.req; + +import com.alibaba.fastjson.annotation.JSONField; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * @Author: huise23 + * @Date: 2022/8/29 13:04 + * @Description: + */ +@EqualsAndHashCode(callSuper = true) +@Data +public class GetMp4RecordFileReq extends StreamReq { + /** + * 流的录像日期,格式为2020-02-01,如果不是完整的日期,那么是搜索录像文件夹列表,否则搜索对应日期下的mp4文件列表 + */ + private String period; + /** + * 自定义搜索路径,与startRecord方法中的customized_path一样,默认为配置文件的路径 + */ + @JSONField(name = "customized_path") + private String customizedPath; +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/req/IdReq.java b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/req/IdReq.java new file mode 100644 index 0000000..82c454d --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/req/IdReq.java @@ -0,0 +1,20 @@ +package com.dite.znpt.monitor.media.zlm.dto.req; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * @Author: huise23 + * @Date: 2022/8/29 17:24 + * @Description: + */ +@EqualsAndHashCode(callSuper = true) +@Data +@AllArgsConstructor +public class IdReq extends BaseReq { + /** + * 客户端唯一id,可以通过getAllSession接口获取 + */ + private Long id; +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/req/KeyReq.java b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/req/KeyReq.java new file mode 100644 index 0000000..91ebcd9 --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/req/KeyReq.java @@ -0,0 +1,20 @@ +package com.dite.znpt.monitor.media.zlm.dto.req; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * @Author: huise23 + * @Date: 2022/8/29 17:30 + * @Description: + */ +@EqualsAndHashCode(callSuper = true) +@Data +@AllArgsConstructor +public class KeyReq extends BaseReq { + /** + * addStreamProxy接口返回的key + */ + private String key; +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/req/RecordReq.java b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/req/RecordReq.java new file mode 100644 index 0000000..4e3dc21 --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/req/RecordReq.java @@ -0,0 +1,29 @@ +package com.dite.znpt.monitor.media.zlm.dto.req; + +import com.alibaba.fastjson.annotation.JSONField; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * @Author: huise23 + * @Date: 2022/8/29 13:11 + * @Description: + */ +@EqualsAndHashCode(callSuper = true) +@Data +public class RecordReq extends StreamReq { + /** + * 0为hls,1为mp4 + */ + private Integer type; + /** + * 录像保存目录 + */ + @JSONField(name = "customized_path") + private String customizedPath; + /** + * mp4录像切片时间大小,单位秒,置0则采用配置项 + */ + @JSONField(name = "max_second") + private Integer maxSecond; +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/req/RtpServerReq.java b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/req/RtpServerReq.java new file mode 100644 index 0000000..a7003e7 --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/req/RtpServerReq.java @@ -0,0 +1,45 @@ +package com.dite.znpt.monitor.media.zlm.dto.req; + +import com.alibaba.fastjson.annotation.JSONField; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; + +/** + * @Author: huise23 + * @Date: 2022/8/29 13:17 + * @Description: + */ +@EqualsAndHashCode(callSuper = true) +@Data +@NoArgsConstructor +public class RtpServerReq extends BaseReq { + /** + * 接收端口,0则为随机端口 + */ + private Integer port; + /** + * 启用UDP监听的同时是否监听TCP端口 + */ + @JSONField(name = "enable_tcp") + private Integer enableTcp; + /** + * 该端口绑定的流ID,该端口只能创建这一个流(而不是根据ssrc创建多个) + */ + @JSONField(name = "stream_id") + private String streamId; + + public RtpServerReq(Integer port, Integer enableTcp, String streamId) { + this.port = port; + this.enableTcp = enableTcp; + this.streamId = streamId; + } + + public RtpServerReq(Integer enableTcp, String streamId) { + this(0, enableTcp, streamId); + } + + public RtpServerReq(String streamId) { + this(1, streamId); + } +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/req/SendRtpReq.java b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/req/SendRtpReq.java new file mode 100644 index 0000000..20807df --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/req/SendRtpReq.java @@ -0,0 +1,53 @@ +package com.dite.znpt.monitor.media.zlm.dto.req; + +import com.alibaba.fastjson.annotation.JSONField; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * @Author: huise23 + * @Date: 2022/8/29 13:23 + * @Description: + */ +@EqualsAndHashCode(callSuper = true) +@Data +public class SendRtpReq extends StreamReq { + /** + * 推流的rtp的ssrc,指定不同的ssrc可以同时推流到多个服务器 + */ + private String ssrc; + /** + * 目标ip或域名 + */ + @JSONField(name = "dst_url") + private String dstUrl; + /** + * 目标端口 + */ + @JSONField(name = "dst_port") + private Integer dstPort; + /** + * 是否为udp模式,否则为tcp模式 + */ + @JSONField(name = "is_udp") + private Integer isUdp; + /** + * 使用的本机端口,为0或不传时默认为随机端口 + */ + @JSONField(name = "src_port") + private Integer srcPort; + /** + * 使用的本机端口,为0或不传时默认为随机端口 + */ + private Integer pt; + /** + * 发送时,rtp的负载类型。为1时,负载为ps;为0时,为es;不传时默认为1 + */ + @JSONField(name = "use_ps") + private Integer usePs; + /** + * 当use_ps 为0时,有效。为1时,发送音频;为0时,发送视频;不传时默认为0 + */ + @JSONField(name = "only_audio") + private Integer onlyAudio; +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/req/SnapReq.java b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/req/SnapReq.java new file mode 100644 index 0000000..548cfd7 --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/req/SnapReq.java @@ -0,0 +1,29 @@ +package com.dite.znpt.monitor.media.zlm.dto.req; + +import com.alibaba.fastjson.annotation.JSONField; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * @Author: huise23 + * @Date: 2022/8/29 13:14 + * @Description: + */ +@EqualsAndHashCode(callSuper = true) +@Data +public class SnapReq extends BaseReq { + /** + * 需要截图的url,可以是本机的,也可以是远程主机的 + */ + private String url; + /** + * 截图失败超时时间,防止FFmpeg一直等待截图 + */ + @JSONField(name = "timeout_sec") + private Integer timeoutSec; + /** + * 截图的过期时间,该时间内产生的截图都会作为缓存返回 + */ + @JSONField(name = "expire_sec") + private Integer expireSec; +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/req/StreamIdReq.java b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/req/StreamIdReq.java new file mode 100644 index 0000000..a53d2dc --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/req/StreamIdReq.java @@ -0,0 +1,22 @@ +package com.dite.znpt.monitor.media.zlm.dto.req; + +import com.alibaba.fastjson.annotation.JSONField; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * @Author: huise23 + * @Date: 2022/8/29 17:30 + * @Description: + */ +@EqualsAndHashCode(callSuper = true) +@Data +@AllArgsConstructor +public class StreamIdReq extends BaseReq { + /** + * RTP的ssrc,16进制字符串或者是流的id(openRtpServer接口指定) + */ + @JSONField(name = "stream_id") + private String streamId; +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/req/StreamProxyReq.java b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/req/StreamProxyReq.java new file mode 100644 index 0000000..8481f0a --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/req/StreamProxyReq.java @@ -0,0 +1,89 @@ +package com.dite.znpt.monitor.media.zlm.dto.req; + +import com.alibaba.fastjson.annotation.JSONField; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * @Author: huise23 + * @Date: 2022/8/29 12:19 + * @Description: + */ +@EqualsAndHashCode(callSuper = true) +@Data +public class StreamProxyReq extends StreamReq { + /** + * 拉流地址,例如rtmp://live.hkstv.hk.lxdns.com/live/hks2 Y + */ + private String url; + /** + * 拉流重试次数,默认为-1无限重试 + */ + @JSONField(name = "retry_count") + private Integer retryCount; + /** + * rtsp拉流时,拉流方式,0:tcp,1:udp,2:组播 + */ + @JSONField(name = "rtp_type") + private Integer rtpType; + /** + * 拉流超时时间,单位秒,float类型 + */ + @JSONField(name = "timeout_sec") + private Integer timeoutSec; + /** + * 是否转换成hls协议 + */ + @JSONField(name = "enable_hls") + private Integer enableHls; + /** + * 是否允许mp4录制 + */ + @JSONField(name = "enable_mp4") + private Integer enableMp4; + /** + * 是否转rtsp协议 + */ + @JSONField(name = "enable_rtsp") + private Integer enableRtsp; + /** + * 是否转rtmp/flv协议 + */ + @JSONField(name = "enable_rtmp") + private Integer enableRtmp; + /** + * 是否转http-ts/ws-ts协议 + */ + @JSONField(name = "enable_ts") + private Integer enableTs; + /** + * 是否转http-fmp4/ws-fmp4协议 + */ + @JSONField(name = "enable_fmp4") + private Integer enableFmp4; + /** + * 转协议时是否开启音频 + */ + @JSONField(name = "enable_audio") + private Integer enableAudio; + /** + * 转协议时,无音频是否添加静音aac音频 + */ + @JSONField(name = "add_mute_audio") + private Integer addMuteAudio; + /** + * mp4录制文件保存根目录,置空使用默认 + */ + @JSONField(name = "mp4_save_path") + private String mp4SavePath; + /** + * mp4录制切片大小,单位秒 + */ + @JSONField(name = "mp4_max_second") + private Integer mp4MaxSecond; + /** + * hls文件保存保存根目录,置空使用默认 + */ + @JSONField(name = "hls_save_path") + private String hlsSavePath; +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/req/StreamPusherProxyReq.java b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/req/StreamPusherProxyReq.java new file mode 100644 index 0000000..6729ba1 --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/req/StreamPusherProxyReq.java @@ -0,0 +1,35 @@ +package com.dite.znpt.monitor.media.zlm.dto.req; + +import com.alibaba.fastjson.annotation.JSONField; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * @Author: huise23 + * @Date: 2022/8/29 13:50 + * @Description: + */ +@EqualsAndHashCode(callSuper = true) +@Data +public class StreamPusherProxyReq extends StreamReq { + /** + * 目标转推url,带参数需要自行url转义 + */ + @JSONField(name = "dst_url") + private String dstUrl; + /** + * 转推失败重试次数,默认无限重试 + */ + @JSONField(name = "retry_count") + private Integer retryCount; + /** + * rtsp拉流时,拉流方式,0:tcp,1:udp,2:组播 + */ + @JSONField(name = "rtp_type") + private Integer rtpType; + /** + * 拉流超时时间,单位秒,float类型 + */ + @JSONField(name = "timeout_sec") + private Float timeoutSec; +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/req/StreamReq.java b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/req/StreamReq.java new file mode 100644 index 0000000..404369a --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/req/StreamReq.java @@ -0,0 +1,32 @@ +package com.dite.znpt.monitor.media.zlm.dto.req; + +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + * @Author: huise23 + * @Date: 2022/8/29 13:05 + * @Description: + */ +@EqualsAndHashCode(callSuper = true) +@Data +@Accessors(chain = true) +public class StreamReq extends BaseReq { + /** + * 协议,例如 rtsp或rtmp + */ + private String schema; + /** + * 筛选虚拟主机,例如__defaultVhost__ + */ + private String vhost; + /** + * 筛选应用名,例如 live + */ + private String app; + /** + * 筛选流id,例如 test + */ + private String stream; +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/resp/BaseResp.java b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/resp/BaseResp.java new file mode 100644 index 0000000..d6cfa48 --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/resp/BaseResp.java @@ -0,0 +1,64 @@ +package com.dite.znpt.monitor.media.zlm.dto.resp; + +import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.JSON; +import lombok.Data; + +import java.util.List; + +/** + * @Author: huise23 + * @Date: 2022/8/29 10:33 + * @Description: 请求响应基类 + */ +@Data +public class BaseResp { + /** + * code == 0时代表完全成功 + */ + private Integer code; + /** + * 失败提示 + */ + private String msg; + /** + * 失败具体原因 + */ + private String result; + /** + * 返回数据 + */ + private String data; + /** + * 配置项变更个数 + */ + private Integer changed; + /** + * false:未录制,true:正在录制 + */ + private Boolean status; + /** + * 接收端口,方便获取随机端口号 + */ + private Integer port; + /** + * 是否找到记录并关闭 + */ + private Integer hit; + + public String getMsg() { + return StrUtil.format("{}:{}", code, msg); + } + + public Boolean isSuccess() { + return code == 0; + } + + public T getData(Class clazz) { + return JSON.parseObject(data, clazz); + } + + public List getList(Class clazz) { + return JSON.parseArray(data, clazz); + } +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/resp/CloseStreamResp.java b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/resp/CloseStreamResp.java new file mode 100644 index 0000000..aa0bf8e --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/resp/CloseStreamResp.java @@ -0,0 +1,25 @@ +package com.dite.znpt.monitor.media.zlm.dto.resp; + +import com.alibaba.fastjson.annotation.JSONField; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * @Author: huise23 + * @Date: 2022/8/29 11:59 + * @Description: + */ +@EqualsAndHashCode(callSuper = true) +@Data +public class CloseStreamResp extends BaseResp { + /** + * 筛选命中的流个数 + */ + @JSONField(name = "count_hit") + private Integer countHit; + /** + * 被关闭的流个数,可能小于count_hit + */ + @JSONField(name = "count_closed") + private Integer countClosed; +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/resp/MediaResp.java b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/resp/MediaResp.java new file mode 100644 index 0000000..942b099 --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/resp/MediaResp.java @@ -0,0 +1,61 @@ +package com.dite.znpt.monitor.media.zlm.dto.resp; + +import com.dite.znpt.monitor.media.zlm.dto.event.BaseEventReq; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; +import java.util.List; + +/** + * @Author: huise23 + * @Date: 2022/8/29 11:18 + * @Description: + */ +@EqualsAndHashCode(callSuper = true) +@Data +public class MediaResp extends BaseEventReq implements Serializable { + private static final long serialVersionUID = -8710934021370904914L; + + /** + * 本协议观看人数 + */ + private Integer readerCount; + /** + * 观看总人数,包括hls/rtsp/rtmp/http-flv/ws-flv + */ + private Integer totalReaderCount; + /** + * 客户端和服务器网络信息,可能为null类型 + */ + private OriginSock originSock; + /** + * 产生源类型,包括 unknown = 0, rtmp_push = 1, rtsp_push = 2, rtp_push = 3, pull = 4, ffmpeg_pull = 5, mp4_vod = 6, device_chn = 7 + */ + private Integer originType; + /** + * 产生源类型 + */ + private String originTypeStr; + /** + * 产生源的url + */ + private String originUrl; + /** + * GMT unix系统时间戳,单位秒 + */ + private Long createStamp; + /** + * 存活时间,单位秒 + */ + private Long aliveSecond; + /** + * 数据产生速度,单位byte/s + */ + private Long bytesSpeed; + /** + * 音视频轨道 + */ + private List tracks; + +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/resp/Mp4RecordFileResp.java b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/resp/Mp4RecordFileResp.java new file mode 100644 index 0000000..f39ea4f --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/resp/Mp4RecordFileResp.java @@ -0,0 +1,23 @@ +package com.dite.znpt.monitor.media.zlm.dto.resp; + +import lombok.Data; + +import java.util.List; + +/** + * @Author: huise23 + * @Date: 2022/8/29 13:08 + * @Description: + */ +@Data +public class Mp4RecordFileResp { + /** + * 文件列表 + */ + private List paths; + /** + * 根路径 + */ + private String rootPath; +} + diff --git a/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/resp/OriginSock.java b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/resp/OriginSock.java new file mode 100644 index 0000000..5ca64f3 --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/resp/OriginSock.java @@ -0,0 +1,26 @@ +package com.dite.znpt.monitor.media.zlm.dto.resp; + +import com.alibaba.fastjson.annotation.JSONField; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author: huise23 + * @Date: 2022/8/29 11:20 + * @Description: + */ +@Data +public class OriginSock implements Serializable { + private static final long serialVersionUID = 5628294142872524316L; + + private String identifier; + @JSONField(name = "local_ip") + private String localIp; + @JSONField(name = "local_port") + private Integer localPort; + @JSONField(name = "peer_ip") + private String peerIp; + @JSONField(name = "peer_port") + private Integer peerPort; +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/resp/RtpInfoResp.java b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/resp/RtpInfoResp.java new file mode 100644 index 0000000..b8654a5 --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/resp/RtpInfoResp.java @@ -0,0 +1,39 @@ +package com.dite.znpt.monitor.media.zlm.dto.resp; + +import com.alibaba.fastjson.annotation.JSONField; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * @Author: huise23 + * @Date: 2022/8/29 12:32 + * @Description: + */ +@EqualsAndHashCode(callSuper = true) +@Data +public class RtpInfoResp extends BaseResp { + /** + * 是否存在 + */ + private Boolean exist; + /** + * 推流客户端ip + */ + @JSONField(name = "peer_ip") + private String peerIp; + /** + * 客户端端口号 + */ + @JSONField(name = "peer_port") + private Integer peerPort; + /** + * 本地监听的网卡ip + */ + @JSONField(name = "local_ip") + private String localIp; + /** + * 本地监听端口号 + */ + @JSONField(name = "local_port") + private Integer localPort; +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/resp/RtpServerResp.java b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/resp/RtpServerResp.java new file mode 100644 index 0000000..1a5267f --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/resp/RtpServerResp.java @@ -0,0 +1,22 @@ +package com.dite.znpt.monitor.media.zlm.dto.resp; + +import com.alibaba.fastjson.annotation.JSONField; +import lombok.Data; + +/** + * @Author: huise23 + * @Date: 2022/8/29 13:22 + * @Description: + */ +@Data +public class RtpServerResp { + /** + * 绑定的端口号 + */ + private Integer port; + /** + * 绑定的流ID + */ + @JSONField(name = "stream_id") + private String streamId; +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/resp/SessionResp.java b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/resp/SessionResp.java new file mode 100644 index 0000000..eaf6119 --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/resp/SessionResp.java @@ -0,0 +1,41 @@ +package com.dite.znpt.monitor.media.zlm.dto.resp; + +import com.alibaba.fastjson.annotation.JSONField; +import lombok.Data; + +/** + * @Author: huise23 + * @Date: 2022/8/29 12:04 + * @Description: + */ +@Data +public class SessionResp { + /** + * 该tcp链接唯一id + */ + private Long id; + /** + * 本机网卡ip + */ + @JSONField(name = "local_ip") + private String localIp; + /** + * 本机端口号 (这是个rtmp播放器或推流器) + */ + @JSONField(name = "local_port") + private Integer localPort; + /** + * 客户端ip + */ + @JSONField(name = "peer_ip") + private String peerIp; + /** + * 客户端端口号 + */ + @JSONField(name = "peer_port") + private Integer peerPort; + /** + * 客户端TCPSession typeid + */ + private String typeid; +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/resp/StatisticResp.java b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/resp/StatisticResp.java new file mode 100644 index 0000000..f464784 --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/resp/StatisticResp.java @@ -0,0 +1,28 @@ +package com.dite.znpt.monitor.media.zlm.dto.resp; + +import lombok.Data; + +/** + * @Author: huise23 + * @Date: 2022/8/29 13:47 + * @Description: + */ +@Data +public class StatisticResp { + private Integer Buffer; + private Integer BufferLikeString; + private Integer BufferList; + private Integer BufferRaw; + private Integer Frame; + private Integer FrameImp; + private Integer MediaSource; + private Integer MultiMediaSourceMuxer; + private Integer RtmpPacket; + private Integer RtpPacket; + private Integer Socket; + private Integer TcpClient; + private Integer TcpServer; + private Integer TcpSession; + private Integer UdpServer; + private Integer UdpSession; +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/resp/ThreadsLoadResp.java b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/resp/ThreadsLoadResp.java new file mode 100644 index 0000000..9c0257e --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/resp/ThreadsLoadResp.java @@ -0,0 +1,22 @@ +package com.dite.znpt.monitor.media.zlm.dto.resp; + +import lombok.Data; + + + +/** + * @Author: huise23 + * @Date: 2022/8/29 10:40 + * @Description: 各epoll(或select)线程负载以及延时 + */ +@Data +public class ThreadsLoadResp { + /** + * 该线程延时 + */ + private Integer delay; + /** + * 该线程负载 + */ + private Integer load; +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/resp/Track.java b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/resp/Track.java new file mode 100644 index 0000000..e7307aa --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/dto/resp/Track.java @@ -0,0 +1,61 @@ +package com.dite.znpt.monitor.media.zlm.dto.resp; + +import com.alibaba.fastjson.annotation.JSONField; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author: huise23 + * @Date: 2022/8/29 11:25 + * @Description: + */ +@Data +public class Track implements Serializable { + private static final long serialVersionUID = 5317048895056912057L; + /** + * 音频通道数 + */ + private Integer channels; + /** + * H264 = 0, H265 = 1, AAC = 2, G711A = 3, G711U = 4 + */ + @JSONField(name = "codec_id") + private Integer codecId; + /** + * 编码类型名称 + */ + @JSONField(name = "codec_id_name") + private String codecIdName; + /** + * Video = 0, Audio = 1 + */ + @JSONField(name = "codec_type") + private Integer codecType; + /** + * 轨道是否准备就绪 + */ + private Boolean ready; + /** + * 音频采样位数 + */ + @JSONField(name = "sample_bit") + private Integer sampleBit; + /** + * 音频采样率 + */ + @JSONField(name = "sample_rate") + private Integer sampleRate; + /** + * 视频fps + */ + private Integer fps; + /** + * 视频高 + */ + private Integer height; + /** + * 视频宽 + */ + private Integer width; +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/media/zlm/enums/MediaFormatType.java b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/enums/MediaFormatType.java new file mode 100644 index 0000000..215715c --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/enums/MediaFormatType.java @@ -0,0 +1,43 @@ +package com.dite.znpt.monitor.media.zlm.enums; + +import lombok.Getter; + +/** + * @Author: huise23 + * @Date: 2022/8/31 10:29 + * @Description: + */ +@Getter +public enum MediaFormatType { + /** + * FLV + */ + flv(".live.flv"), + /** + * MP4 + */ + mp4(".live.mp4"), + /** + * HLS + */ + hls("/hls.m3u8"), + /** + * RTS + */ + rts(".live.ts"); + + private final String suffix; + + MediaFormatType(String suffix) { + this.suffix = suffix; + } + + public static String getSuffix(String name) { + for (MediaFormatType value : MediaFormatType.values()) { + if (value.name().equals(name)) { + return value.getSuffix(); + } + } + return ""; + } +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/media/zlm/impl/ZlmApiImpl.java b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/impl/ZlmApiImpl.java new file mode 100644 index 0000000..f1e20ce --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/impl/ZlmApiImpl.java @@ -0,0 +1,223 @@ +package com.dite.znpt.monitor.media.zlm.impl; + +import cn.hutool.core.lang.Dict; +import cn.hutool.core.util.BooleanUtil; +import cn.hutool.core.util.StrUtil; +import cn.hutool.http.HttpUtil; +import com.alibaba.fastjson.JSON; +import com.dite.znpt.monitor.media.zlm.ZlmApi; +import com.dite.znpt.monitor.media.zlm.dto.ServerConfig; +import com.dite.znpt.monitor.media.zlm.dto.ServerInfo; +import com.dite.znpt.monitor.media.zlm.dto.req.*; +import com.dite.znpt.monitor.media.zlm.dto.resp.*; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.List; + +/** + * @Author: huise23 + * @Date: 2022/8/29 10:22 + * @Description: + */ +@Service +@Slf4j +@RequiredArgsConstructor(onConstructor = @__(@Autowired)) +public class ZlmApiImpl implements ZlmApi { + private final HttpServletResponse response; + + public V post(ServerInfo server, String url, T req, Class clazz) { + url = StrUtil.format("http://{}:{}/index/api/{}", server.getApiHost(), server.getApiPort(), url); + log.info("ZLM:" + url); + log.info("REQ:" + req); + req.setSecret(server.getSecretKey()); + String respStr = HttpUtil.post(url, JSON.toJSONString(req)); + V resp = JSON.parseObject(respStr, clazz); + if (resp.isSuccess()) { + return resp; + } + throw new RuntimeException(resp.getMsg()); + } + + public BaseResp post(ServerInfo server, String url, T req) { + return post(server, url, req, BaseResp.class); + } + + public V post(ServerInfo server, String url, Class clazz) { + return post(server, url, new BaseReq(), clazz); + } + + public BaseResp post(ServerInfo server, String url) { + return post(server, url, new BaseReq()); + } + + @Override + public List getApiList(ServerInfo server) { + return post(server, "getApiList").getList(String.class); + } + + @Override + public List getThreadsLoad(ServerInfo server) { + return post(server, "getThreadsLoad").getList(ThreadsLoadResp.class); + } + + @Override + public List getWorkThreadsLoad(ServerInfo server) { + return post(server, "getWorkThreadsLoad").getList(ThreadsLoadResp.class); + } + + @Override + public List getServerConfig(ServerInfo server) { + return post(server, "getServerConfig").getList(ServerConfig.class); + } + +// public static void main(String[] args) { +// ZlmApi zlmApi = new ZlmApiImpl(null); +// ServerInfo server = new ServerInfo("10.12.1.41", 8819, "035c73f7-bb6b-4889-a715-d9eb2d1925cc"); +// List config = zlmApi.getMediaList(server,new StreamReq()); +// System.out.println(JSONUtil.toJsonPrettyStr(config)); +// for (MediaResp mediaResp : config) { +// zlmApi.closeRtpServer(server,mediaResp.getStream() ); +// } +// } + + @Override + public Integer setServerConfig(ServerInfo server, ServerConfig config) { + BaseResp req = post(server, "setServerConfig", config); + return req.getChanged(); + } + + @Override + public Boolean restartServer(ServerInfo server) { + BaseResp req = post(server, "restartServer"); + return req.isSuccess(); + } + + @Override + public List getMediaList(ServerInfo server, StreamReq req) { + return post(server, "getMediaList", req).getList(MediaResp.class); + } + + @Override + public CloseStreamResp closeStreams(ServerInfo server, CloseStreamReq req) { + return post(server, "close_streams", req, CloseStreamResp.class); + } + + @Override + public List getAllSession(ServerInfo server, GetAllSessionReq req) { + return post(server, "getAllSession", req).getList(SessionResp.class); + } + + @Override + public Boolean kickSession(ServerInfo server, Long id) { + return post(server, "kick_session", new IdReq(id)).isSuccess(); + } + + @Override + public Integer kickSession(ServerInfo server, GetAllSessionReq req) { + return post(server, "kick_sessions", req, CloseStreamResp.class).getCountHit(); + } + + @Override + public String addStreamProxy(ServerInfo server, StreamProxyReq req) { + return post(server, "addStreamProxy", req).getData(Dict.class).getStr("key"); + } + + @Override + public Boolean delStreamProxy(ServerInfo server, String key) { + return post(server, "delStreamProxy", new KeyReq(key)).getData(Dict.class).getBool("flag"); + } + + @Override + public String addFfMpegSource(ServerInfo server, FFmpegSourceReq req) { + return post(server, "addFFmpegSource", req).getData(Dict.class).getStr("key"); + } + + @Override + public Boolean delFfMpegSource(ServerInfo server, String key) { + return post(server, "delFFmpegSource", new KeyReq(key)).getData(Dict.class).getBool("flag"); + } + + @Override + public RtpInfoResp getRtpInfo(ServerInfo server, String streamId) { + return post(server, "getRtpInfo", new StreamIdReq(streamId), RtpInfoResp.class); + } + + @Override + public Mp4RecordFileResp getMp4RecordFile(ServerInfo server, GetMp4RecordFileReq req) { + return post(server, "getMp4RecordFile", req).getData(Mp4RecordFileResp.class); + } + + @Override + public Boolean startRecord(ServerInfo server, RecordReq req) { + return BooleanUtil.toBoolean(post(server, "startRecord", req).getResult()); + } + + @Override + public Boolean stopRecord(ServerInfo server, RecordReq req) { + return BooleanUtil.toBoolean(post(server, "stopRecord", req).getResult()); + } + + @Override + public Boolean isRecording(ServerInfo server, RecordReq req) { + return post(server, "isRecording", req).getStatus(); + } + + @Override + public void getSnap(ServerInfo server, SnapReq req) throws IOException { + String url = StrUtil.format("http://{}:{}/index/api/getSnap", server.getApiHost(), server.getApiPort()); + req.setSecret(server.getSecretKey()); + url += "?" + HttpUtil.toParams(JSON.parseObject(JSON.toJSONString(req))); + HttpUtil.download(url, response.getOutputStream(), true); + } + + @Override + public Integer openRtpServer(ServerInfo server, RtpServerReq req) { + return post(server, "openRtpServer", req).getPort(); + } + + @Override + public Boolean closeRtpServer(ServerInfo server, String streamId) { + BaseResp closeRtpServer = post(server, "closeRtpServer", new StreamIdReq(streamId)); + return closeRtpServer.getHit() == 1; + } + + @Override + public List listRtpServer(ServerInfo server) { + return post(server, "listRtpServer").getList(RtpServerResp.class); + } + + @Override + public Integer startSendRtp(ServerInfo server, SendRtpReq req) { + return post(server, "startSendRtp", req, RtpInfoResp.class).getLocalPort(); + } + + @Override + public Integer startSendRtpPassive(ServerInfo server, SendRtpReq req) { + return post(server, "startSendRtpPassive", req, RtpInfoResp.class).getLocalPort(); + } + + @Override + public Boolean stopSendRtp(ServerInfo server, SendRtpReq req) { + return post(server, "stopSendRtp", req).isSuccess(); + } + + @Override + public StatisticResp getStatistic(ServerInfo server) { + return post(server, "getStatistic").getData(StatisticResp.class); + } + + @Override + public String addStreamPusherProxy(ServerInfo server, StreamPusherProxyReq req) { + return post(server, "addStreamPusherProxy", req).getData(Dict.class).getStr("key"); + } + + @Override + public Boolean delStreamPusherProxy(ServerInfo server, String key) { + return post(server, "delStreamPusherProxy", new KeyReq(key)).getData(Dict.class).getBool("flag"); + } +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/media/zlm/impl/ZlmHookService.java b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/impl/ZlmHookService.java new file mode 100644 index 0000000..2bc7a2e --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/impl/ZlmHookService.java @@ -0,0 +1,132 @@ +package com.dite.znpt.monitor.media.zlm.impl; + +import com.dite.znpt.monitor.media.zlm.ZlmService; +import com.dite.znpt.monitor.media.zlm.dto.ServerConfig; +import com.dite.znpt.monitor.media.zlm.dto.event.*; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * @Author: huise23 + * @Date: 2022/8/30 10:32 + * @Description: + */ +@Service +@Slf4j +@RequiredArgsConstructor(onConstructor = @__(@Autowired)) +public class ZlmHookService { + private final ZlmService zlmService; + + /** + * TODO 流量统计事件,播放器或推流器断开时并且耗用流量超过特定阈值时会触发此事件, + * 阈值通过配置文件general.flowThreshold配置;此事件对回复不敏感。 + */ + public BaseEventResp onFlowReport(FlowReportReq req) { + log.debug("[ZLM] onFlowReport : {}", req); + return BaseEventResp.success(); + } + + /** + * TODO 访问http文件服务器上hls之外的文件时触发。 + */ + public HttpAccessResp onHttpAccess(HttpAccessReq req) { + log.debug("[ZLM] onHttpAccess : {}", req); + return HttpAccessResp.success(); + } + + /** + * TODO 播放器鉴权事件,rtsp/rtmp/http-flv/ws-flv/hls的播放都将触发此鉴权事件; + * 如果流不存在,那么先触发on_play事件然后触发on_stream_not_found事件。 + * 播放rtsp流时,如果该流启动了rtsp专属鉴权(on_rtsp_realm)那么将不再触发on_play事件。 + */ + public BaseEventResp onPlay(PlayReq req) { + log.debug("[ZLM] onPlay : {}", req); + return BaseEventResp.success(); + } + + /** + * TODO rtsp/rtmp/rtp推流鉴权事件。 + */ + public PublishResp onPublish(PublishReq req) { + System.out.println("[ZLM] 接收到推流信息"); + log.info("[ZLM] onPublish : {}", req); + return PublishResp.success(); + } + + /** + * TODO 录制mp4完成后通知事件;此事件对回复不敏感。 + */ + public BaseEventResp onRecordMp4(RecordMp4Req req) { + log.debug("[ZLM] onRecordMp4 : {}", req); + return BaseEventResp.success(); + } + + /** + * TODO 该rtsp流是否开启rtsp专用方式的鉴权事件,开启后才会触发on_rtsp_auth事件。 + * 需要指出的是rtsp也支持url参数鉴权,它支持两种方式鉴权。 + */ + public BaseEventResp onRtspRealm(RtspRealmReq req) { + log.debug("[ZLM] onRtspRealm : {}", req); + return BaseEventResp.success(); + } + + /** + * TODO rtsp专用的鉴权事件,先触发on_rtsp_realm事件然后才会触发on_rtsp_auth事件。 + */ + public RtspAuthResp onRtspAuth(RtspAuthReq req) { + log.debug("[ZLM] onRtspAuth : {}", req); + return RtspAuthResp.success(); + } + + /** + * TODO shell登录鉴权,ZLMediaKit提供简单的telnet调试方式 + * 使用telnet 127.0.0.1 9000能进入MediaServer进程的shell界面。 + */ + public BaseEventResp onShellLogin(ShellLoginReq req) { + log.debug("[ZLM] onShellLogin : {}", req); + return BaseEventResp.success(); + } + + /** + * TODO rtsp/rtmp流注册或注销时触发此事件;此事件对回复不敏感。 + */ + public BaseEventResp onStreamChanged(StreamChangedReq req) { + log.info("[ZLM] onStreamChanged 流信息 : {}", req); + return BaseEventResp.success(); + } + + /** + * 流无人观看时事件,用户可以通过此事件选择是否关闭无人看的流。 + */ + public BaseEventResp onStreamNoneReader(StreamNoneReaderReq req) { + log.debug("[ZLM] onStreamNoneReader : {}", req); + zlmService.display(req.getMediaServerId(), req.getStream()); + return BaseEventResp.success().setClose(false); + } + + /** + * TODO 流未找到事件,用户可以在此事件触发时,立即去拉流,这样可以实现按需拉流;此事件对回复不敏感。 + */ + public BaseEventResp onStreamNotFound(StreamNotFoundReq req) { + log.debug("[ZLM] onStreamNotFound : {}", req); + return BaseEventResp.success(); + } + + /** + * TODO 服务器启动事件,可以用于监听服务器崩溃重启;此事件对回复不敏感。 + */ + public BaseEventResp onServerStarted(ServerConfig req) { + log.debug("[ZLM] onServerStarted : {}", req); + return BaseEventResp.success(); + } + + /** + * TODO 服务器定时上报时间,上报间隔可配置,默认10s上报一次 + */ + public BaseEventResp onServerKeepalive(ServerKeepaliveReq req) { + log.debug("[ZLM] onServerKeepalive : {}", req); + return BaseEventResp.success(); + } +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/media/zlm/impl/ZlmServiceImpl.java b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/impl/ZlmServiceImpl.java new file mode 100644 index 0000000..3f3feb5 --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/media/zlm/impl/ZlmServiceImpl.java @@ -0,0 +1,196 @@ +package com.dite.znpt.monitor.media.zlm.impl; + +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.core.util.StrUtil; +import com.dite.znpt.exception.ServiceException; +import com.dite.znpt.monitor.domain.vo.video.StreamMediaFormat; +import com.dite.znpt.monitor.media.zlm.ZlmApi; +import com.dite.znpt.monitor.media.zlm.ZlmService; +import com.dite.znpt.monitor.media.zlm.cache.MediaServerCache; +import com.dite.znpt.monitor.media.zlm.cache.MediaServerChannelCache; +import com.dite.znpt.monitor.media.zlm.config.StreamMediaServerConfig; +import com.dite.znpt.monitor.media.zlm.dto.MediaItem; +import com.dite.znpt.monitor.media.zlm.dto.ServerConfig; +import com.dite.znpt.monitor.media.zlm.dto.ServerItem; +import com.dite.znpt.monitor.media.zlm.dto.req.RtpServerReq; +import com.dite.znpt.monitor.media.zlm.dto.req.StreamReq; +import com.dite.znpt.monitor.media.zlm.dto.resp.MediaResp; +import com.dite.znpt.monitor.media.zlm.dto.resp.RtpInfoResp; +import com.dite.znpt.monitor.service.StreamMediaFormatService; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.ApplicationArguments; +import org.springframework.boot.ApplicationRunner; +import org.springframework.core.env.Environment; +import org.springframework.scheduling.annotation.EnableScheduling; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.stereotype.Service; + +import java.util.List; + +import static com.dite.znpt.monitor.config.MediaFormatConfig.streamMediaFormatList; + +/** + * @Author: huise23 + * @Date: 2022/8/30 10:40 + * @Description: + */ +//@Service +@Slf4j +@RequiredArgsConstructor(onConstructor = @__(@Autowired)) +@EnableScheduling +public class ZlmServiceImpl implements ZlmService, ApplicationRunner { + private final StreamMediaFormatService formatService; + private final ZlmApi zlmApi; + private final MediaServerCache serverCache; + private final MediaServerChannelCache channelCache; + private final Environment environment; + private final StreamMediaServerConfig zlmConfig; + + @Value("${spring.profiles.active:dev}") + private String activeProfile; + @Value("${server.host:''}") + private String serverHost; + @Value("${server.port:''}") + private String serverPort; + + private String profile = "dev"; + + /** + * 系统启动加载服务器 + */ + @Override + public void run(ApplicationArguments args) throws Exception { + //TODO 媒体格式注入 + List formatList = streamMediaFormatList(); + ServerItem item = new ServerItem(zlmConfig, formatList); + try { + // 开发环境不去修改多媒体配置 +// if (!StrUtil.equalsIgnoreCase(activeProfile, profile)) { +// String host = StrUtil.blankToDefault(serverHost, IpUtils.getHostIp()); +// String port = StrUtil.blankToDefault(serverPort, environment.getProperty("server.port")); +// ServerConfig config = new ServerConfig(); +// config.refreshHook(host, port, zlmConfig); +// zlmApi.setServerConfig(item.getServer(), config); +// } + List configList = zlmApi.getServerConfig(item.getServer()); + item.setConfig(configList.get(0)); + item.setStatus(true); + log.info("ZLM媒体服务器连接成功"); + } catch (Exception e) { + log.warn("ZLM媒体服务器连接失败,应用将继续启动但媒体功能不可用:{}", e.getMessage()); + item.setStatus(false); + } + //初始化参数 + serverCache.putLoad(item); + } + +// @Scheduled(cron = "*/10 * * * * ?") + public void heartbeat1() { + log.debug("开始心跳检查..."); + ServerItem item = serverCache.getLoad(); + // 获取服务器流信息 + try { + List media = zlmApi.getMediaList(item.getServer(), new StreamReq()); + item.setMedia(media); + item.setStatus(true); + } catch (Exception e) { + log.error("流服务器节点丢失:", e); + item.setStatus(false); + } + serverCache.putLoad(item); + } + + @Override + public MediaItem play(String deviceCode, String channelCode) { + // 获取通道信息 + MediaItem media; + if (channelCache.has(deviceCode, channelCode)) { + media = channelCache.get(deviceCode, channelCode); + } else { + media = new MediaItem().setDeviceCode(deviceCode).setChannelCode(channelCode); + } + media.setIsCache(true); + // 检查节点是否正常 + if (!checkServer(media.getConfigId())) { + // 获取负载最小的节点 + ServerItem server = serverCache.getLoad(); + if (!server.getStatus()) { + throw new ServiceException("无正常的流媒体节点可用!"); + } + media.setSsrc(server.genPlaySsrc(channelCode)); + media.setConfigId(server.getConfigId()); + media.setConfig(server.getConfig()); + media.setServer(server.getServer()); + media.setFormatList(server.getFormatList()); + media.setIsCache(false); + serverCache.putLoad(server); + } + // 检查播放流是否正常 + if (StrUtil.isNotBlank(media.getStreamId())) { + RtpInfoResp rtp = zlmApi.getRtpInfo(media.getServer(), media.getStreamId()); + if (rtp.getExist()) { + media.setRtp(rtp); + media.setIsCache(true); + return media; + } + } + // 不正常,需要重新拉流 + Integer rtpPort = zlmApi.openRtpServer(media.getServer(), new RtpServerReq(media.getSsrc())); + media.setRtpPort(rtpPort); + media.setStreamId(media.getSsrc()); + // 缓存链接信息 + channelCache.put(deviceCode, channelCode, media); + media.setIsCache(false); + return media; + } + + @Override + public void release(String deviceCode, String channelCode) { + // 获取通道信息 + MediaItem media = channelCache.get(deviceCode, channelCode); + release(media); + } + + @Override + public void release(MediaItem media) { + if (ObjectUtil.isNull(media)) { + return; + } + try { + List list = zlmApi.getMediaList(media.getServer(), new StreamReq().setStream(media.getStreamId())); + if (!CollUtil.isEmpty(list) && list.get(0).getTotalReaderCount() > 0) { + // 当前还有观看者 不释放资源 + return; + } + zlmApi.closeRtpServer(media.getServer(), media.getStreamId()); + } catch (Exception e) { + log.error("流媒体服务器调用失败:", e); + } + // 释放SSRC句柄 + serverCache.releaseSsrc(media.getSsrc()); + // 删除链接信息 + channelCache.delete(media); + } + + @Override + public void display(String mediaServerId, String streamId) { + // 获取通道信息 + MediaItem media = channelCache.getByStream(mediaServerId, streamId); + release(media); + } + + /** + * 检查节点是否正常 + */ + private boolean checkServer(String configId) { + if (ObjectUtil.isNull(configId)) { + return false; + } + ServerItem item = serverCache.getLoad(); + return ObjectUtil.isNotNull(item) && item.getStatus(); + } +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/service/DeviceVideoChannelService.java b/sip/src/main/java/com/dite/znpt/monitor/service/DeviceVideoChannelService.java new file mode 100644 index 0000000..6632114 --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/service/DeviceVideoChannelService.java @@ -0,0 +1,120 @@ +package com.dite.znpt.monitor.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.dite.znpt.domain.PageResult; +import com.dite.znpt.domain.Result; +import com.dite.znpt.monitor.domain.entity.DeviceVideoChannelEntity; +import com.dite.znpt.monitor.domain.req.VideoInfoReq; +import com.dite.znpt.monitor.domain.resp.VideoInfoResp; +import com.dite.znpt.monitor.domain.vo.video.DeviceVideoChannelEditReq; +import com.dite.znpt.monitor.domain.vo.video.DeviceVideoChannelListResp; +import com.dite.znpt.monitor.domain.vo.video.DeviceVideoChannelResp; +import com.dite.znpt.monitor.domain.vo.video.VideoPayResp; + +import java.util.List; + +/** + * @Author: huise23 + * @Date: 2022/8/11 18:10 + * @Description: + */ +public interface DeviceVideoChannelService extends IService { + /** + * 查询视频通道列表 + * + * @param videoId 视频id + * @param keyword 查询条件 + * @return {@link PageResult < DeviceVideoChannelListResp >} + */ + PageResult selectDeviceVideoChannel(Long videoId, String keyword); + + /** + * 查询所有视频通道列表 + * + * @param keyword 查询条件 + * @return {@link PageResult< DeviceVideoChannelListResp>} + */ + PageResult selectAllDeviceVideoChannel(String keyword); + + /** + * 查询视频通道详情 + * + * @param channelCode + * @return {@link DeviceVideoChannelResp} + */ + DeviceVideoChannelResp getDeviceVideoChannelDetail(String channelCode); + + /** + * 编辑视频设备通道 + * + * @param channelId + * @param req + * @return + */ + void editDeviceVideoChannel(Long channelId, DeviceVideoChannelEditReq req); + + /** + * 根据通道id删除通道信息 + * + * @param channelIds + * @return {@link boolean} + */ + Result removeByChannelIds(List channelIds); + + /** + * 根据通道编码查询通道信息 + * + * @param channelCode 通道编码 + * @return 通道信息 + */ + DeviceVideoChannelEntity getByCode(String channelCode); + + /** + * 根据设备id查询设备通道 + * @param videoId 设备id + * @return {@link List< DeviceVideoChannelEntity>} + */ + List selectDeviceVideoChannelByVideoCode(Long videoId); + + /** + * 播放直播视频 + * + * @param channelCode + * @return + */ + VideoPayResp play(String channelCode); + + /** + * 是否在线 + * + * @param channelCode + * @return + */ + boolean isOnline(String channelCode); + + /** + * 停止播放直播 + * + * @param channelCode + * @return + */ + void stop(String channelCode); + + /** + * 下线视频设备下的所有通道 + * @param videoId + * @return + */ + void offlineByVideoId(Long videoId); + + /** + * 查询通道及视频信息 + * + * @param videoInfoReq 查询参数 + * @return {@link VideoInfoResp } + * @author huise23 + * @since 2024-12-03 13:54:52 + */ + List selectVideoInfoList(VideoInfoReq videoInfoReq); + +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/service/DeviceVideoService.java b/sip/src/main/java/com/dite/znpt/monitor/service/DeviceVideoService.java new file mode 100644 index 0000000..79ac330 --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/service/DeviceVideoService.java @@ -0,0 +1,104 @@ +package com.dite.znpt.monitor.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.dite.znpt.domain.PageResult; +import com.dite.znpt.domain.Result; +import com.dite.znpt.monitor.domain.entity.DeviceVideoEntity; +import com.dite.znpt.monitor.domain.vo.video.DeviceVideoEditReq; +import com.dite.znpt.monitor.domain.vo.video.DeviceVideoListResp; +import com.dite.znpt.monitor.domain.vo.video.DeviceVideoNumResp; + +/** + * @Author: huise23 + * @Date: 2022/8/11 18:09 + * @Description: + */ +public interface DeviceVideoService extends IService { + + /** + * 查询视频设备列表 + * + * @param status 状态 + * @param keyword 设备编码或者设备名称 + * @return {@link PageResult< DeviceVideoListResp>} + */ + PageResult selectDeviceVideoList(String status, String keyword, String hostAddress); + + /** + * 查询视频设备数量 + * + * @return {@link DeviceVideoNumResp} + */ + DeviceVideoNumResp countDeviceVideoNum(); + + /** + * 编辑视频设备信息 + * + * @param videoId 视频设备id + * @param req 视频设备信息 + * @return + */ + void editDeviceVideo(Long videoId, DeviceVideoEditReq req); + + /** + * 删除视频设备 + * + * @param videoId 视频设备id + * @return + */ + Result removeByVideoId(Long videoId); + + /** + * 根据端口和host查询设备 + * + * @param host 地址 + * @param port 端口 + * @return 设备 + */ + DeviceVideoEntity getDeviceByHostAndPort(String host, int port); + + /** + * 设备离线 + * + * @param videoCode videoCode + */ + void offline(String videoCode); + + /** + * 上线设备 + * @param entity + * @return + */ + void online(DeviceVideoEntity entity); + + /** + * 判断是否注册已经失效 + * @param entity 设备信息 + * @return {@link boolean} + */ + boolean expire(DeviceVideoEntity entity); + + /** + * 根据 videoCode 获取设备 + * + * @param videoCode videoCode + * @return 设备 + */ + DeviceVideoEntity getByCode(String videoCode); + + /** + * 根据 videoCode 获取设备 + * + * @param channelCode + * @return 设备 + */ + DeviceVideoEntity getByChannelCode(String channelCode); + + /** + * 查询设备状态 + * @param videoId + * @return + */ + void queryDeviceStatus(Long videoId); + +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/service/IpConfigService.java b/sip/src/main/java/com/dite/znpt/monitor/service/IpConfigService.java new file mode 100644 index 0000000..11a53d1 --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/service/IpConfigService.java @@ -0,0 +1,27 @@ +package com.dite.znpt.monitor.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.dite.znpt.monitor.domain.entity.IpConfigEntity; +import com.dite.znpt.monitor.domain.req.MonitorConfigAddReq; + +import java.util.List; + +/** + * @Date: 2023/09/05 16:39 + * @Description: 监控设备IP配置表服务接口 + */ +public interface IpConfigService extends IService { + + /** + * 新增ip配置 + * @param req + */ + void configAdd(MonitorConfigAddReq req); + + /** + * 查询ip配置 + * @return + */ + List configList(); +} + diff --git a/sip/src/main/java/com/dite/znpt/monitor/service/StreamMediaFormatService.java b/sip/src/main/java/com/dite/znpt/monitor/service/StreamMediaFormatService.java new file mode 100644 index 0000000..fa959bc --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/service/StreamMediaFormatService.java @@ -0,0 +1,12 @@ +package com.dite.znpt.monitor.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.dite.znpt.monitor.domain.vo.video.StreamMediaFormat; + +/** + * @Author: huise23 + * @Date: 2022/8/11 14:58 + * @Description: + */ +public interface StreamMediaFormatService extends IService { +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/service/impl/DeviceVideoChannelServiceImpl.java b/sip/src/main/java/com/dite/znpt/monitor/service/impl/DeviceVideoChannelServiceImpl.java new file mode 100644 index 0000000..931a754 --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/service/impl/DeviceVideoChannelServiceImpl.java @@ -0,0 +1,262 @@ +package com.dite.znpt.monitor.service.impl; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.dite.znpt.domain.PageResult; +import com.dite.znpt.domain.Result; +import com.dite.znpt.exception.ServiceException; +import com.dite.znpt.monitor.constant.IotRespMessage; +import com.dite.znpt.monitor.constant.dict.CameraType; +import com.dite.znpt.monitor.constant.dict.DeviceStatus; +import com.dite.znpt.monitor.constant.dict.YesOrNo; +import com.dite.znpt.monitor.domain.entity.DeviceVideoChannelEntity; +import com.dite.znpt.monitor.domain.entity.DeviceVideoEntity; +import com.dite.znpt.monitor.domain.req.VideoInfoReq; +import com.dite.znpt.monitor.domain.resp.VideoInfoResp; +import com.dite.znpt.monitor.domain.vo.video.DeviceVideoChannelEditReq; +import com.dite.znpt.monitor.domain.vo.video.DeviceVideoChannelListResp; +import com.dite.znpt.monitor.domain.vo.video.DeviceVideoChannelResp; +import com.dite.znpt.monitor.domain.vo.video.VideoPayResp; +import com.dite.znpt.monitor.mapper.DeviceVideoChannelMapper; +import com.dite.znpt.monitor.media.zlm.ZlmApi; +import com.dite.znpt.monitor.media.zlm.ZlmService; +import com.dite.znpt.monitor.media.zlm.cache.MediaServerChannelCache; +import com.dite.znpt.monitor.media.zlm.dto.MediaItem; +import com.dite.znpt.monitor.media.zlm.dto.req.StreamReq; +import com.dite.znpt.monitor.media.zlm.dto.resp.MediaResp; +import com.dite.znpt.monitor.service.DeviceVideoChannelService; +import com.dite.znpt.monitor.service.DeviceVideoService; +import com.dite.znpt.monitor.sip.config.SipConfig; +import com.dite.znpt.monitor.sip.transmit.cmd.ISipDeviceCommander; +import com.dite.znpt.monitor.utils.DictUtils; +import com.dite.znpt.util.PageUtil; +import com.github.pagehelper.PageInfo; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.time.LocalDateTime; +import java.util.List; +import java.util.Objects; +import java.util.Optional; +import java.util.stream.Collectors; + +/** + * @Author: huise23 + * @Date: 2022/8/11 18:10 + * @Description: + */ +@Service +public class DeviceVideoChannelServiceImpl extends ServiceImpl implements DeviceVideoChannelService { + + @Resource + private MediaServerChannelCache channelCache; + + @Resource + private DeviceVideoService deviceVideoService; + + @Resource + private ISipDeviceCommander sipDeviceCommander; + + @Resource + private ZlmService zlmService; + + @Resource + private ZlmApi zlmApi; + + @Resource + private SipConfig sipConfig; + + /** + * 查询视频通道列表 + * + * @param videoId 视频id + * @param keyword 查询条件 + * @return {@link PageResult < DeviceVideoChannelListResp >} + */ + @Override + public PageResult selectDeviceVideoChannel(Long videoId, String keyword) { + PageUtil.startPage(); + List list = this.baseMapper.selectDeviceVideoChannel(videoId, keyword); + return buildPageResult(list); + } + + /** + * 查询所有视频通道列表 + * + * @param keyword 查询条件 + * @return {@link PageResult< DeviceVideoChannelListResp>} + */ + @Override + public PageResult selectAllDeviceVideoChannel(String keyword) { + PageUtil.startPage(); + List list = this.baseMapper.selectAllDeviceVideoChannel(keyword); + return buildPageResult(list); + } + + private PageResult buildPageResult(List list) { + if (CollectionUtil.isEmpty(list)) { + return PageResult.ok(list, 0); + } + long total = new PageInfo<>(list).getTotal(); + list.stream().peek(resp -> { + resp.setCameraTypeLabel(DictUtils.getDictLabel(CameraType.class, resp.getCameraType())); + resp.setPtzControlLabel(DictUtils.getDictLabel(YesOrNo.class, resp.getPtzControl())); + resp.setStatusLabel(DictUtils.getDictLabel(DeviceStatus.class, resp.getStatus())); + }).collect(Collectors.toList()); + return PageResult.ok(list, total); + } + + /** + * 查询视频通道详情 + * + * @param channelCode + * @return {@link DeviceVideoChannelResp} + */ + @Override + public DeviceVideoChannelResp getDeviceVideoChannelDetail(String channelCode) { + return this.baseMapper.getDeviceVideoChannelDetail(channelCode); + } + + /** + * 编辑视频设备通道 + * + * @param channelId + * @param req + * @return + */ + @Transactional(rollbackFor = Exception.class) + @Override + public void editDeviceVideoChannel(Long channelId, DeviceVideoChannelEditReq req) { + DeviceVideoChannelEntity entity = this.getById(channelId); + BeanUtil.copyProperties(req, entity); + entity.setUpdateTime(LocalDateTime.now()); + this.updateById(entity); + } + + /** + * 根据通道id删除通道信息 + * + * @param channelIds + * @return {@link boolean} + */ + @Transactional(rollbackFor = Exception.class) + @Override + public Result removeByChannelIds(List channelIds) { + List list = this.listByIds(channelIds); + List ids = list.stream().map(DeviceVideoChannelEntity::getChannelId).collect(Collectors.toList()); + if (ids.size() == list.size()) { + return Result.ok(this.removeByIds(ids)); + } else { + return Result.error(IotRespMessage.DEVICE_VIDEO_CANNOT_DELETE); + } + } + + @Override + public DeviceVideoChannelEntity getByCode(String channelCode) { + return super.getOne(Wrappers.lambdaQuery(DeviceVideoChannelEntity.class) + .eq(DeviceVideoChannelEntity::getChannelCode, channelCode) + .orderByDesc(DeviceVideoChannelEntity::getCreateTime) + .last("limit 1")); + } + + /** + * 根据设备国标编码查询设备通道 + * + * @param videoId 设备id + * @return {@link List< DeviceVideoChannelEntity>} + */ + @Override + public List selectDeviceVideoChannelByVideoCode(Long videoId) { + return this.list(Wrappers.lambdaQuery(DeviceVideoChannelEntity.class).eq(DeviceVideoChannelEntity::getVideoId, videoId)); + } + + /** + * 播放视频 + * + * @param channelCode + * @return + */ + @Override + public VideoPayResp play(String channelCode) { + DeviceVideoChannelEntity channelEntity = Optional.ofNullable(this.getByCode(channelCode)).orElseThrow(() -> new ServiceException(IotRespMessage.ID_NOT_FOUND)); + DeviceVideoEntity videoEntity = Optional.ofNullable(deviceVideoService.getById(channelEntity.getVideoId())).orElseThrow(() -> new ServiceException(IotRespMessage.ID_NOT_FOUND)); + MediaItem mediaItem = zlmService.play(videoEntity.getVideoCode(), channelEntity.getChannelCode()); + if (!mediaItem.getIsCache()) { + sipDeviceCommander.playStreamCmd(videoEntity, channelEntity.getChannelCode(), mediaItem.getSsrc(), mediaItem.getRtpPort(), mediaItem.getServer().getApiHost()); + } + return VideoPayResp.builder() + .mediaType(sipConfig.getMediaType()) + .streamMediaFormatList(mediaItem.getFormatList(sipConfig.getMediaRouter())) + .build(); + } + + /** + * 是否在线 + * + * @param channelCode + * @return + */ + @Override + public boolean isOnline(String channelCode) { + DeviceVideoChannelEntity channelEntity = this.getByCode(channelCode); + return Objects.nonNull(channelEntity) && channelEntity.getStatus().equals(DeviceStatus.ONLINE.getValue()); + } + + /** + * 停止播放直播 + * + * @param channelCode + * @return + */ + @Override + public void stop(String channelCode) { + DeviceVideoChannelEntity channelEntity = Optional.ofNullable(this.getByCode(channelCode)).orElseThrow(() -> new ServiceException(IotRespMessage.ID_NOT_FOUND)); + DeviceVideoEntity videoEntity = Optional.ofNullable(deviceVideoService.getById(channelEntity.getVideoId())).orElseThrow(() -> new ServiceException(IotRespMessage.ID_NOT_FOUND)); + MediaItem mediaItem = channelCache.get(videoEntity.getVideoCode(), channelEntity.getChannelCode()); + if (null != mediaItem) { + List list = zlmApi.getMediaList(mediaItem.getServer(), new StreamReq().setStream(mediaItem.getStreamId())); + if (CollectionUtil.isNotEmpty(list) && list.get(0).getTotalReaderCount() <= 1) { + // 当只有一个人观看时,想设备发送停止推流命令 + sipDeviceCommander.stopStreamCmd(mediaItem.getSsrc()); + } + zlmService.release(videoEntity.getVideoCode(), channelEntity.getChannelCode()); + } + } + + /** + * 下线视频设备下的所有通道 + * + * @param videoId + * @return + */ + @Override + public void offlineByVideoId(Long videoId) { + List list = this.list(Wrappers.lambdaQuery(DeviceVideoChannelEntity.class).eq(DeviceVideoChannelEntity::getVideoId, videoId)); + if (ObjectUtil.isNotNull(list)) { + this.updateBatchById( + list.stream().peek(entity -> { + entity.setUpdateTime(LocalDateTime.now()); + entity.setStatus(DeviceStatus.OFFLINE.getValue()); + }).collect(Collectors.toList()) + ); + } + } + + /** + * 查询通道及视频信息 + * + * @param videoInfoReq 查询参数 + * @return {@link VideoInfoResp } + * @author huise23 + * @since 2024-12-03 13:54:52 + */ + @Override + public List selectVideoInfoList(VideoInfoReq videoInfoReq) { + return this.baseMapper.selectVideoInfoList(videoInfoReq); + } + +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/service/impl/DeviceVideoServiceImpl.java b/sip/src/main/java/com/dite/znpt/monitor/service/impl/DeviceVideoServiceImpl.java new file mode 100644 index 0000000..8c00abb --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/service/impl/DeviceVideoServiceImpl.java @@ -0,0 +1,225 @@ +package com.dite.znpt.monitor.service.impl; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.http.HttpStatus; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.dite.znpt.domain.PageResult; +import com.dite.znpt.domain.Result; +import com.dite.znpt.exception.ServiceException; +import com.dite.znpt.monitor.constant.IotCacheConstants; +import com.dite.znpt.monitor.constant.IotDictConstants; +import com.dite.znpt.monitor.constant.IotRespMessage; +import com.dite.znpt.monitor.constant.dict.DeviceStatus; +import com.dite.znpt.monitor.constant.dict.SipTransferMode; +import com.dite.znpt.monitor.constant.dict.StreamTransferMode; +import com.dite.znpt.monitor.domain.entity.DeviceVideoChannelEntity; +import com.dite.znpt.monitor.domain.entity.DeviceVideoEntity; +import com.dite.znpt.monitor.domain.vo.video.DeviceVideoEditReq; +import com.dite.znpt.monitor.domain.vo.video.DeviceVideoListResp; +import com.dite.znpt.monitor.domain.vo.video.DeviceVideoNumResp; +import com.dite.znpt.monitor.mapper.DeviceVideoMapper; +import com.dite.znpt.monitor.service.DeviceVideoChannelService; +import com.dite.znpt.monitor.service.DeviceVideoService; +import com.dite.znpt.monitor.sip.transmit.cmd.ISipDeviceCommander; +import com.dite.znpt.monitor.utils.DictUtils; +import com.dite.znpt.service.impl.RedisService; +import com.github.pagehelper.PageInfo; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.time.LocalDateTime; +import java.time.temporal.ChronoUnit; +import java.util.List; +import java.util.Optional; +import java.util.stream.Collectors; + +/** + * @Author: huise23 + * @Date: 2022/8/11 18:11 + * @Description: + */ +@Slf4j +@Service +public class DeviceVideoServiceImpl extends ServiceImpl implements DeviceVideoService { + + @Resource + private RedisService redisService; + + @Resource + private DeviceVideoChannelService deviceVideoChannelService; + + @Resource + private ISipDeviceCommander sipDeviceCommander; + + /** + * 查询视频设备列表 + * + * @param status 状态 + * @param keyword 设备编码或者设备名称 + * @return {@link List < DeviceVideoListResp >} + */ + @Override + public PageResult selectDeviceVideoList(String status, String keyword, String hostAddress) { + List deviceVideoListResps = this.baseMapper.selectDeviceVideoList(status, keyword,hostAddress); + int total = (int) new PageInfo(deviceVideoListResps).getTotal(); + deviceVideoListResps = deviceVideoListResps.stream().peek(resp -> { + resp.setStatusLabel(DictUtils.getDictLabel(DeviceStatus.class, resp.getStatus())); + resp.setStreamModeLabel(DictUtils.getDictLabel(StreamTransferMode.class, resp.getStreamMode())); + resp.setTransportLabel(DictUtils.getDictLabel(SipTransferMode.class, resp.getTransport())); + }).collect(Collectors.toList()); + return PageResult.ok(deviceVideoListResps,total); + } + + /** + * 查询视频设备数量 + * + * @param + * @return {@link DeviceVideoNumResp} + */ + @Override + public DeviceVideoNumResp countDeviceVideoNum() { + DeviceVideoNumResp deviceVideoNumResp = new DeviceVideoNumResp(); + List deviceVideoList = this.baseMapper.selectDeviceVideoList(null, null,null); + deviceVideoNumResp.setAllDevice(deviceVideoList.stream().count()); + deviceVideoNumResp.setOnlineDevice(deviceVideoList.stream().filter(item -> IotDictConstants.IOT_DEVICE_STATUS_ONLINE.equals(item.getStatus())).count()); + deviceVideoNumResp.setOfflineDevice(deviceVideoList.stream().filter(item -> IotDictConstants.IOT_DEVICE_STATUS_OFFLINE.equals(item.getStatus())).count()); + return deviceVideoNumResp; + } + + /** + * 编辑视频设备信息 + * + * @param videoId 视频设备id + * @param req 视频设备信息 + * @return + */ + @Transactional(rollbackFor = Exception.class) + @Override + public void editDeviceVideo(Long videoId, DeviceVideoEditReq req) { + DeviceVideoEntity entity = this.getById(videoId); + if (null == entity) { + throw new ServiceException(IotRespMessage.ID_NOT_FOUND); + } + BeanUtil.copyProperties(req, entity); + this.updateById(entity); + } + + /** + * 删除视频设备 + * + * @param videoId 视频设备id + * @return + */ + @Transactional(rollbackFor = Exception.class) + @Override + public Result removeByVideoId(Long videoId) { + DeviceVideoEntity entity = this.getById(videoId); + if (null == entity) { + throw new ServiceException(IotRespMessage.ID_NOT_FOUND); + } + if (!DeviceStatus.OFFLINE.getValue().equals(entity.getStatus())) { + return Result.error(IotRespMessage.DEVICE_VIDEO_CANNOT_DELETE); + } + Result result = Result.ok(); + List list = deviceVideoChannelService.list(Wrappers.lambdaQuery(DeviceVideoChannelEntity.class).eq(DeviceVideoChannelEntity::getVideoId,videoId)); + List channelIds = list.stream().map(DeviceVideoChannelEntity::getChannelId).collect(Collectors.toList()); + if(CollectionUtil.isNotEmpty(channelIds)){ + result = deviceVideoChannelService.removeByChannelIds(channelIds); + } + if (HttpStatus.HTTP_OK == result.getCode()) { + return this.removeById(videoId) ? Result.ok() : Result.error(); + } else { + return result; + } + } + + @Override + public DeviceVideoEntity getDeviceByHostAndPort(String host, int port) { + return super.getOne(Wrappers.lambdaQuery(DeviceVideoEntity.class) + .eq(DeviceVideoEntity::getIp, host) + .eq(DeviceVideoEntity::getPort, port) +// .orderByDesc(DeviceVideoEntity::getCreateTime) + .last("limit 1")); + } + + @Transactional(rollbackFor = Exception.class) + @Override + public void offline(String videoCode) { + DeviceVideoEntity entity = this.getByCode(videoCode); + entity.setStatus(DeviceStatus.OFFLINE.getValue()); +// entity.setUpdateTime(LocalDateTime.now()); + this.updateById(entity); + deviceVideoChannelService.offlineByVideoId(entity.getVideoId()); + + } + + /** + * 上线设备 + * + * @param entity + * @return + */ + @Transactional(rollbackFor = Exception.class) + @Override + public void online(DeviceVideoEntity entity) { + log.info("[设备上线] deviceId:{}->{}:{}",entity.getVideoCode(), entity.getIp(), entity.getPort()); + String deviceCacheKey = IotCacheConstants.getIotDeviceVideoKey(entity.getVideoCode()); + entity.setStatus(DeviceStatus.ONLINE.getValue()); + if(entity.getVideoId() == null){ + // 设备首次上线 + if(redisService.hasKey(deviceCacheKey)){ + // 脏数据 + redisService.deleteObject(deviceCacheKey); + } + this.save(entity); + } else { + entity.setUpdateTime(LocalDateTime.now()); + this.updateById(entity); + } + sipDeviceCommander.queryDeviceInfo(entity); + sipDeviceCommander.queryCatalog(entity); + } + + @Override + public boolean expire(DeviceVideoEntity entity) { + LocalDateTime expireDateTime = entity.getRegisterTime().plus(entity.getExpires(), ChronoUnit.MILLIS); + return expireDateTime.isBefore(LocalDateTime.now()); + } + + @Override + public DeviceVideoEntity getByCode(String videoCode) { + return super.getOne(Wrappers.lambdaQuery(DeviceVideoEntity.class) + .eq(DeviceVideoEntity::getVideoCode, videoCode) + .orderByDesc(DeviceVideoEntity::getCreateTime) + .last("limit 1")); + } + + /** + * 根据 videoCode 获取设备 + * + * @param channelCode + * @return 设备 + */ + @Override + public DeviceVideoEntity getByChannelCode(String channelCode) { + DeviceVideoChannelEntity channelEntity = Optional.ofNullable(deviceVideoChannelService.getByCode(channelCode)).orElseThrow(()-> new ServiceException(IotRespMessage.ID_NOT_FOUND)); + return this.getById(channelEntity.getVideoId()); + } + + /** + * 查询设备状态 + * + * @param videoId + * @return + */ + @Override + public void queryDeviceStatus(Long videoId) { + DeviceVideoEntity entity = Optional.ofNullable(this.getById(videoId)).orElseThrow( () -> new ServiceException(IotRespMessage.ID_NOT_FOUND)); + sipDeviceCommander.queryDeviceStatus(entity); + } + +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/service/impl/IpConfigServiceImpl.java b/sip/src/main/java/com/dite/znpt/monitor/service/impl/IpConfigServiceImpl.java new file mode 100644 index 0000000..0d33fa6 --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/service/impl/IpConfigServiceImpl.java @@ -0,0 +1,80 @@ +package com.dite.znpt.monitor.service.impl; + +import cn.hutool.core.util.NumberUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.dite.znpt.exception.ServiceException; +import com.dite.znpt.monitor.domain.entity.IpConfigEntity; +import com.dite.znpt.monitor.domain.req.MonitorConfigAddReq; +import com.dite.znpt.monitor.mapper.IpConfigMapper; +import com.dite.znpt.monitor.service.IpConfigService; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; +import java.util.stream.Collectors; + +/** + * @Date: 2023/09/05 16:39 + * @Description: 监控设备IP配置表服务实现类 + */ +@Service +public class IpConfigServiceImpl extends ServiceImpl implements IpConfigService { + + + @Override + @Transactional(rollbackFor = Exception.class) + public void configAdd(MonitorConfigAddReq req) { + //先删除再新增--全量新增 + final List configAdds = req.getIpAddresses().stream().map(this::BuildConfigEntity).collect(Collectors.toList()); + //校验是否有重复的--用前三位来判断重复 + checkDup(configAdds); + deleteConfig(); + this.saveBatch(configAdds); + } + + + + @Override + public List configList() { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + final List ifConfigs = this.list(wrapper); + return ifConfigs.stream().map(t->t.getIp()).collect(Collectors.toList()); + } + + private void deleteConfig(){ + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + this.remove(wrapper); + } + + private void checkDup(List configAdds) { + final List ipTopThreeList = configAdds.stream().map(t -> t.getIpTopThree()).collect(Collectors.toList()); + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.in(IpConfigEntity::getIpTopThree,ipTopThreeList) + .last("limit 1"); + final IpConfigEntity one = this.getOne(wrapper); + if(one != null){ + throw new ServiceException("与现有视频地址重复,请重新选择!"); + } + } + + private IpConfigEntity BuildConfigEntity( String ip) { + IpConfigEntity entity = new IpConfigEntity(); + final String[] ipArray = ip.split("\\."); + ipValidate(ipArray); + entity.setIp(ip); + entity.setIpTopThree(ipArray[0]+"."+ipArray[1]+"."+ipArray[2]); + return entity; + } + + private void ipValidate(String[] ipArray) { + if(ipArray.length!=4){ + throw new ServiceException("ip地址长度不对"); + } + for (int i = 0; i < 4; i++) { + if(! (NumberUtil.isInteger(ipArray[i]) || (i==3 && "*".equals(ipArray[i])))){ + throw new ServiceException("ip地址为非数字"); + } + } + } +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/service/impl/StreamMediaFormatServiceImpl.java b/sip/src/main/java/com/dite/znpt/monitor/service/impl/StreamMediaFormatServiceImpl.java new file mode 100644 index 0000000..06aaa50 --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/service/impl/StreamMediaFormatServiceImpl.java @@ -0,0 +1,17 @@ +package com.dite.znpt.monitor.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.dite.znpt.monitor.domain.vo.video.StreamMediaFormat; +import com.dite.znpt.monitor.mapper.StreamMediaFormatMapper; +import com.dite.znpt.monitor.service.StreamMediaFormatService; +import org.springframework.stereotype.Service; + +/** + * @Author: huise23 + * @Date: 2022/8/11 14:59 + * @Description: + */ +@Service +public class StreamMediaFormatServiceImpl extends ServiceImpl implements StreamMediaFormatService { + +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/sip/SipLayer.java b/sip/src/main/java/com/dite/znpt/monitor/sip/SipLayer.java new file mode 100644 index 0000000..f10f7d8 --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/sip/SipLayer.java @@ -0,0 +1,102 @@ +package com.dite.znpt.monitor.sip; + +import com.dite.znpt.monitor.sip.config.SipConfig; +import com.dite.znpt.monitor.sip.transmit.SipProcessorFactoryI; +import gov.nist.javax.sip.SipProviderImpl; +import lombok.extern.slf4j.Slf4j; +import org.slf4j.bridge.SLF4JBridgeHandler; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.DependsOn; +import org.springframework.stereotype.Component; + +import javax.annotation.PostConstruct; +import javax.annotation.Resource; +import javax.sip.*; +import java.util.Properties; +import java.util.TooManyListenersException; + +/** + * @Author: huise23 + * @Date: 2022/8/10 16:20 + * @Description: + */ +@Slf4j +@Component +public class SipLayer { + + @Resource + private SipConfig sipConfig; + + @Resource + private SipProcessorFactoryI sipProcessorFactory; + + private SipStack sipStack; + + private SipFactory sipFactory; + + @Bean("sipFactory") + SipFactory createSipFactory() { + sipFactory = SipFactory.getInstance(); + sipFactory.setPathName("gov.nist"); + return sipFactory; + } + + @Bean("sipStack") + @DependsOn({"sipFactory"}) + SipStack createSipStack() throws PeerUnavailableException { + Properties properties = new Properties(); + properties.setProperty("javax.sip.STACK_NAME", "GB28181_SIP"); + properties.setProperty("javax.sip.IP_ADDRESS", sipConfig.getIp()); + /** + * 完整配置参考 gov.nist.javax.sip.SipStackImpl,需要下载源码 + * gov/nist/javax/sip/SipStackImpl.class + */ + if (log.isDebugEnabled()) { + properties.setProperty("gov.nist.javax.sip.LOG_MESSAGE_CONTENT", "true"); + } + // 接收所有notify请求,即使没有订阅 + properties.setProperty("gov.nist.javax.sip.DELIVER_UNSOLICITED_NOTIFY", "true"); + // 为_NULL _对话框传递_终止的_事件 + properties.setProperty("gov.nist.javax.sip.DELIVER_TERMINATED_EVENT_FOR_NULL_DIALOG", "true"); + // 会话清理策略 + properties.setProperty("gov.nist.javax.sip.RELEASE_REFERENCES_STRATEGY", "Normal"); + // 处理由该服务器处理的基于底层TCP的保持生存超时 + properties.setProperty("gov.nist.javax.sip.RELIABLE_CONNECTION_KEEP_ALIVE_TIMEOUT", "60"); + + /** + * sip_server_log.log 和 sip_debug_log.log public static final int TRACE_NONE = + * 0; public static final int TRACE_MESSAGES = 16; public static final int + * TRACE_EXCEPTION = 17; public static final int TRACE_DEBUG = 32; + */ + if (log.isDebugEnabled()) { + properties.setProperty("gov.nist.javax.sip.TRACE_LEVEL", "DEBUG"); + } +// sip日志等级 + properties.setProperty("gov.nist.javax.sip.TRACE_LEVEL", "ERROR"); + sipStack = sipFactory.createSipStack(properties); + + return sipStack; + } + + @Bean(name = "tcpSipProvider") + @DependsOn("sipStack") + SipProviderImpl startTcpListener() throws InvalidArgumentException, TransportNotSupportedException, ObjectInUseException, TooManyListenersException { + ListeningPoint tcpListeningPoint = sipStack.createListeningPoint(sipConfig.getIp(), sipConfig.getPort(), "TCP"); + SipProviderImpl tcpSipProvider = (SipProviderImpl)sipStack.createSipProvider(tcpListeningPoint); + tcpSipProvider.setDialogErrorsAutomaticallyHandled(); + tcpSipProvider.addSipListener(sipProcessorFactory); + log.info("[Sip Server] TCP 启动成功 {}:{}", sipConfig.getIp(), sipConfig.getPort()); + return tcpSipProvider; + } + + @Bean(name = "udpSipProvider") + @DependsOn("sipStack") + SipProviderImpl startUdpListener() throws InvalidArgumentException, TransportNotSupportedException, ObjectInUseException, TooManyListenersException { + ListeningPoint udpListeningPoint = sipStack.createListeningPoint(sipConfig.getIp(), sipConfig.getPort(), "UDP"); + SipProviderImpl udpSipProvider = (SipProviderImpl)sipStack.createSipProvider(udpListeningPoint); + udpSipProvider.addSipListener(sipProcessorFactory); + log.info("[Sip Server] UDP 启动成功 {}:{}", sipConfig.getIp(), sipConfig.getPort()); + return udpSipProvider; + } + +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/sip/config/SipConfig.java b/sip/src/main/java/com/dite/znpt/monitor/sip/config/SipConfig.java new file mode 100644 index 0000000..86d475f --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/sip/config/SipConfig.java @@ -0,0 +1,38 @@ +package com.dite.znpt.monitor.sip.config; + +import lombok.Data; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.context.annotation.Configuration; + +/** + * @Author: huise23 + * @Date: 2022/8/10 16:59 + * @Description: + */ +@Data +@Configuration +@ConfigurationProperties(prefix = "sip-config") +public class SipConfig { + + String name; + + String ip; + + Integer port; + + String charset; + + String domain; + + String id; + + String password; + + String mediaType = "mp4"; + + /** + * zlm播放地址路由 + */ + String mediaRouter = "/zlm"; + +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/sip/session/StreamSessionManager.java b/sip/src/main/java/com/dite/znpt/monitor/sip/session/StreamSessionManager.java new file mode 100644 index 0000000..48d758d --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/sip/session/StreamSessionManager.java @@ -0,0 +1,26 @@ +package com.dite.znpt.monitor.sip.session; + +import org.springframework.stereotype.Component; + +import javax.sip.ClientTransaction; +import java.util.concurrent.ConcurrentHashMap; + +/** + * @Author: huise23 + * @Date: 2022/8/29 16:52 + * @Description: 视频流session管理器,管理视频预览、预览回放的通信句柄 + */ +@Component +public class StreamSessionManager { + + private ConcurrentHashMap sessionMap = new ConcurrentHashMap<>(); + + public void put(String ssrc, ClientTransaction transaction){ + sessionMap.put(ssrc, transaction); + } + + public ClientTransaction get(String ssrc){ + return sessionMap.get(ssrc); + } + +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/sip/transmit/SipProcessorFactoryI.java b/sip/src/main/java/com/dite/znpt/monitor/sip/transmit/SipProcessorFactoryI.java new file mode 100644 index 0000000..ad1c041 --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/sip/transmit/SipProcessorFactoryI.java @@ -0,0 +1,11 @@ +package com.dite.znpt.monitor.sip.transmit; + +import javax.sip.SipListener; + +/** + * @Author: huise23 + * @Date: 2022/8/29 16:52 + * @Description: + */ +public interface SipProcessorFactoryI extends SipListener { +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/sip/transmit/SipProcessorFactoryImpl.java b/sip/src/main/java/com/dite/znpt/monitor/sip/transmit/SipProcessorFactoryImpl.java new file mode 100644 index 0000000..b450e7e --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/sip/transmit/SipProcessorFactoryImpl.java @@ -0,0 +1,99 @@ +package com.dite.znpt.monitor.sip.transmit; + + +import cn.hutool.json.JSONUtil; +import com.dite.znpt.monitor.sip.transmit.request.ISipRequestProcessor; +import com.dite.znpt.monitor.sip.transmit.response.ISipResponseProcessor; +import com.dite.znpt.monitor.sip.transmit.timeout.ITimeoutProcessor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.scheduling.annotation.Async; +import org.springframework.stereotype.Component; + +import javax.sip.*; +import javax.sip.header.CSeqHeader; +import javax.sip.message.Response; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +/** + * @Author: huise23 + * @Date: 2022/8/10 16:44 + * @Description: + */ +@Slf4j +@Component +public class SipProcessorFactoryImpl implements SipProcessorFactoryI { + + private static Map requestProcessorMap = new ConcurrentHashMap<>(); + + private static Map responseProcessorMap = new ConcurrentHashMap<>(); + + private static ITimeoutProcessor timeoutProcessor; + + public void addRequestProcessor(String method, ISipRequestProcessor processor) { + requestProcessorMap.put(method, processor); + } + + public void addResponseProcessor(String method, ISipResponseProcessor processor) { + responseProcessorMap.put(method, processor); + } + + public void addTimeoutProcessor(ITimeoutProcessor processor) { + timeoutProcessor = processor; + } + + @Override + @Async + public void processRequest(RequestEvent requestEvent) { + log.info("requestEvent:"+ JSONUtil.toJsonStr(requestEvent.getRequest())); + String method = requestEvent.getRequest().getMethod(); + ISipRequestProcessor sipRequestProcessor = requestProcessorMap.get(method); + if (sipRequestProcessor == null) { + log.warn("不支持方法{}的request", method); + return; + } + sipRequestProcessor.process(requestEvent); + } + + @Override + @Async + public void processResponse(ResponseEvent responseEvent) { + Response response = responseEvent.getResponse(); + int status = response.getStatusCode(); + if ((status >= 200 && status < 300) || status == Response.UNAUTHORIZED) { + CSeqHeader cseqHeader = (CSeqHeader) responseEvent.getResponse().getHeader(CSeqHeader.NAME); + String method = cseqHeader.getMethod(); + ISipResponseProcessor sipResponseProcessor = responseProcessorMap.get(method); + if (sipResponseProcessor == null) { + log.warn("不支持方法{}的response", method); + return; + } + sipResponseProcessor.process(responseEvent); + } else if ((status >= 100) && (status < 200)) { + // 增加其它无需回复的响应,如101、180等 + } else { + //未完成 接收到失败的response响应!status:400,message:Bad Request + log.warn("接收到失败的response响应!status:" + status + ",message:" + response.getReasonPhrase()); + } + } + + @Override + public void processTimeout(TimeoutEvent timeoutEvent) { + // TODO Auto-generated method stub + } + + @Override + public void processIOException(IOExceptionEvent exceptionEvent) { + // TODO Auto-generated method stub + } + + @Override + public void processTransactionTerminated(TransactionTerminatedEvent transactionTerminatedEvent) { + // TODO Auto-generated method stub + } + + @Override + public void processDialogTerminated(DialogTerminatedEvent dialogTerminatedEvent) { + // TODO Auto-generated method stub + } +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/sip/transmit/cmd/ISipDeviceCommander.java b/sip/src/main/java/com/dite/znpt/monitor/sip/transmit/cmd/ISipDeviceCommander.java new file mode 100644 index 0000000..7ace5f6 --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/sip/transmit/cmd/ISipDeviceCommander.java @@ -0,0 +1,50 @@ +package com.dite.znpt.monitor.sip.transmit.cmd; + +import com.dite.znpt.monitor.domain.entity.DeviceVideoEntity; + +/** + * @Author: huise23 + * @Date: 2022/8/30 8:46 + * @Description: + */ +public interface ISipDeviceCommander { + + /** + * 查询目录列表 + * @param entity + * @return {@link boolean} + */ + boolean queryCatalog(DeviceVideoEntity entity); + + /** + * 查询设备信息 + * @param entity + * @return {@link boolean} + */ + boolean queryDeviceInfo(DeviceVideoEntity entity); + + /** + * 查询设备状态 + * @param entity + * @return {@link boolean} + */ + boolean queryDeviceStatus(DeviceVideoEntity entity); + + /** + * 请求预览视频流 + * + * @param entity + * @param channelCode + * @param ssrc + * @param ssrcPort + * @return {@link String} + */ + void playStreamCmd(DeviceVideoEntity entity, String channelCode, String ssrc, Integer ssrcPort, String mediaIp); + + /** + * 停止视频流 + * @param ssrc + * @return + */ + void stopStreamCmd(String ssrc); +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/sip/transmit/cmd/SipRequestHeaderProvider.java b/sip/src/main/java/com/dite/znpt/monitor/sip/transmit/cmd/SipRequestHeaderProvider.java new file mode 100644 index 0000000..383c7c8 --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/sip/transmit/cmd/SipRequestHeaderProvider.java @@ -0,0 +1,120 @@ +package com.dite.znpt.monitor.sip.transmit.cmd; + +import com.dite.znpt.monitor.domain.entity.DeviceVideoEntity; +import com.dite.znpt.monitor.sip.config.SipConfig; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Component; + +import javax.annotation.Resource; +import javax.sip.InvalidArgumentException; +import javax.sip.PeerUnavailableException; +import javax.sip.SipFactory; +import javax.sip.SipProvider; +import javax.sip.address.Address; +import javax.sip.address.SipURI; +import javax.sip.header.*; +import javax.sip.message.Request; +import java.security.SecureRandom; +import java.text.ParseException; +import java.util.ArrayList; + +/** + * 摄像头命令request构造器 + * + * @author yun11 + * @date 2023/05/11 + */ +@Component +public class SipRequestHeaderProvider { + + @Resource + private SipConfig sipConfig; + + @Resource + private SipFactory sipFactory; + + @Resource + @Qualifier(value="tcpSipProvider") + private SipProvider tcpSipProvider; + + @Resource + @Qualifier(value="udpSipProvider") + private SipProvider udpSipProvider; + + /** + * 创建Message信令请求报文 + * @param device + * @param content + * @param viaTag + * @param fromTag + * @param toTag + * @return {@link Request} + */ + public Request createMessageRequest(DeviceVideoEntity device, String content, String viaTag, String fromTag, String toTag) throws ParseException, InvalidArgumentException, PeerUnavailableException { + Request request = null; + // sipuri + SipURI requestUri = sipFactory.createAddressFactory().createSipURI(device.getVideoCode(), device.getHostAddress()); + // via + ArrayList viaHeaders = new ArrayList(); + ViaHeader viaHeader = sipFactory.createHeaderFactory().createViaHeader(sipConfig.getIp(), sipConfig.getPort(), device.getTransport(), viaTag); + viaHeader.setRPort(); + viaHeaders.add(viaHeader); + // from + SipURI fromSipURI = SipFactory.getInstance().createAddressFactory().createSipURI(sipConfig.getId(), sipConfig.getDomain()); + Address fromAddress = SipFactory.getInstance().createAddressFactory().createAddress(fromSipURI); + FromHeader fromHeader = SipFactory.getInstance().createHeaderFactory().createFromHeader(fromAddress, fromTag); + // to + SipURI toSipUri = sipFactory.createAddressFactory().createSipURI(device.getVideoCode(), device.getHostAddress()); + Address toAddress = sipFactory.createAddressFactory().createAddress(toSipUri); + ToHeader toHeader = sipFactory.createHeaderFactory().createToHeader(toAddress, toTag); + // callid + CallIdHeader callIdHeader = "TCP".equals(device.getTransport()) ? tcpSipProvider.getNewCallId() : udpSipProvider.getNewCallId(); + // Forwards + MaxForwardsHeader maxForwards = sipFactory.createHeaderFactory().createMaxForwardsHeader(70); + // ceq + CSeqHeader cSeqHeader = sipFactory.createHeaderFactory().createCSeqHeader(Long.valueOf(Math.abs(new SecureRandom().nextInt(Integer.MAX_VALUE)) - 1000), Request.MESSAGE); + + request = sipFactory.createMessageFactory().createRequest(requestUri, Request.MESSAGE, callIdHeader, cSeqHeader, fromHeader, + toHeader, viaHeaders, maxForwards); + ContentTypeHeader contentTypeHeader = sipFactory.createHeaderFactory().createContentTypeHeader("Application", "MANSCDP+xml"); + request.setContent(content, contentTypeHeader); + return request; + } + + public Request createInviteRequest(DeviceVideoEntity entity, String channelId, String content, String viaTag, String fromTag, String toTag, String ssrc, CallIdHeader callIdHeader) throws ParseException, InvalidArgumentException, PeerUnavailableException { + Request request = null; + //请求行 + SipURI requestLine = sipFactory.createAddressFactory().createSipURI(channelId, entity.getHostAddress()); + //via + ArrayList viaHeaders = new ArrayList(); + ViaHeader viaHeader = sipFactory.createHeaderFactory().createViaHeader(sipConfig.getIp(), sipConfig.getPort(), entity.getTransport(), viaTag); + viaHeader.setRPort(); + viaHeaders.add(viaHeader); + //from + SipURI fromSipUri = sipFactory.createAddressFactory().createSipURI(sipConfig.getId(), sipConfig.getDomain()); + Address fromAddress = sipFactory.createAddressFactory().createAddress(fromSipUri); + //必须要有标记,否则无法创建会话,无法回应ack + FromHeader fromHeader = sipFactory.createHeaderFactory().createFromHeader(fromAddress, fromTag); + //to + SipURI toSipUri = sipFactory.createAddressFactory().createSipURI(channelId, entity.getHostAddress()); + Address toAddress = sipFactory.createAddressFactory().createAddress(toSipUri); + ToHeader toHeader = sipFactory.createHeaderFactory().createToHeader(toAddress,null); + + //Forwards + MaxForwardsHeader maxForwards = sipFactory.createHeaderFactory().createMaxForwardsHeader(70); + + //ceq + CSeqHeader cSeqHeader = sipFactory.createHeaderFactory().createCSeqHeader(Long.valueOf(Math.abs(new SecureRandom().nextInt(Integer.MAX_VALUE)) - 1000), Request.INVITE); + request = sipFactory.createMessageFactory().createRequest(requestLine, Request.INVITE, callIdHeader, cSeqHeader,fromHeader, toHeader, viaHeaders, maxForwards); + + Address concatAddress = sipFactory.createAddressFactory().createAddress(sipFactory.createAddressFactory().createSipURI(sipConfig.getId(), sipConfig.getIp() + ":" + sipConfig.getPort())); + request.addHeader(sipFactory.createHeaderFactory().createContactHeader(concatAddress)); + // Subject + SubjectHeader subjectHeader = sipFactory.createHeaderFactory().createSubjectHeader(String.format("%s:%s,%s:%s", channelId, ssrc, sipConfig.getId(), 0)); + request.addHeader(subjectHeader); + ContentTypeHeader contentTypeHeader = sipFactory.createHeaderFactory().createContentTypeHeader("APPLICATION", "SDP"); + request.setContent(content, contentTypeHeader); + return request; + } + +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/sip/transmit/cmd/impl/SipDeviceCommanderImpl.java b/sip/src/main/java/com/dite/znpt/monitor/sip/transmit/cmd/impl/SipDeviceCommanderImpl.java new file mode 100644 index 0000000..72672fc --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/sip/transmit/cmd/impl/SipDeviceCommanderImpl.java @@ -0,0 +1,226 @@ +package com.dite.znpt.monitor.sip.transmit.cmd.impl; + +import cn.hutool.core.util.SerializeUtil; +import com.dite.znpt.monitor.constant.IotCacheConstants; +import com.dite.znpt.monitor.domain.entity.DeviceVideoEntity; +import com.dite.znpt.monitor.media.zlm.ZlmService; +import com.dite.znpt.monitor.sip.transmit.cmd.ISipDeviceCommander; +import com.dite.znpt.monitor.sip.transmit.cmd.SipRequestHeaderProvider; +import com.dite.znpt.service.impl.RedisService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Component; + +import javax.annotation.Resource; +import javax.sip.ClientTransaction; +import javax.sip.InvalidArgumentException; +import javax.sip.SipException; +import javax.sip.SipProvider; +import javax.sip.address.SipURI; +import javax.sip.header.CallIdHeader; +import javax.sip.header.ViaHeader; +import javax.sip.message.Request; +import java.text.ParseException; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * @Author: huise23 + * @Date: 2022/8/30 8:50 + * @Description: + */ +@Slf4j +@Component +public class SipDeviceCommanderImpl implements ISipDeviceCommander { + + private final static Pattern VIA_HEADER_PATTERN = Pattern.compile("(\\d+\\.\\d+\\.\\d+\\.\\d+)\\:(\\d+)"); + @Resource + @Qualifier(value="tcpSipProvider") + private SipProvider tcpSipProvider; + + @Resource + @Qualifier(value="udpSipProvider") + private SipProvider udpSipProvider; + + @Resource + private SipRequestHeaderProvider sipRequestHeaderProvider; + + @Resource + private ZlmService zlmService; + + @Resource + private RedisService redisService; + + /** + * 查询目录列表 + * @param entity + * @return {@link boolean} + */ + @Override + public boolean queryCatalog(DeviceVideoEntity entity) { + try { + StringBuffer content = new StringBuffer(200); + String charset = entity.getCharset(); + content.append("\r\n"); + content.append("\r\n"); + content.append(" Catalog\r\n"); + content.append(" " + (int)((Math.random()*9+1)*100000) + "\r\n"); + content.append(" " + entity.getVideoCode() + "\r\n"); + content.append("\r\n"); + + String tag = String.valueOf(System.nanoTime()); + Request request = sipRequestHeaderProvider.createMessageRequest(entity, content.toString(), tag, tag, null); + transmitRequest(entity.getTransport(), request); + } catch (SipException | ParseException | InvalidArgumentException e) { + e.printStackTrace(); + return false; + } + return true; + } + + /** + * 查询设备信息 + * @param entity + * @return {@link boolean} + */ + @Override + public boolean queryDeviceInfo(DeviceVideoEntity entity) { + try { + StringBuffer content = new StringBuffer(200); + String charset = entity.getCharset(); + content.append("\r\n"); + content.append("\r\n"); + content.append("DeviceInfo\r\n"); + content.append("" + (int)((Math.random()*9+1)*100000) + "\r\n"); + content.append("" + entity.getVideoCode() + "\r\n"); + content.append("\r\n"); + String tag = String.valueOf(System.nanoTime()); + Request request = sipRequestHeaderProvider.createMessageRequest(entity, content.toString(), tag, tag, null); + transmitRequest(entity.getTransport(), request); + } catch (SipException | ParseException | InvalidArgumentException e) { + e.printStackTrace(); + return false; + } + return true; + } + + /** + * 查询设备状态 + * @param entity + * @return {@link boolean} + */ + @Override + public boolean queryDeviceStatus(DeviceVideoEntity entity) { + try { + StringBuffer content = new StringBuffer(200); + content.append("\r\n"); + content.append("\r\n"); + content.append("DeviceStatus\r\n"); + content.append("" + (int)((Math.random()*9+1)*100000) + "\r\n"); + content.append("" + entity.getVideoCode() + "\r\n"); + content.append("\r\n"); + String tag = String.valueOf(System.nanoTime()); + Request request = sipRequestHeaderProvider.createMessageRequest(entity, content.toString(), tag, tag, tag); + transmitRequest(entity.getTransport(), request); + return true; + + } catch (SipException | ParseException | InvalidArgumentException e) { + e.printStackTrace(); + return false; + } + } + + /** + * 请求预览视频流 + * + * @param entity + * @param channelCode 流传输协议 + * @param ssrc + * @param ssrcPort + * @return {@link String} + */ + @Override + public void playStreamCmd(DeviceVideoEntity entity, String channelCode, String ssrc, Integer ssrcPort, String mediaIp){ + try { + String streamMode = entity.getStreamMode().toUpperCase(); + StringBuffer content = new StringBuffer(200); + content.append("v=0\r\n"); + content.append("o=" + channelCode + " 0 0 IN IP4 " + mediaIp + "\r\n"); + content.append("s=Play\r\n"); + content.append("c=IN IP4 " + mediaIp + "\r\n"); + content.append("t=0 0\r\n"); + if("TCP-PASSIVE".equals(streamMode)) { + content.append("m=video " + ssrcPort + " TCP/RTP/AVP 96 97 98 99\r\n"); + }else if ("TCP-ACTIVE".equals(streamMode)) { + content.append("m=video " + ssrcPort + " TCP/RTP/AVP 96 97 98 99\r\n"); + }else if("UDP".equals(streamMode)) { + content.append("m=video " + ssrcPort + " RTP/AVP 96 97 98 99\r\n"); + } + content.append("a=recvonly\r\n"); + content.append("a=rtpmap:96 PS/90000\r\n"); + content.append("a=rtpmap:98 H264/90000\r\n"); + content.append("a=rtpmap:97 MPEG4/90000\r\n"); + content.append("a=rtpmap:99 H265/90000\r\n"); + if ("TCP-PASSIVE".equals(streamMode)) { // tcp被动模式 + content.append("a=setup:passive\r\n"); + content.append("a=connection:new\r\n"); + } else if ("TCP-ACTIVE".equals(streamMode)) { // tcp主动模式 + content.append("a=setup:active\r\n"); + content.append("a=connection:new\r\n"); + } + content.append("y=" + ssrc + "\r\n");//ssrc + String tm = Long.toString(System.currentTimeMillis()); + CallIdHeader callIdHeader = "TCP".equals(entity.getTransport()) ? tcpSipProvider.getNewCallId() : udpSipProvider.getNewCallId(); + Request request = sipRequestHeaderProvider.createInviteRequest(entity, channelCode, content.toString(), null, "FromInvt" + tm, null, ssrc, callIdHeader); + ClientTransaction clientTransaction = transmitRequest(entity.getTransport(), request); + System.out.println("-----------------------------------------------------------"); + redisService.setCacheObject(IotCacheConstants.getClientTransactionCacheKey(ssrc), SerializeUtil.serialize(clientTransaction)); + } catch (ParseException | InvalidArgumentException | SipException e) { + System.out.println("[zlm]拉流失败"); + zlmService.release(entity.getVideoCode(), channelCode); + e.printStackTrace(); + } + } + + /** + * 停止视频流 + * + * @param ssrc + * @return + */ + @Override + public void stopStreamCmd(String ssrc) { + try { + ClientTransaction transaction = redisService.hasKey(ssrc) ? SerializeUtil.deserialize(redisService.getCacheObject(ssrc)) : null; + if ( null == transaction || null == transaction.getDialog()) { + return; + } + Request byeRequest = transaction.getDialog().createRequest(Request.BYE); + SipURI byeURI = (SipURI) byeRequest.getRequestURI(); + String vh = transaction.getRequest().getHeader(ViaHeader.NAME).toString(); + + Matcher matcher = VIA_HEADER_PATTERN.matcher(vh); + if (VIA_HEADER_PATTERN.matcher(vh).find()) { + byeURI.setHost(matcher.group(1)); + } + ViaHeader viaHeader = (ViaHeader) byeRequest.getHeader(ViaHeader.NAME); + String protocol = viaHeader.getTransport().toUpperCase(); + ClientTransaction clientTransaction = null; + if("TCP".equals(protocol)) { + clientTransaction = tcpSipProvider.getNewClientTransaction(byeRequest); + } else if("UDP".equals(protocol)) { + clientTransaction = udpSipProvider.getNewClientTransaction(byeRequest); + } + transaction.getDialog().sendRequest(clientTransaction); + redisService.deleteObject(ssrc); + } catch (SipException | ParseException e) { + e.printStackTrace(); + } + } + + private ClientTransaction transmitRequest(String transport, Request request) throws SipException { + ClientTransaction clientTransaction = "TCP".equals(transport) ? tcpSipProvider.getNewClientTransaction(request) : udpSipProvider.getNewClientTransaction(request); + clientTransaction.sendRequest(); + return clientTransaction; + } +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/sip/transmit/request/ISipRequestProcessor.java b/sip/src/main/java/com/dite/znpt/monitor/sip/transmit/request/ISipRequestProcessor.java new file mode 100644 index 0000000..14ad459 --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/sip/transmit/request/ISipRequestProcessor.java @@ -0,0 +1,12 @@ +package com.dite.znpt.monitor.sip.transmit.request; + +import javax.sip.RequestEvent; + +/** + * @Author: huise23 + * @Date: 2022/8/10 16:46 + * @Description: + */ +public interface ISipRequestProcessor { + void process(RequestEvent event); +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/sip/transmit/request/ISipRequestProcessorAbstract.java b/sip/src/main/java/com/dite/znpt/monitor/sip/transmit/request/ISipRequestProcessorAbstract.java new file mode 100644 index 0000000..20d7e99 --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/sip/transmit/request/ISipRequestProcessorAbstract.java @@ -0,0 +1,259 @@ +package com.dite.znpt.monitor.sip.transmit.request; + +import gov.nist.javax.sip.SipProviderImpl; +import gov.nist.javax.sip.SipStackImpl; +import gov.nist.javax.sip.message.SIPRequest; +import gov.nist.javax.sip.stack.SIPServerTransaction; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.ArrayUtils; +import org.dom4j.Document; +import org.dom4j.DocumentException; +import org.dom4j.Element; +import org.dom4j.io.SAXReader; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; + +import javax.sip.*; +import javax.sip.address.Address; +import javax.sip.address.AddressFactory; +import javax.sip.address.SipURI; +import javax.sip.header.ContentTypeHeader; +import javax.sip.header.ExpiresHeader; +import javax.sip.header.HeaderFactory; +import javax.sip.header.ViaHeader; +import javax.sip.message.MessageFactory; +import javax.sip.message.Request; +import javax.sip.message.Response; +import java.io.ByteArrayInputStream; +import java.text.ParseException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +/** + * @Author: huise23 + * @Date: 2022/8/10 16:48 + * @Description: + */ + +@Slf4j +public abstract class ISipRequestProcessorAbstract { + + @Autowired + @Qualifier(value="tcpSipProvider") + private SipProviderImpl tcpSipProvider; + + @Autowired + @Qualifier(value="udpSipProvider") + private SipProviderImpl udpSipProvider; + + /** + * 根据 RequestEvent 获取 ServerTransaction + * @param evt + * @return + */ + public ServerTransaction getServerTransaction(RequestEvent evt) { + Request request = evt.getRequest(); + ServerTransaction serverTransaction = evt.getServerTransaction(); + // 判断TCP还是UDP + boolean isTcp = false; + ViaHeader reqViaHeader = (ViaHeader) request.getHeader(ViaHeader.NAME); + String transport = reqViaHeader.getTransport(); + if ("TCP".equals(transport)) { + isTcp = true; + } + + if (serverTransaction == null) { + try { + if (isTcp) { + SipStackImpl stack = (SipStackImpl)tcpSipProvider.getSipStack(); + serverTransaction = (SIPServerTransaction) stack.findTransaction((SIPRequest)request, true); + if (serverTransaction == null) { + serverTransaction = tcpSipProvider.getNewServerTransaction(request); + } + } else { + SipStackImpl stack = (SipStackImpl)udpSipProvider.getSipStack(); + serverTransaction = (SIPServerTransaction) stack.findTransaction((SIPRequest)request, true); + if (serverTransaction == null) { + serverTransaction = udpSipProvider.getNewServerTransaction(request); + } + } + } catch (TransactionAlreadyExistsException e) { + log.error(e.getMessage()); + } catch (TransactionUnavailableException e) { + log.error(e.getMessage()); + } + } + return serverTransaction; + } + + public AddressFactory getAddressFactory() { + try { + return SipFactory.getInstance().createAddressFactory(); + } catch (PeerUnavailableException e) { + e.printStackTrace(); + } + return null; + } + + public HeaderFactory getHeaderFactory() { + try { + return SipFactory.getInstance().createHeaderFactory(); + } catch (PeerUnavailableException e) { + e.printStackTrace(); + } + return null; + } + + public MessageFactory getMessageFactory() { + try { + return SipFactory.getInstance().createMessageFactory(); + } catch (PeerUnavailableException e) { + e.printStackTrace(); + } + return null; + } + + /*** + * 回复状态码 + * 100 trying + * 200 OK + * 400 + * 404 + * @param evt + * @throws SipException + * @throws InvalidArgumentException + * @throws ParseException + */ + public void responseAck(RequestEvent evt, int statusCode) throws SipException, InvalidArgumentException, ParseException { + Response response = getMessageFactory().createResponse(statusCode, evt.getRequest()); + ServerTransaction serverTransaction = getServerTransaction(evt); + if (serverTransaction == null) { + log.warn("回复失败:{}", response); + return; + } + serverTransaction.sendResponse(response); + if (statusCode >= 200 && !"NOTIFY".equals(evt.getRequest().getMethod())) { + if (serverTransaction.getDialog() != null) { + serverTransaction.getDialog().delete(); + } + } + } + + public void responseAck(RequestEvent evt, int statusCode, String msg) throws SipException, InvalidArgumentException, ParseException { + Response response = getMessageFactory().createResponse(statusCode, evt.getRequest()); + response.setReasonPhrase(msg); + ServerTransaction serverTransaction = getServerTransaction(evt); + serverTransaction.sendResponse(response); + if (statusCode >= 200 && !"NOTIFY".equals(evt.getRequest().getMethod())) { + if (serverTransaction.getDialog() != null) { + serverTransaction.getDialog().delete(); + } + } + } + + /** + * 回复带sdp的200 + * @param evt + * @param sdp + * @param sipServerCode SIP服务国标编码 + * @param serverIp SIP服务ip + * @param sipServerPort SIP服务端口 + * @return + */ + public void responseSdpAck(RequestEvent evt, String sdp, String sipServerCode, String serverIp, Integer sipServerPort) throws SipException, InvalidArgumentException, ParseException { + Response response = getMessageFactory().createResponse(Response.OK, evt.getRequest()); + SipFactory sipFactory = SipFactory.getInstance(); + ContentTypeHeader contentTypeHeader = sipFactory.createHeaderFactory().createContentTypeHeader("APPLICATION", "SDP"); + response.setContent(sdp, contentTypeHeader); + + // 兼容国标中的使用编码@域名作为RequestURI的情况 + SipURI sipURI = (SipURI)evt.getRequest().getRequestURI(); + if (sipURI.getPort() == -1) { + sipURI = sipFactory.createAddressFactory().createSipURI(sipServerCode, serverIp+":" + sipServerPort); + } + log.debug("responseSdpAck SipURI: {}:{}", sipURI.getHost(), sipURI.getPort()); + + Address concatAddress = sipFactory.createAddressFactory().createAddress( + sipFactory.createAddressFactory().createSipURI(sipURI.getUser(), sipURI.getHost()+":"+sipURI.getPort() + )); + response.addHeader(sipFactory.createHeaderFactory().createContactHeader(concatAddress)); + getServerTransaction(evt).sendResponse(response); + } + + /** + * 回复带xml的200 + * @param evt + * @param xml + * @param sipServerCode SIP服务国标编码 + * @param serverIp SIP服务ip + * @param sipServerPort SIP服务端口 + * @throws SipException + * @throws InvalidArgumentException + * @throws ParseException + */ + public Response responseXmlAck(RequestEvent evt, String xml, String sipServerCode, String serverIp, Integer sipServerPort) throws SipException, InvalidArgumentException, ParseException { + Response response = getMessageFactory().createResponse(Response.OK, evt.getRequest()); + SipFactory sipFactory = SipFactory.getInstance(); + ContentTypeHeader contentTypeHeader = sipFactory.createHeaderFactory().createContentTypeHeader("Application", "MANSCDP+xml"); + response.setContent(xml, contentTypeHeader); + + // 兼容国标中的使用编码@域名作为RequestURI的情况 + SipURI sipURI = (SipURI)evt.getRequest().getRequestURI(); + if (sipURI.getPort() == -1) { + sipURI = sipFactory.createAddressFactory().createSipURI(sipServerCode, serverIp + ":" + sipServerPort); + } + log.debug("responseXmlAck SipURI: {}:{}", sipURI.getHost(), sipURI.getPort()); + + Address concatAddress = sipFactory.createAddressFactory().createAddress( + sipFactory.createAddressFactory().createSipURI(sipURI.getUser(), sipURI.getHost()+":"+sipURI.getPort() + )); + response.addHeader(sipFactory.createHeaderFactory().createContactHeader(concatAddress)); + response.addHeader(evt.getRequest().getHeader(ExpiresHeader.NAME)); + getServerTransaction(evt).sendResponse(response); + return response; + } + + public Element getRootElement(RequestEvent evt) throws DocumentException { + return getRootElement(evt, "gb2312"); + } + + public Element getRootElement(RequestEvent evt, String charset) throws DocumentException { + if (charset == null) { + charset = "gb2312"; + } + Request request = evt.getRequest(); + SAXReader reader = new SAXReader(); + reader.setEncoding(charset); + // 对海康出现的未转义字符做处理。 + String[] destStrArray = new String[]{"<",">","&","'","""}; + char despChar = '&'; // 或许可扩展兼容其他字符 + byte destBye = (byte) despChar; + List result = new ArrayList<>(); + byte[] rawContent = request.getRawContent(); + if (rawContent == null) { + return null; + } + for (int i = 0; i < rawContent.length; i++) { + if (rawContent[i] == destBye) { + boolean resul = false; + for (String destStr : destStrArray) { + if (i + destStr.length() <= rawContent.length) { + byte[] bytes = Arrays.copyOfRange(rawContent, i, i + destStr.length()); + resul = resul || (Arrays.equals(bytes,destStr.getBytes())); + } + } + if (resul) { + result.add(rawContent[i]); + } + }else { + result.add(rawContent[i]); + } + } + Byte[] bytes = new Byte[0]; + byte[] bytesResult = ArrayUtils.toPrimitive(result.toArray(bytes)); + + Document xml = reader.read(new ByteArrayInputStream(bytesResult)); + return xml.getRootElement(); + } +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/sip/transmit/request/impl/AckRequestProcessorImpl.java b/sip/src/main/java/com/dite/znpt/monitor/sip/transmit/request/impl/AckRequestProcessorImpl.java new file mode 100644 index 0000000..4fdfe4c --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/sip/transmit/request/impl/AckRequestProcessorImpl.java @@ -0,0 +1,53 @@ +package com.dite.znpt.monitor.sip.transmit.request.impl; + +import com.dite.znpt.monitor.sip.transmit.SipProcessorFactoryImpl; +import com.dite.znpt.monitor.sip.transmit.request.ISipRequestProcessor; +import com.dite.znpt.monitor.sip.transmit.request.ISipRequestProcessorAbstract; +import gov.nist.javax.sip.header.CSeq; +import lombok.extern.slf4j.Slf4j; +import org.dom4j.DocumentException; +import org.springframework.beans.factory.InitializingBean; +import org.springframework.stereotype.Component; + +import javax.annotation.Resource; +import javax.sip.Dialog; +import javax.sip.InvalidArgumentException; +import javax.sip.RequestEvent; +import javax.sip.SipException; +import javax.sip.message.Request; + +/** + * @Author: huise23 + * @Date: 2022/8/10 16:54 + * @Description: + */ +@Slf4j +@Component +public class AckRequestProcessorImpl extends ISipRequestProcessorAbstract implements InitializingBean, ISipRequestProcessor { + + private final String METHOD = "ACK"; + + @Resource + private SipProcessorFactoryImpl sipProcessorFactory; + + @Override + public void afterPropertiesSet() { + sipProcessorFactory.addRequestProcessor(METHOD, this); + } + + + @Override + public void process(RequestEvent evt) { + Request request = evt.getRequest(); + Dialog dialog = evt.getDialog(); + try { + log.info("接收到bye请求:{}", getRootElement(evt)); + CSeq csReq = (CSeq) request.getHeader(CSeq.NAME); + Request ackRequest = dialog.createAck(csReq.getSeqNumber()); + dialog.sendAck(ackRequest); + log.info("send ack : " + ackRequest.toString()); + } catch (SipException | InvalidArgumentException | DocumentException e) { + e.printStackTrace(); + } + } +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/sip/transmit/request/impl/ByeRequestProcessorImpl.java b/sip/src/main/java/com/dite/znpt/monitor/sip/transmit/request/impl/ByeRequestProcessorImpl.java new file mode 100644 index 0000000..a872d5f --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/sip/transmit/request/impl/ByeRequestProcessorImpl.java @@ -0,0 +1,63 @@ +package com.dite.znpt.monitor.sip.transmit.request.impl; + +import com.dite.znpt.monitor.domain.entity.DeviceVideoEntity; +import com.dite.znpt.monitor.media.zlm.ZlmService; +import com.dite.znpt.monitor.service.DeviceVideoService; +import com.dite.znpt.monitor.sip.transmit.SipProcessorFactoryImpl; +import com.dite.znpt.monitor.sip.transmit.request.ISipRequestProcessor; +import com.dite.znpt.monitor.sip.transmit.request.ISipRequestProcessorAbstract; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.InitializingBean; +import org.springframework.stereotype.Component; + +import javax.annotation.Resource; +import javax.sip.*; +import javax.sip.address.SipURI; +import javax.sip.header.FromHeader; +import javax.sip.header.HeaderAddress; +import javax.sip.message.Response; +import java.text.ParseException; + +/** + * @Author: huise23 + * @Date: 2022/8/10 16:55 + * @Description: + */ +@Slf4j +@Component +public class ByeRequestProcessorImpl extends ISipRequestProcessorAbstract implements InitializingBean, ISipRequestProcessor { + + private final String METHOD = "BYE"; + + @Resource + private SipProcessorFactoryImpl sipProcessorFactory; + + @Resource + private DeviceVideoService deviceVideoService; + + @Resource + private ZlmService zlmService; + + @Override + public void afterPropertiesSet() { + sipProcessorFactory.addRequestProcessor(METHOD, this); + } + @Override + public void process(RequestEvent evt) { + try { + responseAck(evt, Response.OK); + Dialog dialog = evt.getDialog(); + if (dialog == null) { + return; + } + if (dialog.getState().equals(DialogState.TERMINATED)) { + String channelCode = ((SipURI) ((HeaderAddress) evt.getRequest().getHeader(FromHeader.NAME)).getAddress().getURI()).getUser(); + DeviceVideoEntity videoEntity = deviceVideoService.getByChannelCode(channelCode); + zlmService.release(videoEntity.getVideoCode(), channelCode); + } + } catch (SipException | InvalidArgumentException | ParseException e) { + e.printStackTrace(); + } + } + +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/sip/transmit/request/impl/MessageRequestProcessorImpl.java b/sip/src/main/java/com/dite/znpt/monitor/sip/transmit/request/impl/MessageRequestProcessorImpl.java new file mode 100644 index 0000000..674bbf6 --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/sip/transmit/request/impl/MessageRequestProcessorImpl.java @@ -0,0 +1,75 @@ +package com.dite.znpt.monitor.sip.transmit.request.impl; + +import com.dite.znpt.monitor.domain.entity.DeviceVideoEntity; +import com.dite.znpt.monitor.service.DeviceVideoService; +import com.dite.znpt.monitor.sip.transmit.SipProcessorFactoryImpl; +import com.dite.znpt.monitor.sip.transmit.request.ISipRequestProcessor; +import com.dite.znpt.monitor.sip.transmit.request.ISipRequestProcessorAbstract; +import com.dite.znpt.monitor.sip.transmit.request.impl.message.IMessageHandler; +import com.dite.znpt.monitor.sip.utils.XmlUtil; +import lombok.extern.slf4j.Slf4j; +import org.dom4j.DocumentException; +import org.dom4j.Element; +import org.springframework.beans.factory.InitializingBean; +import org.springframework.stereotype.Component; + +import javax.annotation.Resource; +import javax.sip.RequestEvent; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +/** + * @Author: huise23 + * @Date: 2022/8/29 18:43 + * @Description: + */ +@Slf4j +@Component +public class MessageRequestProcessorImpl extends ISipRequestProcessorAbstract implements InitializingBean, ISipRequestProcessor { + + private final String METHOD = "MESSAGE"; + + public Map messageHandlerMap = new ConcurrentHashMap<>(); + + public void addHandler(String cmdType, IMessageHandler messageHandler) { + messageHandlerMap.put(cmdType, messageHandler); + } + + @Resource + private SipProcessorFactoryImpl sipProcessorFactory; + + @Resource + private DeviceVideoService deviceVideoService; + + @Override + public void afterPropertiesSet() { + sipProcessorFactory.addRequestProcessor(METHOD, this); + } + + @Override + public void process(RequestEvent event) { + try { + Element rootElement = getRootElement(event); + String cmd = XmlUtil.getText(rootElement,"CmdType"); + log.info("接收到message请求:{}", cmd); + IMessageHandler messageHandler = messageHandlerMap.get(cmd); + if(null == messageHandler){ + log.info("不支持的消息类型:{}", cmd); + return; + } + String videoCode = rootElement.element("DeviceID").getText(); + DeviceVideoEntity entity = deviceVideoService.getByCode(videoCode); + if(null == entity){ + log.info("设备未注册,国标编码:{}", videoCode); + return; + } + messageHandler.process(entity, event); + + } catch (DocumentException e) { + e.printStackTrace(); + } + } + + + +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/sip/transmit/request/impl/RegisterRequestProcessorImpl.java b/sip/src/main/java/com/dite/znpt/monitor/sip/transmit/request/impl/RegisterRequestProcessorImpl.java new file mode 100644 index 0000000..da11e57 --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/sip/transmit/request/impl/RegisterRequestProcessorImpl.java @@ -0,0 +1,158 @@ +package com.dite.znpt.monitor.sip.transmit.request.impl; + +import cn.hutool.core.util.StrUtil; +import cn.hutool.json.JSONUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.dite.znpt.monitor.constant.dict.DeviceStatus; +import com.dite.znpt.monitor.domain.entity.DeviceVideoEntity; +import com.dite.znpt.monitor.service.DeviceVideoService; +import com.dite.znpt.monitor.service.IpConfigService; +import com.dite.znpt.monitor.sip.config.SipConfig; +import com.dite.znpt.monitor.sip.transmit.SipProcessorFactoryImpl; +import com.dite.znpt.monitor.sip.transmit.cmd.ISipDeviceCommander; +import com.dite.znpt.monitor.sip.transmit.request.ISipRequestProcessor; +import com.dite.znpt.monitor.sip.transmit.request.ISipRequestProcessorAbstract; +import com.dite.znpt.monitor.sip.utils.DigestServerAuthenticationHelper; +import gov.nist.javax.sip.address.AddressImpl; +import gov.nist.javax.sip.address.SipUri; +import gov.nist.javax.sip.header.Expires; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.ObjectUtils; +import org.springframework.beans.factory.InitializingBean; +import org.springframework.stereotype.Component; + +import javax.annotation.Resource; +import javax.sip.InvalidArgumentException; +import javax.sip.RequestEvent; +import javax.sip.SipException; +import javax.sip.header.*; +import javax.sip.message.Request; +import javax.sip.message.Response; +import java.security.NoSuchAlgorithmException; +import java.text.ParseException; +import java.time.LocalDateTime; +import java.util.Calendar; +import java.util.List; +import java.util.Locale; + +/** + * @Author: huise23 + * @Date: 2022/8/10 16:53 + * @Description: + */ +@Slf4j +@Component +public class RegisterRequestProcessorImpl extends ISipRequestProcessorAbstract implements InitializingBean, ISipRequestProcessor { + + public final String METHOD = "REGISTER"; + + @Resource + private SipProcessorFactoryImpl sipProcessorFactory; + + @Resource + private SipConfig sipConfig; + + @Resource + private DeviceVideoService deviceVideoService; + + @Resource + private ISipDeviceCommander sipDeviceCommander; + + @Resource + private IpConfigService ipConfigService; + + @Override + public void afterPropertiesSet() { + sipProcessorFactory.addRequestProcessor(METHOD, this); + } + + @Override + public synchronized void process(RequestEvent evt) { + try { + log.info("收到注册请求,开始处理"); + Request request = evt.getRequest(); + Response response; + // 注册标志 + boolean registerFlag = false; + AuthorizationHeader authorHeader = (AuthorizationHeader) request.getHeader(AuthorizationHeader.NAME); + + String password = sipConfig.getPassword(); + if (StrUtil.isNotBlank(password)) { + // 未携带授权头或者密码错误 回复401 + if (authorHeader == null && StrUtil.isNotEmpty(sipConfig.getPassword())) { + log.info("未携带授权头或者密码错误,回复401"); + response = getMessageFactory().createResponse(Response.UNAUTHORIZED, request); + new DigestServerAuthenticationHelper().generateChallenge(getHeaderFactory(), response, sipConfig.getDomain()); + getServerTransaction(evt).sendResponse(response); + return; + } + // 校验密码是否正确 + boolean passwordCorrect = new DigestServerAuthenticationHelper().doAuthenticatePlainTextPassword(request, sipConfig.getPassword()); + if (!passwordCorrect) { + response = getMessageFactory().createResponse(Response.FORBIDDEN, request); + response.setReasonPhrase("wrong password"); + log.info("[注册请求] 密码/SIP服务器ID错误, 回复403"); + getServerTransaction(evt).sendResponse(response); + return; + } + } + // 携带授权头并且密码正确 + response = getMessageFactory().createResponse(Response.OK, request); + // 添加date头 + response.addHeader(getHeaderFactory().createDateHeader(Calendar.getInstance(Locale.ENGLISH))); + ExpiresHeader expiresHeader = (ExpiresHeader) request.getHeader(Expires.NAME); + // 添加Contact头 + response.addHeader(request.getHeader(ContactHeader.NAME)); + // 添加Expires头 + response.addHeader(request.getExpires()); + // 获取到通信地址等信息 + FromHeader fromHeader = (FromHeader) request.getHeader(FromHeader.NAME); + ViaHeader viaHeader = (ViaHeader) request.getHeader(ViaHeader.NAME); + AddressImpl address = (AddressImpl) fromHeader.getAddress(); + SipUri uri = (SipUri) address.getURI(); + String videoCode = uri.getUser(); + DeviceVideoEntity entity = deviceVideoService.getByCode(videoCode); + log.info("entity:"+JSONUtil.toJsonStr(entity)); + if (expiresHeader != null && expiresHeader.getExpires() == 0) { + // 注册失败 + registerFlag = false; + } else { + // 注册成功 + registerFlag = true; + if (entity == null) { + entity = new DeviceVideoEntity(); + entity.setStreamMode("UDP"); + entity.setVideoCode(videoCode); + entity.setVideoCode(DeviceStatus.OFFLINE.getValue()); + } + entity.setVideoCode(videoCode); + entity.setExpires(expiresHeader.getExpires()); + + String ip = viaHeader.getHost(); + int rPort = viaHeader.getRPort(); + // 解析本地地址替代 + if (ObjectUtils.isEmpty(ip) || rPort == -1) { + ip = viaHeader.getHost(); + rPort = viaHeader.getPort(); + } + entity.setIp(ip); + entity.setPort(rPort); + entity.setHostAddress(ip.concat(":").concat(String.valueOf(rPort))); + // 判断TCP还是UDP + ViaHeader reqViaHeader = (ViaHeader) request.getHeader(ViaHeader.NAME); + entity.setTransport("TCP".equals(reqViaHeader.getTransport()) ? "TCP" : "UDP"); + entity.setCharset("GB2312"); + } + getServerTransaction(evt).sendResponse(response); + if(registerFlag){ + entity.setRegisterTime(LocalDateTime.now()); + deviceVideoService.online(entity); + }else{ + deviceVideoService.offline(videoCode); + } + } catch (SipException | InvalidArgumentException | NoSuchAlgorithmException | ParseException e) { + e.printStackTrace(); + } + } + +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/sip/transmit/request/impl/message/IMessageHandler.java b/sip/src/main/java/com/dite/znpt/monitor/sip/transmit/request/impl/message/IMessageHandler.java new file mode 100644 index 0000000..36db6b6 --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/sip/transmit/request/impl/message/IMessageHandler.java @@ -0,0 +1,20 @@ +package com.dite.znpt.monitor.sip.transmit.request.impl.message; + +import com.dite.znpt.monitor.domain.entity.DeviceVideoEntity; + +import javax.sip.RequestEvent; + +/** + * @Author: huise23 + * @Date: 2022/9/1 13:48 + * @Description: + */ +public interface IMessageHandler { + + /** + * 处理消息 + * @param evt + * @return + */ + void process(DeviceVideoEntity entity, RequestEvent evt); +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/sip/transmit/request/impl/message/query/CatalogHandlerImpl.java b/sip/src/main/java/com/dite/znpt/monitor/sip/transmit/request/impl/message/query/CatalogHandlerImpl.java new file mode 100644 index 0000000..bd28287 --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/sip/transmit/request/impl/message/query/CatalogHandlerImpl.java @@ -0,0 +1,137 @@ +package com.dite.znpt.monitor.sip.transmit.request.impl.message.query; + +import cn.hutool.core.util.NumberUtil; +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.core.util.StrUtil; +import com.dite.znpt.monitor.constant.dict.DeviceStatus; +import com.dite.znpt.monitor.domain.entity.DeviceVideoChannelEntity; +import com.dite.znpt.monitor.domain.entity.DeviceVideoEntity; +import com.dite.znpt.monitor.service.DeviceVideoChannelService; +import com.dite.znpt.monitor.service.DeviceVideoService; +import com.dite.znpt.monitor.sip.transmit.request.ISipRequestProcessorAbstract; +import com.dite.znpt.monitor.sip.transmit.request.impl.MessageRequestProcessorImpl; +import com.dite.znpt.monitor.sip.transmit.request.impl.message.IMessageHandler; +import com.dite.znpt.monitor.sip.utils.XmlUtil; +import lombok.extern.slf4j.Slf4j; +import org.dom4j.DocumentException; +import org.dom4j.Element; +import org.springframework.beans.factory.InitializingBean; +import org.springframework.stereotype.Component; + +import javax.annotation.Resource; +import javax.sip.InvalidArgumentException; +import javax.sip.RequestEvent; +import javax.sip.SipException; +import javax.sip.message.Response; +import java.text.ParseException; +import java.time.LocalDateTime; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * @Author: huise23 + * @Date: 2022/9/1 13:33 + * @Description: + */ +@Slf4j +@Component +public class CatalogHandlerImpl extends ISipRequestProcessorAbstract implements InitializingBean, IMessageHandler { + + private final static String CMD_TYPE = "Catalog"; + + @Resource + private MessageRequestProcessorImpl messageRequestProcessor; + + @Resource + private DeviceVideoService deviceVideoService; + + @Resource + private DeviceVideoChannelService deviceVideoChannelService; + + @Override + public void afterPropertiesSet(){ + messageRequestProcessor.addHandler(CMD_TYPE, this); + } + + /** + * 处理消息 + * + * @param evt + * @param entity + * @return + */ + @Override + public void process(DeviceVideoEntity entity, RequestEvent evt) { + try { + Element rootElement = getRootElement(evt); + log.info("接收到catalog消息"); + Element deviceChannelElement = rootElement.element("DeviceList"); + Element sumNumElement = rootElement.element("SumNum"); + Element snElement = rootElement.element("SN"); + if (snElement == null || sumNumElement == null || deviceChannelElement == null) { + log.info("报文异常:{},{},{}", deviceChannelElement.getText(), sumNumElement.getText(), snElement.getText()); + responseAck(evt, Response.BAD_REQUEST); + return; + } + Iterator deviceListIterator = deviceChannelElement.elementIterator(); + if (deviceListIterator != null) { + List channelEntityList = deviceVideoChannelService.selectDeviceVideoChannelByVideoCode(entity.getVideoId()); + Map channelCodeMapEntity = channelEntityList.stream().collect(Collectors.toMap(k->k.getChannelCode(), v->v)); + // 遍历DeviceList + while (deviceListIterator.hasNext()) { + Element itemDevice = deviceListIterator.next(); + Element channelDeviceElement = itemDevice.element("DeviceID"); + + int parental = NumberUtil.isInteger(XmlUtil.getText(itemDevice,"Parental")) ? NumberUtil.parseInt(XmlUtil.getText(itemDevice,"Parental")): 0; + String parentId = XmlUtil.getText(itemDevice, "ParentID"); + if (channelDeviceElement == null || parental != 0 || StrUtil.isEmpty(parentId)) { + continue; + } + String channelCode = channelDeviceElement.getText(); + DeviceVideoChannelEntity channelEntity = channelCodeMapEntity.containsKey(channelCode) ? channelCodeMapEntity.get(channelCode) : new DeviceVideoChannelEntity(); + channelEntity.setChannelCode(channelCode); + channelEntity.setVideoId(entity.getVideoId()); + channelEntity.setChannelName( ObjectUtil.isNotEmpty(itemDevice.element("Name")) ? itemDevice.element("Name").getText(): ""); + channelEntity.setManufacture(XmlUtil.getText(itemDevice,"Manufacturer")); + channelEntity.setModel(XmlUtil.getText(itemDevice,"Model")); + channelEntity.setOwner(XmlUtil.getText(itemDevice,"Owner")); + channelEntity.setCivilCode(XmlUtil.getText(itemDevice,"CivilCode")); + channelEntity.setBlock(XmlUtil.getText(itemDevice,"Block")); + channelEntity.setAddress(XmlUtil.getText(itemDevice,"Address")); + channelEntity.setParental(parental); + channelEntity.setParentId(parentId); + channelEntity.setSafetyWay(NumberUtil.isInteger(XmlUtil.getText(itemDevice,"SafetyWay")) ? NumberUtil.parseInt(XmlUtil.getText(itemDevice,"SafetyWay")):0); + channelEntity.setRegisterWay(NumberUtil.isInteger(XmlUtil.getText(itemDevice,"RegisterWay"))? NumberUtil.parseInt(XmlUtil.getText(itemDevice,"RegisterWay")): 1); + channelEntity.setCertNum(XmlUtil.getText(itemDevice,"CertNum")); + channelEntity.setCertifiable(NumberUtil.isInteger(XmlUtil.getText(itemDevice,"Certifiable"))? NumberUtil.parseInt(XmlUtil.getText(itemDevice,"Certifiable")): 0); + channelEntity.setErrCode(NumberUtil.isInteger(XmlUtil.getText(itemDevice,"ErrCode"))? NumberUtil.parseInt(XmlUtil.getText(itemDevice,"ErrCode")): 0); + channelEntity.setCertNum(XmlUtil.getText(itemDevice,"CertNum")); + channelEntity.setEndTime(XmlUtil.getText(itemDevice,"EndTime")); + channelEntity.setSecrecy(XmlUtil.getText(itemDevice,"Secrecy")); + channelEntity.setIpAddress(XmlUtil.getText(itemDevice,"IPAddress")); + channelEntity.setPort(NumberUtil.isInteger(XmlUtil.getText(itemDevice,"Port"))? NumberUtil.parseInt(XmlUtil.getText(itemDevice,"Port")): 0); + channelEntity.setPassword(XmlUtil.getText(itemDevice,"Password")); + Element statusElement = itemDevice.element("Status"); + String status = statusElement != null && "OFF".equals(statusElement.getText())? DeviceStatus.OFFLINE.getValue() : DeviceStatus.ONLINE.getValue(); + channelEntity.setStatus(status); + channelEntity.setLongitude(NumberUtil.isDouble(XmlUtil.getText(itemDevice,"Longitude"))?NumberUtil.parseDouble(XmlUtil.getText(itemDevice,"Longitude")): 0.00); + channelEntity.setLatitude(NumberUtil.isDouble(XmlUtil.getText(itemDevice,"Latitude"))?NumberUtil.parseDouble(XmlUtil.getText(itemDevice,"Latitude")): 0.00); + channelEntity.setUpdateTime(LocalDateTime.now()); + channelEntityList.add(channelEntity); + } + deviceVideoChannelService.saveOrUpdateBatch(channelEntityList); + + entity.setChannelCount(channelEntityList.size()); + entity.setUpdateTime(LocalDateTime.now()); + deviceVideoService.updateById(entity); + + responseAck(evt, Response.OK); + } + } catch (DocumentException | SipException | InvalidArgumentException | ParseException e) { + e.printStackTrace(); + } + } + +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/sip/transmit/request/impl/message/query/DeviceInfoHandlerImpl.java b/sip/src/main/java/com/dite/znpt/monitor/sip/transmit/request/impl/message/query/DeviceInfoHandlerImpl.java new file mode 100644 index 0000000..7e44cb4 --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/sip/transmit/request/impl/message/query/DeviceInfoHandlerImpl.java @@ -0,0 +1,68 @@ +package com.dite.znpt.monitor.sip.transmit.request.impl.message.query; + +import com.dite.znpt.monitor.domain.entity.DeviceVideoEntity; +import com.dite.znpt.monitor.service.DeviceVideoService; +import com.dite.znpt.monitor.sip.transmit.request.ISipRequestProcessorAbstract; +import com.dite.znpt.monitor.sip.transmit.request.impl.MessageRequestProcessorImpl; +import com.dite.znpt.monitor.sip.transmit.request.impl.message.IMessageHandler; +import com.dite.znpt.monitor.sip.utils.XmlUtil; +import lombok.extern.slf4j.Slf4j; +import org.dom4j.DocumentException; +import org.dom4j.Element; +import org.springframework.beans.factory.InitializingBean; +import org.springframework.stereotype.Component; + +import javax.annotation.Resource; +import javax.sip.InvalidArgumentException; +import javax.sip.RequestEvent; +import javax.sip.SipException; +import javax.sip.message.Response; +import java.text.ParseException; +import java.time.LocalDateTime; + +/** + * @Author: huise23 + * @Date: 2022/9/1 13:34 + * @Description: blog.csdn.net/Marvin1311/article/details/98845468 + */ +@Slf4j +@Component +public class DeviceInfoHandlerImpl extends ISipRequestProcessorAbstract implements InitializingBean, IMessageHandler { + + private final static String CMD_TYPE = "DeviceInfo"; + + @Resource + private MessageRequestProcessorImpl messageRequestProcessor; + + @Resource + private DeviceVideoService deviceVideoService; + + @Override + public void afterPropertiesSet() { + messageRequestProcessor.addHandler(CMD_TYPE, this); + } + + /** + * 处理消息 + * + * @param evt + * @param entity + * @return + */ + @Override + public void process(DeviceVideoEntity entity, RequestEvent evt) { + try { + Element rootElement = getRootElement(evt); + log.info("接收到deviceInfo消息"); + entity.setVideoName(XmlUtil.getText(rootElement,"DeviceName")); + entity.setManufacturer(XmlUtil.getText(rootElement,"Manufacturer")); + entity.setModel(XmlUtil.getText(rootElement,"Model")); + entity.setFirmware(XmlUtil.getText(rootElement,"Firmware")); + entity.setUpdateTime(LocalDateTime.now()); + deviceVideoService.updateById(entity); + responseAck(evt, Response.OK); + } catch (DocumentException | SipException | InvalidArgumentException | ParseException e) { + e.printStackTrace(); + } + } +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/sip/transmit/request/impl/message/query/DeviceStatusHandlerImpl.java b/sip/src/main/java/com/dite/znpt/monitor/sip/transmit/request/impl/message/query/DeviceStatusHandlerImpl.java new file mode 100644 index 0000000..8a28193 --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/sip/transmit/request/impl/message/query/DeviceStatusHandlerImpl.java @@ -0,0 +1,68 @@ +package com.dite.znpt.monitor.sip.transmit.request.impl.message.query; + +import com.dite.znpt.monitor.domain.entity.DeviceVideoEntity; +import com.dite.znpt.monitor.service.DeviceVideoService; +import com.dite.znpt.monitor.sip.transmit.request.ISipRequestProcessorAbstract; +import com.dite.znpt.monitor.sip.transmit.request.impl.MessageRequestProcessorImpl; +import com.dite.znpt.monitor.sip.transmit.request.impl.message.IMessageHandler; +import lombok.extern.slf4j.Slf4j; +import org.dom4j.DocumentException; +import org.dom4j.Element; +import org.springframework.beans.factory.InitializingBean; +import org.springframework.stereotype.Component; + +import javax.annotation.Resource; +import javax.sip.InvalidArgumentException; +import javax.sip.RequestEvent; +import javax.sip.SipException; +import javax.sip.message.Response; +import java.text.ParseException; +import java.util.Objects; + +/** + * @Author: huise23 + * @Date: 2022/9/1 13:34 + * @Description: + */ +@Slf4j +@Component +public class DeviceStatusHandlerImpl extends ISipRequestProcessorAbstract implements InitializingBean, IMessageHandler { + + private final static String CMD_TYPE = "DeviceStatus"; + + @Resource + private MessageRequestProcessorImpl messageRequestProcessor; + + @Override + public void afterPropertiesSet() { + messageRequestProcessor.addHandler(CMD_TYPE, this); + } + + + @Resource + private DeviceVideoService deviceVideoService; + /** + * 处理消息 + * + * @param evt + * @param entity + * @return + */ + @Override + public void process(DeviceVideoEntity entity, RequestEvent evt) { + try { + Element rootElement = getRootElement(evt); + log.info("接收到DeviceStatus消息"); + responseAck(evt, Response.OK); + Element onlineElement = rootElement.element("Online"); + String text = onlineElement.getText(); + if (Objects.equals(text.trim().toUpperCase(), "ONLINE")) { + deviceVideoService.online(entity); + }else { + deviceVideoService.offline(entity.getVideoCode()); + } + } catch (DocumentException | SipException | InvalidArgumentException | ParseException e) { + e.printStackTrace(); + } + } +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/sip/transmit/request/impl/message/query/KeepaliveHandlerImpl.java b/sip/src/main/java/com/dite/znpt/monitor/sip/transmit/request/impl/message/query/KeepaliveHandlerImpl.java new file mode 100644 index 0000000..47927b8 --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/sip/transmit/request/impl/message/query/KeepaliveHandlerImpl.java @@ -0,0 +1,89 @@ +package com.dite.znpt.monitor.sip.transmit.request.impl.message.query; + +import com.alibaba.fastjson.JSON; +import com.dite.znpt.monitor.constant.dict.DeviceStatus; +import com.dite.znpt.monitor.domain.entity.DeviceVideoEntity; +import com.dite.znpt.monitor.service.DeviceVideoService; +import com.dite.znpt.monitor.sip.transmit.request.ISipRequestProcessorAbstract; +import com.dite.znpt.monitor.sip.transmit.request.impl.MessageRequestProcessorImpl; +import com.dite.znpt.monitor.sip.transmit.request.impl.message.IMessageHandler; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.ObjectUtils; +import org.springframework.beans.factory.InitializingBean; +import org.springframework.stereotype.Component; + +import javax.annotation.Resource; +import javax.sip.InvalidArgumentException; +import javax.sip.RequestEvent; +import javax.sip.SipException; +import javax.sip.header.ViaHeader; +import javax.sip.message.Response; +import java.text.ParseException; +import java.time.LocalDateTime; + +/** + * @Author: huise23 + * @Date: 2022/9/1 13:35 + * @Description: + */ +@Slf4j +@Component +public class KeepaliveHandlerImpl extends ISipRequestProcessorAbstract implements InitializingBean, IMessageHandler { + + private final static String CMD_TYPE = "Keepalive"; + + @Resource + private MessageRequestProcessorImpl messageRequestProcessor; + + @Resource + private DeviceVideoService deviceVideoService; + + @Override + public void afterPropertiesSet() { + messageRequestProcessor.addHandler(CMD_TYPE, this); + } + + /** + * 处理消息 + * + * @param evt + * @param entity + * @return + */ + @Override + public void process(DeviceVideoEntity entity, RequestEvent evt) { + try { + log.info("接收到keepalive消息"); + // 判断RPort是否改变,改变则说明路由nat信息变化,修改设备信息 + // 获取到通信地址等信息 + ViaHeader viaHeader = (ViaHeader) evt.getRequest().getHeader(ViaHeader.NAME); + log.info("viaHeader:{}", JSON.toJSONString(viaHeader)); + String ip = viaHeader.getHost(); + int rPort = viaHeader.getRPort(); + // 解析本地地址替代 + if (ObjectUtils.isEmpty(ip) || rPort == -1) { + ip = viaHeader.getHost(); + rPort = viaHeader.getPort(); + } + log.info("port:{}",rPort); + if (entity.getPort() != rPort) { + entity.setPort(rPort); + entity.setHostAddress(ip.concat(":").concat(String.valueOf(rPort))); + } + entity.setKeepaliveTime(LocalDateTime.now()); + // 回复200 OK + responseAck(evt, Response.OK); + if (DeviceStatus.ONLINE.getValue().equals(entity.getStatus())) { + entity.setUpdateTime(LocalDateTime.now()); + deviceVideoService.updateById(entity); + }else { + // 对于已经离线的设备判断他的注册是否已经过期 + if (deviceVideoService.expire(entity)){ + deviceVideoService.online(entity); + } + } + } catch (SipException | InvalidArgumentException | ParseException e) { + e.printStackTrace(); + } + } +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/sip/transmit/response/ISipResponseProcessor.java b/sip/src/main/java/com/dite/znpt/monitor/sip/transmit/response/ISipResponseProcessor.java new file mode 100644 index 0000000..255e4c2 --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/sip/transmit/response/ISipResponseProcessor.java @@ -0,0 +1,13 @@ +package com.dite.znpt.monitor.sip.transmit.response; + + +import javax.sip.ResponseEvent; + +/** + * @Author: huise23 + * @Date: 2022/8/10 16:47 + * @Description: + */ +public interface ISipResponseProcessor { + void process(ResponseEvent evt); +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/sip/transmit/response/ISipResponseProcessorAbstract.java b/sip/src/main/java/com/dite/znpt/monitor/sip/transmit/response/ISipResponseProcessorAbstract.java new file mode 100644 index 0000000..30e3a4e --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/sip/transmit/response/ISipResponseProcessorAbstract.java @@ -0,0 +1,12 @@ +package com.dite.znpt.monitor.sip.transmit.response; + +import org.springframework.beans.factory.InitializingBean; + +/** + * @Author: huise23 + * @Date: 2022/8/29 17:59 + * @Description: + */ +public abstract class ISipResponseProcessorAbstract implements InitializingBean, ISipResponseProcessor{ + +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/sip/transmit/response/impl/InviteResponseProcessorImpl.java b/sip/src/main/java/com/dite/znpt/monitor/sip/transmit/response/impl/InviteResponseProcessorImpl.java new file mode 100644 index 0000000..bb82e96 --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/sip/transmit/response/impl/InviteResponseProcessorImpl.java @@ -0,0 +1 @@ +package com.dite.znpt.monitor.sip.transmit.response.impl; import com.dite.znpt.monitor.sip.config.SipConfig; import com.dite.znpt.monitor.sip.transmit.SipProcessorFactoryImpl; import com.dite.znpt.monitor.sip.transmit.response.ISipResponseProcessorAbstract; import gov.nist.javax.sip.ResponseEventExt; import gov.nist.javax.sip.stack.SIPDialog; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Component; import javax.annotation.Resource; import javax.sdp.SdpFactory; import javax.sdp.SdpParseException; import javax.sdp.SessionDescription; import javax.sip.InvalidArgumentException; import javax.sip.ResponseEvent; import javax.sip.SipException; import javax.sip.SipFactory; import javax.sip.address.Address; import javax.sip.address.SipURI; import javax.sip.header.CSeqHeader; import javax.sip.message.Request; import javax.sip.message.Response; import java.text.ParseException; /** * @Description:处理INVITE响应 * @author: swwheihei * @date: 2020年5月3日 下午4:43:52 */ @Slf4j @Component public class InviteResponseProcessorImpl extends ISipResponseProcessorAbstract { private final String method = "INVITE"; @Resource private SipConfig sipConfig; @Resource private SipFactory sipFactory; @Resource private SipProcessorFactoryImpl sipProcessorFactory; @Override public void afterPropertiesSet(){ sipProcessorFactory.addResponseProcessor(method, this); } /** * 处理invite响应 * @param evt 响应消息 */ @Override public void process(ResponseEvent evt) { try { Response response = evt.getResponse(); int statusCode = response.getStatusCode(); // trying不会回复 if (statusCode == Response.TRYING) { } // 成功响应 // 下发ack if (statusCode == Response.OK) { ResponseEventExt event = (ResponseEventExt)evt; SIPDialog dialog = (SIPDialog)evt.getDialog(); CSeqHeader cseq = (CSeqHeader) response.getHeader(CSeqHeader.NAME); Request reqAck = dialog.createAck(cseq.getSeqNumber()); SipURI requestUri = (SipURI) reqAck.getRequestURI(); String contentString = new String(response.getRawContent()); // jainSip不支持y=字段, 移除以解析。 int ssrcIndex = contentString.indexOf("y="); // 检查是否有y字段 SessionDescription sdp; if (ssrcIndex >= 0) { //ssrc规定长度为10字节,不取余下长度以避免后续还有“f=”字段 String substring = contentString.substring(0, contentString.indexOf("y=")); sdp = SdpFactory.getInstance().createSessionDescription(substring); } else { sdp = SdpFactory.getInstance().createSessionDescription(contentString); } requestUri.setUser(sdp.getOrigin().getUsername()); requestUri.setHost(event.getRemoteIpAddress()); requestUri.setPort(event.getRemotePort()); reqAck.setRequestURI(requestUri); Address concatAddress = sipFactory.createAddressFactory().createAddress(sipFactory.createAddressFactory().createSipURI(sipConfig.getId(), sipConfig.getIp() + ":" + sipConfig.getPort())); reqAck.addHeader(sipFactory.createHeaderFactory().createContactHeader(concatAddress)); log.info("[invite回复ack] {}-> {}:{} ",requestUri, event.getRemoteIpAddress(), event.getRemotePort()); dialog.sendAck(reqAck); } } catch (InvalidArgumentException | SipException e) { e.printStackTrace(); } catch (ParseException e) { throw new RuntimeException(e); } catch (SdpParseException e) { throw new RuntimeException(e); } } } \ No newline at end of file diff --git a/sip/src/main/java/com/dite/znpt/monitor/sip/transmit/timeout/ITimeoutProcessor.java b/sip/src/main/java/com/dite/znpt/monitor/sip/transmit/timeout/ITimeoutProcessor.java new file mode 100644 index 0000000..36e1201 --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/sip/transmit/timeout/ITimeoutProcessor.java @@ -0,0 +1,7 @@ +package com.dite.znpt.monitor.sip.transmit.timeout; + +import javax.sip.TimeoutEvent; + +public interface ITimeoutProcessor { + void process(TimeoutEvent event); +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/sip/transmit/timeout/impl/TimeoutProcessorImpl.java b/sip/src/main/java/com/dite/znpt/monitor/sip/transmit/timeout/impl/TimeoutProcessorImpl.java new file mode 100644 index 0000000..a750ef1 --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/sip/transmit/timeout/impl/TimeoutProcessorImpl.java @@ -0,0 +1,34 @@ +package com.dite.znpt.monitor.sip.transmit.timeout.impl; + +import com.dite.znpt.monitor.sip.transmit.SipProcessorFactoryImpl; +import com.dite.znpt.monitor.sip.transmit.timeout.ITimeoutProcessor; +import org.springframework.beans.factory.InitializingBean; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import javax.sip.TimeoutEvent; +import javax.sip.header.CallIdHeader; + +/** + * @author huise23 + */ +@Component +public class TimeoutProcessorImpl implements InitializingBean, ITimeoutProcessor { + + @Autowired + private SipProcessorFactoryImpl sipProcessorFactory; + + + @Override + public void afterPropertiesSet() { + sipProcessorFactory.addTimeoutProcessor(this); + } + + @Override + public void process(TimeoutEvent event) { + CallIdHeader callIdHeader = event.getClientTransaction().getDialog().getCallId(); + String callId = callIdHeader.getCallId(); + // TODO + + } +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/sip/utils/DigestServerAuthenticationHelper.java b/sip/src/main/java/com/dite/znpt/monitor/sip/utils/DigestServerAuthenticationHelper.java new file mode 100644 index 0000000..ce07ee5 --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/sip/utils/DigestServerAuthenticationHelper.java @@ -0,0 +1,210 @@ +/* +* Conditions Of Use +* +* This software was developed by employees of the National Institute of +* Standards and Technology (NIST), an agency of the Federal Government. +* Pursuant to title 15 Untied States Code Section 105, works of NIST +* employees are not subject to copyright protection in the United States +* and are considered to be in the public domain. As a result, a formal +* license is not needed to use the software. +* +* This software is provided by NIST as a service and is expressly +* provided "AS IS." NIST MAKES NO WARRANTY OF ANY KIND, EXPRESS, IMPLIED +* OR STATUTORY, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTY OF +* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT +* AND DATA ACCURACY. NIST does not warrant or make any representations +* regarding the use of the software or the results thereof, including but +* not limited to the correctness, accuracy, reliability or usefulness of +* the software. +* +* Permission to use this software is contingent upon your acceptance +* of the terms of this agreement +* +* . +* +*/ +package com.dite.znpt.monitor.sip.utils; + +import gov.nist.core.InternalErrorHandler; + +import javax.sip.address.URI; +import javax.sip.header.AuthorizationHeader; +import javax.sip.header.HeaderFactory; +import javax.sip.header.WWWAuthenticateHeader; +import javax.sip.message.Request; +import javax.sip.message.Response; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.util.Date; +import java.util.Random; + +/** + * Implements the HTTP digest authentication method server side functionality. + * + * @author M. Ranganathan + * @author Marc Bednarek + */ + +public class DigestServerAuthenticationHelper { + + private MessageDigest messageDigest; + + public static final String DEFAULT_ALGORITHM = "MD5"; + public static final String DEFAULT_SCHEME = "Digest"; + + + + + /** to hex converter */ + private static final char[] toHex = { '0', '1', '2', '3', '4', '5', '6', + '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' }; + + /** + * Default constructor. + * @throws NoSuchAlgorithmException + */ + public DigestServerAuthenticationHelper() + throws NoSuchAlgorithmException { + messageDigest = MessageDigest.getInstance(DEFAULT_ALGORITHM); + } + + public static String toHexString(byte b[]) { + int pos = 0; + char[] c = new char[b.length * 2]; + for (int i = 0; i < b.length; i++) { + c[pos++] = toHex[(b[i] >> 4) & 0x0F]; + c[pos++] = toHex[b[i] & 0x0f]; + } + return new String(c); + } + + /** + * Generate the challenge string. + * + * @return a generated nonce. + */ + private String generateNonce() { + // Get the time of day and run MD5 over it. + Date date = new Date(); + long time = date.getTime(); + Random rand = new Random(); + long pad = rand.nextLong(); + String nonceString = (new Long(time)).toString() + + (new Long(pad)).toString(); + byte mdbytes[] = messageDigest.digest(nonceString.getBytes()); + // Convert the mdbytes array into a hex string. + return toHexString(mdbytes); + } + + public Response generateChallenge(HeaderFactory headerFactory, Response response, String realm) { + try { + WWWAuthenticateHeader proxyAuthenticate = headerFactory + .createWWWAuthenticateHeader(DEFAULT_SCHEME); + proxyAuthenticate.setParameter("realm", realm); + proxyAuthenticate.setParameter("nonce", generateNonce()); + proxyAuthenticate.setParameter("opaque", ""); + proxyAuthenticate.setParameter("stale", "FALSE"); + proxyAuthenticate.setParameter("algorithm", DEFAULT_ALGORITHM); + response.setHeader(proxyAuthenticate); + } catch (Exception ex) { + InternalErrorHandler.handleException(ex); + } + return response; + } + /** + * Authenticate the inbound request. + * + * @param request - the request to authenticate. + * @param hashedPassword -- the MD5 hashed string of username:realm:plaintext password. + * + * @return true if authentication succeded and false otherwise. + */ + public boolean doAuthenticateHashedPassword(Request request, String hashedPassword) { + AuthorizationHeader authHeader = (AuthorizationHeader) request.getHeader(AuthorizationHeader.NAME); + if ( authHeader == null ) return false; + String realm = authHeader.getRealm(); + String username = authHeader.getUsername(); + + if ( username == null || realm == null ) { + return false; + } + + String nonce = authHeader.getNonce(); + URI uri = authHeader.getURI(); + if (uri == null) { + return false; + } + + + + String A2 = request.getMethod().toUpperCase() + ":" + uri.toString(); + String HA1 = hashedPassword; + + + byte[] mdbytes = messageDigest.digest(A2.getBytes()); + String HA2 = toHexString(mdbytes); + + String cnonce = authHeader.getCNonce(); + String KD = HA1 + ":" + nonce; + if (cnonce != null) { + KD += ":" + cnonce; + } + KD += ":" + HA2; + mdbytes = messageDigest.digest(KD.getBytes()); + String mdString = toHexString(mdbytes); + String response = authHeader.getResponse(); + + + return mdString.equals(response); + } + + /** + * Authenticate the inbound request given plain text password. + * + * @param request - the request to authenticate. + * @param pass -- the plain text password. + * + * @return true if authentication succeded and false otherwise. + */ + public boolean doAuthenticatePlainTextPassword(Request request, String pass) { + AuthorizationHeader authHeader = (AuthorizationHeader) request.getHeader(AuthorizationHeader.NAME); + if ( authHeader == null ) return false; + String realm = authHeader.getRealm(); + String username = authHeader.getUsername(); + + + if ( username == null || realm == null ) { + return false; + } + + + String nonce = authHeader.getNonce(); + URI uri = authHeader.getURI(); + if (uri == null) { + return false; + } + + + String A1 = username + ":" + realm + ":" + pass; + String A2 = request.getMethod().toUpperCase() + ":" + uri.toString(); + byte mdbytes[] = messageDigest.digest(A1.getBytes()); + String HA1 = toHexString(mdbytes); + + + mdbytes = messageDigest.digest(A2.getBytes()); + String HA2 = toHexString(mdbytes); + + String cnonce = authHeader.getCNonce(); + String KD = HA1 + ":" + nonce; + if (cnonce != null) { + KD += ":" + cnonce; + } + KD += ":" + HA2; + mdbytes = messageDigest.digest(KD.getBytes()); + String mdString = toHexString(mdbytes); + String response = authHeader.getResponse(); + return mdString.equals(response); + + } + +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/sip/utils/XmlUtil.java b/sip/src/main/java/com/dite/znpt/monitor/sip/utils/XmlUtil.java new file mode 100644 index 0000000..934490a --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/sip/utils/XmlUtil.java @@ -0,0 +1,95 @@ +package com.dite.znpt.monitor.sip.utils; + +import lombok.extern.slf4j.Slf4j; +import org.dom4j.Attribute; +import org.dom4j.Document; +import org.dom4j.DocumentException; +import org.dom4j.Element; +import org.dom4j.io.SAXReader; + +import java.io.StringReader; +import java.util.*; + +/** + * 基于dom4j的工具包 + * + * + */ +@Slf4j +public class XmlUtil +{ + /** + * 解析XML为Document对象 + * + * @param xml 被解析的XMl + * @return Document + */ + public static Element parseXml(String xml){ + Document document = null; + // + StringReader sr = new StringReader(xml); + SAXReader saxReader = new SAXReader(); + try{ + document = saxReader.read(sr); + }catch (DocumentException e){ + log.error("解析失败", e); + } + return null == document ? null : document.getRootElement(); + } + + /** + * 获取element对象的text的值 + * + * @param em 节点的对象 + * @param tag 节点的tag + * @return 节点 + */ + public static String getText(Element em, String tag){ + if (null == em){ + return null; + } + Element e = em.element(tag); + // + return null == e ? null : e.getText(); + } + + /** + * 递归解析xml节点,适用于 多节点数据 + * + * @param node node + * @param nodeName nodeName + * @return List> + */ + public static List> listNodes(Element node, String nodeName){ + if (null == node){ + return null; + } + // 初始化返回 + List> listMap = new ArrayList>(); + // 首先获取当前节点的所有属性节点 + List list = node.attributes(); + + Map map = null; + // 遍历属性节点 + for (Attribute attribute : list){ + if (nodeName.equals(node.getName())){ + if (null == map){ + map = new HashMap(); + listMap.add(map); + } + // 取到的节点属性放到map中 + map.put(attribute.getName(), attribute.getValue()); + } + + } + // 遍历当前节点下的所有节点 ,nodeName 要解析的节点名称 + // 使用递归 + Iterator iterator = node.elementIterator(); + while (iterator.hasNext()){ + Element e = iterator.next(); + listMap.addAll(listNodes(e, nodeName)); + } + return listMap; + } + +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/sip/vo/DeviceAlarmVo.java b/sip/src/main/java/com/dite/znpt/monitor/sip/vo/DeviceAlarmVo.java new file mode 100644 index 0000000..59023bb --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/sip/vo/DeviceAlarmVo.java @@ -0,0 +1,49 @@ +package com.dite.znpt.monitor.sip.vo; + +import lombok.Data; + +@Data +public class DeviceAlarmVo { + + /** + * 设备Id + */ + private String deviceId; + + /** + * 报警级别, 1为一级警情, 2为二级警情, 3为三级警情, 4为四级 警情- + */ + private String alarmPriorit; + + /** + * 报警方式 , 1为电话报警, 2为设备报警, 3为短信报警, 4为 GPS报警, 5为视频报警, 6为设备故障报警, + * 7其他报警;可以为直接组合如12为电话报警或 设备报警- + */ + private String alarmMethod; + + /** + * 报警时间 + */ + private String alarmTime; + + /** + * 报警内容描述 + */ + private String alarmDescription; + + /** + * 经度 + */ + private double longitude; + + /** + * 纬度 + */ + private double latitude; + + /** + * 报警类型 + */ + private String alarmType; + +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/sip/vo/DeviceChannelVo.java b/sip/src/main/java/com/dite/znpt/monitor/sip/vo/DeviceChannelVo.java new file mode 100644 index 0000000..4e56103 --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/sip/vo/DeviceChannelVo.java @@ -0,0 +1,129 @@ +package com.dite.znpt.monitor.sip.vo; + +import lombok.Data; + +@Data +public class DeviceChannelVo { + + /** + * 通道id + */ + private String channelId; + + /** + * 通道名 + */ + private String name; + + /** + * 生产厂商 + */ + private String manufacture; + + /** + * 型号 + */ + private String model; + + /** + * 设备归属 + */ + private String owner; + + /** + * 行政区域 + */ + private String civilCode; + + /** + * 警区 + */ + private String block; + + /** + * 安装地址 + */ + private String address; + + /** + * 是否有子设备 1有, 0没有 + */ + private int parental; + + /** + * 父级id + */ + private String parentId; + + /** + * 信令安全模式 缺省为0; 0:不采用; 2: S/MIME签名方式; 3: S/ MIME加密签名同时采用方式; 4:数字摘要方式 + */ + private int safetyWay; + + /** + * 注册方式 缺省为1;1:符合IETFRFC3261标准的认证注册模 式; 2:基于口令的双向认证注册模式; 3:基于数字证书的双向认证注册模式 + */ + private int registerWay; + + /** + * 证书序列号 + */ + private String certNum; + + /** + * 证书有效标识 缺省为0;证书有效标识:0:无效1: 有效 + */ + private int certifiable; + + /** + * 证书无效原因码 + */ + private int errCode; + + /** + * 证书终止有效期 + */ + private String endTime; + + /** + * 保密属性 缺省为0; 0:不涉密, 1:涉密 + */ + private String secrecy; + + /** + * IP地址 + */ + private String ipAddress; + + /** + * 端口号 + */ + private int port; + + /** + * 密码 + */ + private String password; + + /** + * 在线/离线 + * 1在线,0离线 + * 默认在线 + * 信令: + * ON + * OFF + * 遇到过NVR下的IPC下发信令可以推流, 但是 Status 响应 OFF + */ + private int status; + + /** + * 经度 + */ + private double longitude; + + /** + * 纬度 + */ + private double latitude; + +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/sip/vo/DeviceVo.java b/sip/src/main/java/com/dite/znpt/monitor/sip/vo/DeviceVo.java new file mode 100644 index 0000000..6e7f47b --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/sip/vo/DeviceVo.java @@ -0,0 +1,56 @@ +package com.dite.znpt.monitor.sip.vo; + +import lombok.Data; + +import java.util.Map; + +@Data +public class DeviceVo { + + /** + * 设备Id + */ + private String deviceId; + + /** + * 设备名 + */ + private String name; + + /** + * 生产厂商 + */ + private String manufacturer; + + /** + * 型号 + */ + private String model; + + /** + * 固件版本 + */ + private String firmware; + + /** + * 传输协议 + * UDP/TCP + */ + private String transport; + + /** + * wan地址 + */ + private HostVo hostVo; + + /** + * 在线 + */ + private int online; + + /** + * 通道列表 + */ + private Map channelMap; + +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/sip/vo/HostVo.java b/sip/src/main/java/com/dite/znpt/monitor/sip/vo/HostVo.java new file mode 100644 index 0000000..fdda095 --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/sip/vo/HostVo.java @@ -0,0 +1,12 @@ +package com.dite.znpt.monitor.sip.vo; + +import lombok.Data; + +@Data +public class HostVo { + + private String ip; + private int port; + private String address; + +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/sip/vo/RecordItemVo.java b/sip/src/main/java/com/dite/znpt/monitor/sip/vo/RecordItemVo.java new file mode 100644 index 0000000..a9111b0 --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/sip/vo/RecordItemVo.java @@ -0,0 +1,31 @@ +package com.dite.znpt.monitor.sip.vo; + +import lombok.Data; + +/** + * @Description:设备录像 + * @author: + * @date: + */ +@Data +public class RecordItemVo { + + private String deviceId; + + private String name; + + private String filePath; + + private String address; + + private String startTime; + + private String endTime; + + private int secrecy; + + private String type; + + private String recorderId; + +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/sip/vo/RecordVo.java b/sip/src/main/java/com/dite/znpt/monitor/sip/vo/RecordVo.java new file mode 100644 index 0000000..f2ba518 --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/sip/vo/RecordVo.java @@ -0,0 +1,23 @@ +package com.dite.znpt.monitor.sip.vo; + +import lombok.Data; + +import java.util.List; + +/** + * @Description:设备录像信息 + * @author: + * @date: + */ +@Data +public class RecordVo { + + private String deviceId; + + private String name; + + private int sumNum; + + private List recordItemVoList; + +} diff --git a/sip/src/main/java/com/dite/znpt/monitor/utils/DictUtils.java b/sip/src/main/java/com/dite/znpt/monitor/utils/DictUtils.java new file mode 100644 index 0000000..d50f84a --- /dev/null +++ b/sip/src/main/java/com/dite/znpt/monitor/utils/DictUtils.java @@ -0,0 +1,33 @@ +package com.dite.znpt.monitor.utils; + +import com.dite.znpt.monitor.constant.dict.ValueAndLabel; + +import java.util.Arrays; + +/** + * 字典工具类 + * + * @author huise23 + * @since 2023-07-28 15:38:41 + */ +public class DictUtils { + + /** + * 通用方法,根据传入的枚举类和value返回对应的label值 + * + * @param enumClass 枚举类 + * @param value 值 + * @return {@link String } + * @author huise23 + * @since 2023-07-28 15:40:07 + */ + public static & ValueAndLabel> String getDictLabel(Class enumClass, String value) { + final String label = Arrays.stream(enumClass.getEnumConstants()) + .filter(enumItem -> enumItem.getValue().equals(value)) + .map(t->t.getLabel()) + .findFirst() + .orElse(null); + return label; + } + +} diff --git a/sip/src/main/resources/mapper/iot/DeviceVideoChannelMapper.xml b/sip/src/main/resources/mapper/iot/DeviceVideoChannelMapper.xml new file mode 100644 index 0000000..c43f856 --- /dev/null +++ b/sip/src/main/resources/mapper/iot/DeviceVideoChannelMapper.xml @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + dvc.channel_id, dvc.channel_code, dvc.channel_name, dvc.address, dvc.camera_type, dvc.ptz_control, dvc.status, dvc.remark + + + + + + + + + + + + + + diff --git a/sip/src/main/resources/mapper/iot/DeviceVideoMapper.xml b/sip/src/main/resources/mapper/iot/DeviceVideoMapper.xml new file mode 100644 index 0000000..b0820c3 --- /dev/null +++ b/sip/src/main/resources/mapper/iot/DeviceVideoMapper.xml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + dv.video_id, dv.video_code, dv.video_name, dv.transport, dv.stream_mode, dv.channel_count, dv.status, dv.register_time, + dv.keepalive_time, dv.channel_count, dv.ip, dv.port,dv.host_address, dv.manufacturer, dv.remark, dv.create_time + + + + + + diff --git a/sip/src/main/resources/mapper/iot/IpConfigMapper.xml b/sip/src/main/resources/mapper/iot/IpConfigMapper.xml new file mode 100644 index 0000000..339afe7 --- /dev/null +++ b/sip/src/main/resources/mapper/iot/IpConfigMapper.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + ic.config_id, ic.ip + + + + + diff --git a/web/src/main/java/com/dite/znpt/web/build/DeployController.java b/web/src/main/java/com/dite/znpt/web/build/DeployController.java index 626dbd8..0808a41 100644 --- a/web/src/main/java/com/dite/znpt/web/build/DeployController.java +++ b/web/src/main/java/com/dite/znpt/web/build/DeployController.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.web.build; import cn.hutool.core.util.StrUtil; @@ -189,3 +190,196 @@ public class DeployController { return output.toString(); } } +======= +package com.dite.znpt.web.build; + +import cn.hutool.core.util.StrUtil; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.*; + +import javax.crypto.Mac; +import javax.crypto.spec.SecretKeySpec; +import java.io.BufferedReader; +import java.io.File; +import java.io.IOException; +import java.io.InputStreamReader; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; + +@Api(tags = "webhook自动部署") +@RestController +public class DeployController { + + @Value("${deploy.secret}") + private String webhookSecret; + + @Value("${deploy.build-dir}") + private String buildDir; + + private Process deploymentProcess; + private final GiteeSignatureVerifier signatureVerifier = new GiteeSignatureVerifier(); + + @ApiOperation(value = "自动部署", httpMethod = "POST") + @PostMapping("/gitee-webhook") + public ResponseEntity handleWebhook( + @RequestHeader(value = "X-Gitee-Token", required = false) String receivedSignature, + @RequestHeader(value = "X-Gitee-Timestamp", required = false) String timestamp, + @RequestBody String payload) { + + // 0. 基本验证 + if (!StrUtil.isAllNotBlank(receivedSignature, timestamp)) { + return ResponseEntity.status(403).body("签名验证失败"); + } + + // 1. 验证签名 + if (!signatureVerifier.verifySignature(receivedSignature, timestamp, payload, webhookSecret)) { + System.out.println("签名验证失败"); + return ResponseEntity.status(403).body("签名验证失败"); + } + + // 2. 启动部署流程 + startDeployment(); + + return ResponseEntity.ok("部署流程已启动"); + } + + @ApiOperation(value = "gitea自动部署", httpMethod = "POST") + @PostMapping("/gitea-webhook") + public ResponseEntity handleWebhook(@RequestHeader("X-Gitea-Signature") String signature, + @RequestBody(required = false) byte[] body) { + + // 1. 签名校验 + if (!validSignature(body, signature)) { + return ResponseEntity.status(403).body("签名验证失败"); + } + + // 2. 启动部署流程 + startDeployment(); + + return ResponseEntity.ok("部署流程已启动"); + } + + private boolean validSignature(byte[] body, String sigHeader) { + if (sigHeader == null) return false; + try { + Mac mac = Mac.getInstance("HmacSHA256"); + mac.init(new SecretKeySpec(webhookSecret.getBytes(StandardCharsets.UTF_8), "HmacSHA256")); + String computed = bytesToHex(mac.doFinal(body)); + return computed.equalsIgnoreCase(sigHeader); // 不区分大小写 + } catch (Exception e) { + return false; + } + } + + private String bytesToHex(byte[] bytes) { + StringBuilder sb = new StringBuilder(); + for (byte b : bytes) sb.append(String.format("%02x", b)); + return sb.toString(); + } + + @ApiOperation(value = "查询自动部署状态", httpMethod = "GET") + @GetMapping("/deployment-status") + public ResponseEntity getDeploymentStatus() { + try { + Path statusFile = Path.of(buildDir, "deployment-status.txt"); + if (!Files.exists(statusFile)) { + return ResponseEntity.ok("尚未开始部署"); + } + + String statusContent = Files.readString(statusFile); + return ResponseEntity.ok(statusContent); + } catch (Exception e) { + return ResponseEntity.status(500).body("状态读取错误: " + e.getMessage()); + } + } + + @ApiOperation(value = "查询自动部署日志", httpMethod = "GET") + @GetMapping("/deployment-log") + public ResponseEntity getDeploymentLog( + @RequestParam(defaultValue = "100") int lines) { + try { + Path logFile = Path.of(buildDir, "deploy.log"); + if (!Files.exists(logFile)) { + return ResponseEntity.ok("无可用日志"); + } + + String logContent; + if (lines > 0) { + logContent = tail(logFile, lines); + } else { + logContent = Files.readString(logFile); + } + + return ResponseEntity.ok("
" + logContent + "
"); + } catch (Exception e) { + return ResponseEntity.status(500).body("日志读取错误: " + e.getMessage()); + } + } + + private synchronized void startDeployment() { + // 防止重复部署 + if (deploymentProcess != null && deploymentProcess.isAlive()) { + return; + } + + try { + // 启动部署脚本 + ProcessBuilder builder = new ProcessBuilder("./deploy.sh"); + builder.directory(new File(buildDir)); + builder.redirectErrorStream(true); + + deploymentProcess = builder.start(); + + // 启动日志监控线程 + new Thread(() -> { + try (BufferedReader reader = new BufferedReader( + new InputStreamReader(deploymentProcess.getInputStream()))) { + + while (deploymentProcess.isAlive()) { + String line = reader.readLine(); + if (line != null) { + System.out.println("[DEPLOY] " + line); + } + } + + int exitCode = deploymentProcess.waitFor(); + System.out.println("部署进程结束,状态码: " + exitCode); + deploymentProcess = null; + + } catch (Exception e) { + System.err.println("部署日志读取错误: " + e.getMessage()); + } + }).start(); + + } catch (Exception e) { + System.err.println("启动部署脚本失败: " + e.getMessage()); + try { + Files.writeString(Path.of(buildDir, "deployment-status.txt"), + "START_FAILED - " + e.getMessage()); + } catch (Exception ex) { + // 忽略 + } + } + } + + private String tail(Path path, int lines) throws IOException { + ProcessBuilder builder = new ProcessBuilder("tail", "-n", String.valueOf(lines), path.toString()); + Process process = builder.start(); + + StringBuilder output = new StringBuilder(); + try (BufferedReader reader = new BufferedReader( + new InputStreamReader(process.getInputStream()))) { + + String line; + while ((line = reader.readLine()) != null) { + output.append(line).append("\n"); + } + } + return output.toString(); + } +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/web/src/main/java/com/dite/znpt/web/build/GiteeSignatureVerifier.java b/web/src/main/java/com/dite/znpt/web/build/GiteeSignatureVerifier.java index e2f6955..4b1c790 100644 --- a/web/src/main/java/com/dite/znpt/web/build/GiteeSignatureVerifier.java +++ b/web/src/main/java/com/dite/znpt/web/build/GiteeSignatureVerifier.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.web.build; import cn.hutool.core.codec.Base64Encoder; @@ -80,3 +81,87 @@ public class GiteeSignatureVerifier { return result == 0; } } +======= +package com.dite.znpt.web.build; + +import cn.hutool.core.codec.Base64Encoder; +import cn.hutool.core.net.URLEncodeUtil; +import lombok.extern.slf4j.Slf4j; + +import javax.crypto.Mac; +import javax.crypto.spec.SecretKeySpec; +import java.nio.charset.StandardCharsets; +import java.time.Instant; + +@Slf4j +public class GiteeSignatureVerifier { + + private static final long MAX_TIME_DIFF = 3600 * 1000; // 1小时(毫秒) + + public boolean verifySignature(String receivedSignature, + String receivedTimestamp, + String payload, + String secret) { + // 1. 验证时间有效性(避免重放攻击) + if (!validateTimestamp(receivedTimestamp)) { + log.debug("时间戳超出允许范围"); + return false; + } + + // 2. 计算期望签名 + String computedSignature = computeSignature( + receivedTimestamp, + payload, + secret + ); + + // 3. 安全比较签名(防止时序攻击) + return constantTimeEquals(receivedSignature, computedSignature); + } + + private boolean validateTimestamp(String timestampStr) { + try { + long timestamp = Long.parseLong(timestampStr); + long currentTime = Instant.now().toEpochMilli(); + return Math.abs(currentTime - timestamp) < MAX_TIME_DIFF; + } catch (NumberFormatException e) { + log.debug("无效的时间戳格式: {}", timestampStr); + return false; + } + } + + private String computeSignature(String timestamp, String payload, String secret) { + try { + // Step 1: HMAC-SHA256(ts + "\n" + secret) + String data = timestamp + "\n" + secret; + Mac hmac = Mac.getInstance("HmacSHA256"); + SecretKeySpec keySpec = new SecretKeySpec( + secret.getBytes(StandardCharsets.UTF_8), + "HmacSHA256" + ); + hmac.init(keySpec); + byte[] rawSignature = hmac.doFinal(data.getBytes(StandardCharsets.UTF_8)); + + // Step 2: Base64 encode + String base64Sig = Base64Encoder.encode(rawSignature); + + // Step 3: URL encode + return URLEncodeUtil.encode(base64Sig); + } catch (Exception e) { + throw new RuntimeException("签名计算失败", e); + } + } + + // 防止时序攻击的安全字符串比较 + private boolean constantTimeEquals(String a, String b) { + if (a == null || b == null || a.length() != b.length()) { + return false; + } + int result = 0; + for (int i = 0; i < a.length(); i++) { + result |= a.charAt(i) ^ b.charAt(i); + } + return result == 0; + } +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/web/src/main/java/com/dite/znpt/web/controller/AudioController.java b/web/src/main/java/com/dite/znpt/web/controller/AudioController.java index cad065d..e064742 100644 --- a/web/src/main/java/com/dite/znpt/web/controller/AudioController.java +++ b/web/src/main/java/com/dite/znpt/web/controller/AudioController.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.web.controller; @@ -64,3 +65,71 @@ public class AudioController { return Result.ok(audioFileInfoService.batchUpload(imageId, files)); } } +======= +package com.dite.znpt.web.controller; + + +import com.dite.znpt.domain.PageResult; +import com.dite.znpt.domain.Result; +import com.dite.znpt.domain.entity.AudioFileInfoEntity; +import com.dite.znpt.domain.vo.*; +import com.dite.znpt.service.AudioFileInfoService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.RequiredArgsConstructor; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import java.util.List; + +/** + * @author cuizhibin + * @date 2025/06/23 13:39 + * @description 音频控制器 + */ +@Api(tags = "音频信息") +@RestController +@RequestMapping("/audio") +@RequiredArgsConstructor +public class AudioController { + + private final AudioFileInfoService audioFileInfoService; + + @ApiOperation(value = "分页查询音频列表", httpMethod = "GET") + @GetMapping("/page") + public PageResult page(AudioFileInfoListReq req) { + return PageResult.ok(audioFileInfoService.selectList(req)); + } + + @ApiOperation(value = "查询音频列表", httpMethod = "GET") + @GetMapping("/list") + public Result> list(AudioFileInfoListReq req){ + return Result.ok(audioFileInfoService.selectList(req)); + } + + @ApiOperation(value = "查询音频详情", httpMethod = "GET") + @GetMapping("/detail/{audioId}") + public Result detail(@PathVariable String audioId){ + return Result.ok(audioFileInfoService.selectById(audioId)); + } + + @ApiOperation(value = "删除音频", httpMethod = "DELETE") + @DeleteMapping("/{imageId}") + public Result remove(@PathVariable String imageId){ + audioFileInfoService.deleteById(imageId); + return Result.ok(); + } + + @ApiOperation(value = "上传音频", httpMethod = "POST") + @PostMapping("/upload/{imageId}") + public Result uploadBatch(@PathVariable String imageId, @RequestParam("file") MultipartFile file) { + return Result.ok(audioFileInfoService.batchUpload(imageId, new MultipartFile[]{file}).get(0)); + } + + @ApiOperation(value = "批量上传音频", httpMethod = "POST") + @PostMapping("/upload-batch/{imageId}") + public Result> uploadBatch(@PathVariable String imageId, @RequestParam("files") MultipartFile[] files) { + return Result.ok(audioFileInfoService.batchUpload(imageId, files)); + } +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/web/src/main/java/com/dite/znpt/web/controller/AuthController.java b/web/src/main/java/com/dite/znpt/web/controller/AuthController.java index 8ea3523..2ab179f 100644 --- a/web/src/main/java/com/dite/znpt/web/controller/AuthController.java +++ b/web/src/main/java/com/dite/znpt/web/controller/AuthController.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.web.controller; import cn.dev33.satoken.stp.SaTokenInfo; @@ -62,3 +63,69 @@ public class AuthController { return Result.ok(); } } +======= +package com.dite.znpt.web.controller; + +import cn.dev33.satoken.stp.SaTokenInfo; +import cn.dev33.satoken.stp.StpUtil; +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 com.dite.znpt.service.AuthService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.validation.Valid; +import java.util.List; + +/** + * @author Bear.G + * @date 2025/5/19/周一 14:32 + * @description + */ +@Api(tags = "认证相关") +@RestController +@RequestMapping("/auth") +public class AuthController { + + @Resource + private AuthService authService; + + @ApiOperation(value = "登录",httpMethod = "POST", notes = "密码加密采用aes(加密模式ECB,填充方式PKCS#7)加密传输,加密密钥产生逻辑:对账号做md5()计算,然后取值8-24位。demo数据:账号:admin,加密后的密码:Csq+AVwlEzX3r5vfxL7d/g== 账号:tino,加密后的密码:owbegSu4cMJRD4CiWO+WyQ==") + @PostMapping("/login") + public Result login(@Valid @RequestBody LoginReq req) { + return authService.doLogin(req); + } + + @ApiOperation(value = "修改密码", httpMethod = "PUT") + @PutMapping("/modify-password") + public Result modifyPassword(@Valid @RequestBody ModifyPasswordReq req){ + authService.modifyPassword(req); + return Result.ok(); + } + + @GetMapping("/userInfo") + @ApiOperation(value = "获取用户信息",httpMethod = "GET") + public Result userInfo() { + return Result.ok(authService.getUserInfo(StpUtil.getLoginId().toString())); + } + + @GetMapping("/menu") + @ApiOperation(value = "获取菜单",httpMethod = "GET") + public Result>> getMenuInfo() { + return Result.ok(authService.getMenuInfo(StpUtil.getLoginId().toString())); + } + + @ApiOperation(value = "登出",httpMethod = "POST") + @PostMapping("/logout") + public Result logout() { + authService.doLogout(); + return Result.ok(); + } +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/web/src/main/java/com/dite/znpt/web/controller/BiddingInfoController.java b/web/src/main/java/com/dite/znpt/web/controller/BiddingInfoController.java new file mode 100644 index 0000000..4445c13 --- /dev/null +++ b/web/src/main/java/com/dite/znpt/web/controller/BiddingInfoController.java @@ -0,0 +1,85 @@ +package com.dite.znpt.web.controller; + +import com.dite.znpt.domain.PageResult; +import com.dite.znpt.domain.Result; +import com.dite.znpt.domain.vo.BiddingInfoReq; +import com.dite.znpt.domain.vo.BiddingInfoResp; +import com.dite.znpt.service.BiddingInfoService; +import com.pig4cloud.plugin.excel.annotation.RequestExcel; +import com.pig4cloud.plugin.excel.annotation.ResponseExcel; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.validation.BindingResult; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.List; + +/** + * @author Bear.G + * @date 2025/7/28/周一 16:07 + * @description + */ +@Api(tags = "招标信息") +@RestController +@RequestMapping("/bidding-info") +public class BiddingInfoController { + + @Resource + private BiddingInfoService biddingInfoService; + + @ApiOperation(value = "分页查询招标信息列表", httpMethod = "GET") + @GetMapping("/page") + public PageResult page(String projectName) { + return PageResult.ok(biddingInfoService.page(projectName)); + } + + @ApiOperation(value = "查询招标信息列表", httpMethod = "GET") + @GetMapping("/list") + public Result> list(String projectName) { + return Result.ok(biddingInfoService.list(projectName)); + } + + @ApiOperation(value = "新增招标信息", httpMethod = "POST") + @PostMapping + public Result add(@Validated @RequestBody BiddingInfoReq req){ + biddingInfoService.save(req); + return Result.ok(); + } + + @ApiOperation(value = "编辑招标消息",httpMethod = "POST") + @PutMapping("/{biddingInfoId}") + public Result edit(@PathVariable String biddingInfoId, @Validated @RequestBody BiddingInfoReq req){ + biddingInfoService.update(biddingInfoId, req); + return Result.ok(); + } + + @ApiOperation(value = "上传招标文件",httpMethod = "PUT", notes = "上传附件调用新增附件信息接口:/attach-info/biddingInfo,userDefinedPath = {biddingInfoId}") + @PutMapping("/{biddingInfoId}/upload-bidding-info_file/{biddingFileId}") + public Result uploadBiddingInfoFile(@PathVariable String biddingInfoId, @PathVariable String biddingFileId){ + biddingInfoService.uploadBiddingInfoFile(biddingInfoId, biddingFileId); + return Result.ok(); + } + @ApiOperation(value = "报名", httpMethod = "PUT") + @PutMapping("/apply/{biddingInfoId}") + public Result apply(@PathVariable String biddingInfoId){ + biddingInfoService.apply(biddingInfoId); + return Result.ok(); + } + + + @ApiOperation(value = "下载导入模板", httpMethod = "GET") + @GetMapping("/download-template") + @ResponseExcel(name = "招标信息导入模板") + public List downloadTemplate() { + return List.of(new BiddingInfoReq()); + } + + @ApiOperation(value = "导入招标信息", httpMethod = "POST") + @PostMapping("/import") + public Result importData(@RequestExcel List dataList, BindingResult bindingResult) { + return biddingInfoService.importData(dataList, bindingResult); + } + +} diff --git a/web/src/main/java/com/dite/znpt/web/controller/CertificationController.java b/web/src/main/java/com/dite/znpt/web/controller/CertificationController.java index d2919ce..8f01c02 100644 --- a/web/src/main/java/com/dite/znpt/web/controller/CertificationController.java +++ b/web/src/main/java/com/dite/znpt/web/controller/CertificationController.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.web.controller; import com.dite.znpt.domain.PageResult; @@ -66,3 +67,73 @@ public class CertificationController { return Result.ok(); } } +======= +package com.dite.znpt.web.controller; + +import com.dite.znpt.domain.PageResult; +import com.dite.znpt.domain.Result; +import com.dite.znpt.domain.vo.CertificationListReq; +import com.dite.znpt.domain.vo.CertificationReq; +import com.dite.znpt.domain.vo.CertificationResp; +import com.dite.znpt.service.CertificationService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.AllArgsConstructor; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * @author Bear.G + * @date 2025/5/27/周二 15:24 + * @description + */ +@Api(tags = "人员资质") +@RestController +@RequestMapping("/certification") +@AllArgsConstructor +public class CertificationController { + + private final CertificationService certificationService; + + @GetMapping("/page") + @ApiOperation(value = "分页查询人员资质信息", httpMethod = "GET") + public PageResult page(CertificationListReq req){ + return PageResult.ok(certificationService.page(req)); + } + + @GetMapping("/list") + @ApiOperation(value = "查询人员资质信息列表", httpMethod = "GET") + public Result> list(CertificationListReq req){ + return Result.ok(certificationService.list(req)); + } + + @GetMapping("/detail/{certificationId}") + @ApiOperation(value = "查询人员资质详情", httpMethod = "GET") + public Result detail(@PathVariable String certificationId){ + return Result.ok(certificationService.detail(certificationId)); + } + + @PostMapping + @ApiOperation(value = "新增人员资质", httpMethod = "POST") + public Result add(@Validated @RequestBody CertificationReq req){ + certificationService.save(req); + return Result.ok(); + } + + @PutMapping("/{certificationId}") + @ApiOperation(value = "修改人员资质信息", httpMethod = "PUT") + public Result update(@PathVariable String certificationId, @Validated @RequestBody CertificationReq req){ + certificationService.update(certificationId, req); + return Result.ok(); + } + + @DeleteMapping("/{certificationId}") + @ApiOperation(value = "删除人员资质信息", httpMethod = "DELETE") + public Result remove(@PathVariable String certificationId){ + certificationService.deleteById(certificationId); + return Result.ok(); + } +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/web/src/main/java/com/dite/znpt/web/controller/ContractController.java b/web/src/main/java/com/dite/znpt/web/controller/ContractController.java index ec13cd3..63140dd 100644 --- a/web/src/main/java/com/dite/znpt/web/controller/ContractController.java +++ b/web/src/main/java/com/dite/znpt/web/controller/ContractController.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.web.controller; @@ -83,3 +84,90 @@ public class ContractController { } } +======= +package com.dite.znpt.web.controller; + + +import com.dite.znpt.constant.Constants; +import com.dite.znpt.domain.PageResult; +import com.dite.znpt.domain.Result; +import com.dite.znpt.domain.entity.ContractEntity; +import com.dite.znpt.domain.vo.ContractListReq; +import com.dite.znpt.domain.vo.ContractReq; +import com.dite.znpt.domain.vo.ContractResp; +import com.dite.znpt.service.ContractService; +import com.pig4cloud.plugin.excel.annotation.RequestExcel; +import com.pig4cloud.plugin.excel.annotation.ResponseExcel; +import com.pig4cloud.plugin.excel.vo.ErrorMessage; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.validation.BindingResult; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.List; + +/** + * @author huise23 + * @date 2025/07/21 20:29 + */ +@Api(tags = "合同") +@RestController +@RequestMapping("/contract") +public class ContractController { + @Resource + private ContractService contractService; + + @ApiOperation(value = "获取合同列表", httpMethod = "GET") + @GetMapping("/list") + public PageResult list(ContractListReq contractReq) { + return PageResult.ok(contractService.selectList(contractReq)); + } + + @ApiOperation(value = "根据合同Id获取详细信息", httpMethod = "GET") + @GetMapping("/{contractId}") + public Result getInfo(@PathVariable String contractId) { + return Result.ok(contractService.selectById(contractId)); + } + + @ApiOperation(value = "新增合同", httpMethod = "POST") + @PostMapping + public Result add(@RequestBody ContractReq contractReq) { + contractService.saveData(contractReq); + return Result.ok(); + } + + @ApiOperation(value = "修改合同", httpMethod = "PUT") + @PutMapping + public Result edit(@RequestBody ContractReq contractReq) { + contractService.updateData(contractReq); + return Result.ok(); + } + + @ApiOperation(value = "删除合同", httpMethod = "DELETE") + @DeleteMapping("/{contractId}") + public Result remove(@PathVariable String contractId) { + contractService.deleteById(contractId); + return Result.ok(); + } + + @ApiOperation(value = "导出合同", httpMethod = "GET") + @GetMapping("/export") + @ResponseExcel(name = "合同") + public List export(ContractListReq contractReq) { + return contractService.selectList(contractReq); + } + + @ApiOperation(value = "导入合同", httpMethod = "POST") + @PostMapping("/import") + public Result importData(@RequestExcel List dataList, BindingResult bindingResult) { + // JSR 303 校验通用校验获取失败的数据 + List errorMessageList = (List) bindingResult.getTarget(); + if (errorMessageList != null && !errorMessageList.isEmpty()) { + return Result.error(Constants.SERVICE_EXCEPTION, "导入失败"); + } + return Result.okM("导入"+dataList.size()+"条数据"); + } +} + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/web/src/main/java/com/dite/znpt/web/controller/ContractSettlementController.java b/web/src/main/java/com/dite/znpt/web/controller/ContractSettlementController.java index 6106f7a..6870739 100644 --- a/web/src/main/java/com/dite/znpt/web/controller/ContractSettlementController.java +++ b/web/src/main/java/com/dite/znpt/web/controller/ContractSettlementController.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.web.controller; @@ -40,3 +41,47 @@ public class ContractSettlementController { } +======= +package com.dite.znpt.web.controller; + + +import com.dite.znpt.constant.Constants; +import com.dite.znpt.domain.PageResult; +import com.dite.znpt.domain.Result; +import com.dite.znpt.domain.entity.ContractSettlementEntity; +import com.dite.znpt.domain.vo.ContractSettlementListReq; +import com.dite.znpt.domain.vo.ContractSettlementReq; +import com.dite.znpt.domain.vo.ContractSettlementResp; +import com.dite.znpt.service.ContractSettlementService; +import com.pig4cloud.plugin.excel.annotation.RequestExcel; +import com.pig4cloud.plugin.excel.annotation.ResponseExcel; +import com.pig4cloud.plugin.excel.vo.ErrorMessage; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.validation.BindingResult; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.List; + +/** + * @author huise23 + * @date 2025/07/21 21:11 + */ +@Api(tags = "合同结算") +@RestController +@RequestMapping("/contract-settlement") +public class ContractSettlementController { + @Resource + private ContractSettlementService contractSettlementService; + + @ApiOperation(value = "新增合同结算", httpMethod = "POST") + @PostMapping + public Result add(@RequestBody ContractSettlementReq contractSettlementReq) { + contractSettlementService.saveData(contractSettlementReq); + return Result.ok(); + } + +} + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/web/src/main/java/com/dite/znpt/web/controller/DeptController.java b/web/src/main/java/com/dite/znpt/web/controller/DeptController.java index ce774d8..7f9126e 100644 --- a/web/src/main/java/com/dite/znpt/web/controller/DeptController.java +++ b/web/src/main/java/com/dite/znpt/web/controller/DeptController.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.web.controller; import com.dite.znpt.domain.PageResult; @@ -60,3 +61,67 @@ public class DeptController { return Result.ok(); } } +======= +package com.dite.znpt.web.controller; + +import com.dite.znpt.domain.PageResult; +import com.dite.znpt.domain.Result; +import com.dite.znpt.domain.vo.DeptReq; +import com.dite.znpt.domain.vo.DeptResp; +import com.dite.znpt.service.DeptService; +import com.dite.znpt.util.ValidationGroup; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.List; + +/** + * @author Bear.G + * @date 2025/5/20/周二 10:05 + * @description + */ +@Api(tags = "部门信息") +@RestController +@RequestMapping("/dept") +public class DeptController { + + @Resource + private DeptService deptService; + + @ApiOperation(value = "查询部门树", httpMethod = "GET") + @GetMapping("/tree") + public Result tree (@RequestParam(name = "deptName", required = false) String deptName) { + return Result.ok(deptService.tree(deptName)); + } + + @ApiOperation(value = "查询部门信息详情", httpMethod = "GET") + @GetMapping("/detail/{deptId}") + public Result detail(@PathVariable String deptId) { + return Result.ok(deptService.detail(deptId)); + } + + @ApiOperation(value = "新增部门信息", httpMethod = "POST") + @PostMapping + public Result add(@Validated(ValidationGroup.Insert.class) @RequestBody DeptReq req) { + deptService.save(req); + return Result.ok(); + } + + @ApiOperation(value = "修改部门信息", httpMethod = "PUT") + @PutMapping("/{deptId}") + public Result edit(@PathVariable String deptId, @Validated(ValidationGroup.Update.class) @RequestBody DeptReq req) { + deptService.update(deptId, req); + return Result.ok(); + } + + @ApiOperation(value = "删除部门信息", httpMethod = "DELETE") + @DeleteMapping("/{deptId}") + public Result remove(@PathVariable String deptId) { + deptService.deleteById(deptId); + return Result.ok(); + } +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/web/src/main/java/com/dite/znpt/web/controller/DictController.java b/web/src/main/java/com/dite/znpt/web/controller/DictController.java index 082107a..52ed7ff 100644 --- a/web/src/main/java/com/dite/znpt/web/controller/DictController.java +++ b/web/src/main/java/com/dite/znpt/web/controller/DictController.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.web.controller; @@ -60,3 +61,67 @@ public class DictController { } } +======= +package com.dite.znpt.web.controller; + + +import com.dite.znpt.domain.PageResult; +import com.dite.znpt.domain.Result; +import com.dite.znpt.domain.vo.DictListReq; +import com.dite.znpt.domain.vo.DictReq; +import com.dite.znpt.domain.vo.DictResp; +import com.dite.znpt.service.DictService; +import com.dite.znpt.util.ValidationGroup; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; + +/** + * @author huise23 + * @date 2025/06/30 11:39 + */ +@Api(tags = "字典") +@RestController +@RequestMapping("/dict") +public class DictController { + @Resource + private DictService dictService; + + @ApiOperation(value = "获取字典列表", httpMethod = "GET") + @GetMapping("/list") + public PageResult list(DictListReq dictReq) { + return PageResult.ok(dictService.selectList(dictReq)); + } + + @ApiOperation(value = "根据字典Id获取详细信息", httpMethod = "GET") + @GetMapping("/{dictId}") + public Result getInfo(@PathVariable String dictId) { + return Result.ok(dictService.selectById(dictId)); + } + + @ApiOperation(value = "新增字典", httpMethod = "POST") + @PostMapping + public Result add(@Validated(ValidationGroup.Insert.class) @RequestBody DictReq dictReq) { + dictService.saveData(dictReq); + return Result.ok(); + } + + @ApiOperation(value = "修改字典", httpMethod = "PUT") + @PutMapping + public Result edit(@Validated(ValidationGroup.Update.class) @RequestBody DictReq dictReq) { + dictService.updateData(dictReq); + return Result.ok(); + } + + @ApiOperation(value = "删除字典", httpMethod = "DELETE") + @DeleteMapping("/{dictId}") + public Result remove(@PathVariable String dictId) { + dictService.deleteById(dictId); + return Result.ok(); + } +} + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/web/src/main/java/com/dite/znpt/web/controller/EquipmentController.java b/web/src/main/java/com/dite/znpt/web/controller/EquipmentController.java index 8e79a09..df546ad 100644 --- a/web/src/main/java/com/dite/znpt/web/controller/EquipmentController.java +++ b/web/src/main/java/com/dite/znpt/web/controller/EquipmentController.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.web.controller; import com.dite.znpt.domain.PageResult; @@ -66,3 +67,73 @@ public class EquipmentController { return Result.ok(); } } +======= +package com.dite.znpt.web.controller; + +import com.dite.znpt.domain.PageResult; +import com.dite.znpt.domain.Result; +import com.dite.znpt.domain.vo.EquipmentListReq; +import com.dite.znpt.domain.vo.EquipmentReq; +import com.dite.znpt.domain.vo.EquipmentResp; +import com.dite.znpt.service.EquipmentService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.List; + +/** + * @author Bear.G + * @date 2025/7/23/周三 17:41 + * @description + */ +@Api(tags = "设备信息") +@RestController +@RequestMapping("/equipment") +public class EquipmentController { + + @Resource + private EquipmentService equipmentService; + + @ApiOperation(value = "分页查询设备信息列表", httpMethod = "GET") + @GetMapping("/page") + public PageResult page(EquipmentListReq req) { + return PageResult.ok(equipmentService.page(req)); + } + + @ApiOperation(value = "查询设备信息列表", httpMethod = "GET") + @GetMapping("/list") + public Result> list(EquipmentListReq req) { + return Result.ok(equipmentService.list(req)); + } + + @ApiOperation(value = "查询设备信息详情", httpMethod = "GET") + @GetMapping("/detail/{equipmentId}") + public Result detail(@PathVariable String equipmentId) { + return Result.ok(equipmentService.detail(equipmentId)); + } + + @ApiOperation(value = "新增设备信息", httpMethod = "POST") + @PostMapping + public Result add(@Validated @RequestBody EquipmentReq req){ + equipmentService.save(req); + return Result.ok(); + } + + @ApiOperation(value = "修改设备信息", httpMethod = "PUT") + @PutMapping("/{equipmentId}") + public Result edit(@PathVariable String equipmentId, @Validated @RequestBody EquipmentReq req){ + equipmentService.update(equipmentId, req); + return Result.ok(); + } + + @ApiOperation(value = "删除设备信息", httpMethod = "DELETE") + @DeleteMapping("/{equipmentId}") + public Result remove(@PathVariable String equipmentId){ + equipmentService.deleteById(equipmentId); + return Result.ok(); + } +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/web/src/main/java/com/dite/znpt/web/controller/EquipmentUseRecordController.java b/web/src/main/java/com/dite/znpt/web/controller/EquipmentUseRecordController.java index ed337bc..1debe61 100644 --- a/web/src/main/java/com/dite/znpt/web/controller/EquipmentUseRecordController.java +++ b/web/src/main/java/com/dite/znpt/web/controller/EquipmentUseRecordController.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.web.controller; import com.dite.znpt.domain.PageResult; @@ -60,3 +61,67 @@ public class EquipmentUseRecordController { return Result.ok(); } } +======= +package com.dite.znpt.web.controller; + +import com.dite.znpt.domain.PageResult; +import com.dite.znpt.domain.Result; +import com.dite.znpt.domain.vo.EquipmentUseRecordListReq; +import com.dite.znpt.domain.vo.EquipmentUseRecordReq; +import com.dite.znpt.domain.vo.EquipmentUseRecordResp; +import com.dite.znpt.service.EquipmentUseRecordService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.List; + +/** + * @author Bear.G + * @date 2025/7/23/周三 17:41 + * @description + */ +@Api(tags = "设备使用记录") +@RestController +@RequestMapping("/equipment-use-record") +public class EquipmentUseRecordController { + + @Resource + private EquipmentUseRecordService equipmentUseRecordService; + + + @ApiOperation(value = "分页查询设备使用记录列表", httpMethod = "GET") + @GetMapping("/page") + public PageResult page(EquipmentUseRecordListReq req) { + return PageResult.ok(equipmentUseRecordService.page(req)); + } + + @ApiOperation(value = "查询设备使用记录列表", httpMethod = "GET") + @GetMapping("/list") + public Result> list(EquipmentUseRecordListReq req) { + return Result.ok(equipmentUseRecordService.list(req)); + } + + @ApiOperation(value = "查询设备使用记录详情", httpMethod = "GET") + @GetMapping("/detail/{equipmentId}") + public Result> detail(@PathVariable String equipmentId) { + return Result.ok(equipmentUseRecordService.detail(equipmentId)); + } + + @ApiOperation(value = "借用设备", httpMethod = "PUT") + @PutMapping("/borrow/{equipmentId}") + public Result borrowEquipment(@PathVariable String equipmentId, @Validated @RequestBody EquipmentUseRecordReq req){ + equipmentUseRecordService.borrowEquipment(equipmentId,req); + return Result.ok(); + } + + @ApiOperation(value = "归还设备", httpMethod = "PUT") + @PutMapping("/return/{userRecordId}") + public Result returnEquipment(@PathVariable String userRecordId, @Validated @RequestBody EquipmentUseRecordReq req){ + equipmentUseRecordService.returnEquipment(userRecordId, req); + return Result.ok(); + } +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/web/src/main/java/com/dite/znpt/web/controller/ImageController.java b/web/src/main/java/com/dite/znpt/web/controller/ImageController.java index 529bd93..42fb750 100644 --- a/web/src/main/java/com/dite/znpt/web/controller/ImageController.java +++ b/web/src/main/java/com/dite/znpt/web/controller/ImageController.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.web.controller; @@ -102,3 +103,109 @@ public class ImageController { return Result.ok(); } } +======= +package com.dite.znpt.web.controller; + + +import com.dite.znpt.domain.PageResult; +import com.dite.znpt.domain.Result; +import com.dite.znpt.domain.vo.*; +import com.dite.znpt.service.ImageCollectService; +import com.dite.znpt.service.ImageService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import javax.annotation.Resource; +import java.io.IOException; +import java.util.List; + +/** + * @author Bear.G + * @date 2025/4/24/周四 12:46 + * @description + */ +@Api(tags = "图像信息") +@RestController +@RequestMapping("/image") +public class ImageController { + + @Resource + private ImageService imageService; + + @Resource + private ImageCollectService imageCollectService; + + @ApiOperation(value = "分页查询图像列表", httpMethod = "GET") + @GetMapping("/page") + public PageResult page(ImageListReq req) { + return PageResult.ok(imageService.page(req)); + } + + @ApiOperation(value = "查询图像列表", httpMethod = "GET") + @GetMapping("/list") + public Result> list(ImageListReq req){ + return Result.ok(imageService.list(req)); + } + + @ApiOperation(value = "查询图像详情", httpMethod = "GET") + @GetMapping("/detail/{imageId}") + public Result detail(@PathVariable String imageId){ + return Result.ok(imageService.detail(imageId)); + } + + @ApiOperation(value = "批量上传图像", httpMethod = "POST") + @PostMapping("/{imageSource}/upload-batch/{partId}") + public Result> uploadBatch(@PathVariable String imageSource, @PathVariable String partId, ImageCollectReq collectReq, @RequestParam("files") MultipartFile[] files) { + return Result.ok(imageService.batchUploadDefectImage(partId, imageSource, collectReq, files)); + } + + @ApiOperation(value = "手动批量上传文件夹图像到项目", httpMethod = "POST") + @PostMapping("/{projectId}/{imageSource}/upload-batch") + public Result> uploadProjectBatch(@PathVariable String projectId, @PathVariable String imageSource, ImageCollectReq collectReq, @RequestParam("files") MultipartFile[] files) { + return Result.ok(imageService.uploadProjectBatch(projectId, imageSource, collectReq, files)); + } + + @ApiOperation(value = "上传图像", httpMethod = "POST") + @PostMapping("/{imageSource}/upload/{partId}") + public Result uploadOutWork(@PathVariable String imageSource, @PathVariable String partId, ImageCollectReq collectReq, @RequestParam("file") MultipartFile file) { + MultipartFile[] files = {file}; + return Result.ok(imageService.batchUploadDefectImage(partId, imageSource, collectReq, files).get(0)); + } + + @ApiOperation(value = "设置信息", httpMethod = "POST") + @PostMapping("/setting-info/{partId}") + public Result save(@PathVariable String partId, @RequestBody ImageCollectReq req) { + imageCollectService.save(partId, req); + return Result.ok(); + } + + @ApiOperation(value = "删除图像", httpMethod = "DELETE") + @DeleteMapping("/{imageId}") + public Result remove(@PathVariable String imageId){ + imageService.delete(imageId); + return Result.ok(); + } + + @ApiOperation(value = "获取APP上传的图片列表-废弃", httpMethod = "GET") + @GetMapping("/list/app-upload-images") + public Result> listAppUploadImages() throws IOException { + return Result.ok(imageService.listAppUploadImages()); + } + + @ApiOperation(value = "关联APP上传图片到机组-废弃", httpMethod = "POST") + @PostMapping("/linkAppImagesToPart") + public Result linkAppImagesToPart(@RequestBody AppImageToPartReq partReq) { + imageService.linkAppImagesToPart(partReq); + return Result.ok(); + } + + @ApiOperation(value = "审核图片", httpMethod = "POST") + @PostMapping("/reviewImages") + public Result reviewImages(@RequestBody List imageIds) { + imageService.reviewImages(imageIds); + return Result.ok(); + } +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/web/src/main/java/com/dite/znpt/web/controller/InspectionReportController.java b/web/src/main/java/com/dite/znpt/web/controller/InspectionReportController.java index b7d511d..13f0625 100644 --- a/web/src/main/java/com/dite/znpt/web/controller/InspectionReportController.java +++ b/web/src/main/java/com/dite/znpt/web/controller/InspectionReportController.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.web.controller; import com.dite.znpt.domain.PageResult; @@ -75,3 +76,82 @@ public class InspectionReportController { return Result.ok(); } } +======= +package com.dite.znpt.web.controller; + +import com.dite.znpt.domain.PageResult; +import com.dite.znpt.domain.Result; +import com.dite.znpt.domain.vo.InspectionReportListReq; +import com.dite.znpt.domain.vo.InspectionReportListResp; +import com.dite.znpt.domain.vo.InspectionReportReq; +import com.dite.znpt.domain.vo.InspectionReportResp; +import com.dite.znpt.service.InspectionReportService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.List; + +/** + * @author Bear.G + * @date 2025/7/7/周一 17:43 + * @description + */ +@Api(tags = "检查报告") +@RestController +@RequestMapping("/inspection-report") +public class InspectionReportController { + + @Resource + private InspectionReportService inspectionReportService; + + + @ApiOperation(value = "分页查询检查报告列表", httpMethod = "GET") + @GetMapping("/page") + public PageResult page(InspectionReportListReq req) { + return PageResult.ok(inspectionReportService.page(req)); + } + + @ApiOperation(value = "查询检查报告列表", httpMethod = "GET") + @GetMapping("/list") + public Result> list(InspectionReportListReq req) { + return Result.ok(inspectionReportService.list(req)); + } + + @ApiOperation(value = "查询检查报告详情", httpMethod = "GET") + @GetMapping("/detail/{reportId}") + public Result detail(@PathVariable String reportId) { + return Result.ok(inspectionReportService.detail(reportId)); + } + + @ApiOperation(value = "新增检查报告", httpMethod = "POST") + @PostMapping + public Result add(@Validated @RequestBody InspectionReportReq req) { + inspectionReportService.save(req); + return Result.ok(); + } + + @ApiOperation(value = "修改检查报告", httpMethod = "PUT") + @PostMapping("/{reportId}") + public Result edit(@PathVariable String reportId, @Validated @RequestBody InspectionReportReq req) { + inspectionReportService.update(reportId, req); + return Result.ok(); + } + + @ApiOperation(value = "删除检查报告", httpMethod = "DELETE") + @DeleteMapping("/{reportId}") + public Result delete(@PathVariable String reportId) { + inspectionReportService.removeById(reportId); + return Result.ok(); + } + + @ApiOperation(value = "发布项目机组报告", httpMethod = "POST") + @PutMapping("/publish/{reportId}") + public Result publish(@PathVariable String reportId) { + inspectionReportService.publish(reportId); + return Result.ok(); + } +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/web/src/main/java/com/dite/znpt/web/controller/InsuranceCompanyController.java b/web/src/main/java/com/dite/znpt/web/controller/InsuranceCompanyController.java index b3d70d4..a53d08f 100644 --- a/web/src/main/java/com/dite/znpt/web/controller/InsuranceCompanyController.java +++ b/web/src/main/java/com/dite/znpt/web/controller/InsuranceCompanyController.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.web.controller; import com.dite.znpt.domain.PageResult; @@ -66,3 +67,73 @@ public class InsuranceCompanyController { return Result.ok(); } } +======= +package com.dite.znpt.web.controller; + +import com.dite.znpt.domain.PageResult; +import com.dite.znpt.domain.Result; +import com.dite.znpt.domain.vo.InsuranceCompanyListReq; +import com.dite.znpt.domain.vo.InsuranceCompanyReq; +import com.dite.znpt.domain.vo.InsuranceCompanyResp; +import com.dite.znpt.service.InsuranceCompanyService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.validation.Valid; +import java.util.List; + +/** + * @author Bear.G + * @date 2025/6/26/周四 9:10 + * @description + */ +@Api(tags = "保险公司信息") +@RestController +@RequestMapping("/insurance-company") +public class InsuranceCompanyController { + + @Resource + private InsuranceCompanyService insuranceCompanyService; + + @ApiOperation(value = "分页查询保险公司信息列表", httpMethod = "GET") + @GetMapping("/page") + public PageResult page(InsuranceCompanyListReq req) { + return PageResult.ok(insuranceCompanyService.page(req)); + } + + @ApiOperation(value = "查询保险公司信息列表", httpMethod = "GET") + @GetMapping("/list") + public Result> list(InsuranceCompanyListReq req) { + return Result.ok(insuranceCompanyService.list(req)); + } + + @ApiOperation(value = "查询保险公司信息详情", httpMethod = "GET") + @GetMapping("/detail/{insuranceCompanyId}") + public Result detail(@PathVariable String insuranceCompanyId) { + return Result.ok(insuranceCompanyService.detail(insuranceCompanyId)); + } + + @ApiOperation(value = "新增保险公司信息", httpMethod = "POST") + @PostMapping + public Result add(@Valid @RequestBody InsuranceCompanyReq req) { + insuranceCompanyService.save(req); + return Result.ok(); + } + + @ApiOperation(value = "修改保险公司信息", httpMethod = "POST") + @PutMapping("/{insuranceCompanyId}") + public Result edit(@PathVariable String insuranceCompanyId, @Valid @RequestBody InsuranceCompanyReq req) { + insuranceCompanyService.update(insuranceCompanyId, req); + return Result.ok(); + } + + @ApiOperation(value = "删除保险公司信息", httpMethod = "DELETE") + @DeleteMapping("/{insuranceCompanyId}") + public Result remove(@PathVariable String insuranceCompanyId) { + insuranceCompanyService.deleteById(insuranceCompanyId); + return Result.ok(); + } +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/web/src/main/java/com/dite/znpt/web/controller/InsuranceInfoController.java b/web/src/main/java/com/dite/znpt/web/controller/InsuranceInfoController.java index 49e74e8..d931e29 100644 --- a/web/src/main/java/com/dite/znpt/web/controller/InsuranceInfoController.java +++ b/web/src/main/java/com/dite/znpt/web/controller/InsuranceInfoController.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.web.controller; import cn.hutool.core.util.StrUtil; @@ -105,3 +106,112 @@ public class InsuranceInfoController { attachInfoService.download(insuranceInfo.getAttachInfoId(), response); } } +======= +package com.dite.znpt.web.controller; + +import cn.hutool.core.util.StrUtil; +import com.dite.znpt.constant.Message; +import com.dite.znpt.domain.PageResult; +import com.dite.znpt.domain.Result; +import com.dite.znpt.domain.entity.InsuranceInfoEntity; +import com.dite.znpt.domain.vo.InsuranceAttachResp; +import com.dite.znpt.domain.vo.InsuranceInfoListReq; +import com.dite.znpt.domain.vo.InsuranceInfoReq; +import com.dite.znpt.domain.vo.InsuranceInfoResp; +import com.dite.znpt.service.AttachInfoService; +import com.dite.znpt.service.InsuranceInfoService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletResponse; +import javax.validation.Valid; +import java.io.IOException; +import java.rmi.ServerException; +import java.util.List; + +/** + * @author Bear.G + * @date 2025/6/26/周四 9:09 + * @description + */ +@Api(tags = "保险信息") +@RestController +@RequestMapping("/insurance-info") +public class InsuranceInfoController { + + @Resource + private InsuranceInfoService insuranceInfoService; + + @Resource + private AttachInfoService attachInfoService; + + @ApiOperation(value = "分页查询保险信息列表", httpMethod = "GET") + @GetMapping("/page") + public PageResult page(InsuranceInfoListReq req) { + return PageResult.ok(insuranceInfoService.page(req)); + } + + @ApiOperation(value = "查询保险信息列表", httpMethod = "GET") + @GetMapping("/list") + public Result> list(InsuranceInfoListReq req) { + return Result.ok(insuranceInfoService.list(req)); + } + + @ApiOperation(value = "分页查询保险附件列表", httpMethod = "GET") + @GetMapping("/page-attach") + public PageResult pageAttach(InsuranceInfoListReq req) { + return PageResult.ok(insuranceInfoService.pageAttach(req)); + } + + @ApiOperation(value = "查询保险附件列表", httpMethod = "GET") + @GetMapping("/list-attach") + public Result> listAttach(InsuranceInfoListReq req) { + return Result.ok(insuranceInfoService.listAttach(req)); + } + + @ApiOperation(value = "查询保险信息详情", httpMethod = "GET") + @GetMapping("/detail/{insuranceInfoId}") + public Result detail(@PathVariable String insuranceInfoId) { + return Result.ok(insuranceInfoService.detail(insuranceInfoId)); + } + + @ApiOperation(value = "新增保险信息", httpMethod = "POST") + @PostMapping + public Result add(@Valid @RequestBody InsuranceInfoReq req) { + insuranceInfoService.save(req); + return Result.ok(); + } + + @ApiOperation(value = "修改保险信息", httpMethod = "POST") + @PutMapping("/{insuranceInfoId}") + public Result edit(@PathVariable String insuranceInfoId, @Valid @RequestBody InsuranceInfoReq req) { + insuranceInfoService.update(insuranceInfoId, req); + return Result.ok(); + } + + @ApiOperation(value = "删除保险信息", httpMethod = "DELETE") + @DeleteMapping("/{insuranceInfoId}") + public Result remove(@PathVariable String insuranceInfoId) { + insuranceInfoService.deleteById(insuranceInfoId); + return Result.ok(); + } + + /** + * @param response + * @功能描述 下载文件:将输入流中的数据循环写入到响应输出流中,而不是一次性读取到内存 + */ + @GetMapping("/download-file/{insuranceInfoId}") + public void downloadFile(@PathVariable String insuranceInfoId, HttpServletResponse response) throws Exception { + InsuranceInfoEntity insuranceInfo = insuranceInfoService.getById(insuranceInfoId); + if(null == insuranceInfo){ + throw new ServerException(Message.INSURANCE_INFO_ID_IS_NOT_EXIST); + } + if(StrUtil.isBlank(insuranceInfo.getAttachInfoId())){ + throw new ServerException(Message.INSURANCE_FILE_IS_NOT_EXIST); + } + attachInfoService.download(insuranceInfo.getAttachInfoId(), response); + } +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/web/src/main/java/com/dite/znpt/web/controller/InsuranceTypeController.java b/web/src/main/java/com/dite/znpt/web/controller/InsuranceTypeController.java index baec016..2d528c5 100644 --- a/web/src/main/java/com/dite/znpt/web/controller/InsuranceTypeController.java +++ b/web/src/main/java/com/dite/znpt/web/controller/InsuranceTypeController.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.web.controller; import com.dite.znpt.domain.PageResult; @@ -65,3 +66,72 @@ public class InsuranceTypeController { return Result.ok(); } } +======= +package com.dite.znpt.web.controller; + +import com.dite.znpt.domain.PageResult; +import com.dite.znpt.domain.Result; +import com.dite.znpt.domain.vo.InsuranceTypeReq; +import com.dite.znpt.domain.vo.InsuranceTypeResp; +import com.dite.znpt.service.InsuranceTypeService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.validation.Valid; +import java.util.List; + +/** + * @author Bear.G + * @date 2025/6/26/周四 9:10 + * @description + */ +@Api(tags = "保险类型类型") +@RestController +@RequestMapping("/insurance-type") +public class InsuranceTypeController { + + @Resource + private InsuranceTypeService insuranceTypeService; + + @ApiOperation(value = "分页查询保险类型列表", httpMethod = "GET") + @GetMapping("/page") + public PageResult page(@RequestParam(required = false) String insuranceTypeName) { + return PageResult.ok(insuranceTypeService.page(insuranceTypeName)); + } + + @ApiOperation(value = "查询保险类型列表", httpMethod = "GET") + @GetMapping("/list") + public Result> list(@RequestParam(required = false) String insuranceTypeName) { + return Result.ok(insuranceTypeService.list(insuranceTypeName)); + } + + @ApiOperation(value = "查询保险类型详情", httpMethod = "GET") + @GetMapping("/detail/{insuranceTypeId}") + public Result detail(@PathVariable String insuranceTypeId) { + return Result.ok(insuranceTypeService.detail(insuranceTypeId)); + } + + @ApiOperation(value = "新增保险类型", httpMethod = "POST") + @PostMapping + public Result add(@Valid @RequestBody InsuranceTypeReq req) { + insuranceTypeService.save(req); + return Result.ok(); + } + + @ApiOperation(value = "修改保险类型", httpMethod = "POST") + @PutMapping("/{insuranceTypeId}") + public Result edit(@PathVariable String insuranceTypeId, @Valid @RequestBody InsuranceTypeReq req) { + insuranceTypeService.update(insuranceTypeId, req); + return Result.ok(); + } + + @ApiOperation(value = "删除保险类型", httpMethod = "DELETE") + @DeleteMapping("/{insuranceTypeId}") + public Result remove(@PathVariable String insuranceTypeId) { + insuranceTypeService.deleteById(insuranceTypeId); + return Result.ok(); + } +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/web/src/main/java/com/dite/znpt/web/controller/JobAntiThunderWorkController.java b/web/src/main/java/com/dite/znpt/web/controller/JobAntiThunderWorkController.java index e20b3fc..6a4712b 100644 --- a/web/src/main/java/com/dite/znpt/web/controller/JobAntiThunderWorkController.java +++ b/web/src/main/java/com/dite/znpt/web/controller/JobAntiThunderWorkController.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.web.controller; import com.dite.znpt.domain.Result; @@ -68,3 +69,75 @@ public class JobAntiThunderWorkController { } } +======= +package com.dite.znpt.web.controller; + +import com.dite.znpt.domain.Result; +import com.dite.znpt.domain.TableData; +import com.dite.znpt.domain.entity.job.JobAntiThunderWork; +import com.dite.znpt.domain.vo.job.req.JobAntiThunderWorkReq; +import com.dite.znpt.domain.vo.job.req.JobInfoReq; +import com.dite.znpt.exception.ServiceException; +import com.dite.znpt.service.job.JobAntiThunderWorkService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.apache.poi.ss.formula.functions.T; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import java.util.List; + +/** + * @author Julio + * @date 2023/2/1 14:26 + * @description 防雷工作 + */ +@Api(tags = "防雷工作", description = "防雷工作") +@RestController +@RequestMapping("/job-no-man-work") +public class JobAntiThunderWorkController { + + @Autowired + private JobAntiThunderWorkService service; + + @PostMapping(value = "getWorkContent") + @ApiOperation(value = "根据jobId查询岗位内容,未查到返回空对象") + @ResponseBody + public Result getJob(@Valid @RequestBody JobAntiThunderWorkReq dto) throws ServiceException { + List list = this.service.listByJobId(dto); + if (list.isEmpty()) { + return Result.ok(new JobAntiThunderWork()); + } + return Result.ok(list.get(0)); + } + + @PostMapping(value = "save") + @ApiOperation(value = "新增或更新") + public Result save(@Valid @RequestBody JobAntiThunderWork work) { + return Result.okM(this.service.saveInfo(work), "保存成功"); + } + + @PostMapping("/list") + @ApiOperation(value = "查询列表,组长-施工人员") + public Result> list(@RequestBody JobInfoReq request) { + List list = this.service.list(request); + return Result.ok(new TableData<>(list, request.getPage(), request.getPageSize(), list.size())); + } + + @PostMapping("/submit") + @ApiOperation(value = "组长提交/项目经理审批") + public Result> submit(@RequestBody JobInfoReq request) { + this.service.submit(request); + return Result.ok(); + } + + @PostMapping("/reject") + @ApiOperation(value = "组长驳回/项目经理驳回") + public Result> reject(@RequestBody JobInfoReq request) { + this.service.reject(request); + return Result.ok(); + } +} + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/web/src/main/java/com/dite/znpt/web/controller/JobController.java b/web/src/main/java/com/dite/znpt/web/controller/JobController.java index 9ae1f90..9e28f42 100644 --- a/web/src/main/java/com/dite/znpt/web/controller/JobController.java +++ b/web/src/main/java/com/dite/znpt/web/controller/JobController.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.web.controller; import com.dite.znpt.domain.Result; @@ -37,3 +38,44 @@ public class JobController { } } +======= +package com.dite.znpt.web.controller; + +import com.dite.znpt.domain.Result; +import com.dite.znpt.domain.entity.job.JobInfo; +import com.dite.znpt.domain.vo.job.req.JobInfoReq; +import com.dite.znpt.exception.ServiceException; +import com.dite.znpt.service.job.JobService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import java.util.List; + +/** + * @author Julio + * @date 2023/2/1 14:26 + * @description 项目-机组-岗位 + */ +@Api(tags = "项目-机组-岗位", description = "项目-机组-岗位") +@RestController +@RequestMapping("/job") +public class JobController { + @Autowired + private JobService jobService; + + @PostMapping(value = "getJob") + @ApiOperation(value = "根据项目-机组-人员id查询岗位信息,未查到返回null") + @ResponseBody + public Result getJobInfo(@Valid @RequestBody JobInfoReq dto) throws ServiceException { + List list = this.jobService.page(dto); + if (list.isEmpty()) { + return Result.ok(); + } + return Result.ok(list.get(0)); + } +} + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/web/src/main/java/com/dite/znpt/web/controller/JobInWorkController.java b/web/src/main/java/com/dite/znpt/web/controller/JobInWorkController.java index 1a3175c..d7e84fa 100644 --- a/web/src/main/java/com/dite/znpt/web/controller/JobInWorkController.java +++ b/web/src/main/java/com/dite/znpt/web/controller/JobInWorkController.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.web.controller; import com.dite.znpt.domain.Result; @@ -68,3 +69,75 @@ public class JobInWorkController { } } +======= +package com.dite.znpt.web.controller; + +import com.dite.znpt.domain.Result; +import com.dite.znpt.domain.TableData; +import com.dite.znpt.domain.entity.job.JobAntiThunderWork; +import com.dite.znpt.domain.entity.job.JobInWork; +import com.dite.znpt.domain.vo.job.req.JobInWorkReq; +import com.dite.znpt.domain.vo.job.req.JobInfoReq; +import com.dite.znpt.exception.ServiceException; +import com.dite.znpt.service.job.JobInWorkService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import java.util.List; + +/** + * @author Julio + * @date 2023/2/1 14:26 + * @description 内部工作 + */ +@Api(tags = "内部工作", description = "内部工作") +@RestController +@RequestMapping("/job-in-work") +public class JobInWorkController { + + @Autowired + private JobInWorkService service; + + @PostMapping(value = "getWorkContent") + @ApiOperation(value = "根据jobId查询岗位内容,未查到返回空对象") + @ResponseBody + public Result getJob(@Valid @RequestBody JobInWorkReq dto) throws ServiceException { + List list = this.service.listByJobId(dto); + if (list.isEmpty()) { + return Result.ok(new JobInWork()); + } + return Result.ok(list.get(0)); + } + + @PostMapping(value = "save") + @ApiOperation(value = "新增或更新") + public Result save(@Valid @RequestBody JobInWork work) { + return Result.okM(this.service.saveInfo(work), "保存成功"); + } + + @PostMapping("/list") + @ApiOperation(value = "查询列表,组长-施工人员") + public Result> list(@RequestBody JobInfoReq request) { + List list = this.service.list(request); + return Result.ok(new TableData<>(list, request.getPage(), request.getPageSize(), list.size())); + } + + @PostMapping("/submit") + @ApiOperation(value = "组长提交/项目经理审批") + public Result> submit(@RequestBody JobInfoReq request) { + this.service.submit(request); + return Result.ok(); + } + + @PostMapping("/reject") + @ApiOperation(value = "组长驳回/项目经理驳回") + public Result> reject(@RequestBody JobInfoReq request) { + this.service.reject(request); + return Result.ok(); + } +} + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/web/src/main/java/com/dite/znpt/web/controller/JobOutWorkController.java b/web/src/main/java/com/dite/znpt/web/controller/JobOutWorkController.java index 6c24d11..d9ac2e0 100644 --- a/web/src/main/java/com/dite/znpt/web/controller/JobOutWorkController.java +++ b/web/src/main/java/com/dite/znpt/web/controller/JobOutWorkController.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.web.controller; import com.dite.znpt.domain.Result; @@ -64,3 +65,71 @@ public class JobOutWorkController { } +======= +package com.dite.znpt.web.controller; + +import com.dite.znpt.domain.Result; +import com.dite.znpt.domain.TableData; +import com.dite.znpt.domain.entity.job.JobOutWork; +import com.dite.znpt.domain.vo.job.req.JobInfoReq; +import com.dite.znpt.domain.vo.job.req.JobOutWorkReq; +import com.dite.znpt.exception.ServiceException; +import com.dite.znpt.service.job.JobOutWorkService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import java.util.List; + +/** + * @author Julio + * @date 2023/2/1 14:26 + * @description 外部工作 + */ +@Api(tags = "外部工作", description = "外部工作") +@RestController +@RequestMapping("/job-out-work") +public class JobOutWorkController { + + @Autowired + private JobOutWorkService service; + + @PostMapping(value = "getWorkContent") + @ApiOperation(value = "根据jobId查询岗位内容,未查到返回空对象") + @ResponseBody + public Result getJob(@Valid @RequestBody JobOutWorkReq dto) throws ServiceException { + return Result.ok(this.service.getByJobId(dto)); + } + + @PostMapping(value = "save") + @ApiOperation(value = "新增或更新") + public Result save(@Valid @RequestBody JobOutWork work) { + return Result.okM(this.service.saveInfo(work), "保存成功"); + } + + @PostMapping("/list") + @ApiOperation(value = "查询列表,组长-施工人员") + public Result> list(@RequestBody JobInfoReq request) { + List list = this.service.list(request); + return Result.ok(new TableData<>(list, request.getPage(), request.getPageSize(), list.size())); + } + + @PostMapping("/submit") + @ApiOperation(value = "组长提交/项目经理审批") + public Result> submit(@RequestBody JobInfoReq request) { + this.service.submit(request); + return Result.ok(); + } + + @PostMapping("/reject") + @ApiOperation(value = "组长驳回/项目经理驳回") + public Result> reject(@RequestBody JobInfoReq request) { + this.service.reject(request); + return Result.ok(); + } + +} + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/web/src/main/java/com/dite/znpt/web/controller/JobSummaryWorkController.java b/web/src/main/java/com/dite/znpt/web/controller/JobSummaryWorkController.java index 5969531..75da5ee 100644 --- a/web/src/main/java/com/dite/znpt/web/controller/JobSummaryWorkController.java +++ b/web/src/main/java/com/dite/znpt/web/controller/JobSummaryWorkController.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.web.controller; import com.dite.znpt.domain.Result; @@ -72,3 +73,79 @@ public class JobSummaryWorkController { } +======= +package com.dite.znpt.web.controller; + +import com.dite.znpt.domain.Result; +import com.dite.znpt.domain.TableData; +import com.dite.znpt.domain.entity.job.JobOutWork; +import com.dite.znpt.domain.entity.job.JobSummaryWork; +import com.dite.znpt.domain.vo.job.req.JobInfoReq; +import com.dite.znpt.domain.vo.job.req.JobSummaryWorkReq; +import com.dite.znpt.exception.ServiceException; +import com.dite.znpt.service.job.JobInWorkService; +import com.dite.znpt.service.job.JobOutWorkService; +import com.dite.znpt.service.job.JobSummaryWorkService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.domain.Page; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import java.util.List; + +/** + * @author Julio + * @date 2023/2/1 14:26 + * @description 汇总报告 + */ +@Api(tags = "汇总报告", description = "汇总报告") +@RestController +@RequestMapping("/job-summary-work") +public class JobSummaryWorkController { + + @Autowired + private JobSummaryWorkService service; + + @PostMapping(value = "getWorkContent") + @ApiOperation(value = "根据jobId查询岗位内容,未查到返回空对象") + @ResponseBody + public Result getJob(@Valid @RequestBody JobSummaryWorkReq dto) throws ServiceException { + List list = this.service.listByJobId(dto); + if (list.isEmpty()) { + return Result.ok(new JobSummaryWork()); + } + return Result.ok(list.get(0)); + } + + @PostMapping(value = "save") + @ApiOperation(value = "新增或更新") + public Result save(@Valid @RequestBody JobSummaryWork work) { + return Result.okM(this.service.saveInfo(work), "保存成功"); + } + + @PostMapping("/list") + @ApiOperation(value = "查询列表,组长-施工人员") + public Result> list(@RequestBody JobInfoReq request) { + List list = this.service.list(request); + return Result.ok(new TableData<>(list, request.getPage(), request.getPageSize(), list.size())); + } + + @PostMapping("/submit") + @ApiOperation(value = "组长提交/项目经理审批") + public Result> submit(@RequestBody JobInfoReq request) { + this.service.submit(request); + return Result.ok(); + } + + @PostMapping("/reject") + @ApiOperation(value = "组长驳回/项目经理驳回") + public Result> reject(@RequestBody JobInfoReq request) { + this.service.reject(request); + return Result.ok(); + } + +} + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/web/src/main/java/com/dite/znpt/web/controller/MenuController.java b/web/src/main/java/com/dite/znpt/web/controller/MenuController.java index 2620c62..a9e56da 100644 --- a/web/src/main/java/com/dite/znpt/web/controller/MenuController.java +++ b/web/src/main/java/com/dite/znpt/web/controller/MenuController.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.web.controller; import com.dite.znpt.domain.Result; @@ -56,3 +57,63 @@ public class MenuController { return Result.ok(); } } +======= +package com.dite.znpt.web.controller; + +import com.dite.znpt.domain.Result; +import com.dite.znpt.domain.vo.MenuReq; +import com.dite.znpt.domain.vo.MenuResp; +import com.dite.znpt.service.MenuService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; + +/** + * @author Bear.G + * @date 2025/5/21/周三 15:01 + * @description + */ +@Api(tags = "菜单信息") +@RestController +@RequestMapping("/menu") +public class MenuController { + + @Resource + private MenuService menuService; + + @ApiOperation(value = "查询菜单树", httpMethod = "GET") + @GetMapping("/tree") + public Result tree (@RequestParam(name = "menuName", required = false) String menuName, @RequestParam(defaultValue = "PC") String terminalType) { + return Result.ok(menuService.tree(menuName, terminalType)); + } + + @ApiOperation(value = "查询菜单详情", httpMethod = "GET") + @GetMapping("/detail/{menuId}") + public Result detail(@PathVariable String menuId) { + return Result.ok(menuService.detail(menuId)); + } + + @ApiOperation(value = "新增菜单", httpMethod = "POST") + @PostMapping + public Result add(@RequestBody MenuReq req) { + menuService.save(req); + return Result.ok(); + } + + @ApiOperation(value = "修改菜单", httpMethod = "PUT") + @PutMapping("/{menuId}") + public Result update(@PathVariable String menuId, @RequestBody MenuReq req) { + menuService.update(menuId, req); + return Result.ok(); + } + + @ApiOperation(value = "删除菜单", httpMethod = "DELETE") + @DeleteMapping("/{menuId}") + public Result delete(@PathVariable String menuId) { + menuService.deleteById(menuId); + return Result.ok(); + } +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/web/src/main/java/com/dite/znpt/web/controller/ModelConfigController.java b/web/src/main/java/com/dite/znpt/web/controller/ModelConfigController.java index 117efbe..1d4443c 100644 --- a/web/src/main/java/com/dite/znpt/web/controller/ModelConfigController.java +++ b/web/src/main/java/com/dite/znpt/web/controller/ModelConfigController.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.web.controller; @@ -67,3 +68,74 @@ public class ModelConfigController { } } +======= +package com.dite.znpt.web.controller; + + +import com.dite.znpt.config.YoloModelRegistry; +import com.dite.znpt.domain.PageResult; +import com.dite.znpt.domain.Result; +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.service.ModelConfigService; +import com.dite.znpt.service.impl.MultiModelYoloService; +import com.dite.znpt.util.ValidationGroup; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; + +/** + * @author huise23 + * @date 2025/07/02 21:21 + */ +@Api(tags = "模型配置") +@RestController +@RequestMapping("/model-config") +public class ModelConfigController { + @Resource + private ModelConfigService modelConfigService; + @Resource + private YoloModelRegistry registry; + @Autowired + private MultiModelYoloService multiModelYoloService; + + @ApiOperation(value = "获取列表", httpMethod = "GET") + @GetMapping("/list") + public PageResult list(ModelConfigListReq modelConfigReq) { + return PageResult.ok(modelConfigService.selectList(modelConfigReq)); + } + + @ApiOperation(value = "根据Id获取详细信息", httpMethod = "GET") + @GetMapping("/{modelId}") + public Result getInfo(@PathVariable String modelId) { + return Result.ok(modelConfigService.selectById(modelId)); + } + + @ApiOperation(value = "新增", httpMethod = "POST") + @PostMapping + public Result add(@Validated(ValidationGroup.Insert.class) @RequestBody ModelConfigReq modelConfigReq) { + modelConfigService.saveData(modelConfigReq); + return Result.ok(); + } + + @ApiOperation(value = "修改", httpMethod = "PUT") + @PutMapping + public Result edit(@Validated(ValidationGroup.Update.class) @RequestBody ModelConfigReq modelConfigReq) { + modelConfigService.updateData(modelConfigReq); + return Result.ok(); + } + + @ApiOperation(value = "删除", httpMethod = "DELETE") + @DeleteMapping("/{modelId}") + public Result remove(@PathVariable String modelId) { + modelConfigService.deleteById(modelId); + return Result.ok(); + } +} + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/web/src/main/java/com/dite/znpt/web/controller/OutbidInfoController.java b/web/src/main/java/com/dite/znpt/web/controller/OutbidInfoController.java new file mode 100644 index 0000000..a73fe02 --- /dev/null +++ b/web/src/main/java/com/dite/znpt/web/controller/OutbidInfoController.java @@ -0,0 +1,72 @@ +package com.dite.znpt.web.controller; + +import com.dite.znpt.domain.PageResult; +import com.dite.znpt.domain.Result; +import com.dite.znpt.domain.vo.OutbidInfoReq; +import com.dite.znpt.domain.vo.OutbidInfoResp; +import com.dite.znpt.service.OutbidInfoService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletResponse; + +/** + * @author Bear.G + * @date 2025/7/28/周一 16:13 + * @description + */ +@Api(tags = "中标信息") +@RestController +@RequestMapping("/outbid-info") +public class OutbidInfoController { + @Resource + private OutbidInfoService outbidInfoService; + + @ApiOperation(value = "分页查询中标通知信息列表", httpMethod = "GET") + @GetMapping("/page") + public PageResult page(String projectName){ + return PageResult.ok(outbidInfoService.page(projectName)); + } + + @ApiOperation(value = "查询中标通知信息列表", httpMethod = "GET") + @GetMapping("/list") + public Result list(String projectName){ + return Result.ok(outbidInfoService.list(projectName)); + } + + @ApiOperation(value = "根据中标通知信息Id获取详细信息", httpMethod = "GET") + @GetMapping("/detail/{outbidInfoId}") + public Result detail(@PathVariable String outbidInfoId){ + return Result.ok(outbidInfoService.detail(outbidInfoId)); + } + + @ApiOperation(value = "新增中标通知信息", httpMethod = "POST", notes = "上传附件调用新增附件信息接口:/attach-info/outbidInfo,userDefinedPath = {outbidInfoId}") + @PostMapping + public Result add(@RequestBody OutbidInfoReq req){ + outbidInfoService.save(req); + return Result.ok(); + } + + @ApiOperation(value = "根据中标通知信息Id更新信息", httpMethod = "PUT", notes = "上传附件调用新增附件信息接口:/attach-info/outbidInfo,userDefinedPath = {outbidInfoId}") + @PutMapping("/{outbidInfoId}") + public Result update(@PathVariable String outbidInfoId, @RequestBody OutbidInfoReq req){ + outbidInfoService.update(outbidInfoId, req); + return Result.ok(); + } + + @ApiOperation(value = "根据中标通知信息Id删除信息", httpMethod = "DELETE") + @DeleteMapping("/{outbidInfoId}") + public Result delete(@PathVariable String outbidInfoId){ + outbidInfoService.deleteById(outbidInfoId); + return Result.ok(); + } + + @ApiOperation(value = "下载中标通知信息文件", httpMethod = "POST") + @PostMapping("/download-outbid-info-file/{outbidNoticeFileId}") + public Result downLoadOutbidNoticeFile(@PathVariable String outbidNoticeFileId, HttpServletResponse response) throws Exception { + outbidInfoService.downLoadOutbidNoticeFile(outbidNoticeFileId, response); + return Result.ok(); + } +} diff --git a/web/src/main/java/com/dite/znpt/web/controller/PartController.java b/web/src/main/java/com/dite/znpt/web/controller/PartController.java index 596eee6..89383fd 100644 --- a/web/src/main/java/com/dite/znpt/web/controller/PartController.java +++ b/web/src/main/java/com/dite/znpt/web/controller/PartController.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.web.controller; @@ -92,3 +93,99 @@ public class PartController { } } +======= +package com.dite.znpt.web.controller; + + +import com.dite.znpt.constant.Constants; +import com.dite.znpt.domain.vo.PartListReq; +import com.dite.znpt.domain.vo.PartListResp; +import com.dite.znpt.domain.vo.PartReq; +import com.dite.znpt.domain.vo.PartResp; +import com.dite.znpt.domain.entity.PartEntity; +import com.dite.znpt.service.PartService; +import com.dite.znpt.domain.Result; +import com.dite.znpt.domain.PageResult; +import com.dite.znpt.util.ValidationGroup; +import com.pig4cloud.plugin.excel.annotation.RequestExcel; +import com.pig4cloud.plugin.excel.annotation.ResponseExcel; +import com.pig4cloud.plugin.excel.vo.ErrorMessage; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.validation.BindingResult; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.List; + +/** + * @author huise23 + * @date 2025/04/11 23:17 + */ +@Api(tags = "部件信息") +@RestController +@RequestMapping("/part") +public class PartController { + @Resource + private PartService partService; + + @ApiOperation(value = "分页查询部件信息列表", httpMethod = "GET") + @GetMapping("/page") + public PageResult page(PartListReq partReq) { + return PageResult.ok(partService.page(partReq)); + } + + @ApiOperation(value = "查询部件信息列表", httpMethod = "GET") + @GetMapping("/list") + public Result> list(PartListReq partReq) { + return Result.ok(partService.list(partReq)); + } + + @ApiOperation(value = "查询部件信息详情", httpMethod = "GET") + @GetMapping("/detail/{partId}") + public Result detail(@PathVariable String partId) { + return Result.ok(partService.detail(partId)); + } + + @ApiOperation(value = "新增部件信息", httpMethod = "POST") + @PostMapping + public Result add(@Validated(ValidationGroup.Insert.class) @RequestBody PartReq req) { + partService.save(req); + return Result.ok(); + } + + @ApiOperation(value = "修改部件信息", httpMethod = "PUT") + @PutMapping("/{partId}") + public Result edit(@Validated(ValidationGroup.Update.class) @PathVariable String partId, @RequestBody PartReq req) { + partService.update(partId, req); + return Result.ok(); + } + + @ApiOperation(value = "删除部件信息", httpMethod = "DELETE") + @DeleteMapping("/{partId}") + public Result remove(@PathVariable String partId) { + partService.deleteById(partId); + return Result.ok(); + } + + @ApiOperation(value = "导出部件-需求待明确", httpMethod = "GET") + @GetMapping("/export") + @ResponseExcel(name = "部件") + public List export(PartListReq partReq) { + return partService.list(partReq); + } + + @ApiOperation(value = "导入部件-需求待明确", httpMethod = "POST") + @PostMapping("/import") + public Result importData(@RequestExcel List dataList, BindingResult bindingResult) { + // JSR 303 校验通用校验获取失败的数据 + List errorMessageList = (List) bindingResult.getTarget(); + if (errorMessageList != null && !errorMessageList.isEmpty()) { + return Result.error(Constants.SERVICE_EXCEPTION, "导入失败"); + } + return Result.okM("导入"+dataList.size()+"条数据"); + } +} + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/web/src/main/java/com/dite/znpt/web/controller/PostController.java b/web/src/main/java/com/dite/znpt/web/controller/PostController.java index bb88e04..c755022 100644 --- a/web/src/main/java/com/dite/znpt/web/controller/PostController.java +++ b/web/src/main/java/com/dite/znpt/web/controller/PostController.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.web.controller; import com.dite.znpt.domain.PageResult; @@ -66,3 +67,73 @@ public class PostController { } } +======= +package com.dite.znpt.web.controller; + +import com.dite.znpt.domain.PageResult; +import com.dite.znpt.domain.Result; +import com.dite.znpt.domain.vo.PostReq; +import com.dite.znpt.domain.vo.PostResp; +import com.dite.znpt.service.PostService; +import com.dite.znpt.util.ValidationGroup; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.List; + +/** + * @author Bear.G + * @date 2025/5/20/周二 10:05 + * @description + */ +@Api(tags = "岗位信息") +@RestController +@RequestMapping("/post") +public class PostController { + @Resource + private PostService postService; + + @ApiOperation(value = "分页查询岗位信息列表", httpMethod = "GET") + @GetMapping("/page") + public PageResult page(@RequestParam(value = "postName", required = false) String postName){ + return PageResult.ok(postService.page(postName)); + } + + @ApiOperation(value = "查询岗位信息列表", httpMethod = "GET") + @GetMapping("/list") + public Result> list(@RequestParam(value = "postName", required = false) String postName){ + return Result.ok(postService.list(postName)); + } + + @ApiOperation(value = "查询岗位信息详情", httpMethod = "GET") + @GetMapping("/detail/{postId}") + public Result detail(@PathVariable String postId){ + return Result.ok(postService.detail(postId)); + } + + @ApiOperation(value = "新增岗位信息", httpMethod = "POST") + @PostMapping + public Result add(@Validated(ValidationGroup.Insert.class) @RequestBody PostReq req){ + postService.save(req); + return Result.ok(); + } + + @ApiOperation(value = "修改岗位信息", httpMethod = "PUT") + @PutMapping("/{postId}") + public Result edit(@PathVariable String postId, @Validated(ValidationGroup.Update.class) @RequestBody PostReq req){ + postService.update(postId, req); + return Result.ok(); + } + + @ApiOperation(value = "删除岗位信息", httpMethod = "DELETE") + @DeleteMapping("/{postId}") + public Result remove(@PathVariable String postId){ + postService.deleteById(postId); + return Result.ok(); + } + +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/web/src/main/java/com/dite/znpt/web/controller/ProjectBudgetInfoController.java b/web/src/main/java/com/dite/znpt/web/controller/ProjectBudgetInfoController.java index 4a21a96..919b7b4 100644 --- a/web/src/main/java/com/dite/znpt/web/controller/ProjectBudgetInfoController.java +++ b/web/src/main/java/com/dite/znpt/web/controller/ProjectBudgetInfoController.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.web.controller; @@ -46,3 +47,53 @@ public class ProjectBudgetInfoController { } } +======= +package com.dite.znpt.web.controller; + + +import com.dite.znpt.domain.PageResult; +import com.dite.znpt.domain.Result; +import com.dite.znpt.domain.vo.ProjectBudgetInfoListReq; +import com.dite.znpt.domain.vo.ProjectBudgetInfoListResp; +import com.dite.znpt.domain.vo.ProjectBudgetInfoReq; +import com.dite.znpt.domain.vo.ProjectBudgetInfoResp; +import com.dite.znpt.service.ProjectBudgetInfoService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.List; + +/** + * @author huise23 + * @date 2025/07/17 21:55 + */ +@Api(tags = "项目预算信息") +@RestController +@RequestMapping("/project-budget-info") +public class ProjectBudgetInfoController { + @Resource + private ProjectBudgetInfoService projectBudgetInfoService; + + @ApiOperation(value = "获取项目预算信息列表", httpMethod = "GET") + @GetMapping("/list") + public PageResult list(ProjectBudgetInfoListReq projectBudgetInfoReq) { + return PageResult.ok(projectBudgetInfoService.selectList(projectBudgetInfoReq)); + } + + @ApiOperation(value = "根据项目id获取项目预算信息列表", httpMethod = "GET") + @GetMapping("/detail/{projectId}") + public PageResult detailByProjectId(@PathVariable String projectId) { + return PageResult.ok(projectBudgetInfoService.detailByProjectId(projectId)); + } + + @ApiOperation(value = "保存项目预算信息", httpMethod = "POST") + @PostMapping + public Result add(@RequestBody List projectBudgetInfoReq) { + projectBudgetInfoService.saveData(projectBudgetInfoReq); + return Result.ok(); + } +} + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/web/src/main/java/com/dite/znpt/web/controller/ProjectDailyReportController.java b/web/src/main/java/com/dite/znpt/web/controller/ProjectDailyReportController.java new file mode 100644 index 0000000..b49bf8f --- /dev/null +++ b/web/src/main/java/com/dite/znpt/web/controller/ProjectDailyReportController.java @@ -0,0 +1,66 @@ +package com.dite.znpt.web.controller; + +import com.dite.znpt.domain.PageResult; +import com.dite.znpt.domain.Result; +import com.dite.znpt.domain.vo.ProjectDailyReportListReq; +import com.dite.znpt.domain.vo.ProjectDailyReportReq; +import com.dite.znpt.domain.vo.ProjectDailyReportResp; +import com.dite.znpt.service.ProjectDailyReportService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; + +/** + * @author huise23 + * @date 2025/07/27 19:51 + */ +@Api(tags = "项目日报信息") +@RestController +@RequestMapping("/project-daily-report") +public class ProjectDailyReportController { + @Resource + private ProjectDailyReportService projectDailyReportService; + + @ApiOperation(value = "获取项目日报信息列表", httpMethod = "GET") + @GetMapping("/list") + public PageResult list(ProjectDailyReportListReq projectDailyReportReq) { + return PageResult.ok(projectDailyReportService.selectList(projectDailyReportReq)); + } + + @ApiOperation(value = "根据项目日报信息Id获取详细信息", httpMethod = "GET") + @GetMapping("/{reportId}") + public Result getInfo(@PathVariable String reportId) { + return Result.ok(projectDailyReportService.selectById(reportId)); + } + + @ApiOperation(value = "获取登录人当日日报", httpMethod = "GET") + @GetMapping("/my-today/{projectId}") + public Result myToday(@PathVariable String projectId) { + return Result.ok(projectDailyReportService.myToday(projectId)); + } + + @ApiOperation(value = "新增项目日报信息", httpMethod = "POST") + @PostMapping + public Result add(@Validated @RequestBody ProjectDailyReportReq projectDailyReportReq) { + projectDailyReportService.saveData(projectDailyReportReq); + return Result.ok(); + } + + @ApiOperation(value = "修改项目日报信息", httpMethod = "PUT") + @PutMapping + public Result edit(@Validated @RequestBody ProjectDailyReportReq projectDailyReportReq) { + projectDailyReportService.updateData(projectDailyReportReq); + return Result.ok(); + } + + @ApiOperation(value = "删除项目日报信息", httpMethod = "DELETE") + @DeleteMapping("/{reportId}") + public Result remove(@PathVariable String reportId) { + projectDailyReportService.deleteById(reportId); + return Result.ok(); + } +} + diff --git a/web/src/main/java/com/dite/znpt/web/controller/ProjectTaskController.java b/web/src/main/java/com/dite/znpt/web/controller/ProjectTaskController.java index 0d6db55..2561742 100644 --- a/web/src/main/java/com/dite/znpt/web/controller/ProjectTaskController.java +++ b/web/src/main/java/com/dite/znpt/web/controller/ProjectTaskController.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.web.controller; @@ -109,3 +110,114 @@ public class ProjectTaskController { } } +======= +package com.dite.znpt.web.controller; + + +import cn.dev33.satoken.stp.StpUtil; +import com.dite.znpt.constant.Constants; +import com.dite.znpt.domain.PageResult; +import com.dite.znpt.domain.Result; +import com.dite.znpt.domain.vo.*; +import com.dite.znpt.service.ProjectTaskService; +import com.dite.znpt.util.PageUtil; +import com.dite.znpt.util.ValidationGroup; +import com.pig4cloud.plugin.excel.annotation.RequestExcel; +import com.pig4cloud.plugin.excel.annotation.ResponseExcel; +import com.pig4cloud.plugin.excel.vo.ErrorMessage; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.validation.BindingResult; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.List; + +/** + * @author huise23 + * @date 2025/06/25 17:18 + */ +@Api(tags = "项目任务信息") +@RestController +@RequestMapping("/project-task") +public class ProjectTaskController { + @Resource + private ProjectTaskService projectTaskService; + + @ApiOperation(value = "获取项目任务信息列表", httpMethod = "GET") + @GetMapping("/list") + public PageResult list(ProjectTaskListReq projectTaskReq) { + PageUtil.startPage(); + return PageResult.ok(projectTaskService.selectList(projectTaskReq)); + } + + @ApiOperation(value = "根据项目任务信息Id获取详细信息", httpMethod = "GET") + @GetMapping("/{taskId}") + public Result getInfo(@PathVariable String taskId) { + return Result.ok(projectTaskService.selectById(taskId)); + } + + @ApiOperation(value = "新增项目任务信息", httpMethod = "POST") + @PostMapping + public Result add(@Validated(ValidationGroup.Insert.class) @RequestBody ProjectTaskReq projectTaskReq) { + projectTaskService.saveData(projectTaskReq); + return Result.ok(); + } + + @ApiOperation(value = "修改项目任务信息", httpMethod = "PUT") + @PutMapping + public Result edit(@Validated(ValidationGroup.Update.class) @RequestBody ProjectTaskReq projectTaskReq) { + projectTaskService.updateData(projectTaskReq); + return Result.ok(); + } + + @ApiOperation(value = "删除项目任务信息", httpMethod = "DELETE") + @DeleteMapping("/{taskId}") + public Result remove(@PathVariable String taskId) { + projectTaskService.deleteById(taskId); + return Result.ok(); + } + + @ApiOperation(value = "导出项目任务信息", httpMethod = "GET") + @GetMapping("/export") + @ResponseExcel(name = "项目任务信息") + public List export(ProjectTaskListReq projectTaskReq) { + projectTaskReq.setIsExport(true); + return projectTaskService.selectList(projectTaskReq); + } + + @ApiOperation(value = "导入项目任务信息", httpMethod = "POST") + @PostMapping("/import") + public Result importData(@RequestExcel List dataList, BindingResult bindingResult) { + // JSR 303 校验通用校验获取失败的数据 + List errorMessageList = (List) bindingResult.getTarget(); + if (errorMessageList != null && !errorMessageList.isEmpty()) { + return Result.error(Constants.SERVICE_EXCEPTION, "导入失败", errorMessageList); + } + return Result.okM("导入"+dataList.size()+"条数据"); + } + + @ApiOperation(value = "开始任务/任务组开始任务", httpMethod = "PUT") + @PutMapping("/startTask") + public Result startTask(@RequestBody ProjectTaskStartReq taskStartReq) { + projectTaskService.startTask(taskStartReq); + return Result.ok(); + } + + @ApiOperation(value = "结束任务/任务组结束任务", httpMethod = "PUT") + @PutMapping("/endTask") + public Result endTask(@RequestBody ProjectTaskStartReq taskStartReq) { + projectTaskService.endTask(taskStartReq); + return Result.ok(); + } + + @ApiOperation(value = "查询我的任务", httpMethod = "GET") + @GetMapping("/my") + public Result> my(ProjectTaskListReq req) { + req.setUserId(StpUtil.getLoginIdAsString()); + return Result.ok(projectTaskService.selectList(req)); + } +} + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/web/src/main/java/com/dite/znpt/web/controller/ProjectTaskGroupController.java b/web/src/main/java/com/dite/znpt/web/controller/ProjectTaskGroupController.java index 645dd97..d5ed33c 100644 --- a/web/src/main/java/com/dite/znpt/web/controller/ProjectTaskGroupController.java +++ b/web/src/main/java/com/dite/znpt/web/controller/ProjectTaskGroupController.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.web.controller; @@ -61,3 +62,68 @@ public class ProjectTaskGroupController { } } +======= +package com.dite.znpt.web.controller; + + +import com.dite.znpt.constant.Constants; +import com.dite.znpt.domain.PageResult; +import com.dite.znpt.domain.Result; +import com.dite.znpt.domain.entity.ProjectTaskGroupEntity; +import com.dite.znpt.domain.vo.ProjectTaskGroupListReq; +import com.dite.znpt.domain.vo.ProjectTaskGroupReq; +import com.dite.znpt.domain.vo.ProjectTaskGroupResp; +import com.dite.znpt.service.ProjectTaskGroupService; +import com.dite.znpt.util.ValidationGroup; +import com.pig4cloud.plugin.excel.annotation.RequestExcel; +import com.pig4cloud.plugin.excel.annotation.ResponseExcel; +import com.pig4cloud.plugin.excel.vo.ErrorMessage; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.validation.BindingResult; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.List; + +/** + * @author huise23 + * @date 2025/06/25 17:18 + */ +@Api(tags = "项目任务组信息") +@RestController +@RequestMapping("/project-task-group") +public class ProjectTaskGroupController { + @Resource + private ProjectTaskGroupService projectTaskGroupService; + + @ApiOperation(value = "获取项目任务组信息列表", httpMethod = "GET") + @GetMapping("/list") + public PageResult list(ProjectTaskGroupListReq projectTaskGroupReq) { + return PageResult.ok(projectTaskGroupService.selectList(projectTaskGroupReq)); + } + + @ApiOperation(value = "新增项目任务组信息", httpMethod = "POST") + @PostMapping + public Result add(@Validated(ValidationGroup.Insert.class) @RequestBody ProjectTaskGroupReq projectTaskGroupReq) { + projectTaskGroupService.saveData(projectTaskGroupReq); + return Result.ok(); + } + + @ApiOperation(value = "修改项目任务组信息", httpMethod = "PUT") + @PutMapping + public Result edit(@Validated(ValidationGroup.Update.class) @RequestBody ProjectTaskGroupReq projectTaskGroupReq) { + projectTaskGroupService.updateData(projectTaskGroupReq); + return Result.ok(); + } + + @ApiOperation(value = "删除项目任务组信息", httpMethod = "DELETE") + @DeleteMapping("/{groupId}") + public Result remove(@PathVariable String groupId) { + projectTaskGroupService.deleteById(groupId); + return Result.ok(); + } +} + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/web/src/main/java/com/dite/znpt/web/controller/RegulationTypeController.java b/web/src/main/java/com/dite/znpt/web/controller/RegulationTypeController.java new file mode 100644 index 0000000..585aaae --- /dev/null +++ b/web/src/main/java/com/dite/znpt/web/controller/RegulationTypeController.java @@ -0,0 +1,71 @@ +package com.dite.znpt.web.controller; + +import com.dite.znpt.domain.PageResult; +import com.dite.znpt.domain.Result; +import com.dite.znpt.domain.vo.RegulationTypeReq; +import com.dite.znpt.domain.vo.RegulationTypeResp; +import com.dite.znpt.service.RegulationTypeService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.validation.Valid; +import java.util.List; + +/** + * @author Bear.G + * @date 2025/6/26/周四 9:10 + * @description 制度类型Controller + */ +@Api(tags = "制度类型") +@RestController +@RequestMapping("/regulation-type") +public class RegulationTypeController { + + @Resource + private RegulationTypeService regulationTypeService; + + @ApiOperation(value = "分页查询制度类型列表", httpMethod = "GET") + @GetMapping("/page") + public PageResult page(@RequestParam(required = false) String regulationTypeName, + @RequestParam(required = false) Integer status, + @RequestParam(required = false) String remark) { + return PageResult.ok(regulationTypeService.page(regulationTypeName, status, remark)); + } + + @ApiOperation(value = "查询制度类型列表", httpMethod = "GET") + @GetMapping("/list") + public Result> list(@RequestParam(required = false) String regulationTypeName, + @RequestParam(required = false) Integer status, + @RequestParam(required = false) String remark) { + return Result.ok(regulationTypeService.list(regulationTypeName, status, remark)); + } + + @ApiOperation(value = "查询制度类型详情", httpMethod = "GET") + @GetMapping("/detail/{regulationTypeId}") + public Result detail(@PathVariable String regulationTypeId) { + return Result.ok(regulationTypeService.detail(regulationTypeId)); + } + + @ApiOperation(value = "新增制度类型", httpMethod = "POST") + @PostMapping + public Result add(@Valid @RequestBody RegulationTypeReq req) { + regulationTypeService.save(req); + return Result.ok(); + } + + @ApiOperation(value = "修改制度类型", httpMethod = "PUT") + @PutMapping("/{regulationTypeId}") + public Result edit(@PathVariable String regulationTypeId, @Valid @RequestBody RegulationTypeReq req) { + regulationTypeService.update(regulationTypeId, req); + return Result.ok(); + } + + @ApiOperation(value = "删除制度类型", httpMethod = "DELETE") + @DeleteMapping("/{regulationTypeId}") + public Result remove(@PathVariable String regulationTypeId) { + regulationTypeService.deleteById(regulationTypeId); + return Result.ok(); + } +} \ No newline at end of file diff --git a/web/src/main/java/com/dite/znpt/web/controller/RoleController.java b/web/src/main/java/com/dite/znpt/web/controller/RoleController.java index 7c6d42b..3ddf6fb 100644 --- a/web/src/main/java/com/dite/znpt/web/controller/RoleController.java +++ b/web/src/main/java/com/dite/znpt/web/controller/RoleController.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.web.controller; import com.dite.znpt.domain.PageResult; @@ -80,3 +81,87 @@ public class RoleController { return Result.ok(); } } +======= +package com.dite.znpt.web.controller; + +import com.dite.znpt.domain.PageResult; +import com.dite.znpt.domain.Result; +import com.dite.znpt.domain.vo.RoleMenuReq; +import com.dite.znpt.domain.vo.RoleReq; +import com.dite.znpt.domain.vo.RoleResp; +import com.dite.znpt.service.RoleMenuService; +import com.dite.znpt.service.RoleService; +import com.dite.znpt.service.UserRoleService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +/** + * @author Bear.G + * @date 2025/5/21/周三 15:00 + * @description + */ +@Api(tags = "角色信息") +@RestController +@RequestMapping("/role") +public class RoleController { + + @Resource + private RoleService roleService; + + @Resource + private RoleMenuService roleMenuService; + + @ApiOperation(value = "分页查询角色信息列表", httpMethod = "GET") + @GetMapping("/page") + public PageResult page(@RequestParam(value = "roleName", required = false) String roleName){ + return PageResult.ok(roleService.page(roleName)); + } + + @ApiOperation(value = "查询角色信息列表", httpMethod = "GET") + @GetMapping("/list") + public Result> list(@RequestParam(value = "roleName", required = false) String roleName){ + return Result.ok(roleService.list(roleName)); + } + + @ApiOperation(value = "查询角色信息详情", httpMethod = "GET") + @GetMapping("/detail/{roleId}") + public Result detail(@PathVariable String roleId){ + return Result.ok(roleService.detail(roleId)); + } + + @ApiOperation(value = "新增角色信息", httpMethod = "POST") + @PostMapping + public Result add(@RequestBody RoleReq req){ + roleService.save(req); + return Result.ok(); + } + + @ApiOperation(value = "修改角色信息", httpMethod = "PUT") + @PutMapping("/{roleId}") + public Result edit(@PathVariable String roleId, @RequestBody RoleReq req){ + roleService.update(roleId, req); + return Result.ok(); + } + + @ApiOperation(value = "删除角色信息", httpMethod = "DELETE") + @DeleteMapping("/{roleId}") + public Result delete(@PathVariable String roleId){ + roleService.deleteById(roleId); + return Result.ok(); + } + + @ApiOperation(value = "绑定菜单", httpMethod = "PUT") + @PutMapping("/bind-menu") + public Result bindMenu(@Validated @RequestBody RoleMenuReq req){ + roleMenuService.bindRoleMenu(req); + return Result.ok(); + } +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/web/src/main/java/com/dite/znpt/web/controller/TenderInfoController.java b/web/src/main/java/com/dite/znpt/web/controller/TenderInfoController.java new file mode 100644 index 0000000..3dd5d58 --- /dev/null +++ b/web/src/main/java/com/dite/znpt/web/controller/TenderInfoController.java @@ -0,0 +1,69 @@ +package com.dite.znpt.web.controller; + +import com.dite.znpt.domain.PageResult; +import com.dite.znpt.domain.Result; +import com.dite.znpt.domain.vo.BiddingInfoResp; +import com.dite.znpt.domain.vo.TenderInfoReq; +import com.dite.znpt.domain.vo.TenderInfoResp; +import com.dite.znpt.service.TenderInfoService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.List; + +/** + * @author Bear.G + * @date 2025/7/28/周一 16:10 + * @description + */ +@Api(tags = "投标信息") +@RestController +@RequestMapping("/tender-info") +public class TenderInfoController { + + @Resource + private TenderInfoService tenderInfoService; + + @ApiOperation(value = "分页查询投标信息列表", httpMethod = "GET") + @GetMapping("/page") + public PageResult page(String projectName){ + return PageResult.ok(tenderInfoService.page(projectName)); + } + + @ApiOperation(value = "查询投标信息列表", httpMethod = "GET") + @GetMapping("/list") + public Result> list(String projectName){ + return Result.ok(tenderInfoService.list(projectName)); + } + + @ApiOperation(value = "根据投标信息Id获取详细信息", httpMethod = "GET") + @GetMapping("/detail/{tenderInfoId}") + public Result detail(@PathVariable String tenderInfoId){ + return Result.ok(tenderInfoService.detail(tenderInfoId)); + } + + @ApiOperation(value = "新增投标信息", httpMethod = "POST") + @PostMapping + public Result add(@Validated @RequestBody TenderInfoReq req) { + tenderInfoService.save(req); + return Result.ok(); + } + + @ApiOperation(value = "修改投标信息", httpMethod = "PUT", notes = "上传附件调用新增附件信息接口:/attach-info/tenderInfo,userDefinedPath = {tenderInfoId}") + @PutMapping("/{tenderInfoId}") + public Result edit(@PathVariable String tenderInfoId, @Validated @RequestBody TenderInfoReq req) { + tenderInfoService.update(tenderInfoId, req); + return Result.ok(); + } + + @ApiOperation(value = "删除投标信息", httpMethod = "DELETE", notes = "上传附件调用新增附件信息接口:/attach-info/tenderInfo,userDefinedPath = {tenderInfoId}") + @DeleteMapping("/{tenderInfoId}") + public Result delete(@PathVariable String tenderInfoId) { + tenderInfoService.deleteById(tenderInfoId); + return Result.ok(); + } + +} diff --git a/web/src/main/java/com/dite/znpt/web/controller/VideoController.java b/web/src/main/java/com/dite/znpt/web/controller/VideoController.java new file mode 100644 index 0000000..2eef147 --- /dev/null +++ b/web/src/main/java/com/dite/znpt/web/controller/VideoController.java @@ -0,0 +1,188 @@ +package com.dite.znpt.web.controller; + +import cn.hutool.core.bean.BeanUtil; +import com.dite.znpt.domain.PageResult; +import com.dite.znpt.domain.Result; +import com.dite.znpt.monitor.constant.IotRespMessage; +import com.dite.znpt.monitor.constant.dict.DeviceStatus; +import com.dite.znpt.monitor.constant.dict.SipTransferMode; +import com.dite.znpt.monitor.constant.dict.StreamTransferMode; +import com.dite.znpt.monitor.domain.entity.DeviceVideoEntity; +import com.dite.znpt.monitor.domain.req.MonitorConfigAddReq; +import com.dite.znpt.monitor.domain.resp.DeviceVideoResp; +import com.dite.znpt.monitor.domain.vo.video.DeviceVideoChannelEditReq; +import com.dite.znpt.monitor.domain.vo.video.DeviceVideoChannelListResp; +import com.dite.znpt.monitor.domain.vo.video.DeviceVideoEditReq; +import com.dite.znpt.monitor.domain.vo.video.DeviceVideoListResp; +import com.dite.znpt.monitor.media.zlm.config.StreamMediaServerConfig; +import com.dite.znpt.monitor.service.DeviceVideoChannelService; +import com.dite.znpt.monitor.service.DeviceVideoService; +import com.dite.znpt.monitor.service.IpConfigService; +import com.dite.znpt.monitor.sip.config.SipConfig; +import com.dite.znpt.monitor.sip.transmit.cmd.ISipDeviceCommander; +import com.dite.znpt.monitor.utils.DictUtils; +import com.dite.znpt.util.PageUtil; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.Arrays; +import java.util.List; + +/** + * @Author: huise23 + * @Date: 2022/8/8 10:39 + * @Description: + */ +@Api(tags = "视频管理") +@RestController +@RequestMapping("/monitoring/video") +public class VideoController { + + @Resource + private SipConfig sipConfig; + + @Resource + private StreamMediaServerConfig streamMediaServerConfigService; + + @Resource + private DeviceVideoService deviceVideoService; + + @Resource + private IpConfigService ipConfigService; + + @Resource + private DeviceVideoChannelService deviceVideoChannelService; + + @Resource + private ISipDeviceCommander sipDeviceCommander; + + @ApiOperation(value = "获取信令服务器配置信息", notes = "iot:video:sip:view", httpMethod = "GET") + @GetMapping("/sipServerConfig") + public Result getSipServerConfig(){ + return Result.ok(BeanUtil.copyProperties(sipConfig, SipConfig.class)); + } + + @ApiOperation(value = "获取流媒体服务配置信息", notes = "iot:video:media:view", httpMethod = "GET") + @GetMapping("/streamMediaServerConfig") + public Result getStreamMediaServerConfig(){ + return Result.ok(BeanUtil.copyProperties(streamMediaServerConfigService, StreamMediaServerConfig.class)); + } + + @ApiOperation(value = "查询监控IP配置列表", notes = "iot:config:list", httpMethod = "GET") + @GetMapping("/config/list") + public Result> configList(){ + PageUtil.startPage(); + return Result.ok(ipConfigService.configList()); + } + + @ApiOperation(value = "配置监控IP列表,每次全量传ip列表", notes = "iot:config:add", httpMethod = "POST") + @PostMapping("/config/add") + public Result configAdd(@RequestBody MonitorConfigAddReq req){ + ipConfigService.configAdd(req); + return Result.ok(); + } + + @ApiOperation(value = "分页查询视频设备列表", notes = "iot:video:list", httpMethod = "GET") + @GetMapping("/device/page") + public PageResult pageDevice( + @RequestParam(value = "status", required = false) String status, + @RequestParam(value = "keyword", required = false) String keyword, + @RequestParam(value = "hostAddress", required = false) String hostAddress){ + PageUtil.startPage(); + return deviceVideoService.selectDeviceVideoList(status, keyword,hostAddress); + } + + @ApiOperation(value = "查看视频设备数量", notes = "iot:video:list", httpMethod = "GET") + @GetMapping("/device/count") + public Result countDevice(){ + return Result.ok(deviceVideoService.countDeviceVideoNum()); + } + + @ApiOperation(value = "查看视频设备详情", notes = "iot:video:view", httpMethod = "GET") + @GetMapping("/device/{videoId}") + public Result viewDevice(@PathVariable("videoId") Long videoId){ + final DeviceVideoEntity entity = deviceVideoService.getById(videoId); + final DeviceVideoResp resp = BeanUtil.copyProperties(entity, DeviceVideoResp.class); + resp.setStatusLabel(DictUtils.getDictLabel(DeviceStatus.class, resp.getStatus())); + resp.setStreamModeLabel(DictUtils.getDictLabel(StreamTransferMode.class, resp.getStreamMode())); + resp.setTransportLabel(DictUtils.getDictLabel(SipTransferMode.class, resp.getTransport())); + return Result.ok(resp); + } + + @ApiOperation(value = "编辑视频设备", notes = "iot:video:edit", httpMethod = "PUT") + @PutMapping("/device/{videoId}") + public Result editDevice(@PathVariable("videoId") Long videoId, @RequestBody DeviceVideoEditReq req){ + deviceVideoService.editDeviceVideo(videoId, req); + return Result.ok(); + } + + @ApiOperation(value = "更新视频设备", notes = "iot:video:sync", httpMethod = "PUT") + @PutMapping("/device/sync/{videoId}") + public Result syncDevice(@PathVariable("videoId") Long videoId){ + DeviceVideoEntity entity = deviceVideoService.getById(videoId); + if(DeviceStatus.ONLINE.getValue().equals(entity.getStatus())){ + sipDeviceCommander.queryCatalog(entity); + return Result.ok(); + }else { + return Result.error(IotRespMessage.DEVICE_VIDEO_CANNOT_SYNC); + } + } + + @ApiOperation(value = "删除视频设备", notes = "iot:video:delete", httpMethod = "DELETE") + @DeleteMapping("/device/{videoId}") + public Result deleteDevice(@PathVariable("videoId") Long videoId){ + return deviceVideoService.removeByVideoId(videoId); + } + + @ApiOperation(value = "分页查询视频通道列表", notes = "iot:video:channel:list", httpMethod = "GET") + @GetMapping("/channel/page/{videoId}") + public PageResult pageChannel(@PathVariable("videoId") Long videoId, @RequestParam(value = "keyword", required = false) String keyword){ + return deviceVideoChannelService.selectDeviceVideoChannel(videoId, keyword); + } + + @ApiOperation(value = "分页查询所有视频通道列表", notes = "iot:video:channel:list", httpMethod = "GET") + @GetMapping("/channel/page") + public PageResult pageAllChannel(@RequestParam(value = "keyword", required = false) String keyword){ + return deviceVideoChannelService.selectAllDeviceVideoChannel(keyword); + } + + @ApiOperation(value = "查看视频通道", notes = "iot:video:channel:view", httpMethod = "GET") + @GetMapping("/channel/{channelCode}") + public Result viewChannel(@PathVariable("channelCode") String channelCode){ + return Result.ok(deviceVideoChannelService.getDeviceVideoChannelDetail(channelCode)); + } + + @ApiOperation(value = "编辑视频通道", notes = "iot:video:channel:edit", httpMethod = "PUT") + @PutMapping("/channel/{channelId}") + public Result editChannel(@PathVariable("channelId") Long channelId, @RequestBody DeviceVideoChannelEditReq req){ + deviceVideoChannelService.editDeviceVideoChannel(channelId, req); + return Result.ok(); + } + + @ApiOperation(value = "删除视频通道", notes = "iot:video:channel:delete", httpMethod = "DELETE") + @DeleteMapping("/channel/{channelId}") + public Result deleteChannel(@PathVariable("channelId") Long channelId){ + return deviceVideoChannelService.removeByChannelIds(Arrays.asList(channelId)); + } + + @ApiOperation(value = "播放直播视频", notes = "iot:video:play", httpMethod = "GET") + @GetMapping("/play/live/{channelCode}") + public Result play(@PathVariable("channelCode") String channelCode){ + return Result.ok(deviceVideoChannelService.play(channelCode)); + } + + @ApiOperation(value = "查询视频设备是否在线", notes = "iot:video:isOnline", httpMethod = "GET") + @GetMapping("/channel/isOnline/{channelCode}") + public Result isOnline(@PathVariable("channelCode") String channelCode){ + return Result.ok(deviceVideoChannelService.isOnline(channelCode)); + } + + @ApiOperation(value = "停止播放直播", notes = "iot:video:stop", httpMethod = "GET") + @GetMapping("/stop/live/{channelCode}") + public Result stop(@PathVariable("channelCode") String channelCode){ + deviceVideoChannelService.stop(channelCode); + return Result.ok(); + } +} diff --git a/web/src/main/java/com/dite/znpt/web/controller/VideoFileInfoController.java b/web/src/main/java/com/dite/znpt/web/controller/VideoFileInfoController.java index 6826618..0f56c46 100644 --- a/web/src/main/java/com/dite/znpt/web/controller/VideoFileInfoController.java +++ b/web/src/main/java/com/dite/znpt/web/controller/VideoFileInfoController.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.web.controller; @@ -61,3 +62,68 @@ public class VideoFileInfoController { } } +======= +package com.dite.znpt.web.controller; + + +import com.dite.znpt.domain.PageResult; +import com.dite.znpt.domain.Result; +import com.dite.znpt.domain.entity.VideoFileInfoEntity; +import com.dite.znpt.domain.vo.VideoFileInfoListReq; +import com.dite.znpt.domain.vo.VideoFileInfoReq; +import com.dite.znpt.domain.vo.VideoFileInfoResp; +import com.dite.znpt.service.VideoFileInfoService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import javax.annotation.Resource; +import java.io.IOException; + +/** + * @author huise23 + * @date 2025/06/09 09:42 + */ +@Api(tags = "视频文件信息") +@RestController +@RequestMapping("/video-file-info") +public class VideoFileInfoController { + @Resource + private VideoFileInfoService videoFileInfoService; + + @ApiOperation(value = "获取视频文件信息列表", httpMethod = "GET") + @GetMapping("/list") + public PageResult list(VideoFileInfoListReq videoFileInfoReq) { + return PageResult.ok(videoFileInfoService.selectList(videoFileInfoReq)); + } + + @ApiOperation(value = "根据视频文件信息Id获取详细信息", httpMethod = "GET") + @GetMapping("/{id}") + public Result getInfo(@PathVariable String id) { + return Result.ok(videoFileInfoService.selectById(id)); + } + + @ApiOperation(value = "批量上传视频文件", httpMethod = "POST") + @PostMapping("/batch-upload") + public Result batchUploadImage(VideoFileInfoReq infoReq, + @RequestParam("file") MultipartFile[] files) throws IOException { + return Result.ok(videoFileInfoService.batchUpload(infoReq, files)); + } + + @ApiOperation(value = "修改视频文件信息", httpMethod = "PUT") + @PutMapping + public Result edit(@RequestBody VideoFileInfoEntity videoFileInfo) { + videoFileInfoService.updateData(videoFileInfo); + return Result.ok(); + } + + @ApiOperation(value = "删除视频文件信息", httpMethod = "DELETE") + @DeleteMapping("/{id}") + public Result remove(@PathVariable String id) { + videoFileInfoService.deleteById(id); + return Result.ok(); + } +} + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/web/src/main/java/com/dite/znpt/web/controller/WorkShiftController.java b/web/src/main/java/com/dite/znpt/web/controller/WorkShiftController.java index 78708b3..0c73f06 100644 --- a/web/src/main/java/com/dite/znpt/web/controller/WorkShiftController.java +++ b/web/src/main/java/com/dite/znpt/web/controller/WorkShiftController.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.web.controller; import com.dite.znpt.domain.PageResult; @@ -75,3 +76,82 @@ public class WorkShiftController { return Result.ok(); } } +======= +package com.dite.znpt.web.controller; + +import com.dite.znpt.domain.PageResult; +import com.dite.znpt.domain.Result; +import com.dite.znpt.domain.vo.WorkShiftListResp; +import com.dite.znpt.domain.vo.WorkShiftReq; +import com.dite.znpt.domain.vo.WorkShiftResp; +import com.dite.znpt.service.WorkShiftService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.validation.Valid; +import java.util.List; + +/** + * @author Bear.G + * @date 2025/6/30/周一 10:29 + * @description + */ +@Api(tags = "班次管理") +@RestController +@RequestMapping("/work-shift") +public class WorkShiftController { + + @Resource + private WorkShiftService workShiftService; + + @ApiOperation(value = "分页查询班次信息", httpMethod = "GET") + @GetMapping("/page") + public PageResult page(@RequestParam(required = false) String workShitName) { + return PageResult.ok(workShiftService.page(workShitName)); + } + + @ApiOperation(value = "查询班次信息列表", httpMethod = "GET") + @GetMapping("/list") + public Result> list(@RequestParam(required = false) String workShiftName) { + return Result.ok(workShiftService.list(workShiftName)); + } + + + @ApiOperation(value = "查询班次详情信息", httpMethod = "GET") + @GetMapping("/detail/{workShiftId}") + public Result detail(@PathVariable String workShiftId) { + return Result.ok(workShiftService.detail(workShiftId)); + } + + @ApiOperation(value = "新增班次信息", httpMethod = "POST") + @PostMapping() + public Result add(@Valid @RequestBody WorkShiftReq req){ + workShiftService.save(req); + return Result.ok(); + } + + @ApiOperation(value = "修改班次信息", httpMethod = "PUT") + @PutMapping("/{workShiftId}") + public Result edit(@PathVariable String workShiftId, @Valid @RequestBody WorkShiftReq req){ + workShiftService.update(workShiftId, req); + return Result.ok(); + } + + + @ApiOperation(value = "发布班次信息", httpMethod = "PUT") + @PutMapping("/publish/{workShiftId}") + public Result publish(@PathVariable String workShiftId){ + workShiftService.publish(workShiftId); + return Result.ok(); + } + + @ApiOperation(value = "删除班次信息", httpMethod = "DELETE") + @DeleteMapping("/{workShiftId}") + public Result remove(@PathVariable String workShiftId){ + workShiftService.delete(workShiftId); + return Result.ok(); + } +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/web/src/main/java/com/dite/znpt/web/controller/WorkbenchController.java b/web/src/main/java/com/dite/znpt/web/controller/WorkbenchController.java index 9d49f92..9d56bf0 100644 --- a/web/src/main/java/com/dite/znpt/web/controller/WorkbenchController.java +++ b/web/src/main/java/com/dite/znpt/web/controller/WorkbenchController.java @@ -1,3 +1,4 @@ +<<<<<<< HEAD package com.dite.znpt.web.controller; import com.dite.znpt.domain.PageResult; @@ -32,3 +33,39 @@ public class WorkbenchController { } } +======= +package com.dite.znpt.web.controller; + +import com.dite.znpt.domain.PageResult; +import com.dite.znpt.domain.Result; +import com.dite.znpt.domain.vo.WeatherTypeListReq; +import com.dite.znpt.domain.vo.WeatherTypeResp; +import com.dite.znpt.domain.vo.WorkbenchInfoResp; +import com.dite.znpt.service.WorkbenchService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.RequiredArgsConstructor; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @author huise23 + * @date 2025/04/11 23:17 + */ +@Api(tags = "工作台") +@RestController +@RequestMapping("/workbench") +@RequiredArgsConstructor +public class WorkbenchController { + + private final WorkbenchService workbenchService; + + @ApiOperation(value = "获取工作台信息", httpMethod = "GET") + @GetMapping("/info") + public Result info() { + return Result.ok(workbenchService.getInfo()); + } + +} +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/web/src/main/resources/application-dev.yml b/web/src/main/resources/application-dev.yml index 37fe098..f9dd493 100644 --- a/web/src/main/resources/application-dev.yml +++ b/web/src/main/resources/application-dev.yml @@ -2,14 +2,21 @@ server: # 服务器的HTTP端口,默认为8080 port: 8888 +<<<<<<< HEAD address: 0.0.0.0 +======= +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f # 数据源配置 spring: datasource: type: com.alibaba.druid.pool.DruidDataSource driverClassName: com.mysql.cj.jdbc.Driver +<<<<<<< HEAD url: jdbc:mysql://39.99.201.243:3306/test01?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 +======= + url: jdbc:mysql://39.99.201.243:3306/znpt_dev?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f username: root password: BUw8YW6%@^8q druid: @@ -110,6 +117,14 @@ sip-config: password: 123456 mediaType: mp4 +<<<<<<< HEAD +======= +# 功能开关配置 +feature: + # 是否启用视频流媒体功能 + enable-video-stream: false + +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f zlm-config: # 流媒体名称 mediaName: 媒体服务 @@ -149,7 +164,10 @@ util: imagePreTreatmentPath: d:\ reportGeneratorPath: D:\blade_report_generator.exe reportGeneratorTemplatePath: D:\muban +<<<<<<< HEAD file: upload: businessDataPath: D:/upload/businessData +======= +>>>>>>> 117e02770e868ab78bdce112c2316a990cf9954f diff --git a/zlm-config.ini b/zlm-config.ini new file mode 100644 index 0000000..98564a6 --- /dev/null +++ b/zlm-config.ini @@ -0,0 +1,47 @@ +[general] +# 服务器名称 +server_name=ZLMediaKit +# 服务器ID +server_id=your_server_id +# 是否启用调试日志 +enable_vhost=1 +# 是否启用调试日志 +enable_debug=1 + +[api] +# API密钥,需要与application-dev.yml中的secretKey一致 +secret=6Q76ivvVOQDsnnfOSKbtVzcYpbgy4n1G +# API端口 +port=8080 +# 是否启用API +enable=1 + +[rtp] +# RTP端口范围 +port_range=30150-30185 +# RTP超时时间 +timeout_sec=30 + +[rtmp] +# RTMP端口 +port=1935 +# 是否启用RTMP +enable=1 + +[rtsp] +# RTSP端口 +port=554 +# 是否启用RTSP +enable=1 + +[http] +# HTTP端口 +port=80 +# 是否启用HTTP +enable=1 + +[hls] +# HLS端口 +port=80 +# 是否启用HLS +enable=1 \ No newline at end of file