ty
7 months ago
70 changed files with 1938 additions and 634 deletions
@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> |
||||
<parent> |
||||
<artifactId>hzims-service-api</artifactId> |
||||
<groupId>com.hnac.hzims</groupId> |
||||
<version>4.0.0-SNAPSHOT</version> |
||||
</parent> |
||||
<modelVersion>4.0.0</modelVersion> |
||||
<name>big-model-api</name> |
||||
<artifactId>big-model-api</artifactId> |
||||
|
||||
<dependencies> |
||||
|
||||
</dependencies> |
||||
|
||||
</project> |
@ -0,0 +1,14 @@
|
||||
package com.hnac.hzims.bigmodel; |
||||
|
||||
/** |
||||
* @Author: huangxing |
||||
* @Date: 2024/04/26 10:15 |
||||
*/ |
||||
public interface BigModelConstants { |
||||
|
||||
/**注册至NACOS服务名**/ |
||||
String APP_NAME = "hzims-big-model"; |
||||
/**前端展示服务名**/ |
||||
String MODULE_NAME = "大模型管理"; |
||||
|
||||
} |
@ -0,0 +1,38 @@
|
||||
package com.hnac.hzims.bigmodel.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import io.swagger.annotations.ApiModel; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Data; |
||||
import org.springblade.core.mp.support.QueryField; |
||||
import org.springblade.core.mp.support.SqlCondition; |
||||
import org.springblade.core.tenant.mp.TenantEntity; |
||||
|
||||
import javax.validation.constraints.Max; |
||||
import javax.validation.constraints.Size; |
||||
|
||||
/** |
||||
* @Author: huangxing |
||||
* @Date: 2024/04/26 10:56 |
||||
*/ |
||||
@TableName("HZIMS_FUNC_PARAM") |
||||
@ApiModel(value = "大模型函数参数entity",description = "大模型函数参数entity") |
||||
@Data |
||||
public class FuncParamEntity extends TenantEntity { |
||||
|
||||
@ApiModelProperty(value = "函数表主键ID") |
||||
@QueryField(condition = SqlCondition.EQUAL) |
||||
@Max(20) |
||||
private Long funcId; |
||||
|
||||
@ApiModelProperty("参数名称") |
||||
@QueryField(condition = SqlCondition.LIKE) |
||||
@Size(min = 1,max = 50) |
||||
private String name; |
||||
|
||||
@ApiModelProperty(value = "参数别名,传参参数") |
||||
@QueryField(condition = SqlCondition.EQUAL) |
||||
@Size(min = 1,max = 25) |
||||
private String alias; |
||||
|
||||
} |
@ -0,0 +1,45 @@
|
||||
package com.hnac.hzims.bigmodel.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import io.swagger.annotations.ApiModel; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Data; |
||||
import org.springblade.core.mp.support.QueryField; |
||||
import org.springblade.core.mp.support.SqlCondition; |
||||
import org.springblade.core.tenant.mp.TenantEntity; |
||||
|
||||
import javax.validation.constraints.Max; |
||||
import javax.validation.constraints.Size; |
||||
|
||||
/** |
||||
* @Author: huangxing |
||||
* @Date: 2024/04/26 10:46 |
||||
*/ |
||||
@Data |
||||
@ApiModel(value = "大模型函数entity",description = "大模型函数entity") |
||||
@TableName("HZIMS_FUNCTION") |
||||
public class FunctionEntity extends TenantEntity { |
||||
|
||||
@ApiModelProperty("函数名称") |
||||
@QueryField(condition = SqlCondition.LIKE) |
||||
private String name; |
||||
|
||||
@ApiModelProperty(value = "函数编号") |
||||
@QueryField(condition = SqlCondition.EQUAL) |
||||
private String code; |
||||
|
||||
@ApiModelProperty("动作类型") |
||||
@QueryField(condition = SqlCondition.EQUAL) |
||||
private String type; |
||||
|
||||
@ApiModelProperty("是否需要确认,0:否,1:是") |
||||
@QueryField(condition = SqlCondition.EQUAL) |
||||
private Boolean isConfirm; |
||||
|
||||
@ApiModelProperty("跳转路径") |
||||
private String path; |
||||
|
||||
@ApiModelProperty("描述") |
||||
private String remake; |
||||
|
||||
} |
@ -0,0 +1,29 @@
|
||||
package com.hnac.hzims.bigmodel.interactive.constants; |
||||
|
||||
import lombok.AllArgsConstructor; |
||||
import lombok.Getter; |
||||
|
||||
import java.util.Arrays; |
||||
import java.util.Optional; |
||||
|
||||
/** |
||||
* @Author: huangxing |
||||
* @Date: 2024/04/26 13:29 |
||||
*/ |
||||
public interface FunctionConstants { |
||||
|
||||
@AllArgsConstructor |
||||
enum TypeEnum { |
||||
/**跳转页面**/ |
||||
JUMP("1") |
||||
; |
||||
@Getter |
||||
private String type; |
||||
|
||||
public static TypeEnum getTypeEnumByType (String type) { |
||||
Optional<TypeEnum> typeEnumOptional = Arrays.stream(TypeEnum.class.getEnumConstants()).filter(e -> type.equals(e.getType())).findFirst(); |
||||
return typeEnumOptional.orElse(null); |
||||
} |
||||
} |
||||
|
||||
} |
@ -0,0 +1,30 @@
|
||||
package com.hnac.hzims.bigmodel.interactive.req; |
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField; |
||||
import io.swagger.annotations.ApiModel; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Data; |
||||
|
||||
import java.io.Serializable; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* @Author: huangxing |
||||
* @Date: 2024/04/26 11:31 |
||||
*/ |
||||
@Data |
||||
@ApiModel("大模型响应内容") |
||||
public class ModelFunctionReq implements Serializable { |
||||
|
||||
@ApiModelProperty("类型") |
||||
private String type; |
||||
|
||||
@JSONField(name = "function_name") |
||||
@ApiModelProperty("函数标识") |
||||
private String functionName; |
||||
|
||||
@JSONField(name = "function_args") |
||||
@ApiModelProperty("函数参数") |
||||
private Map<String,String> functionArgs; |
||||
|
||||
} |
@ -0,0 +1,29 @@
|
||||
package com.hnac.hzims.bigmodel.interactive.vo; |
||||
|
||||
import io.swagger.annotations.ApiModel; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Data; |
||||
|
||||
import java.io.Serializable; |
||||
|
||||
/** |
||||
* @Author: huangxing |
||||
* @Date: 2024/04/26 13:35 |
||||
*/ |
||||
@Data |
||||
@ApiModel("响应内容") |
||||
public class ExtraVO implements Serializable { |
||||
|
||||
@ApiModelProperty("交互类型") |
||||
private String type; |
||||
|
||||
@ApiModelProperty("若为弹窗,则返回路由") |
||||
private String route; |
||||
|
||||
@ApiModelProperty("链接显示文字") |
||||
private String label; |
||||
|
||||
@ApiModelProperty("是否立即跳转") |
||||
private boolean isImmediatelyJump = true; |
||||
|
||||
} |
@ -1,309 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4"> |
||||
<module version="4"> |
||||
<component name="FacetManager"> |
||||
<facet type="web" name="Web"> |
||||
<configuration> |
||||
<webroots /> |
||||
<sourceRoots> |
||||
<root url="file://$MODULE_DIR$/src/main/java" /> |
||||
<root url="file://$MODULE_DIR$/src/main/resources" /> |
||||
<root url="file://$MODULE_DIR$/target/generated-sources/annotations" /> |
||||
</sourceRoots> |
||||
</configuration> |
||||
</facet> |
||||
<facet type="Spring" name="Spring"> |
||||
<configuration /> |
||||
</facet> |
||||
</component> |
||||
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8"> |
||||
<output url="file://$MODULE_DIR$/target/classes" /> |
||||
<output-test url="file://$MODULE_DIR$/target/test-classes" /> |
||||
<content url="file://$MODULE_DIR$"> |
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" /> |
||||
<excludeFolder url="file://$MODULE_DIR$/target" /> |
||||
</content> |
||||
<orderEntry type="inheritedJdk" /> |
||||
<orderEntry type="sourceFolder" forTests="false" /> |
||||
<orderEntry type="library" name="Maven: org.springblade:blade-starter-mybatis:5.1.1.RELEASE.fix.1" level="project" /> |
||||
<orderEntry type="library" name="Maven: com.baomidou:mybatis-plus:3.3.2" level="project" /> |
||||
<orderEntry type="library" name="Maven: com.baomidou:mybatis-plus-extension:3.3.2" level="project" /> |
||||
<orderEntry type="library" name="Maven: com.baomidou:mybatis-plus-core:3.3.2" level="project" /> |
||||
<orderEntry type="library" name="Maven: com.baomidou:mybatis-plus-annotation:3.3.2" level="project" /> |
||||
<orderEntry type="library" name="Maven: com.github.jsqlparser:jsqlparser:3.1" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.mybatis:mybatis-spring:2.0.3" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.mybatis:mybatis:3.5.3" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.mybatis:mybatis-typehandlers-jsr310:1.0.2" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-jdbc:2.1.16.RELEASE" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter:2.1.16.RELEASE" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot:2.1.16.RELEASE" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-logging:2.1.16.RELEASE" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-to-slf4j:2.17.1" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-api:2.17.1" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.slf4j:jul-to-slf4j:1.7.30" level="project" /> |
||||
<orderEntry type="library" name="Maven: javax.annotation:javax.annotation-api:1.3.2" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.yaml:snakeyaml:1.23" level="project" /> |
||||
<orderEntry type="library" name="Maven: com.zaxxer:HikariCP:3.2.0" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.springframework:spring-jdbc:5.1.17.RELEASE" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.springframework:spring-tx:5.1.17.RELEASE" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.springblade:blade-starter-auth:5.1.1.RELEASE.fix.1" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.springblade:blade-core-tool:5.1.1.RELEASE.fix.1" level="project" /> |
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.13.0" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.jsoup:jsoup:1.12.1" level="project" /> |
||||
<orderEntry type="library" name="Maven: io.protostuff:protostuff-core:1.6.0" level="project" /> |
||||
<orderEntry type="library" name="Maven: io.protostuff:protostuff-api:1.6.0" level="project" /> |
||||
<orderEntry type="library" name="Maven: io.protostuff:protostuff-runtime:1.6.0" level="project" /> |
||||
<orderEntry type="library" name="Maven: io.protostuff:protostuff-collectionschema:1.6.0" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.springblade:blade-starter-jwt:5.1.1.RELEASE.fix.1" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-data-redis:2.1.16.RELEASE" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-redis:2.1.19.RELEASE" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-keyvalue:2.1.19.RELEASE" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-commons:2.1.19.RELEASE" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.springframework:spring-oxm:5.1.17.RELEASE" level="project" /> |
||||
<orderEntry type="library" name="Maven: redis.clients:jedis:2.9.3" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.apache.commons:commons-pool2:2.6.2" level="project" /> |
||||
<orderEntry type="library" name="Maven: io.jsonwebtoken:jjwt:0.9.1" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.springblade:blade-starter-log:5.1.1.RELEASE.fix.1" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.springblade:blade-core-cloud:5.1.1.RELEASE.fix.1" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-stream:2.1.4.RELEASE" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-validation:2.1.16.RELEASE" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-el:9.0.37" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.springframework:spring-messaging:5.1.17.RELEASE" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.springframework.integration:spring-integration-core:5.1.12.RELEASE" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.springframework.integration:spring-integration-jmx:5.1.12.RELEASE" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.springframework:spring-tuple:1.0.0.RELEASE" level="project" /> |
||||
<orderEntry type="library" name="Maven: com.esotericsoftware:kryo-shaded:3.0.3" level="project" /> |
||||
<orderEntry type="library" name="Maven: com.esotericsoftware:minlog:1.3.0" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.springframework.integration:spring-integration-tuple:1.0.0.RELEASE" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-function-context:2.0.2.RELEASE" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-function-core:2.0.2.RELEASE" level="project" /> |
||||
<orderEntry type="library" name="Maven: io.github.openfeign:feign-okhttp:10.4.0" level="project" /> |
||||
<orderEntry type="library" name="Maven: com.squareup.okhttp3:okhttp:3.14.5" level="project" /> |
||||
<orderEntry type="library" name="Maven: com.squareup.okio:okio:1.17.2" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-starter-netflix-hystrix:2.1.5.RELEASE" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-netflix-hystrix:2.1.5.RELEASE" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-starter-netflix-archaius:2.1.5.RELEASE" level="project" /> |
||||
<orderEntry type="library" name="Maven: com.netflix.hystrix:hystrix-serialization:1.5.18" level="project" /> |
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: com.fasterxml.jackson.module:jackson-module-afterburner:2.13.0" level="project" /> |
||||
<orderEntry type="library" name="Maven: com.netflix.hystrix:hystrix-metrics-event-stream:1.5.18" level="project" /> |
||||
<orderEntry type="library" name="Maven: com.netflix.hystrix:hystrix-javanica:1.5.18" level="project" /> |
||||
<orderEntry type="library" name="Maven: io.reactivex:rxjava-reactive-streams:1.2.1" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.reactivestreams:reactive-streams:1.0.3" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-actuator:2.1.16.RELEASE" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-actuator-autoconfigure:2.1.16.RELEASE" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-actuator:2.1.16.RELEASE" level="project" /> |
||||
<orderEntry type="library" name="Maven: io.micrometer:micrometer-core:1.1.16" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.latencyutils:LatencyUtils:2.0.3" level="project" /> |
||||
<orderEntry type="library" name="Maven: com.alibaba.cloud:spring-cloud-starter-alibaba-nacos-discovery:2.1.2.RELEASE" level="project" /> |
||||
<orderEntry type="library" name="Maven: com.alibaba.nacos:nacos-client:1.2.1" level="project" /> |
||||
<orderEntry type="library" name="Maven: com.alibaba.nacos:nacos-common:1.2.1" level="project" /> |
||||
<orderEntry type="library" name="Maven: com.alibaba.nacos:nacos-api:1.2.1" level="project" /> |
||||
<orderEntry type="library" name="Maven: io.prometheus:simpleclient:0.5.0" level="project" /> |
||||
<orderEntry type="library" name="Maven: com.alibaba.spring:spring-context-support:1.0.6" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-starter-netflix-ribbon:2.1.5.RELEASE" level="project" /> |
||||
<orderEntry type="library" name="Maven: com.netflix.ribbon:ribbon:2.3.0" level="project" /> |
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: com.netflix.ribbon:ribbon-transport:2.3.0" level="project" /> |
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: io.reactivex:rxnetty-contexts:0.4.9" level="project" /> |
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: io.reactivex:rxnetty-servo:0.4.9" level="project" /> |
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: javax.inject:javax.inject:1" level="project" /> |
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: io.reactivex:rxnetty:0.4.9" level="project" /> |
||||
<orderEntry type="library" name="Maven: com.netflix.ribbon:ribbon-core:2.3.0" level="project" /> |
||||
<orderEntry type="library" name="Maven: com.netflix.ribbon:ribbon-httpclient:2.3.0" level="project" /> |
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: commons-collections:commons-collections:3.2.2" level="project" /> |
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: com.sun.jersey:jersey-client:1.19.1" level="project" /> |
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: com.sun.jersey:jersey-core:1.19.1" level="project" /> |
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: javax.ws.rs:jsr311-api:1.1.1" level="project" /> |
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: com.sun.jersey.contribs:jersey-apache-client4:1.19.1" level="project" /> |
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: com.netflix.servo:servo-core:0.12.21" level="project" /> |
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: com.netflix.netflix-commons:netflix-commons-util:0.3.0" level="project" /> |
||||
<orderEntry type="library" name="Maven: com.netflix.ribbon:ribbon-loadbalancer:2.3.0" level="project" /> |
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: com.netflix.netflix-commons:netflix-statistics:0.1.1" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.junit.jupiter:junit-jupiter:5.5.2" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.junit.jupiter:junit-jupiter-api:5.3.2" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.apiguardian:apiguardian-api:1.0.0" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.opentest4j:opentest4j:1.1.1" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.junit.platform:junit-platform-commons:1.3.2" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.junit.jupiter:junit-jupiter-params:5.3.2" level="project" /> |
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: org.junit.jupiter:junit-jupiter-engine:5.3.2" level="project" /> |
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: org.junit.platform:junit-platform-engine:1.3.2" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.mockito:mockito-junit-jupiter:2.23.4" level="project" /> |
||||
<orderEntry type="library" name="Maven: com.alibaba.cloud:spring-cloud-starter-alibaba-nacos-config:2.1.2.RELEASE" level="project" /> |
||||
<orderEntry type="library" name="Maven: net.logstash.logback:logstash-logback-encoder:6.2" level="project" /> |
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.13.0" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.codehaus.janino:janino:3.0.15" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.codehaus.janino:commons-compiler:3.0.16" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-aop:2.1.16.RELEASE" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.springframework:spring-aop:5.1.17.RELEASE" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.aspectj:aspectjweaver:1.9.6" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.springframework.retry:spring-retry:1.2.5.RELEASE" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.springframework:spring-core:5.1.17.RELEASE" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.springframework:spring-jcl:5.1.17.RELEASE" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.springblade:blade-starter-tenant:5.1.1.RELEASE.fix.1" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.springblade:blade-starter-cache:5.1.1.RELEASE.fix.1" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-cache:2.1.16.RELEASE" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.springframework:spring-context-support:5.1.17.RELEASE" level="project" /> |
||||
<orderEntry type="library" name="Maven: com.baomidou:dynamic-datasource-spring-boot-starter:3.3.2" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-starter-openfeign:2.1.5.RELEASE" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-starter:2.1.6.RELEASE" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-context:2.1.6.RELEASE" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.springframework.security:spring-security-rsa:1.0.9.RELEASE" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.bouncycastle:bcpkix-jdk15on:1.59" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.bouncycastle:bcprov-jdk15on:1.59" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-openfeign-core:2.1.5.RELEASE" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-autoconfigure:2.1.16.RELEASE" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-netflix-ribbon:2.1.5.RELEASE" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-netflix-archaius:2.1.5.RELEASE" level="project" /> |
||||
<orderEntry type="library" name="Maven: io.github.openfeign.form:feign-form-spring:3.8.0" level="project" /> |
||||
<orderEntry type="library" name="Maven: io.github.openfeign.form:feign-form:3.8.0" level="project" /> |
||||
<orderEntry type="library" name="Maven: commons-fileupload:commons-fileupload:1.3.3" level="project" /> |
||||
<orderEntry type="library" name="Maven: commons-io:commons-io:2.6" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.springframework:spring-web:5.1.17.RELEASE" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.springframework:spring-beans:5.1.17.RELEASE" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-commons:2.1.6.RELEASE" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.springframework.security:spring-security-crypto:5.1.11.RELEASE" level="project" /> |
||||
<orderEntry type="library" name="Maven: io.github.openfeign:feign-core:10.4.0" level="project" /> |
||||
<orderEntry type="library" name="Maven: io.github.openfeign:feign-slf4j:10.4.0" level="project" /> |
||||
<orderEntry type="library" name="Maven: io.github.openfeign:feign-hystrix:10.4.0" level="project" /> |
||||
<orderEntry type="library" name="Maven: com.netflix.archaius:archaius-core:0.7.6" level="project" /> |
||||
<orderEntry type="library" name="Maven: com.google.code.findbugs:jsr305:3.0.2" level="project" /> |
||||
<orderEntry type="library" name="Maven: commons-configuration:commons-configuration:1.8" level="project" /> |
||||
<orderEntry type="library" name="Maven: commons-lang:commons-lang:2.6" level="project" /> |
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.13.0" level="project" /> |
||||
<orderEntry type="library" name="Maven: com.netflix.hystrix:hystrix-core:1.5.18" level="project" /> |
||||
<orderEntry type="library" name="Maven: io.reactivex:rxjava:1.3.8" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.hdrhistogram:HdrHistogram:2.1.9" level="project" /> |
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-swagger2:2.9.2" level="project" /> |
||||
<orderEntry type="library" name="Maven: io.swagger:swagger-annotations:1.5.20" level="project" /> |
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-spi:2.9.2" level="project" /> |
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-core:2.9.2" level="project" /> |
||||
<orderEntry type="library" name="Maven: net.bytebuddy:byte-buddy:1.9.16" level="project" /> |
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-schema:2.9.2" level="project" /> |
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-swagger-common:2.9.2" level="project" /> |
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-spring-web:2.9.2" level="project" /> |
||||
<orderEntry type="library" name="Maven: com.google.guava:guava:20.0" level="project" /> |
||||
<orderEntry type="library" name="Maven: com.fasterxml:classmate:1.4.0" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.30" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-core:1.2.0.RELEASE" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.springframework:spring-context:5.1.17.RELEASE" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.springframework:spring-expression:5.1.17.RELEASE" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-metadata:1.2.0.RELEASE" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.mapstruct:mapstruct:1.2.0.Final" level="project" /> |
||||
<orderEntry type="library" name="Maven: io.swagger:swagger-models:1.5.21" level="project" /> |
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.13.0" level="project" /> |
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.springblade:blade-core-auto:5.1.1.RELEASE.fix.1" level="project" /> |
||||
<orderEntry type="module" module-name="common-api" /> |
||||
<orderEntry type="library" name="Maven: com.github.ben-manes.caffeine:caffeine:2.6.2" level="project" /> |
||||
<orderEntry type="library" name="Maven: com.alibaba:easyexcel:2.2.6" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.apache.poi:poi:3.17" level="project" /> |
||||
<orderEntry type="library" name="Maven: commons-codec:commons-codec:1.11" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.apache.commons:commons-collections4:4.4" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.apache.poi:poi-ooxml:3.17" level="project" /> |
||||
<orderEntry type="library" name="Maven: com.github.virtuald:curvesapi:1.04" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.apache.poi:poi-ooxml-schemas:3.17" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.apache.xmlbeans:xmlbeans:2.6.0" level="project" /> |
||||
<orderEntry type="library" name="Maven: stax:stax-api:1.0.1" level="project" /> |
||||
<orderEntry type="library" name="Maven: cglib:cglib:3.1" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.ow2.asm:asm:4.2" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.ehcache:ehcache:3.6.3" level="project" /> |
||||
<orderEntry type="module" module-name="safeproduct-api" /> |
||||
<orderEntry type="library" name="Maven: org.springblade:blade-system-api:5.1.1.RELEASE" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.springblade:blade-starter-swagger:5.1.1.RELEASE.fix.1" level="project" /> |
||||
<orderEntry type="library" name="Maven: com.github.xiaoymin:knife4j-micro-spring-boot-starter:2.0.4" level="project" /> |
||||
<orderEntry type="library" name="Maven: com.github.xiaoymin:knife4j-spring-boot-autoconfigure:2.0.4" level="project" /> |
||||
<orderEntry type="library" name="Maven: com.github.xiaoymin:knife4j-spring:2.0.4" level="project" /> |
||||
<orderEntry type="library" name="Maven: com.github.xiaoymin:knife4j-annotations:2.0.4" level="project" /> |
||||
<orderEntry type="library" name="Maven: com.github.xiaoymin:knife4j-core:2.0.4" level="project" /> |
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-bean-validators:2.9.2" level="project" /> |
||||
<orderEntry type="module" module-name="middle-api" /> |
||||
<orderEntry type="library" name="Maven: org.springblade:blade-user-api:5.1.1.RELEASE" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.springblade:blade-dict-api:5.1.1.RELEASE" level="project" /> |
||||
<orderEntry type="library" name="Maven: cn.afterturn:easypoi-spring-boot-starter:4.4.0" level="project" /> |
||||
<orderEntry type="library" name="Maven: cn.afterturn:easypoi-web:4.4.0" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.springframework:spring-webmvc:5.1.17.RELEASE" level="project" /> |
||||
<orderEntry type="library" name="Maven: cn.afterturn:easypoi-base:4.4.0" level="project" /> |
||||
<orderEntry type="library" name="Maven: ognl:ognl:3.2.6" level="project" /> |
||||
<orderEntry type="library" name="Maven: javax.validation:validation-api:2.0.1.Final" level="project" /> |
||||
<orderEntry type="library" name="Maven: cn.afterturn:easypoi-annotation:4.4.0" level="project" /> |
||||
<orderEntry type="library" name="Maven: cn.afterturn:easypoi-wps:4.4.0" level="project" /> |
||||
<orderEntry type="library" name="Maven: cn.hutool:hutool-all:5.6.6" level="project" /> |
||||
<orderEntry type="module" module-name="hzims-biz-common" /> |
||||
<orderEntry type="library" name="Maven: org.springblade:blade-core-launch:5.1.1.RELEASE.fix.1" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-web:2.1.16.RELEASE" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-json:2.1.16.RELEASE" level="project" /> |
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.13.0" level="project" /> |
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.module:jackson-module-parameter-names:2.13.0" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.hibernate.validator:hibernate-validator:6.0.20.Final" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.jboss.logging:jboss-logging:3.3.3.Final" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-undertow:2.1.16.RELEASE" level="project" /> |
||||
<orderEntry type="library" name="Maven: io.undertow:undertow-core:2.0.30.Final" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.jboss.xnio:xnio-api:3.3.8.Final" level="project" /> |
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: org.jboss.xnio:xnio-nio:3.3.8.Final" level="project" /> |
||||
<orderEntry type="library" name="Maven: io.undertow:undertow-servlet:2.0.30.Final" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.jboss.spec.javax.annotation:jboss-annotations-api_1.2_spec:1.0.2.Final" level="project" /> |
||||
<orderEntry type="library" name="Maven: io.undertow:undertow-websockets-jsr:2.0.30.Final" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.jboss.spec.javax.websocket:jboss-websocket-api_1.1_spec:1.1.4.Final" level="project" /> |
||||
<orderEntry type="library" name="Maven: javax.servlet:javax.servlet-api:4.0.1" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.glassfish:javax.el:3.0.0" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.springblade:blade-common:5.1.1.RELEASE.fix.1" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.springblade:blade-core-boot:5.1.1.RELEASE.fix.1" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.springblade:blade-core-db:5.1.1.RELEASE.fix.1" level="project" /> |
||||
<orderEntry type="library" name="Maven: com.baomidou:mybatis-plus-boot-starter:3.3.2" level="project" /> |
||||
<orderEntry type="library" name="Maven: com.alibaba:druid-spring-boot-starter:1.1.22" level="project" /> |
||||
<orderEntry type="library" name="Maven: com.alibaba:druid:1.1.22" level="project" /> |
||||
<orderEntry type="library" name="Maven: mysql:mysql-connector-java:8.0.27" level="project" /> |
||||
<orderEntry type="library" name="Maven: com.google.protobuf:protobuf-java:3.5.1" level="project" /> |
||||
<orderEntry type="library" name="Maven: com.oracle:ojdbc7:12.2.0.1" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.postgresql:postgresql:42.2.6" level="project" /> |
||||
<orderEntry type="library" name="Maven: com.microsoft.sqlserver:mssql-jdbc:6.4.0.jre8" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.springblade:blade-core-secure:5.1.1.RELEASE.fix.1" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.springblade:blade-starter-redis:5.1.1.RELEASE.fix.1" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.redisson:redisson:3.11.6" level="project" /> |
||||
<orderEntry type="library" name="Maven: io.netty:netty-common:4.1.51.Final" level="project" /> |
||||
<orderEntry type="library" name="Maven: io.netty:netty-codec:4.1.51.Final" level="project" /> |
||||
<orderEntry type="library" name="Maven: io.netty:netty-buffer:4.1.51.Final" level="project" /> |
||||
<orderEntry type="library" name="Maven: io.netty:netty-transport:4.1.51.Final" level="project" /> |
||||
<orderEntry type="library" name="Maven: io.netty:netty-resolver:4.1.51.Final" level="project" /> |
||||
<orderEntry type="library" name="Maven: io.netty:netty-resolver-dns:4.1.51.Final" level="project" /> |
||||
<orderEntry type="library" name="Maven: io.netty:netty-codec-dns:4.1.51.Final" level="project" /> |
||||
<orderEntry type="library" name="Maven: io.netty:netty-handler:4.1.51.Final" level="project" /> |
||||
<orderEntry type="library" name="Maven: javax.cache:cache-api:1.1.1" level="project" /> |
||||
<orderEntry type="library" name="Maven: io.projectreactor:reactor-core:3.2.19.RELEASE" level="project" /> |
||||
<orderEntry type="library" name="Maven: io.reactivex.rxjava2:rxjava:2.2.19" level="project" /> |
||||
<orderEntry type="library" name="Maven: de.ruedigermoeller:fst:2.57" level="project" /> |
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.13.0" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.jodd:jodd-bean:5.0.13" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.jodd:jodd-core:5.0.13" level="project" /> |
||||
<orderEntry type="library" name="Maven: com.github.oshi:oshi-core:3.9.1" level="project" /> |
||||
<orderEntry type="library" name="Maven: net.java.dev.jna:jna-platform:4.5.2" level="project" /> |
||||
<orderEntry type="library" name="Maven: net.java.dev.jna:jna:4.5.2" level="project" /> |
||||
<orderEntry type="library" name="Maven: ch.qos.logback.db:logback-classic-db:1.2.11.1" level="project" /> |
||||
<orderEntry type="library" name="Maven: ch.qos.logback:logback-core:test-jar:tests:1.2.11" level="project" /> |
||||
<orderEntry type="library" name="Maven: ch.qos.logback:logback-core:1.2.3" level="project" /> |
||||
<orderEntry type="library" name="Maven: ch.qos.logback.db:logback-core-db:1.2.11.1" level="project" /> |
||||
<orderEntry type="library" name="Maven: ch.qos.logback:logback-classic:1.2.3" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.reflections:reflections:0.10.2" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.javassist:javassist:3.28.0-GA" level="project" /> |
||||
<orderEntry type="library" name="Maven: com.alibaba:fastjson:1.2.73" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.springblade:blade-starter-datascope:5.1.1.RELEASE.fix.1" level="project" /> |
||||
<orderEntry type="library" name="Maven: com.hikvision.ga:artemis-http-client:1.1.2" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpclient:4.5.2" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore:4.4.13" level="project" /> |
||||
<orderEntry type="library" name="Maven: commons-logging:commons-logging:1.2" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.apache.commons:commons-lang3:3.8.1" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.projectlombok:lombok:1.18.12" level="project" /> |
||||
<orderEntry type="library" scope="TEST" name="Maven: org.springblade:blade-core-test:5.1.1.RELEASE.fix.1" level="project" /> |
||||
<orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-starter-test:2.1.16.RELEASE" level="project" /> |
||||
<orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-test:2.1.16.RELEASE" level="project" /> |
||||
<orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-test-autoconfigure:2.1.16.RELEASE" level="project" /> |
||||
<orderEntry type="library" scope="TEST" name="Maven: com.jayway.jsonpath:json-path:2.4.0" level="project" /> |
||||
<orderEntry type="library" scope="TEST" name="Maven: net.minidev:json-smart:2.3" level="project" /> |
||||
<orderEntry type="library" scope="TEST" name="Maven: net.minidev:accessors-smart:1.2" level="project" /> |
||||
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.12" level="project" /> |
||||
<orderEntry type="library" scope="TEST" name="Maven: org.assertj:assertj-core:3.11.1" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.mockito:mockito-core:2.23.4" level="project" /> |
||||
<orderEntry type="library" name="Maven: net.bytebuddy:byte-buddy-agent:1.9.16" level="project" /> |
||||
<orderEntry type="library" name="Maven: org.objenesis:objenesis:2.6" level="project" /> |
||||
<orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" /> |
||||
<orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-library:1.3" level="project" /> |
||||
<orderEntry type="library" scope="TEST" name="Maven: org.skyscreamer:jsonassert:1.5.0" level="project" /> |
||||
<orderEntry type="library" scope="TEST" name="Maven: com.vaadin.external.google:android-json:0.0.20131108.vaadin1" level="project" /> |
||||
<orderEntry type="library" scope="TEST" name="Maven: org.springframework:spring-test:5.1.17.RELEASE" level="project" /> |
||||
<orderEntry type="library" scope="TEST" name="Maven: org.xmlunit:xmlunit-core:2.6.4" level="project" /> |
||||
<orderEntry type="library" scope="TEST" name="Maven: javax.xml.bind:jaxb-api:2.3.1" level="project" /> |
||||
<orderEntry type="library" scope="TEST" name="Maven: javax.activation:javax.activation-api:1.2.0" level="project" /> |
||||
</component> |
||||
</module> |
@ -0,0 +1,56 @@
|
||||
package com.hnac.hzinfo.inspect.request; |
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
import io.swagger.annotations.ApiModel; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
import org.springblade.core.tool.utils.DateUtil; |
||||
import org.springframework.format.annotation.DateTimeFormat; |
||||
|
||||
import java.io.Serializable; |
||||
import java.time.LocalDate; |
||||
import java.time.LocalTime; |
||||
|
||||
/** |
||||
* @ClassName GenerateTaskVO |
||||
* @description: |
||||
* @author: hx |
||||
* @create: 2023-10-12 09:01 |
||||
* @Version 4.0 |
||||
**/ |
||||
@Data |
||||
@EqualsAndHashCode |
||||
@ApiModel("生成巡检任务") |
||||
public class GenerateTaskVO implements Serializable { |
||||
|
||||
@ApiModelProperty("站点编号") |
||||
private String stationCode; |
||||
|
||||
@ApiModelProperty("站点名称") |
||||
private String stationName; |
||||
|
||||
@ApiModelProperty("区域机构ID") |
||||
private Long areaDeptId; |
||||
|
||||
@ApiModelProperty("开始日期") |
||||
@DateTimeFormat(pattern = DateUtil.PATTERN_DATE) |
||||
@JsonFormat(pattern = DateUtil.PATTERN_DATE) |
||||
private LocalDate startDate; |
||||
|
||||
@ApiModelProperty("结束日期") |
||||
@DateTimeFormat(pattern = DateUtil.PATTERN_DATE) |
||||
@JsonFormat(pattern = DateUtil.PATTERN_DATE) |
||||
private LocalDate endDate; |
||||
|
||||
@ApiModelProperty("开始时间") |
||||
@DateTimeFormat(pattern = DateUtil.PATTERN_TIME) |
||||
@JsonFormat(pattern = DateUtil.PATTERN_TIME) |
||||
private LocalTime startTime = LocalTime.of(8,0,0); |
||||
|
||||
@ApiModelProperty("结束时间") |
||||
@DateTimeFormat(pattern = DateUtil.PATTERN_TIME) |
||||
@JsonFormat(pattern = DateUtil.PATTERN_TIME) |
||||
private LocalTime endTime = LocalTime.of(16,0,0); |
||||
|
||||
} |
@ -0,0 +1,21 @@
|
||||
package com.hnac.hzinfo.inspect.showTemplate.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import com.hnac.hzinfo.inspect.plan.entity.PlanEntity; |
||||
import io.swagger.annotations.ApiModel; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
|
||||
import java.io.Serializable; |
||||
|
||||
@Data |
||||
@EqualsAndHashCode |
||||
@ApiModel("巡检计划模板-造演示数据使用") |
||||
@TableName("hz_st_re_plan_template") |
||||
public class PlanTemplateEntity extends PlanEntity implements Serializable { |
||||
|
||||
@ApiModelProperty("是否启用") |
||||
private Boolean enable; |
||||
|
||||
} |
@ -0,0 +1,28 @@
|
||||
package com.hnac.hzinfo.inspect.showTemplate.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import com.hnac.hzinfo.inspect.task.entity.TaskObjectProjectContentEntity; |
||||
import io.swagger.annotations.ApiModel; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
|
||||
import java.io.Serializable; |
||||
|
||||
/** |
||||
* @ClassName TaskObjectProjectContentTemplateEntity |
||||
* @description: |
||||
* @author: hx |
||||
* @create: 2023-10-12 14:49 |
||||
* @Version 4.0 |
||||
**/ |
||||
@Data |
||||
@ApiModel("TaskObjectProjectContentTemplateEntity对象") |
||||
@EqualsAndHashCode |
||||
@TableName("hz_st_ex_object_project_content_template") |
||||
public class TaskObjectProjectContentTemplateEntity extends TaskObjectProjectContentEntity implements Serializable { |
||||
|
||||
@ApiModelProperty("是否启用") |
||||
private Boolean enable; |
||||
|
||||
} |
@ -0,0 +1,21 @@
|
||||
package com.hnac.hzinfo.inspect.showTemplate.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import com.hnac.hzinfo.inspect.task.entity.TaskObjectProjectEntity; |
||||
import io.swagger.annotations.ApiModel; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
|
||||
import java.io.Serializable; |
||||
|
||||
@Data |
||||
@TableName("hz_st_ex_object_project_template") |
||||
@EqualsAndHashCode(callSuper = true) |
||||
@ApiModel(value = "TaskObjectProject对象", description = "") |
||||
public class TaskObjectProjectTemplateEntity extends TaskObjectProjectEntity implements Serializable { |
||||
|
||||
@ApiModelProperty("是否启用") |
||||
private Boolean enable; |
||||
|
||||
} |
@ -0,0 +1,28 @@
|
||||
package com.hnac.hzinfo.inspect.showTemplate.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import com.hnac.hzinfo.inspect.task.entity.TaskObjectEntity; |
||||
import io.swagger.annotations.ApiModel; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.AllArgsConstructor; |
||||
import lombok.Data; |
||||
|
||||
import java.io.Serializable; |
||||
|
||||
/** |
||||
* @ClassName TaskObjectTemplateEntity |
||||
* @description: |
||||
* @author: hx |
||||
* @create: 2023-10-12 13:31 |
||||
* @Version 4.0 |
||||
**/ |
||||
@Data |
||||
@AllArgsConstructor |
||||
@ApiModel("巡检任务对象模板-演示数据占用") |
||||
@TableName("hz_st_ex_object_template") |
||||
public class TaskObjectTemplateEntity extends TaskObjectEntity implements Serializable { |
||||
|
||||
@ApiModelProperty("是否启用") |
||||
private Boolean enable; |
||||
|
||||
} |
@ -0,0 +1,28 @@
|
||||
package com.hnac.hzinfo.inspect.showTemplate.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import com.hnac.hzinfo.inspect.task.entity.TaskEntity; |
||||
import io.swagger.annotations.ApiModel; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.AllArgsConstructor; |
||||
import lombok.Data; |
||||
|
||||
import java.io.Serializable; |
||||
|
||||
/** |
||||
* @ClassName TaskTemplateEntity |
||||
* @description: |
||||
* @author: hx |
||||
* @create: 2023-10-12 11:28 |
||||
* @Version 4.0 |
||||
**/ |
||||
@Data |
||||
@AllArgsConstructor |
||||
@ApiModel("巡检任务模板-演示数据占用") |
||||
@TableName("hz_st_ex_task_template") |
||||
public class TaskTemplateEntity extends TaskEntity implements Serializable { |
||||
|
||||
@ApiModelProperty("是否启用") |
||||
private Boolean enable; |
||||
|
||||
} |
@ -0,0 +1,91 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> |
||||
<parent> |
||||
<groupId>com.hnac.hzims</groupId> |
||||
<artifactId>hzims-service</artifactId> |
||||
<version>4.0.0-SNAPSHOT</version> |
||||
</parent> |
||||
<modelVersion>4.0.0</modelVersion> |
||||
<artifactId>hzims-big-model</artifactId> |
||||
<name>big-model</name> |
||||
<packaging>jar</packaging> |
||||
|
||||
<dependencies> |
||||
<dependency> |
||||
<groupId>org.springblade</groupId> |
||||
<artifactId>blade-core-boot</artifactId> |
||||
<exclusions> |
||||
<exclusion> |
||||
<groupId>org.springblade</groupId> |
||||
<artifactId>blade-starter-redis</artifactId> |
||||
</exclusion> |
||||
</exclusions> |
||||
</dependency> |
||||
|
||||
<dependency> |
||||
<groupId>org.springblade</groupId> |
||||
<artifactId>blade-starter-swagger</artifactId> |
||||
</dependency> |
||||
|
||||
<dependency> |
||||
<groupId>org.springblade</groupId> |
||||
<artifactId>blade-core-test</artifactId> |
||||
<scope>test</scope> |
||||
</dependency> |
||||
|
||||
<dependency> |
||||
<groupId>org.springblade</groupId> |
||||
<artifactId>blade-core-cloud</artifactId> |
||||
</dependency> |
||||
<dependency> |
||||
<groupId>com.hnac.hzims</groupId> |
||||
<artifactId>big-model-api</artifactId> |
||||
<version>4.0.0-SNAPSHOT</version> |
||||
<scope>compile</scope> |
||||
</dependency> |
||||
|
||||
<!-- spring-boot-websocket start --> |
||||
<dependency> |
||||
<groupId>org.springframework.boot</groupId> |
||||
<artifactId>spring-boot-starter-websocket</artifactId> |
||||
<exclusions> |
||||
<exclusion> |
||||
<groupId>org.springframework.boot</groupId> |
||||
<artifactId>spring-boot-starter-tomcat</artifactId> |
||||
</exclusion> |
||||
</exclusions> |
||||
</dependency> |
||||
<!-- spring-boot-websocket end --> |
||||
<dependency> |
||||
<groupId>com.xuxueli</groupId> |
||||
<artifactId>xxl-job-core</artifactId> |
||||
</dependency> |
||||
<dependency> |
||||
<groupId>org.springblade</groupId> |
||||
<artifactId>blade-system-api</artifactId> |
||||
</dependency> |
||||
</dependencies> |
||||
|
||||
<build> |
||||
<finalName>${project.name}-${project.version}</finalName> |
||||
<plugins> |
||||
<plugin> |
||||
<groupId>com.spotify</groupId> |
||||
<artifactId>dockerfile-maven-plugin</artifactId> |
||||
<configuration> |
||||
<username>${docker.username}</username> |
||||
<password>${docker.password}</password> |
||||
<repository>${docker.registry.url}/${docker.namespace}/${project.artifactId}</repository> |
||||
<tag>${project.version}</tag> |
||||
<useMavenSettingsForAuth>true</useMavenSettingsForAuth> |
||||
<buildArgs> |
||||
<JAR_FILE>target/${project.build.finalName}.jar</JAR_FILE> |
||||
</buildArgs> |
||||
<skip>false</skip> |
||||
</configuration> |
||||
</plugin> |
||||
</plugins> |
||||
</build> |
||||
|
||||
</project> |
@ -0,0 +1,33 @@
|
||||
package com.hnac.hzims.bigmodel; |
||||
|
||||
import org.mybatis.spring.annotation.MapperScan; |
||||
import org.springblade.core.cloud.feign.EnableBladeFeign; |
||||
import org.springblade.core.launch.BladeApplication; |
||||
import org.springframework.boot.SpringApplication; |
||||
import org.springframework.boot.autoconfigure.SpringBootApplication; |
||||
import org.springframework.boot.builder.SpringApplicationBuilder; |
||||
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; |
||||
import org.springframework.cloud.client.SpringCloudApplication; |
||||
import org.springframework.context.annotation.ComponentScan; |
||||
import org.springframework.scheduling.annotation.EnableScheduling; |
||||
|
||||
import javax.annotation.Resource; |
||||
|
||||
@EnableBladeFeign(basePackages = {"org.springblade","com.hnac"}) |
||||
@SpringCloudApplication |
||||
@MapperScan("com.hnac.hzims.**.mapper.**") |
||||
@ComponentScan(basePackages = {"com.hnac.hzims.bigmodel.*"}) |
||||
@Resource |
||||
@ComponentScan(basePackages = {"com.hnac.hzims.*"}) |
||||
public class HzimsBigModelApplication extends SpringBootServletInitializer { |
||||
|
||||
public static void main(String[] args) { |
||||
BladeApplication.run(BigModelConstants.APP_NAME, HzimsBigModelApplication.class, args); |
||||
} |
||||
|
||||
@Override |
||||
protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) { |
||||
return BladeApplication.createSpringApplicationBuilder(builder, BigModelConstants.APP_NAME, HzimsBigModelApplication.class); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,18 @@
|
||||
package com.hnac.hzims.bigmodel.configuration; |
||||
|
||||
import lombok.Data; |
||||
import org.springframework.boot.context.properties.ConfigurationProperties; |
||||
import org.springframework.stereotype.Component; |
||||
|
||||
/** |
||||
* @Author: huangxing |
||||
* @Date: 2024/04/28 18:20 |
||||
*/ |
||||
@Data |
||||
@Component |
||||
@ConfigurationProperties(prefix = "fdp.url") |
||||
public class BigModelInvokeUrl { |
||||
|
||||
private String assistantAsk; |
||||
|
||||
} |
@ -0,0 +1,73 @@
|
||||
package com.hnac.hzims.bigmodel.function.controller; |
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
||||
import com.hnac.hzims.bigmodel.BigModelConstants; |
||||
import com.hnac.hzims.bigmodel.entity.FunctionEntity; |
||||
import com.hnac.hzims.bigmodel.function.service.IFunctionService; |
||||
import com.hnac.hzims.common.utils.Condition; |
||||
import com.hnac.hzinfo.log.annotation.Business; |
||||
import io.swagger.annotations.Api; |
||||
import io.swagger.annotations.ApiModel; |
||||
import io.swagger.annotations.ApiOperation; |
||||
import lombok.AllArgsConstructor; |
||||
import org.springblade.core.mp.support.Query; |
||||
import org.springblade.core.tool.api.R; |
||||
import org.springblade.core.tool.utils.BeanUtil; |
||||
import org.springblade.core.tool.utils.Func; |
||||
import org.springframework.validation.annotation.Validated; |
||||
import org.springframework.web.bind.annotation.*; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @Author: huangxing |
||||
* @Date: 2024/04/29 14:39 |
||||
*/ |
||||
@RestController |
||||
@RequestMapping("/function") |
||||
@Api(value = "大模型函数管理",tags = "大模型函数管理") |
||||
@Business(module = BigModelConstants.MODULE_NAME,value = "大模型函数管理") |
||||
@AllArgsConstructor |
||||
public class FunctionController { |
||||
|
||||
private final IFunctionService functionService; |
||||
|
||||
@PostMapping("/save") |
||||
@ApiOperation("保存函数") |
||||
@ApiOperationSupport(order = 1) |
||||
public R save(@RequestBody @Validated FunctionEntity req) { |
||||
return R.status(functionService.save(req)); |
||||
} |
||||
|
||||
@PutMapping("/save") |
||||
@ApiOperation("编辑函数") |
||||
@ApiOperationSupport(order = 2) |
||||
public R updateById(@RequestBody FunctionEntity req) { |
||||
return R.status(functionService.save(req)); |
||||
} |
||||
|
||||
@GetMapping("/list") |
||||
@ApiOperation("列表查询") |
||||
@ApiOperationSupport(order = 3) |
||||
public R<List<FunctionEntity>> list(FunctionEntity req) { |
||||
return R.data(functionService.list(Condition.getQueryWrapper(BeanUtil.toMap(req),FunctionEntity.class))); |
||||
} |
||||
|
||||
@GetMapping("/page") |
||||
@ApiOperation("分页查询") |
||||
@ApiOperationSupport(order = 4) |
||||
public R<IPage<FunctionEntity>> page(FunctionEntity req, Query query) { |
||||
QueryWrapper<FunctionEntity> queryWrapper = Condition.getQueryWrapper(BeanUtil.toMap(req), FunctionEntity.class); |
||||
return R.data(functionService.page(Condition.getPage(query),queryWrapper)); |
||||
} |
||||
|
||||
@DeleteMapping("/remove") |
||||
@ApiOperation("删除函数") |
||||
@ApiOperationSupport(order = 4) |
||||
public R remove(String ids) { |
||||
return R.data(functionService.removeByIds(Func.toLongList(",",ids))); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,74 @@
|
||||
package com.hnac.hzims.bigmodel.function.controller; |
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
||||
import com.hnac.hzims.bigmodel.BigModelConstants; |
||||
import com.hnac.hzims.bigmodel.entity.FuncParamEntity; |
||||
import com.hnac.hzims.bigmodel.entity.FunctionEntity; |
||||
import com.hnac.hzims.bigmodel.function.service.IFuncParamService; |
||||
import com.hnac.hzims.bigmodel.function.service.IFunctionService; |
||||
import com.hnac.hzims.common.utils.Condition; |
||||
import com.hnac.hzinfo.log.annotation.Business; |
||||
import io.swagger.annotations.Api; |
||||
import io.swagger.annotations.ApiOperation; |
||||
import lombok.AllArgsConstructor; |
||||
import org.springblade.core.mp.support.Query; |
||||
import org.springblade.core.tool.api.R; |
||||
import org.springblade.core.tool.utils.BeanUtil; |
||||
import org.springblade.core.tool.utils.Func; |
||||
import org.springframework.validation.annotation.Validated; |
||||
import org.springframework.web.bind.annotation.*; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @Author: huangxing |
||||
* @Date: 2024/04/29 15:46 |
||||
*/ |
||||
@RestController |
||||
@RequestMapping("/function/param") |
||||
@Api(value = "大模型函数参数管理",tags = "大模型函数参数管理") |
||||
@Business(module = BigModelConstants.MODULE_NAME,value = "大模型函数参数管理") |
||||
@AllArgsConstructor |
||||
public class FunctionParamController { |
||||
|
||||
private final IFuncParamService funcParamService; |
||||
|
||||
@PostMapping("/save") |
||||
@ApiOperation("保存函数参数") |
||||
@ApiOperationSupport(order = 1) |
||||
public R save(@RequestBody @Validated FuncParamEntity req) { |
||||
return R.status(funcParamService.save(req)); |
||||
} |
||||
|
||||
@PutMapping("/save") |
||||
@ApiOperation("编辑函数参数") |
||||
@ApiOperationSupport(order = 2) |
||||
public R updateById(@RequestBody FuncParamEntity req) { |
||||
return R.status(funcParamService.save(req)); |
||||
} |
||||
|
||||
@GetMapping("/list") |
||||
@ApiOperation("列表查询") |
||||
@ApiOperationSupport(order = 3) |
||||
public R<List<FuncParamEntity>> list(FuncParamEntity req) { |
||||
return R.data(funcParamService.list(Condition.getQueryWrapper(BeanUtil.toMap(req),FuncParamEntity.class))); |
||||
} |
||||
|
||||
@GetMapping("/page") |
||||
@ApiOperation("分页查询") |
||||
@ApiOperationSupport(order = 4) |
||||
public R<IPage<FuncParamEntity>> page(FuncParamEntity req, Query query) { |
||||
QueryWrapper<FuncParamEntity> queryWrapper = Condition.getQueryWrapper(BeanUtil.toMap(req), FuncParamEntity.class); |
||||
return R.data(funcParamService.page(Condition.getPage(query),queryWrapper)); |
||||
} |
||||
|
||||
@DeleteMapping("/remove") |
||||
@ApiOperation("删除函数参数") |
||||
@ApiOperationSupport(order = 4) |
||||
public R remove(String ids) { |
||||
return R.data(funcParamService.removeByIds(Func.toLongList(",",ids))); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,11 @@
|
||||
package com.hnac.hzims.bigmodel.function.mapper; |
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.hnac.hzims.bigmodel.entity.FuncParamEntity; |
||||
|
||||
/** |
||||
* @Author: huangxing |
||||
* @Date: 2024/04/26 11:11 |
||||
*/ |
||||
public interface FuncParamMapper extends BaseMapper<FuncParamEntity> { |
||||
} |
@ -0,0 +1,12 @@
|
||||
package com.hnac.hzims.bigmodel.function.mapper; |
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.hnac.hzims.bigmodel.entity.FunctionEntity; |
||||
|
||||
/** |
||||
* @Author: huangxing |
||||
* @Date: 2024/04/26 11:10 |
||||
*/ |
||||
public interface FunctionMapper extends BaseMapper<FunctionEntity> { |
||||
|
||||
} |
@ -0,0 +1,21 @@
|
||||
package com.hnac.hzims.bigmodel.function.service; |
||||
|
||||
import com.hnac.hzims.bigmodel.entity.FuncParamEntity; |
||||
import org.springblade.core.mp.base.BaseService; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @Author: huangxing |
||||
* @Date: 2024/04/26 11:12 |
||||
*/ |
||||
public interface IFuncParamService extends BaseService<FuncParamEntity> { |
||||
|
||||
/** |
||||
* 根据函数ID获取参数列表 |
||||
* @param funcId 函数ID |
||||
* @return 参数列表 |
||||
*/ |
||||
List<FuncParamEntity> getParamsByFuncId(Long funcId); |
||||
|
||||
} |
@ -0,0 +1,14 @@
|
||||
package com.hnac.hzims.bigmodel.function.service; |
||||
|
||||
import com.hnac.hzims.bigmodel.entity.FunctionEntity; |
||||
import org.springblade.core.mp.base.BaseService; |
||||
|
||||
/** |
||||
* @Author: huangxing |
||||
* @Date: 2024/04/26 11:08 |
||||
*/ |
||||
public interface IFunctionService extends BaseService<FunctionEntity> { |
||||
|
||||
FunctionEntity getFunctionByCode(String code); |
||||
|
||||
} |
@ -0,0 +1,28 @@
|
||||
package com.hnac.hzims.bigmodel.function.service.impl; |
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
||||
import com.hnac.hzims.bigmodel.entity.FuncParamEntity; |
||||
import com.hnac.hzims.bigmodel.function.mapper.FuncParamMapper; |
||||
import com.hnac.hzims.bigmodel.function.service.IFuncParamService; |
||||
import lombok.extern.slf4j.Slf4j; |
||||
import org.springblade.core.mp.base.BaseServiceImpl; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @Author: huangxing |
||||
* @Date: 2024/04/26 11:13 |
||||
*/ |
||||
@Service |
||||
@Slf4j |
||||
public class FuncParamServiceImpl extends BaseServiceImpl<FuncParamMapper, FuncParamEntity> implements IFuncParamService { |
||||
|
||||
@Override |
||||
public List<FuncParamEntity> getParamsByFuncId(Long funcId) { |
||||
LambdaQueryWrapper<FuncParamEntity> queryWrapper = Wrappers.<FuncParamEntity>lambdaQuery().eq(FuncParamEntity::getFuncId, funcId); |
||||
return this.list(queryWrapper); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,27 @@
|
||||
package com.hnac.hzims.bigmodel.function.service.impl; |
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
||||
import com.hnac.hzims.bigmodel.entity.FunctionEntity; |
||||
import com.hnac.hzims.bigmodel.function.mapper.FunctionMapper; |
||||
import com.hnac.hzims.bigmodel.function.service.IFunctionService; |
||||
import lombok.AllArgsConstructor; |
||||
import lombok.extern.slf4j.Slf4j; |
||||
import org.springblade.core.mp.base.BaseServiceImpl; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
/** |
||||
* @Author: huangxing |
||||
* @Date: 2024/04/26 11:09 |
||||
*/ |
||||
@Service |
||||
@Slf4j |
||||
@AllArgsConstructor |
||||
public class FunctionServiceImpl extends BaseServiceImpl<FunctionMapper, FunctionEntity> implements IFunctionService { |
||||
|
||||
@Override |
||||
public FunctionEntity getFunctionByCode(String code) { |
||||
LambdaQueryWrapper<FunctionEntity> queryWrapper = Wrappers.<FunctionEntity>lambdaQuery().eq(FunctionEntity::getCode, code); |
||||
return this.getOne(queryWrapper); |
||||
} |
||||
} |
@ -0,0 +1,45 @@
|
||||
package com.hnac.hzims.bigmodel.interactive.controller; |
||||
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
||||
import com.hnac.hzims.bigmodel.BigModelConstants; |
||||
import com.hnac.hzims.bigmodel.interactive.req.ModelFunctionReq; |
||||
import com.hnac.hzims.bigmodel.interactive.service.IInteractiveService; |
||||
import com.hnac.hzinfo.log.annotation.Business; |
||||
import io.swagger.annotations.Api; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import io.swagger.annotations.ApiOperation; |
||||
import io.swagger.annotations.ApiParam; |
||||
import lombok.AllArgsConstructor; |
||||
import org.springblade.core.tool.api.R; |
||||
import org.springframework.web.bind.annotation.*; |
||||
|
||||
import javax.servlet.http.HttpServletRequest; |
||||
|
||||
/** |
||||
* @Author: huangxing |
||||
* @Date: 2024/04/26 14:51 |
||||
*/ |
||||
@RestController |
||||
@AllArgsConstructor |
||||
@Api(value = "FDP大模型交互层",tags = "FDP大模型交互层") |
||||
@RequestMapping("/interactive") |
||||
@Business(module = BigModelConstants.MODULE_NAME,value = "FDP大模型交互层") |
||||
public class InteractiveController { |
||||
|
||||
private final IInteractiveService interactiveService; |
||||
|
||||
@ApiOperation("解析大模型函数") |
||||
@ApiOperationSupport(order = 1) |
||||
@PostMapping("/resolve") |
||||
public R resolve(@RequestBody ModelFunctionReq req) { |
||||
return interactiveService.resolve(req); |
||||
} |
||||
|
||||
@ApiOperation("提问") |
||||
@ApiOperationSupport(order = 2) |
||||
@GetMapping("/ask") |
||||
public R ask(@RequestParam @ApiParam("用户提出问题") String question, HttpServletRequest request) { |
||||
return interactiveService.ask(request, question); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,20 @@
|
||||
package com.hnac.hzims.bigmodel.interactive.service; |
||||
|
||||
import com.hnac.hzims.bigmodel.interactive.req.ModelFunctionReq; |
||||
import io.swagger.annotations.ApiParam; |
||||
import org.springblade.core.tool.api.R; |
||||
import org.springframework.web.bind.annotation.RequestParam; |
||||
|
||||
import javax.servlet.http.HttpServletRequest; |
||||
|
||||
/** |
||||
* @Author: huangxing |
||||
* @Date: 2024/04/26 14:51 |
||||
*/ |
||||
public interface IInteractiveService { |
||||
|
||||
R resolve(ModelFunctionReq req); |
||||
|
||||
R ask(HttpServletRequest request, String question); |
||||
|
||||
} |
@ -0,0 +1,16 @@
|
||||
package com.hnac.hzims.bigmodel.interactive.service; |
||||
|
||||
import com.hnac.hzims.bigmodel.entity.FunctionEntity; |
||||
import com.hnac.hzims.bigmodel.interactive.vo.ExtraVO; |
||||
|
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* @Author: huangxing |
||||
* @Date: 2024/04/26 11:46 |
||||
*/ |
||||
public interface IJumpPageService { |
||||
|
||||
String dealJumpTypeFunction(FunctionEntity function, Map<String,String> args); |
||||
|
||||
} |
@ -0,0 +1,85 @@
|
||||
package com.hnac.hzims.bigmodel.interactive.service.impl; |
||||
|
||||
import cn.hutool.http.HttpRequest; |
||||
import cn.hutool.http.HttpResponse; |
||||
import com.alibaba.fastjson.JSON; |
||||
import com.alibaba.fastjson.JSONObject; |
||||
import com.hnac.hzims.bigmodel.configuration.BigModelInvokeUrl; |
||||
import com.hnac.hzims.bigmodel.entity.FunctionEntity; |
||||
import com.hnac.hzims.bigmodel.interactive.req.ModelFunctionReq; |
||||
import com.hnac.hzims.bigmodel.interactive.service.IInteractiveService; |
||||
import com.hnac.hzims.bigmodel.interactive.service.IJumpPageService; |
||||
import com.hnac.hzims.bigmodel.function.service.IFunctionService; |
||||
import lombok.AllArgsConstructor; |
||||
import lombok.RequiredArgsConstructor; |
||||
import lombok.extern.slf4j.Slf4j; |
||||
import org.springblade.core.log.exception.ServiceException; |
||||
import org.springblade.core.secure.utils.AuthUtil; |
||||
import org.springblade.core.tool.api.R; |
||||
import org.springblade.core.tool.utils.Func; |
||||
import org.springblade.core.tool.utils.StringUtil; |
||||
import org.springframework.beans.factory.annotation.Value; |
||||
import org.springframework.data.redis.core.RedisTemplate; |
||||
import org.springframework.stereotype.Service; |
||||
import org.springframework.util.Assert; |
||||
|
||||
import javax.servlet.http.HttpServletRequest; |
||||
import javax.servlet.http.HttpServletResponse; |
||||
import javax.servlet.http.HttpSession; |
||||
|
||||
import java.util.HashMap; |
||||
import java.util.Map; |
||||
|
||||
import static com.hnac.hzims.bigmodel.interactive.constants.FunctionConstants.*; |
||||
/** |
||||
* @Author: huangxing |
||||
* @Date: 2024/04/26 14:51 |
||||
*/ |
||||
@Service |
||||
@Slf4j |
||||
@RequiredArgsConstructor |
||||
public class InteractiveServiceImpl implements IInteractiveService { |
||||
|
||||
private final IJumpPageService jumpPageService; |
||||
private final IFunctionService functionService; |
||||
private final BigModelInvokeUrl bigModelInvokeUrl; |
||||
@Value("${fdp.host}") |
||||
private String fdpHost; |
||||
|
||||
@Override |
||||
public R resolve(ModelFunctionReq req) { |
||||
//TODO 数据鉴权
|
||||
FunctionEntity function = functionService.getFunctionByCode(req.getFunctionName()); |
||||
TypeEnum typeEnum = TypeEnum.getTypeEnumByType(function.getType()); |
||||
switch (typeEnum) { |
||||
// 页面跳转
|
||||
case JUMP: |
||||
String extra = jumpPageService.dealJumpTypeFunction(function, req.getFunctionArgs()); |
||||
Assert.isTrue(StringUtil.isNotBlank(extra) && Func.isNotEmpty(extra), () -> { |
||||
throw new ServiceException("解析" + function.getName() + "函数失败!"); |
||||
}); |
||||
R.data(extra); |
||||
default: |
||||
throw new ServiceException("函数解析失败!"); |
||||
} |
||||
} |
||||
|
||||
@Override |
||||
public R ask(HttpServletRequest request, String question) { |
||||
HttpSession session = request.getSession(true); |
||||
String sessionId = session.getId(); |
||||
Long userId = AuthUtil.getUserId(); |
||||
//TODO 保存问题
|
||||
Map<String,String> params = new HashMap<>(); |
||||
params.put("id",sessionId); |
||||
params.put("userid",userId.toString()); |
||||
params.put("query",question); |
||||
HttpResponse response = HttpRequest.post(fdpHost + bigModelInvokeUrl.getAssistantAsk()) |
||||
.body(JSON.toJSONString(params)).execute(); |
||||
Assert.isTrue(response.getStatus() == HttpServletResponse.SC_OK && "1".equals(JSONObject.parseObject(response.body()).getString("success")), () -> { |
||||
throw new ServiceException("远程调用大模型【发起问答】接口失败!"); |
||||
}); |
||||
return R.data(JSONObject.parseObject(response.body()).getString("data")); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,54 @@
|
||||
package com.hnac.hzims.bigmodel.interactive.service.impl; |
||||
|
||||
import com.alibaba.fastjson.JSON; |
||||
import com.hnac.hzims.bigmodel.entity.FuncParamEntity; |
||||
import com.hnac.hzims.bigmodel.entity.FunctionEntity; |
||||
import com.hnac.hzims.bigmodel.function.service.IFuncParamService; |
||||
import com.hnac.hzims.bigmodel.interactive.constants.FunctionConstants; |
||||
import com.hnac.hzims.bigmodel.interactive.service.IJumpPageService; |
||||
import com.hnac.hzims.bigmodel.interactive.vo.ExtraVO; |
||||
import lombok.AllArgsConstructor; |
||||
import lombok.extern.slf4j.Slf4j; |
||||
import org.springblade.core.log.exception.ServiceException; |
||||
import org.springblade.core.tool.utils.StringUtil; |
||||
import org.springframework.stereotype.Service; |
||||
import org.springframework.util.Assert; |
||||
|
||||
import java.util.List; |
||||
import java.util.Map; |
||||
import java.util.Optional; |
||||
import java.util.Set; |
||||
|
||||
/** |
||||
* @Author: huangxing |
||||
* @Date: 2024/04/26 11:46 |
||||
*/ |
||||
@Service |
||||
@AllArgsConstructor |
||||
@Slf4j |
||||
public class JumpPageServiceImpl implements IJumpPageService { |
||||
|
||||
private final IFuncParamService paramService; |
||||
|
||||
@Override |
||||
public String dealJumpTypeFunction(FunctionEntity function,Map<String,String> args) { |
||||
List<FuncParamEntity> params = paramService.getParamsByFuncId(function.getId()); |
||||
Optional<FuncParamEntity> paramOptional = params.stream().filter(p -> !args.containsKey(p)).findAny(); |
||||
Assert.isTrue(!paramOptional.isPresent(), () -> { |
||||
throw new ServiceException("解析参数失败,缺少参数:" + paramOptional.get().getName()); |
||||
}); |
||||
// 跳转页面逻辑
|
||||
ExtraVO extraVO = new ExtraVO(); |
||||
String path = function.getPath(); |
||||
Set<Map.Entry<String, String>> entries = args.entrySet(); |
||||
// 替换path中变量
|
||||
for (Map.Entry<String, String> entry : entries) { |
||||
String replaceVariables = "{" + entry.getKey() + "}"; |
||||
path = StringUtil.replace(path,replaceVariables,entry.getValue()); |
||||
} |
||||
extraVO.setType(FunctionConstants.TypeEnum.JUMP.getType()); |
||||
extraVO.setRoute(path); |
||||
// TODO 将结果存入redis中供前端获取
|
||||
return JSON.toJSONString(extraVO); |
||||
} |
||||
} |
@ -0,0 +1,58 @@
|
||||
package com.hnac.hzims.bigmodel.schedule; |
||||
|
||||
import com.alibaba.fastjson.JSON; |
||||
import com.hnac.hzims.bigmodel.websocket.server.InteractiveWsServer; |
||||
import com.hnac.hzims.bigmodel.websocket.service.InteractiveWsService; |
||||
import com.hnac.hzims.bigmodel.websocket.sessionManager.InteractiveSessionManager; |
||||
import com.xxl.job.core.biz.model.ReturnT; |
||||
import com.xxl.job.core.handler.annotation.XxlJob; |
||||
import lombok.AllArgsConstructor; |
||||
import org.springblade.core.log.exception.ServiceException; |
||||
import org.springblade.core.tool.utils.Func; |
||||
import org.springblade.system.cache.ParamCache; |
||||
import org.springframework.data.redis.core.RedisTemplate; |
||||
import org.springframework.stereotype.Component; |
||||
import org.springframework.util.Assert; |
||||
import org.springframework.web.socket.TextMessage; |
||||
import org.springframework.web.socket.WebSocketSession; |
||||
|
||||
import java.util.List; |
||||
import java.util.Set; |
||||
|
||||
import static com.hnac.hzims.bigmodel.schedule.XxlJobHandlerConstant.*; |
||||
|
||||
/** |
||||
* @Author: huangxing |
||||
* @Date: 2024/04/28 16:18 |
||||
*/ |
||||
@Component |
||||
@AllArgsConstructor |
||||
public class InteractiveSchedule { |
||||
|
||||
private final RedisTemplate redisTemplate; |
||||
private final InteractiveWsService wsService; |
||||
|
||||
@XxlJob(GET_INTERACTIVE_RESULT) |
||||
public ReturnT execute(String params) { |
||||
String resultKey = ParamCache.getValue(GET_INTERACTIVE_RESULT); |
||||
Set<String> keySet = redisTemplate.keys(resultKey + "*"); |
||||
keySet.parallelStream().forEach(key -> { |
||||
// 根据Key获取sessionId
|
||||
List<String> keySplits = Func.toStrList(":", key); |
||||
String sessionId = keySplits.get(2); |
||||
// 查询websocket是否存在连接session
|
||||
WebSocketSession session = InteractiveSessionManager.get(sessionId); |
||||
if(session == null) { |
||||
return; |
||||
} |
||||
TextMessage message = new TextMessage(JSON.toJSONString(redisTemplate.opsForValue().get(key))); |
||||
Boolean sendResult = wsService.sendMessage(sessionId, message); |
||||
Assert.isTrue(sendResult, () -> { |
||||
throw new ServiceException(key + "推送消息失败,推送消息体为:" + JSON.toJSONString(redisTemplate.opsForValue().get(key))); |
||||
}); |
||||
redisTemplate.delete(key); |
||||
}); |
||||
return ReturnT.SUCCESS; |
||||
} |
||||
|
||||
} |
@ -0,0 +1,13 @@
|
||||
package com.hnac.hzims.bigmodel.schedule; |
||||
|
||||
/** |
||||
* @Author: huangxing |
||||
* @Date: 2024/04/28 16:19 |
||||
*/ |
||||
public interface XxlJobHandlerConstant { |
||||
|
||||
String GET_INTERACTIVE_RESULT = "getInteractiveResult"; |
||||
|
||||
String INTERACTIVE_RESULT_KEY = "hzllm:interactive:result"; |
||||
|
||||
} |
@ -0,0 +1,28 @@
|
||||
package com.hnac.hzims.bigmodel.websocket.config; |
||||
|
||||
import com.hnac.hzims.bigmodel.websocket.handler.InteractiveHandler; |
||||
import org.springframework.context.annotation.Bean; |
||||
import org.springframework.context.annotation.Configuration; |
||||
import org.springframework.web.socket.WebSocketHandler; |
||||
import org.springframework.web.socket.config.annotation.EnableWebSocket; |
||||
import org.springframework.web.socket.config.annotation.WebSocketConfigurer; |
||||
import org.springframework.web.socket.config.annotation.WebSocketHandlerRegistry; |
||||
|
||||
/** |
||||
* @Author: huangxing |
||||
* @Date: 2024/04/28 13:39 |
||||
*/ |
||||
@Configuration |
||||
@EnableWebSocket |
||||
public class WebSocketConfig implements WebSocketConfigurer { |
||||
|
||||
@Override |
||||
public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) { |
||||
registry.addHandler(interactiveHandler(), "/interactive/{sessionId}").setAllowedOrigins("*"); |
||||
} |
||||
@Bean |
||||
public WebSocketHandler interactiveHandler() { |
||||
return new InteractiveHandler(); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,41 @@
|
||||
package com.hnac.hzims.bigmodel.websocket.handler; |
||||
|
||||
import com.hnac.hzims.bigmodel.websocket.sessionManager.InteractiveSessionManager; |
||||
import lombok.extern.slf4j.Slf4j; |
||||
import org.springframework.web.socket.CloseStatus; |
||||
import org.springframework.web.socket.TextMessage; |
||||
import org.springframework.web.socket.WebSocketSession; |
||||
import org.springframework.web.socket.handler.TextWebSocketHandler; |
||||
|
||||
/** |
||||
* @Author: huangxing |
||||
* @Date: 2024/04/28 13:45 |
||||
*/ |
||||
@Slf4j |
||||
public class InteractiveHandler extends TextWebSocketHandler { |
||||
@Override |
||||
public void afterConnectionEstablished(WebSocketSession session) { |
||||
String[] split = session.getUri().toString().split("/"); |
||||
String sessionId = split[split.length - 1]; |
||||
session.getAttributes().put("sessionId", sessionId); |
||||
InteractiveSessionManager.add(sessionId, session); |
||||
log.info("sessionId: " + session.getId()); |
||||
log.info("uri: " + session.getUri()); |
||||
log.info("session connection successful!"); |
||||
} |
||||
|
||||
@Override |
||||
public void afterConnectionClosed(WebSocketSession session, CloseStatus status) { |
||||
String[] split = session.getUri().toString().split("/"); |
||||
String sessionId = split[split.length - 1]; |
||||
InteractiveSessionManager.removeAndClose(sessionId); |
||||
log.info("sessionId: " + session.getId()); |
||||
log.info("uri: " + session.getUri()); |
||||
log.info("session closed successful!"); |
||||
} |
||||
|
||||
@Override |
||||
protected void handleTextMessage(WebSocketSession session, TextMessage message) { |
||||
log.info("message handle successful!"); |
||||
} |
||||
} |
@ -0,0 +1,9 @@
|
||||
package com.hnac.hzims.bigmodel.websocket.server; |
||||
|
||||
/** |
||||
* @Author: huangxing |
||||
* @Date: 2024/04/28 13:38 |
||||
*/ |
||||
public class InteractiveWsServer { |
||||
|
||||
} |
@ -0,0 +1,32 @@
|
||||
package com.hnac.hzims.bigmodel.websocket.service; |
||||
|
||||
import com.alibaba.fastjson.JSON; |
||||
import com.hnac.hzims.bigmodel.websocket.sessionManager.InteractiveSessionManager; |
||||
import lombok.extern.slf4j.Slf4j; |
||||
import org.springblade.core.log.exception.ServiceException; |
||||
import org.springframework.stereotype.Service; |
||||
import org.springframework.web.socket.TextMessage; |
||||
import org.springframework.web.socket.WebSocketSession; |
||||
|
||||
import java.io.IOException; |
||||
|
||||
/** |
||||
* @Author: huangxing |
||||
* @Date: 2024/04/28 14:35 |
||||
*/ |
||||
@Service |
||||
@Slf4j |
||||
public class InteractiveWsService implements WebSocketService { |
||||
|
||||
@Override |
||||
public Boolean sendMessage(String signage, TextMessage message) { |
||||
WebSocketSession session = InteractiveSessionManager.get(signage); |
||||
try { |
||||
session.sendMessage(message); |
||||
return true; |
||||
} catch (IOException e) { |
||||
log.error("消息推送失败,推送sessionId为:" + signage + ";消息体为:" + JSON.toJSONString(message)); |
||||
return false; |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,13 @@
|
||||
package com.hnac.hzims.bigmodel.websocket.service; |
||||
|
||||
import org.springframework.web.socket.TextMessage; |
||||
|
||||
/** |
||||
* @Author: huangxing |
||||
* @Date: 2024/04/28 14:37 |
||||
*/ |
||||
public interface WebSocketService { |
||||
|
||||
Boolean sendMessage(String signage, TextMessage message); |
||||
|
||||
} |
@ -0,0 +1,56 @@
|
||||
package com.hnac.hzims.bigmodel.websocket.sessionManager; |
||||
|
||||
import org.springframework.web.socket.WebSocketSession; |
||||
|
||||
import java.io.IOException; |
||||
import java.util.concurrent.ConcurrentHashMap; |
||||
import java.util.concurrent.locks.Lock; |
||||
import java.util.concurrent.locks.ReentrantLock; |
||||
|
||||
/** |
||||
* @Author: huangxing |
||||
* @Date: 2024/04/28 13:58 |
||||
*/ |
||||
public class InteractiveSessionManager { |
||||
/** ws会话池 **/ |
||||
public static ConcurrentHashMap<String, WebSocketSession> SESSION_POOL = new ConcurrentHashMap<>(); |
||||
|
||||
private static final Lock lock = new ReentrantLock(); |
||||
|
||||
/** |
||||
* 添加会话 |
||||
* @param sessionId 会话ID |
||||
* @param session 会话对象 |
||||
*/ |
||||
public static void add(String sessionId, WebSocketSession session) { |
||||
if (SESSION_POOL.containsKey(sessionId)) { |
||||
InteractiveSessionManager.removeAndClose(sessionId); |
||||
} |
||||
SESSION_POOL.put(sessionId, session); |
||||
} |
||||
|
||||
/** |
||||
* 获取ws会话 |
||||
* @param sessionId 会话ID |
||||
*/ |
||||
public static WebSocketSession get(String sessionId) { |
||||
return SESSION_POOL.get(sessionId); |
||||
} |
||||
|
||||
/** |
||||
* 移除ws会话并关闭会话 |
||||
* @param sessionId 会话ID |
||||
*/ |
||||
public static void removeAndClose(String sessionId) { |
||||
WebSocketSession session = SESSION_POOL.get(sessionId); |
||||
if (session != null) { |
||||
try { |
||||
//关闭连接
|
||||
session.close(); |
||||
} catch (IOException ex) { |
||||
throw new RuntimeException("关闭ws会话失败!", ex); |
||||
} |
||||
} |
||||
SESSION_POOL.remove(sessionId); |
||||
} |
||||
} |
@ -0,0 +1,34 @@
|
||||
CREATE TABLE IF NOT EXISTS `hzims_function` ( |
||||
`ID` bigint(20) NOT NULL COMMENT '主键ID', |
||||
`NAME` varchar(50) COLLATE utf8mb4_bin NOT NULL COMMENT '函数名称', |
||||
`CODE` varchar(25) COLLATE utf8mb4_bin NOT NULL COMMENT '函数编号', |
||||
`TYPE` varchar(25) COLLATE utf8mb4_bin NOT NULL COMMENT '动作类型', |
||||
`IS_CONFIRM` tinyint(1) DEFAULT '0' COMMENT '是否需要确认,0:否,1:是', |
||||
`PATH` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '跳转路径', |
||||
`REMAKE` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '描述', |
||||
`TENANT_ID` varchar(12) CHARACTER SET utf8 DEFAULT NULL COMMENT '租户ID', |
||||
`STATUS` bigint(1) DEFAULT NULL COMMENT '状态', |
||||
`CREATE_DEPT` bigint(20) DEFAULT NULL COMMENT '创建单位', |
||||
`CREATE_USER` bigint(20) DEFAULT NULL COMMENT '创建人', |
||||
`CREATE_TIME` datetime DEFAULT NULL COMMENT '创建时间', |
||||
`UPDATE_USER` bigint(20) DEFAULT NULL COMMENT '修改人', |
||||
`UPDATE_TIME` datetime DEFAULT NULL COMMENT '更新时间', |
||||
`IS_DELETED` tinyint(4) NOT NULL COMMENT '是否删除', |
||||
PRIMARY KEY (`ID`) USING BTREE |
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='模型函数'; |
||||
|
||||
CREATE TABLE IF NOT EXISTS `hzims_func_param` ( |
||||
`ID` bigint(20) NOT NULL COMMENT '主键ID', |
||||
`FUNC_ID` bigint(20) NOT NULL COMMENT '主键ID', |
||||
`NAME` varchar(50) COLLATE utf8mb4_bin NOT NULL COMMENT '参数名称', |
||||
`ALIAS` varchar(25) COLLATE utf8mb4_bin NOT NULL COMMENT '参数别名', |
||||
`TENANT_ID` varchar(12) CHARACTER SET utf8 DEFAULT NULL COMMENT '租户ID', |
||||
`STATUS` bigint(1) DEFAULT NULL COMMENT '状态', |
||||
`CREATE_DEPT` bigint(20) DEFAULT NULL COMMENT '创建单位', |
||||
`CREATE_USER` bigint(20) DEFAULT NULL COMMENT '创建人', |
||||
`CREATE_TIME` datetime DEFAULT NULL COMMENT '创建时间', |
||||
`UPDATE_USER` bigint(20) DEFAULT NULL COMMENT '修改人', |
||||
`UPDATE_TIME` datetime DEFAULT NULL COMMENT '更新时间', |
||||
`IS_DELETED` tinyint(4) NOT NULL COMMENT '是否删除', |
||||
PRIMARY KEY (`ID`) USING BTREE |
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='模型函数参数'; |
@ -0,0 +1,15 @@
|
||||
package com.hnac.hzinfo.inspect.showTempalte.mapper; |
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.hnac.hzinfo.inspect.task.entity.EventRecordTemplateEntity; |
||||
|
||||
/** |
||||
* @ClassName EventRecordTemplateMapper |
||||
* @description: |
||||
* @author: hx |
||||
* @create: 2023-10-12 15:08 |
||||
* @Version 4.0 |
||||
**/ |
||||
public interface EventRecordTemplateMapper extends BaseMapper<EventRecordTemplateEntity> { |
||||
|
||||
} |
@ -0,0 +1,8 @@
|
||||
package com.hnac.hzinfo.inspect.showTempalte.mapper; |
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.hnac.hzinfo.inspect.task.entity.EventTemplateEntity; |
||||
|
||||
public interface EventTemplateMapper extends BaseMapper<EventTemplateEntity> { |
||||
|
||||
} |
@ -0,0 +1,15 @@
|
||||
package com.hnac.hzinfo.inspect.showTempalte.mapper; |
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.hnac.hzinfo.inspect.showTemplate.entity.PlanTemplateEntity; |
||||
|
||||
/** |
||||
* @ClassName PlanTemplateMapper |
||||
* @description: |
||||
* @author: hx |
||||
* @create: 2023-10-12 10:16 |
||||
* @Version 4.0 |
||||
**/ |
||||
public interface PlanTemplateMapper extends BaseMapper<PlanTemplateEntity> { |
||||
|
||||
} |
@ -0,0 +1,10 @@
|
||||
package com.hnac.hzinfo.inspect.showTempalte.mapper; |
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.hnac.hzinfo.inspect.showTemplate.entity.TaskObjectProjectContentTemplateEntity; |
||||
|
||||
public interface TaskObjectProjectContentTemplateMapper extends BaseMapper<TaskObjectProjectContentTemplateEntity> { |
||||
|
||||
|
||||
|
||||
} |
@ -0,0 +1,9 @@
|
||||
package com.hnac.hzinfo.inspect.showTempalte.mapper; |
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.hnac.hzinfo.inspect.showTemplate.entity.TaskObjectProjectTemplateEntity; |
||||
|
||||
public interface TaskObjectProjectTemplateMapper extends BaseMapper<TaskObjectProjectTemplateEntity> { |
||||
|
||||
|
||||
} |
@ -0,0 +1,8 @@
|
||||
package com.hnac.hzinfo.inspect.showTempalte.mapper; |
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.hnac.hzinfo.inspect.showTemplate.entity.TaskObjectTemplateEntity; |
||||
|
||||
public interface TaskObjectTemplateMapper extends BaseMapper<TaskObjectTemplateEntity> { |
||||
|
||||
} |
@ -0,0 +1,8 @@
|
||||
package com.hnac.hzinfo.inspect.showTempalte.mapper; |
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.hnac.hzinfo.inspect.showTemplate.entity.TaskTemplateEntity; |
||||
|
||||
public interface TaskTemplateMapper extends BaseMapper<TaskTemplateEntity> { |
||||
|
||||
} |
@ -0,0 +1,8 @@
|
||||
package com.hnac.hzinfo.inspect.showTempalte.service; |
||||
|
||||
import com.hnac.hzinfo.inspect.task.entity.EventRecordTemplateEntity; |
||||
import org.springblade.core.mp.base.BaseService; |
||||
|
||||
public interface IEventRecordTemplateService extends BaseService<EventRecordTemplateEntity> { |
||||
|
||||
} |
@ -0,0 +1,8 @@
|
||||
package com.hnac.hzinfo.inspect.showTempalte.service; |
||||
|
||||
import com.hnac.hzinfo.inspect.task.entity.EventTemplateEntity; |
||||
import org.springblade.core.mp.base.BaseService; |
||||
|
||||
public interface IEventTemplateService extends BaseService<EventTemplateEntity> { |
||||
|
||||
} |
@ -0,0 +1,15 @@
|
||||
package com.hnac.hzinfo.inspect.showTempalte.service; |
||||
|
||||
import com.hnac.hzinfo.inspect.showTemplate.entity.PlanTemplateEntity; |
||||
import org.springblade.core.mp.base.BaseService; |
||||
|
||||
/** |
||||
* @ClassName IPlanTemplateService |
||||
* @description: |
||||
* @author: hx |
||||
* @create: 2023-10-12 10:18 |
||||
* @Version 4.0 |
||||
**/ |
||||
public interface IPlanTemplateService extends BaseService<PlanTemplateEntity> { |
||||
|
||||
} |
@ -0,0 +1,15 @@
|
||||
package com.hnac.hzinfo.inspect.showTempalte.service; |
||||
|
||||
import com.hnac.hzinfo.inspect.showTemplate.entity.TaskObjectProjectContentTemplateEntity; |
||||
import org.springblade.core.mp.base.BaseService; |
||||
|
||||
/** |
||||
* @ClassName ITaskObjectProjectContentTemplateService |
||||
* @description: |
||||
* @author: hx |
||||
* @create: 2023-10-12 14:53 |
||||
* @Version 4.0 |
||||
**/ |
||||
public interface ITaskObjectProjectContentTemplateService extends BaseService<TaskObjectProjectContentTemplateEntity> { |
||||
|
||||
} |
@ -0,0 +1,8 @@
|
||||
package com.hnac.hzinfo.inspect.showTempalte.service; |
||||
|
||||
import com.hnac.hzinfo.inspect.showTemplate.entity.TaskObjectProjectTemplateEntity; |
||||
import org.springblade.core.mp.base.BaseService; |
||||
|
||||
public interface ITaskObjectProjectTemplateService extends BaseService<TaskObjectProjectTemplateEntity> { |
||||
|
||||
} |
@ -0,0 +1,7 @@
|
||||
package com.hnac.hzinfo.inspect.showTempalte.service; |
||||
|
||||
import com.hnac.hzinfo.inspect.showTemplate.entity.TaskObjectTemplateEntity; |
||||
import org.springblade.core.mp.base.BaseService; |
||||
|
||||
public interface ITaskObjectTemplateService extends BaseService<TaskObjectTemplateEntity> { |
||||
} |
@ -0,0 +1,7 @@
|
||||
package com.hnac.hzinfo.inspect.showTempalte.service; |
||||
|
||||
import com.hnac.hzinfo.inspect.showTemplate.entity.TaskTemplateEntity; |
||||
import org.springblade.core.mp.base.BaseService; |
||||
|
||||
public interface ITaskTemplateService extends BaseService<TaskTemplateEntity> { |
||||
} |
@ -0,0 +1,19 @@
|
||||
package com.hnac.hzinfo.inspect.showTempalte.service.impl; |
||||
|
||||
import com.hnac.hzinfo.inspect.showTempalte.mapper.EventRecordTemplateMapper; |
||||
import com.hnac.hzinfo.inspect.showTempalte.service.IEventRecordTemplateService; |
||||
import com.hnac.hzinfo.inspect.task.entity.EventRecordTemplateEntity; |
||||
import org.springblade.core.mp.base.BaseServiceImpl; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
/** |
||||
* @ClassName EventRecordTemplateServiceImpl |
||||
* @description: |
||||
* @author: hx |
||||
* @create: 2023-10-12 15:16 |
||||
* @Version 4.0 |
||||
**/ |
||||
@Service |
||||
public class EventRecordTemplateServiceImpl extends BaseServiceImpl<EventRecordTemplateMapper, EventRecordTemplateEntity> implements IEventRecordTemplateService { |
||||
|
||||
} |
@ -0,0 +1,19 @@
|
||||
package com.hnac.hzinfo.inspect.showTempalte.service.impl; |
||||
|
||||
import com.hnac.hzinfo.inspect.showTempalte.mapper.EventTemplateMapper; |
||||
import com.hnac.hzinfo.inspect.showTempalte.service.IEventTemplateService; |
||||
import com.hnac.hzinfo.inspect.task.entity.EventTemplateEntity; |
||||
import org.springblade.core.mp.base.BaseServiceImpl; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
/** |
||||
* @ClassName EventTemplateServiceImpl |
||||
* @description: |
||||
* @author: hx |
||||
* @create: 2023-10-12 15:11 |
||||
* @Version 4.0 |
||||
**/ |
||||
@Service |
||||
public class EventTemplateServiceImpl extends BaseServiceImpl<EventTemplateMapper,EventTemplateEntity> implements IEventTemplateService { |
||||
|
||||
} |
@ -0,0 +1,20 @@
|
||||
package com.hnac.hzinfo.inspect.showTempalte.service.impl; |
||||
|
||||
import com.hnac.hzinfo.inspect.showTempalte.mapper.PlanTemplateMapper; |
||||
import com.hnac.hzinfo.inspect.showTempalte.service.IPlanTemplateService; |
||||
import com.hnac.hzinfo.inspect.showTemplate.entity.PlanTemplateEntity; |
||||
import org.springblade.core.mp.base.BaseServiceImpl; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
/** |
||||
* @ClassName PlanTemplateServiceImpl |
||||
* @description: |
||||
* @author: hx |
||||
* @create: 2023-10-12 10:18 |
||||
* @Version 4.0 |
||||
**/ |
||||
@Service |
||||
public class PlanTemplateServiceImpl extends BaseServiceImpl<PlanTemplateMapper, PlanTemplateEntity> implements IPlanTemplateService { |
||||
|
||||
|
||||
} |
@ -0,0 +1,19 @@
|
||||
package com.hnac.hzinfo.inspect.showTempalte.service.impl; |
||||
|
||||
import com.hnac.hzinfo.inspect.showTempalte.mapper.TaskObjectProjectContentTemplateMapper; |
||||
import com.hnac.hzinfo.inspect.showTempalte.service.ITaskObjectProjectContentTemplateService; |
||||
import com.hnac.hzinfo.inspect.showTemplate.entity.TaskObjectProjectContentTemplateEntity; |
||||
import org.springblade.core.mp.base.BaseServiceImpl; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
/** |
||||
* @ClassName TaskObjectProjectContentTemplateServiceImpl |
||||
* @description: |
||||
* @author: hx |
||||
* @create: 2023-10-12 14:54 |
||||
* @Version 4.0 |
||||
**/ |
||||
@Service |
||||
public class TaskObjectProjectContentTemplateServiceImpl extends BaseServiceImpl<TaskObjectProjectContentTemplateMapper, TaskObjectProjectContentTemplateEntity> implements ITaskObjectProjectContentTemplateService { |
||||
|
||||
} |
@ -0,0 +1,16 @@
|
||||
package com.hnac.hzinfo.inspect.showTempalte.service.impl; |
||||
|
||||
import com.hnac.hzinfo.inspect.showTempalte.mapper.TaskObjectProjectTemplateMapper; |
||||
import com.hnac.hzinfo.inspect.showTempalte.service.ITaskObjectProjectTemplateService; |
||||
import com.hnac.hzinfo.inspect.showTemplate.entity.TaskObjectProjectTemplateEntity; |
||||
import lombok.AllArgsConstructor; |
||||
import lombok.extern.slf4j.Slf4j; |
||||
import org.springblade.core.mp.base.BaseServiceImpl; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
@Service |
||||
@AllArgsConstructor |
||||
@Slf4j |
||||
public class TaskObjectProjectTemplateServiceImpl extends BaseServiceImpl<TaskObjectProjectTemplateMapper, TaskObjectProjectTemplateEntity> implements ITaskObjectProjectTemplateService { |
||||
|
||||
} |
@ -0,0 +1,19 @@
|
||||
package com.hnac.hzinfo.inspect.showTempalte.service.impl; |
||||
|
||||
import com.hnac.hzinfo.inspect.showTempalte.mapper.TaskObjectTemplateMapper; |
||||
import com.hnac.hzinfo.inspect.showTempalte.service.ITaskObjectTemplateService; |
||||
import com.hnac.hzinfo.inspect.showTemplate.entity.TaskObjectTemplateEntity; |
||||
import org.springblade.core.mp.base.BaseServiceImpl; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
/** |
||||
* @ClassName TaskObjectTemplateServiceImpl |
||||
* @description: |
||||
* @author: hx |
||||
* @create: 2023-10-12 13:34 |
||||
* @Version 4.0 |
||||
**/ |
||||
@Service |
||||
public class TaskObjectTemplateServiceImpl extends BaseServiceImpl<TaskObjectTemplateMapper, TaskObjectTemplateEntity> implements ITaskObjectTemplateService { |
||||
|
||||
} |
@ -0,0 +1,17 @@
|
||||
package com.hnac.hzinfo.inspect.showTempalte.service.impl; |
||||
|
||||
|
||||
import com.hnac.hzinfo.inspect.showTempalte.mapper.TaskTemplateMapper; |
||||
import com.hnac.hzinfo.inspect.showTempalte.service.ITaskTemplateService; |
||||
import com.hnac.hzinfo.inspect.showTemplate.entity.TaskTemplateEntity; |
||||
import lombok.AllArgsConstructor; |
||||
import lombok.extern.slf4j.Slf4j; |
||||
import org.springblade.core.mp.base.BaseServiceImpl; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
@Service |
||||
@AllArgsConstructor |
||||
@Slf4j |
||||
public class TaskTemplateServiceImpl extends BaseServiceImpl<TaskTemplateMapper, TaskTemplateEntity> implements ITaskTemplateService { |
||||
|
||||
} |
@ -0,0 +1,39 @@
|
||||
package com.hnac.hzinfo.inspect.task.controller; |
||||
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
||||
import com.hnac.hzinfo.inspect.request.GenerateTaskVO; |
||||
import com.hnac.hzinfo.inspect.task.service.ICreateTaskService; |
||||
import io.swagger.annotations.Api; |
||||
import io.swagger.annotations.ApiOperation; |
||||
import lombok.AllArgsConstructor; |
||||
import org.springblade.core.boot.ctrl.BladeController; |
||||
import org.springblade.core.tool.api.R; |
||||
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; |
||||
|
||||
/** |
||||
* @ClassName CreateTaskController |
||||
* @description: |
||||
* @author: hx |
||||
* @create: 2023-10-12 17:31 |
||||
* @Version 4.0 |
||||
**/ |
||||
@RestController |
||||
@RequestMapping("/create/task") |
||||
@AllArgsConstructor |
||||
@Api(value = "创建巡检任务管理",tags = "创建巡检任务管理") |
||||
public class CreateTaskController extends BladeController { |
||||
|
||||
private final ICreateTaskService createTaskService; |
||||
|
||||
@PostMapping("/createShowTask") |
||||
@ApiOperation("生成演示数据") |
||||
@ApiOperationSupport(order = 1) |
||||
public R createShowTask(@RequestBody GenerateTaskVO request) { |
||||
createTaskService.createShowTask(request); |
||||
return R.success("成功!"); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,20 @@
|
||||
package com.hnac.hzinfo.inspect.task.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import io.swagger.annotations.ApiModel; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
|
||||
import java.io.Serializable; |
||||
|
||||
@Data |
||||
@TableName("hz_st_ex_event_record_template") |
||||
@EqualsAndHashCode(callSuper = true) |
||||
@ApiModel(value = "巡检情况对象-演示模板", description = "") |
||||
public class EventRecordTemplateEntity extends EventRecordEntity implements Serializable { |
||||
|
||||
@ApiModelProperty("是否启用") |
||||
private Boolean enable; |
||||
|
||||
} |
@ -0,0 +1,27 @@
|
||||
package com.hnac.hzinfo.inspect.task.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import io.swagger.annotations.ApiModel; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
|
||||
import java.io.Serializable; |
||||
|
||||
/** |
||||
* @ClassName EventTemplateEntity |
||||
* @description: |
||||
* @author: hx |
||||
* @create: 2023-10-12 15:04 |
||||
* @Version 4.0 |
||||
**/ |
||||
@Data |
||||
@TableName("hz_st_ex_event_template") |
||||
@EqualsAndHashCode(callSuper = true) |
||||
@ApiModel(value = "巡检任务情况-演示数据模板", description = "巡检任务情况-演示数据模板") |
||||
public class EventTemplateEntity extends EventEntity implements Serializable { |
||||
|
||||
@ApiModelProperty("是否启用") |
||||
private Boolean enable; |
||||
|
||||
} |
@ -0,0 +1,9 @@
|
||||
package com.hnac.hzinfo.inspect.task.service; |
||||
|
||||
import com.hnac.hzinfo.inspect.request.GenerateTaskVO; |
||||
|
||||
public interface ICreateTaskService { |
||||
|
||||
void createShowTask(GenerateTaskVO request); |
||||
|
||||
} |
@ -0,0 +1,269 @@
|
||||
package com.hnac.hzinfo.inspect.task.service.impl; |
||||
|
||||
import com.alibaba.fastjson.JSON; |
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
||||
import com.google.common.collect.Lists; |
||||
import com.hnac.hzinfo.inspect.obj.utils.CodeUtils; |
||||
import com.hnac.hzinfo.inspect.plan.entity.PlanEntity; |
||||
import com.hnac.hzinfo.inspect.plan.service.IPlanService; |
||||
import com.hnac.hzinfo.inspect.request.GenerateTaskVO; |
||||
import com.hnac.hzinfo.inspect.showTempalte.service.*; |
||||
import com.hnac.hzinfo.inspect.showTemplate.entity.*; |
||||
import com.hnac.hzinfo.inspect.task.entity.*; |
||||
import com.hnac.hzinfo.inspect.task.service.*; |
||||
import lombok.AllArgsConstructor; |
||||
import lombok.extern.slf4j.Slf4j; |
||||
import org.springblade.core.tool.utils.BeanUtil; |
||||
import org.springblade.core.tool.utils.CollectionUtil; |
||||
import org.springblade.core.tool.utils.DateUtil; |
||||
import org.springblade.system.user.entity.User; |
||||
import org.springblade.system.user.feign.IUserClient; |
||||
import org.springframework.stereotype.Service; |
||||
import org.springframework.transaction.annotation.Transactional; |
||||
|
||||
import java.time.LocalDate; |
||||
import java.time.LocalDateTime; |
||||
import java.time.LocalTime; |
||||
import java.util.List; |
||||
import java.util.Optional; |
||||
import java.util.stream.Collectors; |
||||
|
||||
/** |
||||
* @ClassName CreateTaskServiceImpl |
||||
* @description: |
||||
* @author: hx |
||||
* @create: 2023-10-12 09:20 |
||||
* @Version 4.0 |
||||
**/ |
||||
@Service |
||||
@Slf4j |
||||
@AllArgsConstructor |
||||
public class CreateTaskServiceImpl implements ICreateTaskService { |
||||
|
||||
private final IUserClient userClient; |
||||
private final IPlanTemplateService planTemplateService; |
||||
private final IPlanService planService; |
||||
private final ITaskTemplateService taskTemplateService; |
||||
private final ITaskService taskService; |
||||
private final ITaskUserService taskUserService; |
||||
private final ITaskObjectTemplateService taskObjectTemplateService; |
||||
private final ITaskObjectService taskObjectService; |
||||
private final ITaskObjectProjectTemplateService taskObjectProjectTemplateService; |
||||
private final ITaskObjectProjectService taskObjectProjectService; |
||||
private final ITaskObjectProjectContentTemplateService taskObjectProjectContentTemplateService; |
||||
private final ITaskObjectProjectContentService taskObjectProjectContentService; |
||||
private final IEventTemplateService eventTemplateService; |
||||
private final IEventService eventService; |
||||
private final IEventRecordTemplateService eventRecordTemplateService; |
||||
private final IEventRecordService eventRecordService; |
||||
|
||||
|
||||
@Override |
||||
@Transactional |
||||
public void createShowTask(GenerateTaskVO request) { |
||||
// R<List<User>> userListR = userClient.userListByDeptId(request.getAreaDeptId());
|
||||
// Assert.isTrue(userListR.isSuccess() && CollectionUtil.isNotEmpty(userListR.getData()),() ->{
|
||||
// throw new ServiceException("获取当前机构下用户列表失败!");
|
||||
// });
|
||||
// List<User> userList = userListR.getData();
|
||||
User user = new User(); |
||||
user.setId(1699662065616064514L); |
||||
List<User> userList = Lists.newArrayList(user); |
||||
List<PlanTemplateEntity> planList = planTemplateService.list(Wrappers.<PlanTemplateEntity>lambdaQuery().eq(PlanTemplateEntity::getEnable, true)); |
||||
planList.forEach(planTemplate -> this.generateTask(request,planTemplate,userList)); |
||||
} |
||||
|
||||
private void generateTask(GenerateTaskVO request,PlanTemplateEntity planTemplate,List<User> userList) { |
||||
// 创建计划
|
||||
PlanEntity plan = this.convert(request, planTemplate, userList); |
||||
planService.save(plan); |
||||
// 创建任务
|
||||
List<TaskTemplateEntity> taskList = taskTemplateService.list( |
||||
Wrappers.<TaskTemplateEntity>lambdaQuery().eq(TaskTemplateEntity::getPlanId, planTemplate.getId()) |
||||
.eq(TaskTemplateEntity::getEnable, true) |
||||
); |
||||
List<LocalDate> dates = this.dateList(request.getStartDate(), request.getEndDate()); |
||||
if(CollectionUtil.isNotEmpty(dates)) { |
||||
dates.forEach(date -> { |
||||
taskList.forEach(taskTemplate -> { |
||||
TaskEntity task = this.convert(request, taskTemplate, userList,date,plan); |
||||
taskService.save(task); |
||||
// 创建任务执行人员
|
||||
TaskUserEntity taskUser = this.getUserByTaskId(request,task.getId(), userList.get(0).getId(), task.getPlanStartTime()); |
||||
taskUserService.save(taskUser); |
||||
// 创建任务执行对象
|
||||
List<TaskObjectTemplateEntity> taskObjectTemplates = taskObjectTemplateService.list(Wrappers.<TaskObjectTemplateEntity>lambdaQuery().eq(TaskObjectTemplateEntity::getTaskId, taskTemplate.getId()).eq(TaskObjectTemplateEntity::getEnable, true)); |
||||
List<TaskObjectEntity> TaskObjectList = taskObjectTemplates.stream().map(taskObjectTemplate -> this.convert(request, taskObjectTemplate, userList,task.getId(),date)).collect(Collectors.toList()); |
||||
taskObjectService.saveBatch(TaskObjectList); |
||||
// 创建任务执行对象项目关联表
|
||||
List<TaskObjectProjectTemplateEntity> taskObjectProjectTemplates = taskObjectProjectTemplateService.list(Wrappers.<TaskObjectProjectTemplateEntity>lambdaQuery().eq(TaskObjectProjectTemplateEntity::getTaskId, taskTemplate.getId()).eq(TaskObjectProjectTemplateEntity::getEnable, true)); |
||||
List<TaskObjectProjectEntity> taskObjectProjectList = taskObjectProjectTemplates.stream().map(taskObjectProjectTemplate -> this.convert(request, taskObjectProjectTemplate, userList, task.getId(), date)).collect(Collectors.toList()); |
||||
taskObjectProjectService.saveBatch(taskObjectProjectList); |
||||
// 创建任务执行对象内容项目关联表
|
||||
List<TaskObjectProjectContentTemplateEntity> taskObjectProjectContentTemplates = taskObjectProjectContentTemplateService.list(Wrappers.<TaskObjectProjectContentTemplateEntity>lambdaQuery().eq(TaskObjectProjectContentTemplateEntity::getTaskId, taskTemplate.getId()).eq(TaskObjectProjectContentTemplateEntity::getEnable, true)); |
||||
List<TaskObjectProjectContentEntity> taskObjectProjectContentList = taskObjectProjectContentTemplates.stream().map(taskObjectProjectContentTemplate -> this.convert(request, taskObjectProjectContentTemplate, userList, task.getId(), date)).collect(Collectors.toList()); |
||||
taskObjectProjectContentService.saveBatch(taskObjectProjectContentList); |
||||
// 创建任务执行结果表
|
||||
List<EventTemplateEntity> eventTemplates = eventTemplateService.list(Wrappers.<EventTemplateEntity>lambdaQuery().eq(EventTemplateEntity::getTaskId, taskTemplate.getId()).eq(EventTemplateEntity::getEnable, true)); |
||||
eventTemplates.forEach(eventTemplate -> { |
||||
EventEntity event = this.convert(request, eventTemplate, userList, task.getId(), date); |
||||
eventService.save(event); |
||||
List<EventRecordTemplateEntity> eventRecordTemplates = eventRecordTemplateService.list(Wrappers.<EventRecordTemplateEntity>lambdaQuery().eq(EventRecordTemplateEntity::getEventId, eventTemplate.getId()).eq(EventRecordTemplateEntity::getEnable, true)); |
||||
List<EventRecordEntity> eventRecordList = eventRecordTemplates.stream().map(eventRecordTemplate -> this.convert(request, eventRecordTemplate, userList, event.getId(), date)).collect(Collectors.toList()); |
||||
eventRecordService.saveBatch(eventRecordList); |
||||
}); |
||||
}); |
||||
}); |
||||
} |
||||
} |
||||
|
||||
private EventRecordEntity convert(GenerateTaskVO request, EventRecordTemplateEntity eventRecordTemplate, List<User> userList, Long eventId, LocalDate date) { |
||||
EventRecordEntity result = BeanUtil.copy(eventRecordTemplate,EventRecordEntity.class); |
||||
result.setId(null); |
||||
result.setEventId(eventId); |
||||
result.setCreateUser(userList.get(0).getId()); |
||||
result.setCreateDept(request.getAreaDeptId()); |
||||
result.setCreateTime(DateUtil.toDate(LocalDateTime.of(date,LocalTime.MIN))); |
||||
result.setUpdateUser(userList.get(0).getId()); |
||||
result.setCreateTime(DateUtil.toDate(LocalDateTime.of(date,LocalTime.MIN))); |
||||
result.setTenantId(null); |
||||
log.info("转换后的任务对象项目内容为:{}",JSON.toJSONString(result)); |
||||
return result; |
||||
} |
||||
|
||||
private EventEntity convert(GenerateTaskVO request, EventTemplateEntity eventTemplate, List<User> userList, Long taskId, LocalDate date) { |
||||
EventTemplateEntity result = BeanUtil.copy(eventTemplate,EventTemplateEntity.class); |
||||
result.setId(null); |
||||
result.setTaskId(taskId); |
||||
result.setTitle(Optional.ofNullable(result.getTitle()).map(s -> s.replaceAll("stationName",request.getStationName())).orElse(null)); |
||||
result.setDescription(Optional.ofNullable(result.getDescription()).map(s -> s.replaceAll("stationName",request.getStationName())).orElse(null)); |
||||
result.setCreateUser(userList.get(0).getId()); |
||||
result.setCreateDept(request.getAreaDeptId()); |
||||
result.setCreateTime(DateUtil.toDate(LocalDateTime.of(date,LocalTime.MIN))); |
||||
result.setUpdateUser(userList.get(0).getId()); |
||||
result.setCreateTime(DateUtil.toDate(LocalDateTime.of(date,LocalTime.MIN))); |
||||
result.setTenantId(null); |
||||
log.info("转换后的任务对象项目内容为:{}",JSON.toJSONString(result)); |
||||
return result; |
||||
} |
||||
|
||||
private TaskObjectProjectContentEntity convert(GenerateTaskVO request, TaskObjectProjectContentTemplateEntity taskObjectProjectContentTemplate, List<User> userList, Long taskId, LocalDate date) { |
||||
TaskObjectProjectContentEntity result = BeanUtil.copy(taskObjectProjectContentTemplate,TaskObjectProjectContentEntity.class); |
||||
result.setId(null); |
||||
result.setCode(CodeUtils.randomCode()); |
||||
result.setTaskId(taskId); |
||||
result.setName(result.getName().replaceAll("stationName",request.getStationName())); |
||||
result.setCreateUser(userList.get(0).getId()); |
||||
result.setCreateDept(request.getAreaDeptId()); |
||||
result.setCreateTime(DateUtil.toDate(LocalDateTime.of(date,LocalTime.MIN))); |
||||
result.setUpdateUser(userList.get(0).getId()); |
||||
result.setCreateTime(DateUtil.toDate(LocalDateTime.of(date,LocalTime.MIN))); |
||||
result.setTenantId(null); |
||||
log.info("转换后的任务对象项目内容为:{}",JSON.toJSONString(result)); |
||||
return result; |
||||
} |
||||
|
||||
private TaskObjectProjectEntity convert(GenerateTaskVO request, TaskObjectProjectTemplateEntity taskObjectProjectTemplate, List<User> userList, Long taskId, LocalDate date) { |
||||
TaskObjectProjectEntity result = BeanUtil.copy(taskObjectProjectTemplate,TaskObjectProjectEntity.class); |
||||
result.setId(null); |
||||
result.setTaskId(taskId); |
||||
result.setCode(CodeUtils.randomCode()); |
||||
result.setName(result.getName().replaceAll("stationName",request.getStationName())); |
||||
result.setCreateUser(userList.get(0).getId()); |
||||
result.setCreateDept(request.getAreaDeptId()); |
||||
result.setCreateTime(DateUtil.toDate(LocalDateTime.of(date,LocalTime.MIN))); |
||||
result.setUpdateUser(userList.get(0).getId()); |
||||
result.setCreateTime(DateUtil.toDate(LocalDateTime.of(date,LocalTime.MIN))); |
||||
result.setTenantId(null); |
||||
log.info("转换后的任务对象项目为:{}",JSON.toJSONString(result)); |
||||
return result; |
||||
} |
||||
|
||||
private TaskObjectEntity convert(GenerateTaskVO request, TaskObjectTemplateEntity taskObjectTemplate, List<User> userList,Long taskId,LocalDate date) { |
||||
TaskObjectEntity result = BeanUtil.copy(taskObjectTemplate,TaskObjectEntity.class); |
||||
result.setId(null); |
||||
result.setTaskId(taskId); |
||||
result.setCode(CodeUtils.randomCode()); |
||||
result.setName(result.getName().replaceAll("stationName",request.getStationName())); |
||||
result.setCreateUser(userList.get(0).getId()); |
||||
result.setCreateDept(request.getAreaDeptId()); |
||||
result.setCreateTime(DateUtil.toDate(LocalDateTime.of(date,LocalTime.MIN))); |
||||
result.setUpdateUser(userList.get(0).getId()); |
||||
result.setCreateTime(DateUtil.toDate(LocalDateTime.of(date,LocalTime.MIN))); |
||||
result.setTaskId(taskId); |
||||
result.setTenantId(null); |
||||
log.info("转换后的任务对象为:{}",JSON.toJSONString(result)); |
||||
return result; |
||||
} |
||||
|
||||
private TaskUserEntity getUserByTaskId(GenerateTaskVO request,Long taskId,Long userId,LocalDateTime claimTime) { |
||||
TaskUserEntity result = new TaskUserEntity(); |
||||
result.setUserId(userId); |
||||
result.setTaskId(taskId); |
||||
result.setClaimTime(claimTime); |
||||
result.setClaimStatus("1"); |
||||
result.setCreateUser(userId); |
||||
result.setCreateDept(request.getAreaDeptId()); |
||||
result.setCreateTime(DateUtil.toDate(LocalDateTime.of(claimTime.toLocalDate(),LocalTime.MIN))); |
||||
result.setUpdateUser(userId); |
||||
result.setCreateTime(DateUtil.toDate(LocalDateTime.of(claimTime.toLocalDate(),LocalTime.MIN))); |
||||
result.setTenantId(null); |
||||
return result; |
||||
} |
||||
|
||||
private TaskEntity convert(GenerateTaskVO request,TaskTemplateEntity taskTemplate,List<User> userList,LocalDate date,PlanEntity plan) { |
||||
TaskEntity result = BeanUtil.copy(taskTemplate,TaskEntity.class); |
||||
result.setPlanId(plan.getId()); |
||||
result.setPlanName(plan.getName()); |
||||
result.setBatchNumber(DateUtil.format(date,"yyyy_MM_dd")+"N"); |
||||
result.setPlanStartTime(LocalDateTime.of(date,request.getStartTime())); |
||||
result.setPlanEndTime(LocalDateTime.of(date,request.getEndTime())); |
||||
result.setStartTime(LocalDateTime.of(date,request.getStartTime())); |
||||
result.setEndTime(LocalDateTime.of(date,request.getEndTime())); |
||||
result.setCreateUser(userList.get(0).getId()); |
||||
result.setCreateDept(request.getAreaDeptId()); |
||||
result.setCreateTime(DateUtil.toDate(LocalDateTime.of(date,LocalTime.MIN))); |
||||
result.setUpdateUser(userList.get(0).getId()); |
||||
result.setCreateTime(DateUtil.toDate(LocalDateTime.of(date,LocalTime.MIN))); |
||||
result.setStartRemindTime(LocalDateTime.of(date,LocalTime.MIN)); |
||||
result.setEndRemindTime(LocalDateTime.of(date,LocalTime.MAX)); |
||||
result.setTenantId(null); |
||||
result.setId(null); |
||||
log.info("转换后的任务为:{}",JSON.toJSONString(result)); |
||||
return result; |
||||
} |
||||
|
||||
private PlanEntity convert(GenerateTaskVO request,PlanTemplateEntity planTemplate,List<User> userList) { |
||||
PlanEntity result = BeanUtil.copy(planTemplate,PlanEntity.class); |
||||
result.setId(null); |
||||
result.setTenantId(null); |
||||
result.setCode(CodeUtils.randomCode()); |
||||
result.setName(result.getName().replaceAll("stationName",request.getStationName())); |
||||
result.setStartTime(request.getStartDate()); |
||||
result.setEndTime(request.getEndDate()); |
||||
result.setApprover(userList.get(0).getId()); |
||||
result.setApproveTime(LocalDateTime.of(request.getStartDate(),LocalTime.MIN)); |
||||
result.setCreateUser(userList.get(0).getId()); |
||||
result.setCreateDept(request.getAreaDeptId()); |
||||
result.setCreateTime(DateUtil.toDate(LocalDateTime.of(request.getStartDate(),LocalTime.MIN))); |
||||
result.setCreateUser(userList.get(0).getId()); |
||||
result.setUpdateUser(userList.get(0).getId()); |
||||
result.setUpdateTime(DateUtil.toDate(LocalDateTime.of(request.getStartDate(),LocalTime.MIN))); |
||||
result.setRouteData(result.getRouteData().replaceAll("stationName",request.getStationName())); |
||||
result.setRouteName(result.getRouteName().replaceAll("stationName",request.getStationName())); |
||||
result.setExecTimeJson(result.getExecTimeJson().replaceAll("startTime",DateUtil.format(request.getStartTime(),DateUtil.PATTERN_TIME)).replaceAll("endtTime",DateUtil.format(request.getEndTime(),DateUtil.PATTERN_TIME))); |
||||
log.info("转换后的计划为:{}", JSON.toJSONString(result)); |
||||
return result; |
||||
} |
||||
|
||||
private List<LocalDate> dateList(LocalDate startDate,LocalDate endDate) { |
||||
List<LocalDate> result = Lists.newArrayList(); |
||||
do { |
||||
//log.info(DateUtil.format(startDate,DateUtil.PATTERN_DATE));
|
||||
result.add(startDate); |
||||
startDate = startDate.plusDays(1); |
||||
} |
||||
while(startDate.isBefore(endDate.plusDays(1))); |
||||
return result; |
||||
} |
||||
} |
Loading…
Reference in new issue