@@ -0,0 +1,23 @@ | |||||
2023-11-22 16:34:54.722 [background-preinit] INFO o.h.validator.internal.util.Version -HV000001: Hibernate Validator 6.2.4.Final | |||||
2023-11-22 16:34:54.736 [main] INFO c.n.kqapi.menu.DuplicationTest -Starting DuplicationTest using Java 1.8.0_131 on LAPTOP-NQGEQP03 with PID 7560 (started by PoffyZhang in D:\ningda\kq-value-added-project\kqapi) | |||||
2023-11-22 16:34:54.736 [main] INFO c.n.kqapi.menu.DuplicationTest -The following 1 profile is active: "dev" | |||||
2023-11-22 16:34:57.112 [main] INFO o.s.b.w.e.tomcat.TomcatWebServer -Tomcat initialized with port(s): 0 (http) | |||||
2023-11-22 16:34:57.123 [main] INFO o.a.coyote.http11.Http11NioProtocol -Initializing ProtocolHandler ["http-nio-auto-1"] | |||||
2023-11-22 16:34:57.124 [main] INFO o.a.catalina.core.StandardService -Starting service [Tomcat] | |||||
2023-11-22 16:34:57.124 [main] INFO o.a.catalina.core.StandardEngine -Starting Servlet engine: [Apache Tomcat/9.0.65] | |||||
2023-11-22 16:34:57.241 [main] INFO o.a.c.c.C.[Tomcat].[localhost].[/kq] -Initializing Spring embedded WebApplicationContext | |||||
2023-11-22 16:34:57.241 [main] INFO o.s.b.w.s.c.ServletWebServerApplicationContext -Root WebApplicationContext: initialization completed in 2454 ms | |||||
2023-11-22 16:34:59.543 [main] INFO com.ningdatech.swagger.SwaggerConfig -swagger文档加载…… | |||||
2023-11-22 16:35:00.675 [main] INFO c.n.kqapi.common.config.BeanConfig ------restTemplate-----初始化完成 | |||||
2023-11-22 16:35:01.087 [main] INFO s.d.s.w.WebMvcPropertySourcedRequestMappingHandlerMapping -Mapped URL path [/v2/api-docs] onto method [springfox.documentation.swagger2.web.Swagger2ControllerWebMvc#getDocumentation(String, HttpServletRequest)] | |||||
2023-11-22 16:35:01.309 [main] WARN o.s.b.a.f.FreeMarkerAutoConfiguration -Cannot find template location(s): [classpath:/templates/] (please add some templates, check your FreeMarker configuration, or set spring.freemarker.checkTemplateLocation=false) | |||||
2023-11-22 16:35:01.562 [main] INFO o.a.coyote.http11.Http11NioProtocol -Starting ProtocolHandler ["http-nio-auto-1"] | |||||
2023-11-22 16:35:01.588 [main] INFO o.s.b.w.e.tomcat.TomcatWebServer -Tomcat started on port(s): 32509 (http) with context path '/kq' | |||||
2023-11-22 16:35:01.589 [main] INFO s.d.s.w.p.DocumentationPluginsBootstrapper -Documentation plugins bootstrapped | |||||
2023-11-22 16:35:01.592 [main] INFO s.d.s.w.p.DocumentationPluginsBootstrapper -Found 1 custom documentation plugin(s) | |||||
2023-11-22 16:35:01.629 [main] INFO s.d.s.w.s.ApiListingReferenceScanner -Scanning for api listing references | |||||
2023-11-22 16:35:01.772 [main] INFO c.n.kqapi.menu.DuplicationTest -Started DuplicationTest in 7.554 seconds (JVM running for 8.94) | |||||
2023-11-22 16:35:02.189 [main] INFO com.zaxxer.hikari.HikariDataSource -HikariPool-1 - Starting... | |||||
2023-11-22 16:35:02.677 [main] INFO com.zaxxer.hikari.HikariDataSource -HikariPool-1 - Start completed. | |||||
2023-11-22 16:35:46.625 [SpringApplicationShutdownHook] INFO com.zaxxer.hikari.HikariDataSource -HikariPool-1 - Shutdown initiated... | |||||
2023-11-22 16:35:46.634 [SpringApplicationShutdownHook] INFO com.zaxxer.hikari.HikariDataSource -HikariPool-1 - Shutdown completed. |
@@ -1,23 +1,80 @@ | |||||
2023-11-22 16:34:54.722 [background-preinit] INFO o.h.validator.internal.util.Version -HV000001: Hibernate Validator 6.2.4.Final | |||||
2023-11-22 16:34:54.736 [main] INFO c.n.kqapi.menu.DuplicationTest -Starting DuplicationTest using Java 1.8.0_131 on LAPTOP-NQGEQP03 with PID 7560 (started by PoffyZhang in D:\ningda\kq-value-added-project\kqapi) | |||||
2023-11-22 16:34:54.736 [main] INFO c.n.kqapi.menu.DuplicationTest -The following 1 profile is active: "dev" | |||||
2023-11-22 16:34:57.112 [main] INFO o.s.b.w.e.tomcat.TomcatWebServer -Tomcat initialized with port(s): 0 (http) | |||||
2023-11-22 16:34:57.123 [main] INFO o.a.coyote.http11.Http11NioProtocol -Initializing ProtocolHandler ["http-nio-auto-1"] | |||||
2023-11-22 16:34:57.124 [main] INFO o.a.catalina.core.StandardService -Starting service [Tomcat] | |||||
2023-11-22 16:34:57.124 [main] INFO o.a.catalina.core.StandardEngine -Starting Servlet engine: [Apache Tomcat/9.0.65] | |||||
2023-11-22 16:34:57.241 [main] INFO o.a.c.c.C.[Tomcat].[localhost].[/kq] -Initializing Spring embedded WebApplicationContext | |||||
2023-11-22 16:34:57.241 [main] INFO o.s.b.w.s.c.ServletWebServerApplicationContext -Root WebApplicationContext: initialization completed in 2454 ms | |||||
2023-11-22 16:34:59.543 [main] INFO com.ningdatech.swagger.SwaggerConfig -swagger文档加载…… | |||||
2023-11-22 16:35:00.675 [main] INFO c.n.kqapi.common.config.BeanConfig ------restTemplate-----初始化完成 | |||||
2023-11-22 16:35:01.087 [main] INFO s.d.s.w.WebMvcPropertySourcedRequestMappingHandlerMapping -Mapped URL path [/v2/api-docs] onto method [springfox.documentation.swagger2.web.Swagger2ControllerWebMvc#getDocumentation(String, HttpServletRequest)] | |||||
2023-11-22 16:35:01.309 [main] WARN o.s.b.a.f.FreeMarkerAutoConfiguration -Cannot find template location(s): [classpath:/templates/] (please add some templates, check your FreeMarker configuration, or set spring.freemarker.checkTemplateLocation=false) | |||||
2023-11-22 16:35:01.562 [main] INFO o.a.coyote.http11.Http11NioProtocol -Starting ProtocolHandler ["http-nio-auto-1"] | |||||
2023-11-22 16:35:01.588 [main] INFO o.s.b.w.e.tomcat.TomcatWebServer -Tomcat started on port(s): 32509 (http) with context path '/kq' | |||||
2023-11-22 16:35:01.589 [main] INFO s.d.s.w.p.DocumentationPluginsBootstrapper -Documentation plugins bootstrapped | |||||
2023-11-22 16:35:01.592 [main] INFO s.d.s.w.p.DocumentationPluginsBootstrapper -Found 1 custom documentation plugin(s) | |||||
2023-11-22 16:35:01.629 [main] INFO s.d.s.w.s.ApiListingReferenceScanner -Scanning for api listing references | |||||
2023-11-22 16:35:01.772 [main] INFO c.n.kqapi.menu.DuplicationTest -Started DuplicationTest in 7.554 seconds (JVM running for 8.94) | |||||
2023-11-22 16:35:02.189 [main] INFO com.zaxxer.hikari.HikariDataSource -HikariPool-1 - Starting... | |||||
2023-11-22 16:35:02.677 [main] INFO com.zaxxer.hikari.HikariDataSource -HikariPool-1 - Start completed. | |||||
2023-11-22 16:35:46.625 [SpringApplicationShutdownHook] INFO com.zaxxer.hikari.HikariDataSource -HikariPool-1 - Shutdown initiated... | |||||
2023-11-22 16:35:46.634 [SpringApplicationShutdownHook] INFO com.zaxxer.hikari.HikariDataSource -HikariPool-1 - Shutdown completed. | |||||
2024-04-07 11:40:43.103 [background-preinit] INFO o.h.validator.internal.util.Version -HV000001: Hibernate Validator 6.2.4.Final | |||||
2024-04-07 11:40:43.116 [main] INFO com.ningdatech.kqapi.menu.MenuTest -Starting MenuTest using Java 1.8.0_131 on LAPTOP-NQGEQP03 with PID 27140 (started by PoffyZhang in D:\ningda\kq-value-added-project\kqapi) | |||||
2024-04-07 11:40:43.117 [main] INFO com.ningdatech.kqapi.menu.MenuTest -The following 1 profile is active: "prod" | |||||
2024-04-07 11:40:44.149 [main] INFO c.u.j.c.EnableEncryptablePropertiesBeanFactoryPostProcessor -Post-processing PropertySource instances | |||||
2024-04-07 11:40:44.150 [main] INFO c.u.j.EncryptablePropertySourceConverter -Skipping PropertySource configurationProperties [class org.springframework.boot.context.properties.source.ConfigurationPropertySourcesPropertySource | |||||
2024-04-07 11:40:44.153 [main] INFO c.u.j.EncryptablePropertySourceConverter -Converting PropertySource test [org.springframework.core.env.MapPropertySource] to EncryptableMapPropertySourceWrapper | |||||
2024-04-07 11:40:44.153 [main] INFO c.u.j.EncryptablePropertySourceConverter -Converting PropertySource Inlined Test Properties [org.springframework.core.env.MapPropertySource] to EncryptableMapPropertySourceWrapper | |||||
2024-04-07 11:40:44.153 [main] INFO c.u.j.EncryptablePropertySourceConverter -Skipping PropertySource servletConfigInitParams [class org.springframework.core.env.PropertySource$StubPropertySource | |||||
2024-04-07 11:40:44.153 [main] INFO c.u.j.EncryptablePropertySourceConverter -Skipping PropertySource servletContextInitParams [class org.springframework.core.env.PropertySource$StubPropertySource | |||||
2024-04-07 11:40:44.153 [main] INFO c.u.j.EncryptablePropertySourceConverter -Converting PropertySource systemProperties [org.springframework.core.env.PropertiesPropertySource] to EncryptableMapPropertySourceWrapper | |||||
2024-04-07 11:40:44.154 [main] INFO c.u.j.EncryptablePropertySourceConverter -Converting PropertySource systemEnvironment [org.springframework.boot.env.SystemEnvironmentPropertySourceEnvironmentPostProcessor$OriginAwareSystemEnvironmentPropertySource] to EncryptableSystemEnvironmentPropertySourceWrapper | |||||
2024-04-07 11:40:44.154 [main] INFO c.u.j.EncryptablePropertySourceConverter -Converting PropertySource random [org.springframework.boot.env.RandomValuePropertySource] to EncryptablePropertySourceWrapper | |||||
2024-04-07 11:40:44.154 [main] INFO c.u.j.EncryptablePropertySourceConverter -Converting PropertySource Config resource 'class path resource [application-prod.yml]' via location 'optional:classpath:/' [org.springframework.boot.env.OriginTrackedMapPropertySource] to EncryptableMapPropertySourceWrapper | |||||
2024-04-07 11:40:44.154 [main] INFO c.u.j.EncryptablePropertySourceConverter -Converting PropertySource Config resource 'class path resource [application.yml]' via location 'optional:classpath:/' [org.springframework.boot.env.OriginTrackedMapPropertySource] to EncryptableMapPropertySourceWrapper | |||||
2024-04-07 11:40:44.439 [main] INFO c.u.j.f.DefaultLazyPropertyFilter -Property Filter custom Bean not found with name 'encryptablePropertyFilter'. Initializing Default Property Filter | |||||
2024-04-07 11:40:44.449 [main] INFO c.u.j.r.DefaultLazyPropertyResolver -Property Resolver custom Bean not found with name 'encryptablePropertyResolver'. Initializing Default Property Resolver | |||||
2024-04-07 11:40:44.453 [main] INFO c.u.j.d.DefaultLazyPropertyDetector -Property Detector custom Bean not found with name 'encryptablePropertyDetector'. Initializing Default Property Detector | |||||
2024-04-07 11:40:45.294 [main] INFO o.s.b.w.e.tomcat.TomcatWebServer -Tomcat initialized with port(s): 0 (http) | |||||
2024-04-07 11:40:45.306 [main] INFO o.a.coyote.http11.Http11NioProtocol -Initializing ProtocolHandler ["http-nio-auto-1"] | |||||
2024-04-07 11:40:45.307 [main] INFO o.a.catalina.core.StandardService -Starting service [Tomcat] | |||||
2024-04-07 11:40:45.307 [main] INFO o.a.catalina.core.StandardEngine -Starting Servlet engine: [Apache Tomcat/9.0.65] | |||||
2024-04-07 11:40:45.441 [main] INFO o.a.c.c.C.[Tomcat].[localhost].[/kq] -Initializing Spring embedded WebApplicationContext | |||||
2024-04-07 11:40:45.442 [main] INFO o.s.b.w.s.c.ServletWebServerApplicationContext -Root WebApplicationContext: initialization completed in 2275 ms | |||||
2024-04-07 11:40:47.784 [main] INFO c.n.kqapi.common.config.BeanConfig ------restTemplate-----初始化完成 | |||||
2024-04-07 11:40:48.621 [main] WARN o.s.b.a.f.FreeMarkerAutoConfiguration -Cannot find template location(s): [classpath:/templates/] (please add some templates, check your FreeMarker configuration, or set spring.freemarker.checkTemplateLocation=false) | |||||
2024-04-07 11:40:48.832 [main] INFO o.a.coyote.http11.Http11NioProtocol -Starting ProtocolHandler ["http-nio-auto-1"] | |||||
2024-04-07 11:40:48.855 [main] INFO o.s.b.w.e.tomcat.TomcatWebServer -Tomcat started on port(s): 9629 (http) with context path '/kq' | |||||
2024-04-07 11:40:48.856 [main] INFO c.u.j.c.RefreshScopeRefreshedEventListener -Refreshing cached encryptable property sources on ServletWebServerInitializedEvent | |||||
2024-04-07 11:40:48.856 [main] INFO c.u.j.c.CachingDelegateEncryptablePropertySource -Property Source test refreshed | |||||
2024-04-07 11:40:48.857 [main] INFO c.u.j.c.CachingDelegateEncryptablePropertySource -Property Source Inlined Test Properties refreshed | |||||
2024-04-07 11:40:48.857 [main] INFO c.u.j.c.CachingDelegateEncryptablePropertySource -Property Source systemProperties refreshed | |||||
2024-04-07 11:40:48.857 [main] INFO c.u.j.c.CachingDelegateEncryptablePropertySource -Property Source systemEnvironment refreshed | |||||
2024-04-07 11:40:48.857 [main] INFO c.u.j.c.CachingDelegateEncryptablePropertySource -Property Source random refreshed | |||||
2024-04-07 11:40:48.857 [main] INFO c.u.j.c.CachingDelegateEncryptablePropertySource -Property Source Config resource 'class path resource [application-prod.yml]' via location 'optional:classpath:/' refreshed | |||||
2024-04-07 11:40:48.857 [main] INFO c.u.j.c.CachingDelegateEncryptablePropertySource -Property Source Config resource 'class path resource [application.yml]' via location 'optional:classpath:/' refreshed | |||||
2024-04-07 11:40:48.857 [main] INFO c.u.j.EncryptablePropertySourceConverter -Converting PropertySource server.ports [org.springframework.core.env.MapPropertySource] to EncryptableMapPropertySourceWrapper | |||||
2024-04-07 11:40:48.857 [main] INFO c.u.j.EncryptablePropertySourceConverter -Skipping PropertySource configurationProperties [class org.springframework.boot.context.properties.source.ConfigurationPropertySourcesPropertySource | |||||
2024-04-07 11:40:48.857 [main] INFO c.u.j.EncryptablePropertySourceConverter -Skipping PropertySource servletConfigInitParams [class org.springframework.core.env.PropertySource$StubPropertySource | |||||
2024-04-07 11:40:48.857 [main] INFO c.u.j.EncryptablePropertySourceConverter -Converting PropertySource servletContextInitParams [org.springframework.web.context.support.ServletContextPropertySource] to EncryptableEnumerablePropertySourceWrapper | |||||
2024-04-07 11:40:48.869 [main] INFO com.ningdatech.kqapi.menu.MenuTest -Started MenuTest in 6.275 seconds (JVM running for 7.573) | |||||
2024-04-07 13:43:39.929 [background-preinit] INFO o.h.validator.internal.util.Version -HV000001: Hibernate Validator 6.2.4.Final | |||||
2024-04-07 13:43:39.939 [main] INFO com.ningdatech.kqapi.menu.MenuTest -Starting MenuTest using Java 1.8.0_131 on LAPTOP-NQGEQP03 with PID 13556 (started by PoffyZhang in D:\ningda\kq-value-added-project\kqapi) | |||||
2024-04-07 13:43:39.939 [main] INFO com.ningdatech.kqapi.menu.MenuTest -The following 1 profile is active: "prod" | |||||
2024-04-07 13:43:40.838 [main] INFO c.u.j.c.EnableEncryptablePropertiesBeanFactoryPostProcessor -Post-processing PropertySource instances | |||||
2024-04-07 13:43:40.839 [main] INFO c.u.j.EncryptablePropertySourceConverter -Skipping PropertySource configurationProperties [class org.springframework.boot.context.properties.source.ConfigurationPropertySourcesPropertySource | |||||
2024-04-07 13:43:40.841 [main] INFO c.u.j.EncryptablePropertySourceConverter -Converting PropertySource test [org.springframework.core.env.MapPropertySource] to EncryptableMapPropertySourceWrapper | |||||
2024-04-07 13:43:40.841 [main] INFO c.u.j.EncryptablePropertySourceConverter -Converting PropertySource Inlined Test Properties [org.springframework.core.env.MapPropertySource] to EncryptableMapPropertySourceWrapper | |||||
2024-04-07 13:43:40.841 [main] INFO c.u.j.EncryptablePropertySourceConverter -Skipping PropertySource servletConfigInitParams [class org.springframework.core.env.PropertySource$StubPropertySource | |||||
2024-04-07 13:43:40.841 [main] INFO c.u.j.EncryptablePropertySourceConverter -Skipping PropertySource servletContextInitParams [class org.springframework.core.env.PropertySource$StubPropertySource | |||||
2024-04-07 13:43:40.842 [main] INFO c.u.j.EncryptablePropertySourceConverter -Converting PropertySource systemProperties [org.springframework.core.env.PropertiesPropertySource] to EncryptableMapPropertySourceWrapper | |||||
2024-04-07 13:43:40.842 [main] INFO c.u.j.EncryptablePropertySourceConverter -Converting PropertySource systemEnvironment [org.springframework.boot.env.SystemEnvironmentPropertySourceEnvironmentPostProcessor$OriginAwareSystemEnvironmentPropertySource] to EncryptableSystemEnvironmentPropertySourceWrapper | |||||
2024-04-07 13:43:40.842 [main] INFO c.u.j.EncryptablePropertySourceConverter -Converting PropertySource random [org.springframework.boot.env.RandomValuePropertySource] to EncryptablePropertySourceWrapper | |||||
2024-04-07 13:43:40.842 [main] INFO c.u.j.EncryptablePropertySourceConverter -Converting PropertySource Config resource 'class path resource [application-prod.yml]' via location 'optional:classpath:/' [org.springframework.boot.env.OriginTrackedMapPropertySource] to EncryptableMapPropertySourceWrapper | |||||
2024-04-07 13:43:40.842 [main] INFO c.u.j.EncryptablePropertySourceConverter -Converting PropertySource Config resource 'class path resource [application.yml]' via location 'optional:classpath:/' [org.springframework.boot.env.OriginTrackedMapPropertySource] to EncryptableMapPropertySourceWrapper | |||||
2024-04-07 13:43:41.106 [main] INFO c.u.j.f.DefaultLazyPropertyFilter -Property Filter custom Bean not found with name 'encryptablePropertyFilter'. Initializing Default Property Filter | |||||
2024-04-07 13:43:41.116 [main] INFO c.u.j.r.DefaultLazyPropertyResolver -Property Resolver custom Bean not found with name 'encryptablePropertyResolver'. Initializing Default Property Resolver | |||||
2024-04-07 13:43:41.119 [main] INFO c.u.j.d.DefaultLazyPropertyDetector -Property Detector custom Bean not found with name 'encryptablePropertyDetector'. Initializing Default Property Detector | |||||
2024-04-07 13:43:41.994 [main] INFO o.s.b.w.e.tomcat.TomcatWebServer -Tomcat initialized with port(s): 0 (http) | |||||
2024-04-07 13:43:42.006 [main] INFO o.a.coyote.http11.Http11NioProtocol -Initializing ProtocolHandler ["http-nio-auto-1"] | |||||
2024-04-07 13:43:42.006 [main] INFO o.a.catalina.core.StandardService -Starting service [Tomcat] | |||||
2024-04-07 13:43:42.007 [main] INFO o.a.catalina.core.StandardEngine -Starting Servlet engine: [Apache Tomcat/9.0.65] | |||||
2024-04-07 13:43:42.143 [main] INFO o.a.c.c.C.[Tomcat].[localhost].[/kq] -Initializing Spring embedded WebApplicationContext | |||||
2024-04-07 13:43:42.143 [main] INFO o.s.b.w.s.c.ServletWebServerApplicationContext -Root WebApplicationContext: initialization completed in 2157 ms | |||||
2024-04-07 13:43:44.513 [main] INFO c.n.kqapi.common.config.BeanConfig ------restTemplate-----初始化完成 | |||||
2024-04-07 13:43:45.402 [main] WARN o.s.b.a.f.FreeMarkerAutoConfiguration -Cannot find template location(s): [classpath:/templates/] (please add some templates, check your FreeMarker configuration, or set spring.freemarker.checkTemplateLocation=false) | |||||
2024-04-07 13:43:45.676 [main] INFO o.a.coyote.http11.Http11NioProtocol -Starting ProtocolHandler ["http-nio-auto-1"] | |||||
2024-04-07 13:43:45.697 [main] INFO o.s.b.w.e.tomcat.TomcatWebServer -Tomcat started on port(s): 2307 (http) with context path '/kq' | |||||
2024-04-07 13:43:45.699 [main] INFO c.u.j.c.RefreshScopeRefreshedEventListener -Refreshing cached encryptable property sources on ServletWebServerInitializedEvent | |||||
2024-04-07 13:43:45.699 [main] INFO c.u.j.c.CachingDelegateEncryptablePropertySource -Property Source test refreshed | |||||
2024-04-07 13:43:45.699 [main] INFO c.u.j.c.CachingDelegateEncryptablePropertySource -Property Source Inlined Test Properties refreshed | |||||
2024-04-07 13:43:45.699 [main] INFO c.u.j.c.CachingDelegateEncryptablePropertySource -Property Source systemProperties refreshed | |||||
2024-04-07 13:43:45.699 [main] INFO c.u.j.c.CachingDelegateEncryptablePropertySource -Property Source systemEnvironment refreshed | |||||
2024-04-07 13:43:45.700 [main] INFO c.u.j.c.CachingDelegateEncryptablePropertySource -Property Source random refreshed | |||||
2024-04-07 13:43:45.700 [main] INFO c.u.j.c.CachingDelegateEncryptablePropertySource -Property Source Config resource 'class path resource [application-prod.yml]' via location 'optional:classpath:/' refreshed | |||||
2024-04-07 13:43:45.700 [main] INFO c.u.j.c.CachingDelegateEncryptablePropertySource -Property Source Config resource 'class path resource [application.yml]' via location 'optional:classpath:/' refreshed | |||||
2024-04-07 13:43:45.700 [main] INFO c.u.j.EncryptablePropertySourceConverter -Converting PropertySource server.ports [org.springframework.core.env.MapPropertySource] to EncryptableMapPropertySourceWrapper | |||||
2024-04-07 13:43:45.700 [main] INFO c.u.j.EncryptablePropertySourceConverter -Skipping PropertySource configurationProperties [class org.springframework.boot.context.properties.source.ConfigurationPropertySourcesPropertySource | |||||
2024-04-07 13:43:45.700 [main] INFO c.u.j.EncryptablePropertySourceConverter -Skipping PropertySource servletConfigInitParams [class org.springframework.core.env.PropertySource$StubPropertySource | |||||
2024-04-07 13:43:45.700 [main] INFO c.u.j.EncryptablePropertySourceConverter -Converting PropertySource servletContextInitParams [org.springframework.web.context.support.ServletContextPropertySource] to EncryptableEnumerablePropertySourceWrapper | |||||
2024-04-07 13:43:45.710 [main] INFO com.ningdatech.kqapi.menu.MenuTest -Started MenuTest in 6.296 seconds (JVM running for 7.144) |
@@ -15,4 +15,6 @@ public class ZzsfwMenuConstant { | |||||
public static final String MENU_TYPE_DEPARTMENT = "department"; | public static final String MENU_TYPE_DEPARTMENT = "department"; | ||||
public static final String MENU_TYPE_MATTER = "matter"; | public static final String MENU_TYPE_MATTER = "matter"; | ||||
public static final String MENU_ITEM_TYPE = "itemType"; | |||||
} | } |
@@ -1,5 +1,7 @@ | |||||
package com.ningdatech.kqapi.zzsfw.controller; | package com.ningdatech.kqapi.zzsfw.controller; | ||||
import cn.hutool.core.collection.CollUtil; | |||||
import com.ningdatech.kqapi.common.exception.BizException; | |||||
import com.ningdatech.kqapi.zzsfw.entity.dto.NdKqZzsfwMattersDeduplicateDTO; | import com.ningdatech.kqapi.zzsfw.entity.dto.NdKqZzsfwMattersDeduplicateDTO; | ||||
import com.ningdatech.kqapi.zzsfw.entity.dto.NdKqZzsfwMenuDTO; | import com.ningdatech.kqapi.zzsfw.entity.dto.NdKqZzsfwMenuDTO; | ||||
import com.ningdatech.kqapi.zzsfw.entity.vo.MatterTopVO; | import com.ningdatech.kqapi.zzsfw.entity.vo.MatterTopVO; | ||||
@@ -9,8 +11,11 @@ import lombok.RequiredArgsConstructor; | |||||
import lombok.extern.slf4j.Slf4j; | import lombok.extern.slf4j.Slf4j; | ||||
import org.springframework.validation.annotation.Validated; | import org.springframework.validation.annotation.Validated; | ||||
import org.springframework.web.bind.annotation.*; | import org.springframework.web.bind.annotation.*; | ||||
import org.springframework.web.multipart.MultipartFile; | |||||
import java.io.IOException; | |||||
import java.util.List; | import java.util.List; | ||||
import java.util.Objects; | |||||
/** | /** | ||||
* <p> | * <p> | ||||
@@ -57,4 +62,19 @@ public class NdKqZzsfwMenuController { | |||||
public String removeAllDup() { | public String removeAllDup() { | ||||
return matterManage.removeAllDup(); | return matterManage.removeAllDup(); | ||||
} | } | ||||
@PostMapping("/ddl") | |||||
public String ddl(@RequestParam("sql") String sql) throws IOException { | |||||
return matterManage.ddl(sql); | |||||
} | |||||
@PostMapping("/upload-menu") | |||||
public String uploadMenu(@RequestParam("file") MultipartFile[] file) throws IOException { | |||||
if (Objects.isNull(file) || file.length == 0) { | |||||
throw new BizException("文件为空!"); | |||||
} | |||||
return matterManage.uploadMenu(file[0]); | |||||
} | |||||
} | } | ||||
@@ -54,4 +54,16 @@ public class NdKqZzsfwMenu implements Serializable { | |||||
@ApiModelProperty("是否在政务中心查到url") | @ApiModelProperty("是否在政务中心查到url") | ||||
private Integer hasUrl; | private Integer hasUrl; | ||||
@ApiModelProperty("类型 1.政府服务 2.增值服务 3.特殊") | |||||
private Integer type; | |||||
@ApiModelProperty("服务内容") | |||||
private String serviceContent; | |||||
@ApiModelProperty("服务流程") | |||||
private String serviceProcess; | |||||
@ApiModelProperty("咨询电话") | |||||
private String telephone; | |||||
} | } |
@@ -31,4 +31,16 @@ public class MattersVO implements Serializable { | |||||
@ApiModelProperty("排序编号") | @ApiModelProperty("排序编号") | ||||
private Integer sort; | private Integer sort; | ||||
@ApiModelProperty("类型 1.政府服务 2.增值服务 3.特殊") | |||||
private Integer type; | |||||
@ApiModelProperty("服务内容") | |||||
private String serviceContent; | |||||
@ApiModelProperty("服务流程") | |||||
private String serviceProcess; | |||||
@ApiModelProperty("咨询电话") | |||||
private String telephone; | |||||
} | } |
@@ -36,6 +36,21 @@ public class TreeVO implements Serializable { | |||||
@ApiModelProperty("链接") | @ApiModelProperty("链接") | ||||
private Integer sort; | private Integer sort; | ||||
@ApiModelProperty("事项类型") | |||||
private Integer itemType; | |||||
@ApiModelProperty("事项类型") | |||||
private Integer itemTypeName; | |||||
@ApiModelProperty("服务内容") | |||||
private String serviceContent; | |||||
@ApiModelProperty("服务流程") | |||||
private String serviceProcess; | |||||
@ApiModelProperty("咨询电话") | |||||
private String telephone; | |||||
@ApiModelProperty("子级") | @ApiModelProperty("子级") | ||||
private List<TreeVO> chilren; | private List<TreeVO> chilren; | ||||
} | } |
@@ -0,0 +1,34 @@ | |||||
package com.ningdatech.kqapi.zzsfw.enumeration; | |||||
import lombok.AllArgsConstructor; | |||||
import lombok.Getter; | |||||
import lombok.NoArgsConstructor; | |||||
import java.util.Objects; | |||||
@Getter | |||||
@AllArgsConstructor | |||||
@NoArgsConstructor | |||||
public enum ItemTypeEnum { | |||||
/** | |||||
* 事项类型 枚举 | |||||
*/ | |||||
GOV(1,"政府服务"), | |||||
ADDED(2,"增值服务"), | |||||
SPECIAL(3,"特殊服务"); | |||||
private Integer code; | |||||
private String desc; | |||||
public static ItemTypeEnum match(Integer code) { | |||||
if (Objects.isNull(code)) { | |||||
return null; | |||||
} | |||||
for (ItemTypeEnum t : ItemTypeEnum.values()) { | |||||
if (code.equals(t.getCode())) { | |||||
return t; | |||||
} | |||||
} | |||||
return null; | |||||
} | |||||
} |
@@ -3,6 +3,7 @@ package com.ningdatech.kqapi.zzsfw.manage; | |||||
import cn.hutool.core.bean.BeanUtil; | import cn.hutool.core.bean.BeanUtil; | ||||
import cn.hutool.core.collection.CollUtil; | import cn.hutool.core.collection.CollUtil; | ||||
import cn.hutool.core.date.StopWatch; | import cn.hutool.core.date.StopWatch; | ||||
import cn.hutool.core.lang.Assert; | |||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | import com.baomidou.mybatisplus.core.toolkit.Wrappers; | ||||
import com.ningdatech.kqapi.common.enumeration.CommonEnum; | import com.ningdatech.kqapi.common.enumeration.CommonEnum; | ||||
import com.ningdatech.kqapi.common.helper.MatterCacheHelper; | import com.ningdatech.kqapi.common.helper.MatterCacheHelper; | ||||
@@ -13,13 +14,28 @@ import com.ningdatech.kqapi.zzsfw.entity.entity.NdKqZzsfwMattersDeduplicate; | |||||
import com.ningdatech.kqapi.zzsfw.entity.entity.NdKqZzsfwMenu; | import com.ningdatech.kqapi.zzsfw.entity.entity.NdKqZzsfwMenu; | ||||
import com.ningdatech.kqapi.zzsfw.entity.vo.MatterTopVO; | import com.ningdatech.kqapi.zzsfw.entity.vo.MatterTopVO; | ||||
import com.ningdatech.kqapi.zzsfw.entity.vo.TreeVO; | import com.ningdatech.kqapi.zzsfw.entity.vo.TreeVO; | ||||
import com.ningdatech.kqapi.zzsfw.enumeration.ItemTypeEnum; | |||||
import com.ningdatech.kqapi.zzsfw.service.INdKqZzsfwMatterDeduplicateService; | import com.ningdatech.kqapi.zzsfw.service.INdKqZzsfwMatterDeduplicateService; | ||||
import com.ningdatech.kqapi.zzsfw.service.INdKqZzsfwMenuService; | import com.ningdatech.kqapi.zzsfw.service.INdKqZzsfwMenuService; | ||||
import lombok.RequiredArgsConstructor; | import lombok.RequiredArgsConstructor; | ||||
import lombok.extern.slf4j.Slf4j; | import lombok.extern.slf4j.Slf4j; | ||||
import org.apache.commons.lang3.StringUtils; | import org.apache.commons.lang3.StringUtils; | ||||
import org.apache.poi.ss.usermodel.CellType; | |||||
import org.apache.poi.ss.usermodel.Row; | |||||
import org.apache.poi.ss.usermodel.Sheet; | |||||
import org.apache.poi.ss.usermodel.Workbook; | |||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook; | |||||
import org.springframework.beans.factory.annotation.Value; | |||||
import org.springframework.stereotype.Component; | import org.springframework.stereotype.Component; | ||||
import org.springframework.web.multipart.MultipartFile; | |||||
import java.io.IOException; | |||||
import java.io.InputStream; | |||||
import java.sql.Connection; | |||||
import java.sql.DriverManager; | |||||
import java.sql.Statement; | |||||
import java.text.DecimalFormat; | |||||
import java.time.LocalDateTime; | |||||
import java.util.*; | import java.util.*; | ||||
import java.util.stream.Collectors; | import java.util.stream.Collectors; | ||||
@@ -34,23 +50,35 @@ import java.util.stream.Collectors; | |||||
@RequiredArgsConstructor | @RequiredArgsConstructor | ||||
public class MatterManage { | public class MatterManage { | ||||
@Value("${spring.datasource.url}") | |||||
public String url; | |||||
@Value("${spring.datasource.username}") | |||||
public String username; | |||||
@Value("${spring.datasource.password}") | |||||
public String password; | |||||
private final INdKqZzsfwMenuService menuService; | private final INdKqZzsfwMenuService menuService; | ||||
private final INdKqZzsfwMatterDeduplicateService matterDeduplicateService; | private final INdKqZzsfwMatterDeduplicateService matterDeduplicateService; | ||||
public List<TreeVO> getMatters() { | public List<TreeVO> getMatters() { | ||||
List<NdKqZzsfwMenu> matters = menuService.list(Wrappers.lambdaQuery(NdKqZzsfwMenu.class) | List<NdKqZzsfwMenu> matters = menuService.list(Wrappers.lambdaQuery(NdKqZzsfwMenu.class) | ||||
.isNotNull(NdKqZzsfwMenu::getWebapplyurl) | |||||
.orderByAsc(NdKqZzsfwMenu::getSort)); | .orderByAsc(NdKqZzsfwMenu::getSort)); | ||||
if(CollUtil.isEmpty(matters)){ | if(CollUtil.isEmpty(matters)){ | ||||
return Collections.emptyList(); | return Collections.emptyList(); | ||||
} | } | ||||
//如果是政府类型的 就隐藏 没有链接的 | |||||
List<NdKqZzsfwMenu> finalMatters = matters.stream().filter(m -> Objects.nonNull(m.getType()) && | |||||
(!m.getType().equals(ItemTypeEnum.GOV.getCode()) || Objects.nonNull(m.getWebapplyurl()))) | |||||
.collect(Collectors.toList()); | |||||
Set<String> zoneSet = new HashSet<>(); | Set<String> zoneSet = new HashSet<>(); | ||||
List<TreeVO> res = matters.stream().filter(m -> zoneSet.add(m.getZoneName())).map(m -> { | List<TreeVO> res = matters.stream().filter(m -> zoneSet.add(m.getZoneName())).map(m -> { | ||||
TreeVO zone = new TreeVO(); | TreeVO zone = new TreeVO(); | ||||
zone.setName(m.getZoneName()); | zone.setName(m.getZoneName()); | ||||
zone.setChilren(generateWindows(m, matters)); | |||||
zone.setChilren(generateWindows(m, finalMatters)); | |||||
zone.setType(ZzsfwMenuConstant.MENU_TYPE_ZONE); | zone.setType(ZzsfwMenuConstant.MENU_TYPE_ZONE); | ||||
return zone; | return zone; | ||||
}).collect(Collectors.toList()); | }).collect(Collectors.toList()); | ||||
@@ -77,14 +105,34 @@ public class MatterManage { | |||||
.map(m -> { | .map(m -> { | ||||
TreeVO department = new TreeVO(); | TreeVO department = new TreeVO(); | ||||
department.setName(m.getDepartment()); | department.setName(m.getDepartment()); | ||||
department.setChilren(generateMatters(m,matters)); | |||||
department.setChilren(generateItemType(m,matters)); | |||||
department.setType(ZzsfwMenuConstant.MENU_TYPE_DEPARTMENT); | department.setType(ZzsfwMenuConstant.MENU_TYPE_DEPARTMENT); | ||||
return department; | return department; | ||||
}).collect(Collectors.toList()); | }).collect(Collectors.toList()); | ||||
} | } | ||||
private List<TreeVO> generateItemType(NdKqZzsfwMenu menu, List<NdKqZzsfwMenu> matters) { | |||||
Set<Integer> typeSet = new HashSet<>(); | |||||
return matters.stream().filter(m -> StringUtils.isNotBlank(m.getWindow()) && m.getWindow().equals(menu.getWindow()) && | |||||
m.getZoneName().equals(menu.getZoneName()) && Objects.nonNull(m.getType()) && typeSet.add(m.getType())) | |||||
.map(m -> { | |||||
TreeVO menuType = new TreeVO(); | |||||
ItemTypeEnum itemTypeEnum = ItemTypeEnum.match(m.getType()); | |||||
if(Objects.nonNull(itemTypeEnum)){ | |||||
menuType.setName(itemTypeEnum.getDesc()); | |||||
menuType.setChilren(generateMatters(m,matters)); | |||||
menuType.setType(ZzsfwMenuConstant.MENU_ITEM_TYPE); | |||||
return menuType; | |||||
} | |||||
return null; | |||||
}) | |||||
.filter(Objects::nonNull) | |||||
.collect(Collectors.toList()); | |||||
} | |||||
private List<TreeVO> generateMatters(NdKqZzsfwMenu menu, List<NdKqZzsfwMenu> matters) { | private List<TreeVO> generateMatters(NdKqZzsfwMenu menu, List<NdKqZzsfwMenu> matters) { | ||||
return matters.stream().filter(m -> Objects.nonNull(m.getHasUrl()) && m.getHasUrl() == 1 && | |||||
return matters.stream().filter(m -> Objects.nonNull(m.getType()) && m.getType().equals(menu.getType()) && | |||||
(!m.getType().equals(ItemTypeEnum.GOV.getCode()) || Objects.nonNull(m.getHasUrl()) && m.getHasUrl() == 1) && | |||||
StringUtils.isNotBlank(m.getDepartment()) && | StringUtils.isNotBlank(m.getDepartment()) && | ||||
m.getDepartment().equals(menu.getDepartment()) && m.getWindow().equals(menu.getWindow()) && | m.getDepartment().equals(menu.getDepartment()) && m.getWindow().equals(menu.getWindow()) && | ||||
m.getZoneName().equals(menu.getZoneName())) | m.getZoneName().equals(menu.getZoneName())) | ||||
@@ -95,6 +143,9 @@ public class MatterManage { | |||||
matter.setId(m.getItemRowid()); | matter.setId(m.getItemRowid()); | ||||
matter.setSort(m.getSort()); | matter.setSort(m.getSort()); | ||||
matter.setType(ZzsfwMenuConstant.MENU_TYPE_MATTER); | matter.setType(ZzsfwMenuConstant.MENU_TYPE_MATTER); | ||||
matter.setServiceContent(m.getServiceContent()); | |||||
matter.setServiceProcess(m.getServiceProcess()); | |||||
matter.setTelephone(m.getTelephone()); | |||||
return matter; | return matter; | ||||
}).collect(Collectors.toList()); | }).collect(Collectors.toList()); | ||||
} | } | ||||
@@ -147,4 +198,87 @@ public class MatterManage { | |||||
matterDeduplicateService.remove(Wrappers.lambdaQuery(NdKqZzsfwMattersDeduplicate.class)); | matterDeduplicateService.remove(Wrappers.lambdaQuery(NdKqZzsfwMattersDeduplicate.class)); | ||||
return "删除成功"; | return "删除成功"; | ||||
} | } | ||||
public String uploadMenu(MultipartFile file) throws IOException { | |||||
InputStream inputStream = file.getInputStream(); | |||||
Workbook workbook = new XSSFWorkbook(inputStream); | |||||
Assert.notNull(workbook); | |||||
Row row; | |||||
//获取最大行数 | |||||
Sheet sheet = workbook.getSheetAt(0); | |||||
int rownum = sheet.getPhysicalNumberOfRows(); | |||||
//获取最大列数 | |||||
Integer num = 1; | |||||
for (int i = 2; i < rownum; i++) { | |||||
row = sheet.getRow(i); | |||||
if (row.getZeroHeight()) { | |||||
continue; | |||||
} | |||||
System.out.println("记数:" + (num++)); | |||||
String zoneName = row.getCell(0).getStringCellValue(); | |||||
System.out.println(zoneName); | |||||
DecimalFormat decimalFormat = new DecimalFormat("#"); | |||||
Integer sort = Integer.valueOf(decimalFormat.format(row.getCell(1).getNumericCellValue())); | |||||
System.out.println(sort); | |||||
String windowName = row.getCell(2).getStringCellValue(); | |||||
System.out.println(windowName); | |||||
String department = row.getCell(3).getStringCellValue(); | |||||
System.out.println(department); | |||||
String itemName = row.getCell(4).getStringCellValue(); | |||||
System.out.println(itemName); | |||||
String serviceContent = row.getCell(5).getStringCellValue(); | |||||
System.out.println(serviceContent); | |||||
String serviceProcess = row.getCell(6).getStringCellValue(); | |||||
System.out.println(serviceProcess); | |||||
String telephone = ""; | |||||
CellType cellType = row.getCell(7).getCellType(); | |||||
if (cellType.equals(CellType.STRING)) { | |||||
telephone = row.getCell(7).getStringCellValue(); | |||||
System.out.println(telephone); | |||||
} else if (cellType.equals(CellType.NUMERIC)) { | |||||
DecimalFormat decimalFormat2 = new DecimalFormat("#.#######"); | |||||
telephone = decimalFormat2.format(row.getCell(7).getNumericCellValue()); | |||||
System.out.println(telephone); | |||||
} | |||||
NdKqZzsfwMenu menu = new NdKqZzsfwMenu(); | |||||
menu.setItemName(itemName); | |||||
menu.setZoneName(zoneName); | |||||
menu.setWindow(windowName); | |||||
menu.setDepartment(department); | |||||
menu.setServiceContent(serviceContent); | |||||
menu.setServiceProcess(serviceProcess); | |||||
menu.setTelephone(telephone); | |||||
menu.setType(ItemTypeEnum.ADDED.getCode()); | |||||
menu.setCreateOn(LocalDateTime.now()); | |||||
menu.setSort(sort); | |||||
menuService.save(menu); | |||||
} | |||||
return "upload success!"; | |||||
} | |||||
public String ddl(String sql) { | |||||
try { | |||||
// 1. 加载数据库驱动 | |||||
Class.forName("com.mysql.cj.jdbc.Driver"); | |||||
// 2. 建立数据库连接 | |||||
Connection connection = DriverManager.getConnection(url, username, password); | |||||
// 3. 创建Statement对象 | |||||
Statement statement = connection.createStatement(); | |||||
// 4. 编写并执行DDL语句(创建一个名为`users`的表) | |||||
statement.executeUpdate(sql); | |||||
System.out.println(" Table updated successfully."); | |||||
// 5. 关闭资源 | |||||
statement.close(); | |||||
connection.close(); | |||||
} catch (Exception e) { | |||||
e.printStackTrace(); | |||||
} | |||||
return "success!"; | |||||
} | |||||
} | } |
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |||||
import com.ningdatech.kqapi.AppTests; | import com.ningdatech.kqapi.AppTests; | ||||
import com.ningdatech.kqapi.zzsfw.entity.entity.DscSxAdsShareItemQltQlsxCommonIDVKq; | import com.ningdatech.kqapi.zzsfw.entity.entity.DscSxAdsShareItemQltQlsxCommonIDVKq; | ||||
import com.ningdatech.kqapi.zzsfw.entity.entity.NdKqZzsfwMenu; | import com.ningdatech.kqapi.zzsfw.entity.entity.NdKqZzsfwMenu; | ||||
import com.ningdatech.kqapi.zzsfw.enumeration.ItemTypeEnum; | |||||
import com.ningdatech.kqapi.zzsfw.service.IDscSxAdsShareItemQltQlsxCommonIDVKqService; | import com.ningdatech.kqapi.zzsfw.service.IDscSxAdsShareItemQltQlsxCommonIDVKqService; | ||||
import com.ningdatech.kqapi.zzsfw.service.INdKqZzsfwMenuService; | import com.ningdatech.kqapi.zzsfw.service.INdKqZzsfwMenuService; | ||||
import org.apache.poi.ss.usermodel.*; | import org.apache.poi.ss.usermodel.*; | ||||
@@ -13,6 +14,10 @@ import org.junit.Test; | |||||
import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
import java.io.FileInputStream; | import java.io.FileInputStream; | ||||
import java.io.IOException; | import java.io.IOException; | ||||
import java.sql.Connection; | |||||
import java.sql.DriverManager; | |||||
import java.sql.Statement; | |||||
import java.text.DecimalFormat; | |||||
import java.time.LocalDateTime; | import java.time.LocalDateTime; | ||||
import java.util.Objects; | import java.util.Objects; | ||||
@@ -22,14 +27,11 @@ import java.util.Objects; | |||||
* @Date 2023/10/27 9:51 | * @Date 2023/10/27 9:51 | ||||
* @Author PoffyZhang | * @Author PoffyZhang | ||||
*/ | */ | ||||
public class MenuTest extends AppTests { | |||||
public class MenuTest extends AppTests{ // | |||||
@Autowired | @Autowired | ||||
private INdKqZzsfwMenuService menuService; | private INdKqZzsfwMenuService menuService; | ||||
@Autowired | |||||
private IDscSxAdsShareItemQltQlsxCommonIDVKqService itemQltQlsxCommonIDVKqService; | |||||
@Test | @Test | ||||
public void test() throws IOException { | public void test() throws IOException { | ||||
FileInputStream fis = new FileInputStream("C:\\Users\\PoffyZhang\\Desktop\\11.14柯桥.xlsx"); | FileInputStream fis = new FileInputStream("C:\\Users\\PoffyZhang\\Desktop\\11.14柯桥.xlsx"); | ||||
@@ -85,4 +87,104 @@ public class MenuTest extends AppTests { | |||||
} | } | ||||
} | } | ||||
@Test | |||||
public void importData() throws IOException { | |||||
FileInputStream fis = new FileInputStream("C:\\Users\\PoffyZhang\\Desktop\\增值服务数据20240403.xlsx"); | |||||
Workbook workbook = new XSSFWorkbook(fis); | |||||
Assert.assertNotNull(workbook); | |||||
Row row; | |||||
if (workbook != null) { | |||||
//获取最大行数 | |||||
Sheet sheet = workbook.getSheetAt(0); | |||||
int rownum = sheet.getPhysicalNumberOfRows(); | |||||
//获取第一行 | |||||
row = sheet.getRow(0); | |||||
//获取最大列数 | |||||
Integer num = 1; | |||||
for (int i = 2; i < rownum; i++) { | |||||
row = sheet.getRow(i); | |||||
if (row.getZeroHeight()) { | |||||
continue; | |||||
} | |||||
System.out.println("记数:" + (num++)); | |||||
String zoneName = row.getCell(0).getStringCellValue(); | |||||
System.out.println(zoneName); | |||||
DecimalFormat decimalFormat = new DecimalFormat("#"); | |||||
Integer sort = Integer.valueOf(decimalFormat.format(row.getCell(1).getNumericCellValue())); | |||||
System.out.println(sort); | |||||
String windowName = row.getCell(2).getStringCellValue(); | |||||
System.out.println(windowName); | |||||
String department = row.getCell(3).getStringCellValue(); | |||||
System.out.println(department); | |||||
String itemName = row.getCell(4).getStringCellValue(); | |||||
System.out.println(itemName); | |||||
String serviceContent = row.getCell(5).getStringCellValue(); | |||||
System.out.println(serviceContent); | |||||
String serviceProcess = row.getCell(6).getStringCellValue(); | |||||
System.out.println(serviceProcess); | |||||
String telephone = ""; | |||||
CellType cellType = row.getCell(7).getCellType(); | |||||
if(cellType.equals(CellType.STRING)){ | |||||
telephone = row.getCell(7).getStringCellValue(); | |||||
System.out.println(telephone); | |||||
}else if(cellType.equals(CellType.NUMERIC)){ | |||||
DecimalFormat decimalFormat2 = new DecimalFormat("#.#######"); | |||||
telephone = decimalFormat2.format(row.getCell(7).getNumericCellValue()); | |||||
System.out.println(telephone); | |||||
} | |||||
NdKqZzsfwMenu menu = new NdKqZzsfwMenu(); | |||||
menu.setItemName(itemName); | |||||
menu.setZoneName(zoneName); | |||||
menu.setWindow(windowName); | |||||
menu.setDepartment(department); | |||||
menu.setServiceContent(serviceContent); | |||||
menu.setServiceProcess(serviceProcess); | |||||
menu.setTelephone(telephone); | |||||
menu.setType(ItemTypeEnum.ADDED.getCode()); | |||||
menu.setCreateOn(LocalDateTime.now()); | |||||
menu.setSort(sort); | |||||
// menuService.save(menu); | |||||
} | |||||
} | |||||
} | |||||
@Test | |||||
public void tableAndColumn() throws IOException { | |||||
String url = "jdbc:mysql://47.98.125.47:3306/kqzzsfw?serverTimezone=Asia/Shanghai&characterEncoding=utf8&allowPublicKeyRetrieval=true&useSSL=false"; // 你的数据库URL | |||||
String username = "root"; // 数据库用户名 | |||||
String password = "NingdaKeji123!"; // 数据库密码 | |||||
String table = "nd_kq_zzsfw_menu"; | |||||
try { | |||||
// 1. 加载数据库驱动 | |||||
Class.forName("com.mysql.cj.jdbc.Driver"); | |||||
// 2. 建立数据库连接 | |||||
Connection connection = DriverManager.getConnection(url, username, password); | |||||
// 3. 创建Statement对象 | |||||
Statement statement = connection.createStatement(); | |||||
// 4. 编写并执行DDL语句(创建一个名为`users`的表) | |||||
// String createTableUsers = "alter table nd_kq_zzsfw_menu add column type tinyint default 1 comment '类型 1.政府服务 2.增值服务 3.特殊'"; | |||||
// String createTableUsers = "alter table nd_kq_zzsfw_menu add column service_content text comment '服务内容';"; | |||||
// String createTableUsers = "alter table nd_kq_zzsfw_menu add column service_process text comment '服务流程';"; | |||||
String createTableUsers = "alter table nd_kq_zzsfw_menu add column telephone text comment '咨询电话'"; | |||||
statement.executeUpdate(createTableUsers); | |||||
System.out.println(" Table '" + table + "' updated successfully."); | |||||
// 5. 关闭资源 | |||||
statement.close(); | |||||
connection.close(); | |||||
} catch (Exception e) { | |||||
e.printStackTrace(); | |||||
} | |||||
} | |||||
} | } |