| @@ -0,0 +1,24 @@ | |||
| # EditorConfig helps developers define and maintain consistent | |||
| # coding styles between different editors and IDEs | |||
| # editorconfig.org | |||
| root = true | |||
| [*] | |||
| # Change these settings to your own preference | |||
| indent_style = space | |||
| indent_size = 4 | |||
| # We recommend you to keep these unchanged | |||
| end_of_line = lf | |||
| charset = utf-8 | |||
| trim_trailing_whitespace = true | |||
| insert_final_newline = true | |||
| [*.md] | |||
| trim_trailing_whitespace = false | |||
| [package.json] | |||
| indent_style = space | |||
| indent_size = 2 | |||
| @@ -0,0 +1,38 @@ | |||
| { | |||
| "generator-jhipster": { | |||
| "promptValues": { | |||
| "packageName": "vn.azteam.tpf", | |||
| "nativeLanguage": "en" | |||
| }, | |||
| "jhipsterVersion": "5.7.2", | |||
| "applicationType": "monolith", | |||
| "baseName": "tpf", | |||
| "packageName": "vn.azteam.tpf", | |||
| "packageFolder": "vn/azteam/tpf", | |||
| "serverPort": "8080", | |||
| "authenticationType": "jwt", | |||
| "cacheProvider": "ehcache", | |||
| "enableHibernateCache": true, | |||
| "websocket": "spring-websocket", | |||
| "databaseType": "sql", | |||
| "devDatabaseType": "mysql", | |||
| "prodDatabaseType": "mysql", | |||
| "searchEngine": "elasticsearch", | |||
| "messageBroker": false, | |||
| "serviceDiscoveryType": false, | |||
| "buildTool": "gradle", | |||
| "enableSwaggerCodegen": false, | |||
| "jwtSecretKey": "OWFjMjcyOGU3ZGI3NTBjMDA3ZTk2M2FkY2Y3MDNhMDA1MTc0ZDFlNjA4ZWExMjM5NWNlNzhjNmY2ZjQzOGRjZDA2Nzk0ZGRhM2U0YTQ5YTZhMGZiMzMzYTdiYTdmYWQ4NjI2NGZjYWY0NzE1Zjc0MjdmZWVkZTIwNTkxZWEwMzI=", | |||
| "testFrameworks": [], | |||
| "jhiPrefix": "jhi", | |||
| "otherModules": [], | |||
| "enableTranslation": true, | |||
| "clientPackageManager": "npm", | |||
| "nativeLanguage": "en", | |||
| "languages": [ | |||
| "en", | |||
| "vi" | |||
| ], | |||
| "skipClient": true | |||
| } | |||
| } | |||
| @@ -1,2 +1,91 @@ | |||
| # smartfarm-api | |||
| # smf | |||
| This application was generated using JHipster 5.7.2, you can find documentation and help at [https://www.jhipster.tech/documentation-archive/v5.7.2](https://www.jhipster.tech/documentation-archive/v5.7.2). | |||
| ## Development | |||
| To start your application in the dev profile, simply run: | |||
| ./gradlew | |||
| For further instructions on how to develop with JHipster, have a look at [Using JHipster in development][]. | |||
| Clone `application-dev.yml` to your profile `application-dev-[your-profile].yml`. Configure your environment variables. | |||
| Run application by executing command `bootRun` and override default profile property: | |||
| `gradlew clean bootRun --args='--spring.profiles.active=dev-[your-profile]'` | |||
| Create casbin data by running sql `src/main/resources/casbin/casbin_rule.sql` and clean build again. | |||
| ## Building for production | |||
| To optimize the tpf application for production, run: | |||
| ./gradlew -Pprod clean bootWar | |||
| To ensure everything worked, run: | |||
| java -jar build/libs/*.war | |||
| Refer to [Using JHipster in production][] for more details. | |||
| ## Testing | |||
| To launch your application's tests, run: | |||
| ./gradlew test | |||
| For more information, refer to the [Running tests page][]. | |||
| ### Code quality | |||
| Sonar is used to analyse code quality. You can start a local Sonar server (accessible on http://localhost:9001) with: | |||
| ``` | |||
| docker-compose -f src/main/docker/sonar.yml up -d | |||
| ``` | |||
| Then, run a Sonar analysis: | |||
| ``` | |||
| ./gradlew -Pprod clean test sonarqube | |||
| ``` | |||
| For more information, refer to the [Code quality page][]. | |||
| ## Using Docker to simplify development (optional) | |||
| You can use Docker to improve your JHipster development experience. A number of docker-compose configuration are available in the [src/main/docker](src/main/docker) folder to launch required third party services. | |||
| For example, to start a mysql database in a docker container, run: | |||
| docker-compose -f src/main/docker/mysql.yml up -d | |||
| To stop it and remove the container, run: | |||
| docker-compose -f src/main/docker/mysql.yml down | |||
| You can also fully dockerize your application and all the services that it depends on. | |||
| To achieve this, first build a docker image of your app by running: | |||
| ./gradlew bootWar -Pprod jibDockerBuild | |||
| Then run: | |||
| docker-compose -f src/main/docker/app.yml up -d | |||
| For more information refer to [Using Docker and Docker-Compose][], this page also contains information on the docker-compose sub-generator (`jhipster docker-compose`), which is able to generate docker configurations for one or several JHipster applications. | |||
| ## Continuous Integration (optional) | |||
| To configure CI for your project, run the ci-cd sub-generator (`jhipster ci-cd`), this will let you generate configuration files for a number of Continuous Integration systems. Consult the [Setting up Continuous Integration][] page for more information. | |||
| [jhipster homepage and latest documentation]: https://www.jhipster.tech | |||
| [jhipster 5.7.2 archive]: https://www.jhipster.tech/documentation-archive/v5.7.2 | |||
| [using jhipster in development]: https://www.jhipster.tech/documentation-archive/v5.7.2/development/ | |||
| [using docker and docker-compose]: https://www.jhipster.tech/documentation-archive/v5.7.2/docker-compose | |||
| [using jhipster in production]: https://www.jhipster.tech/documentation-archive/v5.7.2/production/ | |||
| [running tests page]: https://www.jhipster.tech/documentation-archive/v5.7.2/running-tests/ | |||
| [code quality page]: https://www.jhipster.tech/documentation-archive/v5.7.2/code-quality/ | |||
| [setting up continuous integration]: https://www.jhipster.tech/documentation-archive/v5.7.2/setting-up-ci/ | |||
| @@ -0,0 +1,301 @@ | |||
| import org.gradle.internal.os.OperatingSystem | |||
| buildscript { | |||
| repositories { | |||
| mavenLocal() | |||
| mavenCentral() | |||
| maven { url "https://repo.spring.io/plugins-release" } | |||
| maven { url "https://plugins.gradle.org/m2/" } | |||
| } | |||
| dependencies { | |||
| classpath "org.springframework.boot:spring-boot-gradle-plugin:${spring_boot_version}" | |||
| classpath "io.spring.gradle:propdeps-plugin:0.0.10.RELEASE" | |||
| classpath "gradle.plugin.com.gorylenko.gradle-git-properties:gradle-git-properties:1.5.2" | |||
| //jhipster-needle-gradle-buildscript-dependency - JHipster will add additional gradle build script plugins here | |||
| } | |||
| } | |||
| plugins { | |||
| id "org.sonarqube" version "2.6.2" | |||
| id "net.ltgt.apt-eclipse" version "0.19" | |||
| id "net.ltgt.apt-idea" version "0.19" | |||
| id "net.ltgt.apt" version "0.19" | |||
| id "io.spring.dependency-management" version "1.0.6.RELEASE" | |||
| id "com.moowork.node" version "1.2.0" | |||
| id 'org.liquibase.gradle' version '2.0.1' | |||
| //jhipster-needle-gradle-plugins - JHipster will add additional gradle plugins here | |||
| } | |||
| apply plugin: 'java' | |||
| sourceCompatibility=1.8 | |||
| targetCompatibility=1.8 | |||
| // Until JHipster supports JDK 9 | |||
| assert System.properties['java.specification.version'] == '1.8' | |||
| apply plugin: 'maven' | |||
| apply plugin: 'org.springframework.boot' | |||
| apply plugin: 'war' | |||
| apply plugin: 'propdeps' | |||
| apply plugin: 'com.moowork.node' | |||
| apply plugin: 'io.spring.dependency-management' | |||
| apply plugin: 'idea' | |||
| dependencyManagement { | |||
| imports { | |||
| mavenBom 'io.github.jhipster:jhipster-dependencies:' + jhipster_dependencies_version | |||
| //jhipster-needle-gradle-dependency-management - JHipster will add additional dependencies management here | |||
| } | |||
| } | |||
| defaultTasks 'bootRun' | |||
| group = 'vn.azteam' | |||
| version = '0.0.1-SNAPSHOT' | |||
| description = '' | |||
| bootWar { | |||
| mainClassName = 'vn.azteam.tpf.TPFApp' | |||
| } | |||
| war { | |||
| enabled = true | |||
| classifier = 'original' | |||
| } | |||
| springBoot { | |||
| mainClassName = 'vn.azteam.tpf.TPFApp' | |||
| buildInfo() | |||
| } | |||
| if (OperatingSystem.current().isWindows()) { | |||
| // https://stackoverflow.com/questions/40037487/the-filename-or-extension-is-too-long-error-using-gradle | |||
| task classpathJar(type: Jar) { | |||
| dependsOn configurations.runtime | |||
| appendix = 'classpath' | |||
| doFirst { | |||
| manifest { | |||
| attributes 'Class-Path': configurations.runtime.files.collect { | |||
| it.toURI().toURL().toString().replaceFirst(/file:\/+/, '/').replaceAll(' ', '%20') | |||
| }.join(' ') | |||
| } | |||
| } | |||
| } | |||
| bootRun { | |||
| dependsOn classpathJar | |||
| doFirst { | |||
| classpath = files("$buildDir/classes/java/main", "$buildDir/resources/main", classpathJar.archivePath) | |||
| } | |||
| } | |||
| } | |||
| test { | |||
| exclude '**/CucumberTest*' | |||
| // uncomment if the tests reports are not generated | |||
| // see https://github.com/jhipster/generator-jhipster/pull/2771 and https://github.com/jhipster/generator-jhipster/pull/4484 | |||
| // ignoreFailures true | |||
| reports.html.enabled = false | |||
| } | |||
| task testReport(type: TestReport) { | |||
| destinationDir = file("$buildDir/reports/tests") | |||
| reportOn test | |||
| } | |||
| apply from: 'gradle/docker.gradle' | |||
| apply from: 'gradle/sonar.gradle' | |||
| //jhipster-needle-gradle-apply-from - JHipster will add additional gradle scripts to be applied here | |||
| if (project.hasProperty('prod')) { | |||
| apply from: 'gradle/profile_prod.gradle' | |||
| } else { | |||
| apply from: 'gradle/profile_dev.gradle' | |||
| } | |||
| if (!project.hasProperty('runList')) { | |||
| project.ext.runList = 'main' | |||
| } | |||
| project.ext.diffChangelogFile = 'src/main/resources/config/liquibase/changelog/' + new Date().format('yyyyMMddHHmmss') + '_changelog.xml' | |||
| liquibase { | |||
| activities { | |||
| main { | |||
| driver 'com.mysql.jdbc.Driver' | |||
| url 'jdbc:mysql://1.0.0.4:3306/smf' | |||
| username 'root' | |||
| password 'P@ssw0rdfarm' | |||
| changeLogFile 'src/main/resources/config/liquibase/master.xml' | |||
| defaultSchemaName 'smf' | |||
| logLevel 'debug' | |||
| classpath 'src/main/resources/' | |||
| } | |||
| diffLog { | |||
| driver 'com.mysql.jdbc.Driver' | |||
| url 'jdbc:mysql://1.0.0.4:3306/smf' | |||
| username 'root' | |||
| password 'P@ssw0rdfarm' | |||
| changeLogFile project.ext.diffChangelogFile | |||
| referenceUrl 'hibernate:spring:vn.azteam.smf.domain?dialect=org.hibernate.dialect.MySQL5InnoDBDialect&hibernate.physical_naming_strategy=org.springframework.boot.orm.jpa.hibernate.SpringPhysicalNamingStrategy&hibernate.implicit_naming_strategy=org.springframework.boot.orm.jpa.hibernate.SpringImplicitNamingStrategy' | |||
| defaultSchemaName 'smf' | |||
| logLevel 'debug' | |||
| classpath "$buildDir/classes/java/main" | |||
| } | |||
| } | |||
| runList = project.ext.runList | |||
| } | |||
| configurations { | |||
| providedRuntime | |||
| compile.exclude module: "spring-boot-starter-tomcat" | |||
| } | |||
| repositories { | |||
| mavenLocal() | |||
| mavenCentral() | |||
| jcenter() | |||
| //jhipster-needle-gradle-repositories - JHipster will add additional repositories | |||
| } | |||
| dependencies { | |||
| // Use ", version: jhipster_dependencies_version, changing: true" if you want | |||
| // to use a SNAPSHOT release instead of a stable release | |||
| // https://mvnrepository.com/artifact/com.google.firebase/firebase-admin | |||
| compile group: 'com.google.firebase', name: 'firebase-admin', version: '7.0.1' | |||
| // https://mvnrepository.com/artifact/org.casbin/casbin-spring-boot-starter | |||
| compile group: 'org.casbin', name: 'casbin-spring-boot-starter', version: '0.0.9' | |||
| compile group: "io.github.jhipster", name: "jhipster-framework" | |||
| compile "org.apache.poi:poi:4.1.2" | |||
| compile "org.apache.poi:poi-ooxml:4.1.2" | |||
| compile "org.apache.poi:ooxml-schemas:1.4" | |||
| // https://mvnrepository.com/artifact/org.apache.xmlbeans/xmlbeans | |||
| compile group: 'org.apache.xmlbeans', name: 'xmlbeans', version: '3.1.0' | |||
| compile "org.springframework.boot:spring-boot-starter-cache" | |||
| compile "io.dropwizard.metrics:metrics-core" | |||
| compile "io.dropwizard.metrics:metrics-jcache" | |||
| compile "io.dropwizard.metrics:metrics-json" | |||
| compile "io.dropwizard.metrics:metrics-jvm" | |||
| compile "io.dropwizard.metrics:metrics-servlet" | |||
| compile "io.dropwizard.metrics:metrics-servlets" | |||
| compile "io.prometheus:simpleclient" | |||
| compile "io.prometheus:simpleclient_dropwizard" | |||
| compile "io.prometheus:simpleclient_servlet" | |||
| compile "net.logstash.logback:logstash-logback-encoder" | |||
| compile "com.fasterxml.jackson.datatype:jackson-datatype-hppc" | |||
| compile "com.fasterxml.jackson.datatype:jackson-datatype-jsr310" | |||
| compile "com.fasterxml.jackson.datatype:jackson-datatype-hibernate5" | |||
| compile "com.fasterxml.jackson.core:jackson-annotations" | |||
| compile "com.fasterxml.jackson.core:jackson-databind" | |||
| compile "com.fasterxml.jackson.module:jackson-module-afterburner" | |||
| compile "com.opencsv:opencsv:4.5" | |||
| compile "com.ryantenney.metrics:metrics-spring" | |||
| compile "javax.cache:cache-api" | |||
| compile "org.hibernate:hibernate-core" | |||
| compile "com.zaxxer:HikariCP" | |||
| compile "org.apache.commons:commons-lang3" | |||
| compile "commons-io:commons-io" | |||
| compile "javax.transaction:javax.transaction-api" | |||
| compile "org.ehcache:ehcache" | |||
| compile "org.hibernate:hibernate-jcache" | |||
| compile "org.hibernate:hibernate-entitymanager" | |||
| compile "org.hibernate:hibernate-envers" | |||
| compile "org.hibernate.validator:hibernate-validator" | |||
| compile "org.liquibase:liquibase-core" | |||
| compile "com.mattbertolini:liquibase-slf4j" | |||
| liquibaseRuntime "org.liquibase:liquibase-core" | |||
| liquibaseRuntime "org.liquibase.ext:liquibase-hibernate5:${liquibase_hibernate5_version}" | |||
| liquibaseRuntime sourceSets.main.compileClasspath | |||
| compile "org.springframework.boot:spring-boot-loader-tools" | |||
| compile "org.springframework.boot:spring-boot-starter-mail" | |||
| compile "org.springframework.boot:spring-boot-starter-logging" | |||
| compile "org.springframework.boot:spring-boot-starter-actuator" | |||
| compile "org.springframework.boot:spring-boot-starter-aop" | |||
| compile "org.springframework.boot:spring-boot-starter-data-jpa" | |||
| compile "org.springframework.boot:spring-boot-starter-data-elasticsearch" | |||
| // Spring Data Jest dependencies for Elasticsearch | |||
| compile ("com.github.vanroy:spring-boot-starter-data-jest") { | |||
| exclude module: 'commons-logging' | |||
| } | |||
| // log4j needed to create embedded elasticsearch instance | |||
| runtime "org.apache.logging.log4j:log4j-api:2.7" | |||
| runtime "org.apache.logging.log4j:log4j-core:2.7" | |||
| // end of Spring Data Jest dependencies | |||
| compile "org.springframework.boot:spring-boot-starter-security" | |||
| compile ("org.springframework.boot:spring-boot-starter-web") { | |||
| exclude module: 'spring-boot-starter-tomcat' | |||
| } | |||
| compile "org.springframework.boot:spring-boot-starter-json" | |||
| compile "org.springframework.boot:spring-boot-starter-undertow" | |||
| compile "org.springframework.boot:spring-boot-starter-websocket" | |||
| compile "org.springframework.boot:spring-boot-starter-thymeleaf" | |||
| compile "org.zalando:problem-spring-web:0.24.0-RC.0" | |||
| compile "org.springframework.boot:spring-boot-starter-cloud-connectors" | |||
| compile "org.springframework.security:spring-security-config" | |||
| compile "org.springframework.security:spring-security-data" | |||
| compile "org.springframework.security:spring-security-web" | |||
| compile "org.springframework.security:spring-security-messaging" | |||
| compile "io.jsonwebtoken:jjwt-api" | |||
| runtime "io.jsonwebtoken:jjwt-impl" | |||
| runtime "io.jsonwebtoken:jjwt-jackson" | |||
| compile ("io.springfox:springfox-swagger2") { | |||
| exclude module: 'mapstruct' | |||
| } | |||
| compile "io.springfox:springfox-bean-validators" | |||
| compile "mysql:mysql-connector-java" | |||
| liquibaseRuntime "mysql:mysql-connector-java" | |||
| compile "org.mapstruct:mapstruct-jdk8:${mapstruct_version}" | |||
| annotationProcessor "org.mapstruct:mapstruct-processor:${mapstruct_version}" | |||
| annotationProcessor "org.hibernate:hibernate-jpamodelgen" | |||
| annotationProcessor ("org.springframework.boot:spring-boot-configuration-processor") { | |||
| exclude group: 'com.vaadin.external.google', module: 'android-json' | |||
| } | |||
| testCompile "com.jayway.jsonpath:json-path" | |||
| testCompile ("org.springframework.boot:spring-boot-starter-test") { | |||
| exclude group: 'com.vaadin.external.google', module: 'android-json' | |||
| } | |||
| testCompile "org.springframework.security:spring-security-test" | |||
| testCompile "org.springframework.boot:spring-boot-test" | |||
| testCompile "org.assertj:assertj-core" | |||
| testCompile "junit:junit" | |||
| testCompile "org.mockito:mockito-core" | |||
| testCompile "com.mattbertolini:liquibase-slf4j" | |||
| testCompile "org.hamcrest:hamcrest-library" | |||
| testCompile "com.h2database:h2" | |||
| //jhipster-needle-gradle-dependency - JHipster will add additional dependencies here | |||
| // https://mvnrepository.com/artifact/org.projectlombok/lombok | |||
| provided group: 'org.projectlombok', name: 'lombok', version: '1.18.4' | |||
| } | |||
| task cleanResources(type: Delete) { | |||
| delete 'build/resources' | |||
| } | |||
| wrapper { | |||
| gradleVersion = '4.10.2' | |||
| } | |||
| task stage(dependsOn: 'bootWar') { | |||
| } | |||
| //if (project.hasProperty('nodeInstall')) { | |||
| node { | |||
| download = true | |||
| version = "${node_version}" | |||
| npmVersion = "${npm_version}" | |||
| yarnVersion = "${yarn_version}" | |||
| } | |||
| //} | |||
| bootWar.dependsOn war | |||
| compileJava.dependsOn processResources | |||
| processResources.dependsOn cleanResources,bootBuildInfo | |||
| bootBuildInfo.mustRunAfter cleanResources | |||
| @@ -0,0 +1,51 @@ | |||
| rootProject.name=smart-farm | |||
| profile=prod | |||
| # Build properties | |||
| node_version=10.14.1 | |||
| npm_version=6.4.1 | |||
| yarn_version=1.12.3 | |||
| # Dependency versions | |||
| jhipster_dependencies_version=2.0.29 | |||
| # The spring-boot version should match the one managed by | |||
| # https://mvnrepository.com/artifact/io.github.jhipster/jhipster-dependencies/${jhipster_dependencies_version} | |||
| spring_boot_version=2.0.7.RELEASE | |||
| # The hibernate version should match the one managed by | |||
| # https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-dependencies/${spring-boot.version} --> | |||
| hibernate_version=5.2.17.Final | |||
| mapstruct_version=1.2.0.Final | |||
| liquibase_hibernate5_version=3.6 | |||
| liquibaseTaskPrefix=liquibase | |||
| ## below are some of the gradle performance improvement settings that can be used as required, these are not enabled by default | |||
| ## The Gradle daemon aims to improve the startup and execution time of Gradle. | |||
| ## The daemon is enabled by default in Gradle 3+ setting this to false will disable this. | |||
| ## TODO: disable daemon on CI, since builds should be clean and reliable on servers | |||
| ## https://docs.gradle.org/current/userguide/gradle_daemon.html#sec:ways_to_disable_gradle_daemon | |||
| ## un comment the below line to disable the daemon | |||
| #org.gradle.daemon=false | |||
| ## Specifies the JVM arguments used for the daemon process. | |||
| ## The setting is particularly useful for tweaking memory settings. | |||
| ## Default value: -Xmx1024m -XX:MaxPermSize=256m | |||
| ## un comment the below line to override the daemon defaults | |||
| #org.gradle.jvmargs=-Xmx1024m -XX:MaxPermSize=256m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 | |||
| ## When configured, Gradle will run in incubating parallel mode. | |||
| ## This option should only be used with decoupled projects. More details, visit | |||
| ## http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects | |||
| ## un comment the below line to enable parallel mode | |||
| #org.gradle.parallel=true | |||
| ## Enables new incubating mode that makes Gradle selective when configuring projects. | |||
| ## Only relevant projects are configured which results in faster builds for large multi-projects. | |||
| ## http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:configuration_on_demand | |||
| ## un comment the below line to enable the selective mode | |||
| #org.gradle.configureondemand=true | |||
| @@ -0,0 +1,29 @@ | |||
| buildscript { | |||
| repositories { | |||
| gradlePluginPortal() | |||
| } | |||
| dependencies { | |||
| classpath "gradle.plugin.com.google.cloud.tools:jib-gradle-plugin:0.9.11" | |||
| } | |||
| } | |||
| apply plugin: com.google.cloud.tools.jib.gradle.JibPlugin | |||
| jib { | |||
| from { | |||
| image = 'openjdk:8-jre-alpine' | |||
| } | |||
| to { | |||
| image = 'tpf:latest' | |||
| } | |||
| container { | |||
| entrypoint = ['sh', '-c', 'chmod +x /entrypoint.sh && sync && /entrypoint.sh'] | |||
| ports = ['8080'] | |||
| environment = [ | |||
| SPRING_OUTPUT_ANSI_ENABLED: 'ALWAYS', | |||
| JHIPSTER_SLEEP: '0' | |||
| ] | |||
| useCurrentTimestamp = true | |||
| } | |||
| } | |||
| @@ -0,0 +1,52 @@ | |||
| import org.gradle.internal.os.OperatingSystem | |||
| apply plugin: 'org.springframework.boot' | |||
| apply plugin: 'com.moowork.node' | |||
| dependencies { | |||
| compile "org.springframework.boot:spring-boot-devtools" | |||
| } | |||
| def profiles = 'dev' | |||
| if (project.hasProperty('no-liquibase')) { | |||
| profiles += ',no-liquibase' | |||
| } | |||
| if (project.hasProperty('tls')) { | |||
| profiles += ',tls' | |||
| } | |||
| bootRun { | |||
| args = [] | |||
| } | |||
| task copySwaggerDev(type: NpmTask, dependsOn: 'npm_install') { | |||
| inputs.dir("src/main/webapp/") | |||
| inputs.files(fileTree('src/main/webapp/')) | |||
| outputs.dir("build/www/") | |||
| outputs.file("build/www/app/main.bundle.js") | |||
| args = ["run", "copy-swagger"] | |||
| } | |||
| war { | |||
| webAppDirName = 'build/www/' | |||
| } | |||
| task copyIntoStatic (type: Copy) { | |||
| from 'build/www/' | |||
| into 'build/resources/main/static' | |||
| } | |||
| processResources { | |||
| filesMatching('**/application.yml') { | |||
| filter { | |||
| it.replace('#project.version#', version) | |||
| } | |||
| filter { | |||
| it.replace('#spring.profiles.active#', profiles) | |||
| } | |||
| } | |||
| } | |||
| processResources.dependsOn copySwaggerDev | |||
| copyIntoStatic.dependsOn processResources | |||
| bootJar.dependsOn copyIntoStatic | |||
| @@ -0,0 +1,58 @@ | |||
| apply plugin: 'org.springframework.boot' | |||
| apply plugin: 'com.gorylenko.gradle-git-properties' | |||
| apply plugin: 'com.moowork.node' | |||
| dependencies { | |||
| testCompile "com.h2database:h2" | |||
| } | |||
| def profiles = 'prod' | |||
| if (project.hasProperty('no-liquibase')) { | |||
| profiles += ',no-liquibase' | |||
| } | |||
| if (project.hasProperty('swagger')) { | |||
| profiles += ',swagger' | |||
| } | |||
| bootRun { | |||
| args = [] | |||
| } | |||
| task copySwagger(type: NpmTask, dependsOn: 'npm_install') { | |||
| args = ["run", "copy-swagger"] | |||
| } | |||
| war { | |||
| webAppDirName = 'build/www/' | |||
| } | |||
| task copyIntoStatic (type: Copy) { | |||
| from 'build/www/' | |||
| into 'build/resources/main/static' | |||
| } | |||
| processResources { | |||
| filesMatching('**/application.yml') { | |||
| filter { | |||
| it.replace('#project.version#', version) | |||
| } | |||
| filter { | |||
| it.replace('#spring.profiles.active#', profiles) | |||
| } | |||
| } | |||
| } | |||
| generateGitProperties { | |||
| onlyIf { | |||
| !source.isEmpty() | |||
| } | |||
| } | |||
| gitProperties { | |||
| keys = ['git.branch', 'git.commit.id.abbrev', 'git.commit.id.describe'] | |||
| } | |||
| processResources.dependsOn copySwagger | |||
| copyIntoStatic.dependsOn processResources | |||
| bootJar.dependsOn copyIntoStatic | |||
| @@ -0,0 +1,47 @@ | |||
| apply plugin: "org.sonarqube" | |||
| apply plugin: 'jacoco' | |||
| jacoco { | |||
| toolVersion = '0.8.2' | |||
| } | |||
| jacocoTestReport { | |||
| reports { | |||
| xml.enabled true | |||
| } | |||
| } | |||
| sonarqube { | |||
| properties { | |||
| property "sonar.host.url", "http://localhost:9001" | |||
| property "sonar.exclusions", "src/main/webapp/content/**/*.*,src/main/webapp/i18n/*.js, build/www/**/*.*" | |||
| property "sonar.issue.ignore.multicriteria", "S3437,S4502,S4684,UndocumentedApi,BoldAndItalicTagsCheck" | |||
| // Rule https://sonarcloud.io/coding_rules?open=Web%3ABoldAndItalicTagsCheck&rule_key=Web%3ABoldAndItalicTagsCheck is ignored. Even if we agree that using the "i" tag is an awful practice, this is what is recommended by http://fontawesome.io/examples/ | |||
| property "sonar.issue.ignore.multicriteria.BoldAndItalicTagsCheck.resourceKey", ">src/main/webapp/app/**/*.*" | |||
| property "sonar.issue.ignore.multicriteria.BoldAndItalicTagsCheck.ruleKey", "Web:BoldAndItalicTagsCheck" | |||
| // Rule https://sonarcloud.io/coding_rules?open=squid%3AS3437&rule_key=squid%3AS3437 is ignored, as a JPA-managed field cannot be transient | |||
| property "sonar.issue.ignore.multicriteria.S3437.resourceKey", "src/main/java/**/*" | |||
| property "sonar.issue.ignore.multicriteria.S3437.ruleKey", "squid:S3437" | |||
| // Rule https://sonarcloud.io/coding_rules?open=squid%3AUndocumentedApi&rule_key=squid%3AUndocumentedApi is ignored, as we want to follow "clean code" guidelines and classes, methods and arguments names should be self-explanatory | |||
| property "sonar.issue.ignore.multicriteria.UndocumentedApi.resourceKey", "src/main/java/**/*" | |||
| property "sonar.issue.ignore.multicriteria.UndocumentedApi.ruleKey", "squid:UndocumentedApi" | |||
| // Rule https://sonarcloud.io/coding_rules?open=squid%3AS4502&rule_key=squid%3AS4502 is ignored, as for JWT tokens we are not subject to CSRF attack | |||
| property "sonar.issue.ignore.multicriteria.S4502.resourceKey", "src/main/java/**/*" | |||
| property "sonar.issue.ignore.multicriteria.S4502.ruleKey", "squid:S4502" | |||
| // Rule https://sonarcloud.io/coding_rules?open=squid%3AS4684&rule_key=squid%3AS4684 | |||
| property "sonar.issue.ignore.multicriteria.S4684.resourceKey", "src/main/java/**/*" | |||
| property "sonar.issue.ignore.multicriteria.S4684.ruleKey", "squid:S4684" | |||
| property "sonar.jacoco.reportPaths", "${project.buildDir}/jacoco/test.exec" | |||
| property "sonar.java.codeCoveragePlugin", "jacoco" | |||
| property "sonar.typescript.lcov.reportPaths", "${project.buildDir}/test-results/lcov.info" | |||
| property "sonar.junit.reportPaths", "${project.buildDir}/test-results/test" | |||
| property "sonar.sources", "${project.projectDir}/src/main/" | |||
| property "sonar.tests", "${project.projectDir}/src/test/" | |||
| } | |||
| } | |||
| @@ -0,0 +1,5 @@ | |||
| distributionBase=GRADLE_USER_HOME | |||
| distributionPath=wrapper/dists | |||
| distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-bin.zip | |||
| zipStoreBase=GRADLE_USER_HOME | |||
| zipStorePath=wrapper/dists | |||
| @@ -0,0 +1,3 @@ | |||
| dependencies { | |||
| compile "org.springframework.cloud:spring-cloud-starter-zipkin" | |||
| } | |||
| @@ -0,0 +1,172 @@ | |||
| #!/usr/bin/env sh | |||
| ############################################################################## | |||
| ## | |||
| ## Gradle start up script for UN*X | |||
| ## | |||
| ############################################################################## | |||
| # Attempt to set APP_HOME | |||
| # Resolve links: $0 may be a link | |||
| PRG="$0" | |||
| # Need this for relative symlinks. | |||
| while [ -h "$PRG" ] ; do | |||
| ls=`ls -ld "$PRG"` | |||
| link=`expr "$ls" : '.*-> \(.*\)$'` | |||
| if expr "$link" : '/.*' > /dev/null; then | |||
| PRG="$link" | |||
| else | |||
| PRG=`dirname "$PRG"`"/$link" | |||
| fi | |||
| done | |||
| SAVED="`pwd`" | |||
| cd "`dirname \"$PRG\"`/" >/dev/null | |||
| APP_HOME="`pwd -P`" | |||
| cd "$SAVED" >/dev/null | |||
| APP_NAME="Gradle" | |||
| APP_BASE_NAME=`basename "$0"` | |||
| # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. | |||
| DEFAULT_JVM_OPTS="" | |||
| # Use the maximum available, or set MAX_FD != -1 to use that value. | |||
| MAX_FD="maximum" | |||
| warn () { | |||
| echo "$*" | |||
| } | |||
| die () { | |||
| echo | |||
| echo "$*" | |||
| echo | |||
| exit 1 | |||
| } | |||
| # OS specific support (must be 'true' or 'false'). | |||
| cygwin=false | |||
| msys=false | |||
| darwin=false | |||
| nonstop=false | |||
| case "`uname`" in | |||
| CYGWIN* ) | |||
| cygwin=true | |||
| ;; | |||
| Darwin* ) | |||
| darwin=true | |||
| ;; | |||
| MINGW* ) | |||
| msys=true | |||
| ;; | |||
| NONSTOP* ) | |||
| nonstop=true | |||
| ;; | |||
| esac | |||
| CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar | |||
| # Determine the Java command to use to start the JVM. | |||
| if [ -n "$JAVA_HOME" ] ; then | |||
| if [ -x "$JAVA_HOME/jre/sh/java" ] ; then | |||
| # IBM's JDK on AIX uses strange locations for the executables | |||
| JAVACMD="$JAVA_HOME/jre/sh/java" | |||
| else | |||
| JAVACMD="$JAVA_HOME/bin/java" | |||
| fi | |||
| if [ ! -x "$JAVACMD" ] ; then | |||
| die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME | |||
| Please set the JAVA_HOME variable in your environment to match the | |||
| location of your Java installation." | |||
| fi | |||
| else | |||
| JAVACMD="java" | |||
| which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. | |||
| Please set the JAVA_HOME variable in your environment to match the | |||
| location of your Java installation." | |||
| fi | |||
| # Increase the maximum file descriptors if we can. | |||
| if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then | |||
| MAX_FD_LIMIT=`ulimit -H -n` | |||
| if [ $? -eq 0 ] ; then | |||
| if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then | |||
| MAX_FD="$MAX_FD_LIMIT" | |||
| fi | |||
| ulimit -n $MAX_FD | |||
| if [ $? -ne 0 ] ; then | |||
| warn "Could not set maximum file descriptor limit: $MAX_FD" | |||
| fi | |||
| else | |||
| warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" | |||
| fi | |||
| fi | |||
| # For Darwin, add options to specify how the application appears in the dock | |||
| if $darwin; then | |||
| GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" | |||
| fi | |||
| # For Cygwin, switch paths to Windows format before running java | |||
| if $cygwin ; then | |||
| APP_HOME=`cygpath --path --mixed "$APP_HOME"` | |||
| CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` | |||
| JAVACMD=`cygpath --unix "$JAVACMD"` | |||
| # We build the pattern for arguments to be converted via cygpath | |||
| ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` | |||
| SEP="" | |||
| for dir in $ROOTDIRSRAW ; do | |||
| ROOTDIRS="$ROOTDIRS$SEP$dir" | |||
| SEP="|" | |||
| done | |||
| OURCYGPATTERN="(^($ROOTDIRS))" | |||
| # Add a user-defined pattern to the cygpath arguments | |||
| if [ "$GRADLE_CYGPATTERN" != "" ] ; then | |||
| OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" | |||
| fi | |||
| # Now convert the arguments - kludge to limit ourselves to /bin/sh | |||
| i=0 | |||
| for arg in "$@" ; do | |||
| CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` | |||
| CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option | |||
| if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition | |||
| eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` | |||
| else | |||
| eval `echo args$i`="\"$arg\"" | |||
| fi | |||
| i=$((i+1)) | |||
| done | |||
| case $i in | |||
| (0) set -- ;; | |||
| (1) set -- "$args0" ;; | |||
| (2) set -- "$args0" "$args1" ;; | |||
| (3) set -- "$args0" "$args1" "$args2" ;; | |||
| (4) set -- "$args0" "$args1" "$args2" "$args3" ;; | |||
| (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; | |||
| (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; | |||
| (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; | |||
| (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; | |||
| (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; | |||
| esac | |||
| fi | |||
| # Escape application args | |||
| save () { | |||
| for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done | |||
| echo " " | |||
| } | |||
| APP_ARGS=$(save "$@") | |||
| # Collect all arguments for the java command, following the shell quoting and substitution rules | |||
| eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" | |||
| # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong | |||
| if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then | |||
| cd "$(dirname "$0")" | |||
| fi | |||
| exec "$JAVACMD" "$@" | |||
| @@ -0,0 +1,27 @@ | |||
| { | |||
| "name": "smart-farm", | |||
| "version": "0.0.0", | |||
| "description": "Description for smart farm", | |||
| "private": true, | |||
| "license": "UNLICENSED", | |||
| "cacheDirectories": [ | |||
| "node_modules" | |||
| ], | |||
| "dependencies": { | |||
| "swagger-ui": "2.2.10" | |||
| }, | |||
| "devDependencies": { | |||
| "cpx": "^1.5.0", | |||
| "generator-jhipster": "5.7.2" | |||
| }, | |||
| "engines": { | |||
| "node": ">=8.9.0" | |||
| }, | |||
| "scripts": { | |||
| "copy-swagger": "npm version", | |||
| "copy-swagger-src": "cpx ./src/main/webapp/swagger-ui/** ./build/www/swagger-ui", | |||
| "copy-swagger-css": "cpx ./node_modules/swagger-ui/dist/css/** ./build/www/swagger-ui/dist/css", | |||
| "copy-swagger-lib": "cpx ./node_modules/swagger-ui/dist/lib/** ./build/www/swagger-ui/dist/lib", | |||
| "copy-swagger-js": "cpx ./node_modules/swagger-ui/dist/swagger-ui.min.js ./build/www/swagger-ui/dist" | |||
| } | |||
| } | |||
| @@ -0,0 +1,38 @@ | |||
| version: '3.2' | |||
| services: | |||
| agent: | |||
| image: portainer/agent | |||
| volumes: | |||
| - /var/run/docker.sock:/var/run/docker.sock | |||
| - /var/lib/docker/volumes:/var/lib/docker/volumes | |||
| networks: | |||
| - agent_network | |||
| deploy: | |||
| mode: global | |||
| placement: | |||
| constraints: [node.platform.os == linux] | |||
| portainer: | |||
| image: portainer/portainer-ce | |||
| command: -H tcp://tasks.agent:9001 --tlsskipverify | |||
| ports: | |||
| - "9000:9000" | |||
| - "8000:8000" | |||
| volumes: | |||
| - portainer_data:/data | |||
| networks: | |||
| - agent_network | |||
| deploy: | |||
| mode: replicated | |||
| replicas: 1 | |||
| placement: | |||
| constraints: [node.role == manager] | |||
| networks: | |||
| agent_network: | |||
| driver: overlay | |||
| attachable: true | |||
| volumes: | |||
| portainer_data: | |||
| @@ -0,0 +1,80 @@ | |||
| version: '3' | |||
| volumes: | |||
| smart-farm-mysql: { } | |||
| smart-farm-elasticsearch: { } | |||
| smart-farm-traefik: { } | |||
| upload: { } | |||
| services: | |||
| smart-farm-mysql: | |||
| image: mysql/mysql-server:8.0.25 | |||
| volumes: | |||
| - smart-farm-mysql:/var/lib/mysql/ | |||
| environment: | |||
| - MYSQL_USER=farm | |||
| - MYSQL_ALLOW_EMPTY_PASSWORD=yes | |||
| - MYSQL_PASSWORD=P@ssw0rdfarm | |||
| - MYSQL_ROOT_PASSWORD=P@ssw0rdfarm | |||
| - MYSQL_DATABASE=smf | |||
| ports: | |||
| - 3307:3306 | |||
| command: mysqld --default-authentication-plugin=mysql_native_password --lower_case_table_names=1 --skip-ssl --character_set_server=utf8mb4 --explicit_defaults_for_timestamp | |||
| smart-farm-elasticsearch: | |||
| image: elasticsearch:5.6.13 | |||
| volumes: | |||
| - smart-farm-elasticsearch:/usr/share/elasticsearch/data/ | |||
| ports: | |||
| - 9200:9200 | |||
| - 9300:9300 | |||
| command: -Enetwork.host=0.0.0.0 -Ediscovery.type=single-node | |||
| environment: | |||
| - "ES_JAVA_OPTS=-Xms1024m -Xmx1024m" | |||
| smart-farm-api: | |||
| build: | |||
| context: . | |||
| dockerfile: ./src/main/docker/Dockerfile | |||
| image: smart-farm-api | |||
| volumes: | |||
| - upload:/home/jhipster/upload | |||
| depends_on: | |||
| - smart-farm-mysql | |||
| - smart-farm-elasticsearch | |||
| environment: | |||
| - _JAVA_OPTIONS=-Xmx1024m -Xms512m -Djava.net.preferIPv4Stack=true | |||
| - SPRING_PROFILES_ACTIVE=prod,swagger | |||
| - SPRING_DATASOURCE_URL=jdbc:mysql://smart-farm-mysql:3306/smf?useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&serverTimezone=UTC | |||
| # - SPRING_JACKSON_SERIALIZATION_WRITE-DATES-AS-TIMESTAMPS=false | |||
| - SPRING_DATASOURCE_USERNAME=farm | |||
| - SPRING_DATASOURCE_PASSWORD=P@ssw0rdfarm | |||
| - JHIPSTER_SLEEP=10 # gives time for the database to boot before the application | |||
| - SPRING_DATA_JEST_URI=http://smart-farm-elasticsearch:9200 | |||
| ports: | |||
| - 8080:8080 | |||
| smart-farm-cdn: | |||
| build: | |||
| context: . | |||
| dockerfile: ./x_cdn/Dockerfile | |||
| image: smart-farm-cdn | |||
| depends_on: | |||
| - smart-farm-api | |||
| # volumes_from: | |||
| # - smart-farm-api | |||
| volumes: | |||
| - upload:/home/jhipster/upload | |||
| traefik: | |||
| build: | |||
| context: . | |||
| dockerfile: ./src/main/docker/traefik/Dockerfile | |||
| image: smart-farm-traefik | |||
| depends_on: | |||
| - smart-farm-api | |||
| volumes: | |||
| - smart-farm-traefik:/etc/traefik/acme:z | |||
| ports: | |||
| - "0.0.0.0:80:80" | |||
| - "0.0.0.0:443:443" | |||
| @@ -0,0 +1 @@ | |||
| rootProject.name = 'smart-farm' | |||
| @@ -0,0 +1,14 @@ | |||
| # https://docs.docker.com/engine/reference/builder/#dockerignore-file | |||
| classes/ | |||
| generated-sources/ | |||
| generated-test-sources/ | |||
| h2db/ | |||
| maven-archiver/ | |||
| maven-status/ | |||
| reports/ | |||
| surefire-reports/ | |||
| test-classes/ | |||
| test-results/ | |||
| www/ | |||
| !*.jar | |||
| !*.war | |||
| @@ -0,0 +1,23 @@ | |||
| #FROM r2.aztrace.vn/oracle/serverjre:8 | |||
| FROM sgrio/java:jre_8_alpine | |||
| #FROM openjdk:8-jre-alpine | |||
| ENV SPRING_OUTPUT_ANSI_ENABLED=ALWAYS \ | |||
| JHIPSTER_SLEEP=0 \ | |||
| JAVA_OPTS="" | |||
| # Add a jhipster user to run our application so that it doesn't need to run as root | |||
| RUN adduser -D -s /bin/sh jhipster | |||
| #RUN -s /bin/sh --login jhipster | |||
| WORKDIR /home/jhipster | |||
| # WORKDIR /root | |||
| ADD src/main/docker/entrypoint.sh entrypoint.sh | |||
| RUN chmod 755 entrypoint.sh && chown jhipster:jhipster entrypoint.sh | |||
| USER jhipster | |||
| RUN mkdir upload | |||
| ADD build/libs/smart-farm-0.0.1-SNAPSHOT.war app.war | |||
| ENTRYPOINT ["./entrypoint.sh"] | |||
| EXPOSE 8080 | |||
| @@ -0,0 +1,20 @@ | |||
| version: '2' | |||
| services: | |||
| tpf-app: | |||
| image: tpf | |||
| environment: | |||
| - _JAVA_OPTIONS=-Xmx1024m -Xms512m | |||
| - SPRING_PROFILES_ACTIVE=prod,swagger | |||
| - SPRING_DATASOURCE_URL=jdbc:mysql://smart-farm-mysql:3306/smart_farm?useUnicode=true&characterEncoding=utf8&useSSL=false | |||
| - JHIPSTER_SLEEP=10 # gives time for the database to boot before the application | |||
| - SPRING_DATA_JEST_URI=http://smart-farm-elasticsearch:9200 | |||
| ports: | |||
| - 8080:8080 | |||
| smart-farm-mysql: | |||
| extends: | |||
| file: mysql.yml | |||
| service: smart-farm-mysql | |||
| smart-farm-elasticsearch: | |||
| extends: | |||
| file: elasticsearch.yml | |||
| service: smart-farm-elasticsearch | |||
| @@ -0,0 +1,12 @@ | |||
| version: '2' | |||
| services: | |||
| tpf-elasticsearch: | |||
| image: elasticsearch:5.6.13 | |||
| # volumes: | |||
| # - ~/volumes/jhipster/tpf/elasticsearch/:/usr/share/elasticsearch/data/ | |||
| ports: | |||
| - 9200:9200 | |||
| - 9300:9300 | |||
| command: -Enetwork.host=0.0.0.0 -Ediscovery.type=single-node | |||
| environment: | |||
| - "ES_JAVA_OPTS=-Xms1024m -Xmx1024m" | |||
| @@ -0,0 +1,4 @@ | |||
| #!/bin/sh | |||
| echo "The application will start in ${JHIPSTER_SLEEP}s..." && sleep ${JHIPSTER_SLEEP} | |||
| exec java -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap -XX:MaxRAMFraction=1 ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar "${HOME}/app.war" "$@" | |||
| @@ -0,0 +1,16 @@ | |||
| version: '2' | |||
| services: | |||
| smart-farm-mysql: | |||
| image: mysql:5.7.20 | |||
| volumes: | |||
| - smart-farm-mysql:/var/lib/mysql/ | |||
| environment: | |||
| - MYSQL_USER=root | |||
| - MYSQL_ALLOW_EMPTY_PASSWORD=yes | |||
| - MYSQL_DATABASE=smart_farm | |||
| ports: | |||
| - 3306:3306 | |||
| command: mysqld --lower_case_table_names=1 --skip-ssl --character_set_server=utf8mb4 --explicit_defaults_for_timestamp | |||
| volumes: | |||
| smart-farm-mysql: | |||
| @@ -0,0 +1,7 @@ | |||
| version: '2' | |||
| services: | |||
| tpf-sonar: | |||
| image: sonarqube:7.1 | |||
| ports: | |||
| - 9001:9000 | |||
| - 9092:9092 | |||
| @@ -0,0 +1,5 @@ | |||
| FROM traefik:v2.2.11 | |||
| RUN mkdir -p /etc/traefik/acme \ | |||
| && touch /etc/traefik/acme/acme.json \ | |||
| && chmod 600 /etc/traefik/acme/acme.json | |||
| COPY ./src/main/docker/traefik/traefik.yml /etc/traefik | |||
| @@ -0,0 +1,185 @@ | |||
| log: | |||
| level: INFO | |||
| entryPoints: | |||
| web: | |||
| # http | |||
| address: ":80" | |||
| web-secure: | |||
| # https | |||
| address: ":443" | |||
| certificatesResolvers: | |||
| letsencrypt: | |||
| # https://docs.traefik.io/master/https/acme/#lets-encrypt | |||
| acme: | |||
| email: "[email protected]" | |||
| storage: /etc/traefik/acme/acme.json | |||
| # https://docs.traefik.io/master/https/acme/#httpchallenge | |||
| httpChallenge: | |||
| entryPoint: web | |||
| http: | |||
| routers: | |||
| web-router: | |||
| rule: "Host(`smartfarm.aztrace.vn`)" | |||
| entryPoints: | |||
| - web | |||
| middlewares: | |||
| - redirect | |||
| # - csrf | |||
| # - ui | |||
| service: smart-farm-web-ui | |||
| web-secure-router: | |||
| rule: "Host(`smartfarm.aztrace.vn`)" | |||
| entryPoints: | |||
| - web-secure | |||
| # middlewares: | |||
| # - csrf | |||
| # - ui | |||
| service: smart-farm-web-ui | |||
| tls: | |||
| # https://docs.traefik.io/master/routing/routers/#certresolver | |||
| certResolver: letsencrypt | |||
| cdn-router: | |||
| rule: "Method(`OPTIONS`, `GET`, `POST`, `DELETE`, `PUT`) && Host(`smartfarm.aztrace.vn`) && PathPrefix(`/upload`)" | |||
| entryPoints: | |||
| - web | |||
| middlewares: | |||
| - redirect | |||
| # - csrf | |||
| # - cdn | |||
| service: smart-farm-cdn | |||
| cdn-secure-router: | |||
| rule: "Method(`OPTIONS`, `GET`, `POST`, `DELETE`, `PUT`) && Host(`smartfarm.aztrace.vn`) && PathPrefix(`/upload`)" | |||
| entryPoints: | |||
| - web-secure | |||
| # middlewares: | |||
| # - csrf | |||
| # - cdn | |||
| service: smart-farm-cdn | |||
| tls: | |||
| # https://docs.traefik.io/master/routing/routers/#certresolver | |||
| certResolver: letsencrypt | |||
| api-router: | |||
| rule: "Method(`OPTIONS`, `GET`, `POST`, `DELETE`, `PUT`) && Host(`smartfarm.aztrace.vn`) && PathPrefix(`/api`)" | |||
| entryPoints: | |||
| - web | |||
| middlewares: | |||
| - redirect | |||
| - cros | |||
| # - crosHeader | |||
| service: smart-farm-api | |||
| api-secure-router: | |||
| rule: "Method(`OPTIONS`, `GET`, `POST`, `DELETE`, `PUT`) && Host(`smartfarm.aztrace.vn`) && PathPrefix(`/api`)" | |||
| entryPoints: | |||
| - web-secure | |||
| middlewares: | |||
| - cros | |||
| # - crosHeader | |||
| service: smart-farm-api | |||
| tls: | |||
| # https://docs.traefik.io/master/routing/routers/#certresolver | |||
| certResolver: letsencrypt | |||
| middlewares: | |||
| redirect: | |||
| # https://docs.traefik.io/master/middlewares/redirectscheme/ | |||
| redirectScheme: | |||
| scheme: https | |||
| permanent: true | |||
| csrf: | |||
| # https://docs.traefik.io/master/middlewares/headers/#hostsproxyheaders | |||
| # https://docs.djangoproject.com/en/dev/ref/csrf/#ajax | |||
| headers: | |||
| hostsProxyHeaders: [ "X-CSRFToken" ] | |||
| cros: | |||
| headers: | |||
| # accessControlAllowCredentials: true | |||
| accessControlAllowHeaders: | |||
| - access-control-allow-methods | |||
| - access-control-allow-origin | |||
| - cus_id | |||
| - token_key | |||
| - tmp | |||
| accessControlAllowMethods: | |||
| - GET | |||
| - OPTIONS | |||
| - PUT | |||
| - POST | |||
| - DELETE | |||
| accessControlAllowOriginList: | |||
| - http://localhost:4200 | |||
| - http://ots.aztrace.vn | |||
| - http://smartfarm.aztrace.vn | |||
| - https://ots.aztrace.vn | |||
| - https://smartfarm.aztrace.vn | |||
| # customRequestHeaders: | |||
| # X-Script-Name: "cus_id" | |||
| # X-Script-Name: "token_key" | |||
| # X-Script-Name: "tmp" | |||
| # customResponseHeaders: | |||
| # X-Script-Name: "cus_id" | |||
| # X-Script-Name: "token_key" | |||
| # X-Script-Name: "tmp" | |||
| accessControlMaxAge: 100 | |||
| addVaryHeader: true | |||
| # crosHeader: | |||
| # headers: | |||
| # customRequestHeaders: | |||
| # X-Script-Name: "cus_id" | |||
| # X-Script-Name: "token_key" | |||
| # X-Script-Name: "tmp" | |||
| # customResponseHeaders: | |||
| # X-Script-Name: "cus_id" | |||
| # X-Script-Name: "token_key" | |||
| # X-Script-Name: "tmp" | |||
| # ui: | |||
| # addPrefix: | |||
| # prefix: "/" | |||
| # stripprefix: | |||
| # prefixes: "/" | |||
| # api: | |||
| # addPrefix: | |||
| # prefix: "/api" | |||
| # stripprefix: | |||
| # prefixes: "/api" | |||
| # cdn: | |||
| # addPrefix: | |||
| # prefix: "/images" | |||
| # stripprefix: | |||
| # prefixes: "/images" | |||
| services: | |||
| smart-farm-web-ui: | |||
| loadBalancer: | |||
| servers: | |||
| - url: http://smart-farm-web-ui | |||
| smart-farm-api: | |||
| loadBalancer: | |||
| servers: | |||
| - url: http://smart-farm-api:8080 | |||
| smart-farm-cdn: | |||
| loadBalancer: | |||
| servers: | |||
| - url: http://smart-farm-cdn:90 | |||
| providers: | |||
| # https://docs.traefik.io/master/providers/file/ | |||
| file: | |||
| filename: /etc/traefik/traefik.yml | |||
| watch: true | |||
| @@ -0,0 +1,21 @@ | |||
| package vn.azteam.tpf; | |||
| import vn.azteam.tpf.config.DefaultProfileUtil; | |||
| import org.springframework.boot.builder.SpringApplicationBuilder; | |||
| import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; | |||
| /** | |||
| * This is a helper Java class that provides an alternative to creating a web.xml. | |||
| * This will be invoked only when the application is deployed to a Servlet container like Tomcat, JBoss etc. | |||
| */ | |||
| public class ApplicationWebXml extends SpringBootServletInitializer { | |||
| @Override | |||
| protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { | |||
| /** | |||
| * set a default to use when no profile is configured. | |||
| */ | |||
| DefaultProfileUtil.addDefaultProfile(application.application()); | |||
| return application.sources(TPFApp.class); | |||
| } | |||
| } | |||
| @@ -0,0 +1,299 @@ | |||
| package vn.azteam.tpf.Constants; | |||
| import java.util.HashMap; | |||
| import java.util.Map; | |||
| public class Constants { | |||
| public Constants() { | |||
| } | |||
| public static boolean ENABLE_CASBIN = true; | |||
| public static enum ENUM_MENU_NOT_SHOW { | |||
| QUAN_LY_DON_VI, | |||
| PHAN_QUYEN_NGUOI_DUNG | |||
| } | |||
| public static String ACTIVE_TYPE_UPDATE_ENV = "ACTIVE_TYPE_UPDATE_ENV"; | |||
| public static String ACTIVE_TYPE_NURSERY = "ACTIVE_TYPE_NURSERY"; | |||
| public static String ACTIVE_TYPE_PLANTING = "ACTIVE_TYPE_PLANTING"; | |||
| public static String ACTIVE_TYPE_HARVEST = "ACTIVE_TYPE_HARVEST"; | |||
| public static String ACTIVE_TYPE_PESTS_INVESTIGATION = "ACTIVE_TYPE_PESTS_INVESTIGATION"; | |||
| public static String ACTIVE_TYPE_PLANT_REMOVAL= "ACTIVE_TYPE_PLANT_REMOVAL"; | |||
| public static String ACTIVE_TYPE_END = "ACTIVE_TYPE_END"; | |||
| public static enum ENUM_MENU_ALWAYS_SHOW { | |||
| DASHBOARD | |||
| } | |||
| public static enum ENUM_MENU_INDEX { | |||
| QUAN_LY_NGUOI_DUNG(3), | |||
| PHAN_QUYEN_NGUOI_DUNG(11), | |||
| QUAN_LY_CANH_TAC(1), | |||
| QUAN_LY_THU_HOACH(2), | |||
| QUAN_LY_CODE(4), | |||
| BAO_CAO_THONG_KE(5), | |||
| QUAN_LY_TIEU_CHUAN(6), | |||
| QUAN_LY_GIONG(7), | |||
| QUAN_LY_VAT_TU(8), | |||
| QUAN_LY_THIET_BI(9), | |||
| QUAN_LY_DON_VI(10), | |||
| DASHBOARD(0); | |||
| private final int value; | |||
| ENUM_MENU_INDEX(final int newValue) { | |||
| value = newValue; | |||
| } | |||
| public int getValue() { return value; } | |||
| } | |||
| public static enum ENTITY_COLOR { | |||
| RED(0), | |||
| PURPLE(1), | |||
| YELLOW(2), | |||
| BLUE(3), | |||
| GREEN(4); | |||
| private final int value; | |||
| ENTITY_COLOR(final int newValue) { | |||
| value = newValue; | |||
| } | |||
| public int getValue() { return value; } | |||
| } | |||
| public static enum DATA_ENTITY_TYPE_ID { | |||
| BLOCK(1), | |||
| NET_HOUSE(2), | |||
| WAREHOUSE(3); | |||
| private final int value; | |||
| DATA_ENTITY_TYPE_ID(final int newValue) { | |||
| value = newValue; | |||
| } | |||
| public int getValue() { return value; } | |||
| } | |||
| public static enum ENUM_SUPPLIES_TYPE { | |||
| GIONG, | |||
| PHANBON, | |||
| THUOCBVTV, | |||
| GIATHE | |||
| } | |||
| public static enum STOCK_UPDATE_ACTION { | |||
| IMPORT(0), | |||
| EXPORT(1); | |||
| private final int value; | |||
| STOCK_UPDATE_ACTION(final int newValue) { | |||
| value = newValue; | |||
| } | |||
| public int getValue() { return value; } | |||
| } | |||
| public static enum PRODUCT_STOCK_UPDATE_ACTION { | |||
| IMPORT(0), | |||
| EXPORT(1); | |||
| private final int value; | |||
| PRODUCT_STOCK_UPDATE_ACTION(final int newValue) { | |||
| value = newValue; | |||
| } | |||
| public int getValue() { return value; } | |||
| } | |||
| public static enum ENUM_CROP_STATUS { | |||
| STATUS_ARE_ACTIVE, | |||
| STATUS_FINISHED | |||
| } | |||
| public static enum OBJECT_EXTEND_TYPE { | |||
| TYPE_OBJECT(0), | |||
| TYPE_LIST(1); | |||
| private final int value; | |||
| OBJECT_EXTEND_TYPE(final int newValue) { | |||
| value = newValue; | |||
| } | |||
| public int getValue() { return value; } | |||
| } | |||
| public static final String COMMA_DOT = ";"; | |||
| public static final String EMPTY = ""; | |||
| public static final String SLASH = ""; | |||
| public static final Integer READY_STATUS_EQUIPMENT_HISTORY = 2; | |||
| public static final String SUCCEED_MESSAGE_CONTROL_EQUIPMENT = "Điều khiển thiết bị thành công."; | |||
| public static final String FAILED_MESSAGE_CONTROL_EQUIPMENT = "Điều khiển thiết bị thất bại."; | |||
| public static final String FAILED_AUTO_MODE_MESSAGE_CONTROL_EQUIPMENT = "Mode của thiết bị là manual."; | |||
| public static final String FAILED_ERROR_CONNECT_MESSAGE_CONTROL_EQUIPMENT = "Không kết nối được thiết bị."; | |||
| public static final String FAILED_FAULTY_MESSAGE_CONTROL_EQUIPMENT = "Thiết bị đang vị lỗi."; | |||
| public static final String FAILED_ERROR_ON_MESSAGE_CONTROL_EQUIPMENT = "Thiết bị đang bật. Không thể bật thiết bị"; | |||
| public static final String FAILED_ERROR_OFF_MESSAGE_CONTROL_EQUIPMENT = "Thiết bị đang tắt. Không thể tắt thiết bị"; | |||
| public static final int DEFAULT_TIMEOUT_RECONNECT = 60; | |||
| public static final String NOTIFICATION_TITLE_ENV_UPDATE = "Cập nhật thông số môi trường"; | |||
| public static final String NOTIFICATION_TITLE_PERSON_IN_CHARGE_UPDATE = "Cập nhật người phụ trách"; | |||
| public static final String NOTIFICATION_REQUEST_TYPE_ENV_UPDATE = "ENV_UPDATE"; | |||
| public static final String NOTIFICATION_REQUEST_TYPE_PIC_UPDATE = "PIC_UPDATE"; //PIC-Person In Charge | |||
| public static final String NOTIFICATION_REQUEST_TYPE_DEVICE = "DEVICE_LOST_CONNECTION"; | |||
| public static final String FLUTTER_NOTIFICATION_CLICK = "FLUTTER_NOTIFICATION_CLICK"; | |||
| public static String THOI_GIAN_NGAM_HAT = "THOI_GIAN_NGAM_HAT"; | |||
| public static String SO_LUONG_CAY_TRONG = "SO_LUONG_CAY_TRONG"; | |||
| public static String SO_LUONG_LOAI_BO = "SO_LUONG_LOAI_BO"; | |||
| public static String PHAN_TRAM_CAY = "PHAN_TRAM_CAY"; | |||
| public static String[] NON_TEXT_CONTROLS = {"radiobutton","dropdown"}; | |||
| public static Integer OBJECT_TYPE = 0; | |||
| public static Integer LIST_TYPE = 1; | |||
| public static enum UNITS { | |||
| KG("kg"), | |||
| G("g"), | |||
| M("m"), | |||
| MM("mm"), | |||
| L("l"), | |||
| ML("ml"); | |||
| private final String value; | |||
| UNITS(final String newValue) { | |||
| value = newValue; | |||
| } | |||
| public String getValue() { return value; } | |||
| } | |||
| public static enum UNIT_WEIGHT | |||
| { | |||
| kg("kilogam"), | |||
| g ("gam"); | |||
| private String value; | |||
| UNIT_WEIGHT(String value) { | |||
| this.value = value; | |||
| } | |||
| public String getValue() { | |||
| return value; | |||
| } | |||
| }; | |||
| public static enum UNIT_SIZE | |||
| { | |||
| m("meter"), | |||
| mm ("milimeter"); | |||
| private String value; | |||
| UNIT_SIZE(String value) { | |||
| this.value = value; | |||
| } | |||
| public String getValue() { | |||
| return value; | |||
| } | |||
| }; | |||
| public static enum UNIT_CAPACITY | |||
| { | |||
| l("liter"), | |||
| ml ("milliliter"); | |||
| private String value; | |||
| UNIT_CAPACITY(String value) { | |||
| this.value = value; | |||
| } | |||
| public String getValue() { | |||
| return value; | |||
| } | |||
| }; | |||
| public static enum UNIT_SEED | |||
| { | |||
| seed("hạt"); | |||
| private String value; | |||
| UNIT_SEED(String value) { | |||
| this.value = value; | |||
| } | |||
| public String getValue() { | |||
| return value; | |||
| } | |||
| }; | |||
| public enum SEED_UNIT | |||
| { | |||
| kg("kilogram"), | |||
| g ("gam"); | |||
| private String value; | |||
| SEED_UNIT(String value) { | |||
| this.value = value; | |||
| } | |||
| public String getValue() { | |||
| return value; | |||
| } | |||
| } | |||
| public static enum LOCATION | |||
| { | |||
| ENTITY("entity"), | |||
| WAREHOUSE("warehouse"); | |||
| private String value; | |||
| LOCATION(String value) { | |||
| this.value = value; | |||
| } | |||
| public String getValue() { | |||
| return value; | |||
| } | |||
| }; | |||
| public static enum METHODS_DYNAMIC | |||
| { | |||
| GET_DETAIL("Chi tiết hoạt động "), | |||
| POST_CREATE("Thêm hoạt động "), | |||
| POST_UPDATE("Cập nhật hoạt động "), | |||
| DELETE_DELETE("Xóa hoạt động "); | |||
| private String value; | |||
| METHODS_DYNAMIC(String value) { | |||
| this.value = value; | |||
| } | |||
| public String getValue() { | |||
| return value; | |||
| } | |||
| }; | |||
| public static enum METHODS_PATH_ACTIVITY_TYPE | |||
| { | |||
| GET_DETAIL("GET", "/api/get-detail-common-activity/"), | |||
| POST_CREATE("POST", "/api/create-common-activity/"), | |||
| POST_UPDATE("POST", "/api/update-common-activity/"), | |||
| DELETE_DELETE("DELETE", "/api/delete-common-activity/"); | |||
| private static final Map<String, METHODS_PATH_ACTIVITY_TYPE> BY_NAME = new HashMap<>(); | |||
| static { | |||
| for (METHODS_PATH_ACTIVITY_TYPE e : values()) { | |||
| BY_NAME.put(e.name, e); | |||
| } | |||
| } | |||
| private String name; | |||
| private String value; | |||
| METHODS_PATH_ACTIVITY_TYPE(String name, String value) { | |||
| this.name = name; | |||
| this.value = value; | |||
| } | |||
| public static METHODS_PATH_ACTIVITY_TYPE nameOf(String name) { | |||
| return BY_NAME.get(name); | |||
| } | |||
| public String getName() { | |||
| return name; | |||
| } | |||
| public String getValue() { | |||
| return value; | |||
| } | |||
| }; | |||
| } | |||
| @@ -0,0 +1,139 @@ | |||
| package vn.azteam.tpf; | |||
| import com.fasterxml.jackson.databind.ObjectMapper; | |||
| import com.fasterxml.jackson.databind.SerializationFeature; | |||
| import com.fasterxml.jackson.datatype.jdk8.Jdk8Module; | |||
| import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; | |||
| import com.fasterxml.jackson.module.paramnames.ParameterNamesModule; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.context.annotation.Bean; | |||
| import org.springframework.context.annotation.Primary; | |||
| import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder; | |||
| import vn.azteam.tpf.config.ApplicationProperties; | |||
| import vn.azteam.tpf.config.DefaultProfileUtil; | |||
| import io.github.jhipster.config.JHipsterConstants; | |||
| import org.apache.commons.lang3.StringUtils; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.boot.SpringApplication; | |||
| import org.springframework.boot.autoconfigure.SpringBootApplication; | |||
| import org.springframework.boot.autoconfigure.liquibase.LiquibaseProperties; | |||
| import org.springframework.boot.context.properties.EnableConfigurationProperties; | |||
| import org.springframework.core.env.Environment; | |||
| import javax.annotation.PostConstruct; | |||
| import java.net.InetAddress; | |||
| import java.net.UnknownHostException; | |||
| import java.util.Arrays; | |||
| import java.util.Collection; | |||
| @SpringBootApplication | |||
| @EnableConfigurationProperties({LiquibaseProperties.class, ApplicationProperties.class}) | |||
| public class TPFApp { | |||
| private static final Logger log = LoggerFactory.getLogger(TPFApp.class); | |||
| private final Environment env; | |||
| public TPFApp(Environment env) { | |||
| this.env = env; | |||
| } | |||
| /** | |||
| * Initializes tpf. | |||
| * <p> | |||
| * Spring profiles can be configured with a program argument --spring.profiles.active=your-active-profile | |||
| * <p> | |||
| * You can find more information on how profiles work with JHipster on <a href="https://www.jhipster.tech/profiles/">https://www.jhipster.tech/profiles/</a>. | |||
| */ | |||
| @PostConstruct | |||
| public void initApplication() { | |||
| Collection<String> activeProfiles = Arrays.asList(env.getActiveProfiles()); | |||
| if (activeProfiles.contains(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT) && activeProfiles.contains(JHipsterConstants.SPRING_PROFILE_PRODUCTION)) { | |||
| log.error("You have misconfigured your application! It should not run " + | |||
| "with both the 'dev' and 'prod' profiles at the same time."); | |||
| } | |||
| if (activeProfiles.contains(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT) && activeProfiles.contains(JHipsterConstants.SPRING_PROFILE_CLOUD)) { | |||
| log.error("You have misconfigured your application! It should not " + | |||
| "run with both the 'dev' and 'cloud' profiles at the same time."); | |||
| } | |||
| } | |||
| /** | |||
| * Main method, used to run the application. | |||
| * | |||
| * @param args the command line arguments | |||
| */ | |||
| public static void main(String[] args) { | |||
| SpringApplication app = new SpringApplication(TPFApp.class); | |||
| DefaultProfileUtil.addDefaultProfile(app); | |||
| Environment env = app.run(args).getEnvironment(); | |||
| logApplicationStartup(env); | |||
| } | |||
| private static void logApplicationStartup(Environment env) { | |||
| String protocol = "http"; | |||
| if (env.getProperty("server.ssl.key-store") != null) { | |||
| protocol = "https"; | |||
| } | |||
| String serverPort = env.getProperty("server.port"); | |||
| String contextPath = env.getProperty("server.servlet.context-path"); | |||
| if (StringUtils.isBlank(contextPath)) { | |||
| contextPath = "/"; | |||
| } | |||
| String hostAddress = "localhost"; | |||
| try { | |||
| hostAddress = InetAddress.getLocalHost().getHostAddress(); | |||
| } catch (UnknownHostException e) { | |||
| log.warn("The host name could not be determined, using `localhost` as fallback"); | |||
| } | |||
| log.info("\n----------------------------------------------------------\n\t" + | |||
| "Application '{}' is running! Access URLs:\n\t" + | |||
| "Local: \t\t{}://localhost:{}{}\n\t" + | |||
| "External: \t{}://{}:{}{}\n\t" + | |||
| "Profile(s): \t{}\n----------------------------------------------------------", | |||
| env.getProperty("spring.application.name"), | |||
| protocol, | |||
| serverPort, | |||
| contextPath, | |||
| protocol, | |||
| hostAddress, | |||
| serverPort, | |||
| contextPath, | |||
| env.getActiveProfiles()); | |||
| } | |||
| /** | |||
| * Register modules in object mapper globally | |||
| * @param mapper | |||
| */ | |||
| @Autowired | |||
| void configureObjectMapper(final ObjectMapper mapper) { | |||
| mapper.registerModule(new ParameterNamesModule()); | |||
| mapper.registerModule(new Jdk8Module()); | |||
| mapper.registerModule(new JavaTimeModule()); | |||
| mapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false); | |||
| mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); | |||
| } | |||
| // @Bean | |||
| // @Primary | |||
| // public ObjectMapper objectMapper(Jackson2ObjectMapperBuilder builder) { | |||
| // ObjectMapper objectMapper = builder.build(); | |||
| // objectMapper.registerModule(new JavaTimeModule()); | |||
| // objectMapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false); | |||
| // return objectMapper; | |||
| // } | |||
| // @Bean | |||
| // public DataSourceInitializer dataSourceInitializer(@Qualifier("dataSource") final DataSource dataSource) { | |||
| // ResourceDatabasePopulator resourceDatabasePopulator = new ResourceDatabasePopulator(); | |||
| // resourceDatabasePopulator.addScript(new ClassPathResource("/casbin/casbin_rule.sql")); | |||
| // DataSourceInitializer dataSourceInitializer = new DataSourceInitializer(); | |||
| // dataSourceInitializer.setDataSource(dataSource); | |||
| // dataSourceInitializer.setDatabasePopulator(resourceDatabasePopulator); | |||
| // return dataSourceInitializer; | |||
| // } | |||
| } | |||
| @@ -0,0 +1,98 @@ | |||
| package vn.azteam.tpf.aop.logging; | |||
| import io.github.jhipster.config.JHipsterConstants; | |||
| import org.aspectj.lang.JoinPoint; | |||
| import org.aspectj.lang.ProceedingJoinPoint; | |||
| import org.aspectj.lang.annotation.AfterThrowing; | |||
| import org.aspectj.lang.annotation.Around; | |||
| import org.aspectj.lang.annotation.Aspect; | |||
| import org.aspectj.lang.annotation.Pointcut; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.core.env.Environment; | |||
| import java.util.Arrays; | |||
| /** | |||
| * Aspect for logging execution of service and repository Spring components. | |||
| * | |||
| * By default, it only runs with the "dev" profile. | |||
| */ | |||
| @Aspect | |||
| public class LoggingAspect { | |||
| private final Logger log = LoggerFactory.getLogger(this.getClass()); | |||
| private final Environment env; | |||
| public LoggingAspect(Environment env) { | |||
| this.env = env; | |||
| } | |||
| /** | |||
| * Pointcut that matches all repositories, services and Web REST endpoints. | |||
| */ | |||
| @Pointcut("within(@org.springframework.stereotype.Repository *)" + | |||
| " || within(@org.springframework.stereotype.Service *)" + | |||
| " || within(@org.springframework.web.bind.annotation.RestController *)") | |||
| public void springBeanPointcut() { | |||
| // Method is empty as this is just a Pointcut, the implementations are in the advices. | |||
| } | |||
| /** | |||
| * Pointcut that matches all Spring beans in the application's main packages. | |||
| */ | |||
| @Pointcut("within(vn.azteam.tpf.repository..*)"+ | |||
| " || within(vn.azteam.tpf.service..*)"+ | |||
| " || within(vn.azteam.tpf.web.rest..*)") | |||
| public void applicationPackagePointcut() { | |||
| // Method is empty as this is just a Pointcut, the implementations are in the advices. | |||
| } | |||
| /** | |||
| * Advice that logs methods throwing exceptions. | |||
| * | |||
| * @param joinPoint join point for advice | |||
| * @param e exception | |||
| */ | |||
| @AfterThrowing(pointcut = "applicationPackagePointcut() && springBeanPointcut()", throwing = "e") | |||
| public void logAfterThrowing(JoinPoint joinPoint, Throwable e) { | |||
| if (env.acceptsProfiles(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT)) { | |||
| log.error("Exception in {}.{}() with cause = \'{}\' and exception = \'{}\'", joinPoint.getSignature().getDeclaringTypeName(), | |||
| joinPoint.getSignature().getName(), e.getCause() != null? e.getCause() : "NULL", e.getMessage(), e); | |||
| } else { | |||
| log.error("Exception in {}.{}() with cause = {}", joinPoint.getSignature().getDeclaringTypeName(), | |||
| joinPoint.getSignature().getName(), e.getCause() != null? e.getCause() : "NULL"); | |||
| } | |||
| } | |||
| /** | |||
| * Advice that logs when a method is entered and exited. | |||
| * | |||
| * @param joinPoint join point for advice | |||
| * @return result | |||
| * @throws Throwable throws IllegalArgumentException | |||
| */ | |||
| @Around("applicationPackagePointcut() && springBeanPointcut()") | |||
| public Object logAround(ProceedingJoinPoint joinPoint) throws Throwable { | |||
| if (log.isDebugEnabled()) { | |||
| log.debug("Enter: {}.{}() with argument[s] = {}", joinPoint.getSignature().getDeclaringTypeName(), | |||
| joinPoint.getSignature().getName(), Arrays.toString(joinPoint.getArgs())); | |||
| } | |||
| try { | |||
| Object result = joinPoint.proceed(); | |||
| if (log.isDebugEnabled()) { | |||
| log.debug("Exit: {}.{}() with result = {}", joinPoint.getSignature().getDeclaringTypeName(), | |||
| joinPoint.getSignature().getName(), result); | |||
| } | |||
| return result; | |||
| } catch (IllegalArgumentException e) { | |||
| log.error("Illegal argument: {} in {}.{}()", Arrays.toString(joinPoint.getArgs()), | |||
| joinPoint.getSignature().getDeclaringTypeName(), joinPoint.getSignature().getName()); | |||
| throw e; | |||
| } | |||
| } | |||
| } | |||
| @@ -0,0 +1,14 @@ | |||
| package vn.azteam.tpf.config; | |||
| import org.springframework.boot.context.properties.ConfigurationProperties; | |||
| /** | |||
| * Properties specific to tpf. | |||
| * <p> | |||
| * Properties are configured in the application.yml file. | |||
| * See {@link io.github.jhipster.config.JHipsterProperties} for a good example. | |||
| */ | |||
| @ConfigurationProperties(prefix = "application", ignoreUnknownFields = false) | |||
| public class ApplicationProperties { | |||
| } | |||
| @@ -0,0 +1,59 @@ | |||
| package vn.azteam.tpf.config; | |||
| import io.github.jhipster.async.ExceptionHandlingAsyncTaskExecutor; | |||
| import io.github.jhipster.config.JHipsterProperties; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler; | |||
| import org.springframework.aop.interceptor.SimpleAsyncUncaughtExceptionHandler; | |||
| import org.springframework.context.annotation.Bean; | |||
| import org.springframework.context.annotation.Configuration; | |||
| import org.springframework.scheduling.annotation.*; | |||
| import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; | |||
| import org.springframework.scheduling.annotation.SchedulingConfigurer; | |||
| import org.springframework.scheduling.config.ScheduledTaskRegistrar; | |||
| import java.util.concurrent.Executor; | |||
| import java.util.concurrent.Executors; | |||
| @Configuration | |||
| @EnableAsync | |||
| @EnableScheduling | |||
| public class AsyncConfiguration implements AsyncConfigurer, SchedulingConfigurer { | |||
| private final Logger log = LoggerFactory.getLogger(AsyncConfiguration.class); | |||
| private final JHipsterProperties jHipsterProperties; | |||
| public AsyncConfiguration(JHipsterProperties jHipsterProperties) { | |||
| this.jHipsterProperties = jHipsterProperties; | |||
| } | |||
| @Override | |||
| @Bean(name = "taskExecutor") | |||
| public Executor getAsyncExecutor() { | |||
| log.debug("Creating Async Task Executor"); | |||
| ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); | |||
| executor.setCorePoolSize(jHipsterProperties.getAsync().getCorePoolSize()); | |||
| executor.setMaxPoolSize(jHipsterProperties.getAsync().getMaxPoolSize()); | |||
| executor.setQueueCapacity(jHipsterProperties.getAsync().getQueueCapacity()); | |||
| executor.setThreadNamePrefix("tpf-Executor-"); | |||
| return new ExceptionHandlingAsyncTaskExecutor(executor); | |||
| } | |||
| @Override | |||
| public AsyncUncaughtExceptionHandler getAsyncUncaughtExceptionHandler() { | |||
| return new SimpleAsyncUncaughtExceptionHandler(); | |||
| } | |||
| @Override | |||
| public void configureTasks(ScheduledTaskRegistrar taskRegistrar) { | |||
| taskRegistrar.setScheduler(scheduledTaskExecutor()); | |||
| } | |||
| @Bean | |||
| public Executor scheduledTaskExecutor() { | |||
| return Executors.newScheduledThreadPool(jHipsterProperties.getAsync().getCorePoolSize()); | |||
| } | |||
| } | |||
| @@ -0,0 +1,109 @@ | |||
| package vn.azteam.tpf.config; | |||
| import java.time.Duration; | |||
| import org.ehcache.config.builders.*; | |||
| import org.ehcache.jsr107.Eh107Configuration; | |||
| import io.github.jhipster.config.jcache.BeanClassLoaderAwareJCacheRegionFactory; | |||
| import io.github.jhipster.config.JHipsterProperties; | |||
| import org.springframework.boot.autoconfigure.cache.JCacheManagerCustomizer; | |||
| import org.springframework.cache.annotation.EnableCaching; | |||
| import org.springframework.context.annotation.*; | |||
| @Configuration | |||
| @EnableCaching | |||
| public class CacheConfiguration { | |||
| private final javax.cache.configuration.Configuration<Object, Object> jcacheConfiguration; | |||
| public CacheConfiguration(JHipsterProperties jHipsterProperties) { | |||
| BeanClassLoaderAwareJCacheRegionFactory.setBeanClassLoader(this.getClass().getClassLoader()); | |||
| JHipsterProperties.Cache.Ehcache ehcache = | |||
| jHipsterProperties.getCache().getEhcache(); | |||
| jcacheConfiguration = Eh107Configuration.fromEhcacheCacheConfiguration( | |||
| CacheConfigurationBuilder.newCacheConfigurationBuilder(Object.class, Object.class, | |||
| ResourcePoolsBuilder.heap(ehcache.getMaxEntries())) | |||
| .withExpiry(ExpiryPolicyBuilder.timeToLiveExpiration(Duration.ofSeconds(ehcache.getTimeToLiveSeconds()))) | |||
| .build()); | |||
| } | |||
| @Bean | |||
| public JCacheManagerCustomizer cacheManagerCustomizer() { | |||
| return cm -> { | |||
| cm.createCache(vn.azteam.tpf.repository.UserRepository.USERS_BY_LOGIN_CACHE, jcacheConfiguration); | |||
| cm.createCache(vn.azteam.tpf.repository.UserRepository.USERS_BY_EMAIL_CACHE, jcacheConfiguration); | |||
| cm.createCache(vn.azteam.tpf.domain.User.class.getName(), jcacheConfiguration); | |||
| cm.createCache(vn.azteam.tpf.domain.Authority.class.getName(), jcacheConfiguration); | |||
| cm.createCache(vn.azteam.tpf.domain.User.class.getName() + ".authorities", jcacheConfiguration); | |||
| cm.createCache(vn.azteam.tpf.domain.TBDetailUser.class.getName(), jcacheConfiguration); | |||
| cm.createCache(vn.azteam.tpf.domain.TBActivity.class.getName(), jcacheConfiguration); | |||
| cm.createCache(vn.azteam.tpf.domain.TBAddress.class.getName(), jcacheConfiguration); | |||
| cm.createCache(vn.azteam.tpf.domain.TBCity.class.getName(), jcacheConfiguration); | |||
| cm.createCache(vn.azteam.tpf.domain.TBCommand.class.getName(), jcacheConfiguration); | |||
| cm.createCache(vn.azteam.tpf.domain.TBCountry.class.getName(), jcacheConfiguration); | |||
| cm.createCache(vn.azteam.tpf.domain.TBCrop.class.getName(), jcacheConfiguration); | |||
| cm.createCache(vn.azteam.tpf.domain.TBCustomer.class.getName(), jcacheConfiguration); | |||
| cm.createCache(vn.azteam.tpf.domain.TBDistrict.class.getName(), jcacheConfiguration); | |||
| cm.createCache(vn.azteam.tpf.domain.TBEntity.class.getName(), jcacheConfiguration); | |||
| cm.createCache(vn.azteam.tpf.domain.TBEnvironmentUpdate.class.getName(), jcacheConfiguration); | |||
| cm.createCache(vn.azteam.tpf.domain.TBEnvironmentalParameter.class.getName(), jcacheConfiguration); | |||
| cm.createCache(vn.azteam.tpf.domain.TBEquipment.class.getName(), jcacheConfiguration); | |||
| cm.createCache(vn.azteam.tpf.domain.TBEquipmentHistory.class.getName(), jcacheConfiguration); | |||
| cm.createCache(vn.azteam.tpf.domain.TBEquipmentOfCustomer.class.getName(), jcacheConfiguration); | |||
| cm.createCache(vn.azteam.tpf.domain.TBEquipmentType.class.getName(), jcacheConfiguration); | |||
| cm.createCache(vn.azteam.tpf.domain.TBFunction.class.getName(), jcacheConfiguration); | |||
| cm.createCache(vn.azteam.tpf.domain.TBFunctionGroup.class.getName(), jcacheConfiguration); | |||
| cm.createCache(vn.azteam.tpf.domain.TBGuideline.class.getName(), jcacheConfiguration); | |||
| cm.createCache(vn.azteam.tpf.domain.TBGuidelineDetails.class.getName(), jcacheConfiguration); | |||
| cm.createCache(vn.azteam.tpf.domain.TBLimits.class.getName(), jcacheConfiguration); | |||
| cm.createCache(vn.azteam.tpf.domain.TBMaintenanceDetails.class.getName(), jcacheConfiguration); | |||
| cm.createCache(vn.azteam.tpf.domain.TBMaintenanceSchedule.class.getName(), jcacheConfiguration); | |||
| cm.createCache(vn.azteam.tpf.domain.TBNurseryDetails.class.getName(), jcacheConfiguration); | |||
| cm.createCache(vn.azteam.tpf.domain.TBObjectParameter.class.getName(), jcacheConfiguration); | |||
| cm.createCache(vn.azteam.tpf.domain.TBObjectUpdate.class.getName(), jcacheConfiguration); | |||
| cm.createCache(vn.azteam.tpf.domain.TBPermission.class.getName(), jcacheConfiguration); | |||
| cm.createCache(vn.azteam.tpf.domain.TBRole.class.getName(), jcacheConfiguration); | |||
| cm.createCache(vn.azteam.tpf.domain.TBSetting.class.getName(), jcacheConfiguration); | |||
| cm.createCache(vn.azteam.tpf.domain.TBStockUpdate.class.getName(), jcacheConfiguration); | |||
| cm.createCache(vn.azteam.tpf.domain.TBSupplies.class.getName(), jcacheConfiguration); | |||
| cm.createCache(vn.azteam.tpf.domain.TBSuppliesInWarehouse.class.getName(), jcacheConfiguration); | |||
| cm.createCache(vn.azteam.tpf.domain.TBSuppliesOrder.class.getName(), jcacheConfiguration); | |||
| cm.createCache(vn.azteam.tpf.domain.TBSuppliesOrderDetails.class.getName(), jcacheConfiguration); | |||
| cm.createCache(vn.azteam.tpf.domain.TBSuppliesPriceHistory.class.getName(), jcacheConfiguration); | |||
| cm.createCache(vn.azteam.tpf.domain.TBSuppliesType.class.getName(), jcacheConfiguration); | |||
| cm.createCache(vn.azteam.tpf.domain.TBSuppliesUsingDetails.class.getName(), jcacheConfiguration); | |||
| cm.createCache(vn.azteam.tpf.domain.TBVendor.class.getName(), jcacheConfiguration); | |||
| cm.createCache(vn.azteam.tpf.domain.TBWard.class.getName(), jcacheConfiguration); | |||
| cm.createCache(vn.azteam.tpf.domain.TBActivityType.class.getName(), jcacheConfiguration); | |||
| cm.createCache(vn.azteam.tpf.domain.TBDetailUser.class.getName() + ".tbCrops", jcacheConfiguration); | |||
| cm.createCache(vn.azteam.tpf.domain.TBCrop.class.getName() + ".tbDetailUsers", jcacheConfiguration); | |||
| cm.createCache(vn.azteam.tpf.domain.TBGuideline.class.getName() + ".tbSupplies", jcacheConfiguration); | |||
| cm.createCache(vn.azteam.tpf.domain.TBSupplies.class.getName() + ".tbGuidelines", jcacheConfiguration); | |||
| cm.createCache(vn.azteam.tpf.domain.TBNotification.class.getName(), jcacheConfiguration); | |||
| cm.createCache(vn.azteam.tpf.domain.Casbin.class.getName(), jcacheConfiguration); | |||
| cm.createCache(vn.azteam.tpf.domain.TBCropType.class.getName(), jcacheConfiguration); | |||
| cm.createCache(vn.azteam.tpf.domain.TBEntityType.class.getName(), jcacheConfiguration); | |||
| cm.createCache(vn.azteam.tpf.domain.TBGuidelinePeriod.class.getName(), jcacheConfiguration); | |||
| cm.createCache(vn.azteam.tpf.domain.TBCustomerHasCropType.class.getName(), jcacheConfiguration); | |||
| cm.createCache(vn.azteam.tpf.domain.TBLocationOfCustomer.class.getName(), jcacheConfiguration); | |||
| cm.createCache(vn.azteam.tpf.domain.TBDashboardType.class.getName(), jcacheConfiguration); | |||
| cm.createCache(vn.azteam.tpf.domain.TBGuidelineDetailsObjectUpdate.class.getName(), jcacheConfiguration); | |||
| cm.createCache(vn.azteam.tpf.domain.TBBlockDetails.class.getName(), jcacheConfiguration); | |||
| cm.createCache(vn.azteam.tpf.domain.TBControlType.class.getName(), jcacheConfiguration); | |||
| cm.createCache(vn.azteam.tpf.domain.TBActivityExtendType.class.getName(), jcacheConfiguration); | |||
| cm.createCache(vn.azteam.tpf.domain.TBExternalTable.class.getName(), jcacheConfiguration); | |||
| cm.createCache(vn.azteam.tpf.domain.TBWaterType.class.getName(), jcacheConfiguration); | |||
| cm.createCache(vn.azteam.tpf.domain.TBProductUnit.class.getName(), jcacheConfiguration); | |||
| cm.createCache(vn.azteam.tpf.domain.TBProductBlockDetails.class.getName(), jcacheConfiguration); | |||
| cm.createCache(vn.azteam.tpf.domain.TBProductStockUpdate.class.getName(), jcacheConfiguration); | |||
| cm.createCache(vn.azteam.tpf.domain.TBGuidelineActivity.class.getName(), jcacheConfiguration); | |||
| cm.createCache(vn.azteam.tpf.domain.TBEntityLocationOfCustomer.class.getName(), jcacheConfiguration); | |||
| cm.createCache(vn.azteam.tpf.domain.TBBlockDetailsReport.class.getName(), jcacheConfiguration); | |||
| cm.createCache(vn.azteam.tpf.domain.TBProductBlockDetailsReport.class.getName(), jcacheConfiguration); | |||
| // jhipster-needle-ehcache-add-entry | |||
| }; | |||
| } | |||
| } | |||
| @@ -0,0 +1,28 @@ | |||
| package vn.azteam.tpf.config; | |||
| import io.github.jhipster.config.JHipsterConstants; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.cloud.config.java.AbstractCloudConfig; | |||
| import org.springframework.context.annotation.*; | |||
| import javax.sql.DataSource; | |||
| import org.springframework.boot.context.properties.ConfigurationProperties; | |||
| @Configuration | |||
| @Profile(JHipsterConstants.SPRING_PROFILE_CLOUD) | |||
| public class CloudDatabaseConfiguration extends AbstractCloudConfig { | |||
| private final Logger log = LoggerFactory.getLogger(CloudDatabaseConfiguration.class); | |||
| private final String CLOUD_CONFIGURATION_HIKARI_PREFIX = "spring.datasource.hikari"; | |||
| @Bean | |||
| @ConfigurationProperties(CLOUD_CONFIGURATION_HIKARI_PREFIX) | |||
| public DataSource dataSource() { | |||
| log.info("Configuring JDBC datasource from a cloud provider"); | |||
| return connectionFactory().dataSource(); | |||
| } | |||
| } | |||
| @@ -0,0 +1,17 @@ | |||
| package vn.azteam.tpf.config; | |||
| /** | |||
| * Application constants. | |||
| */ | |||
| public final class Constants { | |||
| // Regex for acceptable logins | |||
| public static final String LOGIN_REGEX = "^[_.@A-Za-z0-9-]*$"; | |||
| public static final String SYSTEM_ACCOUNT = "system"; | |||
| public static final String ANONYMOUS_USER = "anonymoususer"; | |||
| public static final String DEFAULT_LANGUAGE = "en"; | |||
| private Constants() { | |||
| } | |||
| } | |||
| @@ -0,0 +1,24 @@ | |||
| package vn.azteam.tpf.config; | |||
| import io.github.jhipster.config.JHipsterConstants; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.context.annotation.Bean; | |||
| import org.springframework.context.annotation.Configuration; | |||
| import org.springframework.data.elasticsearch.repository.config.EnableElasticsearchRepositories; | |||
| import org.springframework.data.jpa.repository.config.EnableJpaAuditing; | |||
| import org.springframework.data.jpa.repository.config.EnableJpaRepositories; | |||
| import org.springframework.transaction.annotation.EnableTransactionManagement; | |||
| @Configuration | |||
| @EnableJpaRepositories("vn.azteam.tpf.repository") | |||
| @EnableJpaAuditing(auditorAwareRef = "springSecurityAuditorAware") | |||
| @EnableTransactionManagement | |||
| @EnableElasticsearchRepositories("vn.azteam.tpf.repository.search") | |||
| public class DatabaseConfiguration { | |||
| private final Logger log = LoggerFactory.getLogger(DatabaseConfiguration.class); | |||
| } | |||
| @@ -0,0 +1,20 @@ | |||
| package vn.azteam.tpf.config; | |||
| import org.springframework.context.annotation.Configuration; | |||
| import org.springframework.format.FormatterRegistry; | |||
| import org.springframework.format.datetime.standard.DateTimeFormatterRegistrar; | |||
| import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; | |||
| /** | |||
| * Configure the converters to use the ISO format for dates by default. | |||
| */ | |||
| @Configuration | |||
| public class DateTimeFormatConfiguration implements WebMvcConfigurer { | |||
| @Override | |||
| public void addFormatters(FormatterRegistry registry) { | |||
| DateTimeFormatterRegistrar registrar = new DateTimeFormatterRegistrar(); | |||
| registrar.setUseIsoFormat(true); | |||
| registrar.registerFormatters(registry); | |||
| } | |||
| } | |||
| @@ -0,0 +1,51 @@ | |||
| package vn.azteam.tpf.config; | |||
| import io.github.jhipster.config.JHipsterConstants; | |||
| import org.springframework.boot.SpringApplication; | |||
| import org.springframework.core.env.Environment; | |||
| import java.util.*; | |||
| /** | |||
| * Utility class to load a Spring profile to be used as default | |||
| * when there is no <code>spring.profiles.active</code> set in the environment or as command line argument. | |||
| * If the value is not available in <code>application.yml</code> then <code>dev</code> profile will be used as default. | |||
| */ | |||
| public final class DefaultProfileUtil { | |||
| private static final String SPRING_PROFILE_DEFAULT = "spring.profiles.default"; | |||
| private DefaultProfileUtil() { | |||
| } | |||
| /** | |||
| * Set a default to use when no profile is configured. | |||
| * | |||
| * @param app the Spring application | |||
| */ | |||
| public static void addDefaultProfile(SpringApplication app) { | |||
| Map<String, Object> defProperties = new HashMap<>(); | |||
| /* | |||
| * The default profile to use when no other profiles are defined | |||
| * This cannot be set in the <code>application.yml</code> file. | |||
| * See https://github.com/spring-projects/spring-boot/issues/1219 | |||
| */ | |||
| defProperties.put(SPRING_PROFILE_DEFAULT, JHipsterConstants.SPRING_PROFILE_DEVELOPMENT); | |||
| app.setDefaultProperties(defProperties); | |||
| } | |||
| /** | |||
| * Get the profiles that are applied else get default profiles. | |||
| * | |||
| * @param env spring environment | |||
| * @return profiles | |||
| */ | |||
| public static String[] getActiveProfiles(Environment env) { | |||
| String[] profiles = env.getActiveProfiles(); | |||
| if (profiles.length == 0) { | |||
| return env.getDefaultProfiles(); | |||
| } | |||
| return profiles; | |||
| } | |||
| } | |||
| @@ -0,0 +1,72 @@ | |||
| package vn.azteam.tpf.config; | |||
| import com.fasterxml.jackson.databind.DeserializationFeature; | |||
| import com.fasterxml.jackson.databind.ObjectMapper; | |||
| import com.fasterxml.jackson.databind.SerializationFeature; | |||
| import com.github.vanroy.springdata.jest.JestElasticsearchTemplate; | |||
| import com.github.vanroy.springdata.jest.mapper.DefaultJestResultsMapper; | |||
| import io.searchbox.client.JestClient; | |||
| import org.springframework.boot.autoconfigure.data.elasticsearch.ElasticsearchProperties; | |||
| import org.springframework.boot.context.properties.EnableConfigurationProperties; | |||
| import org.springframework.context.annotation.Bean; | |||
| import org.springframework.context.annotation.Configuration; | |||
| import org.springframework.context.annotation.Primary; | |||
| import org.springframework.data.elasticsearch.core.ElasticsearchOperations; | |||
| import org.springframework.data.elasticsearch.core.EntityMapper; | |||
| import org.springframework.data.elasticsearch.core.convert.ElasticsearchConverter; | |||
| import org.springframework.data.elasticsearch.core.mapping.SimpleElasticsearchMappingContext; | |||
| import java.io.IOException; | |||
| @Configuration | |||
| @EnableConfigurationProperties(ElasticsearchProperties.class) | |||
| public class ElasticsearchConfiguration { | |||
| private ObjectMapper mapper; | |||
| public ElasticsearchConfiguration(ObjectMapper mapper) { | |||
| this.mapper = mapper; | |||
| } | |||
| @Bean | |||
| public EntityMapper getEntityMapper() { | |||
| return new CustomEntityMapper(mapper); | |||
| } | |||
| @Bean | |||
| @Primary | |||
| public ElasticsearchOperations elasticsearchTemplate(final JestClient jestClient, | |||
| final ElasticsearchConverter elasticsearchConverter, | |||
| final SimpleElasticsearchMappingContext simpleElasticsearchMappingContext, | |||
| EntityMapper mapper) { | |||
| return new JestElasticsearchTemplate( | |||
| jestClient, | |||
| elasticsearchConverter, | |||
| new DefaultJestResultsMapper(simpleElasticsearchMappingContext, mapper)); | |||
| } | |||
| public class CustomEntityMapper implements EntityMapper { | |||
| private ObjectMapper objectMapper; | |||
| public CustomEntityMapper(ObjectMapper objectMapper) { | |||
| this.objectMapper = objectMapper; | |||
| objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); | |||
| objectMapper.configure(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY, true); | |||
| objectMapper.configure(SerializationFeature.WRITE_DATE_TIMESTAMPS_AS_NANOSECONDS, true); | |||
| objectMapper.configure(SerializationFeature.INDENT_OUTPUT, false); | |||
| objectMapper.configure(DeserializationFeature.READ_DATE_TIMESTAMPS_AS_NANOSECONDS, true); | |||
| } | |||
| @Override | |||
| public String mapToString(Object object) throws IOException { | |||
| return objectMapper.writeValueAsString(object); | |||
| } | |||
| @Override | |||
| public <T> T mapToObject(String source, Class<T> clazz) throws IOException { | |||
| return objectMapper.readValue(source, clazz); | |||
| } | |||
| } | |||
| } | |||
| @@ -0,0 +1,63 @@ | |||
| package vn.azteam.tpf.config; | |||
| import com.fasterxml.jackson.datatype.hibernate5.Hibernate5Module; | |||
| import com.fasterxml.jackson.datatype.jdk8.Jdk8Module; | |||
| import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; | |||
| import com.fasterxml.jackson.module.afterburner.AfterburnerModule; | |||
| import org.springframework.context.annotation.Bean; | |||
| import org.springframework.context.annotation.Configuration; | |||
| import org.zalando.problem.ProblemModule; | |||
| import org.zalando.problem.violations.ConstraintViolationProblemModule; | |||
| @Configuration | |||
| public class JacksonConfiguration { | |||
| /** | |||
| * Support for Java date and time API. | |||
| * @return the corresponding Jackson module. | |||
| */ | |||
| @Bean | |||
| public JavaTimeModule javaTimeModule() { | |||
| return new JavaTimeModule(); | |||
| } | |||
| @Bean | |||
| public Jdk8Module jdk8TimeModule() { | |||
| return new Jdk8Module(); | |||
| } | |||
| /* | |||
| * Support for Hibernate types in Jackson. | |||
| */ | |||
| @Bean | |||
| public Hibernate5Module hibernate5Module() { | |||
| return new Hibernate5Module(); | |||
| } | |||
| /* | |||
| * Jackson Afterburner module to speed up serialization/deserialization. | |||
| */ | |||
| @Bean | |||
| public AfterburnerModule afterburnerModule() { | |||
| return new AfterburnerModule(); | |||
| } | |||
| /* | |||
| * Module for serialization/deserialization of RFC7807 Problem. | |||
| */ | |||
| @Bean | |||
| ProblemModule problemModule() { | |||
| return new ProblemModule(); | |||
| } | |||
| /* | |||
| * Module for serialization/deserialization of ConstraintViolationProblem. | |||
| */ | |||
| @Bean | |||
| ConstraintViolationProblemModule constraintViolationProblemModule() { | |||
| return new ConstraintViolationProblemModule(); | |||
| } | |||
| } | |||
| @@ -0,0 +1,53 @@ | |||
| package vn.azteam.tpf.config; | |||
| import javax.sql.DataSource; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Qualifier; | |||
| import org.springframework.boot.autoconfigure.liquibase.LiquibaseProperties; | |||
| import org.springframework.cache.CacheManager; | |||
| import org.springframework.context.annotation.Bean; | |||
| import org.springframework.context.annotation.Configuration; | |||
| import org.springframework.core.env.Environment; | |||
| import org.springframework.core.task.TaskExecutor; | |||
| import io.github.jhipster.config.JHipsterConstants; | |||
| import io.github.jhipster.config.liquibase.AsyncSpringLiquibase; | |||
| import liquibase.integration.spring.SpringLiquibase; | |||
| @Configuration | |||
| public class LiquibaseConfiguration { | |||
| private final Logger log = LoggerFactory.getLogger(LiquibaseConfiguration.class); | |||
| private final Environment env; | |||
| private final CacheManager cacheManager; | |||
| public LiquibaseConfiguration(Environment env, CacheManager cacheManager) { | |||
| this.env = env; | |||
| this.cacheManager = cacheManager; | |||
| } | |||
| @Bean | |||
| public SpringLiquibase liquibase(@Qualifier("taskExecutor") TaskExecutor taskExecutor, | |||
| DataSource dataSource, LiquibaseProperties liquibaseProperties) { | |||
| // Use liquibase.integration.spring.SpringLiquibase if you don't want Liquibase to start asynchronously | |||
| SpringLiquibase liquibase = new AsyncSpringLiquibase(taskExecutor, env); | |||
| liquibase.setDataSource(dataSource); | |||
| liquibase.setChangeLog("classpath:config/liquibase/master.xml"); | |||
| liquibase.setContexts(liquibaseProperties.getContexts()); | |||
| liquibase.setDefaultSchema(liquibaseProperties.getDefaultSchema()); | |||
| liquibase.setDropFirst(liquibaseProperties.isDropFirst()); | |||
| liquibase.setChangeLogParameters(liquibaseProperties.getParameters()); | |||
| if (env.acceptsProfiles(JHipsterConstants.SPRING_PROFILE_NO_LIQUIBASE)) { | |||
| liquibase.setShouldRun(false); | |||
| } else { | |||
| liquibase.setShouldRun(liquibaseProperties.isEnabled()); | |||
| log.debug("Configuring Liquibase"); | |||
| } | |||
| return liquibase; | |||
| } | |||
| } | |||
| @@ -0,0 +1,27 @@ | |||
| package vn.azteam.tpf.config; | |||
| import io.github.jhipster.config.locale.AngularCookieLocaleResolver; | |||
| import org.springframework.context.annotation.Bean; | |||
| import org.springframework.context.annotation.Configuration; | |||
| import org.springframework.web.servlet.LocaleResolver; | |||
| import org.springframework.web.servlet.config.annotation.*; | |||
| import org.springframework.web.servlet.i18n.LocaleChangeInterceptor; | |||
| @Configuration | |||
| public class LocaleConfiguration implements WebMvcConfigurer { | |||
| @Bean(name = "localeResolver") | |||
| public LocaleResolver localeResolver() { | |||
| AngularCookieLocaleResolver cookieLocaleResolver = new AngularCookieLocaleResolver(); | |||
| cookieLocaleResolver.setCookieName("NG_TRANSLATE_LANG_KEY"); | |||
| return cookieLocaleResolver; | |||
| } | |||
| @Override | |||
| public void addInterceptors(InterceptorRegistry registry) { | |||
| LocaleChangeInterceptor localeChangeInterceptor = new LocaleChangeInterceptor(); | |||
| localeChangeInterceptor.setParamName("language"); | |||
| registry.addInterceptor(localeChangeInterceptor); | |||
| } | |||
| } | |||
| @@ -0,0 +1,19 @@ | |||
| package vn.azteam.tpf.config; | |||
| import vn.azteam.tpf.aop.logging.LoggingAspect; | |||
| import io.github.jhipster.config.JHipsterConstants; | |||
| import org.springframework.context.annotation.*; | |||
| import org.springframework.core.env.Environment; | |||
| @Configuration | |||
| @EnableAspectJAutoProxy | |||
| public class LoggingAspectConfiguration { | |||
| @Bean | |||
| @Profile(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT) | |||
| public LoggingAspect loggingAspect(Environment env) { | |||
| return new LoggingAspect(env); | |||
| } | |||
| } | |||
| @@ -0,0 +1,156 @@ | |||
| package vn.azteam.tpf.config; | |||
| import java.net.InetSocketAddress; | |||
| import java.util.Iterator; | |||
| import io.github.jhipster.config.JHipsterProperties; | |||
| import ch.qos.logback.classic.AsyncAppender; | |||
| import ch.qos.logback.classic.Level; | |||
| import ch.qos.logback.classic.LoggerContext; | |||
| import ch.qos.logback.classic.boolex.OnMarkerEvaluator; | |||
| import ch.qos.logback.classic.spi.ILoggingEvent; | |||
| import ch.qos.logback.classic.spi.LoggerContextListener; | |||
| import ch.qos.logback.core.Appender; | |||
| import ch.qos.logback.core.filter.EvaluatorFilter; | |||
| import ch.qos.logback.core.spi.ContextAwareBase; | |||
| import ch.qos.logback.core.spi.FilterReply; | |||
| import net.logstash.logback.appender.LogstashTcpSocketAppender; | |||
| import net.logstash.logback.encoder.LogstashEncoder; | |||
| import net.logstash.logback.stacktrace.ShortenedThrowableConverter; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Value; | |||
| import org.springframework.context.annotation.Configuration; | |||
| @Configuration | |||
| public class LoggingConfiguration { | |||
| private static final String LOGSTASH_APPENDER_NAME = "LOGSTASH"; | |||
| private static final String ASYNC_LOGSTASH_APPENDER_NAME = "ASYNC_LOGSTASH"; | |||
| private final Logger log = LoggerFactory.getLogger(LoggingConfiguration.class); | |||
| private LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory(); | |||
| private final String appName; | |||
| private final String serverPort; | |||
| private final JHipsterProperties jHipsterProperties; | |||
| public LoggingConfiguration(@Value("${spring.application.name}") String appName, @Value("${server.port}") String serverPort, | |||
| JHipsterProperties jHipsterProperties) { | |||
| this.appName = appName; | |||
| this.serverPort = serverPort; | |||
| this.jHipsterProperties = jHipsterProperties; | |||
| if (jHipsterProperties.getLogging().getLogstash().isEnabled()) { | |||
| addLogstashAppender(context); | |||
| addContextListener(context); | |||
| } | |||
| if (jHipsterProperties.getMetrics().getLogs().isEnabled()) { | |||
| setMetricsMarkerLogbackFilter(context); | |||
| } | |||
| } | |||
| private void addContextListener(LoggerContext context) { | |||
| LogbackLoggerContextListener loggerContextListener = new LogbackLoggerContextListener(); | |||
| loggerContextListener.setContext(context); | |||
| context.addListener(loggerContextListener); | |||
| } | |||
| private void addLogstashAppender(LoggerContext context) { | |||
| log.info("Initializing Logstash logging"); | |||
| LogstashTcpSocketAppender logstashAppender = new LogstashTcpSocketAppender(); | |||
| logstashAppender.setName(LOGSTASH_APPENDER_NAME); | |||
| logstashAppender.setContext(context); | |||
| String customFields = "{\"app_name\":\"" + appName + "\",\"app_port\":\"" + serverPort + "\"}"; | |||
| // More documentation is available at: https://github.com/logstash/logstash-logback-encoder | |||
| LogstashEncoder logstashEncoder = new LogstashEncoder(); | |||
| // Set the Logstash appender config from JHipster properties | |||
| logstashEncoder.setCustomFields(customFields); | |||
| // Set the Logstash appender config from JHipster properties | |||
| logstashAppender.addDestinations(new InetSocketAddress(jHipsterProperties.getLogging().getLogstash().getHost(), jHipsterProperties.getLogging().getLogstash().getPort())); | |||
| ShortenedThrowableConverter throwableConverter = new ShortenedThrowableConverter(); | |||
| throwableConverter.setRootCauseFirst(true); | |||
| logstashEncoder.setThrowableConverter(throwableConverter); | |||
| logstashEncoder.setCustomFields(customFields); | |||
| logstashAppender.setEncoder(logstashEncoder); | |||
| logstashAppender.start(); | |||
| // Wrap the appender in an Async appender for performance | |||
| AsyncAppender asyncLogstashAppender = new AsyncAppender(); | |||
| asyncLogstashAppender.setContext(context); | |||
| asyncLogstashAppender.setName(ASYNC_LOGSTASH_APPENDER_NAME); | |||
| asyncLogstashAppender.setQueueSize(jHipsterProperties.getLogging().getLogstash().getQueueSize()); | |||
| asyncLogstashAppender.addAppender(logstashAppender); | |||
| asyncLogstashAppender.start(); | |||
| context.getLogger("ROOT").addAppender(asyncLogstashAppender); | |||
| } | |||
| // Configure a log filter to remove "metrics" logs from all appenders except the "LOGSTASH" appender | |||
| private void setMetricsMarkerLogbackFilter(LoggerContext context) { | |||
| log.info("Filtering metrics logs from all appenders except the {} appender", LOGSTASH_APPENDER_NAME); | |||
| OnMarkerEvaluator onMarkerMetricsEvaluator = new OnMarkerEvaluator(); | |||
| onMarkerMetricsEvaluator.setContext(context); | |||
| onMarkerMetricsEvaluator.addMarker("metrics"); | |||
| onMarkerMetricsEvaluator.start(); | |||
| EvaluatorFilter<ILoggingEvent> metricsFilter = new EvaluatorFilter<>(); | |||
| metricsFilter.setContext(context); | |||
| metricsFilter.setEvaluator(onMarkerMetricsEvaluator); | |||
| metricsFilter.setOnMatch(FilterReply.DENY); | |||
| metricsFilter.start(); | |||
| for (ch.qos.logback.classic.Logger logger : context.getLoggerList()) { | |||
| for (Iterator<Appender<ILoggingEvent>> it = logger.iteratorForAppenders(); it.hasNext();) { | |||
| Appender<ILoggingEvent> appender = it.next(); | |||
| if (!appender.getName().equals(ASYNC_LOGSTASH_APPENDER_NAME)) { | |||
| log.debug("Filter metrics logs from the {} appender", appender.getName()); | |||
| appender.setContext(context); | |||
| appender.addFilter(metricsFilter); | |||
| appender.start(); | |||
| } | |||
| } | |||
| } | |||
| } | |||
| /** | |||
| * Logback configuration is achieved by configuration file and API. | |||
| * When configuration file change is detected, the configuration is reset. | |||
| * This listener ensures that the programmatic configuration is also re-applied after reset. | |||
| */ | |||
| class LogbackLoggerContextListener extends ContextAwareBase implements LoggerContextListener { | |||
| @Override | |||
| public boolean isResetResistant() { | |||
| return true; | |||
| } | |||
| @Override | |||
| public void onStart(LoggerContext context) { | |||
| addLogstashAppender(context); | |||
| } | |||
| @Override | |||
| public void onReset(LoggerContext context) { | |||
| addLogstashAppender(context); | |||
| } | |||
| @Override | |||
| public void onStop(LoggerContext context) { | |||
| // Nothing to do. | |||
| } | |||
| @Override | |||
| public void onLevelChange(ch.qos.logback.classic.Logger logger, Level level) { | |||
| // Nothing to do. | |||
| } | |||
| } | |||
| } | |||
| @@ -0,0 +1,126 @@ | |||
| package vn.azteam.tpf.config; | |||
| import io.github.jhipster.config.JHipsterProperties; | |||
| import com.codahale.metrics.JmxReporter; | |||
| import com.codahale.metrics.JvmAttributeGaugeSet; | |||
| import com.codahale.metrics.MetricRegistry; | |||
| import com.codahale.metrics.Slf4jReporter; | |||
| import com.codahale.metrics.health.HealthCheckRegistry; | |||
| import com.codahale.metrics.jcache.JCacheGaugeSet; | |||
| import com.codahale.metrics.jvm.*; | |||
| import com.ryantenney.metrics.spring.config.annotation.EnableMetrics; | |||
| import com.ryantenney.metrics.spring.config.annotation.MetricsConfigurerAdapter; | |||
| import com.zaxxer.hikari.HikariDataSource; | |||
| import io.prometheus.client.CollectorRegistry; | |||
| import io.prometheus.client.dropwizard.DropwizardExports; | |||
| import io.prometheus.client.exporter.MetricsServlet; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.slf4j.Marker; | |||
| import org.slf4j.MarkerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.boot.web.servlet.ServletContextInitializer; | |||
| import org.springframework.cache.CacheManager; | |||
| import org.springframework.context.annotation.*; | |||
| import javax.annotation.PostConstruct; | |||
| import javax.servlet.ServletContext; | |||
| import java.lang.management.ManagementFactory; | |||
| import java.util.concurrent.TimeUnit; | |||
| @Configuration | |||
| @EnableMetrics(proxyTargetClass = true) | |||
| public class MetricsConfiguration extends MetricsConfigurerAdapter implements ServletContextInitializer { | |||
| private static final String PROP_METRIC_REG_JVM_MEMORY = "jvm.memory"; | |||
| private static final String PROP_METRIC_REG_JVM_GARBAGE = "jvm.garbage"; | |||
| private static final String PROP_METRIC_REG_JVM_THREADS = "jvm.threads"; | |||
| private static final String PROP_METRIC_REG_JVM_FILES = "jvm.files"; | |||
| private static final String PROP_METRIC_REG_JVM_BUFFERS = "jvm.buffers"; | |||
| private static final String PROP_METRIC_REG_JVM_ATTRIBUTE_SET = "jvm.attributes"; | |||
| private static final String PROP_METRIC_REG_JCACHE_STATISTICS = "jcache.statistics"; | |||
| private final Logger log = LoggerFactory.getLogger(MetricsConfiguration.class); | |||
| private MetricRegistry metricRegistry = new MetricRegistry(); | |||
| private HealthCheckRegistry healthCheckRegistry = new HealthCheckRegistry(); | |||
| private final JHipsterProperties jHipsterProperties; | |||
| private HikariDataSource hikariDataSource; | |||
| // The cacheManager is injected here to force its initialization, so the JCacheGaugeSet | |||
| // will be correctly created below. | |||
| public MetricsConfiguration(JHipsterProperties jHipsterProperties, CacheManager cacheManager) { | |||
| this.jHipsterProperties = jHipsterProperties; | |||
| } | |||
| @Autowired(required = false) | |||
| public void setHikariDataSource(HikariDataSource hikariDataSource) { | |||
| this.hikariDataSource = hikariDataSource; | |||
| } | |||
| @Override | |||
| @Bean | |||
| public MetricRegistry getMetricRegistry() { | |||
| return metricRegistry; | |||
| } | |||
| @Override | |||
| @Bean | |||
| public HealthCheckRegistry getHealthCheckRegistry() { | |||
| return healthCheckRegistry; | |||
| } | |||
| @PostConstruct | |||
| public void init() { | |||
| log.debug("Registering JVM gauges"); | |||
| metricRegistry.register(PROP_METRIC_REG_JVM_MEMORY, new MemoryUsageGaugeSet()); | |||
| metricRegistry.register(PROP_METRIC_REG_JVM_GARBAGE, new GarbageCollectorMetricSet()); | |||
| metricRegistry.register(PROP_METRIC_REG_JVM_THREADS, new ThreadStatesGaugeSet()); | |||
| metricRegistry.register(PROP_METRIC_REG_JVM_FILES, new FileDescriptorRatioGauge()); | |||
| metricRegistry.register(PROP_METRIC_REG_JVM_BUFFERS, new BufferPoolMetricSet(ManagementFactory.getPlatformMBeanServer())); | |||
| metricRegistry.register(PROP_METRIC_REG_JVM_ATTRIBUTE_SET, new JvmAttributeGaugeSet()); | |||
| metricRegistry.register(PROP_METRIC_REG_JCACHE_STATISTICS, new JCacheGaugeSet()); | |||
| if (hikariDataSource != null) { | |||
| log.debug("Monitoring the datasource"); | |||
| // remove the factory created by HikariDataSourceMetricsPostProcessor until JHipster migrate to Micrometer | |||
| hikariDataSource.setMetricsTrackerFactory(null); | |||
| hikariDataSource.setMetricRegistry(metricRegistry); | |||
| } | |||
| if (jHipsterProperties.getMetrics().getJmx().isEnabled()) { | |||
| log.debug("Initializing Metrics JMX reporting"); | |||
| JmxReporter jmxReporter = JmxReporter.forRegistry(metricRegistry).build(); | |||
| jmxReporter.start(); | |||
| } | |||
| if (jHipsterProperties.getMetrics().getLogs().isEnabled()) { | |||
| log.info("Initializing Metrics Log reporting"); | |||
| Marker metricsMarker = MarkerFactory.getMarker("metrics"); | |||
| final Slf4jReporter reporter = Slf4jReporter.forRegistry(metricRegistry) | |||
| .outputTo(LoggerFactory.getLogger("metrics")) | |||
| .markWith(metricsMarker) | |||
| .convertRatesTo(TimeUnit.SECONDS) | |||
| .convertDurationsTo(TimeUnit.MILLISECONDS) | |||
| .build(); | |||
| reporter.start(jHipsterProperties.getMetrics().getLogs().getReportFrequency(), TimeUnit.SECONDS); | |||
| } | |||
| } | |||
| @Override | |||
| public void onStartup(ServletContext servletContext) { | |||
| if (jHipsterProperties.getMetrics().getPrometheus().isEnabled()) { | |||
| String endpoint = jHipsterProperties.getMetrics().getPrometheus().getEndpoint(); | |||
| log.debug("Initializing prometheus metrics exporting via {}", endpoint); | |||
| CollectorRegistry.defaultRegistry.register(new DropwizardExports(metricRegistry)); | |||
| servletContext | |||
| .addServlet("prometheusMetrics", new MetricsServlet(CollectorRegistry.defaultRegistry)) | |||
| .addMapping(endpoint); | |||
| } | |||
| } | |||
| } | |||
| @@ -0,0 +1,35 @@ | |||
| package vn.azteam.tpf.config; | |||
| import com.fasterxml.jackson.databind.ObjectMapper; | |||
| import com.fasterxml.jackson.databind.SerializationFeature; | |||
| import org.springframework.context.annotation.Configuration; | |||
| import org.springframework.http.converter.HttpMessageConverter; | |||
| import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; | |||
| import org.springframework.web.servlet.config.annotation.EnableWebMvc; | |||
| import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; | |||
| import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; | |||
| import java.util.List; | |||
| @Configuration | |||
| @EnableWebMvc | |||
| public class MvcConfig implements WebMvcConfigurer { | |||
| @Override | |||
| public void addResourceHandlers(ResourceHandlerRegistry registry) { | |||
| registry | |||
| .addResourceHandler("/upload/**") | |||
| .addResourceLocations("file:/home/jhipster/upload/"); | |||
| } | |||
| @Override | |||
| public void extendMessageConverters(List<HttpMessageConverter<?>> converters) { | |||
| for (HttpMessageConverter<?> converter : converters) { | |||
| if (converter instanceof MappingJackson2HttpMessageConverter) { | |||
| MappingJackson2HttpMessageConverter jsonMessageConverter = (MappingJackson2HttpMessageConverter) converter; | |||
| ObjectMapper objectMapper = jsonMessageConverter.getObjectMapper(); | |||
| objectMapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); | |||
| break; | |||
| } | |||
| } | |||
| } | |||
| } | |||
| @@ -0,0 +1,39 @@ | |||
| //package vn.azteam.tpf.config; | |||
| // | |||
| //import com.fasterxml.jackson.databind.ObjectMapper; | |||
| //import com.fasterxml.jackson.databind.SerializationFeature; | |||
| //import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; | |||
| //import org.springframework.boot.autoconfigure.http.HttpMessageConverters; | |||
| //import org.springframework.context.annotation.Bean; | |||
| //import org.springframework.context.annotation.Configuration; | |||
| //import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; | |||
| //import org.springframework.web.client.RestTemplate; | |||
| // | |||
| //@Configuration | |||
| //public class RestConfiguration { | |||
| // | |||
| // @Bean | |||
| // public RestTemplate myRestTemplate(HttpMessageConverters customConverters) { | |||
| // RestTemplate restTemplate = new RestTemplate(); | |||
| // restTemplate.setMessageConverters(customConverters.getConverters()); | |||
| // return restTemplate; | |||
| // } | |||
| // | |||
| // /* | |||
| // * The following custom HttpMessageConverter is injected into myRestTemplate | |||
| // * in order to appropriately configure the serialization/deserialization of LocalDate | |||
| // * instances into/from strings. | |||
| // */ | |||
| // @Bean | |||
| // public HttpMessageConverters customConverters() { | |||
| // MappingJackson2HttpMessageConverter converter = new MappingJackson2HttpMessageConverter(); | |||
| // | |||
| // ObjectMapper mapper = new ObjectMapper(); | |||
| // mapper.registerModule(new JavaTimeModule()); | |||
| // mapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false); | |||
| // mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); | |||
| // converter.setObjectMapper(mapper); | |||
| // return new HttpMessageConverters(converter); | |||
| // } | |||
| // | |||
| //} | |||
| @@ -0,0 +1,142 @@ | |||
| package vn.azteam.tpf.config; | |||
| import org.casbin.jcasbin.main.Enforcer; | |||
| import org.springframework.context.annotation.*; | |||
| import vn.azteam.tpf.security.*; | |||
| import vn.azteam.tpf.security.apiKey.ApiKeyProvider; | |||
| import vn.azteam.tpf.security.authz.AuthzConfigurer; | |||
| import vn.azteam.tpf.security.jwt.*; | |||
| import org.springframework.beans.factory.BeanInitializationException; | |||
| import org.springframework.http.HttpMethod; | |||
| import org.springframework.security.authentication.AuthenticationManager; | |||
| import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; | |||
| import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity; | |||
| import org.springframework.security.config.annotation.web.builders.HttpSecurity; | |||
| import org.springframework.security.config.annotation.web.builders.WebSecurity; | |||
| import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; | |||
| import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; | |||
| import org.springframework.security.config.http.SessionCreationPolicy; | |||
| import org.springframework.security.core.userdetails.UserDetailsService; | |||
| import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; | |||
| import org.springframework.security.crypto.password.PasswordEncoder; | |||
| import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter; | |||
| import org.springframework.web.filter.CorsFilter; | |||
| import org.zalando.problem.spring.web.advice.security.SecurityProblemSupport; | |||
| import vn.azteam.tpf.service.TBPermissionQueryService; | |||
| import vn.azteam.tpf.service.UserService; | |||
| import javax.annotation.PostConstruct; | |||
| @Configuration | |||
| @EnableWebSecurity | |||
| @EnableGlobalMethodSecurity(prePostEnabled = true, securedEnabled = true) | |||
| @Import(SecurityProblemSupport.class) | |||
| public class SecurityConfiguration extends WebSecurityConfigurerAdapter { | |||
| private final AuthenticationManagerBuilder authenticationManagerBuilder; | |||
| private final UserDetailsService userDetailsService; | |||
| private final TokenProvider tokenProvider; | |||
| private final CorsFilter corsFilter; | |||
| private final SecurityProblemSupport problemSupport; | |||
| //@Autowired | |||
| private final UserService userService; | |||
| private final ApiKeyProvider apiKeyProvider; | |||
| //@Autowired | |||
| private final TBPermissionQueryService tbPermissionQueryService; | |||
| private final Enforcer enforcer; | |||
| public SecurityConfiguration(AuthenticationManagerBuilder authenticationManagerBuilder, UserDetailsService userDetailsService, TokenProvider tokenProvider, CorsFilter corsFilter, SecurityProblemSupport problemSupport, @Lazy UserService userService, ApiKeyProvider apiKeyProvider, @Lazy TBPermissionQueryService tbPermissionQueryService, Enforcer enforcer) { | |||
| this.authenticationManagerBuilder = authenticationManagerBuilder; | |||
| this.userDetailsService = userDetailsService; | |||
| this.tokenProvider = tokenProvider; | |||
| this.corsFilter = corsFilter; | |||
| this.problemSupport = problemSupport; | |||
| this.userService = userService; | |||
| this.apiKeyProvider = apiKeyProvider; | |||
| this.tbPermissionQueryService = tbPermissionQueryService; | |||
| this.enforcer = enforcer; | |||
| } | |||
| @PostConstruct | |||
| public void init() { | |||
| try { | |||
| authenticationManagerBuilder | |||
| .userDetailsService(userDetailsService) | |||
| .passwordEncoder(passwordEncoder()); | |||
| } catch (Exception e) { | |||
| throw new BeanInitializationException("Security configuration failed", e); | |||
| } | |||
| } | |||
| @Override | |||
| @Bean | |||
| public AuthenticationManager authenticationManagerBean() throws Exception { | |||
| return super.authenticationManagerBean(); | |||
| } | |||
| @Bean | |||
| public PasswordEncoder passwordEncoder() { | |||
| return new BCryptPasswordEncoder(); | |||
| } | |||
| @Override | |||
| public void configure(WebSecurity web) throws Exception { | |||
| web.ignoring() | |||
| .antMatchers(HttpMethod.OPTIONS, "/**") | |||
| .antMatchers("/swagger-ui/index.html") | |||
| .antMatchers("/test/**"); | |||
| } | |||
| @Override | |||
| public void configure(HttpSecurity http) throws Exception { | |||
| http | |||
| .csrf() | |||
| .disable() | |||
| .addFilterBefore(corsFilter, UsernamePasswordAuthenticationFilter.class) | |||
| .exceptionHandling() | |||
| .authenticationEntryPoint(problemSupport) | |||
| .accessDeniedHandler(problemSupport) | |||
| .and() | |||
| .headers() | |||
| .frameOptions() | |||
| .disable() | |||
| .and() | |||
| .sessionManagement() | |||
| .sessionCreationPolicy(SessionCreationPolicy.STATELESS) | |||
| .and() | |||
| .authorizeRequests() | |||
| .antMatchers("/api/register").permitAll() | |||
| .antMatchers("/api/activate").permitAll() | |||
| .antMatchers("/api/authenticate").permitAll() | |||
| .antMatchers("/api/account/reset-password/init").permitAll() | |||
| .antMatchers("/api/account/reset-password/finish").permitAll() | |||
| .antMatchers("/api//notification/exceed-limit").permitAll() | |||
| .antMatchers("/api/ots/**").permitAll() | |||
| // .antMatchers("/api/ots/**").hasAuthority(AuthoritiesConstants.ANONYMOUS) | |||
| .antMatchers("/api/**").authenticated() | |||
| .antMatchers("/websocket/tracker").hasAuthority(AuthoritiesConstants.ADMIN) | |||
| .antMatchers("/websocket/**").permitAll() | |||
| .antMatchers("/management/health").permitAll() | |||
| .antMatchers("/management/info").permitAll() | |||
| .antMatchers("/management/**").hasAuthority(AuthoritiesConstants.ADMIN).and() | |||
| .apply(securityConfigurerAdapter()) | |||
| .and() | |||
| .apply(authzAdapter()); | |||
| } | |||
| private AuthzConfigurer authzAdapter() { | |||
| return new AuthzConfigurer(userService, tbPermissionQueryService, enforcer, apiKeyProvider); | |||
| } | |||
| private JWTConfigurer securityConfigurerAdapter() { | |||
| return new JWTConfigurer(tokenProvider); | |||
| } | |||
| } | |||
| @@ -0,0 +1,135 @@ | |||
| package vn.azteam.tpf.config; | |||
| import com.codahale.metrics.MetricRegistry; | |||
| import com.codahale.metrics.servlet.InstrumentedFilter; | |||
| import com.codahale.metrics.servlets.MetricsServlet; | |||
| import io.github.jhipster.config.JHipsterProperties; | |||
| import io.undertow.UndertowOptions; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.boot.web.embedded.undertow.UndertowServletWebServerFactory; | |||
| import org.springframework.boot.web.server.*; | |||
| import org.springframework.boot.web.servlet.ServletContextInitializer; | |||
| import org.springframework.boot.web.servlet.server.ConfigurableServletWebServerFactory; | |||
| import org.springframework.context.annotation.Bean; | |||
| import org.springframework.context.annotation.Configuration; | |||
| import org.springframework.core.env.Environment; | |||
| import org.springframework.http.MediaType; | |||
| import org.springframework.web.cors.CorsConfiguration; | |||
| import org.springframework.web.cors.UrlBasedCorsConfigurationSource; | |||
| import org.springframework.web.filter.CorsFilter; | |||
| import javax.servlet.*; | |||
| import java.nio.charset.StandardCharsets; | |||
| import java.util.*; | |||
| /** | |||
| * Configuration of web application with Servlet 3.0 APIs. | |||
| */ | |||
| @Configuration | |||
| public class WebConfigurer implements ServletContextInitializer, WebServerFactoryCustomizer<WebServerFactory> { | |||
| private final Logger log = LoggerFactory.getLogger(WebConfigurer.class); | |||
| private final Environment env; | |||
| private final JHipsterProperties jHipsterProperties; | |||
| private MetricRegistry metricRegistry; | |||
| public WebConfigurer(Environment env, JHipsterProperties jHipsterProperties) { | |||
| this.env = env; | |||
| this.jHipsterProperties = jHipsterProperties; | |||
| } | |||
| @Override | |||
| public void onStartup(ServletContext servletContext) throws ServletException { | |||
| if (env.getActiveProfiles().length != 0) { | |||
| log.info("Web application configuration, using profiles: {}", (Object[]) env.getActiveProfiles()); | |||
| } | |||
| EnumSet<DispatcherType> disps = EnumSet.of(DispatcherType.REQUEST, DispatcherType.FORWARD, DispatcherType.ASYNC); | |||
| initMetrics(servletContext, disps); | |||
| log.info("Web application fully configured"); | |||
| } | |||
| /** | |||
| * Customize the Servlet engine: Mime types, the document root, the cache. | |||
| */ | |||
| @Override | |||
| public void customize(WebServerFactory server) { | |||
| setMimeMappings(server); | |||
| /* | |||
| * Enable HTTP/2 for Undertow - https://twitter.com/ankinson/status/829256167700492288 | |||
| * HTTP/2 requires HTTPS, so HTTP requests will fallback to HTTP/1.1. | |||
| * See the JHipsterProperties class and your application-*.yml configuration files | |||
| * for more information. | |||
| */ | |||
| if (jHipsterProperties.getHttp().getVersion().equals(JHipsterProperties.Http.Version.V_2_0) && | |||
| server instanceof UndertowServletWebServerFactory) { | |||
| ((UndertowServletWebServerFactory) server) | |||
| .addBuilderCustomizers(builder -> | |||
| builder.setServerOption(UndertowOptions.ENABLE_HTTP2, true)); | |||
| } | |||
| } | |||
| private void setMimeMappings(WebServerFactory server) { | |||
| if (server instanceof ConfigurableServletWebServerFactory) { | |||
| MimeMappings mappings = new MimeMappings(MimeMappings.DEFAULT); | |||
| // IE issue, see https://github.com/jhipster/generator-jhipster/pull/711 | |||
| mappings.add("html", MediaType.TEXT_HTML_VALUE + ";charset=" + StandardCharsets.UTF_8.name().toLowerCase()); | |||
| // CloudFoundry issue, see https://github.com/cloudfoundry/gorouter/issues/64 | |||
| mappings.add("json", MediaType.TEXT_HTML_VALUE + ";charset=" + StandardCharsets.UTF_8.name().toLowerCase()); | |||
| ConfigurableServletWebServerFactory servletWebServer = (ConfigurableServletWebServerFactory) server; | |||
| servletWebServer.setMimeMappings(mappings); | |||
| } | |||
| } | |||
| /** | |||
| * Initializes Metrics. | |||
| */ | |||
| private void initMetrics(ServletContext servletContext, EnumSet<DispatcherType> disps) { | |||
| log.debug("Initializing Metrics registries"); | |||
| servletContext.setAttribute(InstrumentedFilter.REGISTRY_ATTRIBUTE, | |||
| metricRegistry); | |||
| servletContext.setAttribute(MetricsServlet.METRICS_REGISTRY, | |||
| metricRegistry); | |||
| log.debug("Registering Metrics Filter"); | |||
| FilterRegistration.Dynamic metricsFilter = servletContext.addFilter("webappMetricsFilter", | |||
| new InstrumentedFilter()); | |||
| metricsFilter.addMappingForUrlPatterns(disps, true, "/*"); | |||
| metricsFilter.setAsyncSupported(true); | |||
| log.debug("Registering Metrics Servlet"); | |||
| ServletRegistration.Dynamic metricsAdminServlet = | |||
| servletContext.addServlet("metricsServlet", new MetricsServlet()); | |||
| metricsAdminServlet.addMapping("/management/metrics/*"); | |||
| metricsAdminServlet.setAsyncSupported(true); | |||
| metricsAdminServlet.setLoadOnStartup(2); | |||
| } | |||
| @Bean | |||
| public CorsFilter corsFilter() { | |||
| UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); | |||
| CorsConfiguration config = jHipsterProperties.getCors(); | |||
| if (config.getAllowedOrigins() != null && !config.getAllowedOrigins().isEmpty()) { | |||
| log.debug("Registering CORS filter"); | |||
| source.registerCorsConfiguration("/api/**", config); | |||
| source.registerCorsConfiguration("/management/**", config); | |||
| source.registerCorsConfiguration("/v2/api-docs", config); | |||
| } | |||
| return new CorsFilter(source); | |||
| } | |||
| @Autowired(required = false) | |||
| public void setMetricRegistry(MetricRegistry metricRegistry) { | |||
| this.metricRegistry = metricRegistry; | |||
| } | |||
| } | |||
| @@ -0,0 +1,82 @@ | |||
| package vn.azteam.tpf.config; | |||
| import vn.azteam.tpf.security.AuthoritiesConstants; | |||
| import java.security.Principal; | |||
| import java.util.*; | |||
| import org.springframework.context.annotation.Bean; | |||
| import org.springframework.context.annotation.Configuration; | |||
| import org.springframework.http.server.*; | |||
| import org.springframework.messaging.simp.config.MessageBrokerRegistry; | |||
| import org.springframework.security.authentication.AnonymousAuthenticationToken; | |||
| import org.springframework.security.core.authority.SimpleGrantedAuthority; | |||
| import org.springframework.web.socket.WebSocketHandler; | |||
| import org.springframework.web.socket.config.annotation.*; | |||
| import org.springframework.web.socket.server.HandshakeInterceptor; | |||
| import org.springframework.web.socket.server.support.DefaultHandshakeHandler; | |||
| import io.github.jhipster.config.JHipsterProperties; | |||
| @Configuration | |||
| @EnableWebSocketMessageBroker | |||
| public class WebsocketConfiguration implements WebSocketMessageBrokerConfigurer { | |||
| public static final String IP_ADDRESS = "IP_ADDRESS"; | |||
| private final JHipsterProperties jHipsterProperties; | |||
| public WebsocketConfiguration(JHipsterProperties jHipsterProperties) { | |||
| this.jHipsterProperties = jHipsterProperties; | |||
| } | |||
| @Override | |||
| public void configureMessageBroker(MessageBrokerRegistry config) { | |||
| config.enableSimpleBroker("/topic"); | |||
| } | |||
| @Override | |||
| public void registerStompEndpoints(StompEndpointRegistry registry) { | |||
| String[] allowedOrigins = Optional.ofNullable(jHipsterProperties.getCors().getAllowedOrigins()).map(origins -> origins.toArray(new String[0])).orElse(new String[0]); | |||
| registry.addEndpoint("/websocket/tracker") | |||
| .setHandshakeHandler(defaultHandshakeHandler()) | |||
| .setAllowedOrigins(allowedOrigins) | |||
| .withSockJS() | |||
| .setInterceptors(httpSessionHandshakeInterceptor()); | |||
| } | |||
| @Bean | |||
| public HandshakeInterceptor httpSessionHandshakeInterceptor() { | |||
| return new HandshakeInterceptor() { | |||
| @Override | |||
| public boolean beforeHandshake(ServerHttpRequest request, ServerHttpResponse response, WebSocketHandler wsHandler, Map<String, Object> attributes) throws Exception { | |||
| if (request instanceof ServletServerHttpRequest) { | |||
| ServletServerHttpRequest servletRequest = (ServletServerHttpRequest) request; | |||
| attributes.put(IP_ADDRESS, servletRequest.getRemoteAddress()); | |||
| } | |||
| return true; | |||
| } | |||
| @Override | |||
| public void afterHandshake(ServerHttpRequest request, ServerHttpResponse response, WebSocketHandler wsHandler, Exception exception) { | |||
| } | |||
| }; | |||
| } | |||
| private DefaultHandshakeHandler defaultHandshakeHandler() { | |||
| return new DefaultHandshakeHandler() { | |||
| @Override | |||
| protected Principal determineUser(ServerHttpRequest request, WebSocketHandler wsHandler, Map<String, Object> attributes) { | |||
| Principal principal = request.getPrincipal(); | |||
| if (principal == null) { | |||
| Collection<SimpleGrantedAuthority> authorities = new ArrayList<>(); | |||
| authorities.add(new SimpleGrantedAuthority(AuthoritiesConstants.ANONYMOUS)); | |||
| principal = new AnonymousAuthenticationToken("WebsocketConfiguration", "anonymous", authorities); | |||
| } | |||
| return principal; | |||
| } | |||
| }; | |||
| } | |||
| } | |||
| @@ -0,0 +1,35 @@ | |||
| package vn.azteam.tpf.config; | |||
| import vn.azteam.tpf.security.AuthoritiesConstants; | |||
| import org.springframework.context.annotation.Configuration; | |||
| import org.springframework.messaging.simp.SimpMessageType; | |||
| import org.springframework.security.config.annotation.web.messaging.MessageSecurityMetadataSourceRegistry; | |||
| import org.springframework.security.config.annotation.web.socket.AbstractSecurityWebSocketMessageBrokerConfigurer; | |||
| @Configuration | |||
| public class WebsocketSecurityConfiguration extends AbstractSecurityWebSocketMessageBrokerConfigurer { | |||
| @Override | |||
| protected void configureInbound(MessageSecurityMetadataSourceRegistry messages) { | |||
| messages | |||
| .nullDestMatcher().authenticated() | |||
| .simpDestMatchers("/topic/tracker").hasAuthority(AuthoritiesConstants.ADMIN) | |||
| // matches any destination that starts with /topic/ | |||
| // (i.e. cannot send messages directly to /topic/) | |||
| // (i.e. cannot subscribe to /topic/messages/* to get messages sent to | |||
| // /topic/messages-user<id>) | |||
| .simpDestMatchers("/topic/**").authenticated() | |||
| // message types other than MESSAGE and SUBSCRIBE | |||
| .simpTypeMatchers(SimpMessageType.MESSAGE, SimpMessageType.SUBSCRIBE).denyAll() | |||
| // catch all | |||
| .anyMessage().denyAll(); | |||
| } | |||
| /** | |||
| * Disables CSRF for Websockets. | |||
| */ | |||
| @Override | |||
| protected boolean sameOriginDisabled() { | |||
| return true; | |||
| } | |||
| } | |||
| @@ -0,0 +1,86 @@ | |||
| package vn.azteam.tpf.config.audit; | |||
| import vn.azteam.tpf.domain.PersistentAuditEvent; | |||
| import org.springframework.boot.actuate.audit.AuditEvent; | |||
| import org.springframework.security.web.authentication.WebAuthenticationDetails; | |||
| import org.springframework.stereotype.Component; | |||
| import java.util.*; | |||
| @Component | |||
| public class AuditEventConverter { | |||
| /** | |||
| * Convert a list of PersistentAuditEvent to a list of AuditEvent | |||
| * | |||
| * @param persistentAuditEvents the list to convert | |||
| * @return the converted list. | |||
| */ | |||
| public List<AuditEvent> convertToAuditEvent(Iterable<PersistentAuditEvent> persistentAuditEvents) { | |||
| if (persistentAuditEvents == null) { | |||
| return Collections.emptyList(); | |||
| } | |||
| List<AuditEvent> auditEvents = new ArrayList<>(); | |||
| for (PersistentAuditEvent persistentAuditEvent : persistentAuditEvents) { | |||
| auditEvents.add(convertToAuditEvent(persistentAuditEvent)); | |||
| } | |||
| return auditEvents; | |||
| } | |||
| /** | |||
| * Convert a PersistentAuditEvent to an AuditEvent | |||
| * | |||
| * @param persistentAuditEvent the event to convert | |||
| * @return the converted list. | |||
| */ | |||
| public AuditEvent convertToAuditEvent(PersistentAuditEvent persistentAuditEvent) { | |||
| if (persistentAuditEvent == null) { | |||
| return null; | |||
| } | |||
| return new AuditEvent(persistentAuditEvent.getAuditEventDate(), persistentAuditEvent.getPrincipal(), | |||
| persistentAuditEvent.getAuditEventType(), convertDataToObjects(persistentAuditEvent.getData())); | |||
| } | |||
| /** | |||
| * Internal conversion. This is needed to support the current SpringBoot actuator AuditEventRepository interface | |||
| * | |||
| * @param data the data to convert | |||
| * @return a map of String, Object | |||
| */ | |||
| public Map<String, Object> convertDataToObjects(Map<String, String> data) { | |||
| Map<String, Object> results = new HashMap<>(); | |||
| if (data != null) { | |||
| for (Map.Entry<String, String> entry : data.entrySet()) { | |||
| results.put(entry.getKey(), entry.getValue()); | |||
| } | |||
| } | |||
| return results; | |||
| } | |||
| /** | |||
| * Internal conversion. This method will allow to save additional data. | |||
| * By default, it will save the object as string | |||
| * | |||
| * @param data the data to convert | |||
| * @return a map of String, String | |||
| */ | |||
| public Map<String, String> convertDataToStrings(Map<String, Object> data) { | |||
| Map<String, String> results = new HashMap<>(); | |||
| if (data != null) { | |||
| for (Map.Entry<String, Object> entry : data.entrySet()) { | |||
| // Extract the data that will be saved. | |||
| if (entry.getValue() instanceof WebAuthenticationDetails) { | |||
| WebAuthenticationDetails authenticationDetails = (WebAuthenticationDetails) entry.getValue(); | |||
| results.put("remoteAddress", authenticationDetails.getRemoteAddress()); | |||
| results.put("sessionId", authenticationDetails.getSessionId()); | |||
| } else { | |||
| results.put(entry.getKey(), Objects.toString(entry.getValue())); | |||
| } | |||
| } | |||
| } | |||
| return results; | |||
| } | |||
| } | |||
| @@ -0,0 +1,4 @@ | |||
| /** | |||
| * Audit specific code. | |||
| */ | |||
| package vn.azteam.tpf.config.audit; | |||
| @@ -0,0 +1,4 @@ | |||
| /** | |||
| * Spring Framework configuration files. | |||
| */ | |||
| package vn.azteam.tpf.config; | |||
| @@ -0,0 +1,79 @@ | |||
| package vn.azteam.tpf.domain; | |||
| import com.fasterxml.jackson.annotation.JsonIgnore; | |||
| import org.hibernate.envers.Audited; | |||
| import org.springframework.data.annotation.CreatedBy; | |||
| import org.springframework.data.annotation.CreatedDate; | |||
| import org.springframework.data.annotation.LastModifiedBy; | |||
| import org.springframework.data.annotation.LastModifiedDate; | |||
| import org.springframework.data.jpa.domain.support.AuditingEntityListener; | |||
| import java.io.Serializable; | |||
| import java.time.Instant; | |||
| import javax.persistence.Column; | |||
| import javax.persistence.EntityListeners; | |||
| import javax.persistence.MappedSuperclass; | |||
| /** | |||
| * Base abstract class for entities which will hold definitions for created, last modified by and created, | |||
| * last modified by date. | |||
| */ | |||
| @MappedSuperclass | |||
| @Audited | |||
| @EntityListeners(AuditingEntityListener.class) | |||
| public abstract class AbstractAuditingEntity implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| @CreatedBy | |||
| @Column(name = "created_by", nullable = false, length = 50, updatable = false) | |||
| @JsonIgnore | |||
| private String createdBy; | |||
| @CreatedDate | |||
| @Column(name = "created_date", updatable = false) | |||
| @JsonIgnore | |||
| private Instant createdDate = Instant.now(); | |||
| @LastModifiedBy | |||
| @Column(name = "last_modified_by", length = 50) | |||
| @JsonIgnore | |||
| private String lastModifiedBy; | |||
| @LastModifiedDate | |||
| @Column(name = "last_modified_date") | |||
| @JsonIgnore | |||
| private Instant lastModifiedDate = Instant.now(); | |||
| public String getCreatedBy() { | |||
| return createdBy; | |||
| } | |||
| public void setCreatedBy(String createdBy) { | |||
| this.createdBy = createdBy; | |||
| } | |||
| public Instant getCreatedDate() { | |||
| return createdDate; | |||
| } | |||
| public void setCreatedDate(Instant createdDate) { | |||
| this.createdDate = createdDate; | |||
| } | |||
| public String getLastModifiedBy() { | |||
| return lastModifiedBy; | |||
| } | |||
| public void setLastModifiedBy(String lastModifiedBy) { | |||
| this.lastModifiedBy = lastModifiedBy; | |||
| } | |||
| public Instant getLastModifiedDate() { | |||
| return lastModifiedDate; | |||
| } | |||
| public void setLastModifiedDate(Instant lastModifiedDate) { | |||
| this.lastModifiedDate = lastModifiedDate; | |||
| } | |||
| } | |||
| @@ -0,0 +1,62 @@ | |||
| package vn.azteam.tpf.domain; | |||
| import org.hibernate.annotations.Cache; | |||
| import org.hibernate.annotations.CacheConcurrencyStrategy; | |||
| import javax.persistence.Entity; | |||
| import javax.persistence.Id; | |||
| import javax.persistence.Table; | |||
| import javax.persistence.Column; | |||
| import javax.validation.constraints.NotNull; | |||
| import javax.validation.constraints.Size; | |||
| import java.io.Serializable; | |||
| /** | |||
| * An authority (a security role) used by Spring Security. | |||
| */ | |||
| @Entity | |||
| @Table(name = "jhi_authority") | |||
| @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) | |||
| public class Authority implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| @NotNull | |||
| @Size(max = 50) | |||
| @Id | |||
| @Column(length = 50) | |||
| private String name; | |||
| public String getName() { | |||
| return name; | |||
| } | |||
| public void setName(String name) { | |||
| this.name = name; | |||
| } | |||
| @Override | |||
| public boolean equals(Object o) { | |||
| if (this == o) { | |||
| return true; | |||
| } | |||
| if (o == null || getClass() != o.getClass()) { | |||
| return false; | |||
| } | |||
| Authority authority = (Authority) o; | |||
| return !(name != null ? !name.equals(authority.name) : authority.name != null); | |||
| } | |||
| @Override | |||
| public int hashCode() { | |||
| return name != null ? name.hashCode() : 0; | |||
| } | |||
| @Override | |||
| public String toString() { | |||
| return "Authority{" + | |||
| "name='" + name + '\'' + | |||
| "}"; | |||
| } | |||
| } | |||
| @@ -0,0 +1,326 @@ | |||
| package vn.azteam.tpf.domain; | |||
| import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | |||
| import org.hibernate.annotations.Cache; | |||
| import org.hibernate.annotations.CacheConcurrencyStrategy; | |||
| import org.springframework.data.elasticsearch.annotations.Document; | |||
| import javax.persistence.*; | |||
| import java.io.Serializable; | |||
| import java.util.Objects; | |||
| /** | |||
| * A Casbin. | |||
| */ | |||
| @Entity | |||
| @Table(name = "casbin_rule") | |||
| @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) | |||
| @Document(indexName = "smf_casbinrule") | |||
| public class Casbin implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| @Id | |||
| @GeneratedValue(strategy = GenerationType.IDENTITY) | |||
| private Long id; | |||
| @Column(name = "ptype") | |||
| private String pType; | |||
| @Column(name = "v0") | |||
| private String v0; | |||
| @Column(name = "v1") | |||
| private String v1; | |||
| @Column(name = "v2") | |||
| private String v2; | |||
| @Column(name = "v3") | |||
| private String v3; | |||
| @Column(name = "v4") | |||
| private String v4; | |||
| @Column(name = "v5") | |||
| private String v5; | |||
| @Column(name = "created_date") | |||
| private Long createdDate; | |||
| @Column(name = "modified_date") | |||
| private Long modifiedDate; | |||
| @Column(name = "deleted_date") | |||
| private Long deletedDate; | |||
| @ManyToOne | |||
| @JsonIgnoreProperties("") | |||
| private TBRole tbRole; | |||
| @ManyToOne | |||
| @JsonIgnoreProperties("") | |||
| private TBFunction tbFunction; | |||
| @ManyToOne | |||
| @JsonIgnoreProperties("") | |||
| @JoinColumn(name = "created_by") | |||
| private TBDetailUser createdBy; | |||
| @ManyToOne | |||
| @JsonIgnoreProperties("") | |||
| @JoinColumn(name = "modified_by") | |||
| private TBDetailUser modifiedBy; | |||
| @ManyToOne | |||
| @JsonIgnoreProperties("") | |||
| @JoinColumn(name = "deleted_by") | |||
| private TBDetailUser deletedBy; | |||
| // jhipster-needle-entity-add-field - JHipster will add fields here, do not remove | |||
| public Long getId() { | |||
| return id; | |||
| } | |||
| public void setId(Long id) { | |||
| this.id = id; | |||
| } | |||
| // public Integer getHasPermission() { | |||
| // return hasPermission; | |||
| // } | |||
| // public Casbin hasPermission(Integer hasPermission) { | |||
| // this.hasPermission = hasPermission; | |||
| // return this; | |||
| // } | |||
| // | |||
| // public void setHasPermission(Integer hasPermission) { | |||
| // this.hasPermission = hasPermission; | |||
| // } | |||
| public Long getCreatedDate() { | |||
| return createdDate; | |||
| } | |||
| public Casbin createdDate(Long createdDate) { | |||
| this.createdDate = createdDate; | |||
| return this; | |||
| } | |||
| public void setCreatedDate(Long createdDate) { | |||
| this.createdDate = createdDate; | |||
| } | |||
| public Long getModifiedDate() { | |||
| return modifiedDate; | |||
| } | |||
| public Casbin modifiedDate(Long modifiedDate) { | |||
| this.modifiedDate = modifiedDate; | |||
| return this; | |||
| } | |||
| public void setModifiedDate(Long modifiedDate) { | |||
| this.modifiedDate = modifiedDate; | |||
| } | |||
| public Long getDeletedDate() { | |||
| return deletedDate; | |||
| } | |||
| public Casbin deletedDate(Long deletedDate) { | |||
| this.deletedDate = deletedDate; | |||
| return this; | |||
| } | |||
| public void setDeletedDate(Long deletedDate) { | |||
| this.deletedDate = deletedDate; | |||
| } | |||
| public TBRole getTbRole() { | |||
| return tbRole; | |||
| } | |||
| public Casbin tbRole(TBRole tbRole) { | |||
| this.tbRole = tbRole; | |||
| return this; | |||
| } | |||
| public void setTbRole(TBRole tbRole) { | |||
| this.tbRole = tbRole; | |||
| } | |||
| public TBFunction getTbFunction() { | |||
| return tbFunction; | |||
| } | |||
| public Casbin tbFunction(TBFunction tbFunction) { | |||
| this.tbFunction = tbFunction; | |||
| return this; | |||
| } | |||
| public void setTbFunction(TBFunction tbFunction) { | |||
| this.tbFunction = tbFunction; | |||
| } | |||
| public TBDetailUser getCreatedBy() { | |||
| return createdBy; | |||
| } | |||
| public Casbin createdBy(TBDetailUser detailUser) { | |||
| this.createdBy = detailUser; | |||
| return this; | |||
| } | |||
| public void setCreatedBy(TBDetailUser detailUser) { | |||
| this.createdBy = detailUser; | |||
| } | |||
| public TBDetailUser getModifiedBy() { | |||
| return modifiedBy; | |||
| } | |||
| public Casbin modifiedBy(TBDetailUser detailUser) { | |||
| this.modifiedBy = detailUser; | |||
| return this; | |||
| } | |||
| public void setModifiedBy(TBDetailUser detailUser) { | |||
| this.modifiedBy = detailUser; | |||
| } | |||
| public TBDetailUser getDeletedBy() { | |||
| return deletedBy; | |||
| } | |||
| public Casbin deletedBy(TBDetailUser detailUser) { | |||
| this.deletedBy = detailUser; | |||
| return this; | |||
| } | |||
| public void setDeletedBy(TBDetailUser detailUser) { | |||
| this.deletedBy = detailUser; | |||
| } | |||
| public String getpType() { | |||
| return pType; | |||
| } | |||
| public void setpType(String pType) { | |||
| this.pType = pType; | |||
| } | |||
| public Casbin pType(String pType) { | |||
| this.pType = pType; | |||
| return this; | |||
| } | |||
| public String getV0() { | |||
| return v0; | |||
| } | |||
| public void setV0(String v0) { | |||
| this.v0 = v0; | |||
| } | |||
| public Casbin v0(String v0) { | |||
| this.v0 = v0; | |||
| return this; | |||
| } | |||
| public String getV1() { | |||
| return v1; | |||
| } | |||
| public void setV1(String v1) { | |||
| this.v1 = v1; | |||
| } | |||
| public Casbin v1(String v1) { | |||
| this.v1 = v1; | |||
| return this; | |||
| } | |||
| public String getV2() { | |||
| return v2; | |||
| } | |||
| public void setV2(String v2) { | |||
| this.v2 = v2; | |||
| } | |||
| public Casbin v2(String v2) { | |||
| this.v2 = v2; | |||
| return this; | |||
| } | |||
| public String getV3() { | |||
| return v3; | |||
| } | |||
| public void setV3(String v3) { | |||
| this.v3 = v3; | |||
| } | |||
| public Casbin v3(String v3) { | |||
| this.v3 = v3; | |||
| return this; | |||
| } | |||
| public String getV4() { | |||
| return v4; | |||
| } | |||
| public void setV4(String v4) { | |||
| this.v4 = v4; | |||
| } | |||
| public Casbin v4(String v4) { | |||
| this.v4 = v4; | |||
| return this; | |||
| } | |||
| public String getV5() { | |||
| return v5; | |||
| } | |||
| public void setV5(String v5) { | |||
| this.v5 = v5; | |||
| } | |||
| public Casbin v5(String v5) { | |||
| this.v5 = v5; | |||
| return this; | |||
| } | |||
| // jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove | |||
| @Override | |||
| public boolean equals(Object o) { | |||
| if (this == o) { | |||
| return true; | |||
| } | |||
| if (o == null || getClass() != o.getClass()) { | |||
| return false; | |||
| } | |||
| Casbin casbin = (Casbin) o; | |||
| if (casbin.getId() == null || getId() == null) { | |||
| return false; | |||
| } | |||
| return Objects.equals(getId(), casbin.getId()); | |||
| } | |||
| @Override | |||
| public int hashCode() { | |||
| return Objects.hashCode(getId()); | |||
| } | |||
| @Override | |||
| public String toString() { | |||
| return "Casbin{" + | |||
| "id=" + getId() + | |||
| "id=" + getpType() + | |||
| "id=" + getV0() + | |||
| "id=" + getV1() + | |||
| "id=" + getV2() + | |||
| "id=" + getV3() + | |||
| "id=" + getV4() + | |||
| "id=" + getV5() + | |||
| // ", hasPermission=" + getHasPermission() + | |||
| ", createdDate=" + getCreatedDate() + | |||
| ", modifiedDate=" + getModifiedDate() + | |||
| ", deletedDate=" + getDeletedDate() + | |||
| "}"; | |||
| } | |||
| } | |||
| @@ -0,0 +1,109 @@ | |||
| package vn.azteam.tpf.domain; | |||
| import javax.persistence.*; | |||
| import javax.validation.constraints.NotNull; | |||
| import java.io.Serializable; | |||
| import java.time.Instant; | |||
| import java.util.HashMap; | |||
| import java.util.Objects; | |||
| import java.util.Map; | |||
| /** | |||
| * Persist AuditEvent managed by the Spring Boot actuator. | |||
| * | |||
| * @see org.springframework.boot.actuate.audit.AuditEvent | |||
| */ | |||
| @Entity | |||
| @Table(name = "jhi_persistent_audit_event") | |||
| public class PersistentAuditEvent implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| @Id | |||
| @GeneratedValue(strategy = GenerationType.IDENTITY) | |||
| @Column(name = "event_id") | |||
| private Long id; | |||
| @NotNull | |||
| @Column(nullable = false) | |||
| private String principal; | |||
| @Column(name = "event_date") | |||
| private Instant auditEventDate; | |||
| @Column(name = "event_type") | |||
| private String auditEventType; | |||
| @ElementCollection | |||
| @MapKeyColumn(name = "name") | |||
| @Column(name = "value") | |||
| @CollectionTable(name = "jhi_persistent_audit_evt_data", joinColumns=@JoinColumn(name="event_id")) | |||
| private Map<String, String> data = new HashMap<>(); | |||
| public Long getId() { | |||
| return id; | |||
| } | |||
| public void setId(Long id) { | |||
| this.id = id; | |||
| } | |||
| public String getPrincipal() { | |||
| return principal; | |||
| } | |||
| public void setPrincipal(String principal) { | |||
| this.principal = principal; | |||
| } | |||
| public Instant getAuditEventDate() { | |||
| return auditEventDate; | |||
| } | |||
| public void setAuditEventDate(Instant auditEventDate) { | |||
| this.auditEventDate = auditEventDate; | |||
| } | |||
| public String getAuditEventType() { | |||
| return auditEventType; | |||
| } | |||
| public void setAuditEventType(String auditEventType) { | |||
| this.auditEventType = auditEventType; | |||
| } | |||
| public Map<String, String> getData() { | |||
| return data; | |||
| } | |||
| public void setData(Map<String, String> data) { | |||
| this.data = data; | |||
| } | |||
| @Override | |||
| public boolean equals(Object o) { | |||
| if (this == o) { | |||
| return true; | |||
| } | |||
| if (o == null || getClass() != o.getClass()) { | |||
| return false; | |||
| } | |||
| PersistentAuditEvent persistentAuditEvent = (PersistentAuditEvent) o; | |||
| return !(persistentAuditEvent.getId() == null || getId() == null) && Objects.equals(getId(), persistentAuditEvent.getId()); | |||
| } | |||
| @Override | |||
| public int hashCode() { | |||
| return Objects.hashCode(getId()); | |||
| } | |||
| @Override | |||
| public String toString() { | |||
| return "PersistentAuditEvent{" + | |||
| "principal='" + principal + '\'' + | |||
| ", auditEventDate=" + auditEventDate + | |||
| ", auditEventType='" + auditEventType + '\'' + | |||
| '}'; | |||
| } | |||
| } | |||
| @@ -0,0 +1,308 @@ | |||
| package vn.azteam.tpf.domain; | |||
| import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | |||
| import org.hibernate.annotations.Cache; | |||
| import org.hibernate.annotations.CacheConcurrencyStrategy; | |||
| import javax.persistence.*; | |||
| import org.springframework.data.elasticsearch.annotations.Document; | |||
| import java.io.Serializable; | |||
| import java.time.Instant; | |||
| import java.util.Objects; | |||
| /** | |||
| * A TBActivity. | |||
| */ | |||
| @Entity | |||
| @Table(name = "tb_activity") | |||
| @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) | |||
| @Document(indexName = "smf_tbactivity") | |||
| public class TBActivity implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| @Id | |||
| @GeneratedValue(strategy = GenerationType.IDENTITY) | |||
| private Long id; | |||
| @Column(name = "age_day") | |||
| private Integer ageDay; | |||
| @Column(name = "total_cost") | |||
| private Double totalCost; | |||
| @Column(name = "media") | |||
| private String media; | |||
| @Column(name = "external_table") | |||
| private String externalTable; | |||
| @Column(name = "execute_date") | |||
| private Instant executeDate; | |||
| @Column(name = "description") | |||
| private String description; | |||
| @Column(name = "created_date") | |||
| private Instant createdDate; | |||
| @Column(name = "modified_date") | |||
| private Instant modifiedDate; | |||
| @Column(name = "deleted_date") | |||
| private Instant deletedDate; | |||
| @ManyToOne(fetch=FetchType.LAZY) | |||
| @JsonIgnoreProperties("") | |||
| @JoinColumn(name = "created_by") | |||
| private TBDetailUser createdBy; | |||
| @ManyToOne(fetch=FetchType.LAZY) | |||
| @JsonIgnoreProperties("") | |||
| @JoinColumn(name = "modified_by") | |||
| private TBDetailUser modifiedBy; | |||
| @ManyToOne(fetch=FetchType.LAZY) | |||
| @JsonIgnoreProperties("") | |||
| @JoinColumn(name = "deleted_by") | |||
| private TBDetailUser deletedBy; | |||
| @ManyToOne(fetch=FetchType.LAZY) | |||
| @JsonIgnoreProperties("") | |||
| @JoinColumn(name = "activity_type") | |||
| private TBActivityType activityType; | |||
| @ManyToOne(fetch=FetchType.LAZY) | |||
| @JsonIgnoreProperties("") | |||
| @JoinColumn(name = "tb_crop_id") | |||
| private TBCrop crop; | |||
| // jhipster-needle-entity-add-field - JHipster will add fields here, do not remove | |||
| public Long getId() { | |||
| return id; | |||
| } | |||
| public void setId(Long id) { | |||
| this.id = id; | |||
| } | |||
| public Integer getAgeDay() { | |||
| return ageDay; | |||
| } | |||
| public TBActivity ageDay(Integer ageDay) { | |||
| this.ageDay = ageDay; | |||
| return this; | |||
| } | |||
| public void setAgeDay(Integer ageDay) { | |||
| this.ageDay = ageDay; | |||
| } | |||
| public Double getTotalCost() { | |||
| return totalCost; | |||
| } | |||
| public TBActivity totalCost(Double totalCost) { | |||
| this.totalCost = totalCost; | |||
| return this; | |||
| } | |||
| public void setTotalCost(Double totalCost) { | |||
| this.totalCost = totalCost; | |||
| } | |||
| public String getMedia() { | |||
| return media; | |||
| } | |||
| public TBActivity media(String media) { | |||
| this.media = media; | |||
| return this; | |||
| } | |||
| public void setMedia(String media) { | |||
| this.media = media; | |||
| } | |||
| public String getExternalTable() { | |||
| return externalTable; | |||
| } | |||
| public TBActivity externalTable(String externalTable) { | |||
| this.externalTable = externalTable; | |||
| return this; | |||
| } | |||
| public void setExternalTable(String externalTable) { | |||
| this.externalTable = externalTable; | |||
| } | |||
| public Instant getExecuteDate() { | |||
| return executeDate; | |||
| } | |||
| public TBActivity executeDate(Instant executeDate) { | |||
| this.executeDate = executeDate; | |||
| return this; | |||
| } | |||
| public void setExecuteDate(Instant executeDate) { | |||
| this.executeDate = executeDate; | |||
| } | |||
| public String getDescription() { | |||
| return description; | |||
| } | |||
| public TBActivity description(String description) { | |||
| this.description = description; | |||
| return this; | |||
| } | |||
| public void setDescription(String description) { | |||
| this.description = description; | |||
| } | |||
| public Instant getCreatedDate() { | |||
| return createdDate; | |||
| } | |||
| public TBActivity createdDate(Instant createdDate) { | |||
| this.createdDate = createdDate; | |||
| return this; | |||
| } | |||
| public void setCreatedDate(Instant createdDate) { | |||
| this.createdDate = createdDate; | |||
| } | |||
| public Instant getModifiedDate() { | |||
| return modifiedDate; | |||
| } | |||
| public TBActivity modifiedDate(Instant modifiedDate) { | |||
| this.modifiedDate = modifiedDate; | |||
| return this; | |||
| } | |||
| public void setModifiedDate(Instant modifiedDate) { | |||
| this.modifiedDate = modifiedDate; | |||
| } | |||
| public Instant getDeletedDate() { | |||
| return deletedDate; | |||
| } | |||
| public TBActivity deletedDate(Instant deletedDate) { | |||
| this.deletedDate = deletedDate; | |||
| return this; | |||
| } | |||
| public void setDeletedDate(Instant deletedDate) { | |||
| this.deletedDate = deletedDate; | |||
| } | |||
| public TBDetailUser getDeletedBy() { | |||
| return deletedBy; | |||
| } | |||
| public TBActivity deletedBy(TBDetailUser tBDetailUser) { | |||
| this.deletedBy = tBDetailUser; | |||
| return this; | |||
| } | |||
| public void setDeletedBy(TBDetailUser tBDetailUser) { | |||
| this.deletedBy = tBDetailUser; | |||
| } | |||
| public TBDetailUser getCreatedBy() { | |||
| return createdBy; | |||
| } | |||
| public TBActivity createdBy(TBDetailUser tBDetailUser) { | |||
| this.createdBy = tBDetailUser; | |||
| return this; | |||
| } | |||
| public void setCreatedBy(TBDetailUser tBDetailUser) { | |||
| this.createdBy = tBDetailUser; | |||
| } | |||
| public TBDetailUser getModifiedBy() { | |||
| return modifiedBy; | |||
| } | |||
| public TBActivity modifiedBy(TBDetailUser tBDetailUser) { | |||
| this.modifiedBy = tBDetailUser; | |||
| return this; | |||
| } | |||
| public void setModifiedBy(TBDetailUser tBDetailUser) { | |||
| this.modifiedBy = tBDetailUser; | |||
| } | |||
| public TBActivityType getActivityType() { | |||
| return activityType; | |||
| } | |||
| public TBActivity activityType(TBActivityType tBActivityType) { | |||
| this.activityType = tBActivityType; | |||
| return this; | |||
| } | |||
| public void setActivityType(TBActivityType tBActivityType) { | |||
| this.activityType = tBActivityType; | |||
| } | |||
| public TBCrop getCrop() { | |||
| return crop; | |||
| } | |||
| public TBActivity crop(TBCrop crop) { | |||
| this.crop = crop; | |||
| return this; | |||
| } | |||
| public void setCrop(TBCrop crop) { | |||
| this.crop = crop; | |||
| } | |||
| // jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove | |||
| @Override | |||
| public boolean equals(Object o) { | |||
| if (this == o) { | |||
| return true; | |||
| } | |||
| if (o == null || getClass() != o.getClass()) { | |||
| return false; | |||
| } | |||
| TBActivity tBActivity = (TBActivity) o; | |||
| if (tBActivity.getId() == null || getId() == null) { | |||
| return false; | |||
| } | |||
| return Objects.equals(getId(), tBActivity.getId()); | |||
| } | |||
| @Override | |||
| public int hashCode() { | |||
| return Objects.hashCode(getId()); | |||
| } | |||
| @Override | |||
| public String toString() { | |||
| return "TBActivity{" + | |||
| "id=" + getId() + | |||
| ", ageDay=" + getAgeDay() + | |||
| ", totalCost=" + getTotalCost() + | |||
| ", media='" + getMedia() + "'" + | |||
| ", executeDate='" + getExecuteDate() + "'" + | |||
| ", description='" + getDescription() + "'" + | |||
| ", createdDate='" + getCreatedDate() + "'" + | |||
| ", modifiedDate='" + getModifiedDate() + "'" + | |||
| ", deletedDate='" + getDeletedDate() + "'" + | |||
| "}"; | |||
| } | |||
| } | |||
| @@ -0,0 +1,271 @@ | |||
| package vn.azteam.tpf.domain; | |||
| import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | |||
| import org.hibernate.annotations.Cache; | |||
| import org.hibernate.annotations.CacheConcurrencyStrategy; | |||
| import javax.persistence.*; | |||
| import org.springframework.data.elasticsearch.annotations.Document; | |||
| import java.io.Serializable; | |||
| import java.time.Instant; | |||
| import java.util.Objects; | |||
| /** | |||
| * A TBActivityExtendType. | |||
| */ | |||
| @Entity | |||
| @Table(name = "tb_activity_extend_type") | |||
| @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) | |||
| @Document(indexName = "smf_tbactivityextendtype") | |||
| public class TBActivityExtendType implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| @Id | |||
| @GeneratedValue(strategy = GenerationType.IDENTITY) | |||
| private Long id; | |||
| @Column(name = "name") | |||
| private String name; | |||
| @Column(name = "external_table") | |||
| private String externalTable; | |||
| @Column(name = "object_type") | |||
| private Integer objectType; | |||
| @Column(name = "jhi_condition") | |||
| private String condition; | |||
| @Column(name = "is_guideline_using") | |||
| private Boolean isGuidelineUsing; | |||
| @Column(name = "created_date") | |||
| private Instant createdDate; | |||
| @Column(name = "modified_date") | |||
| private Instant modifiedDate; | |||
| @Column(name = "deleted_date") | |||
| private Instant deletedDate; | |||
| @ManyToOne(fetch=FetchType.LAZY) | |||
| @JsonIgnoreProperties("") | |||
| @JoinColumn(name = "created_by") | |||
| private TBDetailUser createdBy; | |||
| @ManyToOne(fetch=FetchType.LAZY) | |||
| @JsonIgnoreProperties("") | |||
| @JoinColumn(name = "modified_by") | |||
| private TBDetailUser modifiedBy; | |||
| @ManyToOne(fetch=FetchType.LAZY) | |||
| @JsonIgnoreProperties("") | |||
| @JoinColumn(name = "deleted_by") | |||
| private TBDetailUser deletedBy; | |||
| @ManyToOne | |||
| @JsonIgnoreProperties("") | |||
| @JoinColumn(name = "tb_activity_type_id") | |||
| private TBActivityType tbActivityType; | |||
| // jhipster-needle-entity-add-field - JHipster will add fields here, do not remove | |||
| public Long getId() { | |||
| return id; | |||
| } | |||
| public void setId(Long id) { | |||
| this.id = id; | |||
| } | |||
| public String getName() { | |||
| return name; | |||
| } | |||
| public TBActivityExtendType name(String name) { | |||
| this.name = name; | |||
| return this; | |||
| } | |||
| public void setName(String name) { | |||
| this.name = name; | |||
| } | |||
| public String getExternalTable() { | |||
| return externalTable; | |||
| } | |||
| public TBActivityExtendType externalTable(String externalTable) { | |||
| this.externalTable = externalTable; | |||
| return this; | |||
| } | |||
| public void setExternalTable(String externalTable) { | |||
| this.externalTable = externalTable; | |||
| } | |||
| public Integer getObjectType() { | |||
| return objectType; | |||
| } | |||
| public TBActivityExtendType objectType(Integer objectType) { | |||
| this.objectType = objectType; | |||
| return this; | |||
| } | |||
| public void setObjectType(Integer objectType) { | |||
| this.objectType = objectType; | |||
| } | |||
| public String getCondition() { | |||
| return condition; | |||
| } | |||
| public TBActivityExtendType condition(String condition) { | |||
| this.condition = condition; | |||
| return this; | |||
| } | |||
| public void setCondition(String condition) { | |||
| this.condition = condition; | |||
| } | |||
| public TBActivityType getTbActivityType() { | |||
| return tbActivityType; | |||
| } | |||
| public TBActivityExtendType tbActivityType(TBActivityType tBActivityType) { | |||
| this.tbActivityType = tBActivityType; | |||
| return this; | |||
| } | |||
| public void setTbActivityType(TBActivityType tBActivityType) { | |||
| this.tbActivityType = tBActivityType; | |||
| } | |||
| public Boolean getIsGuidelineUsing() { | |||
| return isGuidelineUsing; | |||
| } | |||
| public TBActivityExtendType isGuidelineUsing(Boolean isGuidelineUsing) { | |||
| this.isGuidelineUsing = isGuidelineUsing; | |||
| return this; | |||
| } | |||
| public void setIsGuidelineUsing(Boolean isGuidelineUsing) { | |||
| this.isGuidelineUsing = isGuidelineUsing; | |||
| } | |||
| public Instant getCreatedDate() { | |||
| return createdDate; | |||
| } | |||
| public TBActivityExtendType createdDate(Instant createdDate) { | |||
| this.createdDate = createdDate; | |||
| return this; | |||
| } | |||
| public void setCreatedDate(Instant createdDate) { | |||
| this.createdDate = createdDate; | |||
| } | |||
| public Instant getModifiedDate() { | |||
| return modifiedDate; | |||
| } | |||
| public TBActivityExtendType modifiedDate(Instant modifiedDate) { | |||
| this.modifiedDate = modifiedDate; | |||
| return this; | |||
| } | |||
| public void setModifiedDate(Instant modifiedDate) { | |||
| this.modifiedDate = modifiedDate; | |||
| } | |||
| public Instant getDeletedDate() { | |||
| return deletedDate; | |||
| } | |||
| public TBActivityExtendType deletedDate(Instant deletedDate) { | |||
| this.deletedDate = deletedDate; | |||
| return this; | |||
| } | |||
| public void setDeletedDate(Instant deletedDate) { | |||
| this.deletedDate = deletedDate; | |||
| } | |||
| public TBDetailUser getDeletedBy() { | |||
| return deletedBy; | |||
| } | |||
| public TBActivityExtendType deletedBy(TBDetailUser tBDetailUser) { | |||
| this.deletedBy = tBDetailUser; | |||
| return this; | |||
| } | |||
| public void setDeletedBy(TBDetailUser tBDetailUser) { | |||
| this.deletedBy = tBDetailUser; | |||
| } | |||
| public TBDetailUser getCreatedBy() { | |||
| return createdBy; | |||
| } | |||
| public TBActivityExtendType createdBy(TBDetailUser tBDetailUser) { | |||
| this.createdBy = tBDetailUser; | |||
| return this; | |||
| } | |||
| public void setCreatedBy(TBDetailUser tBDetailUser) { | |||
| this.createdBy = tBDetailUser; | |||
| } | |||
| public TBDetailUser getModifiedBy() { | |||
| return modifiedBy; | |||
| } | |||
| public TBActivityExtendType modifiedBy(TBDetailUser tBDetailUser) { | |||
| this.modifiedBy = tBDetailUser; | |||
| return this; | |||
| } | |||
| public void setModifiedBy(TBDetailUser tBDetailUser) { | |||
| this.modifiedBy = tBDetailUser; | |||
| } | |||
| // jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove | |||
| @Override | |||
| public boolean equals(Object o) { | |||
| if (this == o) { | |||
| return true; | |||
| } | |||
| if (o == null || getClass() != o.getClass()) { | |||
| return false; | |||
| } | |||
| TBActivityExtendType tBActivityExtendType = (TBActivityExtendType) o; | |||
| if (tBActivityExtendType.getId() == null || getId() == null) { | |||
| return false; | |||
| } | |||
| return Objects.equals(getId(), tBActivityExtendType.getId()); | |||
| } | |||
| @Override | |||
| public int hashCode() { | |||
| return Objects.hashCode(getId()); | |||
| } | |||
| @Override | |||
| public String toString() { | |||
| return "TBActivityExtendType{" + | |||
| "id=" + getId() + | |||
| ", name='" + getName() + "'" + | |||
| ", externalTable='" + getExternalTable() + "'" + | |||
| ", objectType=" + getObjectType() + | |||
| ", condition='" + getCondition() + "'" + | |||
| ", isGuidelineUsing='" + getIsGuidelineUsing() + "'" + | |||
| "}"; | |||
| } | |||
| } | |||
| @@ -0,0 +1,281 @@ | |||
| package vn.azteam.tpf.domain; | |||
| import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | |||
| import org.hibernate.annotations.Cache; | |||
| import org.hibernate.annotations.CacheConcurrencyStrategy; | |||
| import javax.persistence.*; | |||
| import org.springframework.data.elasticsearch.annotations.Document; | |||
| import java.io.Serializable; | |||
| import java.time.Instant; | |||
| import java.util.Objects; | |||
| /** | |||
| * A TBActivityType. | |||
| */ | |||
| @Entity | |||
| @Table(name = "tb_activity_type") | |||
| @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) | |||
| @Document(indexName = "smf_tbactivitytype") | |||
| public class TBActivityType implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| @Id | |||
| @GeneratedValue(strategy = GenerationType.IDENTITY) | |||
| private Long id; | |||
| @Column(name = "name") | |||
| private String name; | |||
| @Column(name = "description") | |||
| private String description; | |||
| @Column(name = "is_can_delete") | |||
| private Boolean isCanDelete; | |||
| @Column(name = "url_logo") | |||
| private String urlLogo; | |||
| @Column(name = "created_date") | |||
| private Instant createdDate; | |||
| @Column(name = "modified_date") | |||
| private Instant modifiedDate; | |||
| @Column(name = "deleted_date") | |||
| private Instant deletedDate; | |||
| @Column(name = "is_guideline_using") | |||
| private Boolean isGuidelineUsing; | |||
| @ManyToOne(fetch=FetchType.LAZY) | |||
| @JsonIgnoreProperties("") | |||
| @JoinColumn(name = "created_by") | |||
| private TBDetailUser createdBy; | |||
| @ManyToOne(fetch=FetchType.LAZY) | |||
| @JsonIgnoreProperties("") | |||
| @JoinColumn(name = "modified_by") | |||
| private TBDetailUser modifiedBy; | |||
| @ManyToOne(fetch=FetchType.LAZY) | |||
| @JsonIgnoreProperties("") | |||
| @JoinColumn(name = "deleted_by") | |||
| private TBDetailUser deletedBy; | |||
| @ManyToOne | |||
| @JsonIgnoreProperties("") | |||
| private TBCustomer customer; | |||
| @Column(name = "parent_id") | |||
| private Long parentId; | |||
| // jhipster-needle-entity-add-field - JHipster will add fields here, do not remove | |||
| public Long getId() { | |||
| return id; | |||
| } | |||
| public void setId(Long id) { | |||
| this.id = id; | |||
| } | |||
| public String getName() { | |||
| return name; | |||
| } | |||
| public TBActivityType name(String name) { | |||
| this.name = name; | |||
| return this; | |||
| } | |||
| public void setName(String name) { | |||
| this.name = name; | |||
| } | |||
| public String getDescription() { | |||
| return description; | |||
| } | |||
| public TBActivityType description(String description) { | |||
| this.description = description; | |||
| return this; | |||
| } | |||
| public void setDescription(String description) { | |||
| this.description = description; | |||
| } | |||
| public Boolean getIsCanDelete() { | |||
| return isCanDelete; | |||
| } | |||
| public TBActivityType isCanDelete(Boolean isCanDelete) { | |||
| this.isCanDelete = isCanDelete; | |||
| return this; | |||
| } | |||
| public void setIsCanDelete(Boolean isCanDelete) { | |||
| this.isCanDelete = isCanDelete; | |||
| } | |||
| public String getUrlLogo() { | |||
| return urlLogo; | |||
| } | |||
| public TBActivityType urlLogo(String urlLogo) { | |||
| this.urlLogo = urlLogo; | |||
| return this; | |||
| } | |||
| public void setUrlLogo(String urlLogo) { | |||
| this.urlLogo = urlLogo; | |||
| } | |||
| public Instant getCreatedDate() { | |||
| return createdDate; | |||
| } | |||
| public TBActivityType createdDate(Instant createdDate) { | |||
| this.createdDate = createdDate; | |||
| return this; | |||
| } | |||
| public void setCreatedDate(Instant createdDate) { | |||
| this.createdDate = createdDate; | |||
| } | |||
| public Instant getModifiedDate() { | |||
| return modifiedDate; | |||
| } | |||
| public TBActivityType modifiedDate(Instant modifiedDate) { | |||
| this.modifiedDate = modifiedDate; | |||
| return this; | |||
| } | |||
| public void setModifiedDate(Instant modifiedDate) { | |||
| this.modifiedDate = modifiedDate; | |||
| } | |||
| public Instant getDeletedDate() { | |||
| return deletedDate; | |||
| } | |||
| public TBActivityType deletedDate(Instant deletedDate) { | |||
| this.deletedDate = deletedDate; | |||
| return this; | |||
| } | |||
| public void setDeletedDate(Instant deletedDate) { | |||
| this.deletedDate = deletedDate; | |||
| } | |||
| public TBDetailUser getDeletedBy() { | |||
| return deletedBy; | |||
| } | |||
| public TBActivityType deletedBy(TBDetailUser tBDetailUser) { | |||
| this.deletedBy = tBDetailUser; | |||
| return this; | |||
| } | |||
| public void setDeletedBy(TBDetailUser tBDetailUser) { | |||
| this.deletedBy = tBDetailUser; | |||
| } | |||
| public TBDetailUser getCreatedBy() { | |||
| return createdBy; | |||
| } | |||
| public TBActivityType createdBy(TBDetailUser tBDetailUser) { | |||
| this.createdBy = tBDetailUser; | |||
| return this; | |||
| } | |||
| public void setCreatedBy(TBDetailUser tBDetailUser) { | |||
| this.createdBy = tBDetailUser; | |||
| } | |||
| public TBDetailUser getModifiedBy() { | |||
| return modifiedBy; | |||
| } | |||
| public TBActivityType modifiedBy(TBDetailUser tBDetailUser) { | |||
| this.modifiedBy = tBDetailUser; | |||
| return this; | |||
| } | |||
| public void setModifiedBy(TBDetailUser tBDetailUser) { | |||
| this.modifiedBy = tBDetailUser; | |||
| } | |||
| public TBCustomer getCustomer() { | |||
| return customer; | |||
| } | |||
| public TBActivityType customer(TBCustomer tBCustomer) { | |||
| this.customer = tBCustomer; | |||
| return this; | |||
| } | |||
| public void setCustomer(TBCustomer tBCustomer) { | |||
| this.customer = tBCustomer; | |||
| } | |||
| public Boolean getIsGuidelineUsing() { | |||
| return isGuidelineUsing; | |||
| } | |||
| public TBActivityType isGuidelineUsing(Boolean isGuidelineUsing) { | |||
| this.isGuidelineUsing = isGuidelineUsing; | |||
| return this; | |||
| } | |||
| public void setIsGuidelineUsing(Boolean isGuidelineUsing) { | |||
| this.isGuidelineUsing = isGuidelineUsing; | |||
| } | |||
| // jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove | |||
| public Long getParentId() { | |||
| return parentId; | |||
| } | |||
| public void setParentId(Long parentId) { | |||
| this.parentId = parentId; | |||
| } | |||
| @Override | |||
| public boolean equals(Object o) { | |||
| if (this == o) { | |||
| return true; | |||
| } | |||
| if (o == null || getClass() != o.getClass()) { | |||
| return false; | |||
| } | |||
| TBActivityType tBActivityType = (TBActivityType) o; | |||
| if (tBActivityType.getId() == null || getId() == null) { | |||
| return false; | |||
| } | |||
| return Objects.equals(getId(), tBActivityType.getId()); | |||
| } | |||
| @Override | |||
| public int hashCode() { | |||
| return Objects.hashCode(getId()); | |||
| } | |||
| @Override | |||
| public String toString() { | |||
| return "TBActivityType{" + | |||
| "id=" + getId() + | |||
| ", name='" + getName() + "'" + | |||
| ", description='" + getDescription() + "'" + | |||
| ", createdDate='" + getCreatedDate() + "'" + | |||
| ", modifiedDate='" + getModifiedDate() + "'" + | |||
| ", deletedDate='" + getDeletedDate() + "'" + | |||
| "}"; | |||
| } | |||
| } | |||
| @@ -0,0 +1,149 @@ | |||
| package vn.azteam.tpf.domain; | |||
| import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | |||
| import org.hibernate.annotations.Cache; | |||
| import org.hibernate.annotations.CacheConcurrencyStrategy; | |||
| import javax.persistence.*; | |||
| import org.springframework.data.elasticsearch.annotations.Document; | |||
| import java.io.Serializable; | |||
| import java.util.Objects; | |||
| /** | |||
| * A TBAddress. | |||
| */ | |||
| @Entity | |||
| @Table(name = "tb_address") | |||
| @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) | |||
| @Document(indexName = "smf_tbaddress") | |||
| public class TBAddress implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| @Id | |||
| @GeneratedValue(strategy = GenerationType.IDENTITY) | |||
| private Long id; | |||
| @Column(name = "address") | |||
| private String address; | |||
| @ManyToOne | |||
| @JsonIgnoreProperties({"hibernateLazyInitializer", "handler"}) | |||
| private TBCountry tbCountry; | |||
| @ManyToOne | |||
| @JsonIgnoreProperties({"hibernateLazyInitializer", "handler"}) | |||
| private TBCity tbCity; | |||
| @ManyToOne | |||
| @JsonIgnoreProperties({"hibernateLazyInitializer", "handler"}) | |||
| private TBDistrict tbDistrict; | |||
| @ManyToOne | |||
| @JsonIgnoreProperties({"hibernateLazyInitializer", "handler"}) | |||
| private TBWard tbWard; | |||
| // jhipster-needle-entity-add-field - JHipster will add fields here, do not remove | |||
| public Long getId() { | |||
| return id; | |||
| } | |||
| public void setId(Long id) { | |||
| this.id = id; | |||
| } | |||
| public String getAddress() { | |||
| return address; | |||
| } | |||
| public TBAddress address(String address) { | |||
| this.address = address; | |||
| return this; | |||
| } | |||
| public void setAddress(String address) { | |||
| this.address = address; | |||
| } | |||
| public TBCountry getTbCountry() { | |||
| return tbCountry; | |||
| } | |||
| public TBAddress tbCountry(TBCountry tBCountry) { | |||
| this.tbCountry = tBCountry; | |||
| return this; | |||
| } | |||
| public void setTbCountry(TBCountry tBCountry) { | |||
| this.tbCountry = tBCountry; | |||
| } | |||
| public TBCity getTbCity() { | |||
| return tbCity; | |||
| } | |||
| public TBAddress tbCity(TBCity tBCity) { | |||
| this.tbCity = tBCity; | |||
| return this; | |||
| } | |||
| public void setTbCity(TBCity tBCity) { | |||
| this.tbCity = tBCity; | |||
| } | |||
| public TBDistrict getTbDistrict() { | |||
| return tbDistrict; | |||
| } | |||
| public TBAddress tbDistrict(TBDistrict tBDistrict) { | |||
| this.tbDistrict = tBDistrict; | |||
| return this; | |||
| } | |||
| public void setTbDistrict(TBDistrict tBDistrict) { | |||
| this.tbDistrict = tBDistrict; | |||
| } | |||
| public TBWard getTbWard() { | |||
| return tbWard; | |||
| } | |||
| public TBAddress tbWard(TBWard tBWard) { | |||
| this.tbWard = tBWard; | |||
| return this; | |||
| } | |||
| public void setTbWard(TBWard tBWard) { | |||
| this.tbWard = tBWard; | |||
| } | |||
| // jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove | |||
| @Override | |||
| public boolean equals(Object o) { | |||
| if (this == o) { | |||
| return true; | |||
| } | |||
| if (o == null || getClass() != o.getClass()) { | |||
| return false; | |||
| } | |||
| TBAddress tBAddress = (TBAddress) o; | |||
| if (tBAddress.getId() == null || getId() == null) { | |||
| return false; | |||
| } | |||
| return Objects.equals(getId(), tBAddress.getId()); | |||
| } | |||
| @Override | |||
| public int hashCode() { | |||
| return Objects.hashCode(getId()); | |||
| } | |||
| @Override | |||
| public String toString() { | |||
| return "TBAddress{" + | |||
| "id=" + getId() + | |||
| ", address='" + getAddress() + "'" + | |||
| "}"; | |||
| } | |||
| } | |||
| @@ -0,0 +1,151 @@ | |||
| package vn.azteam.tpf.domain; | |||
| import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | |||
| import org.hibernate.annotations.Cache; | |||
| import org.hibernate.annotations.CacheConcurrencyStrategy; | |||
| import javax.persistence.*; | |||
| import org.springframework.data.elasticsearch.annotations.Document; | |||
| import java.io.Serializable; | |||
| import java.time.Instant; | |||
| import java.util.Objects; | |||
| /** | |||
| * A TBBlockDetails. | |||
| */ | |||
| @Entity | |||
| @Table(name = "tb_block_details") | |||
| @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) | |||
| @Document(indexName = "smf_tbblockdetails") | |||
| public class TBBlockDetails implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| @Id | |||
| @GeneratedValue(strategy = GenerationType.IDENTITY) | |||
| private Long id; | |||
| @Column(name = "quantity") | |||
| private Double quantity; | |||
| @Column(name = "code") | |||
| private String code; | |||
| @Column(name = "mfg_date") | |||
| private Instant mfgDate; | |||
| @Column(name = "exp_date") | |||
| private Instant expDate; | |||
| @ManyToOne | |||
| @JsonIgnoreProperties("") | |||
| private TBSuppliesInWarehouse tbSuppliesInWarehouse; | |||
| // jhipster-needle-entity-add-field - JHipster will add fields here, do not remove | |||
| public Long getId() { | |||
| return id; | |||
| } | |||
| public void setId(Long id) { | |||
| this.id = id; | |||
| } | |||
| public Double getQuantity() { | |||
| return quantity; | |||
| } | |||
| public TBBlockDetails quantity(Double quantity) { | |||
| this.quantity = quantity; | |||
| return this; | |||
| } | |||
| public void setQuantity(Double quantity) { | |||
| this.quantity = quantity; | |||
| } | |||
| public String getCode() { | |||
| return code; | |||
| } | |||
| public TBBlockDetails code(String code) { | |||
| this.code = code; | |||
| return this; | |||
| } | |||
| public void setCode(String code) { | |||
| this.code = code; | |||
| } | |||
| public Instant getMfgDate() { | |||
| return mfgDate; | |||
| } | |||
| public TBBlockDetails mfgDate(Instant mfgDate) { | |||
| this.mfgDate = mfgDate; | |||
| return this; | |||
| } | |||
| public void setMfgDate(Instant mfgDate) { | |||
| this.mfgDate = mfgDate; | |||
| } | |||
| public Instant getExpDate() { | |||
| return expDate; | |||
| } | |||
| public TBBlockDetails expDate(Instant expDate) { | |||
| this.expDate = expDate; | |||
| return this; | |||
| } | |||
| public void setExpDate(Instant expDate) { | |||
| this.expDate = expDate; | |||
| } | |||
| public TBSuppliesInWarehouse getTbSuppliesInWarehouse() { | |||
| return tbSuppliesInWarehouse; | |||
| } | |||
| public TBBlockDetails tbSuppliesInWarehouse(TBSuppliesInWarehouse tbSuppliesInWarehouse) { | |||
| this.tbSuppliesInWarehouse = tbSuppliesInWarehouse; | |||
| return this; | |||
| } | |||
| public void setTbSuppliesInWarehouse(TBSuppliesInWarehouse tbSuppliesInWarehouse) { | |||
| this.tbSuppliesInWarehouse = tbSuppliesInWarehouse; | |||
| } | |||
| // jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove | |||
| @Override | |||
| public boolean equals(Object o) { | |||
| if (this == o) { | |||
| return true; | |||
| } | |||
| if (o == null || getClass() != o.getClass()) { | |||
| return false; | |||
| } | |||
| TBBlockDetails tBBlockDetails = (TBBlockDetails) o; | |||
| if (tBBlockDetails.getId() == null || getId() == null) { | |||
| return false; | |||
| } | |||
| return Objects.equals(getId(), tBBlockDetails.getId()); | |||
| } | |||
| @Override | |||
| public int hashCode() { | |||
| return Objects.hashCode(getId()); | |||
| } | |||
| @Override | |||
| public String toString() { | |||
| return "TBBlockDetails{" + | |||
| "id=" + getId() + | |||
| ", quantity=" + getQuantity() + | |||
| ", code='" + getCode() + "'" + | |||
| ", mfgDate='" + getMfgDate() + "'" + | |||
| ", expDate='" + getExpDate() + "'" + | |||
| "}"; | |||
| } | |||
| } | |||
| @@ -0,0 +1,167 @@ | |||
| package vn.azteam.tpf.domain; | |||
| import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | |||
| import org.hibernate.annotations.Cache; | |||
| import org.hibernate.annotations.CacheConcurrencyStrategy; | |||
| import javax.persistence.*; | |||
| import org.springframework.data.elasticsearch.annotations.Document; | |||
| import java.io.Serializable; | |||
| import java.time.Instant; | |||
| import java.util.Objects; | |||
| /** | |||
| * A TBBlockDetailsReport. | |||
| */ | |||
| @Entity | |||
| @Table(name = "tb_block_details_report") | |||
| @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) | |||
| @Document(indexName = "smf_tbblockdetailsreport") | |||
| public class TBBlockDetailsReport implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| @Id | |||
| @GeneratedValue(strategy = GenerationType.IDENTITY) | |||
| private Long id; | |||
| @Column(name = "code") | |||
| private String code; | |||
| @Column(name = "quantity") | |||
| private Double quantity; | |||
| @Column(name = "create_date") | |||
| private Instant createDate; | |||
| @ManyToOne | |||
| @JsonIgnoreProperties("") | |||
| private TBBlockDetails tbBlockDetails; | |||
| @ManyToOne | |||
| @JsonIgnoreProperties("") | |||
| private TBSuppliesType tbSuppliesType; | |||
| @ManyToOne | |||
| @JsonIgnoreProperties("") | |||
| private TBSuppliesInWarehouse tbSuppliesInWarehouse; | |||
| // jhipster-needle-entity-add-field - JHipster will add fields here, do not remove | |||
| public Long getId() { | |||
| return id; | |||
| } | |||
| public void setId(Long id) { | |||
| this.id = id; | |||
| } | |||
| public String getCode() { | |||
| return code; | |||
| } | |||
| public TBBlockDetailsReport code(String code) { | |||
| this.code = code; | |||
| return this; | |||
| } | |||
| public void setCode(String code) { | |||
| this.code = code; | |||
| } | |||
| public Double getQuantity() { | |||
| return quantity; | |||
| } | |||
| public TBBlockDetailsReport quantity(Double quantity) { | |||
| this.quantity = quantity; | |||
| return this; | |||
| } | |||
| public void setQuantity(Double quantity) { | |||
| this.quantity = quantity; | |||
| } | |||
| public Instant getCreateDate() { | |||
| return createDate; | |||
| } | |||
| public TBBlockDetailsReport createDate(Instant createDate) { | |||
| this.createDate = createDate; | |||
| return this; | |||
| } | |||
| public void setCreateDate(Instant createDate) { | |||
| this.createDate = createDate; | |||
| } | |||
| public TBBlockDetails getTbBlockDetails() { | |||
| return tbBlockDetails; | |||
| } | |||
| public TBBlockDetailsReport tbBlockDetails(TBBlockDetails tBBlockDetails) { | |||
| this.tbBlockDetails = tBBlockDetails; | |||
| return this; | |||
| } | |||
| public void setTbBlockDetails(TBBlockDetails tBBlockDetails) { | |||
| this.tbBlockDetails = tBBlockDetails; | |||
| } | |||
| public TBSuppliesType getTbSuppliesType() { | |||
| return tbSuppliesType; | |||
| } | |||
| public TBBlockDetailsReport tbSuppliesType(TBSuppliesType tBSuppliesType) { | |||
| this.tbSuppliesType = tBSuppliesType; | |||
| return this; | |||
| } | |||
| public void setTbSuppliesType(TBSuppliesType tBSuppliesType) { | |||
| this.tbSuppliesType = tBSuppliesType; | |||
| } | |||
| public TBSuppliesInWarehouse getTbSuppliesInWarehouse() { | |||
| return tbSuppliesInWarehouse; | |||
| } | |||
| public TBBlockDetailsReport tbSuppliesInWarehouse(TBSuppliesInWarehouse tBSuppliesInWarehouse) { | |||
| this.tbSuppliesInWarehouse = tBSuppliesInWarehouse; | |||
| return this; | |||
| } | |||
| public void setTbSuppliesInWarehouse(TBSuppliesInWarehouse tBSuppliesInWarehouse) { | |||
| this.tbSuppliesInWarehouse = tBSuppliesInWarehouse; | |||
| } | |||
| // jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove | |||
| @Override | |||
| public boolean equals(Object o) { | |||
| if (this == o) { | |||
| return true; | |||
| } | |||
| if (o == null || getClass() != o.getClass()) { | |||
| return false; | |||
| } | |||
| TBBlockDetailsReport tBBlockDetailsReport = (TBBlockDetailsReport) o; | |||
| if (tBBlockDetailsReport.getId() == null || getId() == null) { | |||
| return false; | |||
| } | |||
| return Objects.equals(getId(), tBBlockDetailsReport.getId()); | |||
| } | |||
| @Override | |||
| public int hashCode() { | |||
| return Objects.hashCode(getId()); | |||
| } | |||
| @Override | |||
| public String toString() { | |||
| return "TBBlockDetailsReport{" + | |||
| "id=" + getId() + | |||
| ", code='" + getCode() + "'" + | |||
| ", quantity=" + getQuantity() + | |||
| ", createDate='" + getCreateDate() + "'" + | |||
| "}"; | |||
| } | |||
| } | |||
| @@ -0,0 +1,98 @@ | |||
| package vn.azteam.tpf.domain; | |||
| import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | |||
| import org.hibernate.annotations.Cache; | |||
| import org.hibernate.annotations.CacheConcurrencyStrategy; | |||
| import javax.persistence.*; | |||
| import org.springframework.data.elasticsearch.annotations.Document; | |||
| import java.io.Serializable; | |||
| import java.util.Objects; | |||
| /** | |||
| * A TBCity. | |||
| */ | |||
| @Entity | |||
| @Table(name = "tb_city") | |||
| @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) | |||
| @Document(indexName = "smf_tbcity") | |||
| public class TBCity implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| @Id | |||
| @GeneratedValue(strategy = GenerationType.IDENTITY) | |||
| private Long id; | |||
| @Column(name = "name") | |||
| private String name; | |||
| @ManyToOne | |||
| @JsonIgnoreProperties({"hibernateLazyInitializer", "handler"}) | |||
| private TBCountry tbCountry; | |||
| // jhipster-needle-entity-add-field - JHipster will add fields here, do not remove | |||
| public Long getId() { | |||
| return id; | |||
| } | |||
| public void setId(Long id) { | |||
| this.id = id; | |||
| } | |||
| public String getName() { | |||
| return name; | |||
| } | |||
| public TBCity name(String name) { | |||
| this.name = name; | |||
| return this; | |||
| } | |||
| public void setName(String name) { | |||
| this.name = name; | |||
| } | |||
| public TBCountry getTbCountry() { | |||
| return tbCountry; | |||
| } | |||
| public TBCity tbCountry(TBCountry tBCountry) { | |||
| this.tbCountry = tBCountry; | |||
| return this; | |||
| } | |||
| public void setTbCountry(TBCountry tBCountry) { | |||
| this.tbCountry = tBCountry; | |||
| } | |||
| // jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove | |||
| @Override | |||
| public boolean equals(Object o) { | |||
| if (this == o) { | |||
| return true; | |||
| } | |||
| if (o == null || getClass() != o.getClass()) { | |||
| return false; | |||
| } | |||
| TBCity tBCity = (TBCity) o; | |||
| if (tBCity.getId() == null || getId() == null) { | |||
| return false; | |||
| } | |||
| return Objects.equals(getId(), tBCity.getId()); | |||
| } | |||
| @Override | |||
| public int hashCode() { | |||
| return Objects.hashCode(getId()); | |||
| } | |||
| @Override | |||
| public String toString() { | |||
| return "TBCity{" + | |||
| "id=" + getId() + | |||
| ", name='" + getName() + "'" + | |||
| "}"; | |||
| } | |||
| } | |||
| @@ -0,0 +1,114 @@ | |||
| package vn.azteam.tpf.domain; | |||
| import org.hibernate.annotations.Cache; | |||
| import org.hibernate.annotations.CacheConcurrencyStrategy; | |||
| import javax.persistence.*; | |||
| import org.springframework.data.elasticsearch.annotations.Document; | |||
| import java.io.Serializable; | |||
| import java.util.Objects; | |||
| /** | |||
| * A TBCommand. | |||
| */ | |||
| @Entity | |||
| @Table(name = "tb_command") | |||
| @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) | |||
| @Document(indexName = "smf_tbcommand") | |||
| public class TBCommand implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| @Id | |||
| @GeneratedValue(strategy = GenerationType.IDENTITY) | |||
| private Long id; | |||
| @Column(name = "name") | |||
| private String name; | |||
| @Column(name = "jhi_key") | |||
| private String key; | |||
| @Column(name = "description") | |||
| private String description; | |||
| // jhipster-needle-entity-add-field - JHipster will add fields here, do not remove | |||
| public Long getId() { | |||
| return id; | |||
| } | |||
| public void setId(Long id) { | |||
| this.id = id; | |||
| } | |||
| public String getName() { | |||
| return name; | |||
| } | |||
| public TBCommand name(String name) { | |||
| this.name = name; | |||
| return this; | |||
| } | |||
| public void setName(String name) { | |||
| this.name = name; | |||
| } | |||
| public String getKey() { | |||
| return key; | |||
| } | |||
| public TBCommand key(String key) { | |||
| this.key = key; | |||
| return this; | |||
| } | |||
| public void setKey(String key) { | |||
| this.key = key; | |||
| } | |||
| public String getDescription() { | |||
| return description; | |||
| } | |||
| public TBCommand description(String description) { | |||
| this.description = description; | |||
| return this; | |||
| } | |||
| public void setDescription(String description) { | |||
| this.description = description; | |||
| } | |||
| // jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove | |||
| @Override | |||
| public boolean equals(Object o) { | |||
| if (this == o) { | |||
| return true; | |||
| } | |||
| if (o == null || getClass() != o.getClass()) { | |||
| return false; | |||
| } | |||
| TBCommand tBCommand = (TBCommand) o; | |||
| if (tBCommand.getId() == null || getId() == null) { | |||
| return false; | |||
| } | |||
| return Objects.equals(getId(), tBCommand.getId()); | |||
| } | |||
| @Override | |||
| public int hashCode() { | |||
| return Objects.hashCode(getId()); | |||
| } | |||
| @Override | |||
| public String toString() { | |||
| return "TBCommand{" + | |||
| "id=" + getId() + | |||
| ", name='" + getName() + "'" + | |||
| ", key='" + getKey() + "'" + | |||
| ", description='" + getDescription() + "'" + | |||
| "}"; | |||
| } | |||
| } | |||
| @@ -0,0 +1,97 @@ | |||
| package vn.azteam.tpf.domain; | |||
| import org.hibernate.annotations.Cache; | |||
| import org.hibernate.annotations.CacheConcurrencyStrategy; | |||
| import javax.persistence.*; | |||
| import org.springframework.data.elasticsearch.annotations.Document; | |||
| import java.io.Serializable; | |||
| import java.util.Objects; | |||
| /** | |||
| * A TBControlType. | |||
| */ | |||
| @Entity | |||
| @Table(name = "tb_control_type") | |||
| @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) | |||
| @Document(indexName = "smf_tbcontroltype") | |||
| public class TBControlType implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| @Id | |||
| @GeneratedValue(strategy = GenerationType.IDENTITY) | |||
| private Long id; | |||
| @Column(name = "name") | |||
| private String name; | |||
| @Column(name = "description") | |||
| private String description; | |||
| // jhipster-needle-entity-add-field - JHipster will add fields here, do not remove | |||
| public Long getId() { | |||
| return id; | |||
| } | |||
| public void setId(Long id) { | |||
| this.id = id; | |||
| } | |||
| public String getName() { | |||
| return name; | |||
| } | |||
| public TBControlType name(String name) { | |||
| this.name = name; | |||
| return this; | |||
| } | |||
| public void setName(String name) { | |||
| this.name = name; | |||
| } | |||
| public String getDescription() { | |||
| return description; | |||
| } | |||
| public TBControlType description(String description) { | |||
| this.description = description; | |||
| return this; | |||
| } | |||
| public void setDescription(String description) { | |||
| this.description = description; | |||
| } | |||
| // jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove | |||
| @Override | |||
| public boolean equals(Object o) { | |||
| if (this == o) { | |||
| return true; | |||
| } | |||
| if (o == null || getClass() != o.getClass()) { | |||
| return false; | |||
| } | |||
| TBControlType tBControlType = (TBControlType) o; | |||
| if (tBControlType.getId() == null || getId() == null) { | |||
| return false; | |||
| } | |||
| return Objects.equals(getId(), tBControlType.getId()); | |||
| } | |||
| @Override | |||
| public int hashCode() { | |||
| return Objects.hashCode(getId()); | |||
| } | |||
| @Override | |||
| public String toString() { | |||
| return "TBControlType{" + | |||
| "id=" + getId() + | |||
| ", name='" + getName() + "'" + | |||
| ", description='" + getDescription() + "'" + | |||
| "}"; | |||
| } | |||
| } | |||
| @@ -0,0 +1,80 @@ | |||
| package vn.azteam.tpf.domain; | |||
| import org.hibernate.annotations.Cache; | |||
| import org.hibernate.annotations.CacheConcurrencyStrategy; | |||
| import javax.persistence.*; | |||
| import org.springframework.data.elasticsearch.annotations.Document; | |||
| import java.io.Serializable; | |||
| import java.util.Objects; | |||
| /** | |||
| * A TBCountry. | |||
| */ | |||
| @Entity | |||
| @Table(name = "tb_country") | |||
| @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) | |||
| @Document(indexName = "smf_tbcountry") | |||
| public class TBCountry implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| @Id | |||
| @GeneratedValue(strategy = GenerationType.IDENTITY) | |||
| private Long id; | |||
| @Column(name = "name") | |||
| private String name; | |||
| // jhipster-needle-entity-add-field - JHipster will add fields here, do not remove | |||
| public Long getId() { | |||
| return id; | |||
| } | |||
| public void setId(Long id) { | |||
| this.id = id; | |||
| } | |||
| public String getName() { | |||
| return name; | |||
| } | |||
| public TBCountry name(String name) { | |||
| this.name = name; | |||
| return this; | |||
| } | |||
| public void setName(String name) { | |||
| this.name = name; | |||
| } | |||
| // jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove | |||
| @Override | |||
| public boolean equals(Object o) { | |||
| if (this == o) { | |||
| return true; | |||
| } | |||
| if (o == null || getClass() != o.getClass()) { | |||
| return false; | |||
| } | |||
| TBCountry tBCountry = (TBCountry) o; | |||
| if (tBCountry.getId() == null || getId() == null) { | |||
| return false; | |||
| } | |||
| return Objects.equals(getId(), tBCountry.getId()); | |||
| } | |||
| @Override | |||
| public int hashCode() { | |||
| return Objects.hashCode(getId()); | |||
| } | |||
| @Override | |||
| public String toString() { | |||
| return "TBCountry{" + | |||
| "id=" + getId() + | |||
| ", name='" + getName() + "'" + | |||
| "}"; | |||
| } | |||
| } | |||
| @@ -0,0 +1,408 @@ | |||
| package vn.azteam.tpf.domain; | |||
| import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | |||
| import org.hibernate.annotations.Cache; | |||
| import org.hibernate.annotations.CacheConcurrencyStrategy; | |||
| import javax.persistence.*; | |||
| import org.springframework.data.elasticsearch.annotations.Document; | |||
| import java.io.Serializable; | |||
| import java.time.Instant; | |||
| import java.util.HashSet; | |||
| import java.util.Set; | |||
| import java.util.Objects; | |||
| /** | |||
| * A TBCrop. | |||
| */ | |||
| @Entity | |||
| @Table(name = "tb_crop") | |||
| @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) | |||
| @Document(indexName = "smf_tbcrop") | |||
| public class TBCrop implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| @Id | |||
| @GeneratedValue(strategy = GenerationType.IDENTITY) | |||
| private Long id; | |||
| @Column(name = "qr_code") | |||
| private String qrCode; | |||
| @Column(name = "code", unique = true) | |||
| private String code; | |||
| @Column(name = "area_m2") | |||
| private Double areaM2; | |||
| @Column(name = "start_date") | |||
| private Instant startDate; | |||
| @Column(name = "end_date") | |||
| private Instant endDate; | |||
| @Column(name = "status") | |||
| private String status; | |||
| @Column(name = "description") | |||
| private String description; | |||
| @Column(name = "age_day_start_at") | |||
| private Integer ageDayStartAt; | |||
| @Column(name = "created_date") | |||
| private Instant createdDate; | |||
| @Column(name = "modified_date") | |||
| private Instant modifiedDate; | |||
| @Column(name = "deleted_date") | |||
| private Instant deletedDate; | |||
| @ManyToOne | |||
| @JsonIgnoreProperties("") | |||
| private TBCropType tbCropType; | |||
| @ManyToOne | |||
| @JsonIgnoreProperties("") | |||
| private TBSupplies tbSupplies; | |||
| @ManyToOne | |||
| @JsonIgnoreProperties("") | |||
| private TBGuideline tbGuideline; | |||
| @ManyToOne | |||
| @JsonIgnoreProperties("") | |||
| private TBEntity tbEntity; | |||
| @ManyToOne(fetch=FetchType.LAZY) | |||
| @JsonIgnoreProperties("") | |||
| @JoinColumn(name = "created_by") | |||
| private TBDetailUser createdBy; | |||
| @ManyToOne(fetch=FetchType.LAZY) | |||
| @JsonIgnoreProperties("") | |||
| @JoinColumn(name = "modified_by") | |||
| private TBDetailUser modifiedBy; | |||
| @ManyToOne(fetch=FetchType.LAZY) | |||
| @JsonIgnoreProperties("") | |||
| @JoinColumn(name = "deleted_by") | |||
| private TBDetailUser deletedBy; | |||
| @ManyToMany | |||
| @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) | |||
| @JoinTable(name = "tb_assignment", | |||
| joinColumns = @JoinColumn(name = "tb_crops_id"/*, referencedColumnName = "id"*/), | |||
| inverseJoinColumns = @JoinColumn(name = "tb_detail_users_id"/*, referencedColumnName = "id"*/)) | |||
| private Set<TBDetailUser> tbDetailUsers = new HashSet<>(); | |||
| // jhipster-needle-entity-add-field - JHipster will add fields here, do not remove | |||
| public Long getId() { | |||
| return id; | |||
| } | |||
| public void setId(Long id) { | |||
| this.id = id; | |||
| } | |||
| public String getQrCode() { | |||
| return qrCode; | |||
| } | |||
| public TBCrop qrCode(String qrCode) { | |||
| this.qrCode = qrCode; | |||
| return this; | |||
| } | |||
| public void setQrCode(String qrCode) { | |||
| this.qrCode = qrCode; | |||
| } | |||
| public TBCropType getTbCropType() { | |||
| return tbCropType; | |||
| } | |||
| public TBCrop tbCropType(TBCropType tbCropType) { | |||
| this.tbCropType = tbCropType; | |||
| return this; | |||
| } | |||
| public String getCode() { | |||
| return code; | |||
| } | |||
| public TBCrop code(String code) { | |||
| this.code = code; | |||
| return this; | |||
| } | |||
| public void setCode(String code) { | |||
| this.code = code; | |||
| } | |||
| public Double getAreaM2() { | |||
| return areaM2; | |||
| } | |||
| public TBCrop areaM2(Double areaM2) { | |||
| this.areaM2 = areaM2; | |||
| return this; | |||
| } | |||
| public void setAreaM2(Double areaM2) { | |||
| this.areaM2 = areaM2; | |||
| } | |||
| public void setTbCropType(TBCropType tbCropType) { | |||
| this.tbCropType = tbCropType; | |||
| } | |||
| public Instant getStartDate() { | |||
| return startDate; | |||
| } | |||
| public TBCrop startDate(Instant startDate) { | |||
| this.startDate = startDate; | |||
| return this; | |||
| } | |||
| public void setStartDate(Instant startDate) { | |||
| this.startDate = startDate; | |||
| } | |||
| public Instant getEndDate() { | |||
| return endDate; | |||
| } | |||
| public TBCrop endDate(Instant endDate) { | |||
| this.endDate = endDate; | |||
| return this; | |||
| } | |||
| public void setEndDate(Instant endDate) { | |||
| this.endDate = endDate; | |||
| } | |||
| public String getStatus() { | |||
| return status; | |||
| } | |||
| public TBCrop status(String status) { | |||
| this.status = status; | |||
| return this; | |||
| } | |||
| public void setStatus(String status) { | |||
| this.status = status; | |||
| } | |||
| public String getDescription() { | |||
| return description; | |||
| } | |||
| public TBCrop description(String description) { | |||
| this.description = description; | |||
| return this; | |||
| } | |||
| public void setDescription(String description) { | |||
| this.description = description; | |||
| } | |||
| public Integer getAgeDayStartAt() { | |||
| return ageDayStartAt; | |||
| } | |||
| public TBCrop ageDayStartAt(Integer ageDayStartAt) { | |||
| this.ageDayStartAt = ageDayStartAt; | |||
| return this; | |||
| } | |||
| public void setAgeDayStartAt(Integer ageDayStartAt) { | |||
| this.ageDayStartAt = ageDayStartAt; | |||
| } | |||
| public Instant getCreatedDate() { | |||
| return createdDate; | |||
| } | |||
| public TBCrop createdDate(Instant createdDate) { | |||
| this.createdDate = createdDate; | |||
| return this; | |||
| } | |||
| public void setCreatedDate(Instant createdDate) { | |||
| this.createdDate = createdDate; | |||
| } | |||
| public Instant getModifiedDate() { | |||
| return modifiedDate; | |||
| } | |||
| public TBCrop modifiedDate(Instant modifiedDate) { | |||
| this.modifiedDate = modifiedDate; | |||
| return this; | |||
| } | |||
| public void setModifiedDate(Instant modifiedDate) { | |||
| this.modifiedDate = modifiedDate; | |||
| } | |||
| public Instant getDeletedDate() { | |||
| return deletedDate; | |||
| } | |||
| public TBCrop deletedDate(Instant deletedDate) { | |||
| this.deletedDate = deletedDate; | |||
| return this; | |||
| } | |||
| public void setDeletedDate(Instant deletedDate) { | |||
| this.deletedDate = deletedDate; | |||
| } | |||
| public TBSupplies getTbSupplies() { | |||
| return tbSupplies; | |||
| } | |||
| public TBCrop tbSupplies(TBSupplies tBSupplies) { | |||
| this.tbSupplies = tBSupplies; | |||
| return this; | |||
| } | |||
| public void setTbSupplies(TBSupplies tBSupplies) { | |||
| this.tbSupplies = tBSupplies; | |||
| } | |||
| public TBGuideline getTbGuideline() { | |||
| return tbGuideline; | |||
| } | |||
| public TBCrop tbGuideline(TBGuideline tBGuideline) { | |||
| this.tbGuideline = tBGuideline; | |||
| return this; | |||
| } | |||
| public void setTbGuideline(TBGuideline tBGuideline) { | |||
| this.tbGuideline = tBGuideline; | |||
| } | |||
| public TBEntity getTbEntity() { | |||
| return tbEntity; | |||
| } | |||
| public TBCrop tbEntity(TBEntity tBEntity) { | |||
| this.tbEntity = tBEntity; | |||
| return this; | |||
| } | |||
| public void setTbEntity(TBEntity tBEntity) { | |||
| this.tbEntity = tBEntity; | |||
| } | |||
| public TBDetailUser getCreatedBy() { | |||
| return createdBy; | |||
| } | |||
| public TBCrop createdBy(TBDetailUser tBDetailUser) { | |||
| this.createdBy = tBDetailUser; | |||
| return this; | |||
| } | |||
| public void setCreatedBy(TBDetailUser tBDetailUser) { | |||
| this.createdBy = tBDetailUser; | |||
| } | |||
| public TBDetailUser getModifiedBy() { | |||
| return modifiedBy; | |||
| } | |||
| public TBCrop modifiedBy(TBDetailUser tBDetailUser) { | |||
| this.modifiedBy = tBDetailUser; | |||
| return this; | |||
| } | |||
| public void setModifiedBy(TBDetailUser tBDetailUser) { | |||
| this.modifiedBy = tBDetailUser; | |||
| } | |||
| public TBDetailUser getDeletedBy() { | |||
| return deletedBy; | |||
| } | |||
| public TBCrop deletedBy(TBDetailUser tBDetailUser) { | |||
| this.deletedBy = tBDetailUser; | |||
| return this; | |||
| } | |||
| public void setDeletedBy(TBDetailUser tBDetailUser) { | |||
| this.deletedBy = tBDetailUser; | |||
| } | |||
| public Set<TBDetailUser> getTbDetailUsers() { | |||
| return tbDetailUsers; | |||
| } | |||
| public TBCrop tbDetailUsers(Set<TBDetailUser> tBDetailUsers) { | |||
| this.tbDetailUsers = tBDetailUsers; | |||
| return this; | |||
| } | |||
| public TBCrop addTbDetailUser(TBDetailUser tBDetailUser) { | |||
| this.tbDetailUsers.add(tBDetailUser); | |||
| tBDetailUser.getTbCrops().add(this); | |||
| return this; | |||
| } | |||
| public TBCrop removeTbDetailUser(TBDetailUser tBDetailUser) { | |||
| this.tbDetailUsers.remove(tBDetailUser); | |||
| tBDetailUser.getTbCrops().remove(this); | |||
| return this; | |||
| } | |||
| public void setTbDetailUsers(Set<TBDetailUser> tBDetailUsers) { | |||
| this.tbDetailUsers = tBDetailUsers; | |||
| } | |||
| // jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove | |||
| @Override | |||
| public boolean equals(Object o) { | |||
| if (this == o) { | |||
| return true; | |||
| } | |||
| if (o == null || getClass() != o.getClass()) { | |||
| return false; | |||
| } | |||
| TBCrop tBCrop = (TBCrop) o; | |||
| if (tBCrop.getId() == null || getId() == null) { | |||
| return false; | |||
| } | |||
| return Objects.equals(getId(), tBCrop.getId()); | |||
| } | |||
| @Override | |||
| public int hashCode() { | |||
| return Objects.hashCode(getId()); | |||
| } | |||
| @Override | |||
| public String toString() { | |||
| return "TBCrop{" + | |||
| "id=" + getId() + | |||
| ", qrCode='" + getQrCode() + "'" + | |||
| ", code='" + getCode() + "'" + | |||
| ", areaM2='" + getAreaM2() + "'" + | |||
| ", tbCropType=" + getTbCropType() + | |||
| ", startDate='" + getStartDate() + "'" + | |||
| ", endDate='" + getEndDate() + "'" + | |||
| ", status='" + getStatus() + "'" + | |||
| ", description='" + getDescription() + "'" + | |||
| ", ageDayStartAt=" + getAgeDayStartAt() + | |||
| ", createdDate='" + getCreatedDate() + "'" + | |||
| ", modifiedDate='" + getModifiedDate() + "'" + | |||
| ", deletedDate='" + getDeletedDate() + "'" + | |||
| "}"; | |||
| } | |||
| } | |||
| @@ -0,0 +1,80 @@ | |||
| package vn.azteam.tpf.domain; | |||
| import org.hibernate.annotations.Cache; | |||
| import org.hibernate.annotations.CacheConcurrencyStrategy; | |||
| import javax.persistence.*; | |||
| import org.springframework.data.elasticsearch.annotations.Document; | |||
| import java.io.Serializable; | |||
| import java.util.Objects; | |||
| /** | |||
| * A TBCropType. | |||
| */ | |||
| @Entity | |||
| @Table(name = "tb_crop_type") | |||
| @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) | |||
| @Document(indexName = "smf_tbcroptype") | |||
| public class TBCropType implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| @Id | |||
| @GeneratedValue(strategy = GenerationType.IDENTITY) | |||
| private Long id; | |||
| @Column(name = "name") | |||
| private String name; | |||
| // jhipster-needle-entity-add-field - JHipster will add fields here, do not remove | |||
| public Long getId() { | |||
| return id; | |||
| } | |||
| public void setId(Long id) { | |||
| this.id = id; | |||
| } | |||
| public String getName() { | |||
| return name; | |||
| } | |||
| public TBCropType name(String name) { | |||
| this.name = name; | |||
| return this; | |||
| } | |||
| public void setName(String name) { | |||
| this.name = name; | |||
| } | |||
| // jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove | |||
| @Override | |||
| public boolean equals(Object o) { | |||
| if (this == o) { | |||
| return true; | |||
| } | |||
| if (o == null || getClass() != o.getClass()) { | |||
| return false; | |||
| } | |||
| TBCropType tBCropType = (TBCropType) o; | |||
| if (tBCropType.getId() == null || getId() == null) { | |||
| return false; | |||
| } | |||
| return Objects.equals(getId(), tBCropType.getId()); | |||
| } | |||
| @Override | |||
| public int hashCode() { | |||
| return Objects.hashCode(getId()); | |||
| } | |||
| @Override | |||
| public String toString() { | |||
| return "TBCropType{" + | |||
| "id=" + getId() + | |||
| ", name='" + getName() + "'" + | |||
| "}"; | |||
| } | |||
| } | |||
| @@ -0,0 +1,319 @@ | |||
| package vn.azteam.tpf.domain; | |||
| import com.fasterxml.jackson.annotation.JsonIgnore; | |||
| import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | |||
| import org.hibernate.annotations.Cache; | |||
| import org.hibernate.annotations.CacheConcurrencyStrategy; | |||
| import javax.persistence.*; | |||
| import org.springframework.data.elasticsearch.annotations.Document; | |||
| import java.io.Serializable; | |||
| import java.time.Instant; | |||
| import java.util.Objects; | |||
| /** | |||
| * A TBCustomer. | |||
| */ | |||
| @Entity | |||
| @Table(name = "tb_customer") | |||
| @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) | |||
| @Document(indexName = "smf_tbcustomer") | |||
| public class TBCustomer implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| @Id | |||
| @GeneratedValue(strategy = GenerationType.IDENTITY) | |||
| private Long id; | |||
| @Column(name = "name") | |||
| private String name; | |||
| @Column(name = "phone") | |||
| private String phone; | |||
| @Column(name = "email") | |||
| private String email; | |||
| @Column(name = "slug_name") | |||
| private String slugName; | |||
| @Column(name = "area_m_2") | |||
| private Double areaM2; | |||
| @Column(name = "is_activated") | |||
| private Integer isActivated; | |||
| @Column(name = "created_date") | |||
| private Instant createdDate; | |||
| @Column(name = "modified_date") | |||
| private Instant modifiedDate; | |||
| @Column(name = "deleted_date") | |||
| private Instant deletedDate; | |||
| @Column(name = "api_key") | |||
| private String apiKey; | |||
| @ManyToOne | |||
| @JsonIgnoreProperties({"hibernateLazyInitializer", "handler"}) | |||
| private TBAddress tbAddress; | |||
| @ManyToOne | |||
| @JsonIgnoreProperties("") | |||
| private TBDashboardType tbDashboardType; | |||
| @ManyToOne(fetch=FetchType.LAZY) | |||
| @JsonIgnoreProperties("") | |||
| @JsonIgnore | |||
| @JoinColumn(name = "created_by") | |||
| private TBDetailUser createdBy; | |||
| @ManyToOne(fetch=FetchType.LAZY) | |||
| @JsonIgnoreProperties("") | |||
| @JsonIgnore | |||
| @JoinColumn(name = "modified_by") | |||
| private TBDetailUser modifiedBy; | |||
| @ManyToOne(fetch=FetchType.LAZY) | |||
| @JsonIgnoreProperties("") | |||
| @JsonIgnore | |||
| @JoinColumn(name = "deleted_by") | |||
| private TBDetailUser deletedBy; | |||
| public TBCustomer() { | |||
| } | |||
| // jhipster-needle-entity-add-field - JHipster will add fields here, do not remove | |||
| public Long getId() { | |||
| return id; | |||
| } | |||
| public void setId(Long id) { | |||
| this.id = id; | |||
| } | |||
| public String getName() { | |||
| return name; | |||
| } | |||
| public TBCustomer name(String name) { | |||
| this.name = name; | |||
| return this; | |||
| } | |||
| public void setName(String name) { | |||
| this.name = name; | |||
| } | |||
| public String getPhone() { | |||
| return phone; | |||
| } | |||
| public TBCustomer phone(String phone) { | |||
| this.phone = phone; | |||
| return this; | |||
| } | |||
| public void setPhone(String phone) { | |||
| this.phone = phone; | |||
| } | |||
| public String getEmail() { | |||
| return email; | |||
| } | |||
| public TBCustomer email(String email) { | |||
| this.email = email; | |||
| return this; | |||
| } | |||
| public void setEmail(String email) { | |||
| this.email = email; | |||
| } | |||
| public String getSlugName() { | |||
| return slugName; | |||
| } | |||
| public TBCustomer slugName(String slugName) { | |||
| this.slugName = slugName; | |||
| return this; | |||
| } | |||
| public void setSlugName(String slugName) { | |||
| this.slugName = slugName; | |||
| } | |||
| public Double getAreaM2() { | |||
| return areaM2; | |||
| } | |||
| public TBCustomer areaM2(Double areaM2) { | |||
| this.areaM2 = areaM2; | |||
| return this; | |||
| } | |||
| public void setAreaM2(Double areaM2) { | |||
| this.areaM2 = areaM2; | |||
| } | |||
| public Integer getIsActivated() { | |||
| return isActivated; | |||
| } | |||
| public TBCustomer isActivated(Integer isActivated) { | |||
| this.isActivated = isActivated; | |||
| return this; | |||
| } | |||
| public void setIsActivated(Integer isActivated) { | |||
| this.isActivated = isActivated; | |||
| } | |||
| public Instant getCreatedDate() { | |||
| return createdDate; | |||
| } | |||
| public TBCustomer createdDate(Instant createdDate) { | |||
| this.createdDate = createdDate; | |||
| return this; | |||
| } | |||
| public void setCreatedDate(Instant createdDate) { | |||
| this.createdDate = createdDate; | |||
| } | |||
| public Instant getModifiedDate() { | |||
| return modifiedDate; | |||
| } | |||
| public TBCustomer modifiedDate(Instant modifiedDate) { | |||
| this.modifiedDate = modifiedDate; | |||
| return this; | |||
| } | |||
| public void setModifiedDate(Instant modifiedDate) { | |||
| this.modifiedDate = modifiedDate; | |||
| } | |||
| public Instant getDeletedDate() { | |||
| return deletedDate; | |||
| } | |||
| public TBCustomer deletedDate(Instant deletedDate) { | |||
| this.deletedDate = deletedDate; | |||
| return this; | |||
| } | |||
| public void setDeletedDate(Instant deletedDate) { | |||
| this.deletedDate = deletedDate; | |||
| } | |||
| public TBAddress getTbAddress() { | |||
| return tbAddress; | |||
| } | |||
| public TBCustomer tbAddress(TBAddress tBAddress) { | |||
| this.tbAddress = tBAddress; | |||
| return this; | |||
| } | |||
| public void setTbAddress(TBAddress tBAddress) { | |||
| this.tbAddress = tBAddress; | |||
| } | |||
| public TBDashboardType getTbDashboardType() { | |||
| return tbDashboardType; | |||
| } | |||
| public TBCustomer tbDashboardType(TBDashboardType tbDashboardType) { | |||
| this.tbDashboardType = tbDashboardType; | |||
| return this; | |||
| } | |||
| public void setTbDashboardType(TBDashboardType tbDashboardType) { | |||
| this.tbDashboardType = tbDashboardType; | |||
| } | |||
| public TBDetailUser getCreatedBy() { | |||
| return createdBy; | |||
| } | |||
| public TBCustomer createdBy(TBDetailUser tBDetailUser) { | |||
| this.createdBy = tBDetailUser; | |||
| return this; | |||
| } | |||
| public void setCreatedBy(TBDetailUser tBDetailUser) { | |||
| this.createdBy = tBDetailUser; | |||
| } | |||
| public TBDetailUser getModifiedBy() { | |||
| return modifiedBy; | |||
| } | |||
| public TBCustomer modifiedBy(TBDetailUser tBDetailUser) { | |||
| this.modifiedBy = tBDetailUser; | |||
| return this; | |||
| } | |||
| public void setModifiedBy(TBDetailUser tBDetailUser) { | |||
| this.modifiedBy = tBDetailUser; | |||
| } | |||
| public TBDetailUser getDeletedBy() { | |||
| return deletedBy; | |||
| } | |||
| public TBCustomer deletedBy(TBDetailUser tBDetailUser) { | |||
| this.deletedBy = tBDetailUser; | |||
| return this; | |||
| } | |||
| public void setDeletedBy(TBDetailUser tBDetailUser) { | |||
| this.deletedBy = tBDetailUser; | |||
| } | |||
| // jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove | |||
| public String getApiKey() { | |||
| return apiKey; | |||
| } | |||
| public void setApiKey(String apiKey) { | |||
| this.apiKey = apiKey; | |||
| } | |||
| @Override | |||
| public boolean equals(Object o) { | |||
| if (this == o) return true; | |||
| if (o == null || getClass() != o.getClass()) return false; | |||
| TBCustomer that = (TBCustomer) o; | |||
| return Objects.equals(id, that.id) && Objects.equals(name, that.name) && Objects.equals(phone, that.phone) && Objects.equals(email, that.email) && Objects.equals(slugName, that.slugName) && Objects.equals(areaM2, that.areaM2) && Objects.equals(isActivated, that.isActivated) && Objects.equals(createdDate, that.createdDate) && Objects.equals(modifiedDate, that.modifiedDate) && Objects.equals(deletedDate, that.deletedDate) && Objects.equals(apiKey, that.apiKey) && Objects.equals(tbAddress, that.tbAddress) && Objects.equals(tbDashboardType, that.tbDashboardType) && Objects.equals(createdBy, that.createdBy) && Objects.equals(modifiedBy, that.modifiedBy) && Objects.equals(deletedBy, that.deletedBy); | |||
| } | |||
| @Override | |||
| public int hashCode() { | |||
| return Objects.hash(id, name, phone, email, slugName, areaM2, isActivated, createdDate, modifiedDate, deletedDate, apiKey, tbAddress, tbDashboardType, createdBy, modifiedBy, deletedBy); | |||
| } | |||
| @Override | |||
| public String toString() { | |||
| return "TBCustomer{" + | |||
| "id=" + getId() + | |||
| ", name='" + getName() + "'" + | |||
| ", phone='" + getPhone() + "'" + | |||
| ", email='" + getEmail() + "'" + | |||
| ", slugName='" + getSlugName() + "'" + | |||
| ", areaM2=" + getAreaM2() + | |||
| ", isActivated=" + getIsActivated() + | |||
| ", createdDate='" + getCreatedDate() + "'" + | |||
| ", modifiedDate='" + getModifiedDate() + "'" + | |||
| ", deletedDate='" + getDeletedDate() + "'" + | |||
| ", apiKey='" + getApiKey() + "'" + | |||
| "}"; | |||
| } | |||
| } | |||
| @@ -0,0 +1,119 @@ | |||
| package vn.azteam.tpf.domain; | |||
| import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | |||
| import org.hibernate.annotations.Cache; | |||
| import org.hibernate.annotations.CacheConcurrencyStrategy; | |||
| import javax.persistence.*; | |||
| import org.springframework.data.elasticsearch.annotations.Document; | |||
| import java.io.Serializable; | |||
| import java.util.Objects; | |||
| /** | |||
| * A TBCustomerHasCropType. | |||
| */ | |||
| @Entity | |||
| @Table(name = "tb_customer_has_crop_type") | |||
| @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) | |||
| @Document(indexName = "smf_tbcustomerhascroptype") | |||
| public class TBCustomerHasCropType implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| @Id | |||
| @GeneratedValue(strategy = GenerationType.IDENTITY) | |||
| private Long id; | |||
| @ManyToOne | |||
| @JsonIgnoreProperties("") | |||
| private TBCropType tbCropType; | |||
| @ManyToOne | |||
| @JsonIgnoreProperties("") | |||
| private TBCustomer tbCustomer; | |||
| @ManyToOne | |||
| @JsonIgnoreProperties("") | |||
| private TBActivityType tbActivityType; | |||
| // jhipster-needle-entity-add-field - JHipster will add fields here, do not remove | |||
| public Long getId() { | |||
| return id; | |||
| } | |||
| public void setId(Long id) { | |||
| this.id = id; | |||
| } | |||
| public TBCropType getTbCropType() { | |||
| return tbCropType; | |||
| } | |||
| public TBCustomerHasCropType tbCropType(TBCropType tbCropType) { | |||
| this.tbCropType = tbCropType; | |||
| return this; | |||
| } | |||
| public void setTbCropType(TBCropType tbCropType) { | |||
| this.tbCropType = tbCropType; | |||
| } | |||
| public TBCustomer getTbCustomer() { | |||
| return tbCustomer; | |||
| } | |||
| public TBCustomerHasCropType tbCustomer(TBCustomer tbCustomer) { | |||
| this.tbCustomer = tbCustomer; | |||
| return this; | |||
| } | |||
| public void setTbCustomer(TBCustomer tbCustomer) { | |||
| this.tbCustomer = tbCustomer; | |||
| } | |||
| public TBActivityType getTbActivityType() { | |||
| return tbActivityType; | |||
| } | |||
| public TBCustomerHasCropType tbActivityType(TBActivityType tbActivityType) { | |||
| this.tbActivityType = tbActivityType; | |||
| return this; | |||
| } | |||
| public void setTbActivityType(TBActivityType tbActivityType) { | |||
| this.tbActivityType = tbActivityType; | |||
| } | |||
| // jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove | |||
| @Override | |||
| public boolean equals(Object o) { | |||
| if (this == o) { | |||
| return true; | |||
| } | |||
| if (o == null || getClass() != o.getClass()) { | |||
| return false; | |||
| } | |||
| TBCustomerHasCropType tBCustomerHasCropType = (TBCustomerHasCropType) o; | |||
| if (tBCustomerHasCropType.getId() == null || getId() == null) { | |||
| return false; | |||
| } | |||
| return Objects.equals(getId(), tBCustomerHasCropType.getId()); | |||
| } | |||
| @Override | |||
| public int hashCode() { | |||
| return Objects.hashCode(getId()); | |||
| } | |||
| @Override | |||
| public String toString() { | |||
| return "TBCustomerHasCropType{" + | |||
| "id=" + getId() + | |||
| "tbCustomer=" + getTbCustomer() + | |||
| "tbActivityType=" + getTbActivityType() + | |||
| "tbCropType=" + getTbCropType() + | |||
| "}"; | |||
| } | |||
| } | |||
| @@ -0,0 +1,97 @@ | |||
| package vn.azteam.tpf.domain; | |||
| import org.hibernate.annotations.Cache; | |||
| import org.hibernate.annotations.CacheConcurrencyStrategy; | |||
| import javax.persistence.*; | |||
| import org.springframework.data.elasticsearch.annotations.Document; | |||
| import java.io.Serializable; | |||
| import java.util.Objects; | |||
| /** | |||
| * A TBDashboardType. | |||
| */ | |||
| @Entity | |||
| @Table(name = "tb_dashboard_type") | |||
| @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) | |||
| @Document(indexName = "smf_tbdashboardtype") | |||
| public class TBDashboardType implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| @Id | |||
| @GeneratedValue(strategy = GenerationType.IDENTITY) | |||
| private Long id; | |||
| @Column(name = "name") | |||
| private String name; | |||
| @Column(name = "description") | |||
| private String description; | |||
| // jhipster-needle-entity-add-field - JHipster will add fields here, do not remove | |||
| public Long getId() { | |||
| return id; | |||
| } | |||
| public void setId(Long id) { | |||
| this.id = id; | |||
| } | |||
| public String getName() { | |||
| return name; | |||
| } | |||
| public TBDashboardType name(String name) { | |||
| this.name = name; | |||
| return this; | |||
| } | |||
| public void setName(String name) { | |||
| this.name = name; | |||
| } | |||
| public String getDescription() { | |||
| return description; | |||
| } | |||
| public TBDashboardType description(String description) { | |||
| this.description = description; | |||
| return this; | |||
| } | |||
| public void setDescription(String description) { | |||
| this.description = description; | |||
| } | |||
| // jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove | |||
| @Override | |||
| public boolean equals(Object o) { | |||
| if (this == o) { | |||
| return true; | |||
| } | |||
| if (o == null || getClass() != o.getClass()) { | |||
| return false; | |||
| } | |||
| TBDashboardType tBDashboardType = (TBDashboardType) o; | |||
| if (tBDashboardType.getId() == null || getId() == null) { | |||
| return false; | |||
| } | |||
| return Objects.equals(getId(), tBDashboardType.getId()); | |||
| } | |||
| @Override | |||
| public int hashCode() { | |||
| return Objects.hashCode(getId()); | |||
| } | |||
| @Override | |||
| public String toString() { | |||
| return "TBDashboardType{" + | |||
| "id=" + getId() + | |||
| ", name='" + getName() + "'" + | |||
| ", description='" + getDescription() + "'" + | |||
| "}"; | |||
| } | |||
| } | |||
| @@ -0,0 +1,252 @@ | |||
| package vn.azteam.tpf.domain; | |||
| import com.fasterxml.jackson.annotation.JsonIgnore; | |||
| import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | |||
| import org.hibernate.annotations.Cache; | |||
| import org.hibernate.annotations.CacheConcurrencyStrategy; | |||
| import javax.persistence.*; | |||
| import org.springframework.data.elasticsearch.annotations.Document; | |||
| import java.io.Serializable; | |||
| import java.time.Instant; | |||
| import java.util.HashSet; | |||
| import java.util.Set; | |||
| import java.util.Objects; | |||
| /** | |||
| * A TBDetailUser. | |||
| */ | |||
| @Entity | |||
| @Table(name = "tb_detail_user") | |||
| @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) | |||
| @Document(indexName = "smf_tbdetailuser") | |||
| public class TBDetailUser implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| @Id | |||
| // @GeneratedValue(strategy = GenerationType.IDENTITY) | |||
| private Long id; | |||
| @Column(name = "full_name") | |||
| private String fullName; | |||
| @Column(name = "phone") | |||
| private String phone; | |||
| @Column(name = "birthday") | |||
| private Instant birthday; | |||
| @Column(name = "gender") | |||
| private Integer gender; | |||
| @ManyToOne | |||
| @JsonIgnoreProperties("") | |||
| private TBRole tbRole; | |||
| @ManyToOne | |||
| @JsonIgnoreProperties({"hibernateLazyInitializer", "handler"}) | |||
| private TBCustomer tbCustomer; | |||
| @ManyToOne | |||
| @JsonIgnoreProperties({"hibernateLazyInitializer", "handler"}) | |||
| private TBAddress tbAddress; | |||
| @JsonIgnore | |||
| @OneToOne | |||
| @MapsId | |||
| private User user; | |||
| @Column(name = "fcm_token") | |||
| private String fcmToken; | |||
| @ManyToMany(mappedBy = "tbDetailUsers") | |||
| @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) | |||
| @JsonIgnore | |||
| private Set<TBCrop> tbCrops = new HashSet<>(); | |||
| // jhipster-needle-entity-add-field - JHipster will add fields here, do not remove | |||
| public Long getId() { | |||
| return id; | |||
| } | |||
| public void setId(Long id) { | |||
| this.id = id; | |||
| } | |||
| public String getFullName() { | |||
| return fullName; | |||
| } | |||
| public TBDetailUser fullName(String fullName) { | |||
| this.fullName = fullName; | |||
| return this; | |||
| } | |||
| public void setFullName(String fullName) { | |||
| this.fullName = fullName; | |||
| } | |||
| public String getPhone() { | |||
| return phone; | |||
| } | |||
| public TBDetailUser phone(String phone) { | |||
| this.phone = phone; | |||
| return this; | |||
| } | |||
| public void setPhone(String phone) { | |||
| this.phone = phone; | |||
| } | |||
| public Instant getBirthday() { | |||
| return birthday; | |||
| } | |||
| public TBDetailUser birthday(Instant birthday) { | |||
| this.birthday = birthday; | |||
| return this; | |||
| } | |||
| public void setBirthday(Instant birthday) { | |||
| this.birthday = birthday; | |||
| } | |||
| public Integer getGender() { | |||
| return gender; | |||
| } | |||
| public TBDetailUser gender(Integer gender) { | |||
| this.gender = gender; | |||
| return this; | |||
| } | |||
| public void setGender(Integer gender) { | |||
| this.gender = gender; | |||
| } | |||
| public TBRole getTbRole() { | |||
| return tbRole; | |||
| } | |||
| public TBDetailUser tbRole(TBRole tBRole) { | |||
| this.tbRole = tBRole; | |||
| return this; | |||
| } | |||
| public void setTbRole(TBRole tBRole) { | |||
| this.tbRole = tBRole; | |||
| } | |||
| public TBCustomer getTbCustomer() { | |||
| return tbCustomer; | |||
| } | |||
| public TBDetailUser tbCustomer(TBCustomer tBCustomer) { | |||
| this.tbCustomer = tBCustomer; | |||
| return this; | |||
| } | |||
| public void setTbCustomer(TBCustomer tBCustomer) { | |||
| this.tbCustomer = tBCustomer; | |||
| } | |||
| public TBAddress getTbAddress() { | |||
| return tbAddress; | |||
| } | |||
| public TBDetailUser tbAddress(TBAddress tBAddress) { | |||
| this.tbAddress = tBAddress; | |||
| return this; | |||
| } | |||
| public void setTbAddress(TBAddress tBAddress) { | |||
| this.tbAddress = tBAddress; | |||
| } | |||
| public String getFcmToken() { | |||
| return fcmToken; | |||
| } | |||
| public TBDetailUser fcmToken(String fcmToken) { | |||
| this.fcmToken = fcmToken; | |||
| return this; | |||
| } | |||
| public void setFcmToken(String fcmToken) { | |||
| this.fcmToken = fcmToken; | |||
| } | |||
| public User getUser() { | |||
| return user; | |||
| } | |||
| public TBDetailUser user(User user) { | |||
| this.user = user; | |||
| return this; | |||
| } | |||
| public void setUser(User user) { | |||
| this.user = user; | |||
| } | |||
| public Set<TBCrop> getTbCrops() { | |||
| return tbCrops; | |||
| } | |||
| public TBDetailUser tbCrops(Set<TBCrop> tBCrops) { | |||
| this.tbCrops = tBCrops; | |||
| return this; | |||
| } | |||
| public TBDetailUser addTbCrop(TBCrop tBCrop) { | |||
| this.tbCrops.add(tBCrop); | |||
| tBCrop.getTbDetailUsers().add(this); | |||
| return this; | |||
| } | |||
| public TBDetailUser removeTbCrop(TBCrop tBCrop) { | |||
| this.tbCrops.remove(tBCrop); | |||
| tBCrop.getTbDetailUsers().remove(this); | |||
| return this; | |||
| } | |||
| public void setTbCrops(Set<TBCrop> tBCrops) { | |||
| this.tbCrops = tBCrops; | |||
| } | |||
| // jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove | |||
| @Override | |||
| public boolean equals(Object o) { | |||
| if (this == o) { | |||
| return true; | |||
| } | |||
| if (o == null || getClass() != o.getClass()) { | |||
| return false; | |||
| } | |||
| TBDetailUser tBDetailUser = (TBDetailUser) o; | |||
| if (tBDetailUser.getId() == null || getId() == null) { | |||
| return false; | |||
| } | |||
| return Objects.equals(getId(), tBDetailUser.getId()); | |||
| } | |||
| @Override | |||
| public int hashCode() { | |||
| return Objects.hashCode(getId()); | |||
| } | |||
| @Override | |||
| public String toString() { | |||
| return "TBDetailUser{" + | |||
| "id=" + getId() + | |||
| ", fullName='" + getFullName() + "'" + | |||
| ", phone='" + getPhone() + "'" + | |||
| ", birthday='" + getBirthday() + "'" + | |||
| ", gender=" + getGender() + | |||
| ", fcmToken=" + getFcmToken() + | |||
| "}"; | |||
| } | |||
| } | |||
| @@ -0,0 +1,98 @@ | |||
| package vn.azteam.tpf.domain; | |||
| import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | |||
| import org.hibernate.annotations.Cache; | |||
| import org.hibernate.annotations.CacheConcurrencyStrategy; | |||
| import javax.persistence.*; | |||
| import org.springframework.data.elasticsearch.annotations.Document; | |||
| import java.io.Serializable; | |||
| import java.util.Objects; | |||
| /** | |||
| * A TBDistrict. | |||
| */ | |||
| @Entity | |||
| @Table(name = "tb_district") | |||
| @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) | |||
| @Document(indexName = "smf_tbdistrict") | |||
| public class TBDistrict implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| @Id | |||
| @GeneratedValue(strategy = GenerationType.IDENTITY) | |||
| private Long id; | |||
| @Column(name = "name") | |||
| private String name; | |||
| @ManyToOne | |||
| @JsonIgnoreProperties({"hibernateLazyInitializer", "handler"}) | |||
| private TBCity tbCity; | |||
| // jhipster-needle-entity-add-field - JHipster will add fields here, do not remove | |||
| public Long getId() { | |||
| return id; | |||
| } | |||
| public void setId(Long id) { | |||
| this.id = id; | |||
| } | |||
| public String getName() { | |||
| return name; | |||
| } | |||
| public TBDistrict name(String name) { | |||
| this.name = name; | |||
| return this; | |||
| } | |||
| public void setName(String name) { | |||
| this.name = name; | |||
| } | |||
| public TBCity getTbCity() { | |||
| return tbCity; | |||
| } | |||
| public TBDistrict tbCity(TBCity tBCity) { | |||
| this.tbCity = tBCity; | |||
| return this; | |||
| } | |||
| public void setTbCity(TBCity tBCity) { | |||
| this.tbCity = tBCity; | |||
| } | |||
| // jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove | |||
| @Override | |||
| public boolean equals(Object o) { | |||
| if (this == o) { | |||
| return true; | |||
| } | |||
| if (o == null || getClass() != o.getClass()) { | |||
| return false; | |||
| } | |||
| TBDistrict tBDistrict = (TBDistrict) o; | |||
| if (tBDistrict.getId() == null || getId() == null) { | |||
| return false; | |||
| } | |||
| return Objects.equals(getId(), tBDistrict.getId()); | |||
| } | |||
| @Override | |||
| public int hashCode() { | |||
| return Objects.hashCode(getId()); | |||
| } | |||
| @Override | |||
| public String toString() { | |||
| return "TBDistrict{" + | |||
| "id=" + getId() + | |||
| ", name='" + getName() + "'" + | |||
| "}"; | |||
| } | |||
| } | |||
| @@ -0,0 +1,324 @@ | |||
| package vn.azteam.tpf.domain; | |||
| import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | |||
| import org.hibernate.annotations.Cache; | |||
| import org.hibernate.annotations.CacheConcurrencyStrategy; | |||
| import javax.persistence.*; | |||
| import org.springframework.data.elasticsearch.annotations.Document; | |||
| import java.io.Serializable; | |||
| import java.time.Instant; | |||
| import java.util.Objects; | |||
| /** | |||
| * A TBEntity. | |||
| */ | |||
| @Entity | |||
| @Table(name = "tb_entity") | |||
| @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) | |||
| @Document(indexName = "smf_tbentity") | |||
| public class TBEntity implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| @Id | |||
| @GeneratedValue(strategy = GenerationType.IDENTITY) | |||
| private Long id; | |||
| @Column(name = "qr_code") | |||
| private String qrCode; | |||
| @Column(name = "name") | |||
| private String name; | |||
| @Column(name = "area_m_2") | |||
| private Double areaM2; | |||
| @Column(name = "jhi_level") | |||
| private Integer level; | |||
| @Column(name = "status") | |||
| private String status; | |||
| @Column(name = "created_date") | |||
| private Instant createdDate; | |||
| @Column(name = "modified_date") | |||
| private Instant modifiedDate; | |||
| @Column(name = "deleted_date") | |||
| private Instant deletedDate; | |||
| @ManyToOne | |||
| @JsonIgnoreProperties("") | |||
| @JoinColumn(name = "parent_id") | |||
| private TBEntity tbEntity; | |||
| @ManyToOne | |||
| @JoinColumn(name = "tb_entity_type_id") | |||
| private TBEntityType tbEntityType; | |||
| @ManyToOne | |||
| @JsonIgnoreProperties("") | |||
| private TBAddress tbAddress; | |||
| @ManyToOne(fetch=FetchType.LAZY) | |||
| @JsonIgnoreProperties("") | |||
| @JoinColumn(name = "created_by") | |||
| private TBDetailUser createdBy; | |||
| @ManyToOne(fetch=FetchType.LAZY) | |||
| @JsonIgnoreProperties("") | |||
| @JoinColumn(name = "modified_by") | |||
| private TBDetailUser modifiedBy; | |||
| @ManyToOne(fetch=FetchType.LAZY) | |||
| @JsonIgnoreProperties("") | |||
| @JoinColumn(name = "deleted_by") | |||
| private TBDetailUser deletedBy; | |||
| @ManyToOne | |||
| @JsonIgnoreProperties("") | |||
| private TBCustomer tbCustomer; | |||
| // jhipster-needle-entity-add-field - JHipster will add fields here, do not remove | |||
| public Long getId() { | |||
| return id; | |||
| } | |||
| public void setId(Long id) { | |||
| this.id = id; | |||
| } | |||
| public String getQrCode() { | |||
| return qrCode; | |||
| } | |||
| public TBEntity qrCode(String qrCode) { | |||
| this.qrCode = qrCode; | |||
| return this; | |||
| } | |||
| public void setQrCode(String qrCode) { | |||
| this.qrCode = qrCode; | |||
| } | |||
| public String getName() { | |||
| return name; | |||
| } | |||
| public TBEntity name(String name) { | |||
| this.name = name; | |||
| return this; | |||
| } | |||
| public void setName(String name) { | |||
| this.name = name; | |||
| } | |||
| public Double getAreaM2() { | |||
| return areaM2; | |||
| } | |||
| public TBEntity areaM2(Double areaM2) { | |||
| this.areaM2 = areaM2; | |||
| return this; | |||
| } | |||
| public void setAreaM2(Double areaM2) { | |||
| this.areaM2 = areaM2; | |||
| } | |||
| public Integer getLevel() { | |||
| return level; | |||
| } | |||
| public TBEntity level(Integer level) { | |||
| this.level = level; | |||
| return this; | |||
| } | |||
| public void setLevel(Integer level) { | |||
| this.level = level; | |||
| } | |||
| public String getStatus() { | |||
| return status; | |||
| } | |||
| public TBEntity status(String status) { | |||
| this.status = status; | |||
| return this; | |||
| } | |||
| public void setStatus(String status) { | |||
| this.status = status; | |||
| } | |||
| public Instant getCreatedDate() { | |||
| return createdDate; | |||
| } | |||
| public TBEntity createdDate(Instant createdDate) { | |||
| this.createdDate = createdDate; | |||
| return this; | |||
| } | |||
| public void setCreatedDate(Instant createdDate) { | |||
| this.createdDate = createdDate; | |||
| } | |||
| public Instant getModifiedDate() { | |||
| return modifiedDate; | |||
| } | |||
| public TBEntity modifiedDate(Instant modifiedDate) { | |||
| this.modifiedDate = modifiedDate; | |||
| return this; | |||
| } | |||
| public void setModifiedDate(Instant modifiedDate) { | |||
| this.modifiedDate = modifiedDate; | |||
| } | |||
| public Instant getDeletedDate() { | |||
| return deletedDate; | |||
| } | |||
| public TBEntity deletedDate(Instant deletedDate) { | |||
| this.deletedDate = deletedDate; | |||
| return this; | |||
| } | |||
| public void setDeletedDate(Instant deletedDate) { | |||
| this.deletedDate = deletedDate; | |||
| } | |||
| public TBEntity getTbEntity() { | |||
| return tbEntity; | |||
| } | |||
| public TBEntity tbEntity(TBEntity tBEntity) { | |||
| this.tbEntity = tBEntity; | |||
| return this; | |||
| } | |||
| public void setTbEntity(TBEntity tBEntity) { | |||
| this.tbEntity = tBEntity; | |||
| } | |||
| public TBAddress getTbAddress() { | |||
| return tbAddress; | |||
| } | |||
| public TBEntity tbAddress(TBAddress tBAddress) { | |||
| this.tbAddress = tBAddress; | |||
| return this; | |||
| } | |||
| public void setTbAddress(TBAddress tBAddress) { | |||
| this.tbAddress = tBAddress; | |||
| } | |||
| public TBDetailUser getCreatedBy() { | |||
| return createdBy; | |||
| } | |||
| public TBEntity createdBy(TBDetailUser tBDetailUser) { | |||
| this.createdBy = tBDetailUser; | |||
| return this; | |||
| } | |||
| public void setCreatedBy(TBDetailUser tBDetailUser) { | |||
| this.createdBy = tBDetailUser; | |||
| } | |||
| public TBDetailUser getModifiedBy() { | |||
| return modifiedBy; | |||
| } | |||
| public TBEntity modifiedBy(TBDetailUser tBDetailUser) { | |||
| this.modifiedBy = tBDetailUser; | |||
| return this; | |||
| } | |||
| public void setModifiedBy(TBDetailUser tBDetailUser) { | |||
| this.modifiedBy = tBDetailUser; | |||
| } | |||
| public TBDetailUser getDeletedBy() { | |||
| return deletedBy; | |||
| } | |||
| public TBEntity deletedBy(TBDetailUser tBDetailUser) { | |||
| this.deletedBy = tBDetailUser; | |||
| return this; | |||
| } | |||
| public void setDeletedBy(TBDetailUser tBDetailUser) { | |||
| this.deletedBy = tBDetailUser; | |||
| } | |||
| public TBCustomer getTbCustomer() { | |||
| return tbCustomer; | |||
| } | |||
| public TBEntity tbCustomer(TBCustomer tBCustomer) { | |||
| this.tbCustomer = tBCustomer; | |||
| return this; | |||
| } | |||
| public void setTbCustomer(TBCustomer tBCustomer) { | |||
| this.tbCustomer = tBCustomer; | |||
| } | |||
| public TBEntityType getTbEntityType() { | |||
| return tbEntityType; | |||
| } | |||
| public TBEntity tbEntityType(TBEntityType tbEntityType) { | |||
| this.tbEntityType = tbEntityType; | |||
| return this; | |||
| } | |||
| public void setTbEntityType(TBEntityType tbEntityType) { | |||
| this.tbEntityType = tbEntityType; | |||
| } | |||
| // jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove | |||
| @Override | |||
| public boolean equals(Object o) { | |||
| if (this == o) { | |||
| return true; | |||
| } | |||
| if (o == null || getClass() != o.getClass()) { | |||
| return false; | |||
| } | |||
| TBEntity tBEntity = (TBEntity) o; | |||
| if (tBEntity.getId() == null || getId() == null) { | |||
| return false; | |||
| } | |||
| return Objects.equals(getId(), tBEntity.getId()); | |||
| } | |||
| @Override | |||
| public int hashCode() { | |||
| return Objects.hashCode(getId()); | |||
| } | |||
| @Override | |||
| public String toString() { | |||
| return "TBEntity{" + | |||
| "id=" + getId() + | |||
| ", qrCode='" + getQrCode() + "'" + | |||
| ", name='" + getName() + "'" + | |||
| ", areaM2=" + getAreaM2() + | |||
| ", level=" + getLevel() + | |||
| ", status='" + getStatus() + "'" + | |||
| ", createdDate='" + getCreatedDate() + "'" + | |||
| ", modifiedDate='" + getModifiedDate() + "'" + | |||
| ", deletedDate='" + getDeletedDate() + "'" + | |||
| "}"; | |||
| } | |||
| } | |||
| @@ -0,0 +1,135 @@ | |||
| package vn.azteam.tpf.domain; | |||
| import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | |||
| import org.hibernate.annotations.Cache; | |||
| import org.hibernate.annotations.CacheConcurrencyStrategy; | |||
| import javax.persistence.*; | |||
| import org.springframework.data.elasticsearch.annotations.Document; | |||
| import java.io.Serializable; | |||
| import java.util.Objects; | |||
| /** | |||
| * A TBEntityLocationOfCustomer. | |||
| */ | |||
| @Entity | |||
| @Table(name = "tb_entity_location_of_customer") | |||
| @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) | |||
| @Document(indexName = "tbentitylocationofcustomer") | |||
| public class TBEntityLocationOfCustomer implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| @Id | |||
| @GeneratedValue(strategy = GenerationType.IDENTITY) | |||
| private Long id; | |||
| @Column(name = "pixel_x") | |||
| private Double pixelX; | |||
| @Column(name = "pixel_y") | |||
| private Double pixelY; | |||
| @ManyToOne | |||
| @JsonIgnoreProperties("") | |||
| private TBCustomer tbCustomer; | |||
| @ManyToOne | |||
| @JsonIgnoreProperties("") | |||
| private TBEntity tbEntity; | |||
| // jhipster-needle-entity-add-field - JHipster will add fields here, do not remove | |||
| public Long getId() { | |||
| return id; | |||
| } | |||
| public void setId(Long id) { | |||
| this.id = id; | |||
| } | |||
| public Double getPixelX() { | |||
| return pixelX; | |||
| } | |||
| public TBEntityLocationOfCustomer pixelX(Double pixelX) { | |||
| this.pixelX = pixelX; | |||
| return this; | |||
| } | |||
| public void setPixelX(Double pixelX) { | |||
| this.pixelX = pixelX; | |||
| } | |||
| public Double getPixelY() { | |||
| return pixelY; | |||
| } | |||
| public TBEntityLocationOfCustomer pixelY(Double pixelY) { | |||
| this.pixelY = pixelY; | |||
| return this; | |||
| } | |||
| public void setPixelY(Double pixelY) { | |||
| this.pixelY = pixelY; | |||
| } | |||
| public TBCustomer getTbCustomer() { | |||
| return tbCustomer; | |||
| } | |||
| public TBEntityLocationOfCustomer tbCustomer(TBCustomer tbCustomer) { | |||
| this.tbCustomer = tbCustomer; | |||
| return this; | |||
| } | |||
| public void setTbCustomer(TBCustomer tbCustomer) { | |||
| this.tbCustomer = tbCustomer; | |||
| } | |||
| public TBEntity getTbEntity() { | |||
| return tbEntity; | |||
| } | |||
| public TBEntityLocationOfCustomer tbEntity(TBEntity tbEntity) { | |||
| this.tbEntity = tbEntity; | |||
| return this; | |||
| } | |||
| public void setTbEntity(TBEntity tbEntity) { | |||
| this.tbEntity = tbEntity; | |||
| } | |||
| // jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove | |||
| @Override | |||
| public boolean equals(Object o) { | |||
| if (this == o) { | |||
| return true; | |||
| } | |||
| if (o == null || getClass() != o.getClass()) { | |||
| return false; | |||
| } | |||
| TBEntityLocationOfCustomer tBEntityLocationOfCustomer = (TBEntityLocationOfCustomer) o; | |||
| if (tBEntityLocationOfCustomer.getId() == null || getId() == null) { | |||
| return false; | |||
| } | |||
| return Objects.equals(getId(), tBEntityLocationOfCustomer.getId()); | |||
| } | |||
| @Override | |||
| public int hashCode() { | |||
| return Objects.hashCode(getId()); | |||
| } | |||
| @Override | |||
| public String toString() { | |||
| return "TBEntityLocationOfCustomer{" + | |||
| "id=" + getId() + | |||
| ", pixelX=" + getPixelX() + | |||
| ", pixelY=" + getPixelY() + | |||
| "}"; | |||
| } | |||
| } | |||
| @@ -0,0 +1,80 @@ | |||
| package vn.azteam.tpf.domain; | |||
| import org.hibernate.annotations.Cache; | |||
| import org.hibernate.annotations.CacheConcurrencyStrategy; | |||
| import javax.persistence.*; | |||
| import org.springframework.data.elasticsearch.annotations.Document; | |||
| import java.io.Serializable; | |||
| import java.util.Objects; | |||
| /** | |||
| * A TBEntityType. | |||
| */ | |||
| @Entity | |||
| @Table(name = "tb_entity_type") | |||
| @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) | |||
| @Document(indexName = "smf_tbentitytype") | |||
| public class TBEntityType implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| @Id | |||
| @GeneratedValue(strategy = GenerationType.IDENTITY) | |||
| private Long id; | |||
| @Column(name = "name") | |||
| private String name; | |||
| // jhipster-needle-entity-add-field - JHipster will add fields here, do not remove | |||
| public Long getId() { | |||
| return id; | |||
| } | |||
| public void setId(Long id) { | |||
| this.id = id; | |||
| } | |||
| public String getName() { | |||
| return name; | |||
| } | |||
| public TBEntityType name(String name) { | |||
| this.name = name; | |||
| return this; | |||
| } | |||
| public void setName(String name) { | |||
| this.name = name; | |||
| } | |||
| // jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove | |||
| @Override | |||
| public boolean equals(Object o) { | |||
| if (this == o) { | |||
| return true; | |||
| } | |||
| if (o == null || getClass() != o.getClass()) { | |||
| return false; | |||
| } | |||
| TBEntityType tBEntityType = (TBEntityType) o; | |||
| if (tBEntityType.getId() == null || getId() == null) { | |||
| return false; | |||
| } | |||
| return Objects.equals(getId(), tBEntityType.getId()); | |||
| } | |||
| @Override | |||
| public int hashCode() { | |||
| return Objects.hashCode(getId()); | |||
| } | |||
| @Override | |||
| public String toString() { | |||
| return "TBEntityType{" + | |||
| "id=" + getId() + | |||
| ", name='" + getName() + "'" + | |||
| "}"; | |||
| } | |||
| } | |||
| @@ -0,0 +1,149 @@ | |||
| package vn.azteam.tpf.domain; | |||
| import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | |||
| import org.hibernate.annotations.Cache; | |||
| import org.hibernate.annotations.CacheConcurrencyStrategy; | |||
| import javax.persistence.*; | |||
| import org.springframework.data.elasticsearch.annotations.Document; | |||
| import java.io.Serializable; | |||
| import java.util.Objects; | |||
| /** | |||
| * A TBEnvironmentUpdate. | |||
| */ | |||
| @Entity | |||
| @Table(name = "tb_environment_update") | |||
| @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) | |||
| @Document(indexName = "smf_tbenvironmentupdate") | |||
| public class TBEnvironmentUpdate implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| @Id | |||
| @GeneratedValue(strategy = GenerationType.IDENTITY) | |||
| private Long id; | |||
| @Column(name = "jhi_index") | |||
| private Double index; | |||
| @Column(name = "times") | |||
| private Integer times; | |||
| @ManyToOne | |||
| @JsonIgnoreProperties("") | |||
| private TBEnvironmentalParameter tbEnvironmentalParameter; | |||
| @ManyToOne | |||
| @JsonIgnoreProperties("") | |||
| private TBActivity tbActivity; | |||
| @ManyToOne | |||
| @JsonIgnoreProperties("") | |||
| private TBEquipmentOfCustomer tbEquipmentOfCustomer; | |||
| // jhipster-needle-entity-add-field - JHipster will add fields here, do not remove | |||
| public Long getId() { | |||
| return id; | |||
| } | |||
| public void setId(Long id) { | |||
| this.id = id; | |||
| } | |||
| public Double getIndex() { | |||
| return index; | |||
| } | |||
| public TBEnvironmentUpdate index(Double index) { | |||
| this.index = index; | |||
| return this; | |||
| } | |||
| public void setIndex(Double index) { | |||
| this.index = index; | |||
| } | |||
| public Integer getTimes() { | |||
| return times; | |||
| } | |||
| public TBEnvironmentUpdate times(Integer times) { | |||
| this.times = times; | |||
| return this; | |||
| } | |||
| public void setTimes(Integer times) { | |||
| this.times = times; | |||
| } | |||
| public TBEnvironmentalParameter getTbEnvironmentalParameter() { | |||
| return tbEnvironmentalParameter; | |||
| } | |||
| public void setTbEnvironmentalParameter(TBEnvironmentalParameter tbEnvironmentalParameter) { | |||
| this.tbEnvironmentalParameter = tbEnvironmentalParameter; | |||
| } | |||
| public TBEnvironmentUpdate tbEnvironmentalParameter(TBEnvironmentalParameter tbEnvironmentalParameter) { | |||
| this.tbEnvironmentalParameter = tbEnvironmentalParameter; | |||
| return this; | |||
| } | |||
| public TBActivity getTbActivity() { | |||
| return tbActivity; | |||
| } | |||
| public TBEnvironmentUpdate tbActivity(TBActivity tBActivity) { | |||
| this.tbActivity = tBActivity; | |||
| return this; | |||
| } | |||
| public void setTbActivity(TBActivity tBActivity) { | |||
| this.tbActivity = tBActivity; | |||
| } | |||
| public TBEquipmentOfCustomer getTbEquipmentOfCustomer() { | |||
| return tbEquipmentOfCustomer; | |||
| } | |||
| public TBEnvironmentUpdate tbActivity(TBEquipmentOfCustomer tbEquipmentOfCustomer) { | |||
| this.tbEquipmentOfCustomer = tbEquipmentOfCustomer; | |||
| return this; | |||
| } | |||
| public void setTbEquipmentOfCustomer(TBEquipmentOfCustomer tBEquipmentOfCustomer) { | |||
| this.tbEquipmentOfCustomer = tBEquipmentOfCustomer; | |||
| } | |||
| // jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove | |||
| @Override | |||
| public boolean equals(Object o) { | |||
| if (this == o) { | |||
| return true; | |||
| } | |||
| if (o == null || getClass() != o.getClass()) { | |||
| return false; | |||
| } | |||
| TBEnvironmentUpdate tBEnvironmentUpdate = (TBEnvironmentUpdate) o; | |||
| if (tBEnvironmentUpdate.getId() == null || getId() == null) { | |||
| return false; | |||
| } | |||
| return Objects.equals(getId(), tBEnvironmentUpdate.getId()); | |||
| } | |||
| @Override | |||
| public int hashCode() { | |||
| return Objects.hashCode(getId()); | |||
| } | |||
| @Override | |||
| public String toString() { | |||
| return "TBEnvironmentUpdate{" + | |||
| "id=" + getId() + | |||
| ", index=" + getIndex() + | |||
| ", times=" + getTimes() + | |||
| "}"; | |||
| } | |||
| } | |||
| @@ -0,0 +1,255 @@ | |||
| package vn.azteam.tpf.domain; | |||
| import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | |||
| import org.hibernate.annotations.Cache; | |||
| import org.hibernate.annotations.CacheConcurrencyStrategy; | |||
| import javax.persistence.*; | |||
| import org.springframework.data.elasticsearch.annotations.Document; | |||
| import java.io.Serializable; | |||
| import java.time.Instant; | |||
| import java.util.Objects; | |||
| /** | |||
| * A TBEnvironmentalParameter. | |||
| */ | |||
| @Entity | |||
| @Table(name = "tb_environmental_parameter") | |||
| @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) | |||
| @Document(indexName = "smf_tbenvironmentalparameter") | |||
| public class TBEnvironmentalParameter implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| @Id | |||
| @GeneratedValue(strategy = GenerationType.IDENTITY) | |||
| private Long id; | |||
| @Column(name = "jhi_key") | |||
| private String key; | |||
| @Column(name = "name") | |||
| private String name; | |||
| @Column(name = "unit") | |||
| private String unit; | |||
| @Column(name = "description") | |||
| private String description; | |||
| @Column(name = "created_date") | |||
| private Instant createdDate; | |||
| @Column(name = "modified_date") | |||
| private Instant modifiedDate; | |||
| @Column(name = "deleted_date") | |||
| private Instant deletedDate; | |||
| @ManyToOne(fetch=FetchType.LAZY) | |||
| @JsonIgnoreProperties("") | |||
| @JoinColumn(name = "created_by") | |||
| private TBDetailUser createdBy; | |||
| @ManyToOne(fetch=FetchType.LAZY) | |||
| @JsonIgnoreProperties("") | |||
| @JoinColumn(name = "modified_by") | |||
| private TBDetailUser modifiedBy; | |||
| @ManyToOne(fetch=FetchType.LAZY) | |||
| @JsonIgnoreProperties("") | |||
| @JoinColumn(name = "deleted_by") | |||
| private TBDetailUser deletedBy; | |||
| @ManyToOne | |||
| @JsonIgnoreProperties("") | |||
| private TBCustomer tbCustomer; | |||
| // jhipster-needle-entity-add-field - JHipster will add fields here, do not remove | |||
| public Long getId() { | |||
| return id; | |||
| } | |||
| public void setId(Long id) { | |||
| this.id = id; | |||
| } | |||
| public String getKey() { | |||
| return key; | |||
| } | |||
| public TBEnvironmentalParameter key(String key) { | |||
| this.key = key; | |||
| return this; | |||
| } | |||
| public void setKey(String key) { | |||
| this.key = key; | |||
| } | |||
| public String getName() { | |||
| return name; | |||
| } | |||
| public TBEnvironmentalParameter name(String name) { | |||
| this.name = name; | |||
| return this; | |||
| } | |||
| public void setName(String name) { | |||
| this.name = name; | |||
| } | |||
| public String getUnit() { | |||
| return unit; | |||
| } | |||
| public TBEnvironmentalParameter unit(String unit) { | |||
| this.unit = unit; | |||
| return this; | |||
| } | |||
| public void setUnit(String unit) { | |||
| this.unit = unit; | |||
| } | |||
| public String getDescription() { | |||
| return description; | |||
| } | |||
| public TBEnvironmentalParameter description(String description) { | |||
| this.description = description; | |||
| return this; | |||
| } | |||
| public void setDescription(String description) { | |||
| this.description = description; | |||
| } | |||
| public Instant getCreatedDate() { | |||
| return createdDate; | |||
| } | |||
| public TBEnvironmentalParameter createdDate(Instant createdDate) { | |||
| this.createdDate = createdDate; | |||
| return this; | |||
| } | |||
| public void setCreatedDate(Instant createdDate) { | |||
| this.createdDate = createdDate; | |||
| } | |||
| public Instant getModifiedDate() { | |||
| return modifiedDate; | |||
| } | |||
| public TBEnvironmentalParameter modifiedDate(Instant modifiedDate) { | |||
| this.modifiedDate = modifiedDate; | |||
| return this; | |||
| } | |||
| public void setModifiedDate(Instant modifiedDate) { | |||
| this.modifiedDate = modifiedDate; | |||
| } | |||
| public Instant getDeletedDate() { | |||
| return deletedDate; | |||
| } | |||
| public TBEnvironmentalParameter deletedDate(Instant deletedDate) { | |||
| this.deletedDate = deletedDate; | |||
| return this; | |||
| } | |||
| public void setDeletedDate(Instant deletedDate) { | |||
| this.deletedDate = deletedDate; | |||
| } | |||
| public TBDetailUser getDeletedBy() { | |||
| return deletedBy; | |||
| } | |||
| public TBEnvironmentalParameter deletedBy(TBDetailUser tBDetailUser) { | |||
| this.deletedBy = tBDetailUser; | |||
| return this; | |||
| } | |||
| public void setDeletedBy(TBDetailUser tBDetailUser) { | |||
| this.deletedBy = tBDetailUser; | |||
| } | |||
| public TBDetailUser getCreatedBy() { | |||
| return createdBy; | |||
| } | |||
| public TBEnvironmentalParameter createdBy(TBDetailUser tBDetailUser) { | |||
| this.createdBy = tBDetailUser; | |||
| return this; | |||
| } | |||
| public void setCreatedBy(TBDetailUser tBDetailUser) { | |||
| this.createdBy = tBDetailUser; | |||
| } | |||
| public TBDetailUser getModifiedBy() { | |||
| return modifiedBy; | |||
| } | |||
| public TBEnvironmentalParameter modifiedBy(TBDetailUser tBDetailUser) { | |||
| this.modifiedBy = tBDetailUser; | |||
| return this; | |||
| } | |||
| public void setModifiedBy(TBDetailUser tBDetailUser) { | |||
| this.modifiedBy = tBDetailUser; | |||
| } | |||
| public TBCustomer getTbCustomer() { | |||
| return tbCustomer; | |||
| } | |||
| public TBEnvironmentalParameter tbCustomer(TBCustomer tBCustomer) { | |||
| this.tbCustomer = tBCustomer; | |||
| return this; | |||
| } | |||
| public void setTbCustomer(TBCustomer tBCustomer) { | |||
| this.tbCustomer = tBCustomer; | |||
| } | |||
| // jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove | |||
| @Override | |||
| public boolean equals(Object o) { | |||
| if (this == o) { | |||
| return true; | |||
| } | |||
| if (o == null || getClass() != o.getClass()) { | |||
| return false; | |||
| } | |||
| TBEnvironmentalParameter tBEnvironmentalParameter = (TBEnvironmentalParameter) o; | |||
| if (tBEnvironmentalParameter.getId() == null || getId() == null) { | |||
| return false; | |||
| } | |||
| return Objects.equals(getId(), tBEnvironmentalParameter.getId()); | |||
| } | |||
| @Override | |||
| public int hashCode() { | |||
| return Objects.hashCode(getId()); | |||
| } | |||
| @Override | |||
| public String toString() { | |||
| return "TBEnvironmentalParameter{" + | |||
| "id=" + getId() + | |||
| ", key='" + getKey() + "'" + | |||
| ", name='" + getName() + "'" + | |||
| ", unit='" + getUnit() + "'" + | |||
| ", description='" + getDescription() + "'" + | |||
| ", createdDate='" + getCreatedDate() + "'" + | |||
| ", modifiedDate='" + getModifiedDate() + "'" + | |||
| ", deletedDate='" + getDeletedDate() + "'" + | |||
| "}"; | |||
| } | |||
| } | |||
| @@ -0,0 +1,273 @@ | |||
| package vn.azteam.tpf.domain; | |||
| import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | |||
| import org.hibernate.annotations.Cache; | |||
| import org.hibernate.annotations.CacheConcurrencyStrategy; | |||
| import javax.persistence.*; | |||
| import org.hibernate.annotations.Type; | |||
| import org.springframework.data.elasticsearch.annotations.Document; | |||
| import java.io.Serializable; | |||
| import java.time.Instant; | |||
| import java.util.Objects; | |||
| /** | |||
| * A TBEquipment. | |||
| */ | |||
| @Entity | |||
| @Table(name = "tb_equipment") | |||
| @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) | |||
| @Document(indexName = "smf_tbequipment") | |||
| public class TBEquipment implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| @Id | |||
| @GeneratedValue(strategy = GenerationType.IDENTITY) | |||
| private Long id; | |||
| @Column(name = "sku") | |||
| private String sku; | |||
| @Column(name = "name") | |||
| private String name; | |||
| @Column(name = "manufacturer") | |||
| private String manufacturer; | |||
| @Column(name = "specs") | |||
| private String specs; | |||
| @Column(name = "created_date") | |||
| private Instant createdDate; | |||
| @Column(name = "modified_date") | |||
| private Instant modifiedDate; | |||
| @Column(name = "deleted_date") | |||
| private Instant deletedDate; | |||
| @ManyToOne | |||
| @JsonIgnoreProperties("") | |||
| private TBEquipmentType tbEquipmentType; | |||
| @ManyToOne(fetch=FetchType.LAZY) | |||
| @JsonIgnoreProperties("") | |||
| @JoinColumn(name = "created_by") | |||
| private TBDetailUser createdBy; | |||
| @ManyToOne(fetch=FetchType.LAZY) | |||
| @JsonIgnoreProperties("") | |||
| @JoinColumn(name = "modified_by") | |||
| private TBDetailUser modifiedBy; | |||
| @ManyToOne(fetch=FetchType.LAZY) | |||
| @JsonIgnoreProperties("") | |||
| @JoinColumn(name = "deleted_by") | |||
| private TBDetailUser deletedBy; | |||
| @ManyToOne | |||
| @JsonIgnoreProperties("") | |||
| private TBCustomer tbCustomer; | |||
| // jhipster-needle-entity-add-field - JHipster will add fields here, do not remove | |||
| public Long getId() { | |||
| return id; | |||
| } | |||
| public void setId(Long id) { | |||
| this.id = id; | |||
| } | |||
| public String getSku() { | |||
| return sku; | |||
| } | |||
| public TBEquipment sku(String sku) { | |||
| this.sku = sku; | |||
| return this; | |||
| } | |||
| public void setSku(String sku) { | |||
| this.sku = sku; | |||
| } | |||
| public String getName() { | |||
| return name; | |||
| } | |||
| public TBEquipment name(String name) { | |||
| this.name = name; | |||
| return this; | |||
| } | |||
| public void setName(String name) { | |||
| this.name = name; | |||
| } | |||
| public String getManufacturer() { | |||
| return manufacturer; | |||
| } | |||
| public TBEquipment manufacturer(String manufacturer) { | |||
| this.manufacturer = manufacturer; | |||
| return this; | |||
| } | |||
| public void setManufacturer(String manufacturer) { | |||
| this.manufacturer = manufacturer; | |||
| } | |||
| public String getSpecs() { | |||
| return specs; | |||
| } | |||
| public TBEquipment specs(String specs) { | |||
| this.specs = specs; | |||
| return this; | |||
| } | |||
| public void setSpecs(String specs) { | |||
| this.specs = specs; | |||
| } | |||
| public Instant getCreatedDate() { | |||
| return createdDate; | |||
| } | |||
| public TBEquipment createdDate(Instant createdDate) { | |||
| this.createdDate = createdDate; | |||
| return this; | |||
| } | |||
| public void setCreatedDate(Instant createdDate) { | |||
| this.createdDate = createdDate; | |||
| } | |||
| public Instant getModifiedDate() { | |||
| return modifiedDate; | |||
| } | |||
| public TBEquipment modifiedDate(Instant modifiedDate) { | |||
| this.modifiedDate = modifiedDate; | |||
| return this; | |||
| } | |||
| public void setModifiedDate(Instant modifiedDate) { | |||
| this.modifiedDate = modifiedDate; | |||
| } | |||
| public Instant getDeletedDate() { | |||
| return deletedDate; | |||
| } | |||
| public TBEquipment deletedDate(Instant deletedDate) { | |||
| this.deletedDate = deletedDate; | |||
| return this; | |||
| } | |||
| public void setDeletedDate(Instant deletedDate) { | |||
| this.deletedDate = deletedDate; | |||
| } | |||
| public TBEquipmentType getTbEquipmentType() { | |||
| return tbEquipmentType; | |||
| } | |||
| public TBEquipment tbEquipmentType(TBEquipmentType tBEquipmentType) { | |||
| this.tbEquipmentType = tBEquipmentType; | |||
| return this; | |||
| } | |||
| public void setTbEquipmentType(TBEquipmentType tBEquipmentType) { | |||
| this.tbEquipmentType = tBEquipmentType; | |||
| } | |||
| public TBDetailUser getCreatedBy() { | |||
| return createdBy; | |||
| } | |||
| public TBEquipment createdBy(TBDetailUser tBDetailUser) { | |||
| this.createdBy = tBDetailUser; | |||
| return this; | |||
| } | |||
| public void setCreatedBy(TBDetailUser tBDetailUser) { | |||
| this.createdBy = tBDetailUser; | |||
| } | |||
| public TBDetailUser getModifiedBy() { | |||
| return modifiedBy; | |||
| } | |||
| public TBEquipment modifiedBy(TBDetailUser tBDetailUser) { | |||
| this.modifiedBy = tBDetailUser; | |||
| return this; | |||
| } | |||
| public void setModifiedBy(TBDetailUser tBDetailUser) { | |||
| this.modifiedBy = tBDetailUser; | |||
| } | |||
| public TBDetailUser getDeletedBy() { | |||
| return deletedBy; | |||
| } | |||
| public TBEquipment deletedBy(TBDetailUser tBDetailUser) { | |||
| this.deletedBy = tBDetailUser; | |||
| return this; | |||
| } | |||
| public void setDeletedBy(TBDetailUser tBDetailUser) { | |||
| this.deletedBy = tBDetailUser; | |||
| } | |||
| public TBCustomer getTbCustomer() { | |||
| return tbCustomer; | |||
| } | |||
| public TBEquipment tbCustomer(TBCustomer tBCustomer) { | |||
| this.tbCustomer = tBCustomer; | |||
| return this; | |||
| } | |||
| public void setTbCustomer(TBCustomer tBCustomer) { | |||
| this.tbCustomer = tBCustomer; | |||
| } | |||
| // jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove | |||
| @Override | |||
| public boolean equals(Object o) { | |||
| if (this == o) { | |||
| return true; | |||
| } | |||
| if (o == null || getClass() != o.getClass()) { | |||
| return false; | |||
| } | |||
| TBEquipment tBEquipment = (TBEquipment) o; | |||
| if (tBEquipment.getId() == null || getId() == null) { | |||
| return false; | |||
| } | |||
| return Objects.equals(getId(), tBEquipment.getId()); | |||
| } | |||
| @Override | |||
| public int hashCode() { | |||
| return Objects.hashCode(getId()); | |||
| } | |||
| @Override | |||
| public String toString() { | |||
| return "TBEquipment{" + | |||
| "id=" + getId() + | |||
| ", sku='" + getSku() + "'" + | |||
| ", name='" + getName() + "'" + | |||
| ", manufacturer='" + getManufacturer() + "'" + | |||
| ", specs='" + getSpecs() + "'" + | |||
| ", createdDate='" + getCreatedDate() + "'" + | |||
| ", modifiedDate='" + getModifiedDate() + "'" + | |||
| ", deletedDate='" + getDeletedDate() + "'" + | |||
| "}"; | |||
| } | |||
| } | |||
| @@ -0,0 +1,168 @@ | |||
| package vn.azteam.tpf.domain; | |||
| import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | |||
| import org.hibernate.annotations.Cache; | |||
| import org.hibernate.annotations.CacheConcurrencyStrategy; | |||
| import javax.persistence.*; | |||
| import org.springframework.data.elasticsearch.annotations.Document; | |||
| import java.io.Serializable; | |||
| import java.time.Instant; | |||
| import java.util.Objects; | |||
| /** | |||
| * A TBEquipmentHistory. | |||
| */ | |||
| @Entity | |||
| @Table(name = "tb_equipment_history") | |||
| @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) | |||
| @Document(indexName = "smf_tbequipmenthistory") | |||
| public class TBEquipmentHistory implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| @Id | |||
| @GeneratedValue(strategy = GenerationType.IDENTITY) | |||
| private Long id; | |||
| @Column(name = "event") | |||
| private String event; | |||
| @Column(name = "date_occurred") | |||
| private Instant dateOccurred; | |||
| @Column(name = "status") | |||
| private Integer status; | |||
| @ManyToOne | |||
| @JsonIgnoreProperties("") | |||
| private TBCommand tbCommand; | |||
| @ManyToOne(fetch=FetchType.LAZY) | |||
| @JsonIgnoreProperties("") | |||
| @JoinColumn(name = "user_id") | |||
| private TBDetailUser tbDetailUser; | |||
| @ManyToOne | |||
| @JsonIgnoreProperties("") | |||
| private TBEquipmentOfCustomer tbEquipmentOfCustomer; | |||
| // jhipster-needle-entity-add-field - JHipster will add fields here, do not remove | |||
| public Long getId() { | |||
| return id; | |||
| } | |||
| public void setId(Long id) { | |||
| this.id = id; | |||
| } | |||
| public String getEvent() { | |||
| return event; | |||
| } | |||
| public TBEquipmentHistory event(String event) { | |||
| this.event = event; | |||
| return this; | |||
| } | |||
| public void setEvent(String event) { | |||
| this.event = event; | |||
| } | |||
| public Instant getDateOccurred() { | |||
| return dateOccurred; | |||
| } | |||
| public TBEquipmentHistory dateOccurred(Instant dateOccurred) { | |||
| this.dateOccurred = dateOccurred; | |||
| return this; | |||
| } | |||
| public void setDateOccurred(Instant dateOccurred) { | |||
| this.dateOccurred = dateOccurred; | |||
| } | |||
| public Integer getStatus() { | |||
| return status; | |||
| } | |||
| public TBEquipmentHistory status(Integer status) { | |||
| this.status = status; | |||
| return this; | |||
| } | |||
| public void setStatus(Integer status) { | |||
| this.status = status; | |||
| } | |||
| public TBCommand getTbCommand() { | |||
| return tbCommand; | |||
| } | |||
| public TBEquipmentHistory tbCommand(TBCommand tBCommand) { | |||
| this.tbCommand = tBCommand; | |||
| return this; | |||
| } | |||
| public void setTbCommand(TBCommand tBCommand) { | |||
| this.tbCommand = tBCommand; | |||
| } | |||
| public TBDetailUser gettbDetailUser() { | |||
| return tbDetailUser; | |||
| } | |||
| public TBEquipmentHistory tbDetailUser(TBDetailUser tbDetailUser) { | |||
| this.tbDetailUser = tbDetailUser; | |||
| return this; | |||
| } | |||
| public void settbDetailUser(TBDetailUser tbDetailUser) { | |||
| this.tbDetailUser = tbDetailUser; | |||
| } | |||
| public TBEquipmentOfCustomer getTbEquipmentOfCustomer() { | |||
| return tbEquipmentOfCustomer; | |||
| } | |||
| public TBEquipmentHistory tbEquipmentOfCustomer(TBEquipmentOfCustomer tBEquipmentOfCustomer) { | |||
| this.tbEquipmentOfCustomer = tBEquipmentOfCustomer; | |||
| return this; | |||
| } | |||
| public void setTbEquipmentOfCustomer(TBEquipmentOfCustomer tBEquipmentOfCustomer) { | |||
| this.tbEquipmentOfCustomer = tBEquipmentOfCustomer; | |||
| } | |||
| // jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove | |||
| @Override | |||
| public boolean equals(Object o) { | |||
| if (this == o) { | |||
| return true; | |||
| } | |||
| if (o == null || getClass() != o.getClass()) { | |||
| return false; | |||
| } | |||
| TBEquipmentHistory tBEquipmentHistory = (TBEquipmentHistory) o; | |||
| if (tBEquipmentHistory.getId() == null || getId() == null) { | |||
| return false; | |||
| } | |||
| return Objects.equals(getId(), tBEquipmentHistory.getId()); | |||
| } | |||
| @Override | |||
| public int hashCode() { | |||
| return Objects.hashCode(getId()); | |||
| } | |||
| @Override | |||
| public String toString() { | |||
| return "TBEquipmentHistory{" + | |||
| "id=" + getId() + | |||
| ", event='" + getEvent() + "'" + | |||
| ", dateOccurred='" + getDateOccurred() + "'" + | |||
| ", status='" + getStatus() + "'" + | |||
| "}"; | |||
| } | |||
| } | |||
| @@ -0,0 +1,300 @@ | |||
| package vn.azteam.tpf.domain; | |||
| import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | |||
| import org.hibernate.annotations.Cache; | |||
| import org.hibernate.annotations.CacheConcurrencyStrategy; | |||
| import javax.persistence.*; | |||
| import org.springframework.data.elasticsearch.annotations.Document; | |||
| import java.io.Serializable; | |||
| import java.time.Instant; | |||
| import java.util.Objects; | |||
| /** | |||
| * A TBEquipmentOfCustomer. | |||
| */ | |||
| @Entity | |||
| @Table(name = "tb_equipment_of_customer") | |||
| @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) | |||
| @Document(indexName = "smf_tbequipmentofcustomer") | |||
| public class TBEquipmentOfCustomer implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| @Id | |||
| @GeneratedValue(strategy = GenerationType.IDENTITY) | |||
| private Long id; | |||
| @Column(name = "qr_code") | |||
| private String qrCode; | |||
| @Column(name = "name") | |||
| private String name; | |||
| @Column(name = "status") | |||
| private String status; | |||
| @Column(name = "jhi_mode") | |||
| private Integer mode; | |||
| @Column(name = "serial") | |||
| private String serial; | |||
| @Column(name = "created_date") | |||
| private Instant createdDate; | |||
| @Column(name = "modified_date") | |||
| private Instant modifiedDate; | |||
| @Column(name = "deleted_date") | |||
| private Instant deletedDate; | |||
| @ManyToOne | |||
| @JsonIgnoreProperties("") | |||
| private TBEquipment tbEquipment; | |||
| @ManyToOne | |||
| @JsonIgnoreProperties("") | |||
| private TBCustomer tbCustomer; | |||
| @ManyToOne | |||
| @JsonIgnoreProperties("") | |||
| private TBEntity tbEntity; | |||
| @ManyToOne(fetch=FetchType.LAZY) | |||
| @JsonIgnoreProperties("") | |||
| @JoinColumn(name = "created_by") | |||
| private TBDetailUser createdBy; | |||
| @ManyToOne(fetch=FetchType.LAZY) | |||
| @JsonIgnoreProperties("") | |||
| @JoinColumn(name = "modified_by") | |||
| private TBDetailUser modifiedBy; | |||
| @ManyToOne(fetch=FetchType.LAZY) | |||
| @JsonIgnoreProperties("") | |||
| @JoinColumn(name = "deleted_by") | |||
| private TBDetailUser deletedBy; | |||
| // jhipster-needle-entity-add-field - JHipster will add fields here, do not remove | |||
| public Long getId() { | |||
| return id; | |||
| } | |||
| public void setId(Long id) { | |||
| this.id = id; | |||
| } | |||
| public String getQrCode() { | |||
| return qrCode; | |||
| } | |||
| public TBEquipmentOfCustomer qrCode(String qrCode) { | |||
| this.qrCode = qrCode; | |||
| return this; | |||
| } | |||
| public void setQrCode(String qrCode) { | |||
| this.qrCode = qrCode; | |||
| } | |||
| public String getName() { | |||
| return name; | |||
| } | |||
| public TBEquipmentOfCustomer name(String name) { | |||
| this.name = name; | |||
| return this; | |||
| } | |||
| public void setName(String name) { | |||
| this.name = name; | |||
| } | |||
| public String getStatus() { | |||
| return status; | |||
| } | |||
| public TBEquipmentOfCustomer status(String status) { | |||
| this.status = status; | |||
| return this; | |||
| } | |||
| public void setStatus(String status) { | |||
| this.status = status; | |||
| } | |||
| public Integer getMode() { | |||
| return mode; | |||
| } | |||
| public TBEquipmentOfCustomer mode(Integer mode) { | |||
| this.mode = mode; | |||
| return this; | |||
| } | |||
| public void setMode(Integer mode) { | |||
| this.mode = mode; | |||
| } | |||
| public String getSerial() { | |||
| return serial; | |||
| } | |||
| public void setSerial(String serial) { | |||
| this.serial = serial; | |||
| } | |||
| public Instant getCreatedDate() { | |||
| return createdDate; | |||
| } | |||
| public TBEquipmentOfCustomer createdDate(Instant createdDate) { | |||
| this.createdDate = createdDate; | |||
| return this; | |||
| } | |||
| public void setCreatedDate(Instant createdDate) { | |||
| this.createdDate = createdDate; | |||
| } | |||
| public Instant getModifiedDate() { | |||
| return modifiedDate; | |||
| } | |||
| public TBEquipmentOfCustomer modifiedDate(Instant modifiedDate) { | |||
| this.modifiedDate = modifiedDate; | |||
| return this; | |||
| } | |||
| public void setModifiedDate(Instant modifiedDate) { | |||
| this.modifiedDate = modifiedDate; | |||
| } | |||
| public Instant getDeletedDate() { | |||
| return deletedDate; | |||
| } | |||
| public TBEquipmentOfCustomer deletedDate(Instant deletedDate) { | |||
| this.deletedDate = deletedDate; | |||
| return this; | |||
| } | |||
| public void setDeletedDate(Instant deletedDate) { | |||
| this.deletedDate = deletedDate; | |||
| } | |||
| public TBEquipment getTbEquipment() { | |||
| return tbEquipment; | |||
| } | |||
| public TBEquipmentOfCustomer tbEquipment(TBEquipment tBEquipment) { | |||
| this.tbEquipment = tBEquipment; | |||
| return this; | |||
| } | |||
| public void setTbEquipment(TBEquipment tBEquipment) { | |||
| this.tbEquipment = tBEquipment; | |||
| } | |||
| public TBCustomer getTbCustomer() { | |||
| return tbCustomer; | |||
| } | |||
| public TBEquipmentOfCustomer tbCustomer(TBCustomer tBCustomer) { | |||
| this.tbCustomer = tBCustomer; | |||
| return this; | |||
| } | |||
| public void setTbCustomer(TBCustomer tBCustomer) { | |||
| this.tbCustomer = tBCustomer; | |||
| } | |||
| public TBEntity getTbEntity() { | |||
| return tbEntity; | |||
| } | |||
| public TBEquipmentOfCustomer tbEntity(TBEntity tBEntity) { | |||
| this.tbEntity = tBEntity; | |||
| return this; | |||
| } | |||
| public void setTbEntity(TBEntity tBEntity) { | |||
| this.tbEntity = tBEntity; | |||
| } | |||
| public TBDetailUser getCreatedBy() { | |||
| return createdBy; | |||
| } | |||
| public TBEquipmentOfCustomer createdBy(TBDetailUser tBDetailUser) { | |||
| this.createdBy = tBDetailUser; | |||
| return this; | |||
| } | |||
| public void setCreatedBy(TBDetailUser tBDetailUser) { | |||
| this.createdBy = tBDetailUser; | |||
| } | |||
| public TBDetailUser getModifiedBy() { | |||
| return modifiedBy; | |||
| } | |||
| public TBEquipmentOfCustomer modifiedBy(TBDetailUser tBDetailUser) { | |||
| this.modifiedBy = tBDetailUser; | |||
| return this; | |||
| } | |||
| public void setModifiedBy(TBDetailUser tBDetailUser) { | |||
| this.modifiedBy = tBDetailUser; | |||
| } | |||
| public TBDetailUser getDeletedBy() { | |||
| return deletedBy; | |||
| } | |||
| public TBEquipmentOfCustomer deletedBy(TBDetailUser tBDetailUser) { | |||
| this.deletedBy = tBDetailUser; | |||
| return this; | |||
| } | |||
| public void setDeletedBy(TBDetailUser tBDetailUser) { | |||
| this.deletedBy = tBDetailUser; | |||
| } | |||
| // jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove | |||
| @Override | |||
| public boolean equals(Object o) { | |||
| if (this == o) { | |||
| return true; | |||
| } | |||
| if (o == null || getClass() != o.getClass()) { | |||
| return false; | |||
| } | |||
| TBEquipmentOfCustomer tBEquipmentOfCustomer = (TBEquipmentOfCustomer) o; | |||
| if (tBEquipmentOfCustomer.getId() == null || getId() == null) { | |||
| return false; | |||
| } | |||
| return Objects.equals(getId(), tBEquipmentOfCustomer.getId()); | |||
| } | |||
| @Override | |||
| public int hashCode() { | |||
| return Objects.hashCode(getId()); | |||
| } | |||
| @Override | |||
| public String toString() { | |||
| return "TBEquipmentOfCustomer{" + | |||
| "id=" + getId() + | |||
| ", qrCode='" + getQrCode() + "'" + | |||
| ", name='" + getName() + "'" + | |||
| ", status='" + getStatus() + "'" + | |||
| ", mode=" + getMode() + | |||
| ", createdDate='" + getCreatedDate() + "'" + | |||
| ", modifiedDate='" + getModifiedDate() + "'" + | |||
| ", deletedDate='" + getDeletedDate() + "'" + | |||
| "}"; | |||
| } | |||
| } | |||
| @@ -0,0 +1,97 @@ | |||
| package vn.azteam.tpf.domain; | |||
| import org.hibernate.annotations.Cache; | |||
| import org.hibernate.annotations.CacheConcurrencyStrategy; | |||
| import javax.persistence.*; | |||
| import org.springframework.data.elasticsearch.annotations.Document; | |||
| import java.io.Serializable; | |||
| import java.util.Objects; | |||
| /** | |||
| * A TBEquipmentType. | |||
| */ | |||
| @Entity | |||
| @Table(name = "tb_equipment_type") | |||
| @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) | |||
| @Document(indexName = "smf_tbequipmenttype") | |||
| public class TBEquipmentType implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| @Id | |||
| @GeneratedValue(strategy = GenerationType.IDENTITY) | |||
| private Long id; | |||
| @Column(name = "name") | |||
| private String name; | |||
| @Column(name = "description") | |||
| private String description; | |||
| // jhipster-needle-entity-add-field - JHipster will add fields here, do not remove | |||
| public Long getId() { | |||
| return id; | |||
| } | |||
| public void setId(Long id) { | |||
| this.id = id; | |||
| } | |||
| public String getName() { | |||
| return name; | |||
| } | |||
| public TBEquipmentType name(String name) { | |||
| this.name = name; | |||
| return this; | |||
| } | |||
| public void setName(String name) { | |||
| this.name = name; | |||
| } | |||
| public String getDescription() { | |||
| return description; | |||
| } | |||
| public TBEquipmentType description(String description) { | |||
| this.description = description; | |||
| return this; | |||
| } | |||
| public void setDescription(String description) { | |||
| this.description = description; | |||
| } | |||
| // jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove | |||
| @Override | |||
| public boolean equals(Object o) { | |||
| if (this == o) { | |||
| return true; | |||
| } | |||
| if (o == null || getClass() != o.getClass()) { | |||
| return false; | |||
| } | |||
| TBEquipmentType tBEquipmentType = (TBEquipmentType) o; | |||
| if (tBEquipmentType.getId() == null || getId() == null) { | |||
| return false; | |||
| } | |||
| return Objects.equals(getId(), tBEquipmentType.getId()); | |||
| } | |||
| @Override | |||
| public int hashCode() { | |||
| return Objects.hashCode(getId()); | |||
| } | |||
| @Override | |||
| public String toString() { | |||
| return "TBEquipmentType{" + | |||
| "id=" + getId() + | |||
| ", name='" + getName() + "'" + | |||
| ", description='" + getDescription() + "'" + | |||
| "}"; | |||
| } | |||
| } | |||
| @@ -0,0 +1,146 @@ | |||
| package vn.azteam.tpf.domain; | |||
| import org.hibernate.annotations.Cache; | |||
| import org.hibernate.annotations.CacheConcurrencyStrategy; | |||
| import javax.persistence.*; | |||
| import org.springframework.data.elasticsearch.annotations.Document; | |||
| import java.io.Serializable; | |||
| import java.util.Objects; | |||
| /** | |||
| * A TBExternalTable. | |||
| */ | |||
| @Entity | |||
| @Table(name = "tb_external_table") | |||
| @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) | |||
| @Document(indexName = "smf_tbexternaltable") | |||
| public class TBExternalTable implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| @Id | |||
| @GeneratedValue(strategy = GenerationType.IDENTITY) | |||
| private Long id; | |||
| @Column(name = "name") | |||
| private String name; | |||
| @Column(name = "description") | |||
| private String description; | |||
| @Column(name = "object_type") | |||
| private Integer objectType; | |||
| @Column(name = "foreign_key") | |||
| private String foreignKey; | |||
| @Column(name = "relation_table") | |||
| private String relationTable; | |||
| // jhipster-needle-entity-add-field - JHipster will add fields here, do not remove | |||
| public Long getId() { | |||
| return id; | |||
| } | |||
| public void setId(Long id) { | |||
| this.id = id; | |||
| } | |||
| public String getName() { | |||
| return name; | |||
| } | |||
| public TBExternalTable name(String name) { | |||
| this.name = name; | |||
| return this; | |||
| } | |||
| public void setName(String name) { | |||
| this.name = name; | |||
| } | |||
| public String getDescription() { | |||
| return description; | |||
| } | |||
| public TBExternalTable description(String description) { | |||
| this.description = description; | |||
| return this; | |||
| } | |||
| public void setDescription(String description) { | |||
| this.description = description; | |||
| } | |||
| public String getRelationTable() { | |||
| return relationTable; | |||
| } | |||
| public TBExternalTable relationTable(String relationTable) { | |||
| this.relationTable = relationTable; | |||
| return this; | |||
| } | |||
| public void setRelationTable(String relationTable) { | |||
| this.relationTable = relationTable; | |||
| } | |||
| public String getForeignKey() { | |||
| return foreignKey; | |||
| } | |||
| public TBExternalTable foreignKey(String foreignKey) { | |||
| this.foreignKey = foreignKey; | |||
| return this; | |||
| } | |||
| public void setForeignKey(String foreignKey) { | |||
| this.foreignKey = foreignKey; | |||
| } | |||
| public Integer getObjectType() { | |||
| return objectType; | |||
| } | |||
| public TBExternalTable objectType(Integer objectType) { | |||
| this.objectType = objectType; | |||
| return this; | |||
| } | |||
| public void setObjectType(Integer objectType) { | |||
| this.objectType = objectType; | |||
| } | |||
| // jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove | |||
| @Override | |||
| public boolean equals(Object o) { | |||
| if (this == o) { | |||
| return true; | |||
| } | |||
| if (o == null || getClass() != o.getClass()) { | |||
| return false; | |||
| } | |||
| TBExternalTable tBExternalTable = (TBExternalTable) o; | |||
| if (tBExternalTable.getId() == null || getId() == null) { | |||
| return false; | |||
| } | |||
| return Objects.equals(getId(), tBExternalTable.getId()); | |||
| } | |||
| @Override | |||
| public int hashCode() { | |||
| return Objects.hashCode(getId()); | |||
| } | |||
| @Override | |||
| public String toString() { | |||
| return "TBExternalTable{" + | |||
| "id=" + getId() + | |||
| ", name='" + getName() + "'" + | |||
| ", description='" + getDescription() + "'" + | |||
| ", objectType=" + getObjectType() + | |||
| "}"; | |||
| } | |||
| } | |||
| @@ -0,0 +1,149 @@ | |||
| package vn.azteam.tpf.domain; | |||
| import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | |||
| import org.hibernate.annotations.Cache; | |||
| import org.hibernate.annotations.CacheConcurrencyStrategy; | |||
| import javax.persistence.*; | |||
| import org.springframework.data.elasticsearch.annotations.Document; | |||
| import java.io.Serializable; | |||
| import java.util.Objects; | |||
| /** | |||
| * A TBFunction. | |||
| */ | |||
| @Entity | |||
| @Table(name = "tb_function") | |||
| @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) | |||
| @Document(indexName = "smf_tbfunction") | |||
| public class TBFunction implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| @Id | |||
| @GeneratedValue(strategy = GenerationType.IDENTITY) | |||
| private Long id; | |||
| @Column(name = "name") | |||
| private String name; | |||
| @Column(name = "type_request") | |||
| private String typeRequest; | |||
| @Column(name = "path") | |||
| private String path; | |||
| @Column(name = "method") | |||
| private String method; | |||
| @ManyToOne | |||
| @JsonIgnoreProperties("") | |||
| private TBFunctionGroup tbFunctionGroup; | |||
| // jhipster-needle-entity-add-field - JHipster will add fields here, do not remove | |||
| public Long getId() { | |||
| return id; | |||
| } | |||
| public void setId(Long id) { | |||
| this.id = id; | |||
| } | |||
| public String getName() { | |||
| return name; | |||
| } | |||
| public TBFunction name(String name) { | |||
| this.name = name; | |||
| return this; | |||
| } | |||
| public void setName(String name) { | |||
| this.name = name; | |||
| } | |||
| public String getTypeRequest() { | |||
| return typeRequest; | |||
| } | |||
| public TBFunction typeRequest(String typeRequest) { | |||
| this.typeRequest = typeRequest; | |||
| return this; | |||
| } | |||
| public void setTypeRequest(String typeRequest) { | |||
| this.typeRequest = typeRequest; | |||
| } | |||
| public String getPath() { | |||
| return path; | |||
| } | |||
| public TBFunction path(String path) { | |||
| this.path = path; | |||
| return this; | |||
| } | |||
| public void setPath(String path) { | |||
| this.path = path; | |||
| } | |||
| public String getMethod() { | |||
| return method; | |||
| } | |||
| public TBFunction method(String method) { | |||
| this.method = method; | |||
| return this; | |||
| } | |||
| public void setMethod(String method) { | |||
| this.method = method; | |||
| } | |||
| public TBFunctionGroup getTbFunctionGroup() { | |||
| return tbFunctionGroup; | |||
| } | |||
| public TBFunction tbFunctionGroup(TBFunctionGroup tBFunctionGroup) { | |||
| this.tbFunctionGroup = tBFunctionGroup; | |||
| return this; | |||
| } | |||
| public void setTbFunctionGroup(TBFunctionGroup tBFunctionGroup) { | |||
| this.tbFunctionGroup = tBFunctionGroup; | |||
| } | |||
| // jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove | |||
| @Override | |||
| public boolean equals(Object o) { | |||
| if (this == o) { | |||
| return true; | |||
| } | |||
| if (o == null || getClass() != o.getClass()) { | |||
| return false; | |||
| } | |||
| TBFunction tBFunction = (TBFunction) o; | |||
| if (tBFunction.getId() == null || getId() == null) { | |||
| return false; | |||
| } | |||
| return Objects.equals(getId(), tBFunction.getId()); | |||
| } | |||
| @Override | |||
| public int hashCode() { | |||
| return Objects.hashCode(getId()); | |||
| } | |||
| @Override | |||
| public String toString() { | |||
| return "TBFunction{" + | |||
| "id=" + getId() + | |||
| ", name='" + getName() + "'" + | |||
| ", typeRequest='" + getTypeRequest() + "'" + | |||
| ", path='" + getPath() + "'" + | |||
| ", method='" + getMethod() + "'" + | |||
| "}"; | |||
| } | |||
| } | |||
| @@ -0,0 +1,80 @@ | |||
| package vn.azteam.tpf.domain; | |||
| import org.hibernate.annotations.Cache; | |||
| import org.hibernate.annotations.CacheConcurrencyStrategy; | |||
| import javax.persistence.*; | |||
| import org.springframework.data.elasticsearch.annotations.Document; | |||
| import java.io.Serializable; | |||
| import java.util.Objects; | |||
| /** | |||
| * A TBFunctionGroup. | |||
| */ | |||
| @Entity | |||
| @Table(name = "tb_function_group") | |||
| @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) | |||
| @Document(indexName = "smf_tbfunctiongroup") | |||
| public class TBFunctionGroup implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| @Id | |||
| @GeneratedValue(strategy = GenerationType.IDENTITY) | |||
| private Long id; | |||
| @Column(name = "name") | |||
| private String name; | |||
| // jhipster-needle-entity-add-field - JHipster will add fields here, do not remove | |||
| public Long getId() { | |||
| return id; | |||
| } | |||
| public void setId(Long id) { | |||
| this.id = id; | |||
| } | |||
| public String getName() { | |||
| return name; | |||
| } | |||
| public TBFunctionGroup name(String name) { | |||
| this.name = name; | |||
| return this; | |||
| } | |||
| public void setName(String name) { | |||
| this.name = name; | |||
| } | |||
| // jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove | |||
| @Override | |||
| public boolean equals(Object o) { | |||
| if (this == o) { | |||
| return true; | |||
| } | |||
| if (o == null || getClass() != o.getClass()) { | |||
| return false; | |||
| } | |||
| TBFunctionGroup tBFunctionGroup = (TBFunctionGroup) o; | |||
| if (tBFunctionGroup.getId() == null || getId() == null) { | |||
| return false; | |||
| } | |||
| return Objects.equals(getId(), tBFunctionGroup.getId()); | |||
| } | |||
| @Override | |||
| public int hashCode() { | |||
| return Objects.hashCode(getId()); | |||
| } | |||
| @Override | |||
| public String toString() { | |||
| return "TBFunctionGroup{" + | |||
| "id=" + getId() + | |||
| ", name='" + getName() + "'" + | |||
| "}"; | |||
| } | |||
| } | |||
| @@ -0,0 +1,273 @@ | |||
| package vn.azteam.tpf.domain; | |||
| import com.fasterxml.jackson.annotation.JsonIgnore; | |||
| import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | |||
| import org.hibernate.annotations.Cache; | |||
| import org.hibernate.annotations.CacheConcurrencyStrategy; | |||
| import javax.persistence.*; | |||
| import org.springframework.data.elasticsearch.annotations.Document; | |||
| import java.io.Serializable; | |||
| import java.time.Instant; | |||
| import java.util.HashSet; | |||
| import java.util.Set; | |||
| import java.util.Objects; | |||
| /** | |||
| * A TBGuideline. | |||
| */ | |||
| @Entity | |||
| @Table(name = "tb_guideline") | |||
| @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) | |||
| @Document(indexName = "smf_tbguideline") | |||
| public class TBGuideline implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| @Id | |||
| @GeneratedValue(strategy = GenerationType.IDENTITY) | |||
| private Long id; | |||
| @Column(name = "code") | |||
| private String code; | |||
| @Column(name = "name") | |||
| private String name; | |||
| @Column(name = "duration") | |||
| private Integer duration; | |||
| @Column(name = "description") | |||
| private String description; | |||
| @Column(name = "created_date") | |||
| private Instant createdDate; | |||
| @Column(name = "modified_date") | |||
| private Instant modifiedDate; | |||
| @Column(name = "deleted_date") | |||
| private Instant deletedDate; | |||
| @ManyToOne(fetch=FetchType.LAZY) | |||
| @JsonIgnoreProperties("") | |||
| @JoinColumn(name = "created_by") | |||
| private TBDetailUser createdBy; | |||
| @ManyToOne(fetch=FetchType.LAZY) | |||
| @JsonIgnoreProperties("") | |||
| @JoinColumn(name = "modified_by") | |||
| private TBDetailUser modifiedBy; | |||
| @ManyToOne(fetch=FetchType.LAZY) | |||
| @JsonIgnoreProperties("") | |||
| @JoinColumn(name = "deleted_by") | |||
| private TBDetailUser deletedBy; | |||
| @ManyToOne | |||
| @JsonIgnoreProperties("") | |||
| private TBCustomer tbCustomer; | |||
| @ManyToMany | |||
| @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) | |||
| @JoinTable(name = "tb_supplies_has_guideline", | |||
| joinColumns = @JoinColumn(name = "tb_guidelines_id"), | |||
| inverseJoinColumns = @JoinColumn(name = "tb_supplies_id")) | |||
| private Set<TBSupplies> tbSupplies = new HashSet<>(); | |||
| // jhipster-needle-entity-add-field - JHipster will add fields here, do not remove | |||
| public Long getId() { | |||
| return id; | |||
| } | |||
| public void setId(Long id) { | |||
| this.id = id; | |||
| } | |||
| public String getDescription() { | |||
| return description; | |||
| } | |||
| public TBGuideline description(String description) { | |||
| this.description = description; | |||
| return this; | |||
| } | |||
| public void setDescription(String description) { | |||
| this.description = description; | |||
| } | |||
| public Instant getCreatedDate() { | |||
| return createdDate; | |||
| } | |||
| public TBGuideline createdDate(Instant createdDate) { | |||
| this.createdDate = createdDate; | |||
| return this; | |||
| } | |||
| public void setCreatedDate(Instant createdDate) { | |||
| this.createdDate = createdDate; | |||
| } | |||
| public Instant getModifiedDate() { | |||
| return modifiedDate; | |||
| } | |||
| public TBGuideline modifiedDate(Instant modifiedDate) { | |||
| this.modifiedDate = modifiedDate; | |||
| return this; | |||
| } | |||
| public void setModifiedDate(Instant modifiedDate) { | |||
| this.modifiedDate = modifiedDate; | |||
| } | |||
| public Instant getDeletedDate() { | |||
| return deletedDate; | |||
| } | |||
| public TBGuideline deletedDate(Instant deletedDate) { | |||
| this.deletedDate = deletedDate; | |||
| return this; | |||
| } | |||
| public void setDeletedDate(Instant deletedDate) { | |||
| this.deletedDate = deletedDate; | |||
| } | |||
| public TBDetailUser getCreatedBy() { | |||
| return createdBy; | |||
| } | |||
| public TBGuideline createdBy(TBDetailUser tBDetailUser) { | |||
| this.createdBy = tBDetailUser; | |||
| return this; | |||
| } | |||
| public void setCreatedBy(TBDetailUser tBDetailUser) { | |||
| this.createdBy = tBDetailUser; | |||
| } | |||
| public TBDetailUser getModifiedBy() { | |||
| return modifiedBy; | |||
| } | |||
| public TBGuideline modifiedBy(TBDetailUser tBDetailUser) { | |||
| this.modifiedBy = tBDetailUser; | |||
| return this; | |||
| } | |||
| public void setModifiedBy(TBDetailUser tBDetailUser) { | |||
| this.modifiedBy = tBDetailUser; | |||
| } | |||
| public TBDetailUser getDeletedBy() { | |||
| return deletedBy; | |||
| } | |||
| public TBGuideline deletedBy(TBDetailUser tBDetailUser) { | |||
| this.deletedBy = tBDetailUser; | |||
| return this; | |||
| } | |||
| public void setDeletedBy(TBDetailUser tBDetailUser) { | |||
| this.deletedBy = tBDetailUser; | |||
| } | |||
| public TBCustomer getTbCustomer() { | |||
| return tbCustomer; | |||
| } | |||
| public TBGuideline tbCustomer(TBCustomer tBCustomer) { | |||
| this.tbCustomer = tBCustomer; | |||
| return this; | |||
| } | |||
| public void setTbCustomer(TBCustomer tBCustomer) { | |||
| this.tbCustomer = tBCustomer; | |||
| } | |||
| public Set<TBSupplies> getTbSupplies() { | |||
| return tbSupplies; | |||
| } | |||
| public TBGuideline tbSupplies(Set<TBSupplies> tBSupplies) { | |||
| this.tbSupplies = tBSupplies; | |||
| return this; | |||
| } | |||
| public TBGuideline addTbSupplies(TBSupplies tBSupplies) { | |||
| this.tbSupplies.add(tBSupplies); | |||
| tBSupplies.getTbGuidelines().add(this); | |||
| return this; | |||
| } | |||
| public TBGuideline removeTbSupplies(TBSupplies tBSupplies) { | |||
| this.tbSupplies.remove(tBSupplies); | |||
| tBSupplies.getTbGuidelines().remove(this); | |||
| return this; | |||
| } | |||
| public void setTbSupplies(Set<TBSupplies> tBSupplies) { | |||
| this.tbSupplies = tBSupplies; | |||
| } | |||
| public Integer getDuration() { | |||
| return duration; | |||
| } | |||
| public void setDuration(Integer duration) { | |||
| this.duration = duration; | |||
| } | |||
| public String getCode() { | |||
| return code; | |||
| } | |||
| public void setCode(String code) { | |||
| this.code = code; | |||
| } | |||
| public String getName() { | |||
| return name; | |||
| } | |||
| public void setName(String name) { | |||
| this.name = name; | |||
| } | |||
| // jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove | |||
| @Override | |||
| public boolean equals(Object o) { | |||
| if (this == o) { | |||
| return true; | |||
| } | |||
| if (o == null || getClass() != o.getClass()) { | |||
| return false; | |||
| } | |||
| TBGuideline tBGuideline = (TBGuideline) o; | |||
| if (tBGuideline.getId() == null || getId() == null) { | |||
| return false; | |||
| } | |||
| return Objects.equals(getId(), tBGuideline.getId()); | |||
| } | |||
| @Override | |||
| public int hashCode() { | |||
| return Objects.hashCode(getId()); | |||
| } | |||
| @Override | |||
| public String toString() { | |||
| return "TBGuideline{" + | |||
| "id=" + getId() + | |||
| ", description='" + getDescription() + "'" + | |||
| ", createdDate='" + getCreatedDate() + "'" + | |||
| ", modifiedDate='" + getModifiedDate() + "'" + | |||
| ", deletedDate='" + getDeletedDate() + "'" + | |||
| "}"; | |||
| } | |||
| } | |||
| @@ -0,0 +1,114 @@ | |||
| package vn.azteam.tpf.domain; | |||
| import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | |||
| import org.hibernate.annotations.Cache; | |||
| import org.hibernate.annotations.CacheConcurrencyStrategy; | |||
| import javax.persistence.*; | |||
| import org.springframework.data.elasticsearch.annotations.Document; | |||
| import java.io.Serializable; | |||
| import java.util.Objects; | |||
| /** | |||
| * A TBGuidelineActivity. | |||
| */ | |||
| @Entity | |||
| @Table(name = "tb_guideline_activity") | |||
| @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) | |||
| @Document(indexName = "smf_tbguidelineactivity") | |||
| public class TBGuidelineActivity implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| @Id | |||
| @GeneratedValue(strategy = GenerationType.IDENTITY) | |||
| private Long id; | |||
| @ManyToOne | |||
| @JsonIgnoreProperties("") | |||
| private TBActivityType tbActivityType; | |||
| @ManyToOne | |||
| @JsonIgnoreProperties("") | |||
| private TBGuidelineDetails tbGuidelineDetails; | |||
| @Column(name = "external_table") | |||
| private String externalTable; | |||
| // jhipster-needle-entity-add-field - JHipster will add fields here, do not remove | |||
| public Long getId() { | |||
| return id; | |||
| } | |||
| public void setId(Long id) { | |||
| this.id = id; | |||
| } | |||
| public TBGuidelineDetails getTbGuidelineDetails() { | |||
| return tbGuidelineDetails; | |||
| } | |||
| public TBGuidelineActivity tbGuidelineDetails(TBGuidelineDetails tbGuidelineDetails) { | |||
| this.tbGuidelineDetails = tbGuidelineDetails; | |||
| return this; | |||
| } | |||
| public void setTbGuidelineDetails(TBGuidelineDetails tbGuidelineDetails) { | |||
| this.tbGuidelineDetails = tbGuidelineDetails; | |||
| } | |||
| public TBActivityType getTbActivityType() { | |||
| return tbActivityType; | |||
| } | |||
| public TBGuidelineActivity tbActivityType(TBActivityType tbActivityType) { | |||
| this.tbActivityType = tbActivityType; | |||
| return this; | |||
| } | |||
| public void setTbActivityType(TBActivityType tbActivityType) { | |||
| this.tbActivityType = tbActivityType; | |||
| } | |||
| public String getExternalTable() { | |||
| return externalTable; | |||
| } | |||
| public TBGuidelineActivity externalTable(String externalTable) { | |||
| this.externalTable = externalTable; | |||
| return this; | |||
| } | |||
| public void setExternalTable(String externalTable) { | |||
| this.externalTable = externalTable; | |||
| } | |||
| // jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove | |||
| @Override | |||
| public boolean equals(Object o) { | |||
| if (this == o) { | |||
| return true; | |||
| } | |||
| if (o == null || getClass() != o.getClass()) { | |||
| return false; | |||
| } | |||
| TBGuidelineActivity tBGuidelineActivity = (TBGuidelineActivity) o; | |||
| if (tBGuidelineActivity.getId() == null || getId() == null) { | |||
| return false; | |||
| } | |||
| return Objects.equals(getId(), tBGuidelineActivity.getId()); | |||
| } | |||
| @Override | |||
| public int hashCode() { | |||
| return Objects.hashCode(getId()); | |||
| } | |||
| @Override | |||
| public String toString() { | |||
| return "TBGuidelineActivity{" + | |||
| "id=" + getId() + | |||
| ", externalTable='" + getExternalTable() + "'" + | |||
| "}"; | |||
| } | |||
| } | |||
| @@ -0,0 +1,132 @@ | |||
| package vn.azteam.tpf.domain; | |||
| import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | |||
| import org.hibernate.annotations.Cache; | |||
| import org.hibernate.annotations.CacheConcurrencyStrategy; | |||
| import javax.persistence.*; | |||
| import org.springframework.data.elasticsearch.annotations.Document; | |||
| import java.io.Serializable; | |||
| import java.util.Objects; | |||
| /** | |||
| * A TBGuidelineDetails. | |||
| */ | |||
| @Entity | |||
| @Table(name = "tb_guideline_details") | |||
| @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) | |||
| @Document(indexName = "smf_tbguidelinedetails") | |||
| public class TBGuidelineDetails implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| @Id | |||
| @GeneratedValue(strategy = GenerationType.IDENTITY) | |||
| private Long id; | |||
| @Column(name = "age_day_start") | |||
| private Integer ageDayStart; | |||
| @Column(name = "age_day_end") | |||
| private Integer ageDayEnd; | |||
| @ManyToOne | |||
| @JsonIgnoreProperties("") | |||
| private TBGuideline tbGuideline; | |||
| @ManyToOne | |||
| @JsonIgnoreProperties("") | |||
| private TBGuidelinePeriod tbGuidelinePeriod; | |||
| // jhipster-needle-entity-add-field - JHipster will add fields here, do not remove | |||
| public Long getId() { | |||
| return id; | |||
| } | |||
| public void setId(Long id) { | |||
| this.id = id; | |||
| } | |||
| public Integer getAgeDayStart() { | |||
| return ageDayStart; | |||
| } | |||
| public TBGuidelineDetails ageDayStart(Integer ageDayStart) { | |||
| this.ageDayStart = ageDayStart; | |||
| return this; | |||
| } | |||
| public void setAgeDayStart(Integer ageDayStart) { | |||
| this.ageDayStart = ageDayStart; | |||
| } | |||
| public Integer getAgeDayEnd() { | |||
| return ageDayEnd; | |||
| } | |||
| public TBGuidelineDetails ageDayEnd(Integer ageDayEnd) { | |||
| this.ageDayEnd = ageDayEnd; | |||
| return this; | |||
| } | |||
| public void setAgeDayEnd(Integer ageDayEnd) { | |||
| this.ageDayEnd = ageDayEnd; | |||
| } | |||
| public TBGuideline getTbGuideline() { | |||
| return tbGuideline; | |||
| } | |||
| public TBGuidelineDetails tbGuideline(TBGuideline tBGuideline) { | |||
| this.tbGuideline = tBGuideline; | |||
| return this; | |||
| } | |||
| public void setTbGuideline(TBGuideline tBGuideline) { | |||
| this.tbGuideline = tBGuideline; | |||
| } | |||
| public TBGuidelinePeriod getTbGuidelinePeriod() { | |||
| return tbGuidelinePeriod; | |||
| } | |||
| public TBGuidelineDetails tbGuidelinePeriod(TBGuidelinePeriod tBGuidelinePeriod) { | |||
| this.tbGuidelinePeriod = tBGuidelinePeriod; | |||
| return this; | |||
| } | |||
| public void setTbGuidelinePeriod(TBGuidelinePeriod tBGuidelinePeriod) { | |||
| this.tbGuidelinePeriod = tBGuidelinePeriod; | |||
| } | |||
| // jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove | |||
| @Override | |||
| public boolean equals(Object o) { | |||
| if (this == o) { | |||
| return true; | |||
| } | |||
| if (o == null || getClass() != o.getClass()) { | |||
| return false; | |||
| } | |||
| TBGuidelineDetails tBGuidelineDetails = (TBGuidelineDetails) o; | |||
| if (tBGuidelineDetails.getId() == null || getId() == null) { | |||
| return false; | |||
| } | |||
| return Objects.equals(getId(), tBGuidelineDetails.getId()); | |||
| } | |||
| @Override | |||
| public int hashCode() { | |||
| return Objects.hashCode(getId()); | |||
| } | |||
| @Override | |||
| public String toString() { | |||
| return "TBGuidelineDetails{" + | |||
| "id=" + getId() + | |||
| ", ageDayStart=" + getAgeDayStart() + | |||
| ", ageDayEnd=" + getAgeDayEnd() + | |||
| "}"; | |||
| } | |||
| } | |||
| @@ -0,0 +1,116 @@ | |||
| package vn.azteam.tpf.domain; | |||
| import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | |||
| import org.hibernate.annotations.Cache; | |||
| import org.hibernate.annotations.CacheConcurrencyStrategy; | |||
| import javax.persistence.*; | |||
| import org.springframework.data.elasticsearch.annotations.Document; | |||
| import java.io.Serializable; | |||
| import java.util.Objects; | |||
| /** | |||
| * A TBGuidelineDetailsObjectUpdate. | |||
| */ | |||
| @Entity | |||
| @Table(name = "tb_guideline_details_object_update") | |||
| @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) | |||
| @Document(indexName = "smf_tbguidelinedetailsobjectupdate") | |||
| public class TBGuidelineDetailsObjectUpdate implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| @Id | |||
| @GeneratedValue(strategy = GenerationType.IDENTITY) | |||
| private Long id; | |||
| @Column(name = "jhi_index") | |||
| private String index; | |||
| @ManyToOne | |||
| @JsonIgnoreProperties("") | |||
| private TBObjectParameter tbObjectParameter; | |||
| @ManyToOne | |||
| @JsonIgnoreProperties("") | |||
| private TBGuidelineActivity tbGuidelineActivity; | |||
| // jhipster-needle-entity-add-field - JHipster will add fields here, do not remove | |||
| public Long getId() { | |||
| return id; | |||
| } | |||
| public void setId(Long id) { | |||
| this.id = id; | |||
| } | |||
| public String getIndex() { | |||
| return index; | |||
| } | |||
| public TBGuidelineDetailsObjectUpdate index(String index) { | |||
| this.index = index; | |||
| return this; | |||
| } | |||
| public void setIndex(String index) { | |||
| this.index = index; | |||
| } | |||
| public TBObjectParameter getTbObjectParameter() { | |||
| return tbObjectParameter; | |||
| } | |||
| public TBGuidelineDetailsObjectUpdate tbObjectParameter(TBObjectParameter tbObjectParameter) { | |||
| this.tbObjectParameter = tbObjectParameter; | |||
| return this; | |||
| } | |||
| public void setTbObjectParameter(TBObjectParameter tbObjectParameter) { | |||
| this.tbObjectParameter = tbObjectParameter; | |||
| } | |||
| public TBGuidelineActivity getTbGuidelineActivity() { | |||
| return tbGuidelineActivity; | |||
| } | |||
| public TBGuidelineDetailsObjectUpdate tbGuidelineActivity(TBGuidelineActivity tbGuidelineActivity) { | |||
| this.tbGuidelineActivity = tbGuidelineActivity; | |||
| return this; | |||
| } | |||
| public void setTbGuidelineActivity(TBGuidelineActivity tbGuidelineActivity) { | |||
| this.tbGuidelineActivity = tbGuidelineActivity; | |||
| } | |||
| // jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove | |||
| @Override | |||
| public boolean equals(Object o) { | |||
| if (this == o) { | |||
| return true; | |||
| } | |||
| if (o == null || getClass() != o.getClass()) { | |||
| return false; | |||
| } | |||
| TBGuidelineDetailsObjectUpdate tBGuidelineDetailsObjectUpdate = (TBGuidelineDetailsObjectUpdate) o; | |||
| if (tBGuidelineDetailsObjectUpdate.getId() == null || getId() == null) { | |||
| return false; | |||
| } | |||
| return Objects.equals(getId(), tBGuidelineDetailsObjectUpdate.getId()); | |||
| } | |||
| @Override | |||
| public int hashCode() { | |||
| return Objects.hashCode(getId()); | |||
| } | |||
| @Override | |||
| public String toString() { | |||
| return "TBGuidelineDetailsObjectUpdate{" + | |||
| "id=" + getId() + | |||
| ", index='" + getIndex() + "'" + | |||
| "}"; | |||
| } | |||
| } | |||
| @@ -0,0 +1,132 @@ | |||
| package vn.azteam.tpf.domain; | |||
| import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | |||
| import org.hibernate.annotations.Cache; | |||
| import org.hibernate.annotations.CacheConcurrencyStrategy; | |||
| import javax.persistence.*; | |||
| import org.springframework.data.elasticsearch.annotations.Document; | |||
| import java.io.Serializable; | |||
| import java.util.Objects; | |||
| /** | |||
| * A TBGuidelinePeriod. | |||
| */ | |||
| @Entity | |||
| @Table(name = "tb_guideline_period") | |||
| @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) | |||
| @Document(indexName = "smf_tbguidelineperiod") | |||
| public class TBGuidelinePeriod implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| @Id | |||
| @GeneratedValue(strategy = GenerationType.IDENTITY) | |||
| private Long id; | |||
| @Column(name = "name") | |||
| private String name; | |||
| @Column(name = "age_day_start") | |||
| private Integer ageDayStart; | |||
| @Column(name = "age_day_end") | |||
| private Integer ageDayEnd; | |||
| @ManyToOne | |||
| @JsonIgnoreProperties("") | |||
| private TBGuideline tbGuideline; | |||
| // jhipster-needle-entity-add-field - JHipster will add fields here, do not remove | |||
| public Long getId() { | |||
| return id; | |||
| } | |||
| public void setId(Long id) { | |||
| this.id = id; | |||
| } | |||
| public String getName() { | |||
| return name; | |||
| } | |||
| public TBGuidelinePeriod name(String name) { | |||
| this.name = name; | |||
| return this; | |||
| } | |||
| public void setName(String name) { | |||
| this.name = name; | |||
| } | |||
| public Integer getAgeDayStart() { | |||
| return ageDayStart; | |||
| } | |||
| public TBGuidelinePeriod ageDayStart(Integer ageDayStart) { | |||
| this.ageDayStart = ageDayStart; | |||
| return this; | |||
| } | |||
| public void setAgeDayStart(Integer ageDayStart) { | |||
| this.ageDayStart = ageDayStart; | |||
| } | |||
| public Integer getAgeDayEnd() { | |||
| return ageDayEnd; | |||
| } | |||
| public TBGuidelinePeriod ageDayEnd(Integer ageDayEnd) { | |||
| this.ageDayEnd = ageDayEnd; | |||
| return this; | |||
| } | |||
| public void setAgeDayEnd(Integer ageDayEnd) { | |||
| this.ageDayEnd = ageDayEnd; | |||
| } | |||
| public TBGuideline getTbGuideline() { | |||
| return tbGuideline; | |||
| } | |||
| public TBGuidelinePeriod tbGuideline(TBGuideline tbGuideline) { | |||
| this.tbGuideline = tbGuideline; | |||
| return this; | |||
| } | |||
| public void setTbGuideline(TBGuideline tbGuideline) { | |||
| this.tbGuideline = tbGuideline; | |||
| } | |||
| // jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove | |||
| @Override | |||
| public boolean equals(Object o) { | |||
| if (this == o) { | |||
| return true; | |||
| } | |||
| if (o == null || getClass() != o.getClass()) { | |||
| return false; | |||
| } | |||
| TBGuidelinePeriod tBGuidelinePeriod = (TBGuidelinePeriod) o; | |||
| if (tBGuidelinePeriod.getId() == null || getId() == null) { | |||
| return false; | |||
| } | |||
| return Objects.equals(getId(), tBGuidelinePeriod.getId()); | |||
| } | |||
| @Override | |||
| public int hashCode() { | |||
| return Objects.hashCode(getId()); | |||
| } | |||
| @Override | |||
| public String toString() { | |||
| return "TBGuidelinePeriod{" + | |||
| "id=" + getId() + | |||
| ", name='" + getName() + "'" + | |||
| ", ageDayStart=" + getAgeDayStart() + | |||
| ", ageDayEnd=" + getAgeDayEnd() + | |||
| "}"; | |||
| } | |||
| } | |||
| @@ -0,0 +1,149 @@ | |||
| package vn.azteam.tpf.domain; | |||
| import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | |||
| import org.hibernate.annotations.Cache; | |||
| import org.hibernate.annotations.CacheConcurrencyStrategy; | |||
| import javax.persistence.*; | |||
| import org.springframework.data.elasticsearch.annotations.Document; | |||
| import java.io.Serializable; | |||
| import java.util.Objects; | |||
| /** | |||
| * A TBLimits. | |||
| */ | |||
| @Entity | |||
| @Table(name = "tb_limits") | |||
| @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) | |||
| @Document(indexName = "smf_tblimits") | |||
| public class TBLimits implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| @Id | |||
| @GeneratedValue(strategy = GenerationType.IDENTITY) | |||
| private Long id; | |||
| @Column(name = "upper_limit") | |||
| private Double upperLimit; | |||
| @Column(name = "lower_limit") | |||
| private Double lowerLimit; | |||
| @ManyToOne | |||
| @JsonIgnoreProperties("") | |||
| private TBGuidelineDetails tbGuidelineDetails; | |||
| @ManyToOne | |||
| @JsonIgnoreProperties("") | |||
| private TBObjectParameter tbObjectParameter; | |||
| @ManyToOne | |||
| @JsonIgnoreProperties("") | |||
| private TBEnvironmentalParameter tbEnvironmentalParameter; | |||
| // jhipster-needle-entity-add-field - JHipster will add fields here, do not remove | |||
| public Long getId() { | |||
| return id; | |||
| } | |||
| public void setId(Long id) { | |||
| this.id = id; | |||
| } | |||
| public Double getUpperLimit() { | |||
| return upperLimit; | |||
| } | |||
| public TBLimits upperLimit(Double upperLimit) { | |||
| this.upperLimit = upperLimit; | |||
| return this; | |||
| } | |||
| public void setUpperLimit(Double upperLimit) { | |||
| this.upperLimit = upperLimit; | |||
| } | |||
| public Double getLowerLimit() { | |||
| return lowerLimit; | |||
| } | |||
| public TBLimits lowerLimit(Double lowerLimit) { | |||
| this.lowerLimit = lowerLimit; | |||
| return this; | |||
| } | |||
| public void setLowerLimit(Double lowerLimit) { | |||
| this.lowerLimit = lowerLimit; | |||
| } | |||
| public TBGuidelineDetails getTbGuidelineDetails() { | |||
| return tbGuidelineDetails; | |||
| } | |||
| public TBLimits tbGuidelineDetails(TBGuidelineDetails tBGuidelineDetails) { | |||
| this.tbGuidelineDetails = tBGuidelineDetails; | |||
| return this; | |||
| } | |||
| public void setTbGuidelineDetails(TBGuidelineDetails tBGuidelineDetails) { | |||
| this.tbGuidelineDetails = tBGuidelineDetails; | |||
| } | |||
| public TBObjectParameter getTbObjectParameter() { | |||
| return tbObjectParameter; | |||
| } | |||
| public TBLimits tbObjectParameter(TBObjectParameter tBObjectParameter) { | |||
| this.tbObjectParameter = tBObjectParameter; | |||
| return this; | |||
| } | |||
| public void setTbObjectParameter(TBObjectParameter tBObjectParameter) { | |||
| this.tbObjectParameter = tBObjectParameter; | |||
| } | |||
| public TBEnvironmentalParameter getTbEnvironmentalParameter() { | |||
| return tbEnvironmentalParameter; | |||
| } | |||
| public TBLimits tbEnvironmentalParameter(TBEnvironmentalParameter tBEnvironmentalParameter) { | |||
| this.tbEnvironmentalParameter = tBEnvironmentalParameter; | |||
| return this; | |||
| } | |||
| public void setTbEnvironmentalParameter(TBEnvironmentalParameter tBEnvironmentalParameter) { | |||
| this.tbEnvironmentalParameter = tBEnvironmentalParameter; | |||
| } | |||
| // jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove | |||
| @Override | |||
| public boolean equals(Object o) { | |||
| if (this == o) { | |||
| return true; | |||
| } | |||
| if (o == null || getClass() != o.getClass()) { | |||
| return false; | |||
| } | |||
| TBLimits tBLimits = (TBLimits) o; | |||
| if (tBLimits.getId() == null || getId() == null) { | |||
| return false; | |||
| } | |||
| return Objects.equals(getId(), tBLimits.getId()); | |||
| } | |||
| @Override | |||
| public int hashCode() { | |||
| return Objects.hashCode(getId()); | |||
| } | |||
| @Override | |||
| public String toString() { | |||
| return "TBLimits{" + | |||
| "id=" + getId() + | |||
| ", upperLimit=" + getUpperLimit() + | |||
| ", lowerLimit=" + getLowerLimit() + | |||
| "}"; | |||
| } | |||
| } | |||
| @@ -0,0 +1,116 @@ | |||
| package vn.azteam.tpf.domain; | |||
| import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | |||
| import org.hibernate.annotations.Cache; | |||
| import org.hibernate.annotations.CacheConcurrencyStrategy; | |||
| import javax.persistence.*; | |||
| import org.springframework.data.elasticsearch.annotations.Document; | |||
| import java.io.Serializable; | |||
| import java.util.Objects; | |||
| /** | |||
| * A TBLocationOfCustomer. | |||
| */ | |||
| @Entity | |||
| @Table(name = "tb_location_of_customer") | |||
| @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) | |||
| @Document(indexName = "smf_tblocationofcustomer") | |||
| public class TBLocationOfCustomer implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| @Id | |||
| @GeneratedValue(strategy = GenerationType.IDENTITY) | |||
| private Long id; | |||
| @ManyToOne | |||
| @JsonIgnoreProperties("") | |||
| private TBCustomer tbCustomer; | |||
| @Column(name = "latitude") | |||
| private Double latitude; | |||
| @Column(name = "longitude") | |||
| private Double longitude; | |||
| // jhipster-needle-entity-add-field - JHipster will add fields here, do not remove | |||
| public Long getId() { | |||
| return id; | |||
| } | |||
| public void setId(Long id) { | |||
| this.id = id; | |||
| } | |||
| public TBCustomer getTbCustomer() { | |||
| return tbCustomer; | |||
| } | |||
| public TBLocationOfCustomer tbCustomer(TBCustomer tbCustomer) { | |||
| this.tbCustomer = tbCustomer; | |||
| return this; | |||
| } | |||
| public void setTbCustomer(TBCustomer tbCustomer) { | |||
| this.tbCustomer = tbCustomer; | |||
| } | |||
| public Double getLatitude() { | |||
| return latitude; | |||
| } | |||
| public TBLocationOfCustomer latitude(Double latitude) { | |||
| this.latitude = latitude; | |||
| return this; | |||
| } | |||
| public void setLatitude(Double latitude) { | |||
| this.latitude = latitude; | |||
| } | |||
| public Double getLongitude() { | |||
| return longitude; | |||
| } | |||
| public TBLocationOfCustomer longitude(Double longitude) { | |||
| this.longitude = longitude; | |||
| return this; | |||
| } | |||
| public void setLongitude(Double longitude) { | |||
| this.longitude = longitude; | |||
| } | |||
| // jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove | |||
| @Override | |||
| public boolean equals(Object o) { | |||
| if (this == o) { | |||
| return true; | |||
| } | |||
| if (o == null || getClass() != o.getClass()) { | |||
| return false; | |||
| } | |||
| TBLocationOfCustomer tBLocationOfCustomer = (TBLocationOfCustomer) o; | |||
| if (tBLocationOfCustomer.getId() == null || getId() == null) { | |||
| return false; | |||
| } | |||
| return Objects.equals(getId(), tBLocationOfCustomer.getId()); | |||
| } | |||
| @Override | |||
| public int hashCode() { | |||
| return Objects.hashCode(getId()); | |||
| } | |||
| @Override | |||
| public String toString() { | |||
| return "TBLocationOfCustomer{" + | |||
| "id=" + getId() + | |||
| ", latitude=" + getLatitude() + | |||
| ", longitude=" + getLongitude() + | |||
| "}"; | |||
| } | |||
| } | |||
| @@ -0,0 +1,289 @@ | |||
| package vn.azteam.tpf.domain; | |||
| import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | |||
| import org.hibernate.annotations.Cache; | |||
| import org.hibernate.annotations.CacheConcurrencyStrategy; | |||
| import javax.persistence.*; | |||
| import org.springframework.data.elasticsearch.annotations.Document; | |||
| import java.io.Serializable; | |||
| import java.time.Instant; | |||
| import java.util.Objects; | |||
| /** | |||
| * A TBMaintenanceDetails. | |||
| */ | |||
| @Entity | |||
| @Table(name = "tb_maintenance_details") | |||
| @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) | |||
| @Document(indexName = "smf_tbmaintenancedetails") | |||
| public class TBMaintenanceDetails implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| @Id | |||
| @GeneratedValue(strategy = GenerationType.IDENTITY) | |||
| private Long id; | |||
| @Column(name = "start_time") | |||
| private Instant startTime; | |||
| @Column(name = "duration_in_mins") | |||
| private Integer durationInMins; | |||
| @Column(name = "action") | |||
| private String action; | |||
| @Column(name = "description") | |||
| private String description; | |||
| @Column(name = "status") | |||
| private Integer status; | |||
| @Column(name = "created_date") | |||
| private Instant createdDate; | |||
| @Column(name = "modified_date") | |||
| private Instant modifiedDate; | |||
| @Column(name = "deleted_date") | |||
| private Instant deletedDate; | |||
| @ManyToOne | |||
| @JsonIgnoreProperties("") | |||
| private TBEquipmentOfCustomer tbEquipmentOfCustomer; | |||
| @ManyToOne | |||
| @JsonIgnoreProperties("") | |||
| private TBMaintenanceSchedule tbMaintenanceSchedule; | |||
| @ManyToOne(fetch=FetchType.LAZY) | |||
| @JsonIgnoreProperties("") | |||
| @JoinColumn(name = "created_by") | |||
| private TBDetailUser createdBy; | |||
| @ManyToOne(fetch=FetchType.LAZY) | |||
| @JsonIgnoreProperties("") | |||
| @JoinColumn(name = "modified_by") | |||
| private TBDetailUser modifiedBy; | |||
| @ManyToOne(fetch=FetchType.LAZY) | |||
| @JsonIgnoreProperties("") | |||
| @JoinColumn(name = "deleted_by") | |||
| private TBDetailUser deletedBy; | |||
| // jhipster-needle-entity-add-field - JHipster will add fields here, do not remove | |||
| public Long getId() { | |||
| return id; | |||
| } | |||
| public void setId(Long id) { | |||
| this.id = id; | |||
| } | |||
| public Instant getStartTime() { | |||
| return startTime; | |||
| } | |||
| public TBMaintenanceDetails startTime(Instant startTime) { | |||
| this.startTime = startTime; | |||
| return this; | |||
| } | |||
| public void setStartTime(Instant startTime) { | |||
| this.startTime = startTime; | |||
| } | |||
| public Integer getDurationInMins() { | |||
| return durationInMins; | |||
| } | |||
| public TBMaintenanceDetails durationInMins(Integer durationInMins) { | |||
| this.durationInMins = durationInMins; | |||
| return this; | |||
| } | |||
| public void setDurationInMins(Integer durationInMins) { | |||
| this.durationInMins = durationInMins; | |||
| } | |||
| public String getAction() { | |||
| return action; | |||
| } | |||
| public TBMaintenanceDetails action(String action) { | |||
| this.action = action; | |||
| return this; | |||
| } | |||
| public void setAction(String action) { | |||
| this.action = action; | |||
| } | |||
| public String getDescription() { | |||
| return description; | |||
| } | |||
| public TBMaintenanceDetails description(String description) { | |||
| this.description = description; | |||
| return this; | |||
| } | |||
| public void setDescription(String description) { | |||
| this.description = description; | |||
| } | |||
| public Integer getStatus() { | |||
| return status; | |||
| } | |||
| public TBMaintenanceDetails status(Integer status) { | |||
| this.status = status; | |||
| return this; | |||
| } | |||
| public void setStatus(Integer status) { | |||
| this.status = status; | |||
| } | |||
| public Instant getCreatedDate() { | |||
| return createdDate; | |||
| } | |||
| public TBMaintenanceDetails createdDate(Instant createdDate) { | |||
| this.createdDate = createdDate; | |||
| return this; | |||
| } | |||
| public void setCreatedDate(Instant createdDate) { | |||
| this.createdDate = createdDate; | |||
| } | |||
| public Instant getModifiedDate() { | |||
| return modifiedDate; | |||
| } | |||
| public TBMaintenanceDetails modifiedDate(Instant modifiedDate) { | |||
| this.modifiedDate = modifiedDate; | |||
| return this; | |||
| } | |||
| public void setModifiedDate(Instant modifiedDate) { | |||
| this.modifiedDate = modifiedDate; | |||
| } | |||
| public Instant getDeletedDate() { | |||
| return deletedDate; | |||
| } | |||
| public TBMaintenanceDetails deletedDate(Instant deletedDate) { | |||
| this.deletedDate = deletedDate; | |||
| return this; | |||
| } | |||
| public void setDeletedDate(Instant deletedDate) { | |||
| this.deletedDate = deletedDate; | |||
| } | |||
| public TBEquipmentOfCustomer getTbEquipmentOfCustomer() { | |||
| return tbEquipmentOfCustomer; | |||
| } | |||
| public TBMaintenanceDetails tbEquipmentOfCustomer(TBEquipmentOfCustomer tBEquipmentOfCustomer) { | |||
| this.tbEquipmentOfCustomer = tBEquipmentOfCustomer; | |||
| return this; | |||
| } | |||
| public void setTbEquipmentOfCustomer(TBEquipmentOfCustomer tBEquipmentOfCustomer) { | |||
| this.tbEquipmentOfCustomer = tBEquipmentOfCustomer; | |||
| } | |||
| public TBMaintenanceSchedule getTbMaintenanceSchedule() { | |||
| return tbMaintenanceSchedule; | |||
| } | |||
| public TBMaintenanceDetails tbMaintenanceSchedule(TBMaintenanceSchedule tBMaintenanceSchedule) { | |||
| this.tbMaintenanceSchedule = tBMaintenanceSchedule; | |||
| return this; | |||
| } | |||
| public void setTbMaintenanceSchedule(TBMaintenanceSchedule tBMaintenanceSchedule) { | |||
| this.tbMaintenanceSchedule = tBMaintenanceSchedule; | |||
| } | |||
| public TBDetailUser getCreatedBy() { | |||
| return createdBy; | |||
| } | |||
| public TBMaintenanceDetails createdBy(TBDetailUser tBDetailUser) { | |||
| this.createdBy = tBDetailUser; | |||
| return this; | |||
| } | |||
| public void setCreatedBy(TBDetailUser tBDetailUser) { | |||
| this.createdBy = tBDetailUser; | |||
| } | |||
| public TBDetailUser getModifiedBy() { | |||
| return modifiedBy; | |||
| } | |||
| public TBMaintenanceDetails modifiedBy(TBDetailUser tBDetailUser) { | |||
| this.modifiedBy = tBDetailUser; | |||
| return this; | |||
| } | |||
| public void setModifiedBy(TBDetailUser tBDetailUser) { | |||
| this.modifiedBy = tBDetailUser; | |||
| } | |||
| public TBDetailUser getDeletedBy() { | |||
| return deletedBy; | |||
| } | |||
| public TBMaintenanceDetails deletedBy(TBDetailUser tBDetailUser) { | |||
| this.deletedBy = tBDetailUser; | |||
| return this; | |||
| } | |||
| public void setDeletedBy(TBDetailUser tBDetailUser) { | |||
| this.deletedBy = tBDetailUser; | |||
| } | |||
| // jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove | |||
| @Override | |||
| public boolean equals(Object o) { | |||
| if (this == o) { | |||
| return true; | |||
| } | |||
| if (o == null || getClass() != o.getClass()) { | |||
| return false; | |||
| } | |||
| TBMaintenanceDetails tBMaintenanceDetails = (TBMaintenanceDetails) o; | |||
| if (tBMaintenanceDetails.getId() == null || getId() == null) { | |||
| return false; | |||
| } | |||
| return Objects.equals(getId(), tBMaintenanceDetails.getId()); | |||
| } | |||
| @Override | |||
| public int hashCode() { | |||
| return Objects.hashCode(getId()); | |||
| } | |||
| @Override | |||
| public String toString() { | |||
| return "TBMaintenanceDetails{" + | |||
| "id=" + getId() + | |||
| ", startTime='" + getStartTime() + "'" + | |||
| ", durationInMins=" + getDurationInMins() + | |||
| ", action='" + getAction() + "'" + | |||
| ", description='" + getDescription() + "'" + | |||
| ", status=" + getStatus() + | |||
| ", createdDate='" + getCreatedDate() + "'" + | |||
| ", modifiedDate='" + getModifiedDate() + "'" + | |||
| ", deletedDate='" + getDeletedDate() + "'" + | |||
| "}"; | |||
| } | |||
| } | |||
| @@ -0,0 +1,391 @@ | |||
| package vn.azteam.tpf.domain; | |||
| import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | |||
| import org.hibernate.annotations.Cache; | |||
| import org.hibernate.annotations.CacheConcurrencyStrategy; | |||
| import javax.persistence.*; | |||
| import org.springframework.data.elasticsearch.annotations.Document; | |||
| import java.io.Serializable; | |||
| import java.time.Instant; | |||
| import java.util.Objects; | |||
| /** | |||
| * A TBMaintenanceSchedule. | |||
| */ | |||
| @Entity | |||
| @Table(name = "tb_maintenance_schedule") | |||
| @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) | |||
| @Document(indexName = "smf_tbmaintenanceschedule") | |||
| public class TBMaintenanceSchedule implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| @Id | |||
| @GeneratedValue(strategy = GenerationType.IDENTITY) | |||
| private Long id; | |||
| @Column(name = "description") | |||
| private String description; | |||
| @Column(name = "is_repeat") | |||
| private Integer isRepeat; | |||
| @Column(name = "repeat_every") | |||
| private String repeatEvery; | |||
| @Column(name = "is_repeat_on_sunday") | |||
| private Integer isRepeatOnSunday; | |||
| @Column(name = "is_repeat_on_monday") | |||
| private Integer isRepeatOnMonday; | |||
| @Column(name = "is_repeat_on_tuesday") | |||
| private Integer isRepeatOnTuesday; | |||
| @Column(name = "is_repeat_on_wednesday") | |||
| private Integer isRepeatOnWednesday; | |||
| @Column(name = "is_repeat_on_thursday") | |||
| private Integer isRepeatOnThursday; | |||
| @Column(name = "is_repeat_on_friday") | |||
| private Integer isRepeatOnFriday; | |||
| @Column(name = "is_repeat_on_saturday") | |||
| private Integer isRepeatOnSaturday; | |||
| @Column(name = "day_of_month") | |||
| private Integer dayOfMonth; | |||
| @Column(name = "ends_on") | |||
| private Instant endsOn; | |||
| @Column(name = "ends_after_x_occurrences") | |||
| private Integer endsAfterXOccurrences; | |||
| @Column(name = "created_date") | |||
| private Instant createdDate; | |||
| @Column(name = "modified_date") | |||
| private Instant modifiedDate; | |||
| @Column(name = "deleted_date") | |||
| private Instant deletedDate; | |||
| @ManyToOne(fetch=FetchType.LAZY) | |||
| @JsonIgnoreProperties("") | |||
| @JoinColumn(name = "created_by") | |||
| private TBDetailUser createdBy; | |||
| @ManyToOne(fetch=FetchType.LAZY) | |||
| @JsonIgnoreProperties("") | |||
| @JoinColumn(name = "modified_by") | |||
| private TBDetailUser modifiedBy; | |||
| @ManyToOne(fetch=FetchType.LAZY) | |||
| @JsonIgnoreProperties("") | |||
| @JoinColumn(name = "deleted_by") | |||
| private TBDetailUser deletedBy; | |||
| // jhipster-needle-entity-add-field - JHipster will add fields here, do not remove | |||
| public Long getId() { | |||
| return id; | |||
| } | |||
| public void setId(Long id) { | |||
| this.id = id; | |||
| } | |||
| public String getDescription() { | |||
| return description; | |||
| } | |||
| public TBMaintenanceSchedule description(String description) { | |||
| this.description = description; | |||
| return this; | |||
| } | |||
| public void setDescription(String description) { | |||
| this.description = description; | |||
| } | |||
| public Integer getIsRepeat() { | |||
| return isRepeat; | |||
| } | |||
| public TBMaintenanceSchedule isRepeat(Integer isRepeat) { | |||
| this.isRepeat = isRepeat; | |||
| return this; | |||
| } | |||
| public void setIsRepeat(Integer isRepeat) { | |||
| this.isRepeat = isRepeat; | |||
| } | |||
| public String getRepeatEvery() { | |||
| return repeatEvery; | |||
| } | |||
| public TBMaintenanceSchedule repeatEvery(String repeatEvery) { | |||
| this.repeatEvery = repeatEvery; | |||
| return this; | |||
| } | |||
| public void setRepeatEvery(String repeatEvery) { | |||
| this.repeatEvery = repeatEvery; | |||
| } | |||
| public Integer getIsRepeatOnSunday() { | |||
| return isRepeatOnSunday; | |||
| } | |||
| public TBMaintenanceSchedule isRepeatOnSunday(Integer isRepeatOnSunday) { | |||
| this.isRepeatOnSunday = isRepeatOnSunday; | |||
| return this; | |||
| } | |||
| public void setIsRepeatOnSunday(Integer isRepeatOnSunday) { | |||
| this.isRepeatOnSunday = isRepeatOnSunday; | |||
| } | |||
| public Integer getIsRepeatOnMonday() { | |||
| return isRepeatOnMonday; | |||
| } | |||
| public TBMaintenanceSchedule isRepeatOnMonday(Integer isRepeatOnMonday) { | |||
| this.isRepeatOnMonday = isRepeatOnMonday; | |||
| return this; | |||
| } | |||
| public void setIsRepeatOnMonday(Integer isRepeatOnMonday) { | |||
| this.isRepeatOnMonday = isRepeatOnMonday; | |||
| } | |||
| public Integer getIsRepeatOnTuesday() { | |||
| return isRepeatOnTuesday; | |||
| } | |||
| public TBMaintenanceSchedule isRepeatOnTuesday(Integer isRepeatOnTuesday) { | |||
| this.isRepeatOnTuesday = isRepeatOnTuesday; | |||
| return this; | |||
| } | |||
| public void setIsRepeatOnTuesday(Integer isRepeatOnTuesday) { | |||
| this.isRepeatOnTuesday = isRepeatOnTuesday; | |||
| } | |||
| public Integer getIsRepeatOnWednesday() { | |||
| return isRepeatOnWednesday; | |||
| } | |||
| public TBMaintenanceSchedule isRepeatOnWednesday(Integer isRepeatOnWednesday) { | |||
| this.isRepeatOnWednesday = isRepeatOnWednesday; | |||
| return this; | |||
| } | |||
| public void setIsRepeatOnWednesday(Integer isRepeatOnWednesday) { | |||
| this.isRepeatOnWednesday = isRepeatOnWednesday; | |||
| } | |||
| public Integer getIsRepeatOnThursday() { | |||
| return isRepeatOnThursday; | |||
| } | |||
| public TBMaintenanceSchedule isRepeatOnThursday(Integer isRepeatOnThursday) { | |||
| this.isRepeatOnThursday = isRepeatOnThursday; | |||
| return this; | |||
| } | |||
| public void setIsRepeatOnThursday(Integer isRepeatOnThursday) { | |||
| this.isRepeatOnThursday = isRepeatOnThursday; | |||
| } | |||
| public Integer getIsRepeatOnFriday() { | |||
| return isRepeatOnFriday; | |||
| } | |||
| public TBMaintenanceSchedule isRepeatOnFriday(Integer isRepeatOnFriday) { | |||
| this.isRepeatOnFriday = isRepeatOnFriday; | |||
| return this; | |||
| } | |||
| public void setIsRepeatOnFriday(Integer isRepeatOnFriday) { | |||
| this.isRepeatOnFriday = isRepeatOnFriday; | |||
| } | |||
| public Integer getIsRepeatOnSaturday() { | |||
| return isRepeatOnSaturday; | |||
| } | |||
| public TBMaintenanceSchedule isRepeatOnSaturday(Integer isRepeatOnSaturday) { | |||
| this.isRepeatOnSaturday = isRepeatOnSaturday; | |||
| return this; | |||
| } | |||
| public void setIsRepeatOnSaturday(Integer isRepeatOnSaturday) { | |||
| this.isRepeatOnSaturday = isRepeatOnSaturday; | |||
| } | |||
| public Integer getDayOfMonth() { | |||
| return dayOfMonth; | |||
| } | |||
| public TBMaintenanceSchedule dayOfMonth(Integer dayOfMonth) { | |||
| this.dayOfMonth = dayOfMonth; | |||
| return this; | |||
| } | |||
| public void setDayOfMonth(Integer dayOfMonth) { | |||
| this.dayOfMonth = dayOfMonth; | |||
| } | |||
| public Instant getEndsOn() { | |||
| return endsOn; | |||
| } | |||
| public TBMaintenanceSchedule endsOn(Instant endsOn) { | |||
| this.endsOn = endsOn; | |||
| return this; | |||
| } | |||
| public void setEndsOn(Instant endsOn) { | |||
| this.endsOn = endsOn; | |||
| } | |||
| public Integer getEndsAfterXOccurrences() { | |||
| return endsAfterXOccurrences; | |||
| } | |||
| public TBMaintenanceSchedule endsAfterXOccurrences(Integer endsAfterXOccurrences) { | |||
| this.endsAfterXOccurrences = endsAfterXOccurrences; | |||
| return this; | |||
| } | |||
| public void setEndsAfterXOccurrences(Integer endsAfterXOccurrences) { | |||
| this.endsAfterXOccurrences = endsAfterXOccurrences; | |||
| } | |||
| public Instant getCreatedDate() { | |||
| return createdDate; | |||
| } | |||
| public TBMaintenanceSchedule createdDate(Instant createdDate) { | |||
| this.createdDate = createdDate; | |||
| return this; | |||
| } | |||
| public void setCreatedDate(Instant createdDate) { | |||
| this.createdDate = createdDate; | |||
| } | |||
| public Instant getModifiedDate() { | |||
| return modifiedDate; | |||
| } | |||
| public TBMaintenanceSchedule modifiedDate(Instant modifiedDate) { | |||
| this.modifiedDate = modifiedDate; | |||
| return this; | |||
| } | |||
| public void setModifiedDate(Instant modifiedDate) { | |||
| this.modifiedDate = modifiedDate; | |||
| } | |||
| public Instant getDeletedDate() { | |||
| return deletedDate; | |||
| } | |||
| public TBMaintenanceSchedule deletedDate(Instant deletedDate) { | |||
| this.deletedDate = deletedDate; | |||
| return this; | |||
| } | |||
| public void setDeletedDate(Instant deletedDate) { | |||
| this.deletedDate = deletedDate; | |||
| } | |||
| public TBDetailUser getCreatedBy() { | |||
| return createdBy; | |||
| } | |||
| public TBMaintenanceSchedule createdBy(TBDetailUser tBDetailUser) { | |||
| this.createdBy = tBDetailUser; | |||
| return this; | |||
| } | |||
| public void setCreatedBy(TBDetailUser tBDetailUser) { | |||
| this.createdBy = tBDetailUser; | |||
| } | |||
| public TBDetailUser getModifiedBy() { | |||
| return modifiedBy; | |||
| } | |||
| public TBMaintenanceSchedule modifiedBy(TBDetailUser tBDetailUser) { | |||
| this.modifiedBy = tBDetailUser; | |||
| return this; | |||
| } | |||
| public void setModifiedBy(TBDetailUser tBDetailUser) { | |||
| this.modifiedBy = tBDetailUser; | |||
| } | |||
| public TBDetailUser getDeletedBy() { | |||
| return deletedBy; | |||
| } | |||
| public TBMaintenanceSchedule deletedBy(TBDetailUser tBDetailUser) { | |||
| this.deletedBy = tBDetailUser; | |||
| return this; | |||
| } | |||
| public void setDeletedBy(TBDetailUser tBDetailUser) { | |||
| this.deletedBy = tBDetailUser; | |||
| } | |||
| // jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove | |||
| @Override | |||
| public boolean equals(Object o) { | |||
| if (this == o) { | |||
| return true; | |||
| } | |||
| if (o == null || getClass() != o.getClass()) { | |||
| return false; | |||
| } | |||
| TBMaintenanceSchedule tBMaintenanceSchedule = (TBMaintenanceSchedule) o; | |||
| if (tBMaintenanceSchedule.getId() == null || getId() == null) { | |||
| return false; | |||
| } | |||
| return Objects.equals(getId(), tBMaintenanceSchedule.getId()); | |||
| } | |||
| @Override | |||
| public int hashCode() { | |||
| return Objects.hashCode(getId()); | |||
| } | |||
| @Override | |||
| public String toString() { | |||
| return "TBMaintenanceSchedule{" + | |||
| "id=" + getId() + | |||
| ", description='" + getDescription() + "'" + | |||
| ", isRepeat=" + getIsRepeat() + | |||
| ", repeatEvery='" + getRepeatEvery() + "'" + | |||
| ", isRepeatOnSunday=" + getIsRepeatOnSunday() + | |||
| ", isRepeatOnMonday=" + getIsRepeatOnMonday() + | |||
| ", isRepeatOnTuesday=" + getIsRepeatOnTuesday() + | |||
| ", isRepeatOnWednesday=" + getIsRepeatOnWednesday() + | |||
| ", isRepeatOnThursday=" + getIsRepeatOnThursday() + | |||
| ", isRepeatOnFriday=" + getIsRepeatOnFriday() + | |||
| ", isRepeatOnSaturday=" + getIsRepeatOnSaturday() + | |||
| ", dayOfMonth=" + getDayOfMonth() + | |||
| ", endsOn='" + getEndsOn() + "'" + | |||
| ", endsAfterXOccurrences=" + getEndsAfterXOccurrences() + | |||
| ", createdDate='" + getCreatedDate() + "'" + | |||
| ", modifiedDate='" + getModifiedDate() + "'" + | |||
| ", deletedDate='" + getDeletedDate() + "'" + | |||
| "}"; | |||
| } | |||
| } | |||
| @@ -0,0 +1,336 @@ | |||
| package vn.azteam.tpf.domain; | |||
| import org.hibernate.annotations.Cache; | |||
| import org.hibernate.annotations.CacheConcurrencyStrategy; | |||
| import javax.persistence.*; | |||
| import org.springframework.data.elasticsearch.annotations.Document; | |||
| import java.io.Serializable; | |||
| import java.time.Instant; | |||
| import java.util.Objects; | |||
| /** | |||
| * A TBNotification. | |||
| */ | |||
| @Entity | |||
| @Table(name = "tb_notification") | |||
| @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) | |||
| @Document(indexName = "smf_tbnotification") | |||
| public class TBNotification implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| @Id | |||
| @GeneratedValue(strategy = GenerationType.IDENTITY) | |||
| private Long id; | |||
| @Column(name = "channel") | |||
| private String channel; | |||
| @Column(name = "send_from") | |||
| private Long sendFrom; | |||
| @Column(name = "send_to") | |||
| private Long sendTo; | |||
| @Column(name = "subject") | |||
| private String subject; | |||
| @Column(name = "message") | |||
| private String message; | |||
| @Column(name = "status") | |||
| private String status; | |||
| @Column(name = "tb_crop_id") | |||
| private Long tbCropId; | |||
| @Column(name = "tb_entity_id") | |||
| private Long tbEntityId; | |||
| @Column(name = "click_action") | |||
| private String clickAction; | |||
| @Column(name = "jhi_contents") | |||
| private String contents; | |||
| @Column(name = "created_date") | |||
| private Instant createdDate; | |||
| @Column(name = "send_date") | |||
| private Instant sendDate; | |||
| @Column(name = "is_read") | |||
| private Integer isRead; | |||
| @Column(name = "is_test_message") | |||
| private Integer isTestMessage; | |||
| @Column(name = "jhi_type") | |||
| private String type; | |||
| @Column(name = "external_id") | |||
| private Long externalId; | |||
| // jhipster-needle-entity-add-field - JHipster will add fields here, do not remove | |||
| public Long getId() { | |||
| return id; | |||
| } | |||
| public void setId(Long id) { | |||
| this.id = id; | |||
| } | |||
| public String getChannel() { | |||
| return channel; | |||
| } | |||
| public TBNotification channel(String channel) { | |||
| this.channel = channel; | |||
| return this; | |||
| } | |||
| public void setChannel(String channel) { | |||
| this.channel = channel; | |||
| } | |||
| public Long getSendFrom() { | |||
| return sendFrom; | |||
| } | |||
| public TBNotification sendFrom(Long sendFrom) { | |||
| this.sendFrom = sendFrom; | |||
| return this; | |||
| } | |||
| public void setSendFrom(Long sendFrom) { | |||
| this.sendFrom = sendFrom; | |||
| } | |||
| public Long getSendTo() { | |||
| return sendTo; | |||
| } | |||
| public TBNotification sendTo(Long sendTo) { | |||
| this.sendTo = sendTo; | |||
| return this; | |||
| } | |||
| public void setSendTo(Long sendTo) { | |||
| this.sendTo = sendTo; | |||
| } | |||
| public String getSubject() { | |||
| return subject; | |||
| } | |||
| public TBNotification subject(String subject) { | |||
| this.subject = subject; | |||
| return this; | |||
| } | |||
| public void setSubject(String subject) { | |||
| this.subject = subject; | |||
| } | |||
| public String getMessage() { | |||
| return message; | |||
| } | |||
| public TBNotification message(String message) { | |||
| this.message = message; | |||
| return this; | |||
| } | |||
| public void setMessage(String message) { | |||
| this.message = message; | |||
| } | |||
| public String getStatus() { | |||
| return status; | |||
| } | |||
| public TBNotification status(String status) { | |||
| this.status = status; | |||
| return this; | |||
| } | |||
| public void setStatus(String status) { | |||
| this.status = status; | |||
| } | |||
| public Long getTbCropId() { | |||
| return tbCropId; | |||
| } | |||
| public TBNotification tbCropId(Long tbCropId) { | |||
| this.tbCropId = tbCropId; | |||
| return this; | |||
| } | |||
| public void setTbCropId(Long tbCropId) { | |||
| this.tbCropId = tbCropId; | |||
| } | |||
| public Long getTbEntityId() { | |||
| return tbEntityId; | |||
| } | |||
| public TBNotification tbEntityId(Long tbEntityId) { | |||
| this.tbEntityId = tbEntityId; | |||
| return this; | |||
| } | |||
| public void setTbEntityId(Long tbEntityId) { | |||
| this.tbEntityId = tbEntityId; | |||
| } | |||
| public String getClickAction() { | |||
| return clickAction; | |||
| } | |||
| public TBNotification clickAction(String clickAction) { | |||
| this.clickAction = clickAction; | |||
| return this; | |||
| } | |||
| public void setClickAction(String clickAction) { | |||
| this.clickAction = clickAction; | |||
| } | |||
| public String getContents() { | |||
| return contents; | |||
| } | |||
| public TBNotification contents(String contents) { | |||
| this.contents = contents; | |||
| return this; | |||
| } | |||
| public void setContents(String contents) { | |||
| this.contents = contents; | |||
| } | |||
| public Instant getCreatedDate() { | |||
| return createdDate; | |||
| } | |||
| public TBNotification createdDate(Instant createdDate) { | |||
| this.createdDate = createdDate; | |||
| return this; | |||
| } | |||
| public void setCreatedDate(Instant createdDate) { | |||
| this.createdDate = createdDate; | |||
| } | |||
| public Instant getSendDate() { | |||
| return sendDate; | |||
| } | |||
| public TBNotification sendDate(Instant sendDate) { | |||
| this.sendDate = sendDate; | |||
| return this; | |||
| } | |||
| public void setSendDate(Instant sendDate) { | |||
| this.sendDate = sendDate; | |||
| } | |||
| public Integer getIsRead() { | |||
| return isRead; | |||
| } | |||
| public TBNotification isRead(Integer isRead) { | |||
| this.isRead = isRead; | |||
| return this; | |||
| } | |||
| public void setIsRead(Integer isRead) { | |||
| this.isRead = isRead; | |||
| } | |||
| public Integer getIsTestMessage() { | |||
| return isTestMessage; | |||
| } | |||
| public TBNotification isTestMessage(Integer isTestMessage) { | |||
| this.isTestMessage = isTestMessage; | |||
| return this; | |||
| } | |||
| public void setIsTestMessage(Integer isTestMessage) { | |||
| this.isTestMessage = isTestMessage; | |||
| } | |||
| public String getType() { | |||
| return type; | |||
| } | |||
| public TBNotification type(String type) { | |||
| this.type = type; | |||
| return this; | |||
| } | |||
| public void setType(String type) { | |||
| this.type = type; | |||
| } | |||
| public Long getExternalId() { | |||
| return externalId; | |||
| } | |||
| public TBNotification externalId(Long externalId) { | |||
| this.externalId = externalId; | |||
| return this; | |||
| } | |||
| public void setExternalId(Long externalId) { | |||
| this.externalId = externalId; | |||
| } | |||
| // jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove | |||
| @Override | |||
| public boolean equals(Object o) { | |||
| if (this == o) { | |||
| return true; | |||
| } | |||
| if (o == null || getClass() != o.getClass()) { | |||
| return false; | |||
| } | |||
| TBNotification tBNotification = (TBNotification) o; | |||
| if (tBNotification.getId() == null || getId() == null) { | |||
| return false; | |||
| } | |||
| return Objects.equals(getId(), tBNotification.getId()); | |||
| } | |||
| @Override | |||
| public int hashCode() { | |||
| return Objects.hashCode(getId()); | |||
| } | |||
| @Override | |||
| public String toString() { | |||
| return "TBNotification{" + | |||
| "id=" + getId() + | |||
| ", channel='" + getChannel() + "'" + | |||
| ", sendFrom=" + getSendFrom() + | |||
| ", sendTo=" + getSendTo() + | |||
| ", subject='" + getSubject() + "'" + | |||
| ", message='" + getMessage() + "'" + | |||
| ", status='" + getStatus() + "'" + | |||
| ", tbCropId=" + getTbCropId() + | |||
| ", tbEntityId=" + getTbEntityId() + | |||
| ", clickAction='" + getClickAction() + "'" + | |||
| ", contents='" + getContents() + "'" + | |||
| ", createdDate='" + getCreatedDate() + "'" + | |||
| ", sendDate='" + getSendDate() + "'" + | |||
| ", isRead=" + getIsRead() + | |||
| ", isTestMessage=" + getIsTestMessage() + | |||
| ", type='" + getType() + "'" + | |||
| ", externalId=" + getExternalId() + | |||
| "}"; | |||
| } | |||
| } | |||
| @@ -0,0 +1,117 @@ | |||
| package vn.azteam.tpf.domain; | |||
| import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | |||
| import org.hibernate.annotations.Cache; | |||
| import org.hibernate.annotations.CacheConcurrencyStrategy; | |||
| import javax.persistence.*; | |||
| import org.springframework.data.elasticsearch.annotations.Document; | |||
| import java.io.Serializable; | |||
| import java.util.Objects; | |||
| /** | |||
| * A TBNurseryDetails. | |||
| */ | |||
| @Entity | |||
| @Table(name = "tb_nursery_details") | |||
| @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) | |||
| @Document(indexName = "smf_tbnurserydetails") | |||
| public class TBNurseryDetails implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| @Id | |||
| @GeneratedValue(strategy = GenerationType.IDENTITY) | |||
| private Long id; | |||
| @Column(name = "worker_name") | |||
| private String workerName; | |||
| @Column(name = "tray_number") | |||
| private String trayNumber; | |||
| @ManyToOne | |||
| @JsonIgnoreProperties("") | |||
| private TBActivity tbActivity; | |||
| // jhipster-needle-entity-add-field - JHipster will add fields here, do not remove | |||
| public Long getId() { | |||
| return id; | |||
| } | |||
| public void setId(Long id) { | |||
| this.id = id; | |||
| } | |||
| public String getWorkerName() { | |||
| return workerName; | |||
| } | |||
| public TBNurseryDetails workerName(String workerName) { | |||
| this.workerName = workerName; | |||
| return this; | |||
| } | |||
| public void setWorkerName(String workerName) { | |||
| this.workerName = workerName; | |||
| } | |||
| public String getTrayNumber() { | |||
| return trayNumber; | |||
| } | |||
| public TBNurseryDetails trayNumber(String trayNumber) { | |||
| this.trayNumber = trayNumber; | |||
| return this; | |||
| } | |||
| public void setTrayNumber(String trayNumber) { | |||
| this.trayNumber = trayNumber; | |||
| } | |||
| public TBActivity getTbActivity() { | |||
| return tbActivity; | |||
| } | |||
| public TBNurseryDetails tbActivity(TBActivity tbActivity) { | |||
| this.tbActivity = tbActivity; | |||
| return this; | |||
| } | |||
| public void setTbActivity(TBActivity tbActivity) { | |||
| this.tbActivity = tbActivity; | |||
| } | |||
| // jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove | |||
| @Override | |||
| public boolean equals(Object o) { | |||
| if (this == o) { | |||
| return true; | |||
| } | |||
| if (o == null || getClass() != o.getClass()) { | |||
| return false; | |||
| } | |||
| TBNurseryDetails tBNurseryDetails = (TBNurseryDetails) o; | |||
| if (tBNurseryDetails.getId() == null || getId() == null) { | |||
| return false; | |||
| } | |||
| return Objects.equals(getId(), tBNurseryDetails.getId()); | |||
| } | |||
| @Override | |||
| public int hashCode() { | |||
| return Objects.hashCode(getId()); | |||
| } | |||
| @Override | |||
| public String toString() { | |||
| return "TBNurseryDetails{" + | |||
| "id=" + getId() + | |||
| ", workerName='" + getWorkerName() + "'" + | |||
| ", trayNumber='" + getTrayNumber() + "'" + | |||
| "}"; | |||
| } | |||
| } | |||
| @@ -0,0 +1,324 @@ | |||
| package vn.azteam.tpf.domain; | |||
| import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | |||
| import io.swagger.models.auth.In; | |||
| import org.hibernate.annotations.Cache; | |||
| import org.hibernate.annotations.CacheConcurrencyStrategy; | |||
| import javax.persistence.*; | |||
| import org.springframework.data.elasticsearch.annotations.Document; | |||
| import java.io.Serializable; | |||
| import java.time.Instant; | |||
| import java.util.Objects; | |||
| /** | |||
| * A TBObjectParameter. | |||
| */ | |||
| @Entity | |||
| @Table(name = "tb_object_parameter") | |||
| @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) | |||
| @Document(indexName = "smf_tbobjectparameter") | |||
| public class TBObjectParameter implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| @Id | |||
| @GeneratedValue(strategy = GenerationType.IDENTITY) | |||
| private Long id; | |||
| @Column(name = "name") | |||
| private String name; | |||
| @Column(name = "unit") | |||
| private String unit; | |||
| @Column(name = "description") | |||
| private String description; | |||
| @Column(name = "created_date") | |||
| private Instant createdDate; | |||
| @Column(name = "modified_date") | |||
| private Instant modifiedDate; | |||
| @Column(name = "deleted_date") | |||
| private Instant deletedDate; | |||
| @ManyToOne(fetch=FetchType.LAZY) | |||
| @JsonIgnoreProperties("") | |||
| @JoinColumn(name = "created_by") | |||
| private TBDetailUser createdBy; | |||
| @ManyToOne(fetch=FetchType.LAZY) | |||
| @JsonIgnoreProperties("") | |||
| @JoinColumn(name = "modified_by") | |||
| private TBDetailUser modifiedBy; | |||
| @ManyToOne(fetch=FetchType.LAZY) | |||
| @JsonIgnoreProperties("") | |||
| @JoinColumn(name = "deleted_by") | |||
| private TBDetailUser deletedBy; | |||
| @ManyToOne | |||
| @JsonIgnoreProperties("") | |||
| @JoinColumn(name = "activity_type") | |||
| private TBActivityType activityType; | |||
| @ManyToOne | |||
| @JsonIgnoreProperties("") | |||
| @JoinColumn(name = "tb_control_type_id") | |||
| private TBControlType tbControlType; | |||
| @Column(name = "is_guideline_using") | |||
| private Boolean isGuidelineUsing; | |||
| @Column(name = "is_mandatory") | |||
| private Boolean isMandatory; | |||
| @Column(name = "group_name") | |||
| private String groupName; | |||
| @ManyToOne | |||
| @JsonIgnoreProperties("") | |||
| @JoinColumn(name = "tb_activity_extend_type_id") | |||
| private TBActivityExtendType tbActivityExtendType; | |||
| // jhipster-needle-entity-add-field - JHipster will add fields here, do not remove | |||
| public Long getId() { | |||
| return id; | |||
| } | |||
| public void setId(Long id) { | |||
| this.id = id; | |||
| } | |||
| public String getName() { | |||
| return name; | |||
| } | |||
| public TBObjectParameter name(String name) { | |||
| this.name = name; | |||
| return this; | |||
| } | |||
| public void setName(String name) { | |||
| this.name = name; | |||
| } | |||
| public String getUnit() { | |||
| return unit; | |||
| } | |||
| public TBObjectParameter unit(String unit) { | |||
| this.unit = unit; | |||
| return this; | |||
| } | |||
| public void setUnit(String unit) { | |||
| this.unit = unit; | |||
| } | |||
| public String getDescription() { | |||
| return description; | |||
| } | |||
| public TBObjectParameter description(String description) { | |||
| this.description = description; | |||
| return this; | |||
| } | |||
| public void setDescription(String description) { | |||
| this.description = description; | |||
| } | |||
| public Instant getCreatedDate() { | |||
| return createdDate; | |||
| } | |||
| public TBObjectParameter createdDate(Instant createdDate) { | |||
| this.createdDate = createdDate; | |||
| return this; | |||
| } | |||
| public void setCreatedDate(Instant createdDate) { | |||
| this.createdDate = createdDate; | |||
| } | |||
| public Instant getModifiedDate() { | |||
| return modifiedDate; | |||
| } | |||
| public TBObjectParameter modifiedDate(Instant modifiedDate) { | |||
| this.modifiedDate = modifiedDate; | |||
| return this; | |||
| } | |||
| public void setModifiedDate(Instant modifiedDate) { | |||
| this.modifiedDate = modifiedDate; | |||
| } | |||
| public Instant getDeletedDate() { | |||
| return deletedDate; | |||
| } | |||
| public TBObjectParameter deletedDate(Instant deletedDate) { | |||
| this.deletedDate = deletedDate; | |||
| return this; | |||
| } | |||
| public void setDeletedDate(Instant deletedDate) { | |||
| this.deletedDate = deletedDate; | |||
| } | |||
| public TBDetailUser getDeletedBy() { | |||
| return deletedBy; | |||
| } | |||
| public TBObjectParameter deletedBy(TBDetailUser tBDetailUser) { | |||
| this.deletedBy = tBDetailUser; | |||
| return this; | |||
| } | |||
| public void setDeletedBy(TBDetailUser tBDetailUser) { | |||
| this.deletedBy = tBDetailUser; | |||
| } | |||
| public TBDetailUser getCreatedBy() { | |||
| return createdBy; | |||
| } | |||
| public TBObjectParameter createdBy(TBDetailUser tBDetailUser) { | |||
| this.createdBy = tBDetailUser; | |||
| return this; | |||
| } | |||
| public void setCreatedBy(TBDetailUser tBDetailUser) { | |||
| this.createdBy = tBDetailUser; | |||
| } | |||
| public TBDetailUser getModifiedBy() { | |||
| return modifiedBy; | |||
| } | |||
| public TBObjectParameter modifiedBy(TBDetailUser tBDetailUser) { | |||
| this.modifiedBy = tBDetailUser; | |||
| return this; | |||
| } | |||
| public void setModifiedBy(TBDetailUser tBDetailUser) { | |||
| this.modifiedBy = tBDetailUser; | |||
| } | |||
| public TBActivityType getActivityType() { | |||
| return activityType; | |||
| } | |||
| public TBObjectParameter activityType(TBActivityType tBActivityType) { | |||
| this.activityType = tBActivityType; | |||
| return this; | |||
| } | |||
| public void setActivityType(TBActivityType tBActivityType) { | |||
| this.activityType = tBActivityType; | |||
| } | |||
| public TBActivityExtendType getTbActivityExtendType() { | |||
| return tbActivityExtendType; | |||
| } | |||
| public TBObjectParameter tbActivityExtendType(TBActivityExtendType tbActivityExtendType) { | |||
| this.tbActivityExtendType = tbActivityExtendType; | |||
| return this; | |||
| } | |||
| public void setTbActivityExtendType(TBActivityExtendType tbActivityExtendType) { | |||
| this.tbActivityExtendType = tbActivityExtendType; | |||
| } | |||
| public Boolean getIsGuidelineUsing() { | |||
| return isGuidelineUsing; | |||
| } | |||
| public TBObjectParameter isGuidelineUsing(Boolean isGuidelineUsing) { | |||
| this.isGuidelineUsing = isGuidelineUsing; | |||
| return this; | |||
| } | |||
| public void setIsGuidelineUsing(Boolean isGuidelineUsing) { | |||
| this.isGuidelineUsing = isGuidelineUsing; | |||
| } | |||
| public Boolean getIsMandatory() { | |||
| return isMandatory; | |||
| } | |||
| public TBObjectParameter isMandatory(Boolean isMandatory) { | |||
| this.isMandatory = isMandatory; | |||
| return this; | |||
| } | |||
| public void setIsMandatory(Boolean isMandatory) { | |||
| this.isMandatory = isMandatory; | |||
| } | |||
| public String getGroupName() { | |||
| return groupName; | |||
| } | |||
| public TBObjectParameter groupName(String groupName) { | |||
| this.groupName = groupName; | |||
| return this; | |||
| } | |||
| public void setGroupName(String groupName) { | |||
| this.groupName = groupName; | |||
| } | |||
| public TBControlType getTbControlType() { | |||
| return tbControlType; | |||
| } | |||
| public TBObjectParameter tbControlType(TBControlType tbControlType) { | |||
| this.tbControlType = tbControlType; | |||
| return this; | |||
| } | |||
| public void setTbControlType(TBControlType tbControlType) { | |||
| this.tbControlType = tbControlType; | |||
| } | |||
| // jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove | |||
| @Override | |||
| public boolean equals(Object o) { | |||
| if (this == o) { | |||
| return true; | |||
| } | |||
| if (o == null || getClass() != o.getClass()) { | |||
| return false; | |||
| } | |||
| TBObjectParameter tBObjectParameter = (TBObjectParameter) o; | |||
| if (tBObjectParameter.getId() == null || getId() == null) { | |||
| return false; | |||
| } | |||
| return Objects.equals(getId(), tBObjectParameter.getId()); | |||
| } | |||
| @Override | |||
| public int hashCode() { | |||
| return Objects.hashCode(getId()); | |||
| } | |||
| @Override | |||
| public String toString() { | |||
| return "TBObjectParameter{" + | |||
| "id=" + getId() + | |||
| ", name='" + getName() + "'" + | |||
| ", unit='" + getUnit() + "'" + | |||
| ", description='" + getDescription() + "'" + | |||
| ", createdDate='" + getCreatedDate() + "'" + | |||
| ", modifiedDate='" + getModifiedDate() + "'" + | |||
| ", deletedDate='" + getDeletedDate() + "'" + | |||
| "}"; | |||
| } | |||
| } | |||