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

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"
}