mirror of
https://gitee.com/orangeform/orange-admin.git
synced 2026-01-17 18:46:36 +08:00
commit:同步2.1版本
This commit is contained in:
@@ -1,216 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
|
||||
<component name="FacetManager">
|
||||
<facet type="Spring" name="Spring">
|
||||
<configuration />
|
||||
</facet>
|
||||
<facet type="web" name="Web">
|
||||
<configuration>
|
||||
<webroots />
|
||||
</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" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/target/generated-sources/annotations" isTestSource="false" generated="true" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/target" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-web:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-logging:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: ch.qos.logback:logback-classic:1.2.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: ch.qos.logback:logback-core:1.2.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-to-slf4j:2.13.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: jakarta.annotation:jakarta.annotation-api:1.3.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.yaml:snakeyaml:1.26" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-json:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.11.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.11.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.module:jackson-module-parameter-names:2.11.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-tomcat:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-core:9.0.45" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.glassfish:jakarta.el:3.0.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-websocket:9.0.45" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-web:5.2.14.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-webmvc:5.2.14.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-expression:5.2.14.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.guava:guava:29.0-jre" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.guava:failureaccess:1.0.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.code.findbugs:jsr305:3.0.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.checkerframework:checker-qual:2.11.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.errorprone:error_prone_annotations:2.3.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.j2objc:j2objc-annotations:1.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.commons:commons-lang3:3.10" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-codec:commons-codec:1.14" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-io:commons-io:2.6" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-fileupload:commons-fileupload:1.3.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: joda-time:joda-time:2.9.9" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.commons:commons-collections4:4.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.commons:commons-csv:1.8" level="project" />
|
||||
<orderEntry type="library" name="Maven: cn.hutool:hutool-all:5.6.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.jsonwebtoken:jjwt:0.9.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.11.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.11.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.11.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba:fastjson:1.2.76" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.ben-manes.caffeine:caffeine:3.0.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: cn.jimmyshi:bean-query:1.1.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.hamcrest:hamcrest-all:1.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-beanutils:commons-beanutils:1.9.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-collections:commons-collections:3.2.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:jcl-over-slf4j:1.7.30" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.30" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.poi:poi-ooxml:4.1.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.poi:poi:3.17" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.poi:poi-ooxml-schemas:4.1.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.xmlbeans:xmlbeans:3.1.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.commons:commons-compress:1.19" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.virtuald:curvesapi:1.06" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: mysql:mysql-connector-java:8.0.23" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba:druid-spring-boot-starter:1.2.6" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba:druid:1.2.6" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-autoconfigure:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.baomidou:mybatis-plus-boot-starter:3.4.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.baomidou:mybatis-plus:3.4.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.baomidou:mybatis-plus-extension:3.4.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.baomidou:mybatis-plus-core:3.4.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.baomidou:mybatis-plus-annotation:3.4.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-jdbc:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.zaxxer:HikariCP:3.4.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-jdbc:5.2.14.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-tx:5.2.14.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper-spring-boot-starter:1.3.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-starter:2.1.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-autoconfigure:2.1.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mybatis:mybatis:3.5.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mybatis:mybatis-spring:2.0.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper-spring-boot-autoconfigure:1.3.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper:5.2.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.jsqlparser:jsqlparser:3.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-freemarker:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.freemarker:freemarker:2.3.31" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-context-support:5.2.14.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: javax.servlet:javax.servlet-api:4.0.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-log4j2:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-slf4j-impl:2.13.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-api:2.13.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-core:2.13.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-jul:2.13.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:jul-to-slf4j:1.7.30" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-aop:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-aop:5.2.14.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.aspectj:aspectjweaver:1.9.6" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-cache:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-configuration-processor:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-actuator:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-actuator-autoconfigure:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-actuator:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.micrometer:micrometer-core:1.5.13" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.hdrhistogram:HdrHistogram:2.1.12" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: org.latencyutils:LatencyUtils:2.0.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: de.codecentric:spring-boot-admin-starter-client:2.3.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: de.codecentric:spring-boot-admin-client:2.3.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba.cloud:spring-cloud-starter-alibaba-nacos-config:2.2.5.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba.spring:spring-context-support:1.0.10" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba.nacos:nacos-client:1.4.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba.nacos:nacos-common:1.4.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpasyncclient:4.1.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore-nio:4.4.14" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba.nacos:nacos-api:1.4.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.prometheus:simpleclient:0.5.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-commons:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.security:spring-security-crypto:5.3.9.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-context:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-starter-openfeign:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-starter:2.2.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.2.6.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: io.github.openfeign:feign-core:10.10.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.github.openfeign:feign-slf4j:10.10.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.github.openfeign:feign-hystrix:10.10.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.netflix.archaius:archaius-core:0.7.6" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.github.openfeign:feign-httpclient:10.10.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpclient:4.5.13" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore:4.4.14" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-starter-netflix-hystrix:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-netflix-hystrix:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-netflix-ribbon:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-netflix-archaius:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-starter-netflix-archaius:2.2.6.RELEASE" 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.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: 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.11.4" 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" scope="RUNTIME" name="Maven: org.ow2.asm:asm:5.0.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.reactivex:rxjava-reactive-streams:1.2.1" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: org.reactivestreams:reactive-streams:1.0.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.hibernate.validator:hibernate-validator:6.2.0.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: jakarta.validation:jakarta.validation-api:2.0.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.jboss.logging:jboss-logging:3.4.1.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml:classmate:1.5.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mapstruct:mapstruct:1.4.2.Final" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.mapstruct:mapstruct-processor:1.4.2.Final" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.projectlombok:lombok:1.18.20" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.curator:curator-recipes:4.3.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.curator:curator-framework:4.0.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.curator:curator-client:4.0.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.zookeeper:zookeeper:3.5.3-beta" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-cli:commons-cli:1.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.kafka:kafka-clients:2.4.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.luben:zstd-jni:1.4.3-1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.lz4:lz4-java:1.6.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.xerial.snappy:snappy-java:1.1.7.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.scala-lang:scala-library:2.12.10" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.lmax:disruptor:3.4.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-core:2.0.0.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-beans:5.2.14.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-context:5.2.14.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-metadata:2.0.0.RELEASE" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-starter-test:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-test:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-test-autoconfigure:2.3.10.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: jakarta.xml.bind:jakarta.xml.bind-api:2.3.3" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: jakarta.activation:jakarta.activation-api:1.2.2" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.assertj:assertj-core:3.16.1" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest:2.2" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter:5.6.3" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter-api:5.6.3" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.opentest4j:opentest4j:1.2.0" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.junit.platform:junit-platform-commons:1.6.3" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter-params:5.6.3" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter-engine:5.6.3" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.junit.vintage:junit-vintage-engine:5.6.3" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.apiguardian:apiguardian-api:1.1.0" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.junit.platform:junit-platform-engine:1.6.3" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.13.2" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.mockito:mockito-core:3.3.3" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: net.bytebuddy:byte-buddy:1.10.22" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: net.bytebuddy:byte-buddy-agent:1.10.22" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.objenesis:objenesis:2.6" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.mockito:mockito-junit-jupiter:3.3.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" name="Maven: org.springframework:spring-core:5.2.14.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-jcl:5.2.14.RELEASE" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.springframework:spring-test:5.2.14.RELEASE" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.xmlunit:xmlunit-core:2.7.0" level="project" />
|
||||
</component>
|
||||
</module>
|
||||
@@ -2,7 +2,7 @@
|
||||
<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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<groupId>com.orange.demo</groupId>
|
||||
<groupId>com.orangeforms</groupId>
|
||||
<artifactId>common</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</parent>
|
||||
@@ -95,6 +95,16 @@
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>druid-spring-boot-starter</artifactId>
|
||||
<version>${druid.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>com.sun</groupId>
|
||||
<artifactId>jconsole</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>com.sun</groupId>
|
||||
<artifactId>tools</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.orange.demo.common.core.advice;
|
||||
package com.orangeforms.common.core.advice;
|
||||
|
||||
import org.springframework.beans.propertyeditors.CustomDateEditor;
|
||||
import org.springframework.web.bind.WebDataBinder;
|
||||
@@ -1,9 +1,9 @@
|
||||
package com.orange.demo.common.core.advice;
|
||||
package com.orangeforms.common.core.advice;
|
||||
|
||||
import com.orange.demo.common.core.exception.*;
|
||||
import com.orange.demo.common.core.constant.ErrorCodeEnum;
|
||||
import com.orange.demo.common.core.object.ResponseResult;
|
||||
import com.orange.demo.common.core.util.ContextUtil;
|
||||
import com.orangeforms.common.core.exception.*;
|
||||
import com.orangeforms.common.core.constant.ErrorCodeEnum;
|
||||
import com.orangeforms.common.core.object.ResponseResult;
|
||||
import com.orangeforms.common.core.util.ContextUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.ibatis.exceptions.PersistenceException;
|
||||
import org.springframework.dao.DataAccessException;
|
||||
@@ -24,7 +24,7 @@ import java.util.concurrent.TimeoutException;
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Slf4j
|
||||
@RestControllerAdvice("com.orange.demo")
|
||||
@RestControllerAdvice("com.orangeforms")
|
||||
public class MyExceptionHandler {
|
||||
|
||||
/**
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.orange.demo.common.core.annotation;
|
||||
package com.orangeforms.common.core.annotation;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.orange.demo.common.core.annotation;
|
||||
package com.orangeforms.common.core.annotation;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.orange.demo.common.core.annotation;
|
||||
package com.orangeforms.common.core.annotation;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.orange.demo.common.core.annotation;
|
||||
package com.orangeforms.common.core.annotation;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package com.orange.demo.common.core.annotation;
|
||||
package com.orangeforms.common.core.annotation;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
/**
|
||||
* 主要用于标记更新字段。
|
||||
* 主要用于标记Job实体对象的更新时间字段。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.orange.demo.common.core.annotation;
|
||||
package com.orangeforms.common.core.annotation;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.orange.demo.common.core.annotation;
|
||||
package com.orangeforms.common.core.annotation;
|
||||
|
||||
import com.orange.demo.common.core.util.DataSourceResolver;
|
||||
import com.orangeforms.common.core.util.DataSourceResolver;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.orange.demo.common.core.annotation;
|
||||
package com.orangeforms.common.core.annotation;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.orange.demo.common.core.annotation;
|
||||
package com.orangeforms.common.core.annotation;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.orange.demo.common.core.annotation;
|
||||
package com.orangeforms.common.core.annotation;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.orange.demo.common.core.annotation;
|
||||
package com.orangeforms.common.core.annotation;
|
||||
|
||||
import com.orange.demo.common.core.object.DummyClass;
|
||||
import com.orangeforms.common.core.object.DummyClass;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.orange.demo.common.core.annotation;
|
||||
package com.orangeforms.common.core.annotation;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.orange.demo.common.core.annotation;
|
||||
package com.orangeforms.common.core.annotation;
|
||||
|
||||
import com.orange.demo.common.core.object.DummyClass;
|
||||
import com.orangeforms.common.core.object.DummyClass;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.orange.demo.common.core.annotation;
|
||||
package com.orangeforms.common.core.annotation;
|
||||
|
||||
import com.orange.demo.common.core.object.DummyClass;
|
||||
import com.orangeforms.common.core.object.DummyClass;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.orange.demo.common.core.annotation;
|
||||
package com.orangeforms.common.core.annotation;
|
||||
|
||||
import com.orange.demo.common.core.object.DummyClass;
|
||||
import com.orangeforms.common.core.object.DummyClass;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.orange.demo.common.core.annotation;
|
||||
package com.orangeforms.common.core.annotation;
|
||||
|
||||
import com.orange.demo.common.core.object.DummyClass;
|
||||
import com.orangeforms.common.core.object.DummyClass;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.orange.demo.common.core.annotation;
|
||||
package com.orangeforms.common.core.annotation;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.orange.demo.common.core.annotation;
|
||||
package com.orangeforms.common.core.annotation;
|
||||
|
||||
import com.orange.demo.common.core.upload.UploadStoreTypeEnum;
|
||||
import com.orangeforms.common.core.upload.UploadStoreTypeEnum;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.orange.demo.common.core.annotation;
|
||||
package com.orangeforms.common.core.annotation;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.orange.demo.common.core.aop;
|
||||
package com.orangeforms.common.core.aop;
|
||||
|
||||
import com.orange.demo.common.core.annotation.MyDataSource;
|
||||
import com.orange.demo.common.core.config.DataSourceContextHolder;
|
||||
import com.orangeforms.common.core.annotation.MyDataSource;
|
||||
import com.orangeforms.common.core.config.DataSourceContextHolder;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.aspectj.lang.ProceedingJoinPoint;
|
||||
import org.aspectj.lang.annotation.Around;
|
||||
@@ -25,8 +25,8 @@ public class DataSourceAspect {
|
||||
/**
|
||||
* 所有配置MyDataSource注解的Service实现类。
|
||||
*/
|
||||
@Pointcut("execution(public * com.orange.demo..service..*(..)) " +
|
||||
"&& @target(com.orange.demo.common.core.annotation.MyDataSource)")
|
||||
@Pointcut("execution(public * com.orangeforms..service..*(..)) " +
|
||||
"&& @target(com.orangeforms.common.core.annotation.MyDataSource)")
|
||||
public void datasourcePointCut() {
|
||||
// 空注释,避免sonar警告
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
package com.orange.demo.common.core.aop;
|
||||
package com.orangeforms.common.core.aop;
|
||||
|
||||
import com.orange.demo.common.core.annotation.MyDataSourceResolver;
|
||||
import com.orange.demo.common.core.util.DataSourceResolver;
|
||||
import com.orange.demo.common.core.config.DataSourceContextHolder;
|
||||
import com.orange.demo.common.core.util.ApplicationContextHolder;
|
||||
import com.orangeforms.common.core.annotation.MyDataSourceResolver;
|
||||
import com.orangeforms.common.core.util.DataSourceResolver;
|
||||
import com.orangeforms.common.core.config.DataSourceContextHolder;
|
||||
import com.orangeforms.common.core.util.ApplicationContextHolder;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.aspectj.lang.ProceedingJoinPoint;
|
||||
import org.aspectj.lang.annotation.Around;
|
||||
@@ -32,8 +32,8 @@ public class DataSourceResolveAspect {
|
||||
/**
|
||||
* 所有配置MyDataSourceResovler注解的Service实现类。
|
||||
*/
|
||||
@Pointcut("execution(public * com.orange.demo..service..*(..)) " +
|
||||
"&& @target(com.orange.demo.common.core.annotation.MyDataSourceResolver)")
|
||||
@Pointcut("execution(public * com.orangeforms..service..*(..)) " +
|
||||
"&& @target(com.orangeforms.common.core.annotation.MyDataSourceResolver)")
|
||||
public void datasourceResolverPointCut() {
|
||||
// 空注释,避免sonar警告
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.orange.demo.common.core.aop;
|
||||
package com.orangeforms.common.core.aop;
|
||||
|
||||
import com.orange.demo.common.core.base.service.BaseDictService;
|
||||
import com.orangeforms.common.core.base.service.BaseDictService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.aspectj.lang.ProceedingJoinPoint;
|
||||
import org.aspectj.lang.annotation.Around;
|
||||
@@ -27,9 +27,9 @@ public class DictCacheSyncAspect {
|
||||
/**
|
||||
* BaseDictService 字典服务父类中的字典数据增删改的方法。
|
||||
*/
|
||||
@Pointcut("execution(public * com.orange.demo..BaseDictService.saveNew (..)) " +
|
||||
"|| execution(public * com.orange.demo..BaseDictService.update (..)) " +
|
||||
"|| execution(public * com.orange.demo..BaseDictService.remove (..))" )
|
||||
@Pointcut("execution(public * com.orangeforms..BaseDictService.saveNew (..)) " +
|
||||
"|| execution(public * com.orangeforms..BaseDictService.update (..)) " +
|
||||
"|| execution(public * com.orangeforms..BaseDictService.remove (..))" )
|
||||
public void baseDictServicePointCut() {
|
||||
// 空注释,避免sonar警告
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.orange.demo.common.core.base.client;
|
||||
package com.orangeforms.common.core.base.client;
|
||||
|
||||
import com.orange.demo.common.core.object.*;
|
||||
import com.orangeforms.common.core.object.*;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
@@ -49,6 +49,46 @@ public interface BaseClient<D, V, K> {
|
||||
*/
|
||||
ResponseResult<Boolean> existId(K id);
|
||||
|
||||
/**
|
||||
* 保存或更新数据。
|
||||
*
|
||||
* @param data 主键Id为null时表示新增数据,否则更新数据。
|
||||
* @return 应答结果对象,主键Id。
|
||||
*/
|
||||
default ResponseResult<V> saveNewOrUpdate(D data) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量新增或保存数据列表。
|
||||
*
|
||||
* @param dataList 数据列表。主键Id为null时表示新增数据,否则更新数据。
|
||||
* @return 应答结果对象。
|
||||
*/
|
||||
default ResponseResult<Void> saveNewOrUpdateBatch(List<D> dataList) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证指定数据的关联Id数据是否存合法。
|
||||
*
|
||||
* @param data 数据对象。
|
||||
* @return 应答结果对象。
|
||||
*/
|
||||
default ResponseResult<Void> verifyRelatedData(D data) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证指定数据列表的关联Id数据是否存合法。
|
||||
*
|
||||
* @param dataList 数据对象列表。
|
||||
* @return 应答结果对象。
|
||||
*/
|
||||
default ResponseResult<Void> verifyRelatedDataList(List<D> dataList) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除主键Id关联的对象。
|
||||
*
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.orange.demo.common.core.base.client;
|
||||
package com.orangeforms.common.core.base.client;
|
||||
|
||||
import com.orange.demo.common.core.constant.ErrorCodeEnum;
|
||||
import com.orange.demo.common.core.object.*;
|
||||
import com.orangeforms.common.core.constant.ErrorCodeEnum;
|
||||
import com.orangeforms.common.core.object.*;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@@ -41,6 +41,26 @@ public abstract class BaseFallbackFactory<D, V, K, T extends BaseClient<D, V, K>
|
||||
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseResult<V> saveNewOrUpdate(D data) {
|
||||
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseResult<Void> saveNewOrUpdateBatch(List<D> dataList) {
|
||||
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseResult<Void> verifyRelatedData(D data) {
|
||||
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseResult<Void> verifyRelatedDataList(List<D> dataList) {
|
||||
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseResult<Integer> deleteById(K id) {
|
||||
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
|
||||
@@ -1,17 +1,18 @@
|
||||
package com.orange.demo.common.core.base.controller;
|
||||
package com.orangeforms.common.core.base.controller;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.ReflectUtil;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.orange.demo.common.core.base.mapper.BaseModelMapper;
|
||||
import com.orange.demo.common.core.base.service.IBaseService;
|
||||
import com.orange.demo.common.core.constant.AggregationKind;
|
||||
import com.orange.demo.common.core.constant.AggregationType;
|
||||
import com.orange.demo.common.core.constant.ErrorCodeEnum;
|
||||
import com.orange.demo.common.core.exception.RemoteDataBuildException;
|
||||
import com.orange.demo.common.core.object.*;
|
||||
import com.orange.demo.common.core.util.MyCommonUtil;
|
||||
import com.orange.demo.common.core.util.MyModelUtil;
|
||||
import com.orangeforms.common.core.base.mapper.BaseModelMapper;
|
||||
import com.orangeforms.common.core.base.service.IBaseService;
|
||||
import com.orangeforms.common.core.constant.AggregationKind;
|
||||
import com.orangeforms.common.core.constant.AggregationType;
|
||||
import com.orangeforms.common.core.constant.ErrorCodeEnum;
|
||||
import com.orangeforms.common.core.exception.RemoteDataBuildException;
|
||||
import com.orangeforms.common.core.object.*;
|
||||
import com.orangeforms.common.core.util.MyCommonUtil;
|
||||
import com.orangeforms.common.core.util.MyModelUtil;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.page.PageMethod;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -26,6 +27,7 @@ import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@@ -43,15 +45,15 @@ public abstract class BaseController<M, V, K extends Serializable> {
|
||||
/**
|
||||
* 当前Service关联的主Model实体对象的Class。
|
||||
*/
|
||||
protected final Class<M> modelClass;
|
||||
private final Class<M> modelClass;
|
||||
/**
|
||||
* 当前Service关联的主model的VO对象的Class。
|
||||
*/
|
||||
protected final Class<V> domainVoClass;
|
||||
private final Class<V> domainVoClass;
|
||||
/**
|
||||
* 当前Service关联的主Model对象主键字段名称。
|
||||
*/
|
||||
protected String idFieldName;
|
||||
private String idFieldName;
|
||||
|
||||
/**
|
||||
* 获取子类中注入的IBaseService接口。
|
||||
@@ -149,6 +151,68 @@ public abstract class BaseController<M, V, K extends Serializable> {
|
||||
!MyCommonUtil.existBlankArgument(id) && service().getById(id) != null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据最新对象列表和原有对象的数据对比,判断关联的字典数据和多对一主表数据是否都是合法数据。仅限于微服务间远程接口调用。
|
||||
*
|
||||
* @param data 数据对象。
|
||||
* 主键有值是视为更新操作的数据比对,因此仅当关联Id变化时才会验证。
|
||||
* 主键为空视为新增操作的数据比对,所有关联Id都会被验证。
|
||||
* @param idGetter 获取主键值的函数对象。
|
||||
* @return 应答结果对象。
|
||||
*/
|
||||
public ResponseResult<Void> baseVerifyRelatedData(M data, Function<M, K> idGetter) {
|
||||
CallResult result;
|
||||
K id = idGetter.apply(data);
|
||||
if (id == null) {
|
||||
result = service().verifyRelatedData(data, null);
|
||||
} else {
|
||||
M originalData = service().getById(id);
|
||||
if (originalData == null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST);
|
||||
}
|
||||
result = service().verifyRelatedData(data, originalData);
|
||||
}
|
||||
return !result.isSuccess() ? ResponseResult.errorFrom(result) : ResponseResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据最新对象列表和原有对象列表的数据对比,判断关联的字典数据和多对一主表数据是否都是合法数据。
|
||||
*
|
||||
* @param dataList 数据对象列表。
|
||||
* @param idGetter 获取主键值的函数对象。
|
||||
* @return 应答结果对象。
|
||||
*/
|
||||
public ResponseResult<Void> baseVerifyRelatedDataList(List<M> dataList, Function<M, K> idGetter) {
|
||||
if (CollUtil.isEmpty(dataList)) {
|
||||
return ResponseResult.success();
|
||||
}
|
||||
// 1. 先过滤出数据列表中的主键Id集合。
|
||||
Set<K> idList = dataList.stream()
|
||||
.filter(c -> idGetter.apply(c) != null).map(idGetter).collect(Collectors.toSet());
|
||||
// 2. 列表中,我们目前仅支持全部是更新数据,或全部新增数据,不能混着。如果有主键值,说明当前全是更新数据。
|
||||
if (CollUtil.isNotEmpty(idList)) {
|
||||
// 3. 这里是批量读取的优化,用一个主键值得in list查询,一步获取全部原有数据。然后再在内存中基于Map排序。
|
||||
List<M> originalList = service().getInList(idList);
|
||||
Map<K, M> originalMap = originalList.stream().collect(Collectors.toMap(idGetter, c2 -> c2));
|
||||
// 迭代列表,传入当前最新数据和更新前数据进行比对,如果关联数据变化了,就对新数据进行合法性验证。
|
||||
for (M data : dataList) {
|
||||
CallResult result = service().verifyRelatedData(data, originalMap.get(idGetter.apply(data)));
|
||||
if (!result.isSuccess()) {
|
||||
return ResponseResult.errorFrom(result);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// 4. 迭代列表,传入当前最新数据,对关联数据进行合法性验证。
|
||||
for (M model : dataList) {
|
||||
CallResult result = service().verifyRelatedData(model, null);
|
||||
if (!result.isSuccess()) {
|
||||
return ResponseResult.errorFrom(result);
|
||||
}
|
||||
}
|
||||
}
|
||||
return ResponseResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除符合过滤条件的数据。
|
||||
*
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.orange.demo.common.core.base.dao;
|
||||
package com.orangeforms.common.core.base.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.orange.demo.common.core.base.mapper;
|
||||
package com.orangeforms.common.core.base.mapper;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.orange.demo.common.core.base.mapper;
|
||||
package com.orangeforms.common.core.base.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.orange.demo.common.core.base.model;
|
||||
package com.orangeforms.common.core.base.model;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import lombok.Data;
|
||||
@@ -1,11 +1,11 @@
|
||||
package com.orange.demo.common.core.base.service;
|
||||
package com.orangeforms.common.core.base.service;
|
||||
|
||||
import cn.hutool.core.util.ReflectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.orange.demo.common.core.constant.GlobalDeletedFlag;
|
||||
import com.orange.demo.common.core.exception.MyRuntimeException;
|
||||
import com.orange.demo.common.core.cache.DictionaryCache;
|
||||
import com.orange.demo.common.core.object.TokenData;
|
||||
import com.orangeforms.common.core.constant.GlobalDeletedFlag;
|
||||
import com.orangeforms.common.core.exception.MyRuntimeException;
|
||||
import com.orangeforms.common.core.cache.DictionaryCache;
|
||||
import com.orangeforms.common.core.object.TokenData;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.orange.demo.common.core.base.service;
|
||||
package com.orangeforms.common.core.base.service;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
@@ -7,20 +8,20 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import cn.hutool.core.util.ReflectUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.orange.demo.common.core.annotation.*;
|
||||
import com.orange.demo.common.core.base.dao.BaseDaoMapper;
|
||||
import com.orange.demo.common.core.base.client.BaseClient;
|
||||
import com.orange.demo.common.core.constant.AggregationKind;
|
||||
import com.orange.demo.common.core.constant.AggregationType;
|
||||
import com.orange.demo.common.core.constant.GlobalDeletedFlag;
|
||||
import com.orange.demo.common.core.exception.InvalidDataFieldException;
|
||||
import com.orange.demo.common.core.exception.MyRuntimeException;
|
||||
import com.orange.demo.common.core.exception.RemoteDataBuildException;
|
||||
import com.orange.demo.common.core.object.*;
|
||||
import com.orange.demo.common.core.util.AopTargetUtil;
|
||||
import com.orange.demo.common.core.util.ApplicationContextHolder;
|
||||
import com.orange.demo.common.core.util.MyModelUtil;
|
||||
import com.orange.demo.common.core.util.LogMessageUtil;
|
||||
import com.orangeforms.common.core.annotation.*;
|
||||
import com.orangeforms.common.core.base.dao.BaseDaoMapper;
|
||||
import com.orangeforms.common.core.base.client.BaseClient;
|
||||
import com.orangeforms.common.core.constant.AggregationKind;
|
||||
import com.orangeforms.common.core.constant.AggregationType;
|
||||
import com.orangeforms.common.core.constant.GlobalDeletedFlag;
|
||||
import com.orangeforms.common.core.exception.InvalidDataFieldException;
|
||||
import com.orangeforms.common.core.exception.MyRuntimeException;
|
||||
import com.orangeforms.common.core.exception.RemoteDataBuildException;
|
||||
import com.orangeforms.common.core.object.*;
|
||||
import com.orangeforms.common.core.util.AopTargetUtil;
|
||||
import com.orangeforms.common.core.util.ApplicationContextHolder;
|
||||
import com.orangeforms.common.core.util.MyModelUtil;
|
||||
import com.orangeforms.common.core.util.LogMessageUtil;
|
||||
import lombok.Getter;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
@@ -34,9 +35,9 @@ import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Method;
|
||||
import java.lang.reflect.ParameterizedType;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.BiConsumer;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Supplier;
|
||||
import java.util.function.Function;
|
||||
|
||||
import static java.util.stream.Collectors.*;
|
||||
|
||||
@@ -94,11 +95,27 @@ public abstract class BaseService<M, K extends Serializable> extends ServiceImpl
|
||||
/**
|
||||
* 当前Job服务源主表Model对象的最后更新时间字段名称。
|
||||
*/
|
||||
protected String updateTimeFieldName;
|
||||
protected String jobUpdateTimeFieldName;
|
||||
/**
|
||||
* 当前Job服务源主表Model对象的最后更新时间列名称。
|
||||
*/
|
||||
protected String jobUpdateTimeColumnName;
|
||||
/**
|
||||
* 当前业务服务源主表Model对象最后更新时间字段名称。
|
||||
*/
|
||||
protected String updateTimeFieldName;
|
||||
/**
|
||||
* 当前业务服务源主表Model对象最后更新时间列名称。
|
||||
*/
|
||||
protected String updateTimeColumnName;
|
||||
/**
|
||||
* 当前业务服务源主表Model对象最后更新用户Id字段名称。
|
||||
*/
|
||||
protected String updateUserIdFieldName;
|
||||
/**
|
||||
* 当前业务服务源主表Model对象最后更新用户Id列名称。
|
||||
*/
|
||||
protected String updateUserIdColumnName;
|
||||
/**
|
||||
* 当前Service关联的主Model对象主键字段赋值方法的反射对象。
|
||||
*/
|
||||
@@ -155,6 +172,10 @@ public abstract class BaseService<M, K extends Serializable> extends ServiceImpl
|
||||
* 当前Service关联的主Model对象的所有远程多对多聚合关联的结构列表,该字段在系统启动阶段一次性预加载,提升运行时效率。
|
||||
*/
|
||||
private final List<RemoteRelationStruct> remoteRelationManyToManyAggrStructList = new LinkedList<>();
|
||||
/**
|
||||
* 基础表的实体对象及表信息。
|
||||
*/
|
||||
private final TableModelInfo tableModelInfo = new TableModelInfo();
|
||||
|
||||
private static final String AND_OP = " AND ";
|
||||
|
||||
@@ -175,6 +196,15 @@ public abstract class BaseService<M, K extends Serializable> extends ServiceImpl
|
||||
for (Field field : fields) {
|
||||
initializeField(field);
|
||||
}
|
||||
tableModelInfo.setModelName(modelClass.getSimpleName());
|
||||
tableModelInfo.setTableName(this.tableName);
|
||||
tableModelInfo.setKeyFieldName(idFieldName);
|
||||
tableModelInfo.setKeyColumnName(idColumnName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TableModelInfo getTableModelInfo() {
|
||||
return this.tableModelInfo;
|
||||
}
|
||||
|
||||
private void initializeField(Field field) {
|
||||
@@ -187,9 +217,9 @@ public abstract class BaseService<M, K extends Serializable> extends ServiceImpl
|
||||
getIdFieldMethod = ReflectUtil.getMethod(
|
||||
modelClass, "get" + StringUtils.capitalize(idFieldName));
|
||||
}
|
||||
if (updateTimeFieldName == null && null != field.getAnnotation(JobUpdateTimeColumn.class)) {
|
||||
updateTimeFieldName = field.getName();
|
||||
updateTimeColumnName = this.safeMapToColumnName(updateTimeFieldName);
|
||||
if (jobUpdateTimeFieldName == null && null != field.getAnnotation(JobUpdateTimeColumn.class)) {
|
||||
jobUpdateTimeFieldName = field.getName();
|
||||
jobUpdateTimeColumnName = this.safeMapToColumnName(jobUpdateTimeFieldName);
|
||||
}
|
||||
if (deletedFlagFieldName == null && null != field.getAnnotation(TableLogic.class)) {
|
||||
deletedFlagFieldName = field.getName();
|
||||
@@ -223,6 +253,41 @@ public abstract class BaseService<M, K extends Serializable> extends ServiceImpl
|
||||
return false;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void saveNewOrUpdate(M data, Consumer<M> saveNew, BiConsumer<M, M> update) {
|
||||
if (data == null) {
|
||||
return;
|
||||
}
|
||||
K id = (K) ReflectUtil.getFieldValue(data, idFieldName);
|
||||
if (id == null) {
|
||||
saveNew.accept(data);
|
||||
} else {
|
||||
update.accept(data, this.getById(id));
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void saveNewOrUpdateBatch(List<M> dataList, Consumer<List<M>> saveNewBatch, BiConsumer<M, M> update) {
|
||||
if (CollUtil.isEmpty(dataList)) {
|
||||
return;
|
||||
}
|
||||
List<M> saveNewDataList = dataList.stream()
|
||||
.filter(c -> ReflectUtil.getFieldValue(c, idFieldName) == null).collect(toList());
|
||||
if (CollUtil.isNotEmpty(saveNewDataList)) {
|
||||
saveNewBatch.accept(saveNewDataList);
|
||||
}
|
||||
List<M> updateDataList = dataList.stream()
|
||||
.filter(c -> ReflectUtil.getFieldValue(c, idFieldName) != null).collect(toList());
|
||||
if (CollUtil.isNotEmpty(updateDataList)) {
|
||||
for (M data : updateDataList) {
|
||||
K id = (K) ReflectUtil.getFieldValue(data, idFieldName);
|
||||
update.accept(data, this.getById(id));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据过滤条件删除数据。
|
||||
*
|
||||
@@ -235,6 +300,58 @@ public abstract class BaseService<M, K extends Serializable> extends ServiceImpl
|
||||
return mapper().delete(new QueryWrapper<>(filter));
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public void updateBatchOneToManyRelation(
|
||||
String relationFieldName,
|
||||
Object relationFieldValue,
|
||||
String updateUserIdFieldName,
|
||||
String updateTimeFieldName,
|
||||
List<M> dataList,
|
||||
Consumer<List<M>> batchInserter) {
|
||||
// 删除在现有数据列表dataList中不存在的从表数据。
|
||||
QueryWrapper<M> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq(this.safeMapToColumnName(relationFieldName), relationFieldValue);
|
||||
if (CollUtil.isNotEmpty(dataList)) {
|
||||
Set<Object> keptIdSet = dataList.stream()
|
||||
.filter(c -> ReflectUtil.getFieldValue(c, idFieldName) != null)
|
||||
.map(c -> ReflectUtil.getFieldValue(c, idFieldName)).collect(toSet());
|
||||
if (CollUtil.isNotEmpty(keptIdSet)) {
|
||||
queryWrapper.notIn(idColumnName, keptIdSet);
|
||||
}
|
||||
}
|
||||
mapper().delete(queryWrapper);
|
||||
if (CollUtil.isNotEmpty(dataList)) {
|
||||
// 没有包含主键的对象被视为新对象,为了效率最优化,这里执行批量插入。
|
||||
List<M> newDataList = dataList.stream()
|
||||
.filter(c -> ReflectUtil.getFieldValue(c, idFieldName) == null).collect(toList());
|
||||
if (CollUtil.isNotEmpty(newDataList)) {
|
||||
newDataList.forEach(o -> ReflectUtil.setFieldValue(o, relationFieldName, relationFieldValue));
|
||||
batchInserter.accept(newDataList);
|
||||
}
|
||||
// 对于主键已经存在的数据,我们视为已存在数据,这里执行逐条更新操作。
|
||||
List<M> updateDataList =
|
||||
dataList.stream().filter(c -> ReflectUtil.getFieldValue(c, idFieldName) != null).collect(toList());
|
||||
for (M updateData : updateDataList) {
|
||||
// 如果前端将更新用户Id置空,这里使用当前用户更新该字段。
|
||||
if (updateUserIdFieldName != null && ReflectUtil.getFieldValue(updateData, updateUserIdFieldName) == null) {
|
||||
ReflectUtil.setFieldValue(updateData, updateUserIdFieldName, TokenData.takeFromRequest().getUserId());
|
||||
}
|
||||
// 如果前端将更新时间置空,这里使用当前时间更新该字段。
|
||||
if (updateTimeFieldName != null && ReflectUtil.getFieldValue(updateData, updateTimeFieldName) == null) {
|
||||
ReflectUtil.setFieldValue(updateData, updateTimeFieldName, new Date());
|
||||
}
|
||||
if (this.deletedFlagFieldName != null) {
|
||||
ReflectUtil.setFieldValue(updateData, deletedFlagFieldName, GlobalDeletedFlag.NORMAL);
|
||||
}
|
||||
@SuppressWarnings("unchecked")
|
||||
UpdateWrapper<M> uw = this.createUpdateQueryForNullValue(
|
||||
updateData, (K) ReflectUtil.getFieldValue(updateData, idFieldName));
|
||||
mapper().update(updateData, uw);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断主键Id关联的数据是否存在。
|
||||
*
|
||||
@@ -549,6 +666,106 @@ public abstract class BaseService<M, K extends Serializable> extends ServiceImpl
|
||||
return mapper().getCountByCondition(this.tableName, whereClause);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CallResult verifyRelatedData(M data, M originalData) {
|
||||
return CallResult.ok();
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public CallResult verifyRelatedData(List<M> dataList) {
|
||||
if (CollUtil.isEmpty(dataList)) {
|
||||
return CallResult.ok();
|
||||
}
|
||||
// 1. 先过滤出数据列表中的主键Id集合。
|
||||
Set<K> idList = dataList.stream()
|
||||
.filter(c -> ReflectUtil.getFieldValue(c, idFieldName) != null)
|
||||
.map(c -> (K) ReflectUtil.getFieldValue(c, idFieldName)).collect(toSet());
|
||||
// 2. 列表中,我们目前仅支持全部是更新数据,或全部新增数据,不能混着。如果有主键值,说明当前全是更新数据。
|
||||
if (CollUtil.isNotEmpty(idList)) {
|
||||
// 3. 这里是批量读取的优化,用一个主键值得in list查询,一步获取全部原有数据。然后再在内存中基于Map排序。
|
||||
List<M> originalList = this.getInList(idList);
|
||||
Map<Object, M> originalMap = originalList.stream()
|
||||
.collect(toMap(c -> ReflectUtil.getFieldValue(c, idFieldName), c2 -> c2));
|
||||
// 迭代列表,传入当前最新数据和更新前数据进行比对,如果关联数据变化了,就对新数据进行合法性验证。
|
||||
for (M data : dataList) {
|
||||
CallResult result = this.verifyRelatedData(
|
||||
data, originalMap.get(ReflectUtil.getFieldValue(data, idFieldName)));
|
||||
if (!result.isSuccess()) {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// 4. 迭代列表,传入当前最新数据,对关联数据进行合法性验证。
|
||||
for (M data : dataList) {
|
||||
CallResult result = this.verifyRelatedData(data, null);
|
||||
if (!result.isSuccess()) {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
return CallResult.ok();
|
||||
}
|
||||
|
||||
@Override
|
||||
public CallResult verifyRemoteRelatedData(M data, M originalData) {
|
||||
return CallResult.ok();
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public CallResult verifyRemoteRelatedData(List<M> dataList) {
|
||||
if (CollUtil.isEmpty(dataList)) {
|
||||
return CallResult.ok();
|
||||
}
|
||||
// 1. 先过滤出数据列表中的主键Id集合。
|
||||
Set<K> idList = dataList.stream()
|
||||
.filter(c -> ReflectUtil.getFieldValue(c, idFieldName) != null)
|
||||
.map(c -> (K) ReflectUtil.getFieldValue(c, idFieldName)).collect(toSet());
|
||||
// 2. 列表中,我们目前仅支持全部是更新数据,或全部新增数据,不能混着。如果有主键值,说明当前全是更新数据。
|
||||
if (CollUtil.isNotEmpty(idList)) {
|
||||
// 3. 这里是批量读取的优化,用一个主键值得in list查询,一步获取全部原有数据。然后再在内存中基于Map排序。
|
||||
List<M> originalList = this.getInList(idList);
|
||||
Map<Object, M> originalMap = originalList.stream()
|
||||
.collect(toMap(c -> ReflectUtil.getFieldValue(c, idFieldName), c2 -> c2));
|
||||
// 迭代列表,传入当前最新数据和更新前数据进行比对,如果关联数据变化了,就对新数据进行合法性验证。
|
||||
for (M data : dataList) {
|
||||
CallResult result = this.verifyRemoteRelatedData(
|
||||
data, originalMap.get(ReflectUtil.getFieldValue(data, idFieldName)));
|
||||
if (!result.isSuccess()) {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// 4. 迭代列表,传入当前最新数据,对关联数据进行合法性验证。
|
||||
for (M data : dataList) {
|
||||
CallResult result = this.verifyRemoteRelatedData(data, null);
|
||||
if (!result.isSuccess()) {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
return CallResult.ok();
|
||||
}
|
||||
|
||||
@Override
|
||||
public CallResult verifyAllRelatedData(M data, M originalData) {
|
||||
CallResult verifyResult = this.verifyRelatedData(data, originalData);
|
||||
if (!verifyResult.isSuccess()) {
|
||||
return verifyResult;
|
||||
}
|
||||
return this.verifyRemoteRelatedData(data, originalData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CallResult verifyAllRelatedData(List<M> dataList) {
|
||||
CallResult verifyResult = this.verifyRelatedData(dataList);
|
||||
if (!verifyResult.isSuccess()) {
|
||||
return verifyResult;
|
||||
}
|
||||
return this.verifyRemoteRelatedData(dataList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 集成所有与主表实体对象相关的关联数据列表。包括本地和远程服务的一对一、字典、一对多和多对多聚合运算等。
|
||||
* 也可以根据实际需求,单独调用该函数所包含的各个数据集成函数。
|
||||
@@ -1659,23 +1876,6 @@ public abstract class BaseService<M, K extends Serializable> extends ServiceImpl
|
||||
}
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public void saveInternal(List<M> dataList, Supplier<K> idGenerator, Consumer<List<M>> batchInserter) {
|
||||
if (CollectionUtils.isEmpty(dataList)) {
|
||||
return;
|
||||
}
|
||||
dataList.stream().filter(c -> ReflectUtil.getFieldValue(c, idFieldName) == null)
|
||||
.forEach(o -> ReflectUtil.setFieldValue(o, idFieldName, idGenerator.get()));
|
||||
if (batchInserter != null) {
|
||||
batchInserter.accept(dataList);
|
||||
} else {
|
||||
for (M data : dataList) {
|
||||
mapper().insert(data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 缺省实现返回null,在进行一对多和多对多聚合计算时,没有额外的自定义过滤条件。如有需要,需子类自行实现。
|
||||
*
|
||||
@@ -1695,6 +1895,9 @@ public abstract class BaseService<M, K extends Serializable> extends ServiceImpl
|
||||
* @return 需要关联验证返回true,否则false。
|
||||
*/
|
||||
protected <T> boolean needToVerify(M object, M originalObject, Function<M, T> fieldGetter) {
|
||||
if (object == null) {
|
||||
return false;
|
||||
}
|
||||
T data = fieldGetter.apply(object);
|
||||
if (data == null) {
|
||||
return false;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.orange.demo.common.core.base.service;
|
||||
package com.orangeforms.common.core.base.service;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
@@ -1,12 +1,14 @@
|
||||
package com.orange.demo.common.core.base.service;
|
||||
package com.orangeforms.common.core.base.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.orange.demo.common.core.object.MyRelationParam;
|
||||
import com.orangeforms.common.core.object.CallResult;
|
||||
import com.orangeforms.common.core.object.MyRelationParam;
|
||||
import com.orangeforms.common.core.object.TableModelInfo;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.*;
|
||||
import java.util.function.BiConsumer;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
/**
|
||||
* 所有Service的接口。
|
||||
@@ -18,6 +20,24 @@ import java.util.function.Supplier;
|
||||
*/
|
||||
public interface IBaseService<M, K extends Serializable> extends IService<M>{
|
||||
|
||||
/**
|
||||
* 如果主键存在则更新,否则新增保存实体对象。
|
||||
*
|
||||
* @param data 实体对象数据。
|
||||
* @param saveNew 新增实体对象方法。
|
||||
* @param update 更新实体对象方法。
|
||||
*/
|
||||
void saveNewOrUpdate(M data, Consumer<M> saveNew, BiConsumer<M, M> update);
|
||||
|
||||
/**
|
||||
* 如果主键存在的则更新,否则批量新增保存实体对象。
|
||||
*
|
||||
* @param dataList 实体对象数据列表。
|
||||
* @param saveNewBatch 批量新增实体对象方法。
|
||||
* @param update 更新实体对象方法。
|
||||
*/
|
||||
void saveNewOrUpdateBatch(List<M> dataList, Consumer<List<M>> saveNewBatch, BiConsumer<M, M> update);
|
||||
|
||||
/**
|
||||
* 根据过滤条件删除数据。
|
||||
*
|
||||
@@ -26,6 +46,29 @@ public interface IBaseService<M, K extends Serializable> extends IService<M>{
|
||||
*/
|
||||
Integer removeBy(M filter);
|
||||
|
||||
/**
|
||||
* 基于主从表之间的关联字段,批量改更新一对多从表数据。
|
||||
* 该操作会覆盖增、删、改三个操作,具体如下:
|
||||
* 1. 先删除。从表中relationFieldName字段的值为relationFieldValue, 同时主键Id不在dataList中的。
|
||||
* 2. 再批量插入。遍历dataList中没有主键Id的对象,视为新对象批量插入。
|
||||
* 3. 最后逐条更新,遍历dataList中有主键Id的对象,视为已存在对象并逐条更新。
|
||||
* 4. 如果更新时间和更新用户Id为空,我们将视当前记录为变化数据,因此使用当前时间和用户分别填充这两个字段。
|
||||
*
|
||||
* @param relationFieldName 主从表关联中,从表的Java字段名。
|
||||
* @param relationFieldValue 主从表关联中,与从表关联的主表字段值。该值会被赋值给从表关联字段。
|
||||
* @param updateUserIdFieldName 一对多从表的更新用户Id字段名。
|
||||
* @param updateTimeFieldName 一对多从表的更新时间字段名
|
||||
* @param dataList 批量更新的从表数据列表。
|
||||
* @param batchInserter 从表批量插入方法。
|
||||
*/
|
||||
void updateBatchOneToManyRelation(
|
||||
String relationFieldName,
|
||||
Object relationFieldValue,
|
||||
String updateUserIdFieldName,
|
||||
String updateTimeFieldName,
|
||||
List<M> dataList,
|
||||
Consumer<List<M>> batchInserter);
|
||||
|
||||
/**
|
||||
* 判断指定字段的数据是否存在,且仅仅存在一条记录。
|
||||
* 如果是基于主键的过滤,会直接调用existId过滤函数,提升性能。在有缓存的场景下,也可以利用缓存。
|
||||
@@ -216,6 +259,63 @@ public interface IBaseService<M, K extends Serializable> extends IService<M>{
|
||||
*/
|
||||
Integer getCountByCondition(String whereClause);
|
||||
|
||||
/**
|
||||
* 根据最新对象和原有对象的数据对比,判断关联的字典数据和多对一主表数据是否都是合法数据。
|
||||
* NOTE: BaseService中会给出返回CallResult.ok()的缺省实现。每个业务服务实现类在需要的时候可以重载该方法。
|
||||
*
|
||||
* @param data 数据对象。
|
||||
* @param originalData 原有数据对象,null表示data为新增对象。
|
||||
* @return 数据全部正确返回true,否则false,同时返回具体的错误信息。
|
||||
*/
|
||||
CallResult verifyRelatedData(M data, M originalData);
|
||||
|
||||
/**
|
||||
* 根据最新对象列表和原有对象列表的数据对比,判断关联的字典数据和多对一主表数据是否都是合法数据。
|
||||
* NOTE: BaseService中会给出返回CallResult.ok()的缺省实现。每个业务服务实现类在需要的时候可以重载该方法。
|
||||
*
|
||||
* @param dataList 数据对象列表。
|
||||
* @return 数据全部正确返回true,否则false,同时返回具体的错误信息。
|
||||
*/
|
||||
CallResult verifyRelatedData(List<M> dataList);
|
||||
|
||||
/**
|
||||
* 根据最新对象和原有对象的数据对比,判断关联的远程字典数据和多对一主表数据是否都是合法数据。
|
||||
* NOTE: BaseService中会给出返回CallResult.ok()的缺省实现。每个业务服务实现类在需要的时候可以重载该方法。
|
||||
*
|
||||
* @param data 数据对象。
|
||||
* @param originalData 原有数据对象,null表示data为新增对象。
|
||||
* @return 数据全部正确返回true,否则false,同时返回具体的错误信息。
|
||||
*/
|
||||
CallResult verifyRemoteRelatedData(M data, M originalData);
|
||||
|
||||
/**
|
||||
* 根据最新对象列表和原有对象列表的数据对比,判断关联的远程字典数据和多对一主表数据是否都是合法数据。
|
||||
* NOTE: BaseService中会给出返回CallResult.ok()的缺省实现。每个业务服务实现类在需要的时候可以重载该方法。
|
||||
*
|
||||
* @param dataList 数据对象列表。
|
||||
* @return 数据全部正确返回true,否则false,同时返回具体的错误信息。
|
||||
*/
|
||||
CallResult verifyRemoteRelatedData(List<M> dataList);
|
||||
|
||||
/**
|
||||
* 根据最新对象和原有对象的数据对比,判断关联的本地和远程字典数据和多对一主表数据是否都是合法数据。
|
||||
* NOTE: BaseService中给出了缺省实现。
|
||||
*
|
||||
* @param data 数据对象。
|
||||
* @param originalData 原有数据对象,null表示data为新增对象。
|
||||
* @return 数据全部正确返回true,否则false,同时返回具体的错误信息。
|
||||
*/
|
||||
CallResult verifyAllRelatedData(M data, M originalData);
|
||||
|
||||
/**
|
||||
* 根据最新对象列表和原有对象列表的数据对比,判断关联的本地和远程字典数据和多对一主表数据是否都是合法数据。
|
||||
* NOTE: BaseService中给出了缺省实现。
|
||||
*
|
||||
* @param dataList 数据对象列表。
|
||||
* @return 数据全部正确返回true,否则false,同时返回具体的错误信息。
|
||||
*/
|
||||
CallResult verifyAllRelatedData(List<M> dataList);
|
||||
|
||||
/**
|
||||
* 集成所有与主表实体对象相关的关联数据列表。包括一对一、字典、一对多和多对多聚合运算等。
|
||||
* 也可以根据实际需求,单独调用该函数所包含的各个数据集成函数。
|
||||
@@ -309,14 +409,9 @@ public interface IBaseService<M, K extends Serializable> extends IService<M>{
|
||||
void loadLocalRelationStruct();
|
||||
|
||||
/**
|
||||
* 内部使用的批量保存方法。在使用前要确保清楚该方法的实现功能。
|
||||
* 该方法通常用于从表数据的批量更新,为了保证已有数据的主键不变,我们通常会在执行该方法前,根据主表的关联数据,
|
||||
* 删除从表中的数据。之后在迭代参数dataList,并将没有主键值的对象视为新对象,该方法将为这些新对象生成主键值。
|
||||
* 其他包含主键值的对象,为已有对象,不做任何修改。填充主键后,将dataList集合中的数据批量插入到数据表。
|
||||
* 获取当前服务引用的实体对象及表信息。
|
||||
*
|
||||
* @param dataList 待操作的数据列表。
|
||||
* @param idGenerator 主键值生成器方法。
|
||||
* @param batchInserter 批量插入方法。
|
||||
* @return 实体对象及表信息。
|
||||
*/
|
||||
void saveInternal(List<M> dataList, Supplier<K> idGenerator, Consumer<List<M>> batchInserter);
|
||||
TableModelInfo getTableModelInfo();
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.orange.demo.common.core.cache;
|
||||
package com.orangeforms.common.core.cache;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.orange.demo.common.core.cache;
|
||||
package com.orangeforms.common.core.cache;
|
||||
|
||||
import com.orange.demo.common.core.exception.MapCacheAccessException;
|
||||
import com.orangeforms.common.core.exception.MapCacheAccessException;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.util.*;
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.orange.demo.common.core.cache;
|
||||
package com.orangeforms.common.core.cache;
|
||||
|
||||
import com.orange.demo.common.core.exception.MapCacheAccessException;
|
||||
import com.orangeforms.common.core.exception.MapCacheAccessException;
|
||||
import com.google.common.collect.LinkedHashMultimap;
|
||||
import com.google.common.collect.Multimap;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -1,9 +1,9 @@
|
||||
package com.orange.demo.common.core.config;
|
||||
package com.orangeforms.common.core.config;
|
||||
|
||||
import com.alibaba.fastjson.serializer.SerializerFeature;
|
||||
import com.alibaba.fastjson.support.config.FastJsonConfig;
|
||||
import com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter;
|
||||
import com.orange.demo.common.core.interceptor.MyRequestArgumentResolver;
|
||||
import com.orangeforms.common.core.interceptor.MyRequestArgumentResolver;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.http.MediaType;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.orange.demo.common.core.config;
|
||||
package com.orangeforms.common.core.config;
|
||||
|
||||
/**
|
||||
* 通过线程本地存储的方式,保存当前数据库操作所需的数据源类型,动态数据源会根据该值,进行动态切换。
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.orange.demo.common.core.config;
|
||||
package com.orangeforms.common.core.config;
|
||||
|
||||
import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.orange.demo.common.core.config;
|
||||
package com.orangeforms.common.core.config;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
@@ -1,8 +1,8 @@
|
||||
package com.orange.demo.common.core.config;
|
||||
package com.orangeforms.common.core.config;
|
||||
|
||||
import com.orange.demo.common.core.constant.ApplicationConstant;
|
||||
import com.orange.demo.common.core.object.TokenData;
|
||||
import com.orange.demo.common.core.util.ContextUtil;
|
||||
import com.orangeforms.common.core.constant.ApplicationConstant;
|
||||
import com.orangeforms.common.core.object.TokenData;
|
||||
import com.orangeforms.common.core.util.ContextUtil;
|
||||
import feign.RequestInterceptor;
|
||||
import feign.RequestTemplate;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.orange.demo.common.core.config;
|
||||
package com.orangeforms.common.core.config;
|
||||
|
||||
import com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter;
|
||||
import org.apache.http.client.HttpClient;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.orange.demo.common.core.config;
|
||||
package com.orangeforms.common.core.config;
|
||||
|
||||
import org.apache.tomcat.util.descriptor.web.SecurityCollection;
|
||||
import org.apache.tomcat.util.descriptor.web.SecurityConstraint;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.orange.demo.common.core.constant;
|
||||
package com.orangeforms.common.core.constant;
|
||||
|
||||
/**
|
||||
* 在跨服务调用时,需要传递的聚合分类常量对象。
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.orange.demo.common.core.constant;
|
||||
package com.orangeforms.common.core.constant;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.orange.demo.common.core.constant;
|
||||
package com.orangeforms.common.core.constant;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.orange.demo.common.core.constant;
|
||||
package com.orangeforms.common.core.constant;
|
||||
|
||||
/**
|
||||
* 应用程序的常量声明对象。
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.orange.demo.common.core.constant;
|
||||
package com.orangeforms.common.core.constant;
|
||||
|
||||
/**
|
||||
* 返回应答中的错误代码和错误信息。
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.orange.demo.common.core.constant;
|
||||
package com.orangeforms.common.core.constant;
|
||||
|
||||
/**
|
||||
* 数据记录逻辑删除标记常量。
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.orange.demo.common.core.exception;
|
||||
package com.orangeforms.common.core.exception;
|
||||
|
||||
/**
|
||||
* 数据验证失败的自定义异常。
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.orange.demo.common.core.exception;
|
||||
package com.orangeforms.common.core.exception;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.orange.demo.common.core.exception;
|
||||
package com.orangeforms.common.core.exception;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.orange.demo.common.core.exception;
|
||||
package com.orangeforms.common.core.exception;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.orange.demo.common.core.exception;
|
||||
package com.orangeforms.common.core.exception;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.orange.demo.common.core.exception;
|
||||
package com.orangeforms.common.core.exception;
|
||||
|
||||
/**
|
||||
* 内存缓存访问失败。比如:获取分布式数据锁超时、等待线程中断等。
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.orange.demo.common.core.exception;
|
||||
package com.orangeforms.common.core.exception;
|
||||
|
||||
/**
|
||||
* 自定义的运行时异常,在需要抛出运行时异常时,可使用该异常。
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.orange.demo.common.core.exception;
|
||||
package com.orangeforms.common.core.exception;
|
||||
|
||||
/**
|
||||
* 没有数据被修改的自定义异常。
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.orange.demo.common.core.exception;
|
||||
package com.orangeforms.common.core.exception;
|
||||
|
||||
/**
|
||||
* 没有数据访问权限的自定义异常。
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.orange.demo.common.core.exception;
|
||||
package com.orangeforms.common.core.exception;
|
||||
|
||||
/**
|
||||
* Redis缓存访问失败。比如:获取分布式数据锁超时、等待线程中断等。
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.orange.demo.common.core.exception;
|
||||
package com.orangeforms.common.core.exception;
|
||||
|
||||
/**
|
||||
* 关联远程服务数据失败的自定义异常。
|
||||
@@ -1,10 +1,10 @@
|
||||
package com.orange.demo.common.core.interceptor;
|
||||
package com.orangeforms.common.core.interceptor;
|
||||
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.orange.demo.common.core.annotation.MyRequestBody;
|
||||
import com.orangeforms.common.core.annotation.MyRequestBody;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.core.MethodParameter;
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.orange.demo.common.core.listener;
|
||||
package com.orangeforms.common.core.listener;
|
||||
|
||||
import com.orange.demo.common.core.base.service.BaseService;
|
||||
import com.orangeforms.common.core.base.service.BaseService;
|
||||
import org.springframework.boot.context.event.ApplicationReadyEvent;
|
||||
import org.springframework.context.ApplicationListener;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.orange.demo.common.core.object;
|
||||
package com.orangeforms.common.core.object;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.Data;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.orange.demo.common.core.object;
|
||||
package com.orangeforms.common.core.object;
|
||||
|
||||
/**
|
||||
* 哑元对象,主要用于注解中的缺省对象占位符。
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.orange.demo.common.core.object;
|
||||
package com.orangeforms.common.core.object;
|
||||
|
||||
import cn.hutool.core.util.BooleanUtil;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.orange.demo.common.core.object;
|
||||
package com.orangeforms.common.core.object;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.orange.demo.common.core.object;
|
||||
package com.orangeforms.common.core.object;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.orange.demo.common.core.object;
|
||||
package com.orangeforms.common.core.object;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
@@ -1,11 +1,11 @@
|
||||
package com.orange.demo.common.core.object;
|
||||
package com.orangeforms.common.core.object;
|
||||
|
||||
import cn.hutool.core.util.ReflectUtil;
|
||||
import com.orange.demo.common.core.constant.ApplicationConstant;
|
||||
import com.orange.demo.common.core.exception.InvalidClassFieldException;
|
||||
import com.orange.demo.common.core.exception.InvalidDataFieldException;
|
||||
import com.orange.demo.common.core.exception.InvalidDataModelException;
|
||||
import com.orange.demo.common.core.util.MyModelUtil;
|
||||
import com.orangeforms.common.core.constant.ApplicationConstant;
|
||||
import com.orangeforms.common.core.exception.InvalidClassFieldException;
|
||||
import com.orangeforms.common.core.exception.InvalidDataFieldException;
|
||||
import com.orangeforms.common.core.exception.InvalidDataModelException;
|
||||
import com.orangeforms.common.core.util.MyModelUtil;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -1,11 +1,11 @@
|
||||
package com.orange.demo.common.core.object;
|
||||
package com.orangeforms.common.core.object;
|
||||
|
||||
import cn.hutool.core.util.ReflectUtil;
|
||||
import com.orange.demo.common.core.constant.ApplicationConstant;
|
||||
import com.orange.demo.common.core.exception.InvalidClassFieldException;
|
||||
import com.orange.demo.common.core.exception.InvalidDataFieldException;
|
||||
import com.orange.demo.common.core.exception.InvalidDataModelException;
|
||||
import com.orange.demo.common.core.util.MyModelUtil;
|
||||
import com.orangeforms.common.core.constant.ApplicationConstant;
|
||||
import com.orangeforms.common.core.exception.InvalidClassFieldException;
|
||||
import com.orangeforms.common.core.exception.InvalidDataFieldException;
|
||||
import com.orangeforms.common.core.exception.InvalidDataModelException;
|
||||
import com.orangeforms.common.core.util.MyModelUtil;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.orange.demo.common.core.object;
|
||||
package com.orangeforms.common.core.object;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.orange.demo.common.core.object;
|
||||
package com.orangeforms.common.core.object;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.orange.demo.common.core.object;
|
||||
package com.orangeforms.common.core.object;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import lombok.Data;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.orange.demo.common.core.object;
|
||||
package com.orangeforms.common.core.object;
|
||||
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
@@ -1,10 +1,10 @@
|
||||
package com.orange.demo.common.core.object;
|
||||
package com.orangeforms.common.core.object;
|
||||
|
||||
import cn.hutool.core.util.ReflectUtil;
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.orange.demo.common.core.exception.InvalidDataFieldException;
|
||||
import com.orange.demo.common.core.exception.InvalidDataModelException;
|
||||
import com.orange.demo.common.core.util.MyModelUtil;
|
||||
import com.orangeforms.common.core.exception.InvalidDataFieldException;
|
||||
import com.orangeforms.common.core.exception.InvalidDataModelException;
|
||||
import com.orangeforms.common.core.util.MyModelUtil;
|
||||
import lombok.*;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
@@ -1,8 +1,8 @@
|
||||
package com.orange.demo.common.core.object;
|
||||
package com.orangeforms.common.core.object;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.orange.demo.common.core.constant.ErrorCodeEnum;
|
||||
import com.orange.demo.common.core.util.ContextUtil;
|
||||
import com.orangeforms.common.core.constant.ErrorCodeEnum;
|
||||
import com.orangeforms.common.core.util.ContextUtil;
|
||||
import lombok.Data;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@@ -77,6 +77,20 @@ public class ResponseResult<T> {
|
||||
return errorCode == null ? success() : error(errorCode, errorMessage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据参数errorCodeEnum的枚举值,判断创建成功对象还是错误对象。
|
||||
* 如果返回错误对象,errorCode 和 errorMessage 分别取自于参数 errorCodeEnum 的 name() 和参数 errorMessage。
|
||||
*
|
||||
* @param errorCodeEnum 错误码枚举。
|
||||
* @param errorMessage 如果该参数为null,错误信息取自errorCodeEnum参数内置的errorMessage,否则使用当前参数。
|
||||
* @param data 如果错误枚举值为NO_ERROR,则返回该数据。
|
||||
* @return 返回创建的ResponseResult实例对象
|
||||
*/
|
||||
public static <T> ResponseResult<T> create(ErrorCodeEnum errorCodeEnum, String errorMessage, T data) {
|
||||
errorMessage = errorMessage != null ? errorMessage : errorCodeEnum.getErrorMessage();
|
||||
return errorCodeEnum == ErrorCodeEnum.NO_ERROR ? success(data) : error(errorCodeEnum.name(), errorMessage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建成功对象。
|
||||
* 如果需要绑定返回数据,可以在实例化后调用setDataObject方法。
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.orangeforms.common.core.object;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 数据表模型基础信息。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Data
|
||||
public class TableModelInfo {
|
||||
|
||||
/**
|
||||
* 数据表名。
|
||||
*/
|
||||
private String tableName;
|
||||
|
||||
/**
|
||||
* 实体对象名。
|
||||
*/
|
||||
private String modelName;
|
||||
|
||||
/**
|
||||
* 主键的表字段名。
|
||||
*/
|
||||
private String keyColumnName;
|
||||
|
||||
/**
|
||||
* 主键在实体对象中的属性名。
|
||||
*/
|
||||
private String keyFieldName;
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.orange.demo.common.core.object;
|
||||
package com.orangeforms.common.core.object;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.orange.demo.common.core.util.ContextUtil;
|
||||
import com.orangeforms.common.core.util.ContextUtil;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -32,11 +32,19 @@ public class TokenData {
|
||||
* 用户Id。
|
||||
*/
|
||||
private Long userId;
|
||||
/**
|
||||
* 用户所属角色。多个角色之间逗号分隔。
|
||||
*/
|
||||
private String roleIds;
|
||||
/**
|
||||
* 用户所在部门Id。
|
||||
* 仅当系统支持uaa时可用,否则可以直接忽略该字段。保留该字段是为了保持单体和微服务通用代码部分的兼容性。
|
||||
*/
|
||||
private Long deptId;
|
||||
/**
|
||||
* 用户所属岗位Id。多个岗位之间逗号分隔。仅当系统支持岗位时有值。
|
||||
*/
|
||||
private String postIds;
|
||||
/**
|
||||
* 用户的部门岗位Id。多个岗位之间逗号分隔。仅当系统支持岗位时有值。
|
||||
*/
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.orange.demo.common.core.object;
|
||||
package com.orangeforms.common.core.object;
|
||||
|
||||
/**
|
||||
* 二元组对象。主要用于可以一次返回多个结果的场景,同时还能避免强制转换。
|
||||
@@ -1,9 +1,9 @@
|
||||
package com.orange.demo.common.core.upload;
|
||||
package com.orangeforms.common.core.upload;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.orange.demo.common.core.constant.ApplicationConstant;
|
||||
import com.orange.demo.common.core.util.ContextUtil;
|
||||
import com.orange.demo.common.core.util.MyCommonUtil;
|
||||
import com.orangeforms.common.core.constant.ApplicationConstant;
|
||||
import com.orangeforms.common.core.util.ContextUtil;
|
||||
import com.orangeforms.common.core.util.MyCommonUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.io.FilenameUtils;
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.orange.demo.common.core.upload;
|
||||
package com.orangeforms.common.core.upload;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.orange.demo.common.core.constant.ErrorCodeEnum;
|
||||
import com.orangeforms.common.core.constant.ErrorCodeEnum;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.orange.demo.common.core.upload;
|
||||
package com.orangeforms.common.core.upload;
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.orange.demo.common.core.upload;
|
||||
package com.orangeforms.common.core.upload;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.orange.demo.common.core.upload;
|
||||
package com.orangeforms.common.core.upload;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.orange.demo.common.core.upload;
|
||||
package com.orangeforms.common.core.upload;
|
||||
|
||||
/**
|
||||
* 上传数据存储介质类型枚举。
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.orange.demo.common.core.util;
|
||||
package com.orangeforms.common.core.util;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.aop.framework.AdvisedSupport;
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.orange.demo.common.core.util;
|
||||
package com.orangeforms.common.core.util;
|
||||
|
||||
import com.orange.demo.common.core.exception.MyRuntimeException;
|
||||
import com.orangeforms.common.core.exception.MyRuntimeException;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.ApplicationContextAware;
|
||||
import org.springframework.lang.NonNull;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.orange.demo.common.core.util;
|
||||
package com.orangeforms.common.core.util;
|
||||
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.orange.demo.common.core.util;
|
||||
package com.orangeforms.common.core.util;
|
||||
|
||||
/**
|
||||
* 基于自定义解析规则的多数据源解析接口。
|
||||
@@ -1,11 +1,11 @@
|
||||
package com.orange.demo.common.core.util;
|
||||
package com.orangeforms.common.core.util;
|
||||
|
||||
import cn.hutool.core.io.IoUtil;
|
||||
import cn.hutool.poi.excel.ExcelUtil;
|
||||
import cn.hutool.poi.excel.ExcelWriter;
|
||||
import cn.jimmyshi.beanquery.BeanQuery;
|
||||
import com.orange.demo.common.core.constant.ApplicationConstant;
|
||||
import com.orange.demo.common.core.exception.MyRuntimeException;
|
||||
import com.orangeforms.common.core.constant.ApplicationConstant;
|
||||
import com.orangeforms.common.core.exception.MyRuntimeException;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.csv.CSVFormat;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.orange.demo.common.core.util;
|
||||
package com.orangeforms.common.core.util;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
@@ -38,6 +38,9 @@ public class IpUtil {
|
||||
// Proxy-Client-IP:apache 服务代理
|
||||
ipAddresses = request.getHeader("Proxy-Client-IP");
|
||||
}
|
||||
if (StringUtils.isBlank(ipAddresses) || UNKNOWN.equalsIgnoreCase(ipAddresses)) {
|
||||
ipAddresses = request.getHeader("HTTP_X_FORWARDED_FOR");
|
||||
}
|
||||
if (StringUtils.isBlank(ipAddresses) || UNKNOWN.equalsIgnoreCase(ipAddresses)) {
|
||||
// WL-Proxy-Client-IP:weblogic 服务代理
|
||||
ipAddresses = request.getHeader("WL-Proxy-Client-IP");
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.orange.demo.common.core.util;
|
||||
package com.orangeforms.common.core.util;
|
||||
|
||||
import io.jsonwebtoken.Claims;
|
||||
import io.jsonwebtoken.Jwts;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.orange.demo.common.core.util;
|
||||
package com.orangeforms.common.core.util;
|
||||
|
||||
/**
|
||||
* 拼接日志消息的工具类。
|
||||
@@ -1,12 +1,13 @@
|
||||
package com.orange.demo.common.core.util;
|
||||
package com.orangeforms.common.core.util;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.ReflectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.crypto.digest.DigestUtil;
|
||||
import com.orange.demo.common.core.constant.AppDeviceType;
|
||||
import com.orange.demo.common.core.validator.AddGroup;
|
||||
import com.orange.demo.common.core.validator.UpdateGroup;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.orangeforms.common.core.constant.AppDeviceType;
|
||||
import com.orangeforms.common.core.validator.AddGroup;
|
||||
import com.orangeforms.common.core.validator.UpdateGroup;
|
||||
|
||||
import javax.validation.ConstraintViolation;
|
||||
import javax.validation.Validation;
|
||||
@@ -236,6 +237,56 @@ public class MyCommonUtil {
|
||||
return new String[]{};
|
||||
}
|
||||
|
||||
/**
|
||||
* 在调用分布式事务产生错误时,通过该方法可构建一对多关联插入错误的字符串。
|
||||
*
|
||||
* @param clazz 服务实现类的Class。
|
||||
* @param errorMessage 错误信息。
|
||||
* @param mainData 主数据。
|
||||
* @param relationData 一对多关联数据列表。
|
||||
* @param <M> 主数据类型。
|
||||
* @param <R> 一对多关联对象类型。
|
||||
* @return 拼接后的错误信息。
|
||||
*/
|
||||
public static <M, R> String makeAddRelationGlobalTransError(
|
||||
Class<?> clazz, String errorMessage, M mainData, List<R> relationData) {
|
||||
return String.format("Failed to remote call {%s} cascadeAddRelationList for error {%s} with main data {%s} and OneToMany relation data {%s}",
|
||||
clazz.getSimpleName(), errorMessage, JSON.toJSONString(mainData), JSON.toJSONString(relationData));
|
||||
}
|
||||
|
||||
/**
|
||||
* 在调用分布式事务产生错误时,通过该方法可构建一对一关联插入错误的字符串。
|
||||
*
|
||||
* @param clazz 服务实现类的Class。
|
||||
* @param errorMessage 错误信息。
|
||||
* @param mainData 主数据。
|
||||
* @param relationData 一对一关联数据列表。
|
||||
* @param <M> 主数据类型。
|
||||
* @param <R> 一对一关联对象类型。
|
||||
* @return 拼接后的错误信息。
|
||||
*/
|
||||
public static <M, R> String makeAddRelationGlobalTransError(
|
||||
Class<?> clazz, String errorMessage, M mainData, R relationData) {
|
||||
return String.format("Failed to remote call {%s} cascadeAddRelation for error {%s} with main data {%s} and OneToOne relation data {%s}",
|
||||
clazz.getSimpleName(), errorMessage, JSON.toJSONString(mainData), JSON.toJSONString(relationData));
|
||||
}
|
||||
|
||||
/**
|
||||
* 在调用分布式事务产生错误时,通过该方法可构建删除关联数据错误的字符串。
|
||||
*
|
||||
* @param clazz 服务实现类的Class。
|
||||
* @param remoteClazz 远程客户端的Class。
|
||||
* @param errorMessage 错误信息。
|
||||
* @param id 主表主键值。
|
||||
* @param <K> 主表主键类型。
|
||||
* @return 拼接后的错误信息。
|
||||
*/
|
||||
public static <K> String makeDeleteRelationGlobalTransError(
|
||||
Class<?> clazz, Class<?> remoteClazz, String errorMessage, K id) {
|
||||
return String.format("Failed to remote call {%s} cascadeDeleteRelation for error {%s} with remote client {%s} and id {%s}",
|
||||
clazz.getSimpleName(), remoteClazz.getSimpleName(), errorMessage, id.toString());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取请求头中的设备信息。
|
||||
*
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.orange.demo.common.core.util;
|
||||
package com.orangeforms.common.core.util;
|
||||
|
||||
import com.orange.demo.common.core.object.Tuple2;
|
||||
import com.orangeforms.common.core.object.Tuple2;
|
||||
import org.apache.commons.lang3.time.DateUtils;
|
||||
import org.joda.time.DateTime;
|
||||
import org.joda.time.Period;
|
||||
@@ -1,14 +1,14 @@
|
||||
package com.orange.demo.common.core.util;
|
||||
package com.orangeforms.common.core.util;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.ReflectUtil;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.orange.demo.common.core.exception.InvalidDataFieldException;
|
||||
import com.orange.demo.common.core.annotation.*;
|
||||
import com.orange.demo.common.core.exception.MyRuntimeException;
|
||||
import com.orange.demo.common.core.object.TokenData;
|
||||
import com.orange.demo.common.core.object.Tuple2;
|
||||
import com.orange.demo.common.core.upload.UploadStoreInfo;
|
||||
import com.orangeforms.common.core.exception.InvalidDataFieldException;
|
||||
import com.orangeforms.common.core.annotation.*;
|
||||
import com.orangeforms.common.core.exception.MyRuntimeException;
|
||||
import com.orangeforms.common.core.object.TokenData;
|
||||
import com.orangeforms.common.core.object.Tuple2;
|
||||
import com.orangeforms.common.core.upload.UploadStoreInfo;
|
||||
import com.google.common.base.CaseFormat;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user