inisialisasi

This commit is contained in:
tias
2024-06-15 16:59:12 +07:00
commit 3e97011f66
90 changed files with 5620 additions and 0 deletions

5
.dockerignore Normal file
View File

@ -0,0 +1,5 @@
*
!target/*-runner
!target/*-runner.jar
!target/lib/*
!target/quarkus-app/*

43
.gitignore vendored Normal file
View File

@ -0,0 +1,43 @@
#Maven
target/
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
release.properties
.flattened-pom.xml
# Eclipse
.project
.classpath
.settings/
bin/
# IntelliJ
.idea
*.ipr
*.iml
*.iws
# NetBeans
nb-configuration.xml
# Visual Studio Code
.vscode
.factorypath
# OSX
.DS_Store
# Vim
*.swp
*.swo
# patch
*.orig
*.rej
# Local environment
.env
# Plugin directory
/.quarkus/cli/plugins/

1
.mvn/wrapper/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
maven-wrapper.jar

View File

@ -0,0 +1,98 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
import java.io.IOException;
import java.io.InputStream;
import java.net.Authenticator;
import java.net.PasswordAuthentication;
import java.net.URL;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.StandardCopyOption;
public final class MavenWrapperDownloader
{
private static final String WRAPPER_VERSION = "3.2.0";
private static final boolean VERBOSE = Boolean.parseBoolean( System.getenv( "MVNW_VERBOSE" ) );
public static void main( String[] args )
{
log( "Apache Maven Wrapper Downloader " + WRAPPER_VERSION );
if ( args.length != 2 )
{
System.err.println( " - ERROR wrapperUrl or wrapperJarPath parameter missing" );
System.exit( 1 );
}
try
{
log( " - Downloader started" );
final URL wrapperUrl = new URL( args[0] );
final String jarPath = args[1].replace( "..", "" ); // Sanitize path
final Path wrapperJarPath = Paths.get( jarPath ).toAbsolutePath().normalize();
downloadFileFromURL( wrapperUrl, wrapperJarPath );
log( "Done" );
}
catch ( IOException e )
{
System.err.println( "- Error downloading: " + e.getMessage() );
if ( VERBOSE )
{
e.printStackTrace();
}
System.exit( 1 );
}
}
private static void downloadFileFromURL( URL wrapperUrl, Path wrapperJarPath )
throws IOException
{
log( " - Downloading to: " + wrapperJarPath );
if ( System.getenv( "MVNW_USERNAME" ) != null && System.getenv( "MVNW_PASSWORD" ) != null )
{
final String username = System.getenv( "MVNW_USERNAME" );
final char[] password = System.getenv( "MVNW_PASSWORD" ).toCharArray();
Authenticator.setDefault( new Authenticator()
{
@Override
protected PasswordAuthentication getPasswordAuthentication()
{
return new PasswordAuthentication( username, password );
}
} );
}
try ( InputStream inStream = wrapperUrl.openStream() )
{
Files.copy( inStream, wrapperJarPath, StandardCopyOption.REPLACE_EXISTING );
}
log( " - Downloader complete" );
}
private static void log( String msg )
{
if ( VERBOSE )
{
System.out.println( msg );
}
}
}

18
.mvn/wrapper/maven-wrapper.properties vendored Normal file
View File

@ -0,0 +1,18 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.6/apache-maven-3.9.6-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar

61
README.md Normal file
View File

@ -0,0 +1,61 @@
# api-keluhan-mobile
This project uses Quarkus, the Supersonic Subatomic Java Framework.
If you want to learn more about Quarkus, please visit its website: https://quarkus.io/ .
## Running the application in dev mode
You can run your application in dev mode that enables live coding using:
```shell script
./mvnw compile quarkus:dev
```
> **_NOTE:_** Quarkus now ships with a Dev UI, which is available in dev mode only at http://localhost:8080/q/dev/.
## Packaging and running the application
The application can be packaged using:
```shell script
./mvnw package
```
It produces the `quarkus-run.jar` file in the `target/quarkus-app/` directory.
Be aware that its not an _über-jar_ as the dependencies are copied into the `target/quarkus-app/lib/` directory.
The application is now runnable using `java -jar target/quarkus-app/quarkus-run.jar`.
If you want to build an _über-jar_, execute the following command:
```shell script
./mvnw package -Dquarkus.package.type=uber-jar
```
The application, packaged as an _über-jar_, is now runnable using `java -jar target/*-runner.jar`.
## Creating a native executable
You can create a native executable using:
```shell script
./mvnw package -Dnative
```
Or, if you don't have GraalVM installed, you can run the native executable build in a container using:
```shell script
./mvnw package -Dnative -Dquarkus.native.container-build=true
```
You can then execute your native executable with: `./target/api-keluhan-mobile-1.0.0-SNAPSHOT-runner`
If you want to learn more about building native executables, please consult https://quarkus.io/guides/maven-tooling.
## Related Guides
- RESTEasy Reactive ([guide](https://quarkus.io/guides/resteasy-reactive)): A Jakarta REST implementation utilizing build time processing and Vert.x. This extension is not compatible with the quarkus-resteasy extension, or any of the extensions that depend on it.
- Reactive PostgreSQL client ([guide](https://quarkus.io/guides/reactive-sql-clients)): Connect to the PostgreSQL database using the reactive pattern
## Provided Code
### RESTEasy Reactive
Easily start your Reactive RESTful Web Services
[Related guide section...](https://quarkus.io/guides/getting-started-reactive#reactive-jax-rs-resources)

6
build.sh Normal file
View File

@ -0,0 +1,6 @@
echo "-----------------------------------"
echo "Build and deploy api chempion version : $1"
echo "-----------------------------------"
./mvnw package
docker build -f src/main/docker/Dockerfile.jvm -t tias333/api-chempion:v.0.0.$1 .
docker push tias333/api-chempion:v.0.0.$1

308
mvnw vendored Normal file
View File

@ -0,0 +1,308 @@
#!/bin/sh
# ----------------------------------------------------------------------------
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
# ----------------------------------------------------------------------------
# ----------------------------------------------------------------------------
# Apache Maven Wrapper startup batch script, version 3.2.0
#
# Required ENV vars:
# ------------------
# JAVA_HOME - location of a JDK home dir
#
# Optional ENV vars
# -----------------
# MAVEN_OPTS - parameters passed to the Java VM when running Maven
# e.g. to debug Maven itself, use
# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
# MAVEN_SKIP_RC - flag to disable loading of mavenrc files
# ----------------------------------------------------------------------------
if [ -z "$MAVEN_SKIP_RC" ] ; then
if [ -f /usr/local/etc/mavenrc ] ; then
. /usr/local/etc/mavenrc
fi
if [ -f /etc/mavenrc ] ; then
. /etc/mavenrc
fi
if [ -f "$HOME/.mavenrc" ] ; then
. "$HOME/.mavenrc"
fi
fi
# OS specific support. $var _must_ be set to either true or false.
cygwin=false;
darwin=false;
mingw=false
case "$(uname)" in
CYGWIN*) cygwin=true ;;
MINGW*) mingw=true;;
Darwin*) darwin=true
# Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
# See https://developer.apple.com/library/mac/qa/qa1170/_index.html
if [ -z "$JAVA_HOME" ]; then
if [ -x "/usr/libexec/java_home" ]; then
JAVA_HOME="$(/usr/libexec/java_home)"; export JAVA_HOME
else
JAVA_HOME="/Library/Java/Home"; export JAVA_HOME
fi
fi
;;
esac
if [ -z "$JAVA_HOME" ] ; then
if [ -r /etc/gentoo-release ] ; then
JAVA_HOME=$(java-config --jre-home)
fi
fi
# For Cygwin, ensure paths are in UNIX format before anything is touched
if $cygwin ; then
[ -n "$JAVA_HOME" ] &&
JAVA_HOME=$(cygpath --unix "$JAVA_HOME")
[ -n "$CLASSPATH" ] &&
CLASSPATH=$(cygpath --path --unix "$CLASSPATH")
fi
# For Mingw, ensure paths are in UNIX format before anything is touched
if $mingw ; then
[ -n "$JAVA_HOME" ] && [ -d "$JAVA_HOME" ] &&
JAVA_HOME="$(cd "$JAVA_HOME" || (echo "cannot cd into $JAVA_HOME."; exit 1); pwd)"
fi
if [ -z "$JAVA_HOME" ]; then
javaExecutable="$(which javac)"
if [ -n "$javaExecutable" ] && ! [ "$(expr "\"$javaExecutable\"" : '\([^ ]*\)')" = "no" ]; then
# readlink(1) is not available as standard on Solaris 10.
readLink=$(which readlink)
if [ ! "$(expr "$readLink" : '\([^ ]*\)')" = "no" ]; then
if $darwin ; then
javaHome="$(dirname "\"$javaExecutable\"")"
javaExecutable="$(cd "\"$javaHome\"" && pwd -P)/javac"
else
javaExecutable="$(readlink -f "\"$javaExecutable\"")"
fi
javaHome="$(dirname "\"$javaExecutable\"")"
javaHome=$(expr "$javaHome" : '\(.*\)/bin')
JAVA_HOME="$javaHome"
export JAVA_HOME
fi
fi
fi
if [ -z "$JAVACMD" ] ; then
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
else
JAVACMD="$(\unset -f command 2>/dev/null; \command -v java)"
fi
fi
if [ ! -x "$JAVACMD" ] ; then
echo "Error: JAVA_HOME is not defined correctly." >&2
echo " We cannot execute $JAVACMD" >&2
exit 1
fi
if [ -z "$JAVA_HOME" ] ; then
echo "Warning: JAVA_HOME environment variable is not set."
fi
# traverses directory structure from process work directory to filesystem root
# first directory with .mvn subdirectory is considered project base directory
find_maven_basedir() {
if [ -z "$1" ]
then
echo "Path not specified to find_maven_basedir"
return 1
fi
basedir="$1"
wdir="$1"
while [ "$wdir" != '/' ] ; do
if [ -d "$wdir"/.mvn ] ; then
basedir=$wdir
break
fi
# workaround for JBEAP-8937 (on Solaris 10/Sparc)
if [ -d "${wdir}" ]; then
wdir=$(cd "$wdir/.." || exit 1; pwd)
fi
# end of workaround
done
printf '%s' "$(cd "$basedir" || exit 1; pwd)"
}
# concatenates all lines of a file
concat_lines() {
if [ -f "$1" ]; then
# Remove \r in case we run on Windows within Git Bash
# and check out the repository with auto CRLF management
# enabled. Otherwise, we may read lines that are delimited with
# \r\n and produce $'-Xarg\r' rather than -Xarg due to word
# splitting rules.
tr -s '\r\n' ' ' < "$1"
fi
}
log() {
if [ "$MVNW_VERBOSE" = true ]; then
printf '%s\n' "$1"
fi
}
BASE_DIR=$(find_maven_basedir "$(dirname "$0")")
if [ -z "$BASE_DIR" ]; then
exit 1;
fi
MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}; export MAVEN_PROJECTBASEDIR
log "$MAVEN_PROJECTBASEDIR"
##########################################################################################
# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
# This allows using the maven wrapper in projects that prohibit checking in binary data.
##########################################################################################
wrapperJarPath="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar"
if [ -r "$wrapperJarPath" ]; then
log "Found $wrapperJarPath"
else
log "Couldn't find $wrapperJarPath, downloading it ..."
if [ -n "$MVNW_REPOURL" ]; then
wrapperUrl="$MVNW_REPOURL/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar"
else
wrapperUrl="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar"
fi
while IFS="=" read -r key value; do
# Remove '\r' from value to allow usage on windows as IFS does not consider '\r' as a separator ( considers space, tab, new line ('\n'), and custom '=' )
safeValue=$(echo "$value" | tr -d '\r')
case "$key" in (wrapperUrl) wrapperUrl="$safeValue"; break ;;
esac
done < "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.properties"
log "Downloading from: $wrapperUrl"
if $cygwin; then
wrapperJarPath=$(cygpath --path --windows "$wrapperJarPath")
fi
if command -v wget > /dev/null; then
log "Found wget ... using wget"
[ "$MVNW_VERBOSE" = true ] && QUIET="" || QUIET="--quiet"
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
wget $QUIET "$wrapperUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath"
else
wget $QUIET --http-user="$MVNW_USERNAME" --http-password="$MVNW_PASSWORD" "$wrapperUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath"
fi
elif command -v curl > /dev/null; then
log "Found curl ... using curl"
[ "$MVNW_VERBOSE" = true ] && QUIET="" || QUIET="--silent"
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
curl $QUIET -o "$wrapperJarPath" "$wrapperUrl" -f -L || rm -f "$wrapperJarPath"
else
curl $QUIET --user "$MVNW_USERNAME:$MVNW_PASSWORD" -o "$wrapperJarPath" "$wrapperUrl" -f -L || rm -f "$wrapperJarPath"
fi
else
log "Falling back to using Java to download"
javaSource="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/MavenWrapperDownloader.java"
javaClass="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/MavenWrapperDownloader.class"
# For Cygwin, switch paths to Windows format before running javac
if $cygwin; then
javaSource=$(cygpath --path --windows "$javaSource")
javaClass=$(cygpath --path --windows "$javaClass")
fi
if [ -e "$javaSource" ]; then
if [ ! -e "$javaClass" ]; then
log " - Compiling MavenWrapperDownloader.java ..."
("$JAVA_HOME/bin/javac" "$javaSource")
fi
if [ -e "$javaClass" ]; then
log " - Running MavenWrapperDownloader.java ..."
("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$wrapperUrl" "$wrapperJarPath") || rm -f "$wrapperJarPath"
fi
fi
fi
fi
##########################################################################################
# End of extension
##########################################################################################
# If specified, validate the SHA-256 sum of the Maven wrapper jar file
wrapperSha256Sum=""
while IFS="=" read -r key value; do
case "$key" in (wrapperSha256Sum) wrapperSha256Sum=$value; break ;;
esac
done < "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.properties"
if [ -n "$wrapperSha256Sum" ]; then
wrapperSha256Result=false
if command -v sha256sum > /dev/null; then
if echo "$wrapperSha256Sum $wrapperJarPath" | sha256sum -c > /dev/null 2>&1; then
wrapperSha256Result=true
fi
elif command -v shasum > /dev/null; then
if echo "$wrapperSha256Sum $wrapperJarPath" | shasum -a 256 -c > /dev/null 2>&1; then
wrapperSha256Result=true
fi
else
echo "Checksum validation was requested but neither 'sha256sum' or 'shasum' are available."
echo "Please install either command, or disable validation by removing 'wrapperSha256Sum' from your maven-wrapper.properties."
exit 1
fi
if [ $wrapperSha256Result = false ]; then
echo "Error: Failed to validate Maven wrapper SHA-256, your Maven wrapper might be compromised." >&2
echo "Investigate or delete $wrapperJarPath to attempt a clean download." >&2
echo "If you updated your Maven version, you need to update the specified wrapperSha256Sum property." >&2
exit 1
fi
fi
MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
# For Cygwin, switch paths to Windows format before running java
if $cygwin; then
[ -n "$JAVA_HOME" ] &&
JAVA_HOME=$(cygpath --path --windows "$JAVA_HOME")
[ -n "$CLASSPATH" ] &&
CLASSPATH=$(cygpath --path --windows "$CLASSPATH")
[ -n "$MAVEN_PROJECTBASEDIR" ] &&
MAVEN_PROJECTBASEDIR=$(cygpath --path --windows "$MAVEN_PROJECTBASEDIR")
fi
# Provide a "standardized" way to retrieve the CLI args that will
# work with both Windows and non-Windows executions.
MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $*"
export MAVEN_CMD_LINE_ARGS
WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
# shellcheck disable=SC2086 # safe args
exec "$JAVACMD" \
$MAVEN_OPTS \
$MAVEN_DEBUG_OPTS \
-classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
"-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"

205
mvnw.cmd vendored Normal file
View File

@ -0,0 +1,205 @@
@REM ----------------------------------------------------------------------------
@REM Licensed to the Apache Software Foundation (ASF) under one
@REM or more contributor license agreements. See the NOTICE file
@REM distributed with this work for additional information
@REM regarding copyright ownership. The ASF licenses this file
@REM to you under the Apache License, Version 2.0 (the
@REM "License"); you may not use this file except in compliance
@REM with the License. You may obtain a copy of the License at
@REM
@REM http://www.apache.org/licenses/LICENSE-2.0
@REM
@REM Unless required by applicable law or agreed to in writing,
@REM software distributed under the License is distributed on an
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@REM KIND, either express or implied. See the License for the
@REM specific language governing permissions and limitations
@REM under the License.
@REM ----------------------------------------------------------------------------
@REM ----------------------------------------------------------------------------
@REM Apache Maven Wrapper startup batch script, version 3.2.0
@REM
@REM Required ENV vars:
@REM JAVA_HOME - location of a JDK home dir
@REM
@REM Optional ENV vars
@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending
@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
@REM e.g. to debug Maven itself, use
@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
@REM ----------------------------------------------------------------------------
@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
@echo off
@REM set title of command window
title %0
@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on'
@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
@REM set %HOME% to equivalent of $HOME
if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
@REM Execute a user defined script before this one
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
@REM check for pre script, once with legacy .bat ending and once with .cmd ending
if exist "%USERPROFILE%\mavenrc_pre.bat" call "%USERPROFILE%\mavenrc_pre.bat" %*
if exist "%USERPROFILE%\mavenrc_pre.cmd" call "%USERPROFILE%\mavenrc_pre.cmd" %*
:skipRcPre
@setlocal
set ERROR_CODE=0
@REM To isolate internal variables from possible post scripts, we use another setlocal
@setlocal
@REM ==== START VALIDATION ====
if not "%JAVA_HOME%" == "" goto OkJHome
echo.
echo Error: JAVA_HOME not found in your environment. >&2
echo Please set the JAVA_HOME variable in your environment to match the >&2
echo location of your Java installation. >&2
echo.
goto error
:OkJHome
if exist "%JAVA_HOME%\bin\java.exe" goto init
echo.
echo Error: JAVA_HOME is set to an invalid directory. >&2
echo JAVA_HOME = "%JAVA_HOME%" >&2
echo Please set the JAVA_HOME variable in your environment to match the >&2
echo location of your Java installation. >&2
echo.
goto error
@REM ==== END VALIDATION ====
:init
@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
@REM Fallback to current working directory if not found.
set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
set EXEC_DIR=%CD%
set WDIR=%EXEC_DIR%
:findBaseDir
IF EXIST "%WDIR%"\.mvn goto baseDirFound
cd ..
IF "%WDIR%"=="%CD%" goto baseDirNotFound
set WDIR=%CD%
goto findBaseDir
:baseDirFound
set MAVEN_PROJECTBASEDIR=%WDIR%
cd "%EXEC_DIR%"
goto endDetectBaseDir
:baseDirNotFound
set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
cd "%EXEC_DIR%"
:endDetectBaseDir
IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
@setlocal EnableExtensions EnableDelayedExpansion
for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
:endReadAdditionalConfig
SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
set WRAPPER_URL="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar"
FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
IF "%%A"=="wrapperUrl" SET WRAPPER_URL=%%B
)
@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
@REM This allows using the maven wrapper in projects that prohibit checking in binary data.
if exist %WRAPPER_JAR% (
if "%MVNW_VERBOSE%" == "true" (
echo Found %WRAPPER_JAR%
)
) else (
if not "%MVNW_REPOURL%" == "" (
SET WRAPPER_URL="%MVNW_REPOURL%/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar"
)
if "%MVNW_VERBOSE%" == "true" (
echo Couldn't find %WRAPPER_JAR%, downloading it ...
echo Downloading from: %WRAPPER_URL%
)
powershell -Command "&{"^
"$webclient = new-object System.Net.WebClient;"^
"if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^
"$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^
"}"^
"[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%WRAPPER_URL%', '%WRAPPER_JAR%')"^
"}"
if "%MVNW_VERBOSE%" == "true" (
echo Finished downloading %WRAPPER_JAR%
)
)
@REM End of extension
@REM If specified, validate the SHA-256 sum of the Maven wrapper jar file
SET WRAPPER_SHA_256_SUM=""
FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
IF "%%A"=="wrapperSha256Sum" SET WRAPPER_SHA_256_SUM=%%B
)
IF NOT %WRAPPER_SHA_256_SUM%=="" (
powershell -Command "&{"^
"$hash = (Get-FileHash \"%WRAPPER_JAR%\" -Algorithm SHA256).Hash.ToLower();"^
"If('%WRAPPER_SHA_256_SUM%' -ne $hash){"^
" Write-Output 'Error: Failed to validate Maven wrapper SHA-256, your Maven wrapper might be compromised.';"^
" Write-Output 'Investigate or delete %WRAPPER_JAR% to attempt a clean download.';"^
" Write-Output 'If you updated your Maven version, you need to update the specified wrapperSha256Sum property.';"^
" exit 1;"^
"}"^
"}"
if ERRORLEVEL 1 goto error
)
@REM Provide a "standardized" way to retrieve the CLI args that will
@REM work with both Windows and non-Windows executions.
set MAVEN_CMD_LINE_ARGS=%*
%MAVEN_JAVA_EXE% ^
%JVM_CONFIG_MAVEN_PROPS% ^
%MAVEN_OPTS% ^
%MAVEN_DEBUG_OPTS% ^
-classpath %WRAPPER_JAR% ^
"-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" ^
%WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
if ERRORLEVEL 1 goto error
goto end
:error
set ERROR_CODE=1
:end
@endlocal & set ERROR_CODE=%ERROR_CODE%
if not "%MAVEN_SKIP_RC%"=="" goto skipRcPost
@REM check for post script, once with legacy .bat ending and once with .cmd ending
if exist "%USERPROFILE%\mavenrc_post.bat" call "%USERPROFILE%\mavenrc_post.bat"
if exist "%USERPROFILE%\mavenrc_post.cmd" call "%USERPROFILE%\mavenrc_post.cmd"
:skipRcPost
@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
if "%MAVEN_BATCH_PAUSE%"=="on" pause
if "%MAVEN_TERMINATE_CMD%"=="on" exit %ERROR_CODE%
cmd /C exit /B %ERROR_CODE%

181
pom.xml Normal file
View File

@ -0,0 +1,181 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.sadigit</groupId>
<artifactId>api-keluhan-mobile</artifactId>
<version>1.0.0-SNAPSHOT</version>
<properties>
<compiler-plugin.version>3.12.1</compiler-plugin.version>
<maven.compiler.release>21</maven.compiler.release>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id>
<quarkus.platform.group-id>io.quarkus.platform</quarkus.platform.group-id>
<quarkus.platform.version>3.8.4</quarkus.platform.version>
<skipITs>true</skipITs>
<surefire-plugin.version>3.2.5</surefire-plugin.version>
<jackson.version>2.17.0</jackson.version>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>${quarkus.platform.group-id}</groupId>
<artifactId>${quarkus.platform.artifact-id}</artifactId>
<version>${quarkus.platform.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-hibernate-orm-panache</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-jdbc-postgresql</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-arc</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-junit5</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.rest-assured</groupId>
<artifactId>rest-assured</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.32</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-hibernate-validator</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.30</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-spatial</artifactId>
<version>6.4.2.Final</version>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-resteasy-jsonb</artifactId>
<exclusions>
<exclusion>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-xml</artifactId>
<version>${jackson.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>${quarkus.platform.group-id}</groupId>
<artifactId>quarkus-maven-plugin</artifactId>
<version>${quarkus.platform.version}</version>
<extensions>true</extensions>
<executions>
<execution>
<goals>
<goal>build</goal>
<goal>generate-code</goal>
<goal>generate-code-tests</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>${compiler-plugin.version}</version>
<configuration>
<compilerArgs>
<arg>-parameters</arg>
</compilerArgs>
</configuration>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>${surefire-plugin.version}</version>
<configuration>
<systemPropertyVariables>
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
<maven.home>${maven.home}</maven.home>
</systemPropertyVariables>
</configuration>
</plugin>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<version>${surefire-plugin.version}</version>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
<configuration>
<systemPropertyVariables>
<native.image.path>${project.build.directory}/${project.build.finalName}-runner</native.image.path>
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
<maven.home>${maven.home}</maven.home>
</systemPropertyVariables>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>native</id>
<activation>
<property>
<name>native</name>
</property>
</activation>
<properties>
<skipITs>false</skipITs>
<quarkus.package.type>native</quarkus.package.type>
</properties>
</profile>
</profiles>
</project>

View File

@ -0,0 +1,97 @@
####
# This Dockerfile is used in order to build a container that runs the Quarkus application in JVM mode
#
# Before building the container image run:
#
# ./mvnw package
#
# Then, build the image with:
#
# docker build -f src/main/docker/Dockerfile.jvm -t quarkus/api-keluhan-mobile-jvm .
#
# Then run the container using:
#
# docker run -i --rm -p 8080:8080 quarkus/api-keluhan-mobile-jvm
#
# If you want to include the debug port into your docker image
# you will have to expose the debug port (default 5005 being the default) like this : EXPOSE 8080 5005.
# Additionally you will have to set -e JAVA_DEBUG=true and -e JAVA_DEBUG_PORT=*:5005
# when running the container
#
# Then run the container using :
#
# docker run -i --rm -p 8080:8080 quarkus/api-keluhan-mobile-jvm
#
# This image uses the `run-java.sh` script to run the application.
# This scripts computes the command line to execute your Java application, and
# includes memory/GC tuning.
# You can configure the behavior using the following environment properties:
# - JAVA_OPTS: JVM options passed to the `java` command (example: "-verbose:class")
# - JAVA_OPTS_APPEND: User specified Java options to be appended to generated options
# in JAVA_OPTS (example: "-Dsome.property=foo")
# - JAVA_MAX_MEM_RATIO: Is used when no `-Xmx` option is given in JAVA_OPTS. This is
# used to calculate a default maximal heap memory based on a containers restriction.
# If used in a container without any memory constraints for the container then this
# option has no effect. If there is a memory constraint then `-Xmx` is set to a ratio
# of the container available memory as set here. The default is `50` which means 50%
# of the available memory is used as an upper boundary. You can skip this mechanism by
# setting this value to `0` in which case no `-Xmx` option is added.
# - JAVA_INITIAL_MEM_RATIO: Is used when no `-Xms` option is given in JAVA_OPTS. This
# is used to calculate a default initial heap memory based on the maximum heap memory.
# If used in a container without any memory constraints for the container then this
# option has no effect. If there is a memory constraint then `-Xms` is set to a ratio
# of the `-Xmx` memory as set here. The default is `25` which means 25% of the `-Xmx`
# is used as the initial heap size. You can skip this mechanism by setting this value
# to `0` in which case no `-Xms` option is added (example: "25")
# - JAVA_MAX_INITIAL_MEM: Is used when no `-Xms` option is given in JAVA_OPTS.
# This is used to calculate the maximum value of the initial heap memory. If used in
# a container without any memory constraints for the container then this option has
# no effect. If there is a memory constraint then `-Xms` is limited to the value set
# here. The default is 4096MB which means the calculated value of `-Xms` never will
# be greater than 4096MB. The value of this variable is expressed in MB (example: "4096")
# - JAVA_DIAGNOSTICS: Set this to get some diagnostics information to standard output
# when things are happening. This option, if set to true, will set
# `-XX:+UnlockDiagnosticVMOptions`. Disabled by default (example: "true").
# - JAVA_DEBUG: If set remote debugging will be switched on. Disabled by default (example:
# true").
# - JAVA_DEBUG_PORT: Port used for remote debugging. Defaults to 5005 (example: "8787").
# - CONTAINER_CORE_LIMIT: A calculated core limit as described in
# https://www.kernel.org/doc/Documentation/scheduler/sched-bwc.txt. (example: "2")
# - CONTAINER_MAX_MEMORY: Memory limit given to the container (example: "1024").
# - GC_MIN_HEAP_FREE_RATIO: Minimum percentage of heap free after GC to avoid expansion.
# (example: "20")
# - GC_MAX_HEAP_FREE_RATIO: Maximum percentage of heap free after GC to avoid shrinking.
# (example: "40")
# - GC_TIME_RATIO: Specifies the ratio of the time spent outside the garbage collection.
# (example: "4")
# - GC_ADAPTIVE_SIZE_POLICY_WEIGHT: The weighting given to the current GC time versus
# previous GC times. (example: "90")
# - GC_METASPACE_SIZE: The initial metaspace size. (example: "20")
# - GC_MAX_METASPACE_SIZE: The maximum metaspace size. (example: "100")
# - GC_CONTAINER_OPTIONS: Specify Java GC to use. The value of this variable should
# contain the necessary JRE command-line options to specify the required GC, which
# will override the default of `-XX:+UseParallelGC` (example: -XX:+UseG1GC).
# - HTTPS_PROXY: The location of the https proxy. (example: "myuser@127.0.0.1:8080")
# - HTTP_PROXY: The location of the http proxy. (example: "myuser@127.0.0.1:8080")
# - NO_PROXY: A comma separated lists of hosts, IP addresses or domains that can be
# accessed directly. (example: "foo.example.com,bar.example.com")
#
###
FROM registry.access.redhat.com/ubi8/openjdk-21:1.18
ENV LANGUAGE='en_US:en'
# We make four distinct layers so if there are application changes the library layers can be re-used
COPY --chown=185 target/quarkus-app/lib/ /deployments/lib/
COPY --chown=185 target/quarkus-app/*.jar /deployments/
COPY --chown=185 target/quarkus-app/app/ /deployments/app/
COPY --chown=185 target/quarkus-app/quarkus/ /deployments/quarkus/
EXPOSE 8080
USER 185
ENV JAVA_OPTS_APPEND="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager"
ENV JAVA_APP_JAR="/deployments/quarkus-run.jar"
ENTRYPOINT [ "/opt/jboss/container/java/run/run-java.sh" ]

View File

@ -0,0 +1,93 @@
####
# This Dockerfile is used in order to build a container that runs the Quarkus application in JVM mode
#
# Before building the container image run:
#
# ./mvnw package -Dquarkus.package.type=legacy-jar
#
# Then, build the image with:
#
# docker build -f src/main/docker/Dockerfile.legacy-jar -t quarkus/api-keluhan-mobile-legacy-jar .
#
# Then run the container using:
#
# docker run -i --rm -p 8080:8080 quarkus/api-keluhan-mobile-legacy-jar
#
# If you want to include the debug port into your docker image
# you will have to expose the debug port (default 5005 being the default) like this : EXPOSE 8080 5005.
# Additionally you will have to set -e JAVA_DEBUG=true and -e JAVA_DEBUG_PORT=*:5005
# when running the container
#
# Then run the container using :
#
# docker run -i --rm -p 8080:8080 quarkus/api-keluhan-mobile-legacy-jar
#
# This image uses the `run-java.sh` script to run the application.
# This scripts computes the command line to execute your Java application, and
# includes memory/GC tuning.
# You can configure the behavior using the following environment properties:
# - JAVA_OPTS: JVM options passed to the `java` command (example: "-verbose:class")
# - JAVA_OPTS_APPEND: User specified Java options to be appended to generated options
# in JAVA_OPTS (example: "-Dsome.property=foo")
# - JAVA_MAX_MEM_RATIO: Is used when no `-Xmx` option is given in JAVA_OPTS. This is
# used to calculate a default maximal heap memory based on a containers restriction.
# If used in a container without any memory constraints for the container then this
# option has no effect. If there is a memory constraint then `-Xmx` is set to a ratio
# of the container available memory as set here. The default is `50` which means 50%
# of the available memory is used as an upper boundary. You can skip this mechanism by
# setting this value to `0` in which case no `-Xmx` option is added.
# - JAVA_INITIAL_MEM_RATIO: Is used when no `-Xms` option is given in JAVA_OPTS. This
# is used to calculate a default initial heap memory based on the maximum heap memory.
# If used in a container without any memory constraints for the container then this
# option has no effect. If there is a memory constraint then `-Xms` is set to a ratio
# of the `-Xmx` memory as set here. The default is `25` which means 25% of the `-Xmx`
# is used as the initial heap size. You can skip this mechanism by setting this value
# to `0` in which case no `-Xms` option is added (example: "25")
# - JAVA_MAX_INITIAL_MEM: Is used when no `-Xms` option is given in JAVA_OPTS.
# This is used to calculate the maximum value of the initial heap memory. If used in
# a container without any memory constraints for the container then this option has
# no effect. If there is a memory constraint then `-Xms` is limited to the value set
# here. The default is 4096MB which means the calculated value of `-Xms` never will
# be greater than 4096MB. The value of this variable is expressed in MB (example: "4096")
# - JAVA_DIAGNOSTICS: Set this to get some diagnostics information to standard output
# when things are happening. This option, if set to true, will set
# `-XX:+UnlockDiagnosticVMOptions`. Disabled by default (example: "true").
# - JAVA_DEBUG: If set remote debugging will be switched on. Disabled by default (example:
# true").
# - JAVA_DEBUG_PORT: Port used for remote debugging. Defaults to 5005 (example: "8787").
# - CONTAINER_CORE_LIMIT: A calculated core limit as described in
# https://www.kernel.org/doc/Documentation/scheduler/sched-bwc.txt. (example: "2")
# - CONTAINER_MAX_MEMORY: Memory limit given to the container (example: "1024").
# - GC_MIN_HEAP_FREE_RATIO: Minimum percentage of heap free after GC to avoid expansion.
# (example: "20")
# - GC_MAX_HEAP_FREE_RATIO: Maximum percentage of heap free after GC to avoid shrinking.
# (example: "40")
# - GC_TIME_RATIO: Specifies the ratio of the time spent outside the garbage collection.
# (example: "4")
# - GC_ADAPTIVE_SIZE_POLICY_WEIGHT: The weighting given to the current GC time versus
# previous GC times. (example: "90")
# - GC_METASPACE_SIZE: The initial metaspace size. (example: "20")
# - GC_MAX_METASPACE_SIZE: The maximum metaspace size. (example: "100")
# - GC_CONTAINER_OPTIONS: Specify Java GC to use. The value of this variable should
# contain the necessary JRE command-line options to specify the required GC, which
# will override the default of `-XX:+UseParallelGC` (example: -XX:+UseG1GC).
# - HTTPS_PROXY: The location of the https proxy. (example: "myuser@127.0.0.1:8080")
# - HTTP_PROXY: The location of the http proxy. (example: "myuser@127.0.0.1:8080")
# - NO_PROXY: A comma separated lists of hosts, IP addresses or domains that can be
# accessed directly. (example: "foo.example.com,bar.example.com")
#
###
FROM registry.access.redhat.com/ubi8/openjdk-21:1.18
ENV LANGUAGE='en_US:en'
COPY target/lib/* /deployments/lib/
COPY target/*-runner.jar /deployments/quarkus-run.jar
EXPOSE 8080
USER 185
ENV JAVA_OPTS_APPEND="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager"
ENV JAVA_APP_JAR="/deployments/quarkus-run.jar"
ENTRYPOINT [ "/opt/jboss/container/java/run/run-java.sh" ]

View File

@ -0,0 +1,27 @@
####
# This Dockerfile is used in order to build a container that runs the Quarkus application in native (no JVM) mode.
#
# Before building the container image run:
#
# ./mvnw package -Dnative
#
# Then, build the image with:
#
# docker build -f src/main/docker/Dockerfile.native -t quarkus/api-keluhan-mobile .
#
# Then run the container using:
#
# docker run -i --rm -p 8080:8080 quarkus/api-keluhan-mobile
#
###
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.9
WORKDIR /work/
RUN chown 1001 /work \
&& chmod "g+rwX" /work \
&& chown 1001:root /work
COPY --chown=1001:root target/*-runner /work/application
EXPOSE 8080
USER 1001
ENTRYPOINT ["./application", "-Dquarkus.http.host=0.0.0.0"]

View File

@ -0,0 +1,30 @@
####
# This Dockerfile is used in order to build a container that runs the Quarkus application in native (no JVM) mode.
# It uses a micro base image, tuned for Quarkus native executables.
# It reduces the size of the resulting container image.
# Check https://quarkus.io/guides/quarkus-runtime-base-image for further information about this image.
#
# Before building the container image run:
#
# ./mvnw package -Dnative
#
# Then, build the image with:
#
# docker build -f src/main/docker/Dockerfile.native-micro -t quarkus/api-keluhan-mobile .
#
# Then run the container using:
#
# docker run -i --rm -p 8080:8080 quarkus/api-keluhan-mobile
#
###
FROM quay.io/quarkus/quarkus-micro-image:2.0
WORKDIR /work/
RUN chown 1001 /work \
&& chmod "g+rwX" /work \
&& chown 1001:root /work
COPY --chown=1001:root target/*-runner /work/application
EXPOSE 8080
USER 1001
ENTRYPOINT ["./application", "-Dquarkus.http.host=0.0.0.0"]

View File

@ -0,0 +1,53 @@
// package org.sadigit.Interceptor;
// import lombok.NonNull;
// import lombok.extern.slf4j.Slf4j;
// import org.apache.commons.codec.binary.Base64;
// import org.springframework.http.HttpHeaders;
// import org.springframework.http.HttpRequest;
// import org.springframework.http.client.ClientHttpRequestExecution;
// import org.springframework.http.client.ClientHttpRequestInterceptor;
// import org.springframework.http.client.ClientHttpResponse;
// import java.io.IOException;
// import java.nio.charset.Charset;
// @Slf4j
// public class AuthenticationInterceptor implements
// ClientHttpRequestInterceptor {
// private String auth;
// // private String content;
// public AuthenticationInterceptor(String auth) {
// super();
// this.auth = auth;
// // this.content = content;
// }
// public ClientHttpResponse intercept(@NonNull HttpRequest request,
// @NonNull byte[] body,
// @NonNull ClientHttpRequestExecution execution) throws IOException {
// HttpHeaders headers = request.getHeaders();
// String authorize = auth;
// String urlEncoded =
// Base64.encodeBase64String(authorize.getBytes(Charset.forName("utf-8")));
// String authHeader = authorize;
// if (auth != null) {
// headers.add("MAXAUTH", authHeader);
// }
// // headers.setContentType(MediaType.APPLICATION_JSON);
// headers.add("Content-Type", "application/x-www-form-urlencoded");
// headers.add("Cache-Control", "no-cache");
// log.debug("HEADER >> {}", headers.toString());
// log.debug("BODY >> {}", new String(body));
// log.info("request method: {}, request URI: {}, request headers: {}, request
// body: {}",
// request.getMethod(), request.getURI(), request.getHeaders(), new
// String(body));
// return execution.execute(request, body);
// }
// }

View File

@ -0,0 +1,35 @@
package org.sadigit.adapter;
import jakarta.json.bind.adapter.JsonbAdapter;
import org.locationtech.jts.geom.Geometry;
import org.locationtech.jts.io.ParseException;
import org.locationtech.jts.io.WKTReader;
import org.locationtech.jts.io.WKTWriter;
@SuppressWarnings("unused")
public class GeometryAdapter implements JsonbAdapter<Geometry, String> {
private static final int DEFAULT_SRID = 4326; // Default SRID
@Override
public String adaptToJson(Geometry geometry) throws Exception {
if (geometry == null) {
return null;
}
WKTWriter writer = new WKTWriter();
return writer.write(geometry);
}
@Override
public Geometry adaptFromJson(String json) throws Exception {
if (json == null || json.isEmpty()) {
return null;
}
WKTReader reader = new WKTReader();
try {
return reader.read(json);
} catch (ParseException e) {
throw new IllegalArgumentException("Invalid WKT string: " + json, e);
}
}
}

View File

@ -0,0 +1,669 @@
package org.sadigit.boundary.v1.endpoint;
import io.smallrye.mutiny.Uni;
import jakarta.inject.Inject;
import jakarta.ws.rs.POST;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.Produces;
import jakarta.ws.rs.QueryParam;
import jakarta.ws.rs.core.MediaType;
import jakarta.ws.rs.core.Response;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import java.io.InputStream;
import java.util.HashMap;
import java.util.Map;
import java.io.UnsupportedEncodingException;
import org.sadigit.model.ResponseModelIntegKeluhanMobile;
import org.sadigit.model.ResponseModelIntegKeluhanMobileTanpaOutData;
import org.sadigit.service.api.v1.GetDataPerUnitService;
import org.sadigit.service.api.v1.IssueTypeService;
import org.sadigit.service.api.v1.LoginService;
import org.sadigit.service.api.v1.PenggunaService;
import org.sadigit.service.api.v1.UnitService;
import org.sadigit.util.AppException;
@Path("api/apkt/integkeluhanmobile")
@Produces(MediaType.APPLICATION_JSON)
@Slf4j
@RequiredArgsConstructor
public class IntegKeluhanMobileResource {
@Inject
private final LoginService loginService;
private final PenggunaService penggunaService;
private final UnitService unitService;
private final IssueTypeService issueTypeService;
private final GetDataPerUnitService getDataPerUnitService;
@POST
@Path("/p00_login")
public Response p00_login(
@QueryParam(value = "IN_USER") String IN_USER,
@QueryParam(value = "IN_PASSWORD") String IN_PASSWORD) throws UnsupportedEncodingException {
ResponseModelIntegKeluhanMobile mapResponse = new ResponseModelIntegKeluhanMobile();
// replace space with +
IN_USER = IN_USER.replace(" ", "+");
IN_PASSWORD = IN_PASSWORD.replace(" ", "+");
try {
mapResponse.setData(loginService.auth(IN_USER, IN_PASSWORD));
mapResponse.setMessage("SUKSES");
mapResponse.setRc("0");
} catch (AppException e) {
mapResponse.setMessage(e.getMessage());
mapResponse.setRc(e.getRc());
}
return Response.ok(mapResponse).build();
}
@POST
@Path("/P00_GET_USER")
public Response P00_GET_USER(
@QueryParam(value = "IN_UNITID") Long IN_UNITID,
@QueryParam(value = "IN_POSITIONID") Long IN_POSITIONID) {
ResponseModelIntegKeluhanMobile mapResponse = new ResponseModelIntegKeluhanMobile();
try {
mapResponse.setData(penggunaService.findDataPengguna(IN_UNITID, IN_POSITIONID));
mapResponse.setMessage("SUKSES");
mapResponse.setRc("0");
} catch (AppException e) {
mapResponse.setMessage(e.getMessage());
mapResponse.setRc(e.getRc());
}
return Response.ok(mapResponse).build();
}
@POST
@Path("/p01_getdataperunit")
public Response p01_getdataperunit(
@QueryParam(value = "IN_UNIT") Long IN_UNIT,
@QueryParam(value = "IN_TGLAWAL") String IN_TGLAWAL,
@QueryParam(value = "IN_TGLAKHIR") String IN_TGLAKHIR) {
ResponseModelIntegKeluhanMobile mapResponse = new ResponseModelIntegKeluhanMobile();
try {
mapResponse.setData(getDataPerUnitService.getDataPerUnit(IN_UNIT, IN_TGLAWAL, IN_TGLAKHIR));
mapResponse.setMessage("SUKSES");
mapResponse.setRc("0");
} catch (AppException e) {
mapResponse.setMessage(e.getMessage());
mapResponse.setRc(e.getRc());
}
return Response.ok(mapResponse).build();
}
@POST
@Path("/p02_getdataperpetugas")
public Response p02_getdataperpetugas(
@QueryParam(value = "IN_UNIT") String IN_UNIT,
@QueryParam(value = "IN_USER") String IN_USER,
@QueryParam(value = "IN_TGLAWAL") String IN_TGLAWAL,
@QueryParam(value = "IN_TGLAKHIR") String IN_TGLAKHIR) {
ResponseModelIntegKeluhanMobile mapResponse = new ResponseModelIntegKeluhanMobile();
Map<String, Object> mapResult;
Map<String, Object> mapParam = new HashMap<>();
try {
mapParam.put("IN_UNIT", IN_UNIT);
mapParam.put("IN_USER", IN_USER);
mapParam.put("IN_TGLAWAL", IN_TGLAWAL);
mapParam.put("IN_TGLAKHIR", IN_TGLAKHIR);
mapParam.put("OUT_RC", "VARCHAR");
mapParam.put("OUT_MESSAGE", "VARCHAR");
mapParam.put("OUT_DATA", "CURSOR");
// mapResult = IntegKeluhanMobileService.p02_getdataperpetugas(mapParam);
// mapResponse = AppServerIntegKeluhanMobile.setResultMessage(mapResult);
// log.info("log : {}",mapResponse);
} catch (Exception e) {
// log.error(e.getMessage(), e);
mapResponse.setMessage(e.getMessage());
// mapResponse.setRc("06");
}
return Response.ok(mapResponse).build();
}
@POST
@Path("/p03_getpenjelasanbidang")
public Response p03_getpenjelasanbidang(
@QueryParam(value = "IN_LAPORAN") String IN_LAPORAN) {
ResponseModelIntegKeluhanMobile mapResponse = new ResponseModelIntegKeluhanMobile();
Map<String, Object> mapResult;
Map<String, Object> mapParam = new HashMap<>();
try {
mapParam.put("IN_LAPORAN", IN_LAPORAN);
mapParam.put("OUT_RC", "VARCHAR");
mapParam.put("OUT_MESSAGE", "VARCHAR");
mapParam.put("OUT_DATA", "CURSOR");
// mapResult = IntegKeluhanMobileService.p03_getpenjelasanbidang(mapParam);
// mapResponse = AppServerIntegKeluhanMobile.setResultMessage(mapResult);
// log.info("log : {}",mapResponse);
} catch (Exception e) {
// log.error(e.getMessage(), e);
mapResponse.setMessage(e.getMessage());
// mapResponse.setRc("06");
}
return Response.ok(mapResponse).build();
}
@POST
@Path("/p04_setpetugasbidang")
public Response p04_setpetugasbidang(
@QueryParam(value = "IN_REPORTNUMBER") String IN_REPORTNUMBER,
@QueryParam(value = "IN_USER") String IN_USER,
@QueryParam(value = "IN_FUNGSI") String IN_FUNGSI) {
ResponseModelIntegKeluhanMobile mapResponse = new ResponseModelIntegKeluhanMobile();
Map<String, Object> mapResult;
Map<String, Object> mapParam = new HashMap<>();
try {
mapParam.put("IN_REPORTNUMBER", IN_REPORTNUMBER);
mapParam.put("IN_USER", IN_USER);
mapParam.put("IN_FUNGSI", IN_FUNGSI);
mapParam.put("OUT_RC", "VARCHAR");
mapParam.put("OUT_MESSAGE", "VARCHAR");
mapParam.put("OUT_DATA", "CURSOR");
// mapResult = IntegKeluhanMobileService.p04_setpetugasbidang(mapParam);
// mapResponse = AppServerIntegKeluhanMobile.setResultMessage(mapResult);
// log.info("log : {}",mapResponse);
} catch (Exception e) {
// log.error(e.getMessage(), e);
mapResponse.setMessage(e.getMessage());
// mapResponse.setRc("06");
}
return Response.ok(mapResponse).build();
}
@POST //
@Path("/p05_setalihunit")
public Response p05_setalihunit(
@QueryParam(value = "IN_REPORTNUMBER") String IN_REPORTNUMBER,
@QueryParam(value = "IN_USERID") String IN_USERID,
@QueryParam(value = "IN_UNITID") String IN_UNITID) {
ResponseModelIntegKeluhanMobileTanpaOutData mapResponse = new ResponseModelIntegKeluhanMobileTanpaOutData();
Map<String, Object> mapResult;
Map<String, Object> mapParam = new HashMap<>();
try {
mapParam.put("IN_REPORTNUMBER", IN_REPORTNUMBER);
mapParam.put("IN_USERID", IN_USERID);
mapParam.put("IN_UNITID", IN_UNITID);
mapParam.put("OUT_RC", "VARCHAR");
mapParam.put("OUT_MESSAGE", "VARCHAR");
mapParam.put("OUT_DATA", "CURSOR");
// mapResult = IntegKeluhanMobileService.p05_setalihunit(mapParam);
// AppServerIntegKeluhanMobileLoginTanpaOutData.setResultMessage(mapResult);
// log.info("log : {}",mapResponse);
} catch (Exception e) {
// log.error(e.getMessage(), e);
mapResponse.setMessage(e.getMessage());
// mapResponse.setRc("06");
}
return Response.ok(mapResponse).build();
}
@POST
@Path("/p06_setalihbidang")
public Response p06_setalihbidang(
@QueryParam(value = "IN_REPORTNUMBER") String IN_REPORTNUMBER,
@QueryParam(value = "IN_USERID") String IN_USERID,
@QueryParam(value = "IN_FUNGSI") String IN_FUNGSI) {
ResponseModelIntegKeluhanMobileTanpaOutData mapResponse = new ResponseModelIntegKeluhanMobileTanpaOutData();
Map<String, Object> mapResult;
Map<String, Object> mapParam = new HashMap<>();
try {
mapParam.put("IN_REPORTNUMBER", IN_REPORTNUMBER);
mapParam.put("IN_USERID", IN_USERID);
mapParam.put("IN_FUNGSI", IN_FUNGSI);
mapParam.put("OUT_RC", "VARCHAR");
mapParam.put("OUT_MESSAGE", "VARCHAR");
mapParam.put("OUT_DATA", "CURSOR");
// mapResult = IntegKeluhanMobileService.p06_setalihbidang(mapParam);
// mapResponse =
// AppServerIntegKeluhanMobileLoginTanpaOutData.setResultMessage(mapResult);
// log.info("log : {}",mapResponse);
} catch (Exception e) {
// log.error(e.getMessage(), e);
mapResponse.setMessage(e.getMessage());
// mapResponse.setRc("06");
}
return Response.ok(mapResponse).build();
}
@POST //
@Path("/p07_setpenjelasanbidang")
public Response p07_setpenjelasanbidang(
@QueryParam(value = "IN_REPORTNUMBER") String IN_REPORTNUMBER,
@QueryParam(value = "IN_USER") String IN_USER,
@QueryParam(value = "IN_CUSTOMERRESPONSE") String IN_CUSTOMERRESPONSE,
@QueryParam(value = "IN_REMARK") String IN_REMARK,
@QueryParam(value = "IN_IMPLEMENTOR") String IN_IMPLEMENTOR) {
ResponseModelIntegKeluhanMobile mapResponse = new ResponseModelIntegKeluhanMobile();
Map<String, Object> mapResult;
Map<String, Object> mapParam = new HashMap<>();
try {
mapParam.put("IN_REPORTNUMBER", IN_REPORTNUMBER);
mapParam.put("IN_USER", IN_USER);
mapParam.put("IN_CUSTOMERRESPONSE", IN_CUSTOMERRESPONSE);
mapParam.put("IN_REMARK", IN_REMARK);
mapParam.put("IN_IMPLEMENTOR", IN_IMPLEMENTOR);
mapParam.put("OUT_RC", "VARCHAR");
mapParam.put("OUT_MESSAGE", "VARCHAR");
mapParam.put("OUT_DATA", "CURSOR");
// mapResult = IntegKeluhanMobileService.p07_setpenjelasanbidang(mapParam);
// mapResponse = AppServerIntegKeluhanMobile.setResultMessage(mapResult);
// log.info("log : {}",mapResponse);
} catch (Exception e) {
// log.error(e.getMessage(), e);
mapResponse.setMessage(e.getMessage());
// mapResponse.setRc("06");
}
return Response.ok(mapResponse).build();
}
@POST //
@Path("/p08_setkonfirmasi")
public Response p08_setkonfirmasi(
@QueryParam(value = "IN_REPORTNUMBER") String IN_REPORTNUMBER,
@QueryParam(value = "IN_USER") String IN_USER) {
ResponseModelIntegKeluhanMobile mapResponse = new ResponseModelIntegKeluhanMobile();
Map<String, Object> mapResult;
Map<String, Object> mapParam = new HashMap<>();
try {
mapParam.put("IN_REPORTNUMBER", IN_REPORTNUMBER);
mapParam.put("IN_USER", IN_USER);
mapParam.put("OUT_RC", "VARCHAR");
mapParam.put("OUT_MESSAGE", "VARCHAR");
mapParam.put("OUT_DATA", "CURSOR");
// mapResult = IntegKeluhanMobileService.p08_setkonfirmasi(mapParam);
// mapResponse = AppServerIntegKeluhanMobile.setResultMessage(mapResult);
// log.info("log : {}",mapResponse);
} catch (Exception e) {
// log.error(e.getMessage(), e);
mapResponse.setMessage(e.getMessage());
// mapResponse.setRc("06");
}
return Response.ok(mapResponse).build();
}
@POST //
@Path("/p09_setselesai")
public Response p09_setselesai(
@QueryParam(value = "IN_REPORTNUMBER") String IN_REPORTNUMBER,
@QueryParam(value = "IN_USER") String IN_USER) {
ResponseModelIntegKeluhanMobile mapResponse = new ResponseModelIntegKeluhanMobile();
Map<String, Object> mapResult;
Map<String, Object> mapParam = new HashMap<>();
try {
mapParam.put("IN_REPORTNUMBER", IN_REPORTNUMBER);
mapParam.put("IN_USER", IN_USER);
mapParam.put("OUT_RC", "VARCHAR");
mapParam.put("OUT_MESSAGE", "VARCHAR");
// mapResult = IntegKeluhanMobileService.p09_setselesai(mapParam);
// mapResponse = AppServerIntegKeluhanMobile.setResultMessage(mapResult);
// log.info("log : {}",mapResponse);
} catch (Exception e) {
// log.error(e.getMessage(), e);
mapResponse.setMessage(e.getMessage());
// mapResponse.setRc("06");
}
return Response.ok(mapResponse).build();
}
@POST //
@Path("/p10_setbatal")
public Response p10_setbatal(
@QueryParam(value = "IN_LAPORAN") String IN_LAPORAN,
@QueryParam(value = "IN_USER") String IN_USER) {
ResponseModelIntegKeluhanMobileTanpaOutData mapResponse = new ResponseModelIntegKeluhanMobileTanpaOutData();
Map<String, Object> mapResult;
Map<String, Object> mapParam = new HashMap<>();
try {
mapParam.put("IN_LAPORAN", IN_LAPORAN);
mapParam.put("IN_USER", IN_USER);
mapParam.put("OUT_RC", "VARCHAR");
mapParam.put("OUT_MESSAGE", "VARCHAR");
// mapResult = IntegKeluhanMobileService.p10_setbatal(mapParam);
// mapResponse =
// AppServerIntegKeluhanMobileLoginTanpaOutData.setResultMessage(mapResult);
// log.info("log : {}",mapResponse);
} catch (Exception e) {
// log.error(e.getMessage(), e);
mapResponse.setMessage(e.getMessage());
// mapResponse.setRc("06");
}
return Response.ok(mapResponse).build();
}
@POST
@Path("/P11_GETHISTRUNTASK")
public Response P11_GETHISTRUNTASK(
@QueryParam(value = "IN_REPORTNUMBER") String IN_REPORTNUMBER,
@QueryParam(value = "IN_USER") String IN_USER) {
ResponseModelIntegKeluhanMobile mapResponse = new ResponseModelIntegKeluhanMobile();
Map<String, Object> mapResult;
Map<String, Object> mapParam = new HashMap<>();
try {
mapParam.put("IN_REPORTNUMBER", IN_REPORTNUMBER);
mapParam.put("IN_USER", IN_USER);
mapParam.put("OUT_RC", "VARCHAR");
mapParam.put("OUT_MESSAGE", "VARCHAR");
mapParam.put("OUT_DATA", "CURSOR");
// mapResult = IntegKeluhanMobileService.P11_GETHISTRUNTASK(mapParam);
// mapResponse = AppServerIntegKeluhanMobile.setResultMessage(mapResult);
// log.info("log : {}",mapResponse);
} catch (Exception e) {
// log.error(e.getMessage(), e);
mapResponse.setMessage(e.getMessage());
// mapResponse.setRc("06");
}
return Response.ok(mapResponse).build();
}
@POST
@Path("/P12_GETFUNGSI")
public Response P12_GETFUNGSI(
@QueryParam(value = "IN_UNIT") String IN_UNIT,
@QueryParam(value = "IN_USER") String IN_USER) {
ResponseModelIntegKeluhanMobile mapResponse = new ResponseModelIntegKeluhanMobile();
Map<String, Object> mapResult;
Map<String, Object> mapParam = new HashMap<>();
try {
mapParam.put("IN_UNIT", IN_UNIT);
mapParam.put("IN_USER", IN_USER);
mapParam.put("OUT_RC", "VARCHAR");
mapParam.put("OUT_MESSAGE", "VARCHAR");
mapParam.put("OUT_DATA", "CURSOR");
// mapResult = IntegKeluhanMobileService.P12_GETFUNGSI(mapParam);
// mapResponse = AppServerIntegKeluhanMobile.setResultMessage(mapResult);
// log.info("log : {}",mapResponse);
} catch (Exception e) {
// log.error(e.getMessage(), e);
mapResponse.setMessage(e.getMessage());
// mapResponse.setRc("06");
}
return Response.ok(mapResponse).build();
}
@POST
@Path("/P13_GETMASTER_ISSUETYPE")
public Response P13_GETMASTER_ISSUETYPE() {
ResponseModelIntegKeluhanMobile mapResponse = new ResponseModelIntegKeluhanMobile();
try {
mapResponse.setData(issueTypeService.findAll());
mapResponse.setMessage("SUKSES");
mapResponse.setRc("00");
} catch (AppException e) {
mapResponse.setMessage(e.getMessage());
mapResponse.setRc(e.getRc());
}
return Response.ok(mapResponse).build();
}
@POST
@Path("/P14_GETUNIT")
public Response P14_GETUNIT(
@QueryParam(value = "IN_UNITTYPEID") Long IN_UNITTYPEID) {
ResponseModelIntegKeluhanMobile mapResponse = new ResponseModelIntegKeluhanMobile();
try {
mapResponse.setData(unitService.findByUnitTypeId(IN_UNITTYPEID));
mapResponse.setMessage("SUKSES");
mapResponse.setRc("00");
} catch (AppException e) {
mapResponse.setMessage(e.getMessage());
mapResponse.setRc(e.getRc());
}
return Response.ok(mapResponse).build();
}
@POST
@Path("/P15_GETJMLKELUHAN")
public Response P15_GETJMLKELUHAN(
@QueryParam(value = "IN_DISTRIBUTION") String IN_DISTRIBUTION,
@QueryParam(value = "IN_CREATEDATE") String IN_CREATEDATE,
@QueryParam(value = "IN_ESCALATIONID") String IN_ESCALATIONID) {
ResponseModelIntegKeluhanMobile mapResponse = new ResponseModelIntegKeluhanMobile();
Map<String, Object> mapResult;
Map<String, Object> mapParam = new HashMap<>();
try {
mapParam.put("IN_DISTRIBUTION", IN_DISTRIBUTION);
mapParam.put("IN_CREATEDATE", IN_CREATEDATE);
mapParam.put("IN_ESCALATIONID", IN_ESCALATIONID);
// mapParam.put("IN_USER", IN_USER);
mapParam.put("OUT_RC", "VARCHAR");
mapParam.put("OUT_MESSAGE", "VARCHAR");
mapParam.put("OUT_DATA", "CURSOR");
// mapResult = IntegKeluhanMobileService.P15_GETJMLKELUHAN(mapParam);
// mapResponse = AppServerIntegKeluhanMobile.setResultMessage(mapResult);
// log.info("log : {}",mapResponse);
} catch (Exception e) {
// log.error(e.getMessage(), e);
mapResponse.setMessage(e.getMessage());
// mapResponse.setRc("06");
}
return Response.ok(mapResponse).build();
}
@POST
@Path("/P16_GETBIDANGMEMBER")
public Response P16_GETBIDANGMEMBER(
@QueryParam(value = "IN_BIDANGUNITID") Long IN_BIDANGUNITID) {
ResponseModelIntegKeluhanMobile mapResponse = new ResponseModelIntegKeluhanMobile();
Map<String, Object> mapResult;
Map<String, Object> mapParam = new HashMap<>();
try {
mapParam.put("IN_BIDANGUNITID", IN_BIDANGUNITID);
mapParam.put("OUT_RC", "VARCHAR");
mapParam.put("OUT_MESSAGE", "VARCHAR");
mapParam.put("OUT_DATA", "CURSOR");
// mapResult = IntegKeluhanMobileService.P16_GETBIDANGMEMBER(mapParam);
// mapResponse = AppServerIntegKeluhanMobile.setResultMessage(mapResult);
// log.info("log : {}",mapResponse);
} catch (Exception e) {
// log.error(e.getMessage(), e);
mapResponse.setMessage(e.getMessage());
// mapResponse.setRc("06");
}
return Response.ok(mapResponse).build();
}
@POST
@Path("/P17_VALIDASIEMAIL")
public Response P17_VALIDASIEMAIL(
@QueryParam(value = "IN_EMAIL") String IN_EMAIL) {
ResponseModelIntegKeluhanMobile mapResponse = new ResponseModelIntegKeluhanMobile();
Map<String, Object> mapResult;
Map<String, Object> mapParam = new HashMap<>();
try {
mapParam.put("IN_EMAIL", IN_EMAIL);
mapParam.put("OUT_RC", "VARCHAR");
mapParam.put("OUT_MESSAGE", "VARCHAR");
mapParam.put("OUT_DATA", "CURSOR");
// mapResult = IntegKeluhanMobileService.P17_VALIDASIEMAIL(mapParam);
// mapResponse = AppServerIntegKeluhanMobile.setResultMessage(mapResult);
// log.info("log : {}",mapResponse);
} catch (Exception e) {
// log.error(e.getMessage(), e);
mapResponse.setMessage(e.getMessage());
// mapResponse.setRc("06");
}
return Response.ok(mapResponse).build();
}
@POST
@Path("/P18_ISSUETYPE")
public Response P18_ISSUETYPE(
// @QueryParam(value = "IN_UNIT") String IN_UNIT,
// @QueryParam(value = "IN_USER") String IN_USE
) {
ResponseModelIntegKeluhanMobile mapResponse = new ResponseModelIntegKeluhanMobile();
try {
mapResponse.setData(issueTypeService.findActive());
mapResponse.setMessage("SUKSES");
mapResponse.setRc("00");
} catch (AppException e) {
mapResponse.setMessage(e.getMessage());
mapResponse.setRc(e.getRc());
}
return Response.ok(mapResponse).build();
}
@POST
@Path("/P19_SUBISSUETYPE")
public Response P19_SUBISSUETYPE(
// @QueryParam(value = "IN_UNIT") String IN_UNIT,
// @QueryParam(value = "IN_USER") String IN_USE
) {
ResponseModelIntegKeluhanMobile mapResponse = new ResponseModelIntegKeluhanMobile();
Map<String, Object> mapResult;
Map<String, Object> mapParam = new HashMap<>();
try {
// mapParam.put("IN_UNIT", IN_UNIT);
// mapParam.put("IN_USER", IN_USER);
mapParam.put("OUT_RC", "VARCHAR");
mapParam.put("OUT_MESSAGE", "VARCHAR");
mapParam.put("OUT_DATA", "CURSOR");
// mapResult = IntegKeluhanMobileService.P19_SUBISSUETYPE(mapParam);
// mapResponse = AppServerIntegKeluhanMobile.setResultMessage(mapResult);
// log.info("log : {}",mapResponse);
} catch (Exception e) {
// log.error(e.getMessage(), e);
mapResponse.setMessage(e.getMessage());
// mapResponse.setRc("06");
}
return Response.ok(mapResponse).build();
}
}

View File

@ -0,0 +1,137 @@
package org.sadigit.boundary.v2.endpoint;
import java.io.InputStream;
import java.util.HashMap;
import java.util.Map;
import org.sadigit.model.ResponseModelIntegKeluhanMobile;
import org.sadigit.model.ResponseModelIntegKeluhanMobileTanpaOutData;
import io.smallrye.mutiny.Uni;
import jakarta.inject.Inject;
import jakarta.ws.rs.POST;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.Produces;
import jakarta.ws.rs.QueryParam;
import jakarta.ws.rs.core.Response;
import lombok.extern.slf4j.Slf4j;
@Slf4j
@Path("/api/apkt/integkeluhanmobile")
@Produces("application/json")
public class IntegKeluhanMobileResourceV2 {
@POST
@Path("/P018_SETPENJELASANBIDANGV2")
public Response P018_SETPENJELASANBIDANGV2(
@QueryParam(value = "IN_REPORTNUMBER") String IN_REPORTNUMBER,
@QueryParam(value = "IN_USER") String IN_USER,
@QueryParam(value = "IN_CUSTOMERRESPONSE") String IN_CUSTOMERRESPONSE,
@QueryParam(value = "IN_REMARK") String IN_REMARK,
@QueryParam(value = "IN_IMPLEMENTOR") String IN_IMPLEMENTOR,
@QueryParam(value = "IN_ISSUETYPE") String IN_ISSUETYPE,
@QueryParam(value = "IN_SUBISSUETYPE") String IN_SUBISSUETYPE) {
ResponseModelIntegKeluhanMobileTanpaOutData mapResponse = new ResponseModelIntegKeluhanMobileTanpaOutData();
Map<String, Object> mapResult;
Map<String, Object> mapParam = new HashMap<>();
try {
mapParam.put("IN_REPORTNUMBER", IN_REPORTNUMBER);
mapParam.put("IN_USER", IN_USER);
mapParam.put("IN_CUSTOMERRESPONSE", IN_CUSTOMERRESPONSE);
mapParam.put("IN_REMARK", IN_REMARK);
mapParam.put("IN_IMPLEMENTOR", IN_IMPLEMENTOR);
mapParam.put("IN_ISSUETYPE", IN_ISSUETYPE);
mapParam.put("IN_SUBISSUETYPE", IN_SUBISSUETYPE);
mapParam.put("OUT_RC", "VARCHAR");
mapParam.put("OUT_MESSAGE", "VARCHAR");
mapParam.put("OUT_DATA", "CURSOR");
// mapResult = IntegKeluhanMobileService.P20_SETPENJELASANBIDANG(mapParam);
// mapResponse =
// AppServerIntegKeluhanMobileLoginTanpaOutData.setResultMessage(mapResult);
// System.out.println(" log = " + mapResponse);
} catch (Exception e) {
// log.error(e.getMessage(), e);
mapResponse.setMessage(e.getMessage());
// mapResponse.setRc("06");
}
return Response.ok(mapResponse).build();
}
@POST
@Path("/P21_MUTASI_KG")
public Response P21_MUTASI_KG(
@QueryParam(value = "IN_REPORTNUMBER") String IN_REPORTNUMBER,
@QueryParam(value = "IN_USER") String IN_USER,
@QueryParam(value = "IN_ALASAN") String IN_ALASAN) {
ResponseModelIntegKeluhanMobileTanpaOutData mapResponse = new ResponseModelIntegKeluhanMobileTanpaOutData();
Map<String, Object> mapResult;
Map<String, Object> mapParam = new HashMap<>();
try {
mapParam.put("IN_REPORTNUMBER", IN_REPORTNUMBER);
mapParam.put("IN_USER", IN_USER);
mapParam.put("IN_ALASAN", IN_ALASAN);
mapParam.put("OUT_RC", "VARCHAR");
mapParam.put("OUT_MESSAGE", "VARCHAR");
// mapParam.put("OUT_DATA", "CURSOR");
// mapResult = IntegKeluhanMobileService.P21_MUTASI_KG(mapParam);
// mapResponse =
// AppServerIntegKeluhanMobileLoginTanpaOutData.setResultMessage(mapResult);
// System.out.println(" log = " + mapResponse);
} catch (Exception e) {
// log.error(e.getMessage(), e);
mapResponse.setMessage(e.getMessage());
// mapResponse.setRc("06");
}
return Response.ok(mapResponse).build();
}
@POST
@Path("/P22_SEND_LISTRIQU")
public Response P22_SEND_LISTRIQU(
@QueryParam(value = "IN_REPORTNUMBER") String IN_REPORTNUMBER,
@QueryParam(value = "IN_USER") String IN_USER,
@QueryParam(value = "IN_ALASAN") String IN_ALASAN) {
ResponseModelIntegKeluhanMobileTanpaOutData mapResponse = new ResponseModelIntegKeluhanMobileTanpaOutData();
Map<String, Object> mapResult;
Map<String, Object> mapParam = new HashMap<>();
try {
mapParam.put("IN_REPORTNUMBER", IN_REPORTNUMBER);
mapParam.put("IN_USER", IN_USER);
mapParam.put("IN_ALASAN", IN_ALASAN);
mapParam.put("OUT_RC", "VARCHAR");
mapParam.put("OUT_MESSAGE", "VARCHAR");
// mapParam.put("OUT_DATA", "CURSOR");
// mapResult = IntegKeluhanMobileService.P21_MUTASI_KG(mapParam);
// mapResponse =
// AppServerIntegKeluhanMobileLoginTanpaOutData.setResultMessage(mapResult);
// System.out.println(" log = " + mapResponse);
} catch (Exception e) {
// log.error(e.getMessage(), e);
mapResponse.setMessage(e.getMessage());
// mapResponse.setRc("06");
}
return Response.ok(mapResponse).build();
}
}

View File

@ -0,0 +1,25 @@
package org.sadigit.control.errorhandler;
import java.util.LinkedHashMap;
import java.util.Map;
import org.sadigit.control.exception.BadRequestBodyException;
import jakarta.ws.rs.core.Response;
import jakarta.ws.rs.ext.ExceptionMapper;
import jakarta.ws.rs.ext.Provider;
@Provider
public class BadRequestBodyErrorHandler implements ExceptionMapper<BadRequestBodyException> {
@Override
public Response toResponse(BadRequestBodyException exception) {
Map<String, Object> response = new LinkedHashMap<>();
response.put("status", false);
response.put("title", "Bad Request");
response.put("message", exception.getMessage());
return Response.status(403).entity(response).build();
}
}

View File

@ -0,0 +1,26 @@
package org.sadigit.control.errorhandler;
import java.util.LinkedHashMap;
import java.util.Map;
import org.sadigit.control.exception.FileProcessingException;
import jakarta.ws.rs.core.Response;
import jakarta.ws.rs.ext.ExceptionMapper;
import jakarta.ws.rs.ext.Provider;
@Provider
public class FileProcessingErrorHandler implements ExceptionMapper<FileProcessingException> {
@Override
public Response toResponse(FileProcessingException exception) {
Map<String, Object> response = new LinkedHashMap<>();
response.put("status", false);
response.put("title", "Bad Request");
response.put("message", exception.getMessage());
return Response.status(403).entity(response).build();
}
}

View File

@ -0,0 +1,31 @@
package org.sadigit.control.errorhandler;
import java.util.Map;
import java.util.stream.Collectors;
import jakarta.validation.ConstraintViolationException;
import jakarta.ws.rs.core.Response;
import jakarta.ws.rs.ext.ExceptionMapper;
import jakarta.ws.rs.ext.Provider;
import lombok.extern.slf4j.Slf4j;
@Provider
@Slf4j
public class ValidationExceptionErrorHandler implements ExceptionMapper<ConstraintViolationException>{
@Override
public Response toResponse(ConstraintViolationException exception) {
var errorStructure = exception.getConstraintViolations()
.stream()
.map(violation -> Map.of(
"path", violation.getPropertyPath().toString(),
"message", violation.getMessage()
))
.collect(Collectors.toList());
log.error("Validation error: {}", errorStructure);
return Response.status(Response.Status.OK).entity(errorStructure).build();
}
}

View File

@ -0,0 +1,5 @@
package org.sadigit.control.exception;
public class AppFlowException extends RuntimeException{
}

View File

@ -0,0 +1,17 @@
package org.sadigit.control.exception;
public class BadRequestBodyException extends RuntimeException {
private static final long serialVersionUID = 1L;
public BadRequestBodyException() {
super();
}
public BadRequestBodyException(String msg) {
super(msg);
}
public BadRequestBodyException(String msg, Exception e) {
super(msg, e);
}
}

View File

@ -0,0 +1,17 @@
package org.sadigit.control.exception;
public class FileProcessingException extends RuntimeException {
private static final long serialVersionUID = 1L;
public FileProcessingException() {
super();
}
public FileProcessingException(String msg) {
super(msg);
}
public FileProcessingException(String msg, Exception e) {
super(msg, e);
}
}

View File

@ -0,0 +1,24 @@
// package org.sadigit.control.security;
// import io.quarkus.elytron.security.common.BcryptUtil;
// import io.quarkus.security.jpa.Password;
// import io.quarkus.security.jpa.Roles;
// import io.quarkus.security.jpa.UserDefinition;
// import io.quarkus.security.jpa.Username;
// @UserDefinition
// public class User {
// @Username
// public String username;
// @Password
// public String password;
// @Roles
// public String role;
// public User(String username, String password, String role) {
// this.username = username;
// this.password = BcryptUtil.bcryptHash(password);
// this.role = role;
// }
// }

View File

@ -0,0 +1,104 @@
package org.sadigit.entity;
import lombok.Getter;
import lombok.Setter;
import java.sql.Timestamp;
import java.util.List;
import org.hibernate.annotations.Immutable;
import io.quarkus.hibernate.orm.panache.PanacheEntityBase;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.persistence.JoinColumn;
import jakarta.persistence.ManyToMany;
import jakarta.persistence.ManyToOne;
import jakarta.persistence.OneToMany;
import jakarta.persistence.Table;
@Entity
@Getter
@Setter
@Immutable
@Table(name = "appuser", schema = "apkt_transactional")
public class AppUser extends PanacheEntityBase {
@Id
@Column(name = "userid", nullable = false)
private Long userId;
@Column(name = "username", length = 200)
private String username;
@Column(name = "employeename", length = 200)
private String employeeName;
@Column(name = "nip", length = 200)
private String nip;
@Column(name = "password", length = 200)
private String password;
@Column(name = "address", length = 4000)
private String address;
@Column(name = "phone", length = 20)
private String phone;
@Column(name = "mobile", length = 20)
private String mobile;
@Column(name = "email", length = 200)
private String email;
@Column(name = "positionid")
private Long positionId;
@Column(name = "unitid")
private Long unitId;
@Column(name = "isactive", length = 255)
private String isActive;
@Column(name = "islogin", length = 255)
private String isLogin;
@Column(name = "passwordchangedate")
private Timestamp passwordChangeDate;
@Column(name = "createdate")
private Timestamp createDate;
@Column(name = "createby")
private Long createBy;
@Column(name = "updatedate")
private Timestamp updateDate;
@Column(name = "updateby")
private Long updateBy;
@Column(name = "pukid")
private Long pukId;
@Column(name = "pukanswer", length = 200)
private String pukAnswer;
@Column(name = "defaulttab")
private Long defaultTab;
@Column(name = "no_imei", length = 50)
private String noImei;
@Column(name = "domain", length = 50)
private String domain;
@Column(name = "picture")
private String picture;
@OneToMany(mappedBy = "idUser")
private List<UserRole> userRole;
}

View File

@ -0,0 +1,36 @@
package org.sadigit.entity;
import java.math.BigDecimal;
import java.security.Timestamp;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import lombok.Getter;
import lombok.Setter;
@Entity
@Getter
@Setter
@Table(name = "issuetype", schema = "apkt_transactional")
public class Issuetype {
@Id
@Column(name = "issuetypeid", nullable = false)
private Long issueTypeId;
@Column(name = "issuetypecode", length = 10)
private String issueTypeCode;
@Column(name = "issuetypename", length = 200)
private String issueTypeName;
@Column(name = "projectid")
private Long projectId;
@Column(name = "isactive", length = 1)
private String isActive;
@Column(name = "description", length = 4000)
private String description;
}

View File

@ -0,0 +1,206 @@
package org.sadigit.entity;
import java.security.Timestamp;
import java.time.LocalDateTime;
import org.locationtech.jts.geom.Geometry;
import org.sadigit.adapter.GeometryAdapter;
import jakarta.json.bind.annotation.JsonbTypeAdapter;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.JoinColumn;
import jakarta.persistence.ManyToOne;
import jakarta.persistence.Table;
import lombok.Getter;
import lombok.Setter;
@Entity
@Getter
@Setter
@Table(name = "keluhan", schema = "apkt_transactional")
public class Keluhan {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(name = "id_pelanggan_no_meter")
private Long idPelangganNoMeter;
@Column(name = "id_ulp")
private Long idUlp;
@Column(name = "id_tipe_permasalahan")
private Long idTipePermasalahan;
@Column(name = "alamat_pelanggan", length = 255)
private String alamatPelanggan;
@Column(name = "nama_pelapor", length = 255)
private String namaPelapor;
@Column(name = "telepon_pelapor", length = 255)
private String teleponPelapor;
@Column(name = "hp_pelapor", length = 255)
private String hpPelapor;
@Column(name = "fax_pelapor", length = 255)
private String faxPelapor;
@Column(name = "email_pelapor", length = 255)
private String emailPelapor;
@Column(name = "alamat_pelapor", length = 4000)
private String alamatPelapor;
@Column(length = 255)
private String media;
@Column(name = "waktu_padam", length = 255)
private LocalDateTime waktuPadam;
@Column(length = 255)
private String konfirmasi;
@JsonbTypeAdapter(GeometryAdapter.class)
@Column(name = "lokasi", columnDefinition = "geometry(Point,4326)")
private Geometry lokasi;
@Column(name = "no_laporan")
private String noLaporan;
@Column(length = 4000)
private String keterangan;
@Column(name = "created_date")
private LocalDateTime createdDate;
@Column(name = "created_by")
private Long createdBy;
@Column(name = "updated_date")
private LocalDateTime updatedDate;
@Column(name = "updated_by")
private Long updatedBy;
@Column(name = "status_akhir", length = 50)
private String statusAkhir;
@Column(name = "tipe_wo")
private Long tipeWo;
private Long unit;
private Long eskalasi;
private String permasalahan;
@Column(name = "waktu_lapor")
private LocalDateTime waktuLapor;
@Column(name = "id_regu")
private Long idRegu;
@Column(name = "waktu_penugasan")
private LocalDateTime waktuPenugasan;
@Column(name = "waktu_perjalanan")
private LocalDateTime waktuPerjalanan;
@Column(name = "waktu_pengerjaan")
private LocalDateTime waktuPengerjaan;
@Column(name = "waktu_nyala_sementara")
private LocalDateTime waktuNyalaSementara;
@Column(name = "waktu_nyala")
private LocalDateTime waktuNyala;
@Column(name = "waktu_batal")
private LocalDateTime waktuBatal;
@Column(name = "waktu_selesai")
private LocalDateTime waktuSelesai;
@Column(name = "tipe_keluhan")
private Long tipeKeluhan;
@Column(name = "tipe_sub_keluhan")
private Long tipeSubKeluhan;
private String alasan;
private String patokan;
private Long jarak;
@Column(name = "id_kelurahan")
private Long idKelurahan;
private String fax;
@Column(name = "keterangan_lokasi")
private String keteranganLokasi;
@Column(name = "waktu_fax")
private LocalDateTime waktuFax;
@Column(name = "nama_media")
private String namaMedia;
@Column(name = "waktu_media")
private LocalDateTime waktuMedia;
@Column(name = "id_posko")
private Long idPosko;
@Column(name = "respon_pelanggan")
private String responPelanggan;
private String uraian;
private String pelaksana;
@Column(name = "id_tarif_daya")
private Long idTarifDaya;
private String summary;
@Column(name = "jumlah_lapor")
private Long jumlahLapor;
private String deskripsi;
@Column(name = "waktu_konfirmasi")
private LocalDateTime waktuKonfirmasi;
@Column(name = "waktu_menunggu_tanggapan_supervisor")
private LocalDateTime waktuMenungguTanggapanSupervisor;
@Column(name = "tindak_lanjut_penyelesaian")
private String tindakLanjutPenyelesaian;
@Column(name = "no_lapor_pln")
private String noLaporPln;
@Column(name = "no_tiket_crm")
private String noTiketCrm;
@ManyToOne()
@JoinColumn(name = "id_kelurahan", referencedColumnName = "id_kelurahan", insertable = false, updatable = false)
private MasterKelurahan kelurahan;
@ManyToOne()
@JoinColumn(name = "tipe_keluhan", referencedColumnName = "issuetypeid", insertable = false, updatable = false)
private Issuetype issueType;
@ManyToOne()
@JoinColumn(name = "tipe_sub_keluhan", referencedColumnName = "subissuetypeid", insertable = false, updatable = false)
private SubIssueType subIssueType;
}

View File

@ -0,0 +1,59 @@
package org.sadigit.entity;
import java.security.Timestamp;
import java.time.LocalDateTime;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import lombok.Getter;
import lombok.Setter;
@Entity
@Getter
@Setter
@Table(name = "master_kelurahan", schema = "apkt_transactional")
public class MasterKelurahan {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id_kelurahan")
private Long idKelurahan;
@Column(name = "nama_kelurahan", nullable = false)
private String namaKelurahan;
@Column(name = "created_date")
private LocalDateTime createdDate;
@Column(name = "created_by")
private Long createdBy;
@Column(name = "updated_date")
private LocalDateTime updatedDate;
@Column(name = "updated_by")
private Long updatedBy;
@Column(name = "id_kecamatan")
private Long idKecamatan;
@Column(name = "nama_kecamatan")
private String namaKecamatan;
@Column(name = "id_kota")
private Long idKota;
@Column(name = "nama_kota")
private String namaKota;
@Column(name = "id_provinsi")
private Long idProvinsi;
@Column(name = "nama_provinsi")
private String namaProvinsi;
private String status;
}

View File

@ -0,0 +1,38 @@
package org.sadigit.entity;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import lombok.Getter;
import lombok.Setter;
@Entity
@Getter
@Setter
@Table(name = "subissuetype", schema = "apkt_transactional")
public class SubIssueType {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "subissuetypeid", nullable = false)
private Long subissuetypeid;
@Column(name = "issuetypeid", nullable = true)
private Long issuetypeid;
@Column(name = "subissuetypename", length = 200, nullable = true)
private String subissuetypename;
@Column(name = "projectid", nullable = true)
private Long projectid;
@Column(name = "isactive", length = 1, nullable = true)
private String isactive;
@Column(name = "description", length = 4000, nullable = true)
private String description;
}

View File

@ -0,0 +1,87 @@
package org.sadigit.entity;
import java.math.BigDecimal;
import java.security.Timestamp;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import lombok.Getter;
import lombok.Setter;
@Entity
@Getter
@Setter
@Table(name = "unit", schema = "apkt_transactional")
public class Unit {
@Id
@Column(name = "unitid", nullable = false)
private Long unitId;
@Column(name = "unitcode", length = 10)
private String unitCode;
@Column(name = "unitname", length = 100)
private String unitName;
@Column(name = "unittypeid")
private Long unitTypeId;
@Column(name = "unitparent")
private Long unitParent;
@Column(name = "address", length = 250)
private String address;
@Column(name = "city", length = 50)
private String city;
@Column(name = "zip", length = 5)
private String zip;
@Column(name = "phone", length = 20)
private String phone;
@Column(name = "mobile", length = 20)
private String mobile;
@Column(name = "fax", length = 20)
private String fax;
@Column(name = "email", length = 100)
private String email;
@Column(name = "ipaddress", length = 15)
private String ipAddress;
@Column(name = "createdate")
private Timestamp createDate;
@Column(name = "createby")
private BigDecimal createBy;
@Column(name = "updatedate")
private Timestamp updateDate;
@Column(name = "updateby")
private BigDecimal updateBy;
@Column(name = "isactive", length = 1)
private String isActive;
@Column(name = "coordinator")
private BigDecimal coordinator;
@Column(name = "supervisor")
private BigDecimal supervisor;
@Column(name = "assistantmanager")
private BigDecimal assistantManager;
@Column(name = "assmanphone", length = 20)
private String assManPhone;
@Column(name = "vehiclecolor", length = 10)
private String vehicleColor;
}

View File

@ -0,0 +1,54 @@
package org.sadigit.entity;
import java.time.LocalDateTime;
import io.quarkus.hibernate.orm.panache.PanacheEntityBase;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.JoinColumn;
import jakarta.persistence.ManyToMany;
import jakarta.persistence.ManyToOne;
import jakarta.persistence.Table;
import lombok.Getter;
import lombok.Setter;
@Entity
@Getter
@Setter
@Table(name = "user_role", schema = "apkt_transactional")
public class UserRole extends PanacheEntityBase {
@Id
private Long id;
@Column(name = "id_user", nullable = false)
private Long idUser;
@Column(name = "id_role", nullable = false)
private Long idRole;
@Column(name = "start_date", nullable = false)
private LocalDateTime startDate;
@Column(name = "end_date", nullable = false)
private LocalDateTime endDate;
@Column(name = "created_date")
private LocalDateTime createdDate;
@Column(name = "created_by")
private Long createdBy;
@Column(name = "updated_date")
private LocalDateTime updatedDate;
@Column(name = "updated_by")
private Long updatedBy;
@ManyToOne()
@JoinColumn(name = "id_user", referencedColumnName = "userid", insertable = false, updatable = false)
AppUser appUser;
}

View File

@ -0,0 +1,27 @@
package org.sadigit.mapper;
import org.sadigit.entity.AppUser;
import org.sadigit.model.dto.AppUserDto;
public class AppUserMapper {
public AppUserMapper() {
}
public static AppUserDto entityToDTO(AppUser entity) {
return AppUserDto.builder()
.address(entity.getAddress())
.nip(entity.getNip())
.phone(entity.getPhone())
.positionid(entity.getPositionId().intValue())
.isactive(entity.getIsActive())
.mobile(entity.getMobile())
.unitid(entity.getUnitId().intValue())
.userid(entity.getUserId().intValue())
.employeename(entity.getEmployeeName())
.email(entity.getEmail())
.username(entity.getUsername())
.build();
}
}

View File

@ -0,0 +1,22 @@
package org.sadigit.mapper;
import org.sadigit.entity.Issuetype;
import org.sadigit.model.dto.IssueTypeDto;
import io.quarkus.logging.Log;
import lombok.extern.slf4j.Slf4j;
@Slf4j
public class IssueTypeMapper {
public IssueTypeMapper() {
}
public static IssueTypeDto entityToDTO(Issuetype entity) {
return IssueTypeDto.builder()
.issuetypeid(entity.getIssueTypeId())
.issuetypename(entity.getIssueTypeName())
.build();
}
}

View File

@ -0,0 +1,63 @@
package org.sadigit.mapper;
import org.sadigit.entity.Keluhan;
import org.sadigit.model.dto.KeluhantDto;
public class KeluhanMapper {
public KeluhanMapper() {
}
public static KeluhantDto entityToDTO(Keluhan entity) {
return KeluhantDto.builder()
.provinsi(entity.getKelurahan() != null ? entity.getKelurahan().getNamaProvinsi() : null)
.keterangan(entity.getKeterangan())
.latitude(0)
.referencelocation(entity.getLokasi() != null ? entity.getLokasi().toString() : null)
.createdate(entity.getCreatedDate())
.description(entity.getDeskripsi())
.idnomormeter(entity.getIdPelangganNoMeter() != null ? entity.getIdPelangganNoMeter().toString() : null)
.distribution(null)
.flaghisto(0)
.issuetypename(entity.getIssueType().getIssueTypeName())
.kabupaten(entity.getKelurahan() != null ? entity.getKelurahan().getNamaKota() : null)
.serviceunitid(0)
.createby(entity.getCreatedBy())
.updatedate(entity.getUpdatedDate())
.isgerai(false)
.unitname(null)
.subissuetypename(entity.getSubIssueType().getSubissuetypename())
.customername(null)
.plnreportnumber(null)
.longitude(0)
.summary("1")
.escalationid(entity.getEskalasi())
.lapor(0)
.customernumber(1)
.reportnumber(entity.getNoLaporan())
.reporteremail(null)
.kelurahan(entity.getKelurahan() != null ? entity.getKelurahan().getNamaKelurahan() : null)
.priorityid(0)
.neareststreet(null)
.nometer(null)
.priorityname("NORMAL")
.subissuetypeid(entity.getTipeKeluhan())
.updateby(entity
.getUpdatedBy() != null ? entity.getUpdatedBy() : 0)
.runworkflowid(0)
.reportermobile(null)
.customerid(null)
.reporteraddress(null)
.kecamatan(entity.getKelurahan() != null ? entity.getKelurahan().getNamaKecamatan()
: null)
.laststatus(entity.getStatusAkhir())
.issuetypeid(entity.getTipeKeluhan())
.location(null)
.reportername(entity.getNamaPelapor())
.reporterphone(entity.getHpPelapor())
.reporterfax(entity.getFaxPelapor())
.unitparent(null)
.build();
}
}

View File

@ -0,0 +1,24 @@
package org.sadigit.mapper;
import org.sadigit.entity.Issuetype;
import org.sadigit.model.dto.MasterIssueTypeDto;
import io.quarkus.logging.Log;
import lombok.extern.slf4j.Slf4j;
@Slf4j
public class MasterIssueTypeMapper {
public MasterIssueTypeMapper() {
}
public static MasterIssueTypeDto entityToDTO(Issuetype entity) {
return MasterIssueTypeDto.builder()
.jenis_pengaduan("KELUHAN")
.issuetypeid(entity.getIssueTypeId())
.issuetypename(entity.getIssueTypeName())
.projectid(entity.getProjectId())
.build();
}
}

View File

@ -0,0 +1,35 @@
package org.sadigit.mapper;
import org.sadigit.entity.AppUser;
import org.sadigit.model.dto.PenggunaDto;
import org.sadigit.util.Checks;
import io.quarkus.logging.Log;
import lombok.extern.slf4j.Slf4j;
@Slf4j
public class PenggunaMapper {
public PenggunaMapper() {
}
public static PenggunaDto entityToDTO(AppUser entity) {
return PenggunaDto.builder()
.nip(entity.getNip())
.positionid(entity.getPositionId().intValue())
.roleid(getFirstRoleId(entity))
.unitid(entity.getUnitId().intValue())
.userid(entity.getUserId().intValue())
.employeename(entity.getEmployeeName())
.username(entity.getUsername())
.build();
}
private static Integer getFirstRoleId(AppUser entity) {
if (entity.getUserRole() != null && !entity.getUserRole().isEmpty()) {
return entity.getUserRole().get(0).getIdRole().intValue();
}
return null;
}
}

View File

@ -0,0 +1,42 @@
package org.sadigit.model;
import java.io.Serializable;
import io.quarkus.runtime.annotations.RegisterForReflection;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@ToString
@RegisterForReflection
public class ResponseModelIntegKeluhanMobile <T> implements Serializable {
private String Rc;
private String Message;
private T Data;
public String getRc() { return Rc; }
public void setRc(String rc) { this.Rc = rc; }
public String getMessage() {
return Message;
}
public void setMessage(String message) {
this.Message = message;
}
public T getData() {
return Data;
}
public void setData(T data) {
Data = data;
}
}

View File

@ -0,0 +1,33 @@
package org.sadigit.model;
import java.io.Serializable;
import io.quarkus.runtime.annotations.RegisterForReflection;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@ToString
@RegisterForReflection
public class ResponseModelIntegKeluhanMobileTanpaOutData implements Serializable{
private String Rc;
private String Message;
public String getRc() { return Rc; }
public void setRc(String rc) { this.Rc = rc; }
public String getMessage() {
return Message;
}
public void setMessage(String message) {
this.Message = message;
}
}

View File

@ -0,0 +1,22 @@
package org.sadigit.model.dto;
import lombok.Builder;
import lombok.Getter;
import lombok.Setter;
@Builder(toBuilder = true)
@Setter
@Getter
public class AppUserDto {
private String address;
private String nip;
private String phone;
private int positionid;
private String isactive;
private String mobile;
private int unitid;
private int userid;
private String employeename;
private String email;
private String username;
}

View File

@ -0,0 +1,13 @@
package org.sadigit.model.dto;
import lombok.Builder;
import lombok.Getter;
import lombok.Setter;
@Builder(toBuilder = true)
@Setter
@Getter
public class IssueTypeDto {
private Long issuetypeid;
private String issuetypename;
}

View File

@ -0,0 +1,61 @@
package org.sadigit.model.dto;
import java.sql.Date;
import java.time.LocalDate;
import java.time.LocalDateTime;
import lombok.Builder;
import lombok.Getter;
import lombok.Setter;
@Builder(toBuilder = true)
@Setter
@Getter
public class KeluhantDto {
private String provinsi;
private String keterangan;
private double latitude;
private String referencelocation;
private LocalDateTime createdate;
private String description;
private String idnomormeter;
private String distribution;
private int flaghisto;
private String issuetypename;
private String kabupaten;
private int serviceunitid;
private long createby;
private LocalDateTime updatedate;
private Boolean isgerai;
private String unitname;
private String subissuetypename;
private String customername;
private String plnreportnumber;
private double longitude;
private String summary;
private Long escalationid;
private int lapor;
private int customernumber;
private String reportnumber;
private String reporteremail;
private String kelurahan;
private int priorityid;
private String neareststreet;
private String nometer;
private String priorityname;
private Long subissuetypeid;
private long updateby;
private long runworkflowid;
private String reportermobile;
private String customerid;
private String reporteraddress;
private String kecamatan;
private String laststatus;
private Long issuetypeid;
private String location;
private String reportername;
private String reporterphone;
private String reporterfax;
private String unitparent;
}

View File

@ -0,0 +1,16 @@
package org.sadigit.model.dto;
import lombok.Builder;
import lombok.Getter;
import lombok.Setter;
@Builder(toBuilder = true)
@Setter
@Getter
public class MasterIssueTypeDto {
private String jenis_pengaduan;
private Long issuetypeid;
private String issuetypename;
private Long projectid;
}

View File

@ -0,0 +1,18 @@
package org.sadigit.model.dto;
import lombok.Builder;
import lombok.Getter;
import lombok.Setter;
@Builder(toBuilder = true)
@Setter
@Getter
public class PenggunaDto {
private String nip;
private int positionid;
private Integer roleid;
private int unitid;
private int userid;
private String employeename;
private String username;
}

View File

@ -0,0 +1,17 @@
package org.sadigit.model.dto;
import lombok.Builder;
import lombok.Getter;
import lombok.Setter;
@Builder(toBuilder = true)
@Setter
@Getter
public class UnitDto {
private String unit_jaringan;
private String unitname;
private Long unitid;
private Long unittypeid;
private Long unitparent;
}

View File

@ -0,0 +1,23 @@
package org.sadigit.repository;
import java.util.List;
import org.sadigit.entity.AppUser;
import io.quarkus.hibernate.orm.panache.PanacheRepositoryBase;
import jakarta.enterprise.context.ApplicationScoped;
@ApplicationScoped
public class AppUserRepository implements PanacheRepositoryBase<AppUser, Long> {
public AppUser findByUsername(String username) {
return find("username", username).count() > 0 ? find("username", username).firstResult() : null;
}
public AppUser findByUsernameAndPassword(String username, String password) {
return find("username = ?1 and password = ?2", username, password).firstResult();
}
public List<AppUser> findByUnitIdAndPositionId(Long unitId, Long positionId) {
return find("unitId = ?1 and positionId = ?2 and isActive='1'", unitId, positionId).list();
}
}

View File

@ -0,0 +1,19 @@
package org.sadigit.repository;
import java.util.List;
import org.sadigit.entity.Issuetype;
import io.quarkus.hibernate.orm.panache.PanacheRepositoryBase;
import jakarta.enterprise.context.ApplicationScoped;
@ApplicationScoped
public class IssueTypeRepository implements PanacheRepositoryBase<Issuetype, Long> {
public List<Issuetype> findIssueTypeKeluhan() {
return find("projectId = ?1", 2).list();
}
public List<Issuetype> findIssueTypeActiveKeluhan() {
return find("projectId = ?1 AND isActive = ?2", 2, "1").list();
}
}

View File

@ -0,0 +1,27 @@
package org.sadigit.repository;
import java.sql.Date;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.List;
import org.sadigit.entity.Keluhan;
import io.quarkus.hibernate.orm.panache.PanacheRepositoryBase;
import jakarta.enterprise.context.ApplicationScoped;
import lombok.extern.slf4j.Slf4j;
@Slf4j
@ApplicationScoped
public class KeluhanRepository implements PanacheRepositoryBase<Keluhan, Long> {
public List<Keluhan> findKeluhanByUnitId(Long unitId, String startDate, String endDate) {
Date start = Date.valueOf(startDate);
Date end = Date.valueOf(endDate);
log.info("start: {}", start);
return find("unit = ?1 and date(createdDate) >= ?2 and date(createdDate)<= ?3", unitId, start, end)
.list();
}
}

View File

@ -0,0 +1,27 @@
package org.sadigit.repository;
import java.util.List;
import org.hibernate.Session;
import org.hibernate.query.Query;
import org.sadigit.model.dto.UnitDto;
import io.quarkus.hibernate.orm.panache.PanacheRepositoryBase;
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.inject.Inject;
@ApplicationScoped
public class UnitRepository implements PanacheRepositoryBase<UnitDto, Long> {
@Inject
Session session;
public List<UnitDto> findByUnitTypeId(Long unitTypeId) {
Query<UnitDto> query = session.createQuery(
"SELECT (SELECT B.unitName FROM Unit B WHERE B.unitId = A.unitParent) AS unitJaringan, A.unitName, A.unitId, A.unitTypeId, A.unitParent "
+ "FROM Unit A WHERE unitTypeId = ?1",
UnitDto.class);
query.setParameter(1, unitTypeId);
return query.list();
}
}

View File

@ -0,0 +1,304 @@
// package org.sadigit.scheduling.Ago;
// import com.iconpln.schedulerintegapktago.dao.AgoApktDao;
// import java.io.IOException;
// import java.util.ArrayList;
// import java.util.HashMap;
// import java.util.Iterator;
// import java.util.List;
// import java.util.Map;
// import org.slf4j.Logger;
// import org.slf4j.LoggerFactory;
// import org.springframework.beans.factory.annotation.Autowired;
// import org.springframework.stereotype.Component;
// @Component("jobGetAgoApkt")
// public class JobGetAgoApkt {
// private static final Logger log =
// LoggerFactory.getLogger(JobGetAgoApkt.class);
// @Autowired
// private AgoApktDao agoApktDao;
// public JobGetAgoApkt() {
// }
// public void executeGetAgoApkt() throws IOException {
// log.info("--- JOB GET AGO APKT ---");
// List<Map<String, String>> lstMap = this.getAmbilDataAgoSync();
// if (!lstMap.isEmpty()) {
// Iterator var2 = lstMap.iterator();
// while(var2.hasNext()) {
// Map<String, String> mapsync = (Map)var2.next();
// List lstMapMasterKooBon;
// Map SimpanDataMasterKooBon;
// if (((String)mapsync.get("id_master")).toString().equals("1")) {
// lstMapMasterKooBon = this.getAmbilDataMaterialPihak3();
// if (!lstMapMasterKooBon.isEmpty()) {
// log.info("BERHASIL GET AGO JML DATA MATERIAL PIHAK 3 : {}",
// lstMapMasterKooBon.size());
// log.info("BERHASIL GET AGO RESPONSE MATERIAL PIHAK 3 : {}",
// lstMapMasterKooBon);
// SimpanDataMasterKooBon = this.SimpanDataMaterialPihak3(lstMapMasterKooBon);
// if (((String)SimpanDataMasterKooBon.get("return")).equals("1")) {
// log.info("BERHASIL SIMPAN AGO SIMPAN DATA MATERIAL PIHAK 3: {}",
// SimpanDataMasterKooBon);
// }
// } else {
// log.info("GAGAL GET AGO RESPONSE MATERIAL : DATA KOSONG {}",
// lstMapMasterKooBon);
// }
// }
// if (((String)mapsync.get("id_master")).toString().equals("2")) {
// lstMapMasterKooBon = this.getAmbilDataMasterKoo();
// if (!lstMapMasterKooBon.isEmpty()) {
// log.info("BERHASIL GET AGO JML DATA KOO : {}", lstMapMasterKooBon.size());
// log.info("BERHASIL GET AGO RESPONSE KOO: {}", lstMapMasterKooBon);
// SimpanDataMasterKooBon = this.SimpanDataMasterKoo(lstMapMasterKooBon);
// if (((String)SimpanDataMasterKooBon.get("return")).equals("1")) {
// log.info("BERHASIL SIMPAN AGO SIMPAN DATA KOO : {}", SimpanDataMasterKooBon);
// }
// } else {
// log.info("GAGAL GET AGO RESPONSE MASTER KOO : DATA KOSONG {}",
// lstMapMasterKooBon);
// }
// }
// if (((String)mapsync.get("id_master")).toString().equals("3")) {
// lstMapMasterKooBon = this.getAmbilDataMasterKooRegu();
// if (!lstMapMasterKooBon.isEmpty()) {
// log.info("BERHASIL GET AGO JML DATA REGU : {}", lstMapMasterKooBon.size());
// log.info("BERHASIL GET AGO RESPONSE REGU : {}", lstMapMasterKooBon);
// SimpanDataMasterKooBon = this.SimpanDataMasterKooRegu(lstMapMasterKooBon);
// if (((String)SimpanDataMasterKooBon.get("return")).equals("1")) {
// log.info("BERHASIL SIMPAN AGO SIMPAN DATA REGU : {}",
// SimpanDataMasterKooBon);
// }
// } else {
// log.info("GAGAL GET AGO RESPONSE MASTER REGU : DATA KOSONG {}",
// lstMapMasterKooBon);
// }
// }
// if (((String)mapsync.get("id_master")).toString().equals("4")) {
// lstMapMasterKooBon = this.getAmbilDataKooBon();
// if (!lstMapMasterKooBon.isEmpty()) {
// log.info("BERHASIL GET AGO JML DATA KOO BON : {}",
// lstMapMasterKooBon.size());
// log.info("BERHASIL GET AGO RESPONSE KOO BON : {}", lstMapMasterKooBon);
// SimpanDataMasterKooBon = this.SimpanDataMasterKooBon(lstMapMasterKooBon);
// if (((String)SimpanDataMasterKooBon.get("return")).equals("1")) {
// log.info("BERHASIL SIMPAN AGO SIMPAN DATA KOO BON : {}",
// SimpanDataMasterKooBon);
// }
// } else {
// log.info("GAGAL GET AGO RESPONSE MASTER KOO BON : DATA KOSONG {}",
// lstMapMasterKooBon);
// }
// }
// }
// } else {
// log.info("GAGAL GET AGO RESPONSE SYNC : DATA KOSONG {}", lstMap);
// }
// log.info("--- JOB GET APKT AGO---");
// List<Map<String, String>> lstMapMasterKooBon =
// this.getAmbilDataMasterKooBon();
// List<Map<String, String>> lstMapPemakaian = this.getAmbilDataPemakaian();
// List<Map<String, String>> lstMapKembali = this.getAmbilDataKembali();
// List<Map<String, String>> lstMapPemakaianSync = new ArrayList();
// Iterator var5;
// Map mapsyncpemakaian;
// if (!lstMapMasterKooBon.isEmpty()) {
// var5 = lstMapMasterKooBon.iterator();
// while(var5.hasNext()) {
// mapsyncpemakaian = (Map)var5.next();
// log.info("BERHASIL GET APKT JML DATA MASTER KOO BON: {}",
// lstMapMasterKooBon.size());
// log.info("BERHASIL GET APKT ID_KOO : {}",
// ((String)mapsyncpemakaian.get("id_koo")).toString());
// log.info("BERHASIL GET APKT NOMOR_BON : {}",
// ((String)mapsyncpemakaian.get("nomor_bon")).toString());
// List<Map<String, String>> mapGetDataMaterialBon =
// this.getAmbilDataMaterialBon(((String)mapsyncpemakaian.get("id_koo")).toString(),
// ((String)mapsyncpemakaian.get("nomor_bon")).toString());
// if (!mapGetDataMaterialBon.isEmpty()) {
// log.info("BERHASIL GET APKT JML DATA MATERIAL BON : {}",
// mapGetDataMaterialBon.size());
// log.info("BERHASIL GET APKT RESPONSE MATERIAL BON : {}",
// mapGetDataMaterialBon);
// Map<String, String> mapSimpanDataBonMaterial =
// this.SimpanDataBonMaterial(mapGetDataMaterialBon);
// if (((String)mapSimpanDataBonMaterial.get("return")).equals("1")) {
// log.info("BERHASIL APKT SIMPAN DATA MATERIAL BON : {}",
// mapSimpanDataBonMaterial);
// }
// } else {
// log.info("GAGAL GET APKT RESPONSE MATERIAL BON : DATA KOSONG {}",
// mapGetDataMaterialBon);
// }
// }
// } else {
// log.info("GAGAL GET APKT RESPONSE MASTER KOO BON : DATA KOSONG {}",
// lstMapMasterKooBon);
// }
// Map mapSimpanKembali;
// if (!lstMapPemakaian.isEmpty()) {
// log.info("BERHASIL GET APKT JML DATA PEMAKAIAN : {}",
// lstMapPemakaian.size());
// log.info("BERHASIL GET APKT RESPONSE PEMAKAIAN : {}", lstMapPemakaian);
// log.info("LSTMAPPEMAKAIAN : {}", lstMapPemakaian);
// var5 = lstMapPemakaian.iterator();
// while(var5.hasNext()) {
// mapsyncpemakaian = (Map)var5.next();
// log.info("MAPSYNCPEMAKAIAAN : {}", mapsyncpemakaian);
// if (!((String)mapsyncpemakaian.get("nomor_bon")).toString().isEmpty()) {
// lstMapPemakaianSync.add(mapsyncpemakaian);
// log.info("LSTMAPPEMAKAIANSYNC : {}", lstMapPemakaianSync);
// log.info("LSTMAPPEMAKAIANSYNC : {}", lstMapPemakaianSync.size());
// } else {
// log.info("GAGAL INSERT APKT PEMAKAIAN NO WO : {} TIDAK ADA NOMOR BON ",
// ((String)mapsyncpemakaian.get("no_wo")).toString());
// }
// }
// mapSimpanKembali = this.SimpanDataTmpReservasiApkt(lstMapPemakaianSync);
// if (((String)mapSimpanKembali.get("return")).equals("1")) {
// log.info("BERHASIL SIMPAN APKT SIMPAN DATA PEMAKAIAN : {}",
// mapSimpanKembali);
// }
// } else {
// log.info("GAGAL GET APKT RESPONSE PEMAKAIAN : DATA KOSONG {}",
// lstMapPemakaian);
// }
// if (!lstMapKembali.isEmpty()) {
// log.info("BERHASIL GET APKT JML DATA PENGEMBALIAN : {}",
// lstMapKembali.size());
// log.info("BERHASIL GET APKT RESPONSE PENGEMBALIAN : {}", lstMapKembali);
// mapSimpanKembali = this.SimpanDataTmpPengembalianApkt(lstMapKembali);
// if (((String)mapSimpanKembali.get("return")).equals("1")) {
// log.info("BERHASIL SIMPAN APKT SIMPAN DATA PENGEMBALIAN : {}",
// mapSimpanKembali);
// }
// } else {
// log.info("GAGAL GET APKT RESPONSE PENGEMBALIAN : DATA KOSONG {}",
// lstMapKembali);
// }
// }
// //AGO APKT
// private List<Map<String, String>> getAmbilDataAgoSync() {
// List<Map<String, String>> lstMap = this.agoApktDao.getAmbilDataAgoSync();
// return lstMap;
// }
// private List<Map<String, String>> getAmbilDataMaterialPihak3() {
// List<Map<String, String>> lstMap =
// this.agoApktDao.getAmbilDataMaterialPihak3();
// return lstMap;
// }
// private Map<String, String> SimpanDataMaterialPihak3(List<Map<String,
// String>> lstMapMaterial) {
// new HashMap();
// Map<String, String> mapResult =
// this.agoApktDao.SimpanDataMaterialPihak3(lstMapMaterial);
// return mapResult;
// }
// private List<Map<String, String>> getAmbilDataMasterKoo() {
// List<Map<String, String>> lstMap = this.agoApktDao.getAmbilDataMasterKoo();
// return lstMap;
// }
// private Map<String, String> SimpanDataMasterKoo(List<Map<String, String>>
// lstMapMaster) {
// new HashMap();
// Map<String, String> mapResult =
// this.agoApktDao.SimpanDataMasterKoo(lstMapMaster);
// return mapResult;
// }
// private List<Map<String, String>> getAmbilDataMasterKooRegu() {
// List<Map<String, String>> lstMap =
// this.agoApktDao.getAmbilDataMasterKooRegu();
// return lstMap;
// }
// private Map<String, String> SimpanDataMasterKooRegu(List<Map<String, String>>
// lstMapMasterRegu) {
// new HashMap();
// Map<String, String> mapResult =
// this.agoApktDao.SimpanDataMasterKooRegu(lstMapMasterRegu);
// return mapResult;
// }
// private List<Map<String, String>> getAmbilDataKooBon() {
// List<Map<String, String>> lstMap = this.agoApktDao.getAmbilDataKooBon();
// return lstMap;
// }
// private Map<String, String> SimpanDataMasterKooBon(List<Map<String, String>>
// lstMapMasterKooBon) {
// new HashMap();
// Map<String, String> mapResult =
// this.agoApktDao.SimpanDataMasterKooBon(lstMapMasterKooBon);
// return mapResult;
// }
// //APKT AGO
// private List<Map<String, String>> getAmbilDataMasterKooBon() {
// List<Map<String, String>> lstMap =
// this.agoApktDao.getAmbilDataMasterKooBon();
// return lstMap;
// }
// private List<Map<String, String>> getAmbilDataMaterialBon(String id_koo,
// String nomor_bon) {
// List<Map<String, String>> lstMap =
// this.agoApktDao.getAmbilDataMaterialBon(id_koo, nomor_bon);
// return lstMap;
// }
// private Map<String, String> SimpanDataBonMaterial(List<Map<String, String>>
// lstMapBonMaterial) {
// new HashMap();
// Map<String, String> mapResult =
// this.agoApktDao.SimpanDataBonMaterial(lstMapBonMaterial);
// return mapResult;
// }
// private List<Map<String, String>> getAmbilDataPemakaian() {
// List<Map<String, String>> lstMap = this.agoApktDao.getAmbilDataPemakaian();
// return lstMap;
// }
// private Map<String, String> SimpanDataTmpReservasiApkt(List<Map<String,
// String>> lstMapTmpReservasiApkt) {
// new HashMap();
// Map<String, String> mapResult =
// this.agoApktDao.SimpanDataTmpReservasiApkt(lstMapTmpReservasiApkt);
// return mapResult;
// }
// private List<Map<String, String>> getAmbilDataKembali() {
// List<Map<String, String>> lstMap = this.agoApktDao.getAmbilDataKembali();
// return lstMap;
// }
// private Map<String, String> SimpanDataTmpPengembalianApkt(List<Map<String,
// String>> lstMapTmpPengembalianApkt) {
// new HashMap();
// Map<String, String> mapResult =
// this.agoApktDao.SimpanDataTmpPengembalianApkt(lstMapTmpPengembalianApkt);
// return mapResult;
// }
// }

View File

@ -0,0 +1,13 @@
// package org.sadigit.scheduling;
// import org.springframework.stereotype.Component;
// @Component("anotherBean")
// public class AnotherBean {
// public void printAnotherMessage(){
// System.out.println("I am called by Quartz jobBean using
// CronTriggerFactoryBean");
// }
// }

View File

@ -0,0 +1,294 @@
// package org.sadigit.scheduling.Maximo;
// import com.google.gson.Gson;
// import com.google.gson.GsonBuilder;
// import
// com.iconpln.schedulerintegmaximoupdate.Interceptor.AuthenticationInterceptor;
// import com.iconpln.schedulerintegmaximoupdate.dao.AssetDao;
// import com.iconpln.schedulerintegmaximoupdate.model.dto.DataGardu;
// import com.iconpln.schedulerintegmaximoupdate.model.dto.DataPenyulang;
// import com.iconpln.schedulerintegmaximoupdate.model.dto.DataTrafo;
// import com.iconpln.schedulerintegmaximoupdate.model.payload.ResponseGardu;
// import
// com.iconpln.schedulerintegmaximoupdate.model.payload.ResponsePenyulang;
// import com.iconpln.schedulerintegmaximoupdate.model.payload.ResponseTrafo;
// import lombok.extern.slf4j.Slf4j;
// import org.springframework.beans.factory.annotation.Autowired;
// import org.springframework.beans.factory.annotation.Value;
// import org.springframework.http.HttpEntity;
// import org.springframework.http.HttpMethod;
// import org.springframework.http.ResponseEntity;
// import org.springframework.http.client.ClientHttpRequestInterceptor;
// import org.springframework.http.converter.StringHttpMessageConverter;
// import
// org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
// import org.springframework.stereotype.Component;
// import org.springframework.web.client.RestTemplate;
// import java.io.IOException;
// import java.text.SimpleDateFormat;
// import java.util.*;
// @Slf4j
// @Component("jobGetAsset")
// public class JobGetAsset {
// @Value("${url.api.maximo1}")
// private String URL;
// @Value("${auth.api.maximo}")
// private String AUTH;
// // @Value("${content.api.maximo}")
// // private String CONTENT;
// @Autowired
// private AssetDao assetDao;
// public void executeGetAsset() throws IOException {
// log.info("--- JOB GET ASSET ---");
// List<Map<String, String>> lstMap = getDataSiapAmbil();
// log.info("JML DATA CXUNIT : {}", lstMap.size());
// if (!lstMap.isEmpty()) {
// for (Map<String, String> map : lstMap) {
// if (map.get("tipe").toString().equals("GARDU") ) {
// ResponseGardu response = getGarduUpdateEndPoint(map);
// log.info("JML DATA GARDU : {}", response.getMember().size());
// log.info("CXUNIT : {}", map.get("unitid").toString());
// log.info("TIPE : {}", map.get("tipe").toString());
// if (response.getMember() != null) {
// Map<String, String> mapSimpanDataGarduKolektif =
// SimpanDataGarduKolektif(map.get("unitid").toString(), response.getMember());
// if (mapSimpanDataGarduKolektif.get("return").equals("1")) {
// log.info("SIMPAN DATA GARDU : {}", mapSimpanDataGarduKolektif);
// }
// }
// }
// if (map.get("tipe").toString().equals("FEEDER") ) {
// ResponsePenyulang response = getPenyulangUpdateEndPoint(map);
// log.info("JML DATA PENYULANG : {}", response.getMember().size());
// log.info("CXUNIT : {}", map.get("unitid").toString());
// log.info("TIPE : {}", map.get("tipe").toString());
// if (response.getMember() != null) {
// Map<String, String> mapSimpanDataPenyulangKolektif =
// SimpanDataPenyulangKolektif(map.get("unitid").toString(),
// response.getMember());
// if (mapSimpanDataPenyulangKolektif.get("return").equals("1")) {
// log.info("SIMPAN DATA PENYULANG : {}", mapSimpanDataPenyulangKolektif);
// }
// }
// }
// if (map.get("tipe").toString().equals("TRAFO") ) {
// ResponseTrafo response = getTrafoUpdateEndPoint(map);
// log.info("JML DATA TRAFO : {}", response.getMember().size());
// log.info("CXUNIT : {}", map.get("unitid").toString());
// log.info("TIPE : {}", map.get("tipe").toString());
// if (response.getMember() != null) {
// Map<String, String> mapSimpanDataTrafoKolektif =
// SimpanDataTrafoKolektif(map.get("unitid").toString(), response.getMember());
// if (mapSimpanDataTrafoKolektif.get("return").equals("1")) {
// log.info("SIMPAN DATA TRAFO : {}", mapSimpanDataTrafoKolektif);
// }
// }
// }
// }
// }
// }
// private List<Map<String, String>> getDataSiapAmbil() {
// List<Map<String, String>> lstMap = assetDao.getAmbilDataGardu();
// return lstMap;
// }
// private ResponseGardu getGarduUpdateEndPoint (Map<String, String> map) {
// RestTemplate restTemplate = new RestTemplate();
// Map<String, Object> mapParams = new HashMap<>();
// ResponseGardu response = new ResponseGardu();
// ResponseEntity<ResponseGardu> res = null;
// try {
// ClientHttpRequestInterceptor authenticationInterceptor = new
// AuthenticationInterceptor(AUTH);
// restTemplate.setInterceptors(Collections.singletonList(authenticationInterceptor));
// restTemplate.getMessageConverters().add(new
// MappingJackson2HttpMessageConverter());
// restTemplate.getMessageConverters().add(new StringHttpMessageConverter());
// Date date = new Date();
// SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
// // String url = URL +
// "os/MXLOCATION_TEST?oslc.select=location,description,tujdnumber,cxunit,cxclassificationdesc,installvendor,installdate,actualoprdate,changedate,locationspec,serviceaddress{longitudex,latitudey,formattedaddress}&oslc.where=status=\"OPERATING\"
// and cxclassificationdesc=\"Bangunan Sipil Gardu\" and
// cxunit=\"{unitid}\"&ignorecollectionref=1&lean=1&collectioncount=1";
// String url = URL +
// "os/MXLOCATION_TEST?oslc.select=location,description,tujdnumber,cxunit,apkt_numbers,cxclassificationdesc,installvendor,installdate,actualoprdate,changedate,locationspec,serviceaddress{longitudex,latitudey,formattedaddress}&oslc.where=status=\"OPERATING\"
// and cxclassificationdesc=\"Bangunan Sipil Gardu\" and cxunit=\"{unitid}\" and
// changedate>\"{currentdate}\"&ignorecollectionref=1&lean=1&collectioncount=1";
// // String url = URL +
// "os/MXLOCATION_TEST?oslc.select=location,description,tujdnumber,cxunit,apkt_numbers,cxclassificationdesc,installvendor,installdate,actualoprdate,changedate,locationspec,serviceaddress{longitudex,latitudey,formattedaddress}&oslc.where=status=\"OPERATING\"
// and cxclassificationdesc=\"Bangunan Sipil Gardu\" and cxunit=\"{unitid}\" and
// changedate>\"2021-08-05\"&ignorecollectionref=1&lean=1&collectioncount=1";
// Object mapValue = "{longitudex,latitudey,formattedaddress}";
// mapParams.put("longitudex,latitudey,formattedaddress", mapValue);
// mapParams.put("unitid", map.get("unitid").toString());
// mapParams.put("currentdate", formatter.format(date));
// // Map mapParam = new HashMap();
// // res = restTemplate.getForEntity(url, null, ResponseGardu.class, mapParam);
// res = restTemplate.exchange(url, HttpMethod.GET, HttpEntity.EMPTY,
// ResponseGardu.class, mapParams);
// // log.info("res : {}", res);
// Gson gson = new GsonBuilder().setPrettyPrinting().create();
// String jsonifyresponse = gson.toJson(res.getBody());
// log.info("RESPONSE : {}", jsonifyresponse);
// } catch (Exception ex) {
// ex.printStackTrace();
// log.error("ERROR GET GARDU : {}", ex);
// // response.setRc("01");
// response.setMessage("Error, "+ex.getMessage());
// response.setMember(null);
// return response;
// }
// return res.getBody();
// }
// private ResponsePenyulang getPenyulangUpdateEndPoint (Map<String, String>
// map) {
// RestTemplate restTemplate = new RestTemplate();
// Map<String, Object> mapParams = new HashMap<>();
// ResponsePenyulang response = new ResponsePenyulang();
// ResponseEntity<ResponsePenyulang> res = null;
// try {
// ClientHttpRequestInterceptor authenticationInterceptor = new
// AuthenticationInterceptor(AUTH);
// restTemplate.setInterceptors(Collections.singletonList(authenticationInterceptor));
// restTemplate.getMessageConverters().add(new
// MappingJackson2HttpMessageConverter());
// restTemplate.getMessageConverters().add(new StringHttpMessageConverter());
// Date date = new Date();
// SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
// // String url = URL +
// "os/mxasset_test?oslc.select=assetnum,apkt_numbers,description,
// location--assetlocation,tujdnumber,cxunit,cxclassificationdesc,installvendor,installdate,actualoprdate,changedate,assetspec{assetattrid,alnvalue,numvalue,measureunitid},location.saddresscode,locations{serviceaddress.longitudex,serviceaddress.latitudey,serviceaddress.FORMATTEDADDRESS,cxunit},lochierarchy{parent}&oslc.where=status="OPERATING"
// and cxclassificationdesc="MVCable 20 kV" and
// apkt_number!="NULL"&ignorecollectionref=1&oslc.pageSize=10&lean=1&collectioncount=1";
// String url = URL +
// "os/mxasset_test?oslc.select=assetnum,apkt_numbers,description,location--assetlocation,tujdnumber,cxunit,cxclassificationdesc,installvendor,installdate,actualoprdate,changedate,assetspec,location.saddresscode,locations{serviceaddress.longitudex,serviceaddress.latitudey,serviceaddress.FORMATTEDADDRESS,cxunit},lochierarchy,endmeasure&oslc.where=status=\"OPERATING\"
// and cxclassificationdesc=\"MVCable 20 kV\" and cxunit=\"{unitid}\" and
// changedate>\"{currentdate}\"&ignorecollectionref=1&lean=1&collectioncount=1";
// // String url = URL +
// "os/mxasset_test?oslc.select=assetnum,apkt_numbers,description,location--assetlocation,tujdnumber,cxunit,cxclassificationdesc,installvendor,installdate,actualoprdate,changedate,assetspec,location.saddresscode,locations{serviceaddress.longitudex,serviceaddress.latitudey,serviceaddress.FORMATTEDADDRESS,cxunit},lochierarchy,endmeasure&oslc.where=status=\"OPERATING\"
// and cxclassificationdesc=\"MVCable 20 kV\" and cxunit=\"{unitid}\" and
// changedate>\"2021-08-05\"&ignorecollectionref=1&lean=1&collectioncount=1";
// Object mapValue =
// "{serviceaddress.longitudex,serviceaddress.latitudey,serviceaddress.FORMATTEDADDRESS,cxunit}";
// mapParams.put("serviceaddress.longitudex,serviceaddress.latitudey,serviceaddress.FORMATTEDADDRESS,cxunit",
// mapValue);
// mapParams.put("unitid", map.get("unitid").toString());
// mapParams.put("currentdate", formatter.format(date));
// // Map mapParam = new HashMap();
// // res = restTemplate.getForEntity(url, null, ResponseTrafo.class, mapParam);
// res = restTemplate.exchange(url, HttpMethod.GET, HttpEntity.EMPTY,
// ResponsePenyulang.class, mapParams);
// // log.info("res : {}", res);
// Gson gson = new GsonBuilder().setPrettyPrinting().create();
// String jsonifyresponse = gson.toJson(res.getBody());
// log.info("RESPONSE : {}", jsonifyresponse);
// } catch (Exception ex) {
// ex.printStackTrace();
// log.error("ERROR GET PENYULANG : {}", ex);
// // response.setRc("01");
// response.setMessage("Error, "+ex.getMessage());
// response.setMember(null);
// return response;
// }
// return res.getBody();
// }
// private ResponseTrafo getTrafoUpdateEndPoint (Map<String, String> map) {
// RestTemplate restTemplate = new RestTemplate();
// Map<String, Object> mapParams = new HashMap<>();
// ResponseTrafo response = new ResponseTrafo();
// ResponseEntity<ResponseTrafo> res = null;
// try {
// ClientHttpRequestInterceptor authenticationInterceptor = new
// AuthenticationInterceptor(AUTH);
// restTemplate.setInterceptors(Collections.singletonList(authenticationInterceptor));
// restTemplate.getMessageConverters().add(new
// MappingJackson2HttpMessageConverter());
// restTemplate.getMessageConverters().add(new StringHttpMessageConverter());
// Date date = new Date();
// SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
// // String url = URL +
// "os/mxasset_test?oslc.select=assetnum,apkt_numbers,description,location--assetlocation,tujdnumber,cxunit,cxclassificationdesc,installvendor,installdate,actualoprdate,changedate,assetspec,location.saddresscode,locations{serviceaddress.longitudex,serviceaddress.latitudey,serviceaddress.FORMATTEDADDRESS,cxunit},lochierarchy,manufacturer&oslc.where=status=\"OPERATING\"
// and cxclassificationdesc=\"Trafo\" and
// cxunit=\"{unitid}\"&ignorecollectionref=1&lean=1&collectioncount=1";
// String url = URL +
// "os/mxasset_test?oslc.select=assetnum,apkt_numbers,description,location--assetlocation,tujdnumber,cxunit,cxclassificationdesc,installvendor,installdate,actualoprdate,changedate,assetspec,location.saddresscode,locations{serviceaddress.longitudex,serviceaddress.latitudey,serviceaddress.FORMATTEDADDRESS,cxunit},lochierarchy,manufacturer&oslc.where=status=\"OPERATING\"
// and cxclassificationdesc=\"Trafo\" and cxunit=\"{unitid}\" and
// changedate>\"{currentdate}\"&ignorecollectionref=1&lean=1&collectioncount=1";
// // String url = URL +
// "os/mxasset_test?oslc.select=assetnum,apkt_numbers,description,location--assetlocation,tujdnumber,cxunit,cxclassificationdesc,installvendor,installdate,actualoprdate,changedate,assetspec,location.saddresscode,locations{serviceaddress.longitudex,serviceaddress.latitudey,serviceaddress.FORMATTEDADDRESS,cxunit},lochierarchy,manufacturer&oslc.where=status=\"OPERATING\"
// and cxclassificationdesc=\"Trafo\" and cxunit=\"{unitid}\" and
// changedate>\"2021-08-05\"&ignorecollectionref=1&lean=1&collectioncount=1";
// Object mapValue =
// "{serviceaddress.longitudex,serviceaddress.latitudey,serviceaddress.FORMATTEDADDRESS,cxunit}";
// mapParams.put("serviceaddress.longitudex,serviceaddress.latitudey,serviceaddress.FORMATTEDADDRESS,cxunit",
// mapValue);
// mapParams.put("unitid", map.get("unitid").toString());
// mapParams.put("currentdate", formatter.format(date));
// // Map mapParam = new HashMap();
// // res = restTemplate.getForEntity(url, null, ResponseTrafo.class, mapParam);
// res = restTemplate.exchange(url, HttpMethod.GET, HttpEntity.EMPTY,
// ResponseTrafo.class, mapParams);
// // log.info("res : {}", res);
// Gson gson = new GsonBuilder().setPrettyPrinting().create();
// String jsonifyresponse = gson.toJson(res.getBody());
// log.info("RESPONSE : {}", jsonifyresponse);
// } catch (Exception ex) {
// ex.printStackTrace();
// log.error("ERROR GET TRAFO : {}", ex);
// // response.setRc("01");
// response.setMessage("Error, "+ex.getMessage());
// response.setMember(null);
// return response;
// }
// return res.getBody();
// }
// private Map<String, String> SimpanDataGarduKolektif(String unitid,
// List<DataGardu> lstGardu){
// Map<String, String> mapResult = new HashMap<>();
// mapResult = assetDao.SimpanDataGarduKolektif(unitid, lstGardu);
// return mapResult;
// }
// private Map<String, String> SimpanDataPenyulangKolektif(String unitid,
// List<DataPenyulang> lstPenyulang){
// Map<String, String> mapResult = new HashMap<>();
// mapResult = assetDao.SimpanDataPenyulangKolektif(unitid, lstPenyulang);
// return mapResult;
// }
// private Map<String, String> SimpanDataTrafoKolektif(String unitid,
// List<DataTrafo> lstTrafo){
// Map<String, String> mapResult = new HashMap<>();
// mapResult = assetDao.SimpanDataTrafoKolektif(unitid, lstTrafo);
// return mapResult;
// }
// }

View File

@ -0,0 +1,133 @@
// package org.sadigit.scheduling.Maximo;
// import com.google.gson.Gson;
// import com.google.gson.GsonBuilder;
// import
// com.iconpln.schedulerintegmaximoupdate.Interceptor.AuthenticationInterceptor;
// import com.iconpln.schedulerintegmaximoupdate.dao.GarduDao;
// import com.iconpln.schedulerintegmaximoupdate.model.dto.DataGardu;
// import com.iconpln.schedulerintegmaximoupdate.model.payload.ResponseGardu;
// import lombok.extern.slf4j.Slf4j;
// import org.springframework.beans.factory.annotation.Autowired;
// import org.springframework.beans.factory.annotation.Value;
// import org.springframework.http.HttpEntity;
// import org.springframework.http.HttpMethod;
// import org.springframework.http.ResponseEntity;
// import org.springframework.http.client.ClientHttpRequestInterceptor;
// import org.springframework.http.converter.StringHttpMessageConverter;
// import
// org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
// import org.springframework.stereotype.Component;
// import org.springframework.web.client.RestTemplate;
// import java.io.IOException;
// import java.text.SimpleDateFormat;
// import java.util.*;
// @Slf4j
// @Component("jobGetGarduUpdate")
// public class JobGetGarduUpdate {
// @Value("${url.api.maximo1}")
// private String URL;
// @Value("${auth.api.maximo}")
// private String AUTH;
// // @Value("${content.api.maximo}")
// // private String CONTENT;
// @Autowired
// private GarduDao garduDao;
// public void executeGetGarduUpdate() throws IOException {
// log.info("--- JOB GET GARDU ---");
// List<Map<String, String>> lstMap = getDataSiapAmbil();
// // log.info("JML DATA CXUNIT : {}", lstMap.size());
// if (!lstMap.isEmpty()) {
// for (Map<String, String> map : lstMap) {
// if (map.get("tipe").toString().equals("GARDU") ) {
// ResponseGardu response = getGarduUpdateEndPoint(map);
// log.info("JML DATA GARDU : {}", response.getMember().size());
// log.info("CXUNIT : {}", map.get("unitid").toString());
// log.info("TIPE : {}", map.get("tipe").toString());
// if (response.getMember() != null) {
// Map<String, String> mapSimpanDataGarduKolektif =
// SimpanDataGarduKolektif(map.get("unitid").toString(), response.getMember());
// if (mapSimpanDataGarduKolektif.get("return").equals("1")) {
// log.info("SIMPAN DATA GARDU : {}", mapSimpanDataGarduKolektif);
// }
// }
// }
// }
// }
// }
// private List<Map<String, String>> getDataSiapAmbil() {
// List<Map<String, String>> lstMap = garduDao.getAmbilDataGardu();
// return lstMap;
// }
// private ResponseGardu getGarduUpdateEndPoint (Map<String, String> map) {
// RestTemplate restTemplate = new RestTemplate();
// Map<String, Object> mapParams = new HashMap<>();
// ResponseGardu response = new ResponseGardu();
// ResponseEntity<ResponseGardu> res = null;
// try {
// ClientHttpRequestInterceptor authenticationInterceptor = new
// AuthenticationInterceptor(AUTH);
// restTemplate.setInterceptors(Collections.singletonList(authenticationInterceptor));
// restTemplate.getMessageConverters().add(new
// MappingJackson2HttpMessageConverter());
// restTemplate.getMessageConverters().add(new StringHttpMessageConverter());
// Date date = new Date();
// SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
// // String url = URL +
// "os/MXLOCATION_TEST?oslc.select=location,description,tujdnumber,cxunit,cxclassificationdesc,installvendor,installdate,actualoprdate,changedate,locationspec,serviceaddress{longitudex,latitudey,formattedaddress}&oslc.where=status=\"OPERATING\"
// and cxclassificationdesc=\"Bangunan Sipil Gardu\" and
// cxunit=\"{unitid}\"&ignorecollectionref=1&lean=1&collectioncount=1";
// // String url = URL +
// "os/MXLOCATION_TEST?oslc.select=location,description,tujdnumber,cxunit,apkt_numbers,cxclassificationdesc,installvendor,installdate,actualoprdate,changedate,locationspec,serviceaddress{longitudex,latitudey,formattedaddress}&oslc.where=status=\"OPERATING\"
// and cxclassificationdesc=\"Bangunan Sipil Gardu\" and cxunit=\"{unitid}\" and
// changedate>\"{currentdate}\"&ignorecollectionref=1&lean=1&collectioncount=1";
// String url = URL +
// "os/MXLOCATION_TEST?oslc.select=location,description,tujdnumber,cxunit,apkt_numbers,cxclassificationdesc,installvendor,installdate,actualoprdate,changedate,locationspec,serviceaddress{longitudex,latitudey,formattedaddress}&oslc.where=status=\"OPERATING\"
// and cxclassificationdesc=\"Bangunan Sipil Gardu\" and cxunit=\"{unitid}\" and
// changedate>\"2021-08-05\"&ignorecollectionref=1&lean=1&collectioncount=1";
// Object mapValue = "{longitudex,latitudey,formattedaddress}";
// mapParams.put("longitudex,latitudey,formattedaddress", mapValue);
// mapParams.put("unitid", map.get("unitid").toString());
// mapParams.put("currentdate", formatter.format(date));
// // Map mapParam = new HashMap();
// // res = restTemplate.getForEntity(url, null, ResponseGardu.class, mapParam);
// res = restTemplate.exchange(url, HttpMethod.GET, HttpEntity.EMPTY,
// ResponseGardu.class, mapParams);
// // log.info("res : {}", res);
// Gson gson = new GsonBuilder().setPrettyPrinting().create();
// String jsonifyresponse = gson.toJson(res.getBody());
// log.info("RESPONSE : {}", jsonifyresponse);
// } catch (Exception ex) {
// ex.printStackTrace();
// log.error("ERROR GET GARDU : {}", ex);
// // response.setRc("01");
// response.setMessage("Error, "+ex.getMessage());
// response.setMember(null);
// return response;
// }
// return res.getBody();
// }
// private Map<String, String> SimpanDataGarduKolektif(String unitid,
// List<DataGardu> lstGardu){
// Map<String, String> mapResult = new HashMap<>();
// mapResult = garduDao.SimpanDataGarduKolektif(unitid, lstGardu);
// return mapResult;
// }
// }

View File

@ -0,0 +1,139 @@
// package org.sadigit.scheduling.Maximo;
// import com.google.gson.Gson;
// import com.google.gson.GsonBuilder;
// import
// com.iconpln.schedulerintegmaximoupdate.Interceptor.AuthenticationInterceptor;
// import com.iconpln.schedulerintegmaximoupdate.dao.PenyulangDao;
// import com.iconpln.schedulerintegmaximoupdate.model.dto.DataPenyulang;
// import
// com.iconpln.schedulerintegmaximoupdate.model.payload.ResponsePenyulang;
// import lombok.extern.slf4j.Slf4j;
// import org.springframework.beans.factory.annotation.Autowired;
// import org.springframework.beans.factory.annotation.Value;
// import org.springframework.http.HttpEntity;
// import org.springframework.http.HttpMethod;
// import org.springframework.http.ResponseEntity;
// import org.springframework.http.client.ClientHttpRequestInterceptor;
// import org.springframework.http.converter.StringHttpMessageConverter;
// import
// org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
// import org.springframework.stereotype.Component;
// import org.springframework.web.client.RestTemplate;
// import java.io.IOException;
// import java.text.SimpleDateFormat;
// import java.util.*;
// @Slf4j
// @Component("jobGetPenyulangUpdate")
// public class JobGetPenyulangUpdate {
// @Value("${url.api.maximo1}")
// private String URL;
// @Value("${auth.api.maximo}")
// private String AUTH;
// // @Value("${content.api.maximo}")
// // private String CONTENT;
// @Autowired
// private PenyulangDao penyulangDao;
// public void executeGetPenyulangUpdate() throws IOException {
// log.info("--- JOB GET PENYULANG ---");
// List<Map<String, String>> lstMap = getDataSiapAmbil();
// // log.info("JML DATA CXUNIT : {}", lstMap.size());
// if (!lstMap.isEmpty()) {
// for (Map<String, String> map : lstMap) {
// if (map.get("tipe").toString().equals("FEEDER") ) {
// ResponsePenyulang response = getPenyulangUpdateEndPoint(map);
// log.info("JML DATA PENYULANG : {}", response.getMember().size());
// log.info("CXUNIT : {}", map.get("unitid").toString());
// log.info("TIPE : {}", map.get("tipe").toString());
// if (response.getMember() != null) {
// Map<String, String> mapSimpanDataPenyulangKolektif =
// SimpanDataPenyulangKolektif(map.get("unitid").toString(),
// response.getMember());
// if (mapSimpanDataPenyulangKolektif.get("return").equals("1")) {
// log.info("SIMPAN DATA PENYULANG : {}", mapSimpanDataPenyulangKolektif);
// }
// }
// }
// }
// }
// }
// private List<Map<String, String>> getDataSiapAmbil() {
// List<Map<String, String>> lstMap = penyulangDao.getAmbilDataPenyulang();
// return lstMap;
// }
// private ResponsePenyulang getPenyulangUpdateEndPoint (Map<String, String>
// map) {
// RestTemplate restTemplate = new RestTemplate();
// Map<String, Object> mapParams = new HashMap<>();
// ResponsePenyulang response = new ResponsePenyulang();
// ResponseEntity<ResponsePenyulang> res = null;
// try {
// ClientHttpRequestInterceptor authenticationInterceptor = new
// AuthenticationInterceptor(AUTH);
// restTemplate.setInterceptors(Collections.singletonList(authenticationInterceptor));
// restTemplate.getMessageConverters().add(new
// MappingJackson2HttpMessageConverter());
// restTemplate.getMessageConverters().add(new StringHttpMessageConverter());
// Date date = new Date();
// SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
// // String url = URL +
// "os/mxasset_test?oslc.select=assetnum,apkt_numbers,description,
// location--assetlocation,tujdnumber,cxunit,cxclassificationdesc,installvendor,installdate,actualoprdate,changedate,assetspec{assetattrid,alnvalue,numvalue,measureunitid},location.saddresscode,locations{serviceaddress.longitudex,serviceaddress.latitudey,serviceaddress.FORMATTEDADDRESS,cxunit},lochierarchy{parent}&oslc.where=status="OPERATING"
// and cxclassificationdesc="MVCable 20 kV" and
// apkt_number!="NULL"&ignorecollectionref=1&oslc.pageSize=10&lean=1&collectioncount=1";
// // String url = URL +
// "os/mxasset_test?oslc.select=assetnum,apkt_numbers,description,location--assetlocation,tujdnumber,cxunit,cxclassificationdesc,installvendor,installdate,actualoprdate,changedate,assetspec,location.saddresscode,locations{serviceaddress.longitudex,serviceaddress.latitudey,serviceaddress.FORMATTEDADDRESS,cxunit},lochierarchy,endmeasure&oslc.where=status=\"OPERATING\"
// and cxclassificationdesc=\"MVCable 20 kV\" and cxunit=\"{unitid}\" and
// changedate>\"{currentdate}\"&ignorecollectionref=1&lean=1&collectioncount=1";
// String url = URL +
// "os/mxasset_test?oslc.select=assetnum,apkt_numbers,description,location--assetlocation,tujdnumber,cxunit,cxclassificationdesc,installvendor,installdate,actualoprdate,changedate,assetspec,location.saddresscode,locations{serviceaddress.longitudex,serviceaddress.latitudey,serviceaddress.FORMATTEDADDRESS,cxunit},lochierarchy,endmeasure&oslc.where=status=\"OPERATING\"
// and cxclassificationdesc=\"MVCable 20 kV\" and cxunit=\"{unitid}\" and
// changedate>\"2021-08-05\"&ignorecollectionref=1&lean=1&collectioncount=1";
// Object mapValue =
// "{serviceaddress.longitudex,serviceaddress.latitudey,serviceaddress.FORMATTEDADDRESS,cxunit}";
// mapParams.put("serviceaddress.longitudex,serviceaddress.latitudey,serviceaddress.FORMATTEDADDRESS,cxunit",
// mapValue);
// mapParams.put("unitid", map.get("unitid").toString());
// mapParams.put("currentdate", formatter.format(date));
// // Map mapParam = new HashMap();
// // res = restTemplate.getForEntity(url, null, ResponseTrafo.class, mapParam);
// res = restTemplate.exchange(url, HttpMethod.GET, HttpEntity.EMPTY,
// ResponsePenyulang.class, mapParams);
// // log.info("res : {}", res);
// Gson gson = new GsonBuilder().setPrettyPrinting().create();
// String jsonifyresponse = gson.toJson(res.getBody());
// log.info("RESPONSE : {}", jsonifyresponse);
// } catch (Exception ex) {
// ex.printStackTrace();
// log.error("ERROR GET PENYULANG : {}", ex);
// // response.setRc("01");
// response.setMessage("Error, "+ex.getMessage());
// response.setMember(null);
// return response;
// }
// return res.getBody();
// }
// private Map<String, String> SimpanDataPenyulangKolektif(String unitid,
// List<DataPenyulang> lstPenyulang){
// Map<String, String> mapResult = new HashMap<>();
// mapResult = penyulangDao.SimpanDataPenyulangKolektif(unitid, lstPenyulang);
// return mapResult;
// }
// }

View File

@ -0,0 +1,135 @@
// package org.sadigit.scheduling.Maximo;
// import com.google.gson.Gson;
// import com.google.gson.GsonBuilder;
// import
// com.iconpln.schedulerintegmaximoupdate.Interceptor.AuthenticationInterceptor;
// import com.iconpln.schedulerintegmaximoupdate.dao.TrafoDao;
// import com.iconpln.schedulerintegmaximoupdate.model.dto.DataTrafo;
// import com.iconpln.schedulerintegmaximoupdate.model.payload.ResponseTrafo;
// import lombok.extern.slf4j.Slf4j;
// import org.springframework.beans.factory.annotation.Autowired;
// import org.springframework.beans.factory.annotation.Value;
// import org.springframework.http.HttpEntity;
// import org.springframework.http.HttpMethod;
// import org.springframework.http.ResponseEntity;
// import org.springframework.http.client.ClientHttpRequestInterceptor;
// import org.springframework.http.converter.StringHttpMessageConverter;
// import
// org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
// import org.springframework.stereotype.Component;
// import org.springframework.web.client.RestTemplate;
// import java.io.IOException;
// import java.text.SimpleDateFormat;
// import java.util.*;
// @Slf4j
// @Component("jobGetTrafoUpdate")
// public class JobGetTrafoUpdate {
// @Value("${url.api.maximo1}")
// private String URL;
// @Value("${auth.api.maximo}")
// private String AUTH;
// // @Value("${content.api.maximo}")
// // private String CONTENT;
// @Autowired
// private TrafoDao trafoDao;
// public void executeGetTrafoUpdate() throws IOException {
// log.info("--- JOB GET TRAFO ---");
// List<Map<String, String>> lstMap = getDataSiapAmbil();
// // log.info("JML DATA CXUNIT : {}", lstMap.size());
// if (!lstMap.isEmpty()) {
// for (Map<String, String> map : lstMap) {
// if (map.get("tipe").toString().equals("TRAFO") ) {
// ResponseTrafo response = getTrafoUpdateEndPoint(map);
// log.info("JML DATA TRAFO : {}", response.getMember().size());
// log.info("CXUNIT : {}", map.get("unitid").toString());
// log.info("TIPE : {}", map.get("tipe").toString());
// if (response.getMember() != null) {
// Map<String, String> mapSimpanDataTrafoKolektif =
// SimpanDataTrafoKolektif(map.get("unitid").toString(), response.getMember());
// if (mapSimpanDataTrafoKolektif.get("return").equals("1")) {
// log.info("SIMPAN DATA TRAFO : {}", mapSimpanDataTrafoKolektif);
// }
// }
// }
// }
// }
// }
// private List<Map<String, String>> getDataSiapAmbil() {
// List<Map<String, String>> lstMap = trafoDao.getAmbilDataTrafo();
// return lstMap;
// }
// private ResponseTrafo getTrafoUpdateEndPoint (Map<String, String> map) {
// RestTemplate restTemplate = new RestTemplate();
// Map<String, Object> mapParams = new HashMap<>();
// ResponseTrafo response = new ResponseTrafo();
// ResponseEntity<ResponseTrafo> res = null;
// try {
// ClientHttpRequestInterceptor authenticationInterceptor = new
// AuthenticationInterceptor(AUTH);
// restTemplate.setInterceptors(Collections.singletonList(authenticationInterceptor));
// restTemplate.getMessageConverters().add(new
// MappingJackson2HttpMessageConverter());
// restTemplate.getMessageConverters().add(new StringHttpMessageConverter());
// Date date = new Date();
// SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
// // String url = URL +
// "os/mxasset_test?oslc.select=assetnum,apkt_numbers,description,location--assetlocation,tujdnumber,cxunit,cxclassificationdesc,installvendor,installdate,actualoprdate,changedate,assetspec,location.saddresscode,locations{serviceaddress.longitudex,serviceaddress.latitudey,serviceaddress.FORMATTEDADDRESS,cxunit},lochierarchy,manufacturer&oslc.where=status=\"OPERATING\"
// and cxclassificationdesc=\"Trafo\" and
// cxunit=\"{unitid}\"&ignorecollectionref=1&lean=1&collectioncount=1";
// // String url = URL +
// "os/mxasset_test?oslc.select=assetnum,apkt_numbers,description,location--assetlocation,tujdnumber,cxunit,cxclassificationdesc,installvendor,installdate,actualoprdate,changedate,assetspec,location.saddresscode,locations{serviceaddress.longitudex,serviceaddress.latitudey,serviceaddress.FORMATTEDADDRESS,cxunit},lochierarchy,manufacturer&oslc.where=status=\"OPERATING\"
// and cxclassificationdesc=\"Trafo\" and cxunit=\"{unitid}\" and
// changedate>\"{currentdate}\"&ignorecollectionref=1&lean=1&collectioncount=1";
// String url = URL +
// "os/mxasset_test?oslc.select=assetnum,apkt_numbers,description,location--assetlocation,tujdnumber,cxunit,cxclassificationdesc,installvendor,installdate,actualoprdate,changedate,assetspec,location.saddresscode,locations{serviceaddress.longitudex,serviceaddress.latitudey,serviceaddress.FORMATTEDADDRESS,cxunit},lochierarchy,manufacturer&oslc.where=status=\"OPERATING\"
// and cxclassificationdesc=\"Trafo\" and cxunit=\"{unitid}\" and
// changedate>\"2021-08-05\"&ignorecollectionref=1&lean=1&collectioncount=1";
// Object mapValue =
// "{serviceaddress.longitudex,serviceaddress.latitudey,serviceaddress.FORMATTEDADDRESS,cxunit}";
// mapParams.put("serviceaddress.longitudex,serviceaddress.latitudey,serviceaddress.FORMATTEDADDRESS,cxunit",
// mapValue);
// mapParams.put("unitid", map.get("unitid").toString());
// mapParams.put("currentdate", formatter.format(date));
// // Map mapParam = new HashMap();
// // res = restTemplate.getForEntity(url, null, ResponseTrafo.class, mapParam);
// res = restTemplate.exchange(url, HttpMethod.GET, HttpEntity.EMPTY,
// ResponseTrafo.class, mapParams);
// // log.info("res : {}", res);
// Gson gson = new GsonBuilder().setPrettyPrinting().create();
// String jsonifyresponse = gson.toJson(res.getBody());
// log.info("RESPONSE : {}", jsonifyresponse);
// } catch (Exception ex) {
// ex.printStackTrace();
// log.error("ERROR GET TRAFO : {}", ex);
// // response.setRc("01");
// response.setMessage("Error, "+ex.getMessage());
// response.setMember(null);
// return response;
// }
// return res.getBody();
// }
// private Map<String, String> SimpanDataTrafoKolektif(String unitid,
// List<DataTrafo> lstTrafo){
// Map<String, String> mapResult = new HashMap<>();
// mapResult = trafoDao.SimpanDataTrafoKolektif(unitid, lstTrafo);
// return mapResult;
// }
// }

View File

@ -0,0 +1,25 @@
package org.sadigit.service.api.v1;
import java.util.List;
import java.util.stream.Collectors;
import org.sadigit.entity.Keluhan;
import org.sadigit.mapper.KeluhanMapper;
import org.sadigit.mapper.PenggunaMapper;
import org.sadigit.model.dto.KeluhantDto;
import org.sadigit.repository.KeluhanRepository;
import jakarta.enterprise.context.ApplicationScoped;
import lombok.RequiredArgsConstructor;
@ApplicationScoped
@RequiredArgsConstructor
public class GetDataPerUnitService {
private final KeluhanRepository keluhanRepository;
public List<KeluhantDto> getDataPerUnit(Long unitId, String startDate, String endDate) {
return keluhanRepository.findKeluhanByUnitId(unitId, startDate, endDate).stream()
.map(KeluhanMapper::entityToDTO)
.collect(Collectors.toList());
}
}

View File

@ -0,0 +1,31 @@
package org.sadigit.service.api.v1;
import java.util.List;
import java.util.stream.Collectors;
import org.sadigit.mapper.IssueTypeMapper;
import org.sadigit.mapper.MasterIssueTypeMapper;
import org.sadigit.model.dto.IssueTypeDto;
import org.sadigit.model.dto.MasterIssueTypeDto;
import org.sadigit.repository.IssueTypeRepository;
import jakarta.enterprise.context.ApplicationScoped;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@ApplicationScoped
@RequiredArgsConstructor
@Slf4j
public class IssueTypeService {
private final IssueTypeRepository issueTypeRepository;
public List<MasterIssueTypeDto> findAll() {
return issueTypeRepository.findIssueTypeKeluhan().stream().map(MasterIssueTypeMapper::entityToDTO)
.collect(Collectors.toList());
}
public List<IssueTypeDto> findActive() {
return issueTypeRepository.findIssueTypeActiveKeluhan().stream().map(IssueTypeMapper::entityToDTO)
.collect(Collectors.toList());
}
}

View File

@ -0,0 +1,37 @@
package org.sadigit.service.api.v1;
import java.util.List;
import org.sadigit.entity.AppUser;
import org.sadigit.mapper.AppUserMapper;
import org.sadigit.model.dto.AppUserDto;
import org.sadigit.repository.AppUserRepository;
import org.sadigit.util.Checks;
import jakarta.enterprise.context.ApplicationScoped;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@ApplicationScoped
@RequiredArgsConstructor
@Slf4j
public class LoginService {
private final AppUserRepository appUserRepository;
AppUserDto appUser;
public List<AppUserDto> auth(String username, String password) {
log.info("auth password : {}", password);
// find appuser by username
Checks.isTrues(appUserRepository.findByUsername(username) != null,
"DATA TIDAK DITEMUKAN / USER SUDAH TIDAK ACTIVE", "1");
// find user by username and password
appUser = AppUserMapper.entityToDTO(appUserRepository.findByUsernameAndPassword(username, password));
Checks.isTrues(appUser != null, "PASSWORD TIDAK SESUAI", "99");
return List.of(appUser);
}
}

View File

@ -0,0 +1,34 @@
package org.sadigit.service.api.v1;
import java.util.List;
import java.util.stream.Collectors;
import org.sadigit.entity.AppUser;
import org.sadigit.mapper.AppUserMapper;
import org.sadigit.mapper.PenggunaMapper;
import org.sadigit.model.dto.AppUserDto;
import org.sadigit.model.dto.PenggunaDto;
import org.sadigit.repository.AppUserRepository;
import org.sadigit.util.Checks;
import jakarta.enterprise.context.ApplicationScoped;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@ApplicationScoped
@RequiredArgsConstructor
@Slf4j
public class PenggunaService {
private final AppUserRepository appUserRepository;
PenggunaDto pengguna;
public List<PenggunaDto> findDataPengguna(Long unitId, Long positionId) {
Checks.isTrues(appUserRepository.findByUnitIdAndPositionId(unitId, positionId) != null,
"DATA TIDAK DITEMUKAN", "1");
return appUserRepository.findByUnitIdAndPositionId(unitId, positionId).stream().map(PenggunaMapper::entityToDTO)
.collect(Collectors.toList());
}
}

View File

@ -0,0 +1,24 @@
package org.sadigit.service.api.v1;
import java.util.List;
import java.util.stream.Collectors;
import org.sadigit.entity.Unit;
import org.sadigit.mapper.PenggunaMapper;
import org.sadigit.model.dto.UnitDto;
import org.sadigit.repository.UnitRepository;
import jakarta.enterprise.context.ApplicationScoped;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@ApplicationScoped
@RequiredArgsConstructor
@Slf4j
public class UnitService {
private final UnitRepository unitRepository;
public List<UnitDto> findByUnitTypeId(Long unitTypeId) {
return unitRepository.findByUnitTypeId(unitTypeId);
}
}

View File

@ -0,0 +1,68 @@
package org.sadigit.util;
public class AppException extends RuntimeException {
private int status = 400;
private String rc = "99";
private Object data;
public AppException() {
super("Something bad happen on app server please try again later, contact support for this error");
}
public AppException(String message) {
super(message);
}
public AppException(String message, Object data) {
super(message);
this.data = data;
}
public AppException(String message, int status) {
super(message);
this.status = status;
}
public AppException(String message, String rc) {
super(message);
this.rc = rc;
}
public AppException(String message, int status, Object data) {
super(message);
this.status = status;
this.data = data;
}
public static AppException create(String message) {
return new AppException(message);
}
public static AppException create(String message, int status) {
return new AppException(message, status);
}
public static AppException create(String message, Object data) {
return new AppException(message, data);
}
public static AppException create(String message, int status, Object data) {
return new AppException(message, status, data);
}
public void setStatus(int status) {
this.status = status;
}
public void setData(Object data) {
this.data = data;
}
public void setRc(String rc) {
this.rc = rc;
}
public String getRc() {
return rc;
}
}

View File

@ -0,0 +1,57 @@
package org.sadigit.util;
import lombok.extern.slf4j.Slf4j;
import java.math.BigDecimal;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.util.*;
@Slf4j
public class AppUtil {
public static List<Map<String, String>> convertResultsetToListStr(ResultSet rs) {
List<Map<String, String>> lst = new ArrayList<Map<String, String>>();
try {
ResultSetMetaData rsmd = rs.getMetaData();
int colCount = rsmd.getColumnCount();
String value = "";
while (rs.next()) {
HashMap<String, String> map = new HashMap<String, String>();
for (int i = 1; i <= colCount; i++) {
try {
if (rs.getObject(i).toString().equals("") || rs.getObject(i).toString().equals("null")) {
value = "";
} else {
value = rs.getObject(i).toString();
}
} catch (Exception e) {
value = "";
}
map.put(rsmd.getColumnName(i).toLowerCase(), value);
}
lst.add(map);
}
} catch (Exception ex) {
log.info("AppUtil :" + ex.getMessage());
}
return lst;
}
public static Double doubleNVL(Double value) {
return Optional.ofNullable(value).orElse(Double.NaN);
}
public static BigDecimal BigDecimalNVL(BigDecimal value) {
return Optional.ofNullable(value).orElse(null);
}
public static int intNVL(int value) {
return Optional.ofNullable(value).orElse(Integer.BYTES);
}
}

View File

@ -0,0 +1,70 @@
package org.sadigit.util;
import org.apache.commons.lang3.StringUtils;
public class Checks {
public static void isTrues(boolean param, String message, String rc) {
if (!param)
throw newE(message, rc);
}
public static void isTrue(boolean param, String message, int status) {
if (!param)
throw newE(message, status);
}
public static <U extends RuntimeException> void isTrue(boolean param, U exception) {
if (!param)
throw exception;
}
public static void nonNull(Object param, String message) {
if (param == null)
throw newE(message);
}
public static void nonNull(Object param, String message, int status) {
if (param == null)
throw newE(message, status);
}
public static <U extends RuntimeException> void nonNull(Object param, U exception) {
if (param == null)
throw exception;
}
public static void hasText(CharSequence param, String message) {
if (StringUtils.isBlank(param))
throw newE(message);
}
public static void hasText(CharSequence param, String message, int status) {
if (StringUtils.isBlank(param))
throw newE(message, status);
}
public static <U extends RuntimeException> void hasText(CharSequence param, U exception) {
if (StringUtils.isBlank(param))
throw exception;
}
public static void throwE(String message) {
throw newE(message);
}
public static AppException newE(String message) {
return new AppException(message);
}
public static AppException newE(String message, int status) {
return new AppException(message, status);
}
public static AppException newE(String message, String rc) {
return new AppException(message, rc);
}
public static AppException newE(String message, int status, Object data) {
return new AppException(message, status, data);
}
}

View File

@ -0,0 +1,29 @@
package org.sadigit.util.validator;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import org.sadigit.util.validator.impl.ValidDateFormatValidator;
import jakarta.validation.Constraint;
import jakarta.validation.Payload;
/**
* Annotation for checking if String is in correct date format (yyyy-MM-dd HH:mm:ss)
*
* @author Tias Mardiansyah
*
*/
@Retention(java.lang.annotation.RetentionPolicy.RUNTIME)
@Target({
ElementType.FIELD,
})
@Constraint(validatedBy = ValidDateFormatValidator.class)
public @interface ValidDateFormat {
String message() default "Format tanggal harus mengikuti format berikut (yyyy-MM-dd HH:mm:ss)";
Class<? extends Payload>[] payload() default {};
Class<?>[] groups() default {};
}

View File

@ -0,0 +1,32 @@
package org.sadigit.util.validator.impl;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import org.sadigit.util.validator.ValidDateFormat;
import jakarta.validation.ConstraintValidator;
import jakarta.validation.ConstraintValidatorContext;
import lombok.extern.slf4j.Slf4j;
@Slf4j
public class ValidDateFormatValidator implements ConstraintValidator<ValidDateFormat, String> {
@Override
public boolean isValid(String value, ConstraintValidatorContext context) {
try {
DateTimeFormatter inputFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
LocalDateTime.parse(value, inputFormatter);
} catch (Exception e) {
log.error("error parsing, reason : {}", e.getMessage());
context.buildConstraintViolationWithTemplate("Terjadi kesalahan dalam format tanggal, pastikan format tanggal sesuai (yyyy-MM-dd HH:mm:ss)")
.addConstraintViolation();
return false;
}
return true;
}
}

View File

@ -0,0 +1,7 @@
quarkus.native.resources.includes=mock-data/**
# Database configuration
quarkus.datasource.username=adminapkt
quarkus.datasource.password=adm-apkt@2024!
quarkus.datasource.jdbc.url=jdbc:postgresql://10.1.50.173:30257/apkt?sslmode=require
quarkus.hibernate-orm.log.sql=true

View File

@ -0,0 +1,231 @@
{
"message": "SUKSES",
"data": [
{
"nip": "08734",
"positionid": 1,
"roleid": 1,
"unitid": 2,
"userid": 170,
"employeename": "Iskandar",
"username": "iskandar"
},
{
"nip": "123",
"positionid": 1,
"roleid": 1,
"unitid": 2,
"userid": 1377,
"employeename": "DEDI HERYANTO",
"username": "dell"
},
{
"nip": "123456",
"positionid": 1,
"roleid": 1,
"unitid": 2,
"userid": 2534,
"employeename": "Fadjar Permana",
"username": "utha"
},
{
"nip": "0",
"positionid": 1,
"roleid": 1,
"unitid": 2,
"userid": 2805,
"employeename": "Bayu Fajar Nugraha",
"username": "bayu"
},
{
"nip": "0",
"positionid": 1,
"roleid": 99,
"unitid": 2,
"userid": 2805,
"employeename": "Bayu Fajar Nugraha",
"username": "bayu"
},
{
"nip": "12345",
"positionid": 1,
"roleid": 1,
"unitid": 2,
"userid": 2584,
"employeename": "Danang Wira",
"username": "danang.wira"
},
{
"nip": "123456",
"positionid": 1,
"roleid": 1,
"unitid": 2,
"userid": 5824,
"employeename": "ADMIN - APKT",
"username": "eka.priya"
},
{
"nip": "123456",
"positionid": 1,
"roleid": 21,
"unitid": 2,
"userid": 5824,
"employeename": "ADMIN - APKT",
"username": "eka.priya"
},
{
"nip": "43456",
"positionid": 1,
"roleid": 1,
"unitid": 2,
"userid": 11124,
"employeename": "zainul OM Lapangan",
"username": "zainul"
},
{
"nip": "123456",
"positionid": 1,
"roleid": 21,
"unitid": 2,
"userid": 10794,
"employeename": "M Zen Falahuddin",
"username": "zen"
},
{
"nip": "123",
"positionid": 1,
"roleid": 1,
"unitid": 2,
"userid": 10324,
"employeename": "Misno",
"username": "misno"
},
{
"nip": "123",
"positionid": 1,
"roleid": 1,
"unitid": 2,
"userid": 10324,
"employeename": "Misno",
"username": "misno"
},
{
"nip": "0",
"positionid": 1,
"roleid": 1,
"unitid": 2,
"userid": 18430,
"employeename": "taufik arifani",
"username": "taufik"
},
{
"nip": "123",
"positionid": 1,
"roleid": 99,
"unitid": 2,
"userid": 24697,
"employeename": "SINGGIH CP",
"username": "singgih"
},
{
"nip": "123",
"positionid": 1,
"roleid": 1,
"unitid": 2,
"userid": 24697,
"employeename": "SINGGIH CP",
"username": "singgih"
},
{
"nip": "123",
"positionid": 1,
"roleid": 1,
"unitid": 2,
"userid": 26174,
"employeename": "YUKE RIFAYANI",
"username": "YUKE"
},
{
"nip": "123",
"positionid": 1,
"roleid": 1,
"unitid": 2,
"userid": 25700,
"employeename": "ARIP.FAOZI",
"username": "ARIP.FAOZI"
},
{
"nip": "123",
"positionid": 1,
"roleid": 99,
"unitid": 2,
"userid": 25700,
"employeename": "ARIP.FAOZI",
"username": "ARIP.FAOZI"
},
{
"nip": "123321",
"positionid": 1,
"roleid": 1,
"unitid": 2,
"userid": 26054,
"employeename": "FTQA ADMIN",
"username": "SSQA.ADMIN"
},
{
"nip": "123",
"positionid": 1,
"roleid": 1,
"unitid": 2,
"userid": 26173,
"employeename": "RATIH NOVIKA SARI",
"username": "RATIH.SARI"
},
{
"nip": "123",
"positionid": 1,
"roleid": 1,
"unitid": 2,
"userid": 25533,
"employeename": "RANGGA WIJAYA",
"username": "RANGGA.WIJAYA"
},
{
"nip": "123",
"positionid": 1,
"roleid": 99,
"unitid": 2,
"userid": 85811,
"employeename": "AMARUDIN",
"username": "AMARUDIN"
},
{
"nip": "123",
"positionid": 1,
"roleid": 1,
"unitid": 2,
"userid": 85811,
"employeename": "AMARUDIN",
"username": "AMARUDIN"
},
{
"nip": "123",
"positionid": 1,
"roleid": 99,
"unitid": 2,
"userid": 89486,
"employeename": "Aprianto Sudibyo",
"username": "aprianto.s"
},
{
"nip": "123",
"positionid": 1,
"roleid": 1,
"unitid": 2,
"userid": 89486,
"employeename": "Aprianto Sudibyo",
"username": "aprianto.s"
}
],
"rc": "0"
}

View File

@ -0,0 +1,16 @@
{
"message": "SUKSES",
"data": [
{
"bidangunitcode": "SPV.CC",
"bidangunitid": 127122,
"bidangunitname": "Fungsi SPV CC"
},
{
"bidangunitcode": "SPV.CC",
"bidangunitid": 127122,
"bidangunitname": "Fungsi SPV CC"
}
],
"rc": "00"
}

View File

@ -0,0 +1,156 @@
{
"message": "SUKSES",
"data": [
{
"jenis_pengaduan": "KELUHAN",
"issuetypeid": 334,
"issuetypename": "URGENT",
"projectid": 2
},
{
"jenis_pengaduan": "KELUHAN",
"issuetypeid": 41,
"issuetypename": "Pasang Baru (PB)",
"projectid": 2
},
{
"jenis_pengaduan": "KELUHAN",
"issuetypeid": 42,
"issuetypename": "Perubahan Daya (PD)",
"projectid": 2
},
{
"jenis_pengaduan": "KELUHAN",
"issuetypeid": 43,
"issuetypename": "Penyambungan Sementara (PS)",
"projectid": 2
},
{
"jenis_pengaduan": "KELUHAN",
"issuetypeid": 44,
"issuetypename": "Cater",
"projectid": 2
},
{
"jenis_pengaduan": "KELUHAN",
"issuetypeid": 45,
"issuetypename": "Tagihan Listrik dan Token ",
"projectid": 2
},
{
"jenis_pengaduan": "KELUHAN",
"issuetypeid": 46,
"issuetypename": "Pemutusan Penyambungan (Tusbung)",
"projectid": 2
},
{
"jenis_pengaduan": "KELUHAN",
"issuetypeid": 47,
"issuetypename": "APP",
"projectid": 2
},
{
"jenis_pengaduan": "KELUHAN",
"issuetypeid": 48,
"issuetypename": "Informasi",
"projectid": 2
},
{
"jenis_pengaduan": "KELUHAN",
"issuetypeid": 49,
"issuetypename": "Perubahan Data",
"projectid": 2
},
{
"jenis_pengaduan": "KELUHAN",
"issuetypeid": 50,
"issuetypename": "Integritas",
"projectid": 2
},
{
"jenis_pengaduan": "KELUHAN",
"issuetypeid": 51,
"issuetypename": "Program Konversi Kompor Induksi",
"projectid": 2
},
{
"jenis_pengaduan": "KELUHAN",
"issuetypeid": 52,
"issuetypename": "EV Home Charging",
"projectid": 2
},
{
"jenis_pengaduan": "KELUHAN",
"issuetypeid": 4,
"issuetypename": "PDPB",
"projectid": 2
},
{
"jenis_pengaduan": "KELUHAN",
"issuetypeid": 5,
"issuetypename": "Tusbung",
"projectid": 2
},
{
"jenis_pengaduan": "KELUHAN",
"issuetypeid": 6,
"issuetypename": "Lain-Lain",
"projectid": 2
},
{
"jenis_pengaduan": "KELUHAN",
"issuetypeid": 23,
"issuetypename": "Cater",
"projectid": 2
},
{
"jenis_pengaduan": "KELUHAN",
"issuetypeid": 24,
"issuetypename": "Pemakaian PTL Tidak Syah",
"projectid": 2
},
{
"jenis_pengaduan": "KELUHAN",
"issuetypeid": 25,
"issuetypename": "Instalasi Listrik",
"projectid": 2
},
{
"jenis_pengaduan": "KELUHAN",
"issuetypeid": 26,
"issuetypename": "Rekening",
"projectid": 2
},
{
"jenis_pengaduan": "KELUHAN",
"issuetypeid": 27,
"issuetypename": "Mutu dan Keandalan",
"projectid": 2
},
{
"jenis_pengaduan": "KELUHAN",
"issuetypeid": 28,
"issuetypename": "Invoice",
"projectid": 2
},
{
"jenis_pengaduan": "KELUHAN",
"issuetypeid": 29,
"issuetypename": "Non Transaksi",
"projectid": 2
},
{
"jenis_pengaduan": "KELUHAN",
"issuetypeid": 30,
"issuetypename": "Prabayar",
"projectid": 2
},
{
"jenis_pengaduan": "KELUHAN",
"issuetypeid": 32,
"issuetypename": "Calo atau Suap",
"projectid": 2
}
],
"rc": "00"
}

View File

@ -0,0 +1,20 @@
{
"message": "SUKSES",
"data": [
{
"unit_jaringan": null,
"unitname": "PT. PLN (Persero) Kantor Pusat",
"unitid": -1,
"unittypeid": 1,
"unitparent": null
},
{
"unit_jaringan": null,
"unitname": "PT. PLN (Persero)",
"unitid": 1,
"unittypeid": 1,
"unitparent": null
}
],
"rc": "00"
}

View File

@ -0,0 +1,20 @@
{
"message": "SUKSES",
"data": [
{
"appuserid": 90275,
"daftar_user": "12712.JOHANES",
"bidangunitcode": "SPV.CC",
"bidangunitid": 127122,
"bidangunitname": "Fungsi SPV CC"
},
{
"appuserid": 90574,
"daftar_user": "12712.WANDRA",
"bidangunitcode": "SPV.CC",
"bidangunitid": 127122,
"bidangunitname": "Fungsi SPV CC"
}
],
"rc": "00"
}

View File

@ -0,0 +1,54 @@
{
"message": "SUKSES",
"data": [
{
"issuetypeid": 41,
"issuetypename": "Pasang Baru (PB)"
},
{
"issuetypeid": 42,
"issuetypename": "Perubahan Daya (PD)"
},
{
"issuetypeid": 43,
"issuetypename": "Penyambungan Sementara (PS)"
},
{
"issuetypeid": 44,
"issuetypename": "Cater"
},
{
"issuetypeid": 45,
"issuetypename": "Tagihan Listrik dan Token "
},
{
"issuetypeid": 46,
"issuetypename": "Pemutusan Penyambungan (Tusbung)"
},
{
"issuetypeid": 47,
"issuetypename": "APP"
},
{
"issuetypeid": 48,
"issuetypename": "Informasi"
},
{
"issuetypeid": 49,
"issuetypename": "Perubahan Data"
},
{
"issuetypeid": 50,
"issuetypename": "Integritas"
},
{
"issuetypeid": 51,
"issuetypename": "Program Konversi Kompor Induksi"
},
{
"issuetypeid": 52,
"issuetypename": "EV Home Charging"
}
],
"rc": "00"
}

View File

@ -0,0 +1,406 @@
{
"message": "SUKSES",
"data": [
{
"subissuetypeid": 363,
"subissuetypename": "Belum bisa mengoperasikan",
"issuetypeid": 51
},
{
"subissuetypeid": 364,
"subissuetypename": "Geser Instalasi",
"issuetypeid": 51
},
{
"subissuetypeid": 365,
"subissuetypename": "Instalasi Bermasalah",
"issuetypeid": 51
},
{
"subissuetypeid": 366,
"subissuetypename": "MCB Turun / belum diganti",
"issuetypeid": 51
},
{
"subissuetypeid": 367,
"subissuetypename": "Bluetooth / LCD Mati / Blank",
"issuetypeid": 51
},
{
"subissuetypeid": 368,
"subissuetypename": "Gagal baca / QR Code Error",
"issuetypeid": 51
},
{
"subissuetypeid": 369,
"subissuetypename": "Kompor belum diterima",
"issuetypeid": 51
},
{
"subissuetypeid": 370,
"subissuetypename": "Utensil Rusak / Belum Diterima",
"issuetypeid": 51
},
{
"subissuetypeid": 371,
"subissuetypename": "Tagihan Listrik Naik",
"issuetypeid": 51
},
{
"subissuetypeid": 372,
"subissuetypename": "Kompor Rusak / Mati",
"issuetypeid": 51
},
{
"subissuetypeid": 373,
"subissuetypename": "Diskon Tambah Daya Bundling HCS",
"issuetypeid": 52
},
{
"subissuetypeid": 374,
"subissuetypename": "Proses Integrasi Charge.in",
"issuetypeid": 52
},
{
"subissuetypeid": 375,
"subissuetypename": "PB/PD Layanan Bundling HCS",
"issuetypeid": 52
},
{
"subissuetypeid": 376,
"subissuetypename": "Charger Tidak Berfungsi",
"issuetypeid": 52
},
{
"subissuetypeid": 377,
"subissuetypename": "Kendala Instalasi Home Charger",
"issuetypeid": 52
},
{
"subissuetypeid": 378,
"subissuetypename": "Reschedule Jadwal Pemasangan",
"issuetypeid": 52
},
{
"subissuetypeid": 379,
"subissuetypename": "Tidak Mendapatkan Diskon Tarif",
"issuetypeid": 52
},
{
"subissuetypeid": 380,
"subissuetypename": "Umum",
"issuetypeid": 52
},
{
"subissuetypeid": 361,
"subissuetypename": "Layanan Kompor Induksi",
"issuetypeid": 99048
},
{
"subissuetypeid": 301,
"subissuetypename": "Proses PB, belum ada realisasinya",
"issuetypeid": 41
},
{
"subissuetypeid": 302,
"subissuetypename": "Restitusi",
"issuetypeid": 41
},
{
"subissuetypeid": 303,
"subissuetypename": "Proses PD/TD, belum ada realisasinya ",
"issuetypeid": 42
},
{
"subissuetypeid": 304,
"subissuetypename": "Daya Terpasang Tidak Sesuai Daya Kontrak",
"issuetypeid": 42
},
{
"subissuetypeid": 305,
"subissuetypename": "Restitusi",
"issuetypeid": 42
},
{
"subissuetypeid": 306,
"subissuetypename": "Proses PS, belum ada realisasinya ",
"issuetypeid": 43
},
{
"subissuetypeid": 307,
"subissuetypename": "Restitusi",
"issuetypeid": 43
},
{
"subissuetypeid": 308,
"subissuetypename": "Keakuratan hasil catat meter ",
"issuetypeid": 44
},
{
"subissuetypeid": 309,
"subissuetypename": "Lebih Tagih",
"issuetypeid": 44
},
{
"subissuetypeid": 310,
"subissuetypename": "Petugas Cater Jarang Datang",
"issuetypeid": 44
},
{
"subissuetypeid": 311,
"subissuetypename": "Kurang Tagih",
"issuetypeid": 44
},
{
"subissuetypeid": 312,
"subissuetypename": "Koreksi Rekening",
"issuetypeid": 45
},
{
"subissuetypeid": 313,
"subissuetypename": "Rekening belum terbit ",
"issuetypeid": 45
},
{
"subissuetypeid": 314,
"subissuetypename": "Gagal Bayar",
"issuetypeid": 45
},
{
"subissuetypeid": 315,
"subissuetypename": "Salah membayar Rekening",
"issuetypeid": 45
},
{
"subissuetypeid": 316,
"subissuetypename": "Mengajukan Berlanganan Invoice ",
"issuetypeid": 45
},
{
"subissuetypeid": 317,
"subissuetypename": "Restitusi",
"issuetypeid": 45
},
{
"subissuetypeid": 318,
"subissuetypename": "Token tidak terbit",
"issuetypeid": 45
},
{
"subissuetypeid": 319,
"subissuetypename": "Konversi sisa token ",
"issuetypeid": 45
},
{
"subissuetypeid": 320,
"subissuetypename": "Token Expired",
"issuetypeid": 45
},
{
"subissuetypeid": 321,
"subissuetypename": "Gagal Input Token",
"issuetypeid": 45
},
{
"subissuetypeid": 322,
"subissuetypename": "Tidak bisa beli Token ",
"issuetypeid": 45
},
{
"subissuetypeid": 323,
"subissuetypename": "Token sudah dimasukan, namun Kwh tidak bertambah",
"issuetypeid": 45
},
{
"subissuetypeid": 324,
"subissuetypename": "Salah Putus ",
"issuetypeid": 46
},
{
"subissuetypeid": 325,
"subissuetypename": "Sudah Bayar Belum Disambung",
"issuetypeid": 46
},
{
"subissuetypeid": 326,
"subissuetypename": "Alat Ukur Paskabayar tidak berfungsi ",
"issuetypeid": 47
},
{
"subissuetypeid": 327,
"subissuetypename": "Alat Ukur Prabayar tidak berfungsi ",
"issuetypeid": 47
},
{
"subissuetypeid": 328,
"subissuetypename": "Alat Pembatas tidak berfungsi ",
"issuetypeid": 47
},
{
"subissuetypeid": 329,
"subissuetypename": "Instalasi / Wiring tidak berfungsi",
"issuetypeid": 47
},
{
"subissuetypeid": 330,
"subissuetypename": "Keypad/lampu indikator pada APP tidak berfungsi",
"issuetypeid": 47
},
{
"subissuetypeid": 331,
"subissuetypename": "Pelanggan berkeberatan dialihkan ke APP Prabayar",
"issuetypeid": 47
},
{
"subissuetypeid": 332,
"subissuetypename": "Proses Migrasi, belum ada realisasinya ",
"issuetypeid": 47
},
{
"subissuetypeid": 333,
"subissuetypename": "PB ",
"issuetypeid": 48
},
{
"subissuetypeid": 334,
"subissuetypename": "PD",
"issuetypeid": 48
},
{
"subissuetypeid": 335,
"subissuetypename": "PS",
"issuetypeid": 48
},
{
"subissuetypeid": 336,
"subissuetypename": "Tagihan Susulan",
"issuetypeid": 48
},
{
"subissuetypeid": 337,
"subissuetypename": "Tusbung",
"issuetypeid": 48
},
{
"subissuetypeid": 338,
"subissuetypename": "P2TL ",
"issuetypeid": 48
},
{
"subissuetypeid": 339,
"subissuetypename": "Kondisi Jaringan Listrik ",
"issuetypeid": 48
},
{
"subissuetypeid": 340,
"subissuetypename": "Cater ",
"issuetypeid": 48
},
{
"subissuetypeid": 341,
"subissuetypename": "APP",
"issuetypeid": 48
},
{
"subissuetypeid": 342,
"subissuetypename": "Tagihan Listrik dan Token",
"issuetypeid": 48
},
{
"subissuetypeid": 343,
"subissuetypename": "Drop Tegangan ",
"issuetypeid": 48
},
{
"subissuetypeid": 344,
"subissuetypename": "PTL Sering Padam ",
"issuetypeid": 48
},
{
"subissuetypeid": 345,
"subissuetypename": "Penanganan Gangguan dengan cara sambung langsung",
"issuetypeid": 48
},
{
"subissuetypeid": 346,
"subissuetypename": "Penanganan gangguan namun belum disertai penyegelan kembali",
"issuetypeid": 48
},
{
"subissuetypeid": 347,
"subissuetypename": "Stimulus / Subsidi Listrik",
"issuetypeid": 48
},
{
"subissuetypeid": 348,
"subissuetypename": "PJU",
"issuetypeid": 48
},
{
"subissuetypeid": 349,
"subissuetypename": "Umum",
"issuetypeid": 48
},
{
"subissuetypeid": 350,
"subissuetypename": "Ubah Nama",
"issuetypeid": 49
},
{
"subissuetypeid": 351,
"subissuetypename": "Ubah Alamat ",
"issuetypeid": 49
},
{
"subissuetypeid": 352,
"subissuetypename": "Ubah No Telp/NIK/NPWP ",
"issuetypeid": 49
},
{
"subissuetypeid": 353,
"subissuetypename": "Berhenti Berlangganan",
"issuetypeid": 49
},
{
"subissuetypeid": 354,
"subissuetypename": "Penggantian alamat email Invoice ",
"issuetypeid": 49
},
{
"subissuetypeid": 355,
"subissuetypename": "Proses Migrasi Data, belum ada realisasinya ",
"issuetypeid": 49
},
{
"subissuetypeid": 356,
"subissuetypename": "Penyesuaian UJL",
"issuetypeid": 49
},
{
"subissuetypeid": 357,
"subissuetypename": "Petugas kurang Sopan ",
"issuetypeid": 50
},
{
"subissuetypeid": 358,
"subissuetypename": "Petugas menawarkan Jasa (Calo )",
"issuetypeid": 50
},
{
"subissuetypeid": 359,
"subissuetypename": "Petugas Mengancam/Mengintimidasi",
"issuetypeid": 50
},
{
"subissuetypeid": 360,
"subissuetypename": "Petugas Meminta uang tambahan /Tip",
"issuetypeid": 50
},
{
"subissuetypeid": 362,
"subissuetypename": "Bantuan Pasang Baru Listrik / CSR",
"issuetypeid": 41
}
],
"rc": "00"
}