diff --git a/.mvn/wrapper/maven-wrapper.properties b/.mvn/wrapper/maven-wrapper.properties deleted file mode 100644 index d58dfb7..0000000 --- a/.mvn/wrapper/maven-wrapper.properties +++ /dev/null @@ -1,19 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -wrapperVersion=3.3.2 -distributionType=only-script -distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip diff --git a/hs_err_pid29312.log b/hs_err_pid29312.log new file mode 100644 index 0000000..304d132 --- /dev/null +++ b/hs_err_pid29312.log @@ -0,0 +1,220 @@ +# +# There is insufficient memory for the Java Runtime Environment to continue. +# Native memory allocation (mmap) failed to map 123731968 bytes for G1 virtual space +# Possible reasons: +# The system is out of physical RAM or swap space +# The process is running with CompressedOops enabled, and the Java Heap may be blocking the growth of the native heap +# Possible solutions: +# Reduce memory load on the system +# Increase physical memory or swap space +# Check if swap backing store is full +# Decrease Java heap size (-Xmx/-Xms) +# Decrease number of Java threads +# Decrease Java thread stack sizes (-Xss) +# Set larger code cache with -XX:ReservedCodeCacheSize= +# JVM is running with Unscaled Compressed Oops mode in which the Java heap is +# placed in the first 4GB address space. The Java Heap base address is the +# maximum limit for the native heap growth. Please use -XX:HeapBaseMinAddress +# to set the Java Heap base and to place the Java Heap above 4GB virtual address. +# This output file may be truncated or incomplete. +# +# Out of Memory Error (os_windows.cpp:3548), pid=29312, tid=28704 +# +# JRE version: (17.0.12+8) (build ) +# Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0.12+8-LTS-286, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, windows-amd64) +# No core dump will be written. Minidumps are not enabled by default on client versions of Windows +# + +--------------- S U M M A R Y ------------ + +Command Line: -XX:+ShowCodeDetailsInExceptionMessages com.gcc.commissionerreview.DashboardserviceApplication + +Host: AMD Ryzen 3 5300U with Radeon Graphics , 8 cores, 7G, Windows 11 , 64 bit Build 22621 (10.0.22621.5415) +Time: Mon Dec 1 16:30:57 2025 India Standard Time elapsed time: 0.029072 seconds (0d 0h 0m 0s) + +--------------- T H R E A D --------------- + +Current thread (0x000001e9c9095530): JavaThread "Unknown thread" [_thread_in_vm, id=28704, stack(0x00000017b7800000,0x00000017b7900000)] + +Stack: [0x00000017b7800000,0x00000017b7900000] +Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) +V [jvm.dll+0x67a04a] +V [jvm.dll+0x7da4ed] +V [jvm.dll+0x7dbe33] +V [jvm.dll+0x7dc4a3] +V [jvm.dll+0x24508f] +V [jvm.dll+0x677089] +V [jvm.dll+0x66bd32] +V [jvm.dll+0x301fa6] +V [jvm.dll+0x309546] +V [jvm.dll+0x359d2e] +V [jvm.dll+0x359f5f] +V [jvm.dll+0x2d9078] +V [jvm.dll+0x2d9fe4] +V [jvm.dll+0x7aca21] +V [jvm.dll+0x367591] +V [jvm.dll+0x78b999] +V [jvm.dll+0x3ec83f] +V [jvm.dll+0x3ee471] +C [jli.dll+0x5297] +C [ucrtbase.dll+0x29333] +C [KERNEL32.DLL+0x1259d] +C [ntdll.dll+0x5af78] + + +--------------- P R O C E S S --------------- + +Threads class SMR info: +_java_thread_list=0x00007ffd7e0b7a18, length=0, elements={ +} + +Java Threads: ( => current thread ) + +Other Threads: + 0x000001e9c90f3fe0 GCTaskThread "GC Thread#0" [stack: 0x00000017b7900000,0x00000017b7a00000] [id=13928] + 0x000001e9c91049c0 ConcurrentGCThread "G1 Main Marker" [stack: 0x00000017b7a00000,0x00000017b7b00000] [id=21488] + 0x000001e9c91053d0 ConcurrentGCThread "G1 Conc#0" [stack: 0x00000017b7b00000,0x00000017b7c00000] [id=26372] + +[error occurred during error reporting (printing all threads), id 0xc0000005, EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00007ffd7d8e9b67] + +VM state: not at safepoint (not fully initialized) + +VM Mutex/Monitor currently owned by a thread: ([mutex/lock_event]) +[0x000001e9c9090970] Heap_lock - owner thread: 0x000001e9c9095530 + +Heap address: 0x000000008ac00000, size: 1876 MB, Compressed Oops mode: 32-bit + +CDS archive(s) mapped at: [0x0000000000000000-0x0000000000000000-0x0000000000000000), size 0, SharedBaseAddress: 0x0000000800000000, ArchiveRelocationMode: 1. +Narrow klass base: 0x0000000000000000, Narrow klass shift: 0, Narrow klass range: 0x0 + +GC Precious Log: + + +Heap: + garbage-first heap total 0K, used 0K [0x000000008ac00000, 0x0000000100000000) + region size 1024K, 0 young (0K), 0 survivors (0K) + +[error occurred during error reporting (printing heap information), id 0xc0000005, EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00007ffd7dcd3859] + +GC Heap History (0 events): +No events + +Deoptimization events (0 events): +No events + +Classes unloaded (0 events): +No events + +Classes redefined (0 events): +No events + +Internal exceptions (0 events): +No events + +VM Operations (0 events): +No events + +Events (1 events): +Event: 0.014 Loaded shared library C:\Program Files\Java\jdk-17\bin\java.dll + + +Dynamic libraries: +0x00007ff678e90000 - 0x00007ff678ea0000 C:\Program Files\Java\jdk-17\bin\java.exe +0x00007ffe2f0d0000 - 0x00007ffe2f2e8000 C:\windows\SYSTEM32\ntdll.dll +0x00007ffe2e0f0000 - 0x00007ffe2e1b4000 C:\windows\System32\KERNEL32.DLL +0x00007ffe2c460000 - 0x00007ffe2c833000 C:\windows\System32\KERNELBASE.dll +0x00007ffe2cc60000 - 0x00007ffe2cd71000 C:\windows\System32\ucrtbase.dll +0x00007ffd7f2e0000 - 0x00007ffd7f2fb000 C:\Program Files\Java\jdk-17\bin\VCRUNTIME140.dll +0x00007ffd7f280000 - 0x00007ffd7f299000 C:\Program Files\Java\jdk-17\bin\jli.dll +0x00007ffe2ec00000 - 0x00007ffe2ecb1000 C:\windows\System32\ADVAPI32.dll +0x00007ffe2efe0000 - 0x00007ffe2f087000 C:\windows\System32\msvcrt.dll +0x00007ffe2e7b0000 - 0x00007ffe2e858000 C:\windows\System32\sechost.dll +0x00007ffe2c1f0000 - 0x00007ffe2c218000 C:\windows\System32\bcrypt.dll +0x00007ffe2ecc0000 - 0x00007ffe2edd8000 C:\windows\System32\RPCRT4.dll +0x00007ffe2d210000 - 0x00007ffe2d3c2000 C:\windows\System32\USER32.dll +0x00007ffe2c8c0000 - 0x00007ffe2c8e6000 C:\windows\System32\win32u.dll +0x00007ffe2ee00000 - 0x00007ffe2ee29000 C:\windows\System32\GDI32.dll +0x00007ffe2c220000 - 0x00007ffe2c33b000 C:\windows\System32\gdi32full.dll +0x00007ffe2c3c0000 - 0x00007ffe2c45a000 C:\windows\System32\msvcp_win.dll +0x00007ffe12620000 - 0x00007ffe128bc000 C:\windows\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.22621.6060_none_2712eda17382d24b\COMCTL32.dll +0x00007ffe22db0000 - 0x00007ffe22dba000 C:\windows\SYSTEM32\VERSION.dll +0x00007ffe2e0a0000 - 0x00007ffe2e0d1000 C:\windows\System32\IMM32.DLL +0x00007ffd7f2b0000 - 0x00007ffd7f2bc000 C:\Program Files\Java\jdk-17\bin\vcruntime140_1.dll +0x00007ffd7e7a0000 - 0x00007ffd7e82e000 C:\Program Files\Java\jdk-17\bin\msvcp140.dll +0x00007ffd7d600000 - 0x00007ffd7e1e0000 C:\Program Files\Java\jdk-17\bin\server\jvm.dll +0x00007ffe2de60000 - 0x00007ffe2de68000 C:\windows\System32\PSAPI.DLL +0x00007ffd7f270000 - 0x00007ffd7f279000 C:\windows\SYSTEM32\WSOCK32.dll +0x00007ffe2eea0000 - 0x00007ffe2ef11000 C:\windows\System32\WS2_32.dll +0x00007ffe27b70000 - 0x00007ffe27ba4000 C:\windows\SYSTEM32\WINMM.dll +0x00007ffe2b1d0000 - 0x00007ffe2b1e8000 C:\windows\SYSTEM32\kernel.appcore.dll +0x00007ffd7f260000 - 0x00007ffd7f26a000 C:\Program Files\Java\jdk-17\bin\jimage.dll +0x00007ffe242e0000 - 0x00007ffe24513000 C:\windows\SYSTEM32\DBGHELP.DLL +0x00007ffe2e860000 - 0x00007ffe2ebf1000 C:\windows\System32\combase.dll +0x00007ffe2d3d0000 - 0x00007ffe2d4a8000 C:\windows\System32\OLEAUT32.dll +0x00007ffe13910000 - 0x00007ffe13942000 C:\windows\SYSTEM32\dbgcore.DLL +0x00007ffe2c340000 - 0x00007ffe2c3bb000 C:\windows\System32\bcryptPrimitives.dll +0x00007ffd7f230000 - 0x00007ffd7f255000 C:\Program Files\Java\jdk-17\bin\java.dll + +dbghelp: loaded successfully - version: 4.0.5 - missing functions: none +symbol engine: initialized successfully - sym options: 0x614 - pdb path: .;C:\Program Files\Java\jdk-17\bin;C:\windows\SYSTEM32;C:\windows\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.22621.6060_none_2712eda17382d24b;C:\Program Files\Java\jdk-17\bin\server + +VM Arguments: +jvm_args: -XX:+ShowCodeDetailsInExceptionMessages +java_command: com.gcc.commissionerreview.DashboardserviceApplication +java_class_path (initial): C:\Commisoner review may 2025\commissioner_review_1_may2025\target\classes;C:\Users\Ajith\.m2\repository\org\springframework\boot\spring-boot-starter-data-jdbc\3.4.5\spring-boot-starter-data-jdbc-3.4.5.jar;C:\Users\Ajith\.m2\repository\org\springframework\boot\spring-boot-starter-jdbc\3.4.5\spring-boot-starter-jdbc-3.4.5.jar;C:\Users\Ajith\.m2\repository\com\zaxxer\HikariCP\5.1.0\HikariCP-5.1.0.jar;C:\Users\Ajith\.m2\repository\org\springframework\spring-jdbc\6.2.6\spring-jdbc-6.2.6.jar;C:\Users\Ajith\.m2\repository\org\springframework\data\spring-data-jdbc\3.4.5\spring-data-jdbc-3.4.5.jar;C:\Users\Ajith\.m2\repository\org\springframework\data\spring-data-relational\3.4.5\spring-data-relational-3.4.5.jar;C:\Users\Ajith\.m2\repository\org\springframework\data\spring-data-commons\3.4.5\spring-data-commons-3.4.5.jar;C:\Users\Ajith\.m2\repository\org\springframework\spring-tx\6.2.6\spring-tx-6.2.6.jar;C:\Users\Ajith\.m2\repository\org\springframework\spring-context\6.2.6\spring-context-6.2.6.jar;C:\Users\Ajith\.m2\repository\org\springframework\spring-beans\6.2.6\spring-beans-6.2.6.jar;C:\Users\Ajith\.m2\repository\org\slf4j\slf4j-api\2.0.17\slf4j-api-2.0.17.jar;C:\Users\Ajith\.m2\repository\org\springframework\boot\spring-boot-starter-thymeleaf\3.4.5\spring-boot-starter-thymeleaf-3.4.5.jar;C:\Users\Ajith\.m2\repository\org\springframework\boot\spring-boot-starter\3.4.5\spring-boot-starter-3.4.5.jar;C:\Users\Ajith\.m2\repository\org\springframework\boot\spring-boot-starter-logging\3.4.5\spring-boot-starter-logging-3.4.5.jar;C:\Users\Ajith\.m2\repository\ch\qos\logback\logback-classic\1.5.18\logback-classic-1.5.18.jar;C:\Users\Ajith\.m2\repository\ch\qos\logback\logback-core\1.5.18\logback-core-1.5.18.jar;C:\Users\Ajith\.m2\repository\org\apache\logging\log4j\log4j-to-slf4j\2.24.3\log4j-to-slf4j-2.24.3.jar;C:\Users\Ajith\.m2\repository\org\apache\logging\log4j\log4j-api\2.24.3\log4j-api-2.24.3.jar;C:\Users\Ajith\.m2\repository\org\slf4j\jul-t +Launcher Type: SUN_STANDARD + +[Global flags] + intx CICompilerCount = 4 {product} {ergonomic} + uint ConcGCThreads = 2 {product} {ergonomic} + uint G1ConcRefinementThreads = 8 {product} {ergonomic} + size_t G1HeapRegionSize = 1048576 {product} {ergonomic} + uintx GCDrainStackTargetSize = 64 {product} {ergonomic} + size_t InitialHeapSize = 123731968 {product} {ergonomic} + size_t MarkStackSize = 4194304 {product} {ergonomic} + size_t MaxHeapSize = 1967128576 {product} {ergonomic} + size_t MinHeapDeltaBytes = 1048576 {product} {ergonomic} + size_t MinHeapSize = 8388608 {product} {ergonomic} + uintx NonNMethodCodeHeapSize = 5839372 {pd product} {ergonomic} + uintx NonProfiledCodeHeapSize = 122909434 {pd product} {ergonomic} + uintx ProfiledCodeHeapSize = 122909434 {pd product} {ergonomic} + uintx ReservedCodeCacheSize = 251658240 {pd product} {ergonomic} + bool SegmentedCodeCache = true {product} {ergonomic} + bool ShowCodeDetailsInExceptionMessages = true {manageable} {command line} + size_t SoftMaxHeapSize = 1967128576 {manageable} {ergonomic} + bool UseCompressedClassPointers = true {product lp64_product} {ergonomic} + bool UseCompressedOops = true {product lp64_product} {ergonomic} + bool UseG1GC = true {product} {ergonomic} + bool UseLargePagesIndividualAllocation = false {pd product} {ergonomic} + +Logging: +Log output configuration: + #0: stdout all=warning uptime,level,tags + #1: stderr all=off uptime,level,tags + +Environment Variables: +PATH=c:\Users\Ajith\AppData\Roaming\Code\User\globalStorage\github.copilot-chat\debugCommand;c:\Users\Ajith\AppData\Roaming\Code\User\globalStorage\github.copilot-chat\copilotCli;C:\Program Files\Common Files\Oracle\Java\javapath;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0\;C:\windows\System32\OpenSSH\;C:\Program Files\Docker\Docker\resources\bin;C:\Program Files\Java\jdk-17\bin;C:\Program Files\nodejs\;C:\Program Files (x86)\Microsoft SQL Server\160\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\160\Tools\Binn\;C:\Program Files\Microsoft SQL Server\160\Tools\Binn\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\Program Files\Microsoft SQL Server\160\DTS\Binn\;C:\Program Files\Apache\Maven\apache-maven-3.9.11\bin;C:\Users\Ajith\AppData\Local\Programs\Python\Python313\Scripts\;C:\Users\Ajith\AppData\Local\Programs\Python\Python313\;C:\Users\Ajith\AppData\Local\Programs\Python\Python312\Scripts\;C:\Users\Ajith\AppData\Local\Programs\Python\Python312\;C:\Users\Ajith\AppData\Local\Programs\Python\Launcher\;C:\Users\Ajith\AppData\Local\Microsoft\WindowsApps;C:\Users\Ajith\AppData\Local\Programs\Git\cmd;C:\Users\Ajith\Desktop;C:\Users\Ajith\Desktop\demo\terraform;C:\Users\Ajith\AppData\Roaming\npm;C:\Users\Ajith\AppData\Local\GitHubDesktop\bin;C:\Users\Ajith\AppData\Local\Programs\Microsoft VS Code\bin;c:\Users\Ajith\.vscode\extensions\vscjava.vscode-java-debug-0.58.3\bundled\scripts\noConfigScripts +USERNAME=Ajith +LANG=en_US.UTF-8 +OS=Windows_NT +PROCESSOR_IDENTIFIER=AMD64 Family 23 Model 104 Stepping 1, AuthenticAMD + + + +--------------- S Y S T E M --------------- + +OS: + Windows 11 , 64 bit Build 22621 (10.0.22621.5415) +OS uptime: 4 days 23:37 hours +Hyper-V role detected + +CPU: total 8 (initial active 8) (8 cores per cpu, 2 threads per core) family 23 model 104 stepping 1 microcode 0x0, cx8, cmov, fxsr, ht, mmx, 3dnowpref, sse, sse2, sse3, ssse3, sse4a, sse4.1, sse4.2, popcnt, lzcnt, tsc, tscinvbit, avx, avx2, aes, clmul, bmi1, bmi2, adx, sha, fma, vzeroupper, clflush, clflushopt, hv + +Memory: 4k page, system-wide physical 7502M (201M free) +TotalPageFile size 30030M (AvailPageFile size 94M) +current process WorkingSet (physical memory assigned to process): 11M, peak: 11M +current process commit charge ("private bytes"): 60M, peak: 178M + +vm_info: Java HotSpot(TM) 64-Bit Server VM (17.0.12+8-LTS-286) for windows-amd64 JRE (17.0.12+8-LTS-286), built on Jun 5 2024 06:46:59 by "mach5one" with MS VC++ 17.6 (VS2022) + +END. diff --git a/src/main/java/com/gcc/commissionerreview/configuration/AppConfig.java b/src/main/java/com/gcc/commissionerreview/configuration/AppConfig.java new file mode 100644 index 0000000..6426667 --- /dev/null +++ b/src/main/java/com/gcc/commissionerreview/configuration/AppConfig.java @@ -0,0 +1,60 @@ +package com.gcc.commissionerreview.configuration; + +import org.springframework.beans.factory.annotation.Value; + +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.context.annotation.Bean; +import org.springframework.stereotype.Component; +import org.springframework.web.client.RestTemplate; + + +@Component +@ConfigurationProperties(prefix = "app") +public class AppConfig { + + + @Bean + public RestTemplate restTemplate() { + return new RestTemplate(); + } + + private String title; + private String baseUrl; + private String getOtpUrl; + private String erpUrl; + + + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getBaseUrl() { + return baseUrl; + } + + public void setBaseUrl(String baseUrl) { + this.baseUrl = baseUrl; + } + + public String getGetOtpUrl() { + return getOtpUrl; + } + + public void setGetOtpUrl(String getOtpUrl) { + this.getOtpUrl = getOtpUrl; + } + + public String getErpUrl() { + return erpUrl; + } + + public void setErpUrl(String erpUrl) { + this.erpUrl = erpUrl; + } + +} \ No newline at end of file diff --git a/src/main/java/com/gcc/commissionerreview/configuration/DataSourceConfig.java b/src/main/java/com/gcc/commissionerreview/configuration/DataSourceConfig.java index 18485cb..c0e38e3 100644 --- a/src/main/java/com/gcc/commissionerreview/configuration/DataSourceConfig.java +++ b/src/main/java/com/gcc/commissionerreview/configuration/DataSourceConfig.java @@ -1,11 +1,8 @@ package com.gcc.commissionerreview.configuration; - -import com.zaxxer.hikari.HikariConfig; -import com.zaxxer.hikari.HikariDataSource; +import javax.sql.DataSource; import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Primary; @@ -14,71 +11,76 @@ import org.springframework.jdbc.datasource.DriverManagerDataSource; import org.springframework.transaction.PlatformTransactionManager; import org.springframework.transaction.annotation.EnableTransactionManagement; -import javax.sql.DataSource; - @Configuration @EnableTransactionManagement public class DataSourceConfig { - - -// private static String host = "localhost:3306"; -// private static String dbpassword = "root"; - - - private static String host = "gcc-facial-db-instance-1.cf48eqcciziq.ap-south-1.rds.amazonaws.com:3306"; - private static String dbpassword = "gcc-facial-password"; - - public static class MyDataSourceConfig { - @Primary - @Bean(name = "mydatasource") - public DataSource MyDataSource() { -// DriverManagerDataSource dataSource = new DriverManagerDataSource(); -// dataSource.setDriverClassName("com.mysql.cj.jdbc.Driver"); -// dataSource.setUrl("jdbc:mysql://"+host+"/dashboard_service"); -// dataSource.setUsername("root"); -// dataSource.setPassword("root"); -// return dataSource; - - DriverManagerDataSource dataSource = new DriverManagerDataSource(); - dataSource.setUrl("jdbc:mysql://"+host+"/commissioner_review"); - //dataSource.setUrl("jdbc:mysql://"+host+"/dashboard_service"); - dataSource.setUsername("root"); - dataSource.setPassword(dbpassword); - dataSource.setDriverClassName("com.mysql.cj.jdbc.Driver"); - return dataSource; - - - } - - @Primary - @Bean(name = "myTransactionManager") - public PlatformTransactionManager myTransactionManager(@Qualifier("mydatasource") DataSource dataSource) { - return new DataSourceTransactionManager(dataSource); - } - } - - ////////////////////////////// Domestic Waste Management //////////////////////// - @Bean(name = "mysqlSofaBedCollectionDataSource") - public DataSource mysqlSofaBedCollectionDataSource() { - DriverManagerDataSource dataSource = new DriverManagerDataSource(); - dataSource.setDriverClassName("com.mysql.cj.jdbc.Driver"); - dataSource.setUrl("jdbc:mysql://"+host+"/domestic_waste_management"); - dataSource.setUsername("root"); - dataSource.setPassword(dbpassword); - return dataSource; - } + private static String host = "localhost:3306"; + private static String dbpassword = "root"; + + // private static String host = + // "gcc-facial-db-instance-1.cf48eqcciziq.ap-south-1.rds.amazonaws.com:3306"; + // private static String dbpassword = "gcc-facial-password"; + + public static class MyDataSourceConfig { + @Primary + @Bean(name = "mydatasource") + public DataSource MyDataSource() { + // DriverManagerDataSource dataSource = new DriverManagerDataSource(); + // dataSource.setDriverClassName("com.mysql.cj.jdbc.Driver"); + // dataSource.setUrl("jdbc:mysql://"+host+"/dashboard_service"); + // dataSource.setUsername("root"); + // dataSource.setPassword("root"); + // return dataSource; - - //////////////////////////////ORACLE //////////////////////// - @Bean(name = "oracleDataSource") - public DataSource oracleDataSource() { DriverManagerDataSource dataSource = new DriverManagerDataSource(); - dataSource.setDriverClassName("oracle.jdbc.OracleDriver"); - dataSource.setUrl("jdbc:oracle:thin:@10.1.0.14:1521:chncorp"); - dataSource.setUsername("FAS"); - dataSource.setPassword("FAS"); + dataSource.setUrl("jdbc:mysql://" + host + "/commissioner_review"); + // dataSource.setUrl("jdbc:mysql://"+host+"/dashboard_service"); + dataSource.setUsername("root"); + dataSource.setPassword(dbpassword); + dataSource.setDriverClassName("com.mysql.cj.jdbc.Driver"); return dataSource; + } -} + @Primary + @Bean(name = "myTransactionManager") + public PlatformTransactionManager myTransactionManager(@Qualifier("mydatasource") DataSource dataSource) { + return new DataSourceTransactionManager(dataSource); + } + } + + ////////////////////////////// Domestic Waste Management + ////////////////////////////// //////////////////////// + @Bean(name = "mysqlSofaBedCollectionDataSource") + public DataSource mysqlSofaBedCollectionDataSource() { + DriverManagerDataSource dataSource = new DriverManagerDataSource(); + dataSource.setDriverClassName("com.mysql.cj.jdbc.Driver"); + dataSource.setUrl("jdbc:mysql://" + host + "/domestic_waste_management"); + dataSource.setUsername("root"); + dataSource.setPassword(dbpassword); + return dataSource; + } + + ////////////////////////////// Food distribution //////////////////////// + @Bean(name = "mysqlFoodDistributionDataSource") + public DataSource mysqlFoodDistributionDataSource() { + DriverManagerDataSource dataSource = new DriverManagerDataSource(); + dataSource.setDriverClassName("com.mysql.cj.jdbc.Driver"); + dataSource.setUrl("jdbc:mysql://" + host + "/gcc_food_distribution"); + dataSource.setUsername("root"); + dataSource.setPassword(dbpassword); + return dataSource; + } + + ////////////////////////////// ORACLE //////////////////////// + @Bean(name = "oracleDataSource") + public DataSource oracleDataSource() { + DriverManagerDataSource dataSource = new DriverManagerDataSource(); + dataSource.setDriverClassName("oracle.jdbc.OracleDriver"); + dataSource.setUrl("jdbc:oracle:thin:@10.1.0.14:1521:chncorp"); + dataSource.setUsername("FAS"); + dataSource.setPassword("FAS"); + return dataSource; + } +} diff --git a/src/main/java/com/gcc/commissionerreview/controller/FoodSchemeController.java b/src/main/java/com/gcc/commissionerreview/controller/FoodSchemeController.java new file mode 100644 index 0000000..64b42e7 --- /dev/null +++ b/src/main/java/com/gcc/commissionerreview/controller/FoodSchemeController.java @@ -0,0 +1,142 @@ +package com.gcc.commissionerreview.controller; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import com.gcc.commissionerreview.service.FoodSchemeService; + +@RestController +@RequestMapping("/commissionerreview/api") +public class FoodSchemeController { + + @Autowired + private FoodSchemeService foodSchemeService; + + /* + * @GetMapping("/feedback-summary") + * public List> getFeedbackSummary(@RequestParam String + * date) { + * return feedbackService.getFeedbackSummary(date); + * } + * + * @GetMapping("/driver-report") + * public List> getDriverReport(@RequestParam String date) { + * //System.out.println("Date received in controller: " + date); + * return feedbackService.getDriverReport(date); + * } + */ + // ak + @GetMapping("/feedback-summary") + public ResponseEntity getFeedbackSummary(@RequestParam String date) { + try { + List> data = foodSchemeService.getFeedbackSummary(date); + + Map response = new HashMap<>(); + response.put("status", "success"); + response.put("date", date); + response.put("data", data); + + return ResponseEntity.ok(response); + + } catch (Exception e) { + Map error = new HashMap<>(); + error.put("status", "error"); + error.put("message", e.getMessage()); + + return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(error); + } + } + + @GetMapping("/driver-report") + public ResponseEntity getDriverReport(@RequestParam String date) { + try { + List> data = foodSchemeService.getDriverReport(date); + + Map response = new HashMap<>(); + response.put("status", "success"); + response.put("date", date); + response.put("data", data); + + return ResponseEntity.ok(response); + + } catch (Exception e) { + Map error = new HashMap<>(); + error.put("status", "error"); + error.put("message", e.getMessage()); + + return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(error); + } + } + + /// yogi + @GetMapping("/abstract") + public ResponseEntity getAbstractReport(@RequestParam String date) { + try { + List> report = foodSchemeService.getAbstractReport(date); + // System.out.println("report : " + report); + + Map response = new HashMap<>(); + response.put("status", "success"); + response.put("date", date); + response.put("data", report); + + return ResponseEntity.ok(response); + + } catch (Exception e) { + Map error = new HashMap<>(); + error.put("status", "error"); + error.put("message", e.getMessage()); + return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(error); + } + } + + @GetMapping("/zoneandshiftbasedreport") + public ResponseEntity getZoneWiseShiftBasedReport(@RequestParam String date, @RequestParam Integer shiftId) { + try { + List> report = foodSchemeService.getZoneWiseShiftBasedReport(date, shiftId); + // System.out.println("report : " + report); + + Map response = new HashMap<>(); + response.put("status", "success"); + response.put("date", date); + response.put("data", report); + + return ResponseEntity.ok(response); + + } catch (Exception e) { + Map error = new HashMap<>(); + error.put("status", "error"); + error.put("message", e.getMessage()); + return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(error); + } + } + + @GetMapping("/wardlocationreport") + public ResponseEntity getWardLocationReport(@RequestParam String date) { + try { + List> report = foodSchemeService.getWardLocationWiseReport(date); + + Map response = new HashMap<>(); + response.put("status", "success"); + response.put("date", date); + response.put("data", report); + + return ResponseEntity.ok(response); + } catch (Exception e) { + Map error = new HashMap<>(); + error.put("status", "error"); + error.put("message", e.getMessage()); + return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(error); + } + } + +} diff --git a/src/main/java/com/gcc/commissionerreview/controller/MainController.java b/src/main/java/com/gcc/commissionerreview/controller/MainController.java index 07e1c15..1c35d8e 100644 --- a/src/main/java/com/gcc/commissionerreview/controller/MainController.java +++ b/src/main/java/com/gcc/commissionerreview/controller/MainController.java @@ -1,7 +1,7 @@ package com.gcc.commissionerreview.controller; -import org.springframework.ui.Model; import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; @@ -163,6 +163,20 @@ public class MainController { public String viewpendingdetails(Model model) { return "modules/sofa_bed/pendingdetails"; } + @GetMapping("/foodSchemeReport") + public String foodSchemereport(Model model) { + return "modules/food_scheme/foodschemereport"; + } + + @GetMapping("/feedbackreport") + public String feedbackreport(Model model) { + return "modules/food_scheme/feedbackreport"; + } + + @GetMapping("/driverreport") + public String driverreport(Model model) { + return "modules/food_scheme/driverreport"; + } } diff --git a/src/main/java/com/gcc/commissionerreview/service/FoodSchemeService.java b/src/main/java/com/gcc/commissionerreview/service/FoodSchemeService.java new file mode 100644 index 0000000..d6739f7 --- /dev/null +++ b/src/main/java/com/gcc/commissionerreview/service/FoodSchemeService.java @@ -0,0 +1,484 @@ +package com.gcc.commissionerreview.service; + +import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +import javax.imageio.ImageIO; +import javax.sql.DataSource; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.core.env.Environment; +import org.springframework.jdbc.core.JdbcTemplate; +import org.springframework.stereotype.Service; +import java.net.URL; +import java.awt.image.BufferedImage; +import java.io.ByteArrayOutputStream; +import javax.imageio.ImageIO; +import java.util.Base64; +import java.util.concurrent.ConcurrentHashMap; +import java.util.Map; + +import com.gcc.commissionerreview.configuration.AppConfig; + +@Service +public class FoodSchemeService { + + @Autowired + private JdbcTemplate jdbcTemplate; + @Autowired + private Environment environment; + @Autowired + private AppConfig appConfig; + + @Autowired + @Value("${fileBaseUrl}") + + private String fileBaseUrl; + + // ak for pdf image render + // private final Map imageCache = new ConcurrentHashMap<>(); + + @Autowired + public void setFeedbackDataSource(@Qualifier("mysqlFoodDistributionDataSource") DataSource dataSource) { + this.jdbcTemplate = new JdbcTemplate(dataSource); + } + + public FoodSchemeService(Environment environment) { + + this.environment = environment; + + this.fileBaseUrl = environment.getProperty("fileBaseUrl"); + } + /* + * private String convertUrlToBase64(String url) { + * try { + * if (imageCache.containsKey(url)) { + * return imageCache.get(url); + * } + * + * URL imageUrl = new URL(url); + * BufferedImage image = ImageIO.read(imageUrl); + * + * ByteArrayOutputStream baos = new ByteArrayOutputStream(); + * ImageIO.write(image, "jpeg", baos); + * + * String base64 = "data:image/jpeg;base64," + + * Base64.getEncoder().encodeToString(baos.toByteArray()); + * + * imageCache.put(url, base64); + * return base64; + * + * } catch (Exception e) { + * e.printStackTrace(); + * return null; + * } + * } + */ + + public List> getFeedbackSummary(String date) { + + /* + * String sql = """ + * SELECT + * fq.qid, + * fq.question, + * + * -- YES Count + * SUM( + * CASE + * WHEN fq.qid = 1 AND fd.q1 = '1' THEN 1 + * WHEN fq.qid = 2 AND fd.q2 = '3' THEN 1 + * WHEN fq.qid = 3 AND fd.q3 = '5' THEN 1 + * ELSE 0 + * END + * ) AS yes_count, + * + * -- NO Count + * SUM( + * CASE + * WHEN fq.qid = 1 AND fd.q1 = '2' THEN 1 + * WHEN fq.qid = 2 AND fd.q2 = '4' THEN 1 + * WHEN fq.qid = 3 AND fd.q3 = '6' THEN 1 + * ELSE 0 + * END + * ) AS no_count + * + * FROM feedback_questions fq + * LEFT JOIN feedback_data fd + * ON fd.isactive = 1 + * AND fd.isdelete = 0 + * AND DATE(fd.feedback_date) = ? + * + * + * WHERE fq.isactive = 1 + * AND fq.isdelete = 0 + * + * GROUP BY fq.qid, fq.question + * ORDER BY fq.orderby + * """; + */ + String sql = "SELECT " + + " fq.qid, " + + " fq.question, " + + + " SUM( " + + " CASE " + + " WHEN fq.qid = 1 AND fd.q1 = '1' THEN 1 " + + " WHEN fq.qid = 2 AND fd.q2 = '3' THEN 1 " + + " WHEN fq.qid = 3 AND fd.q3 = '5' THEN 1 " + + " ELSE 0 " + + " END " + + " ) AS yes_count, " + + + " SUM( " + + " CASE " + + " WHEN fq.qid = 1 AND fd.q1 = '2' THEN 1 " + + " WHEN fq.qid = 2 AND fd.q2 = '4' THEN 1 " + + " WHEN fq.qid = 3 AND fd.q3 = '6' THEN 1 " + + " ELSE 0 " + + " END " + + " ) AS no_count " + + + "FROM feedback_questions fq " + + "LEFT JOIN feedback_data fd " + + " ON fd.isactive = 1 " + + " AND fd.isdelete = 0 " + + " AND DATE(fd.feedback_date) = ? " + + + "WHERE fq.isactive = 1 " + + "AND fq.isdelete = 0 " + + + "GROUP BY fq.qid, fq.question " + + "ORDER BY fq.orderby"; + + return jdbcTemplate.queryForList(sql, date); + } + + public List> getDriverReport(String date) { + // System.out.println("File Base URL: " + fileBaseUrl); + + String sql = "SELECT lm.location AS LocationDescription, " + + "dl.username AS DriverName, " + + "CONCAT('" + fileBaseUrl + "/gccofficialapp/files', dss_start.image) AS upload_image_url, " + + "CONCAT(dss_start.latitude, ', ', dss_start.longitude) AS StartPoint, " + + "Date(dss_start.datetime) AS StartTime, " + + "CONCAT(dss_stop.latitude, ', ', dss_stop.longitude) AS EndPoint, " + + "Date(dss_stop.datetime) AS EndTime " + + + "FROM location_mapping lm " + + "INNER JOIN driver_login dl ON dl.loginid = lm.driverid " + + + "LEFT JOIN driver_start_stop dss_start " + + "ON dss_start.loginid = lm.driverid " + + "AND dss_start.action = 'Start' " + + + "LEFT JOIN driver_start_stop dss_stop " + + "ON dss_stop.loginid = lm.driverid " + + "AND dss_stop.action = 'Stop' " + + "AND dss_stop.startid = dss_start.locationid " + + + "WHERE DATE(dss_start.datetime) = ?"; + + return jdbcTemplate.queryForList(sql, date); + } + + // yogi + public List> getAbstractReport(String date) { + + String sql = """ + SELECT * FROM ( + + SELECT + + sm.name AS shift_name, + sm.Code as shift_code, + sm.shiftid as shiftid, + IFNULL(SUM(gru.total_food_requested), 0) AS food_requested, + IFNULL(SUM(gru.total_food_received), 0) AS food_delivered, + IFNULL(SUM(dr.nulm + dr.private + dr.permanent), 0) AS overall_count, + IFNULL(SUM(dr.nulm + dr.private + dr.permanent), 0) AS present_count, + IFNULL(SUM(gru.today_absentees_nulm + gru.today_absentees_private + gru.today_absentees_permanent), 0) AS unplanned_count, + IFNULL(SUM(dr.absentees_nulm + dr.absentees_private + dr.absentees_permanent), 0) AS absent_count, + IFNULL(SUM(gru.total_box_shortfall), 0) AS food_shortfall + FROM shift_master sm + LEFT JOIN daily_request dr + ON sm.shiftid = dr.shiftid AND dr.required_date = ? + LEFT JOIN gcc_received_update gru + ON gru.requestid = dr.requestid + GROUP BY sm.shiftid, sm.name + + UNION ALL + + SELECT + 'Total' AS shift_name, + 'TOTAL' AS shift_code, + 'TOTAL' as shift_id, + IFNULL(SUM(gru.total_food_requested), 0), + IFNULL(SUM(gru.total_food_received), 0), + IFNULL(SUM(dr.nulm + dr.private + dr.permanent), 0), + IFNULL(SUM(dr.nulm + dr.private + dr.permanent), 0), + IFNULL(SUM(gru.today_absentees_nulm + gru.today_absentees_private + gru.today_absentees_permanent), 0), + IFNULL(SUM(dr.absentees_nulm + dr.absentees_private + dr.absentees_permanent), 0), + IFNULL(SUM(gru.total_box_shortfall), 0) + FROM shift_master sm + LEFT JOIN daily_request dr + ON sm.shiftid = dr.shiftid AND dr.required_date = ? + LEFT JOIN gcc_received_update gru + ON gru.requestid = dr.requestid + ) AS final_result + """; + + return jdbcTemplate.queryForList(sql, date, date); + } + + // yogi + public List> getZoneWiseShiftBasedReport(String date, int shiftId) { + + String sql = """ + SELECT * + FROM ( + + /* ==================== 1. ZONE-WISE SUMMARY ===================== */ + SELECT + z.zone, + + /* FOOD REQUESTED */ + ( + SELECT IFNULL(SUM(gru.total_food_requested), 0) + FROM gcc_received_update gru + WHERE gru.shiftid = ? + AND gru.received_by IN ( + SELECT siloginid FROM location_mapping WHERE zone = z.zone + ) + AND gru.requestid IN ( + SELECT requestid FROM daily_request WHERE required_date = ? + ) + ) AS food_requested, + + /* FOOD DELIVERED */ + ( + SELECT IFNULL(SUM(gru.total_food_received), 0) + FROM gcc_received_update gru + WHERE gru.shiftid = ? + AND gru.received_by IN ( + SELECT siloginid FROM location_mapping WHERE zone = z.zone + ) + AND gru.requestid IN ( + SELECT requestid FROM daily_request WHERE required_date = ? + ) + ) AS food_delivered, + + /* PRESENT */ + ( + SELECT IFNULL(SUM(dr.nulm + dr.private + dr.permanent), 0) + FROM daily_request dr + WHERE dr.required_date = ? + AND dr.shiftid = ? + AND dr.request_by IN ( + SELECT siloginid FROM location_mapping WHERE zone = z.zone + ) + ) AS present_count, + + /* ABSENT */ + ( + SELECT IFNULL(SUM(dr.absentees_nulm + dr.absentees_private + dr.absentees_permanent), 0) + FROM daily_request dr + WHERE dr.required_date = ? + AND dr.shiftid = ? + AND dr.request_by IN ( + SELECT siloginid FROM location_mapping WHERE zone = z.zone + ) + ) AS absent_count, + + /* UNPLANNED */ + ( + SELECT IFNULL(SUM(gru.today_absentees_nulm + + gru.today_absentees_private + + gru.today_absentees_permanent), 0) + FROM gcc_received_update gru + WHERE gru.shiftid = ? + AND gru.requestid IN ( + SELECT requestid FROM daily_request WHERE required_date = ? + ) + AND gru.received_by IN ( + SELECT siloginid FROM location_mapping WHERE zone = z.zone + ) + ) AS unplanned_count, + + /* FOOD SHORTFALL */ + ( + SELECT IFNULL(SUM(gru.total_box_shortfall), 0) + FROM gcc_received_update gru + WHERE gru.shiftid = ? + AND gru.received_by IN ( + SELECT siloginid FROM location_mapping WHERE zone = z.zone + ) + AND gru.requestid IN ( + SELECT requestid FROM daily_request WHERE required_date = ? + ) + ) AS food_shortfall + + FROM ( + SELECT DISTINCT zone + FROM location_mapping + WHERE zone IS NOT NULL + ) z + + + UNION ALL + + /* ==================== 2. GRAND TOTAL ===================== */ + SELECT + 'TOTAL' AS zone, + + (SELECT IFNULL(SUM(total_food_requested), 0) + FROM gcc_received_update + WHERE shiftid = ? + AND requestid IN (SELECT requestid FROM daily_request WHERE required_date = ?) + ) AS food_requested, + + (SELECT IFNULL(SUM(total_food_received), 0) + FROM gcc_received_update + WHERE shiftid = ? + AND requestid IN (SELECT requestid FROM daily_request WHERE required_date = ?) + ) AS food_delivered, + + (SELECT IFNULL(SUM(nulm + private + permanent), 0) + FROM daily_request + WHERE required_date = ? AND shiftid = ? + ) AS present_count, + + (SELECT IFNULL(SUM(absentees_nulm + absentees_private + absentees_permanent), 0) + FROM daily_request + WHERE required_date = ? AND shiftid = ? + ) AS absent_count, + + (SELECT IFNULL(SUM(today_absentees_nulm + + today_absentees_private + + today_absentees_permanent), 0) + FROM gcc_received_update + WHERE shiftid = ? + AND requestid IN (SELECT requestid FROM daily_request WHERE required_date = ?) + ) AS unplanned_count, + + (SELECT IFNULL(SUM(total_box_shortfall), 0) + FROM gcc_received_update + WHERE shiftid = ? + AND requestid IN (SELECT requestid FROM daily_request WHERE required_date = ?) + ) AS food_shortfall + + ) AS final_output + + ORDER BY + CASE WHEN zone = 'TOTAL' THEN 1 ELSE 0 END, + CAST(zone AS UNSIGNED); + """; + + // parameters repeated in correct order + return jdbcTemplate.queryForList(sql, + shiftId, date, + shiftId, date, + date, shiftId, + date, shiftId, + shiftId, date, + shiftId, date, + + /* total section */ + shiftId, date, + shiftId, date, + date, shiftId, + date, shiftId, + shiftId, date, + shiftId, date); + } + + // yogi + public List> getWardLocationWiseReport(String date) { + + String sql = "SELECT ward, location, food_requested, food_delivered, present_count, absent_count, unplanned_count, food_shortfall " + + + "FROM (" + + " SELECT lm.driverid, lm.ward, lm.location, " + + " (SELECT IFNULL(SUM(gru.total_food_requested),0) FROM gcc_received_update gru " + + " WHERE gru.received_by IN (SELECT siloginid FROM location_mapping WHERE ward=lm.ward AND location=lm.location) " + + + " AND gru.requestid IN (SELECT requestid FROM daily_request WHERE required_date = ?)) AS food_requested, " + + + " (SELECT IFNULL(SUM(gru.total_food_received),0) FROM gcc_received_update gru " + + " WHERE gru.received_by IN (SELECT siloginid FROM location_mapping WHERE ward=lm.ward AND location=lm.location) " + + + " AND gru.requestid IN (SELECT requestid FROM daily_request WHERE required_date = ?)) AS food_delivered, " + + + " (SELECT IFNULL(SUM(dr.nulm + dr.private + dr.permanent),0) FROM daily_request dr " + + " WHERE dr.required_date = ? " + + " AND dr.request_by IN (SELECT siloginid FROM location_mapping WHERE ward=lm.ward AND location=lm.location)) AS present_count, " + + + " (SELECT IFNULL(SUM(dr.absentees_nulm + dr.absentees_private + dr.absentees_permanent),0) FROM daily_request dr " + + + " WHERE dr.required_date = ? " + + " AND dr.request_by IN (SELECT siloginid FROM location_mapping WHERE ward=lm.ward AND location=lm.location)) AS absent_count, " + + + " (SELECT IFNULL(SUM(gru.today_absentees_nulm + gru.today_absentees_private + gru.today_absentees_permanent),0) FROM gcc_received_update gru " + + + " WHERE gru.requestid IN (SELECT requestid FROM daily_request WHERE required_date = ?) " + + " AND gru.received_by IN (SELECT siloginid FROM location_mapping WHERE ward=lm.ward AND location=lm.location)) AS unplanned_count, " + + + " (SELECT IFNULL(SUM(gru.total_box_shortfall),0) FROM gcc_received_update gru " + + " WHERE gru.received_by IN (SELECT siloginid FROM location_mapping WHERE ward=lm.ward AND location=lm.location) " + + + " AND gru.requestid IN (SELECT requestid FROM daily_request WHERE required_date = ?)) AS food_shortfall " + + + " FROM location_mapping lm " + + " WHERE lm.ward IS NOT NULL AND lm.location IS NOT NULL " + + " GROUP BY lm.driverid, lm.ward, lm.location " + + " UNION ALL " + + " SELECT 999999 AS driverid, 'TOTAL' AS ward, 'TOTAL' AS location, " + + " (SELECT IFNULL(SUM(total_food_requested),0) FROM gcc_received_update WHERE requestid IN (SELECT requestid FROM daily_request WHERE required_date = ?)), " + + + " (SELECT IFNULL(SUM(total_food_received),0) FROM gcc_received_update WHERE requestid IN (SELECT requestid FROM daily_request WHERE required_date = ?)), " + + + " (SELECT IFNULL(SUM(nulm + private + permanent),0) FROM daily_request WHERE required_date = ?), " + + + " (SELECT IFNULL(SUM(absentees_nulm + absentees_private + absentees_permanent),0) FROM daily_request WHERE required_date = ?), " + + + " (SELECT IFNULL(SUM(today_absentees_nulm + today_absentees_private + today_absentees_permanent),0) FROM gcc_received_update WHERE requestid IN (SELECT requestid FROM daily_request WHERE required_date = ?)), " + + + " (SELECT IFNULL(SUM(total_box_shortfall),0) FROM gcc_received_update WHERE requestid IN (SELECT requestid FROM daily_request WHERE required_date = ?)) " + + + ") AS final_output " + + "ORDER BY driverid ASC"; + + return jdbcTemplate.queryForList(sql, date, date, date, date, date, date, date, date, date, date, date, date); + } + +} +/* + * String sql = "SELECT lm.location AS LocationDescription, "+ + * "dl.username AS DriverName, "+ + * " CONCAT('" + * +fileBaseUrl+"/gccofficialapp/files',dss_start.image) as upload_image_url, "+ + * " CONCAT(dss_start.latitude, ', ', dss_start.longitude) AS StartPoint, "+ + * "Date(dss_start.datetime) AS StartTime, "+ + * + * " CONCAT(dss_stop.latitude, ', ', dss_stop.longitude) AS EndPoint, "+ + * Date(dss_stop.datetime) AS EndTime + * + * FROM location_mapping lm + * INNER JOIN driver_login dl + * ON dl.loginid = lm.driverid + * + * LEFT JOIN driver_start_stop dss_start + * ON dss_start.loginid = lm.driverid + * AND dss_start.action = 'Start' + * + * + * LEFT JOIN driver_start_stop dss_stop + * ON dss_stop.loginid = lm.driverid + * AND dss_stop.action = 'Stop' + * AND dss_stop.startid = dss_start.locationid + * WHERE DATE(dss_start.datetime) = ?"; + * change for full query + */ \ No newline at end of file diff --git a/src/main/resources/application-dev.properties b/src/main/resources/application-dev.properties index 36b2f7d..3fc6833 100644 --- a/src/main/resources/application-dev.properties +++ b/src/main/resources/application-dev.properties @@ -13,6 +13,4 @@ server.port=8078 #secondary.datasource.username=FAS #secondary.datasource.password=FAS #secondary.datasource.driver-class-name=oracle.jdbc.OracleDriver - - - +fileBaseUrl=https://gccservices.in \ No newline at end of file diff --git a/src/main/resources/templates/modules/food_scheme/driverreport.html b/src/main/resources/templates/modules/food_scheme/driverreport.html new file mode 100644 index 0000000..c7bdf0c --- /dev/null +++ b/src/main/resources/templates/modules/food_scheme/driverreport.html @@ -0,0 +1,348 @@ + + + + + Food Scheme Operations Dashboard + + + + + + + + + + + + + + +
+

Food Scheme Report

+
+ + + +
+
+ +
+
Driver Logistics Report
+ +
+ + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/templates/modules/food_scheme/feedbackreport.html b/src/main/resources/templates/modules/food_scheme/feedbackreport.html new file mode 100644 index 0000000..601b67e --- /dev/null +++ b/src/main/resources/templates/modules/food_scheme/feedbackreport.html @@ -0,0 +1,184 @@ + + + + + Feedback Summary Report + + + + + + + + + + + + + +
+

Food Scheme – Feedback Summary

+
+ +
+
+ +
+ +
Feedback Questions Summary
+ +
+ + +
+ +
+ + + + + + + + + + + + +
QuestionYes CountNo Count
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/resources/templates/modules/food_scheme/foodschemereport.html b/src/main/resources/templates/modules/food_scheme/foodschemereport.html new file mode 100644 index 0000000..b15ba33 --- /dev/null +++ b/src/main/resources/templates/modules/food_scheme/foodschemereport.html @@ -0,0 +1,1075 @@ + + + + + + + + Food Scheme Operations Dashboard + + + + + + + + + + + + + + +
+

Food Scheme Report

+
+ + + +
+
+
Food Scheme
+ +
+ + + + + + + +
+ + +
+ + + + + + + + + + + + + + + + +
ShiftFood RequestedFood DeliveredOverall PresentPresent CountAbsent CountFood Shortfall
+
+
+ + + +
+
+
Shift A Daily Food Menu
+ + + + + + + + + + + + + + + + + + + + + + + + + +
SundayMondayTuesdayWednesdayThursdayFridaySaturday
Semiya Kitchadi (500g) & Sambar (250g)Idly (6*50g), Medhu Vadai (50g) & Sambar(250 g)Rava Kitchadi(500g) & Red Chutney (100g)Veg Biryani (500g) & Brinjal Onion (75g)Pongal (500g) & Sambar (250g)Rava Upma (500g) & Mint/Coriander Cocunut Chutney (100g)Rava Pongal (500g) & sambar (250g)
+ +
+
+ + + + + + + + + +
+
+ + +
+
+
Zone wise Logistics Overallview
+ +
+ + + + + + + + + + + + +
zonePresent CountAbsent CountFood RequestedFood DeliveredFood Shortfall
+
+
+ + + +
+
+
+
Zone wise Logistics Overview
+ +
+ + +
+
+ + + + + + + + + + + + +
LocationsPresent CountAbsent CountFood RequestedFood DeliveredFood Shortfall
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file