From a84e55624c198b03a72adda8d0e0b2154ec7d28f Mon Sep 17 00:00:00 2001 From: by1642146903 <1642146903@qq.com> Date: Tue, 10 Jan 2023 15:17:27 +0800 Subject: [PATCH] 将抽取的数据转换为partspec数据 --- logs/info.log | 93 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/sucl/sbmp/sys/biz/SpecPartBiz.java | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/sucl/sbmp/sys/entity/SpecPart.java | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/sucl/sbmp/sys/mapper/SpecPartMapper.java | 10 ++++++++++ src/main/java/com/sucl/sbmp/sys/service/SpecPartService.java | 8 ++++++++ src/main/java/com/sucl/sbmp/sys/service/impl/SpecPartServiceImpl.java | 12 ++++++++++++ src/test/java/cn/fw/parts/AcquirePartsTest.java | 14 ++++++++++++-- 7 files changed, 249 insertions(+), 2 deletions(-) create mode 100644 src/main/java/com/sucl/sbmp/sys/biz/SpecPartBiz.java create mode 100644 src/main/java/com/sucl/sbmp/sys/entity/SpecPart.java create mode 100644 src/main/java/com/sucl/sbmp/sys/mapper/SpecPartMapper.java create mode 100644 src/main/java/com/sucl/sbmp/sys/service/SpecPartService.java create mode 100644 src/main/java/com/sucl/sbmp/sys/service/impl/SpecPartServiceImpl.java diff --git a/logs/info.log b/logs/info.log index 1c87c4c..b646a1e 100644 --- a/logs/info.log +++ b/logs/info.log @@ -98802,3 +98802,96 @@ 2023-01-07 11:45:10.242 [main] INFO o.s.web.servlet.handler.SimpleUrlHandlerMapping - Mapped URL path [/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler] 2023-01-07 11:45:10.290 [main] INFO o.s.web.servlet.handler.SimpleUrlHandlerMapping - Mapped URL path [/**/favicon.ico] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler] 2023-01-07 11:45:10.670 [main] INFO cn.fw.parts.AcquirePartsTest - Started AcquirePartsTest in 3.53 seconds (JVM running for 4.528) +2023-01-10 14:34:37.813 [main] INFO o.s.b.t.context.SpringBootTestContextBootstrapper - Neither @ContextConfiguration nor @ContextHierarchy found for test class [cn.fw.parts.AcquirePartsTest], using SpringBootContextLoader +2023-01-10 14:34:37.827 [main] INFO o.s.test.context.support.AbstractContextLoader - Could not detect default resource locations for test class [cn.fw.parts.AcquirePartsTest]: no resource found for suffixes {-context.xml, Context.groovy}. +2023-01-10 14:34:38.083 [main] INFO o.s.b.t.context.SpringBootTestContextBootstrapper - Loaded default TestExecutionListener class names from location [META-INF/spring.factories]: [org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener, org.springframework.boot.test.mock.mockito.ResetMocksTestExecutionListener, org.springframework.boot.test.autoconfigure.restdocs.RestDocsTestExecutionListener, org.springframework.boot.test.autoconfigure.web.client.MockRestServiceServerResetTestExecutionListener, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcPrintOnlyOnFailureTestExecutionListener, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverTestExecutionListener, org.springframework.test.context.web.ServletTestExecutionListener, org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener, org.springframework.test.context.support.DependencyInjectionTestExecutionListener, org.springframework.test.context.support.DirtiesContextTestExecutionListener, org.springframework.test.context.transaction.TransactionalTestExecutionListener, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener] +2023-01-10 14:34:38.147 [main] INFO o.s.b.t.context.SpringBootTestContextBootstrapper - Using TestExecutionListeners: [org.springframework.test.context.web.ServletTestExecutionListener@7a5ceedd, org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener@4201c465, org.springframework.boot.test.autoconfigure.SpringBootDependencyInjectionTestExecutionListener@5b799640, org.springframework.test.context.support.DirtiesContextTestExecutionListener@6cb107fd, org.springframework.test.context.transaction.TransactionalTestExecutionListener@710636b0, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener@3de8f619, org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener@2ab4bc72, org.springframework.boot.test.mock.mockito.ResetMocksTestExecutionListener@4e5ed836, org.springframework.boot.test.autoconfigure.restdocs.RestDocsTestExecutionListener@eadd4fb, org.springframework.boot.test.autoconfigure.web.client.MockRestServiceServerResetTestExecutionListener@740fb309, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcPrintOnlyOnFailureTestExecutionListener@7bd7d6d6, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverTestExecutionListener@43f02ef2] +2023-01-10 14:34:38.894 [main] INFO cn.fw.parts.AcquirePartsTest - Starting AcquirePartsTest on baiyun with PID 22939 (started by macbookpro in /Users/baiyun/develop/sbmp) +2023-01-10 14:34:38.895 [main] INFO cn.fw.parts.AcquirePartsTest - No active profile set, falling back to default profiles: default +2023-01-10 14:34:38.942 [main] INFO o.s.w.context.support.GenericWebApplicationContext - Refreshing org.springframework.web.context.support.GenericWebApplicationContext@6b5894c8: startup date [Tue Jan 10 14:34:38 CST 2023]; root of context hierarchy +2023-01-10 14:34:39.425 [background-preinit] INFO org.hibernate.validator.internal.util.Version - HV000001: Hibernate Validator 5.3.6.Final +2023-01-10 14:34:42.380 [main] INFO o.s.w.s.m.m.a.RequestMappingHandlerAdapter - Looking for @ControllerAdvice: org.springframework.web.context.support.GenericWebApplicationContext@6b5894c8: startup date [Tue Jan 10 14:34:38 CST 2023]; root of context hierarchy +2023-01-10 14:34:42.584 [main] INFO o.s.w.s.m.m.a.RequestMappingHandlerMapping - Mapped "{[/error]}" onto public org.springframework.http.ResponseEntity> org.springframework.boot.autoconfigure.web.BasicErrorController.error(javax.servlet.http.HttpServletRequest) +2023-01-10 14:34:42.585 [main] INFO o.s.w.s.m.m.a.RequestMappingHandlerMapping - Mapped "{[/error],produces=[text/html]}" onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse) +2023-01-10 14:34:42.621 [main] INFO o.s.web.servlet.handler.SimpleUrlHandlerMapping - Mapped URL path [/webjars/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler] +2023-01-10 14:34:42.622 [main] INFO o.s.web.servlet.handler.SimpleUrlHandlerMapping - Mapped URL path [/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler] +2023-01-10 14:34:42.673 [main] INFO o.s.web.servlet.handler.SimpleUrlHandlerMapping - Mapped URL path [/**/favicon.ico] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler] +2023-01-10 14:34:43.075 [main] INFO cn.fw.parts.AcquirePartsTest - Started AcquirePartsTest in 4.609 seconds (JVM running for 7.341) +2023-01-10 14:34:53.489 [Thread-3] INFO o.s.w.context.support.GenericWebApplicationContext - Closing org.springframework.web.context.support.GenericWebApplicationContext@6b5894c8: startup date [Tue Jan 10 14:34:38 CST 2023]; root of context hierarchy +2023-01-10 14:42:05.958 [main] INFO o.s.b.t.context.SpringBootTestContextBootstrapper - Neither @ContextConfiguration nor @ContextHierarchy found for test class [cn.fw.parts.AcquirePartsTest], using SpringBootContextLoader +2023-01-10 14:42:05.965 [main] INFO o.s.test.context.support.AbstractContextLoader - Could not detect default resource locations for test class [cn.fw.parts.AcquirePartsTest]: no resource found for suffixes {-context.xml, Context.groovy}. +2023-01-10 14:42:06.049 [main] INFO o.s.b.t.context.SpringBootTestContextBootstrapper - Loaded default TestExecutionListener class names from location [META-INF/spring.factories]: [org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener, org.springframework.boot.test.mock.mockito.ResetMocksTestExecutionListener, org.springframework.boot.test.autoconfigure.restdocs.RestDocsTestExecutionListener, org.springframework.boot.test.autoconfigure.web.client.MockRestServiceServerResetTestExecutionListener, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcPrintOnlyOnFailureTestExecutionListener, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverTestExecutionListener, org.springframework.test.context.web.ServletTestExecutionListener, org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener, org.springframework.test.context.support.DependencyInjectionTestExecutionListener, org.springframework.test.context.support.DirtiesContextTestExecutionListener, org.springframework.test.context.transaction.TransactionalTestExecutionListener, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener] +2023-01-10 14:42:06.074 [main] INFO o.s.b.t.context.SpringBootTestContextBootstrapper - Using TestExecutionListeners: [org.springframework.test.context.web.ServletTestExecutionListener@7a5ceedd, org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener@4201c465, org.springframework.boot.test.autoconfigure.SpringBootDependencyInjectionTestExecutionListener@5b799640, org.springframework.test.context.support.DirtiesContextTestExecutionListener@6cb107fd, org.springframework.test.context.transaction.TransactionalTestExecutionListener@710636b0, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener@3de8f619, org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener@2ab4bc72, org.springframework.boot.test.mock.mockito.ResetMocksTestExecutionListener@4e5ed836, org.springframework.boot.test.autoconfigure.restdocs.RestDocsTestExecutionListener@eadd4fb, org.springframework.boot.test.autoconfigure.web.client.MockRestServiceServerResetTestExecutionListener@740fb309, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcPrintOnlyOnFailureTestExecutionListener@7bd7d6d6, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverTestExecutionListener@43f02ef2] +2023-01-10 14:42:06.623 [main] INFO cn.fw.parts.AcquirePartsTest - Starting AcquirePartsTest on baiyun with PID 23138 (started by macbookpro in /Users/baiyun/develop/sbmp) +2023-01-10 14:42:06.624 [main] INFO cn.fw.parts.AcquirePartsTest - No active profile set, falling back to default profiles: default +2023-01-10 14:42:06.674 [main] INFO o.s.w.context.support.GenericWebApplicationContext - Refreshing org.springframework.web.context.support.GenericWebApplicationContext@6b5894c8: startup date [Tue Jan 10 14:42:06 CST 2023]; root of context hierarchy +2023-01-10 14:42:07.126 [background-preinit] INFO org.hibernate.validator.internal.util.Version - HV000001: Hibernate Validator 5.3.6.Final +2023-01-10 14:42:10.067 [main] INFO o.s.b.t.context.SpringBootTestContextBootstrapper - Neither @ContextConfiguration nor @ContextHierarchy found for test class [cn.fw.parts.AcquirePartsTest], using SpringBootContextLoader +2023-01-10 14:42:10.077 [main] INFO o.s.test.context.support.AbstractContextLoader - Could not detect default resource locations for test class [cn.fw.parts.AcquirePartsTest]: no resource found for suffixes {-context.xml, Context.groovy}. +2023-01-10 14:42:10.157 [main] INFO o.s.b.t.context.SpringBootTestContextBootstrapper - Loaded default TestExecutionListener class names from location [META-INF/spring.factories]: [org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener, org.springframework.boot.test.mock.mockito.ResetMocksTestExecutionListener, org.springframework.boot.test.autoconfigure.restdocs.RestDocsTestExecutionListener, org.springframework.boot.test.autoconfigure.web.client.MockRestServiceServerResetTestExecutionListener, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcPrintOnlyOnFailureTestExecutionListener, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverTestExecutionListener, org.springframework.test.context.web.ServletTestExecutionListener, org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener, org.springframework.test.context.support.DependencyInjectionTestExecutionListener, org.springframework.test.context.support.DirtiesContextTestExecutionListener, org.springframework.test.context.transaction.TransactionalTestExecutionListener, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener] +2023-01-10 14:42:10.175 [main] INFO o.s.b.t.context.SpringBootTestContextBootstrapper - Using TestExecutionListeners: [org.springframework.test.context.web.ServletTestExecutionListener@3c87521, org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener@2aece37d, org.springframework.boot.test.autoconfigure.SpringBootDependencyInjectionTestExecutionListener@548a102f, org.springframework.test.context.support.DirtiesContextTestExecutionListener@5762806e, org.springframework.test.context.transaction.TransactionalTestExecutionListener@17c386de, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener@5af97850, org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener@5ef60048, org.springframework.boot.test.mock.mockito.ResetMocksTestExecutionListener@1d548a08, org.springframework.boot.test.autoconfigure.restdocs.RestDocsTestExecutionListener@16aa0a0a, org.springframework.boot.test.autoconfigure.web.client.MockRestServiceServerResetTestExecutionListener@780cb77, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcPrintOnlyOnFailureTestExecutionListener@691a7f8f, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverTestExecutionListener@50a7bc6e] +2023-01-10 14:42:10.631 [main] INFO cn.fw.parts.AcquirePartsTest - Starting AcquirePartsTest on baiyun with PID 23144 (started by macbookpro in /Users/baiyun/develop/sbmp) +2023-01-10 14:42:10.632 [main] INFO cn.fw.parts.AcquirePartsTest - No active profile set, falling back to default profiles: default +2023-01-10 14:42:10.678 [main] INFO o.s.w.context.support.GenericWebApplicationContext - Refreshing org.springframework.web.context.support.GenericWebApplicationContext@cecf639: startup date [Tue Jan 10 14:42:10 CST 2023]; root of context hierarchy +2023-01-10 14:42:11.195 [background-preinit] INFO org.hibernate.validator.internal.util.Version - HV000001: Hibernate Validator 5.3.6.Final +2023-01-10 14:42:14.060 [main] INFO o.s.w.s.m.m.a.RequestMappingHandlerAdapter - Looking for @ControllerAdvice: org.springframework.web.context.support.GenericWebApplicationContext@cecf639: startup date [Tue Jan 10 14:42:10 CST 2023]; root of context hierarchy +2023-01-10 14:42:14.147 [main] INFO o.s.w.s.m.m.a.RequestMappingHandlerMapping - Mapped "{[/error],produces=[text/html]}" onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse) +2023-01-10 14:42:14.148 [main] INFO o.s.w.s.m.m.a.RequestMappingHandlerMapping - Mapped "{[/error]}" onto public org.springframework.http.ResponseEntity> org.springframework.boot.autoconfigure.web.BasicErrorController.error(javax.servlet.http.HttpServletRequest) +2023-01-10 14:42:14.184 [main] INFO o.s.web.servlet.handler.SimpleUrlHandlerMapping - Mapped URL path [/webjars/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler] +2023-01-10 14:42:14.184 [main] INFO o.s.web.servlet.handler.SimpleUrlHandlerMapping - Mapped URL path [/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler] +2023-01-10 14:42:14.233 [main] INFO o.s.web.servlet.handler.SimpleUrlHandlerMapping - Mapped URL path [/**/favicon.ico] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler] +2023-01-10 14:42:14.607 [main] INFO cn.fw.parts.AcquirePartsTest - Started AcquirePartsTest in 4.318 seconds (JVM running for 5.148) +2023-01-10 14:42:16.879 [main] INFO o.s.beans.factory.xml.XmlBeanDefinitionReader - Loading XML bean definitions from class path resource [org/springframework/jdbc/support/sql-error-codes.xml] +2023-01-10 14:42:16.913 [main] INFO o.s.jdbc.support.SQLErrorCodesFactory - SQLErrorCodes loaded: [DB2, Derby, H2, HSQL, Informix, MS-SQL, MySQL, Oracle, PostgreSQL, Sybase, Hana] +2023-01-10 14:42:20.742 [Thread-3] INFO o.s.w.context.support.GenericWebApplicationContext - Closing org.springframework.web.context.support.GenericWebApplicationContext@cecf639: startup date [Tue Jan 10 14:42:10 CST 2023]; root of context hierarchy +2023-01-10 14:43:31.996 [main] INFO o.s.b.t.context.SpringBootTestContextBootstrapper - Neither @ContextConfiguration nor @ContextHierarchy found for test class [cn.fw.parts.AcquirePartsTest], using SpringBootContextLoader +2023-01-10 14:43:32.004 [main] INFO o.s.test.context.support.AbstractContextLoader - Could not detect default resource locations for test class [cn.fw.parts.AcquirePartsTest]: no resource found for suffixes {-context.xml, Context.groovy}. +2023-01-10 14:43:32.111 [main] INFO o.s.b.t.context.SpringBootTestContextBootstrapper - Loaded default TestExecutionListener class names from location [META-INF/spring.factories]: [org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener, org.springframework.boot.test.mock.mockito.ResetMocksTestExecutionListener, org.springframework.boot.test.autoconfigure.restdocs.RestDocsTestExecutionListener, org.springframework.boot.test.autoconfigure.web.client.MockRestServiceServerResetTestExecutionListener, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcPrintOnlyOnFailureTestExecutionListener, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverTestExecutionListener, org.springframework.test.context.web.ServletTestExecutionListener, org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener, org.springframework.test.context.support.DependencyInjectionTestExecutionListener, org.springframework.test.context.support.DirtiesContextTestExecutionListener, org.springframework.test.context.transaction.TransactionalTestExecutionListener, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener] +2023-01-10 14:43:32.141 [main] INFO o.s.b.t.context.SpringBootTestContextBootstrapper - Using TestExecutionListeners: [org.springframework.test.context.web.ServletTestExecutionListener@7a5ceedd, org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener@4201c465, org.springframework.boot.test.autoconfigure.SpringBootDependencyInjectionTestExecutionListener@5b799640, org.springframework.test.context.support.DirtiesContextTestExecutionListener@6cb107fd, org.springframework.test.context.transaction.TransactionalTestExecutionListener@710636b0, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener@3de8f619, org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener@2ab4bc72, org.springframework.boot.test.mock.mockito.ResetMocksTestExecutionListener@4e5ed836, org.springframework.boot.test.autoconfigure.restdocs.RestDocsTestExecutionListener@eadd4fb, org.springframework.boot.test.autoconfigure.web.client.MockRestServiceServerResetTestExecutionListener@740fb309, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcPrintOnlyOnFailureTestExecutionListener@7bd7d6d6, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverTestExecutionListener@43f02ef2] +2023-01-10 14:43:32.702 [main] INFO cn.fw.parts.AcquirePartsTest - Starting AcquirePartsTest on baiyun with PID 23186 (started by macbookpro in /Users/baiyun/develop/sbmp) +2023-01-10 14:43:32.703 [main] INFO cn.fw.parts.AcquirePartsTest - No active profile set, falling back to default profiles: default +2023-01-10 14:43:32.748 [main] INFO o.s.w.context.support.GenericWebApplicationContext - Refreshing org.springframework.web.context.support.GenericWebApplicationContext@6b5894c8: startup date [Tue Jan 10 14:43:32 CST 2023]; root of context hierarchy +2023-01-10 14:43:33.218 [background-preinit] INFO org.hibernate.validator.internal.util.Version - HV000001: Hibernate Validator 5.3.6.Final +2023-01-10 14:43:35.763 [main] INFO o.s.w.s.m.m.a.RequestMappingHandlerAdapter - Looking for @ControllerAdvice: org.springframework.web.context.support.GenericWebApplicationContext@6b5894c8: startup date [Tue Jan 10 14:43:32 CST 2023]; root of context hierarchy +2023-01-10 14:43:35.916 [main] INFO o.s.w.s.m.m.a.RequestMappingHandlerMapping - Mapped "{[/error],produces=[text/html]}" onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse) +2023-01-10 14:43:35.917 [main] INFO o.s.w.s.m.m.a.RequestMappingHandlerMapping - Mapped "{[/error]}" onto public org.springframework.http.ResponseEntity> org.springframework.boot.autoconfigure.web.BasicErrorController.error(javax.servlet.http.HttpServletRequest) +2023-01-10 14:43:35.946 [main] INFO o.s.web.servlet.handler.SimpleUrlHandlerMapping - Mapped URL path [/webjars/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler] +2023-01-10 14:43:35.946 [main] INFO o.s.web.servlet.handler.SimpleUrlHandlerMapping - Mapped URL path [/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler] +2023-01-10 14:43:35.984 [main] INFO o.s.web.servlet.handler.SimpleUrlHandlerMapping - Mapped URL path [/**/favicon.ico] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler] +2023-01-10 14:43:36.268 [main] INFO cn.fw.parts.AcquirePartsTest - Started AcquirePartsTest in 3.976 seconds (JVM running for 4.975) +2023-01-10 14:43:38.640 [main] INFO o.s.beans.factory.xml.XmlBeanDefinitionReader - Loading XML bean definitions from class path resource [org/springframework/jdbc/support/sql-error-codes.xml] +2023-01-10 14:43:38.686 [main] INFO o.s.jdbc.support.SQLErrorCodesFactory - SQLErrorCodes loaded: [DB2, Derby, H2, HSQL, Informix, MS-SQL, MySQL, Oracle, PostgreSQL, Sybase, Hana] +2023-01-10 14:46:37.642 [Thread-3] INFO o.s.w.context.support.GenericWebApplicationContext - Closing org.springframework.web.context.support.GenericWebApplicationContext@6b5894c8: startup date [Tue Jan 10 14:43:32 CST 2023]; root of context hierarchy +2023-01-10 14:46:52.489 [main] INFO o.s.b.t.context.SpringBootTestContextBootstrapper - Neither @ContextConfiguration nor @ContextHierarchy found for test class [cn.fw.parts.AcquirePartsTest], using SpringBootContextLoader +2023-01-10 14:46:52.494 [main] INFO o.s.test.context.support.AbstractContextLoader - Could not detect default resource locations for test class [cn.fw.parts.AcquirePartsTest]: no resource found for suffixes {-context.xml, Context.groovy}. +2023-01-10 14:46:52.571 [main] INFO o.s.b.t.context.SpringBootTestContextBootstrapper - Loaded default TestExecutionListener class names from location [META-INF/spring.factories]: [org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener, org.springframework.boot.test.mock.mockito.ResetMocksTestExecutionListener, org.springframework.boot.test.autoconfigure.restdocs.RestDocsTestExecutionListener, org.springframework.boot.test.autoconfigure.web.client.MockRestServiceServerResetTestExecutionListener, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcPrintOnlyOnFailureTestExecutionListener, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverTestExecutionListener, org.springframework.test.context.web.ServletTestExecutionListener, org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener, org.springframework.test.context.support.DependencyInjectionTestExecutionListener, org.springframework.test.context.support.DirtiesContextTestExecutionListener, org.springframework.test.context.transaction.TransactionalTestExecutionListener, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener] +2023-01-10 14:46:52.592 [main] INFO o.s.b.t.context.SpringBootTestContextBootstrapper - Using TestExecutionListeners: [org.springframework.test.context.web.ServletTestExecutionListener@7a5ceedd, org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener@4201c465, org.springframework.boot.test.autoconfigure.SpringBootDependencyInjectionTestExecutionListener@5b799640, org.springframework.test.context.support.DirtiesContextTestExecutionListener@6cb107fd, org.springframework.test.context.transaction.TransactionalTestExecutionListener@710636b0, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener@3de8f619, org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener@2ab4bc72, org.springframework.boot.test.mock.mockito.ResetMocksTestExecutionListener@4e5ed836, org.springframework.boot.test.autoconfigure.restdocs.RestDocsTestExecutionListener@eadd4fb, org.springframework.boot.test.autoconfigure.web.client.MockRestServiceServerResetTestExecutionListener@740fb309, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcPrintOnlyOnFailureTestExecutionListener@7bd7d6d6, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverTestExecutionListener@43f02ef2] +2023-01-10 14:46:53.122 [main] INFO cn.fw.parts.AcquirePartsTest - Starting AcquirePartsTest on baiyun with PID 23287 (started by macbookpro in /Users/baiyun/develop/sbmp) +2023-01-10 14:46:53.123 [main] INFO cn.fw.parts.AcquirePartsTest - No active profile set, falling back to default profiles: default +2023-01-10 14:46:53.173 [main] INFO o.s.w.context.support.GenericWebApplicationContext - Refreshing org.springframework.web.context.support.GenericWebApplicationContext@6b5894c8: startup date [Tue Jan 10 14:46:53 CST 2023]; root of context hierarchy +2023-01-10 14:46:53.685 [background-preinit] INFO org.hibernate.validator.internal.util.Version - HV000001: Hibernate Validator 5.3.6.Final +2023-01-10 14:46:56.321 [main] INFO o.s.w.s.m.m.a.RequestMappingHandlerAdapter - Looking for @ControllerAdvice: org.springframework.web.context.support.GenericWebApplicationContext@6b5894c8: startup date [Tue Jan 10 14:46:53 CST 2023]; root of context hierarchy +2023-01-10 14:46:56.498 [main] INFO o.s.w.s.m.m.a.RequestMappingHandlerMapping - Mapped "{[/error],produces=[text/html]}" onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse) +2023-01-10 14:46:56.516 [main] INFO o.s.w.s.m.m.a.RequestMappingHandlerMapping - Mapped "{[/error]}" onto public org.springframework.http.ResponseEntity> org.springframework.boot.autoconfigure.web.BasicErrorController.error(javax.servlet.http.HttpServletRequest) +2023-01-10 14:46:56.558 [main] INFO o.s.web.servlet.handler.SimpleUrlHandlerMapping - Mapped URL path [/webjars/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler] +2023-01-10 14:46:56.558 [main] INFO o.s.web.servlet.handler.SimpleUrlHandlerMapping - Mapped URL path [/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler] +2023-01-10 14:46:56.606 [main] INFO o.s.web.servlet.handler.SimpleUrlHandlerMapping - Mapped URL path [/**/favicon.ico] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler] +2023-01-10 14:46:56.963 [main] INFO cn.fw.parts.AcquirePartsTest - Started AcquirePartsTest in 4.229 seconds (JVM running for 5.191) +2023-01-10 14:46:59.375 [main] INFO o.s.beans.factory.xml.XmlBeanDefinitionReader - Loading XML bean definitions from class path resource [org/springframework/jdbc/support/sql-error-codes.xml] +2023-01-10 14:46:59.409 [main] INFO o.s.jdbc.support.SQLErrorCodesFactory - SQLErrorCodes loaded: [DB2, Derby, H2, HSQL, Informix, MS-SQL, MySQL, Oracle, PostgreSQL, Sybase, Hana] +2023-01-10 14:50:11.250 [Thread-3] INFO o.s.w.context.support.GenericWebApplicationContext - Closing org.springframework.web.context.support.GenericWebApplicationContext@6b5894c8: startup date [Tue Jan 10 14:46:53 CST 2023]; root of context hierarchy +2023-01-10 14:50:46.451 [main] INFO o.s.b.t.context.SpringBootTestContextBootstrapper - Neither @ContextConfiguration nor @ContextHierarchy found for test class [cn.fw.parts.AcquirePartsTest], using SpringBootContextLoader +2023-01-10 14:50:46.465 [main] INFO o.s.test.context.support.AbstractContextLoader - Could not detect default resource locations for test class [cn.fw.parts.AcquirePartsTest]: no resource found for suffixes {-context.xml, Context.groovy}. +2023-01-10 14:50:46.711 [main] INFO o.s.b.t.context.SpringBootTestContextBootstrapper - Loaded default TestExecutionListener class names from location [META-INF/spring.factories]: [org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener, org.springframework.boot.test.mock.mockito.ResetMocksTestExecutionListener, org.springframework.boot.test.autoconfigure.restdocs.RestDocsTestExecutionListener, org.springframework.boot.test.autoconfigure.web.client.MockRestServiceServerResetTestExecutionListener, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcPrintOnlyOnFailureTestExecutionListener, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverTestExecutionListener, org.springframework.test.context.web.ServletTestExecutionListener, org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener, org.springframework.test.context.support.DependencyInjectionTestExecutionListener, org.springframework.test.context.support.DirtiesContextTestExecutionListener, org.springframework.test.context.transaction.TransactionalTestExecutionListener, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener] +2023-01-10 14:50:46.845 [main] INFO o.s.b.t.context.SpringBootTestContextBootstrapper - Using TestExecutionListeners: [org.springframework.test.context.web.ServletTestExecutionListener@7a5ceedd, org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener@4201c465, org.springframework.boot.test.autoconfigure.SpringBootDependencyInjectionTestExecutionListener@5b799640, org.springframework.test.context.support.DirtiesContextTestExecutionListener@6cb107fd, org.springframework.test.context.transaction.TransactionalTestExecutionListener@710636b0, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener@3de8f619, org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener@2ab4bc72, org.springframework.boot.test.mock.mockito.ResetMocksTestExecutionListener@4e5ed836, org.springframework.boot.test.autoconfigure.restdocs.RestDocsTestExecutionListener@eadd4fb, org.springframework.boot.test.autoconfigure.web.client.MockRestServiceServerResetTestExecutionListener@740fb309, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcPrintOnlyOnFailureTestExecutionListener@7bd7d6d6, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverTestExecutionListener@43f02ef2] +2023-01-10 14:50:48.048 [main] INFO cn.fw.parts.AcquirePartsTest - Starting AcquirePartsTest on baiyun with PID 23416 (started by macbookpro in /Users/baiyun/develop/sbmp) +2023-01-10 14:50:48.048 [main] INFO cn.fw.parts.AcquirePartsTest - No active profile set, falling back to default profiles: default +2023-01-10 14:50:48.111 [main] INFO o.s.w.context.support.GenericWebApplicationContext - Refreshing org.springframework.web.context.support.GenericWebApplicationContext@1433046b: startup date [Tue Jan 10 14:50:48 CST 2023]; root of context hierarchy +2023-01-10 14:50:48.676 [background-preinit] INFO org.hibernate.validator.internal.util.Version - HV000001: Hibernate Validator 5.3.6.Final +2023-01-10 14:50:52.008 [main] INFO o.s.w.s.m.m.a.RequestMappingHandlerAdapter - Looking for @ControllerAdvice: org.springframework.web.context.support.GenericWebApplicationContext@1433046b: startup date [Tue Jan 10 14:50:48 CST 2023]; root of context hierarchy +2023-01-10 14:50:52.245 [main] INFO o.s.w.s.m.m.a.RequestMappingHandlerMapping - Mapped "{[/error],produces=[text/html]}" onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse) +2023-01-10 14:50:52.246 [main] INFO o.s.w.s.m.m.a.RequestMappingHandlerMapping - Mapped "{[/error]}" onto public org.springframework.http.ResponseEntity> org.springframework.boot.autoconfigure.web.BasicErrorController.error(javax.servlet.http.HttpServletRequest) +2023-01-10 14:50:52.298 [main] INFO o.s.web.servlet.handler.SimpleUrlHandlerMapping - Mapped URL path [/webjars/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler] +2023-01-10 14:50:52.299 [main] INFO o.s.web.servlet.handler.SimpleUrlHandlerMapping - Mapped URL path [/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler] +2023-01-10 14:50:52.352 [main] INFO o.s.web.servlet.handler.SimpleUrlHandlerMapping - Mapped URL path [/**/favicon.ico] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler] +2023-01-10 14:50:52.727 [main] INFO cn.fw.parts.AcquirePartsTest - Started AcquirePartsTest in 5.491 seconds (JVM running for 8.252) diff --git a/src/main/java/com/sucl/sbmp/sys/biz/SpecPartBiz.java b/src/main/java/com/sucl/sbmp/sys/biz/SpecPartBiz.java new file mode 100644 index 0000000..8a894f8 --- /dev/null +++ b/src/main/java/com/sucl/sbmp/sys/biz/SpecPartBiz.java @@ -0,0 +1,62 @@ +package com.sucl.sbmp.sys.biz; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.sucl.sbmp.sys.entity.SpecPart; +import com.sucl.sbmp.sys.entity.TempScName; +import com.sucl.sbmp.sys.entity.TempScParts; +import com.sucl.sbmp.sys.service.SpecPartService; +import com.sucl.sbmp.sys.service.TempScNameService; +import com.sucl.sbmp.sys.service.TempScPartsService; +import lombok.AllArgsConstructor; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +@Service +@AllArgsConstructor +public class SpecPartBiz { + private final TempScPartsService partsService; + private final TempScNameService nameService; + private final SpecPartService specPartService; + /** + * 将抽取的数据转换到spec_part表中 + * + * 调用接口之前将TempScName的yn数据设置为0 + */ + public void transferData() { + for (int i = 1; i < 100; i++) { + Page page = new Page<>(i, 1000); + nameService.page(page, Wrappers.lambdaQuery().eq(TempScName::getYn, false)); + for (TempScName tempScName : page.getRecords()) { + try { + List specParts = new ArrayList<>(); + List scParts = partsService.list(Wrappers.lambdaQuery() + .eq(TempScParts::getScId, tempScName.getScId())); + List oldCodes = U.collIds(specPartService.list(Wrappers.lambdaQuery() + .select(SpecPart::getPartCode) + .eq(SpecPart::getSpecCode, tempScName.getCode())), SpecPart::getPartCode); + Map partCodeMap = U.transferMap(scParts, TempScParts::getPartNumber, it -> 1, Integer::sum); + partCodeMap.forEach((k, v) -> { + if (!oldCodes.contains(k)) { + SpecPart specPart = new SpecPart(); + specPart.setPartCode(k); + specPart.setPartCount(v); + specPart.setSpecCode(tempScName.getCode()); + specPart.setStdType(1); + specParts.add(specPart); + } + }); + tempScName.setYn(Boolean.TRUE); + nameService.updateById(tempScName); + U.groupUpdateData(specParts, specPartService::saveOrUpdateBatch); + } catch (Exception e) { + e.printStackTrace(); + } + } + } + } +} diff --git a/src/main/java/com/sucl/sbmp/sys/entity/SpecPart.java b/src/main/java/com/sucl/sbmp/sys/entity/SpecPart.java new file mode 100644 index 0000000..7e5e36f --- /dev/null +++ b/src/main/java/com/sucl/sbmp/sys/entity/SpecPart.java @@ -0,0 +1,52 @@ +package com.sucl.sbmp.sys.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 车型配件 + *

+ * create at 2019-12-31 + * + * @author 钟奉池 + */ +@Data +@NoArgsConstructor +public class SpecPart{ + @TableId(type = IdType.AUTO) + protected Long id; + /** + * 品牌id + */ + private Long brandId; + /** + * 车系id + */ + private Long seriesId; + /** + * 车型id + */ + private Long modelId; + /** + * 配置代码 + */ + private String specCode; + /** + * 配件代码 + */ + private String partCode; + /** + * 配件名称 + */ + private String partName; + /** + * 使用数量 + */ + private Integer partCount; + /** + * 标准类型 (1:厂家标准,2:霏微标准) + */ + private Integer stdType; +} diff --git a/src/main/java/com/sucl/sbmp/sys/mapper/SpecPartMapper.java b/src/main/java/com/sucl/sbmp/sys/mapper/SpecPartMapper.java new file mode 100644 index 0000000..63e9bb7 --- /dev/null +++ b/src/main/java/com/sucl/sbmp/sys/mapper/SpecPartMapper.java @@ -0,0 +1,10 @@ +package com.sucl.sbmp.sys.mapper; + + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.sucl.sbmp.sys.entity.SpecPart; +import org.springframework.stereotype.Repository; + +@Repository +public interface SpecPartMapper extends BaseMapper { +} diff --git a/src/main/java/com/sucl/sbmp/sys/service/SpecPartService.java b/src/main/java/com/sucl/sbmp/sys/service/SpecPartService.java new file mode 100644 index 0000000..c4011a5 --- /dev/null +++ b/src/main/java/com/sucl/sbmp/sys/service/SpecPartService.java @@ -0,0 +1,8 @@ +package com.sucl.sbmp.sys.service; + + +import com.baomidou.mybatisplus.extension.service.IService; +import com.sucl.sbmp.sys.entity.SpecPart; + +public interface SpecPartService extends IService { +} diff --git a/src/main/java/com/sucl/sbmp/sys/service/impl/SpecPartServiceImpl.java b/src/main/java/com/sucl/sbmp/sys/service/impl/SpecPartServiceImpl.java new file mode 100644 index 0000000..615125a --- /dev/null +++ b/src/main/java/com/sucl/sbmp/sys/service/impl/SpecPartServiceImpl.java @@ -0,0 +1,12 @@ +package com.sucl.sbmp.sys.service.impl; + + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.sucl.sbmp.sys.entity.SpecPart; +import com.sucl.sbmp.sys.mapper.SpecPartMapper; +import com.sucl.sbmp.sys.service.SpecPartService; +import org.springframework.stereotype.Service; + +@Service +public class SpecPartServiceImpl extends ServiceImpl implements SpecPartService { +} diff --git a/src/test/java/cn/fw/parts/AcquirePartsTest.java b/src/test/java/cn/fw/parts/AcquirePartsTest.java index 1158657..b640c45 100644 --- a/src/test/java/cn/fw/parts/AcquirePartsTest.java +++ b/src/test/java/cn/fw/parts/AcquirePartsTest.java @@ -3,6 +3,7 @@ package cn.fw.parts; import com.sucl.sbmp.MpStartApplication; import com.sucl.sbmp.sys.biz.ChanganAutoEpcPartsBiz; import com.sucl.sbmp.sys.biz.OldChanganAutoEpcPartsBiz; +import com.sucl.sbmp.sys.biz.SpecPartBiz; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -26,7 +27,8 @@ import java.util.concurrent.CompletableFuture; //@TestPropertySource(properties = { "spring.config.location = classpath:test.properties" }) public class AcquirePartsTest { private HashMap token; - + @Autowired + private SpecPartBiz specPartBiz; @Autowired private ChanganAutoEpcPartsBiz changanAutoEpcPartsBiz; @@ -36,6 +38,14 @@ public class AcquirePartsTest { // this.token = this.changanAutoEpcPartsBiz.setToken("381ec1fa12a84dce81e1d05db15bcc34"); this.token = this.changanAutoEpcPartsBiz.setToken("77054ffe926c416bb0d48412ab734f3f"); } + + /** + * 将抽取的数据转换到specpart表中 + */ + @Test + public void transferData(){ + specPartBiz.transferData(); + } /** * 新版EPC数据抽取 */ @@ -52,7 +62,7 @@ public class AcquirePartsTest { // 根据具体车款获取备件模块 // this.changanAutoEpcPartsBiz.selectModuleByScId(token); // 根据模块获取备件 - this.changanAutoEpcPartsBiz.selectPartsByModule(token); +// this.changanAutoEpcPartsBiz.selectPartsByModule(token); } /** -- libgit2 0.22.2