Commit 3bbba332 by 软件中心

小程序数据报告独立工程

parent 75c6c9f8
2024-09-24 15:56:50,314 INFO (StartupInfoLogger.java:55)- Starting DjmDataReportApplication using Java 1.8.0_191 on DESKTOP-AB45DQR with PID 1384 (F:\workspace\djm-data-report\target\classes started by Administrator in F:\workspace\djm-data-report)
2024-09-24 15:56:50,320 DEBUG (StartupInfoLogger.java:56)- Running with Spring Boot v2.7.6, Spring v5.3.24
2024-09-24 15:56:50,321 INFO (SpringApplication.java:637)- The following 1 profile is active: "test"
2024-09-24 15:56:55,467 INFO (StartupInfoLogger.java:61)- Started DjmDataReportApplication in 5.883 seconds (JVM running for 8.921)
2024-09-24 15:56:55,471 INFO (DjmDataReportApplication.java:15)- __ __
/ \~~~/ \
,----( .. )
/ \__ __/
/| (\ |(
^ \ /___\ /\ |
|__| |__|-"
---------------djm-data-report------------start------->>>>>--------
2024-09-24 15:57:51,077 INFO (TestController.java:19)- ok
2024-10-08 14:05:28,386 INFO (StartupInfoLogger.java:55)- Starting DjmDataReportApplication using Java 1.8.0_191 on DESKTOP-AB45DQR with PID 48048 (F:\workspace\djm-data-report\target\classes started by Administrator in F:\workspace\djm-data-report)
2024-10-08 14:05:28,395 DEBUG (StartupInfoLogger.java:56)- Running with Spring Boot v2.7.6, Spring v5.3.24
2024-10-08 14:05:28,396 INFO (SpringApplication.java:637)- The following 1 profile is active: "test"
2024-10-08 14:06:36,279 INFO (StartupInfoLogger.java:55)- Starting DjmDataReportApplication using Java 1.8.0_191 on DESKTOP-AB45DQR with PID 70364 (F:\workspace\djm-data-report\target\classes started by Administrator in F:\workspace\djm-data-report)
2024-10-08 14:06:36,283 DEBUG (StartupInfoLogger.java:56)- Running with Spring Boot v2.7.6, Spring v5.3.24
2024-10-08 14:06:36,284 INFO (SpringApplication.java:637)- The following 1 profile is active: "test"
2024-10-08 14:08:16,849 INFO (StartupInfoLogger.java:55)- Starting DjmDataReportApplication using Java 1.8.0_191 on DESKTOP-AB45DQR with PID 37868 (F:\workspace\djm-data-report\target\classes started by Administrator in F:\workspace\djm-data-report)
2024-10-08 14:08:16,852 DEBUG (StartupInfoLogger.java:56)- Running with Spring Boot v2.7.6, Spring v5.3.24
2024-10-08 14:08:16,853 INFO (SpringApplication.java:637)- The following 1 profile is active: "test"
2024-10-08 14:10:44,175 INFO (StartupInfoLogger.java:55)- Starting DjmDataReportApplication using Java 1.8.0_191 on DESKTOP-AB45DQR with PID 20272 (F:\workspace\djm-data-report\target\classes started by Administrator in F:\workspace\djm-data-report)
2024-10-08 14:10:44,178 DEBUG (StartupInfoLogger.java:56)- Running with Spring Boot v2.7.6, Spring v5.3.24
2024-10-08 14:10:44,179 INFO (SpringApplication.java:637)- The following 1 profile is active: "test"
2024-10-08 14:17:27,601 INFO (StartupInfoLogger.java:55)- Starting DjmDataReportApplication using Java 1.8.0_191 on DESKTOP-AB45DQR with PID 31328 (F:\workspace\djm-data-report\target\classes started by Administrator in F:\workspace\djm-data-report)
2024-10-08 14:17:27,605 DEBUG (StartupInfoLogger.java:56)- Running with Spring Boot v2.7.6, Spring v5.3.24
2024-10-08 14:17:27,605 INFO (SpringApplication.java:637)- The following 1 profile is active: "test"
2024-10-08 14:32:50,892 INFO (StartupInfoLogger.java:55)- Starting DjmDataReportApplication using Java 1.8.0_191 on DESKTOP-AB45DQR with PID 44904 (F:\workspace\djm-data-report\target\classes started by Administrator in F:\workspace\djm-data-report)
2024-10-08 14:32:50,895 DEBUG (StartupInfoLogger.java:56)- Running with Spring Boot v2.7.6, Spring v5.3.24
2024-10-08 14:32:50,895 INFO (SpringApplication.java:637)- The following 1 profile is active: "test"
2024-10-08 14:43:04,071 INFO (StartupInfoLogger.java:55)- Starting DjmDataReportApplication using Java 1.8.0_191 on DESKTOP-AB45DQR with PID 56608 (F:\workspace\djm-data-report\target\classes started by Administrator in F:\workspace\djm-data-report)
2024-10-08 14:43:04,074 DEBUG (StartupInfoLogger.java:56)- Running with Spring Boot v2.7.6, Spring v5.3.24
2024-10-08 14:43:04,075 INFO (SpringApplication.java:637)- The following 1 profile is active: "test"
2024-10-08 14:45:46,703 INFO (StartupInfoLogger.java:55)- Starting DjmDataReportApplication using Java 1.8.0_191 on DESKTOP-AB45DQR with PID 42808 (F:\workspace\djm-data-report\target\classes started by Administrator in F:\workspace\djm-data-report)
2024-10-08 14:45:46,706 DEBUG (StartupInfoLogger.java:56)- Running with Spring Boot v2.7.6, Spring v5.3.24
2024-10-08 14:45:46,707 INFO (SpringApplication.java:637)- The following 1 profile is active: "test"
2024-10-08 14:47:18,325 INFO (StartupInfoLogger.java:55)- Starting DjmDataReportApplication using Java 1.8.0_191 on DESKTOP-AB45DQR with PID 11912 (F:\workspace\djm-data-report\target\classes started by Administrator in F:\workspace\djm-data-report)
2024-10-08 14:47:18,328 DEBUG (StartupInfoLogger.java:56)- Running with Spring Boot v2.7.6, Spring v5.3.24
2024-10-08 14:47:18,330 INFO (SpringApplication.java:637)- The following 1 profile is active: "test"
2024-10-08 14:47:24,413 INFO (StartupInfoLogger.java:61)- Started DjmDataReportApplication in 6.651 seconds (JVM running for 8.035)
2024-10-08 14:47:24,416 INFO (DjmDataReportApplication.java:15)- __ __
/ \~~~/ \
,----( .. )
/ \__ __/
/| (\ |(
^ \ /___\ /\ |
|__| |__|-"
---------------djm-data-report------------start------->>>>>--------
2024-10-08 14:49:58,806 INFO (StartupInfoLogger.java:55)- Starting DjmDataReportApplication using Java 1.8.0_191 on DESKTOP-AB45DQR with PID 57908 (F:\workspace\djm-data-report\target\classes started by Administrator in F:\workspace\djm-data-report)
2024-10-08 14:49:58,810 DEBUG (StartupInfoLogger.java:56)- Running with Spring Boot v2.7.6, Spring v5.3.24
2024-10-08 14:49:58,810 INFO (SpringApplication.java:637)- The following 1 profile is active: "test"
2024-10-08 14:50:05,558 INFO (StartupInfoLogger.java:61)- Started DjmDataReportApplication in 7.452 seconds (JVM running for 9.142)
2024-10-08 14:50:05,561 INFO (DjmDataReportApplication.java:15)- __ __
/ \~~~/ \
,----( .. )
/ \__ __/
/| (\ |(
^ \ /___\ /\ |
|__| |__|-"
---------------djm-data-report------------start------->>>>>--------
2024-10-08 14:58:34,949 INFO (StartupInfoLogger.java:55)- Starting DjmDataReportApplication using Java 1.8.0_191 on DESKTOP-AB45DQR with PID 38908 (F:\workspace\djm-data-report\target\classes started by Administrator in F:\workspace\djm-data-report)
2024-10-08 14:58:34,953 DEBUG (StartupInfoLogger.java:56)- Running with Spring Boot v2.7.6, Spring v5.3.24
2024-10-08 14:58:34,954 INFO (SpringApplication.java:637)- The following 1 profile is active: "test"
2024-10-08 14:59:18,516 INFO (StartupInfoLogger.java:55)- Starting DjmDataReportApplication using Java 1.8.0_191 on DESKTOP-AB45DQR with PID 82564 (F:\workspace\djm-data-report\target\classes started by Administrator in F:\workspace\djm-data-report)
2024-10-08 14:59:18,520 DEBUG (StartupInfoLogger.java:56)- Running with Spring Boot v2.7.6, Spring v5.3.24
2024-10-08 14:59:18,520 INFO (SpringApplication.java:637)- The following 1 profile is active: "test"
2024-10-08 15:00:52,673 INFO (StartupInfoLogger.java:55)- Starting DjmDataReportApplication using Java 1.8.0_191 on DESKTOP-AB45DQR with PID 46512 (F:\workspace\djm-data-report\target\classes started by Administrator in F:\workspace\djm-data-report)
2024-10-08 15:00:52,678 DEBUG (StartupInfoLogger.java:56)- Running with Spring Boot v2.7.6, Spring v5.3.24
2024-10-08 15:00:52,678 INFO (SpringApplication.java:637)- The following 1 profile is active: "test"
2024-10-08 15:08:35,857 INFO (StartupInfoLogger.java:55)- Starting DjmDataReportApplication using Java 1.8.0_191 on DESKTOP-AB45DQR with PID 25152 (F:\workspace\djm-data-report\target\classes started by Administrator in F:\workspace\djm-data-report)
2024-10-08 15:08:35,861 DEBUG (StartupInfoLogger.java:56)- Running with Spring Boot v2.7.6, Spring v5.3.24
2024-10-08 15:08:35,861 INFO (SpringApplication.java:637)- The following 1 profile is active: "test"
2024-10-08 15:20:54,260 INFO (StartupInfoLogger.java:55)- Starting DjmDataReportApplication using Java 1.8.0_191 on DESKTOP-AB45DQR with PID 83964 (F:\workspace\djm-data-report\target\classes started by Administrator in F:\workspace\djm-data-report)
2024-10-08 15:20:54,264 DEBUG (StartupInfoLogger.java:56)- Running with Spring Boot v2.7.6, Spring v5.3.24
2024-10-08 15:20:54,265 INFO (SpringApplication.java:637)- The following 1 profile is active: "test"
2024-10-08 15:22:20,862 INFO (StartupInfoLogger.java:55)- Starting DjmDataReportApplication using Java 1.8.0_191 on DESKTOP-AB45DQR with PID 50788 (F:\workspace\djm-data-report\target\classes started by Administrator in F:\workspace\djm-data-report)
2024-10-08 15:22:20,865 DEBUG (StartupInfoLogger.java:56)- Running with Spring Boot v2.7.6, Spring v5.3.24
2024-10-08 15:22:20,866 INFO (SpringApplication.java:637)- The following 1 profile is active: "test"
2024-10-08 15:22:28,052 INFO (StartupInfoLogger.java:61)- Started DjmDataReportApplication in 7.932 seconds (JVM running for 9.463)
2024-10-08 15:22:28,066 INFO (DjmDataReportApplication.java:15)- __ __
/ \~~~/ \
,----( .. )
/ \__ __/
/| (\ |(
^ \ /___\ /\ |
|__| |__|-"
---------------djm-data-report------------start------->>>>>--------
2024-10-08 15:26:41,114 ERROR (GlobalExceptionHandler.java:19)- 异常信息null
java.lang.NullPointerException: null
at com.nimbusds.jose.JOSEObject.split(JOSEObject.java:214)
at com.nimbusds.jose.JWSObject.parse(JWSObject.java:414)
at com.dr.filter.token.JwtHelper.parseTokenData(JwtHelper.java:187)
at com.dr.service.impl.MeowShopDataReportServiceImpl.parseToken(MeowShopDataReportServiceImpl.java:871)
at com.dr.service.impl.MeowShopDataReportServiceImpl.selectAgeDistribution(MeowShopDataReportServiceImpl.java:455)
at com.dr.controller.MeowShopDataReportController.selectAgeDistribution(MeowShopDataReportController.java:204)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:150)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:117)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:808)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1071)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:964)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:696)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:779)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:177)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:135)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:360)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:399)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:891)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1784)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)
2024-10-19 14:09:47,671 INFO (StartupInfoLogger.java:55)- Starting DjmDataReportApplication using Java 1.8.0_191 on DESKTOP-AB45DQR with PID 36960 (F:\workspace\djm-data-report\target\classes started by Administrator in F:\workspace\djm-data-report)
2024-10-19 14:09:47,715 DEBUG (StartupInfoLogger.java:56)- Running with Spring Boot v2.7.6, Spring v5.3.24
2024-10-19 14:09:47,716 INFO (SpringApplication.java:637)- The following 1 profile is active: "test"
2024-10-19 14:11:18,337 INFO (StartupInfoLogger.java:55)- Starting DjmDataReportApplication using Java 1.8.0_191 on DESKTOP-AB45DQR with PID 36096 (F:\workspace\djm-data-report\target\classes started by Administrator in F:\workspace\djm-data-report)
2024-10-19 14:11:18,343 DEBUG (StartupInfoLogger.java:56)- Running with Spring Boot v2.7.6, Spring v5.3.24
2024-10-19 14:11:18,344 INFO (SpringApplication.java:637)- The following 1 profile is active: "test"
2024-10-19 14:28:14,294 INFO (StartupInfoLogger.java:55)- Starting DjmDataReportApplication using Java 1.8.0_191 on DESKTOP-AB45DQR with PID 71428 (F:\workspace\djm-data-report\target\classes started by Administrator in F:\workspace\djm-data-report)
2024-10-19 14:28:14,301 DEBUG (StartupInfoLogger.java:56)- Running with Spring Boot v2.7.6, Spring v5.3.24
2024-10-19 14:28:14,303 INFO (SpringApplication.java:637)- The following 1 profile is active: "test"
2024-10-19 14:28:22,951 INFO (StartupInfoLogger.java:61)- Started DjmDataReportApplication in 10.084 seconds (JVM running for 12.948)
2024-10-19 14:28:22,958 INFO (DjmDataReportApplication.java:15)- __ __
/ \~~~/ \
,----( .. )
/ \__ __/
/| (\ |(
^ \ /___\ /\ |
|__| |__|-"
---------------djm-data-report------------start------->>>>>--------
2024-10-19 14:31:35,955 ERROR (GlobalExceptionHandler.java:19)- 异常信息Required request parameter 'lineCityId' for method parameter type Long is not present
org.springframework.web.bind.MissingServletRequestParameterException: Required request parameter 'lineCityId' for method parameter type Long is not present
at org.springframework.web.method.annotation.RequestParamMethodArgumentResolver.handleMissingValueInternal(RequestParamMethodArgumentResolver.java:218)
at org.springframework.web.method.annotation.RequestParamMethodArgumentResolver.handleMissingValue(RequestParamMethodArgumentResolver.java:193)
at org.springframework.web.method.annotation.AbstractNamedValueMethodArgumentResolver.resolveArgument(AbstractNamedValueMethodArgumentResolver.java:114)
at org.springframework.web.method.support.HandlerMethodArgumentResolverComposite.resolveArgument(HandlerMethodArgumentResolverComposite.java:122)
at org.springframework.web.method.support.InvocableHandlerMethod.getMethodArgumentValues(InvocableHandlerMethod.java:179)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:146)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:117)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:808)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1071)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:964)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:696)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:779)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:177)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:135)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:360)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:399)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:891)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1784)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)
2024-10-21 16:45:25,139 INFO (StartupInfoLogger.java:55)- Starting DjmDataReportApplication using Java 1.8.0_191 on DESKTOP-AB45DQR with PID 38584 (F:\workspace\djm-data-report\target\classes started by Administrator in F:\workspace\djm-data-report)
2024-10-21 16:45:25,175 DEBUG (StartupInfoLogger.java:56)- Running with Spring Boot v2.7.6, Spring v5.3.24
2024-10-21 16:45:25,176 INFO (SpringApplication.java:637)- The following 1 profile is active: "test"
2024-10-21 16:45:36,531 INFO (StartupInfoLogger.java:61)- Started DjmDataReportApplication in 12.502 seconds (JVM running for 14.814)
2024-10-21 16:45:36,536 INFO (DjmDataReportApplication.java:15)- __ __
/ \~~~/ \
,----( .. )
/ \__ __/
/| (\ |(
^ \ /___\ /\ |
|__| |__|-"
---------------djm-data-report------------start------->>>>>--------
2024-10-21 16:46:33,183 INFO (StartupInfoLogger.java:55)- Starting DjmDataReportApplication using Java 1.8.0_191 on DESKTOP-AB45DQR with PID 83028 (F:\workspace\djm-data-report\target\classes started by Administrator in F:\workspace\djm-data-report)
2024-10-21 16:46:33,186 DEBUG (StartupInfoLogger.java:56)- Running with Spring Boot v2.7.6, Spring v5.3.24
2024-10-21 16:46:33,187 INFO (SpringApplication.java:637)- The following 1 profile is active: "test"
2024-10-21 16:46:41,192 INFO (StartupInfoLogger.java:61)- Started DjmDataReportApplication in 8.861 seconds (JVM running for 10.869)
2024-10-21 16:46:41,198 INFO (DjmDataReportApplication.java:15)- __ __
/ \~~~/ \
,----( .. )
/ \__ __/
/| (\ |(
^ \ /___\ /\ |
|__| |__|-"
---------------djm-data-report------------start------->>>>>--------
2024-10-21 16:47:21,364 INFO (StartupInfoLogger.java:55)- Starting DjmDataReportApplication using Java 1.8.0_191 on DESKTOP-AB45DQR with PID 17440 (F:\workspace\djm-data-report\target\classes started by Administrator in F:\workspace\djm-data-report)
2024-10-21 16:47:21,367 DEBUG (StartupInfoLogger.java:56)- Running with Spring Boot v2.7.6, Spring v5.3.24
2024-10-21 16:47:21,368 INFO (SpringApplication.java:637)- The following 1 profile is active: "test"
2024-10-21 16:47:28,529 INFO (StartupInfoLogger.java:61)- Started DjmDataReportApplication in 7.797 seconds (JVM running for 9.374)
2024-10-21 16:47:28,532 INFO (DjmDataReportApplication.java:15)- __ __
/ \~~~/ \
,----( .. )
/ \__ __/
/| (\ |(
^ \ /___\ /\ |
|__| |__|-"
---------------djm-data-report------------start------->>>>>--------
2024-10-21 16:48:29,905 INFO (StartupInfoLogger.java:55)- Starting DjmDataReportApplication using Java 1.8.0_191 on DESKTOP-AB45DQR with PID 6452 (F:\workspace\djm-data-report\target\classes started by Administrator in F:\workspace\djm-data-report)
2024-10-21 16:48:29,910 DEBUG (StartupInfoLogger.java:56)- Running with Spring Boot v2.7.6, Spring v5.3.24
2024-10-21 16:48:29,910 INFO (SpringApplication.java:637)- The following 1 profile is active: "test"
2024-10-21 16:48:36,809 INFO (StartupInfoLogger.java:61)- Started DjmDataReportApplication in 7.541 seconds (JVM running for 9.176)
2024-10-21 16:48:36,812 INFO (DjmDataReportApplication.java:15)- __ __
/ \~~~/ \
,----( .. )
/ \__ __/
/| (\ |(
^ \ /___\ /\ |
|__| |__|-"
---------------djm-data-report------------start------->>>>>--------
...@@ -120,6 +120,41 @@ ...@@ -120,6 +120,41 @@
<artifactId>knife4j-spring-boot-starter</artifactId> <artifactId>knife4j-spring-boot-starter</artifactId>
<version>${knife4j.version}</version> <version>${knife4j.version}</version>
</dependency> </dependency>
<dependency>
<groupId>com.nimbusds</groupId>
<artifactId>nimbus-jose-jwt</artifactId>
<version>7.6</version>
</dependency>
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>2.2.2</version>
</dependency>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
<version>3.5.1</version>
<exclusions>
<exclusion>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-generator</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- rabbitmq -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-amqp</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-websocket</artifactId>
</dependency>
<!-- <dependency>--> <!-- <dependency>-->
<!-- <groupId>org.slf4j</groupId>--> <!-- <groupId>org.slf4j</groupId>-->
<!-- <artifactId>slf4j-api</artifactId>--> <!-- <artifactId>slf4j-api</artifactId>-->
......
package com.dr.config;
import org.springframework.amqp.core.*;
import org.springframework.amqp.rabbit.config.SimpleRabbitListenerContainerFactory;
import org.springframework.amqp.rabbit.connection.ConnectionFactory;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.amqp.support.converter.Jackson2JsonMessageConverter;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import java.util.HashMap;
import java.util.Map;
@Configuration
public class RabbitMqConfig {
@Bean
public RabbitTemplate rabbitTemplate(ConnectionFactory connectionFactory) {
RabbitTemplate rabbitTemplate = new RabbitTemplate(connectionFactory);
rabbitTemplate.setMessageConverter(new Jackson2JsonMessageConverter());
return rabbitTemplate;
}
@Bean
public SimpleRabbitListenerContainerFactory rabbitListenerContainerFactory(ConnectionFactory connectionFactory) {
SimpleRabbitListenerContainerFactory factory = new SimpleRabbitListenerContainerFactory();
factory.setAcknowledgeMode(AcknowledgeMode.MANUAL);
factory.setConnectionFactory(connectionFactory);
factory.setMessageConverter(new Jackson2JsonMessageConverter());
return factory;
}
/**********************************用户下单后确定代理商门店绑定关系****************************************/
private final static String PROXY_SHOP_QUEUE = "proxyShopQueue";
private final static String PROXY_SHOP_KEY = "proxyShopKey";
private final static String PROXY_SHOP_EXCHANGE = "proxyShopExchange";
public static String getProxyShopKey() {
return PROXY_SHOP_KEY;
}
public static String getProxyShopExchange() {
return PROXY_SHOP_EXCHANGE;
}
@Bean
public Queue proxyShopQueue() {
return new Queue(PROXY_SHOP_QUEUE,true);
}
@Bean
public DirectExchange proxyShopExchange() {
return new DirectExchange(PROXY_SHOP_EXCHANGE, true, false);
}
@Bean
public Binding bindProxyShopExchangeDirect() {
return BindingBuilder.bind(proxyShopQueue()).to(proxyShopExchange()).with(PROXY_SHOP_KEY);
}
/**********************************用户下单后确定代理商门店绑定关系****************************************/
/**********************************用户购买指定商品开通VIP****************************************/
private final static String USER_VIP_QUEUE = "userVipQueue";
private final static String USER_VIP_KEY = "userVipKey";
private final static String USER_VIP_EXCHANGE = "userVipExchange";
public static String getUserVipKey() {
return USER_VIP_KEY;
}
public static String getUserVipExchange() {
return USER_VIP_EXCHANGE;
}
@Bean
public Queue userVipQueue() {
return new Queue(USER_VIP_QUEUE,true);
}
@Bean
public DirectExchange userVipExchange() {
return new DirectExchange(USER_VIP_EXCHANGE,true, false);
}
@Bean
public Binding bindUserVipExchangeDirect() {
return BindingBuilder.bind(userVipQueue()).to(userVipExchange()).with(USER_VIP_KEY);
}
/**********************************用户购买指定商品开通VIP****************************************/
/**********************************修改指定时间未审核的报价的状态****************************************/
private final static String COMMODITY_QUOTATION_QUEUE = "commodityQuotationQueue";
private final static String COMMODITY_QUOTATION_KEY = "commodityQuotationKey";
private final static String COMMODITY_QUOTATION_EXCHANGE = "commodityQuotationExchange";
public static String getCommodityQuotationKey() {
return COMMODITY_QUOTATION_KEY;
}
public static String getCommodityQuotationExchange() {
return COMMODITY_QUOTATION_EXCHANGE;
}
@Bean
public Queue commodityQuotationQueue() {
return new Queue(COMMODITY_QUOTATION_QUEUE,true);
}
@Bean
public CustomExchange commodityQuotationExchange() {
Map<String, Object> args = new HashMap<>(2);
args.put("x-delayed-type", "direct");
return new CustomExchange(COMMODITY_QUOTATION_EXCHANGE, "x-delayed-message", true, false, args);
}
@Bean
public Binding bindCommodityQuotationDelay() {
return BindingBuilder.bind(commodityQuotationQueue()).to(commodityQuotationExchange()).with(COMMODITY_QUOTATION_KEY).noargs();
}
/**********************************修改指定时间未审核的报价的状态****************************************/
/**********************************苗医生相关数据推送****************************************/
private final static String MYS_DATA_QUEUE = "reSyncDataQueue";
private final static String MYS_DATA_KEY = "mysDataKey";
private final static String MYS_DATA_EXCHANGE = "mysDataExchange";
public static String getMysDataKey() {
return MYS_DATA_KEY;
}
public static String getMysDataExchange() {
return MYS_DATA_EXCHANGE;
}
@Bean
public Queue mysDataQueue() {
return new Queue(MYS_DATA_QUEUE,true);
}
@Bean
public CustomExchange mysDataExchange() {
Map<String, Object> args = new HashMap<>(2);
args.put("x-delayed-type", "direct");
return new CustomExchange(MYS_DATA_EXCHANGE, "x-delayed-message", true, false, args);
}
@Bean
public Binding mysDataDelay() {
return BindingBuilder.bind(mysDataQueue()).to(mysDataExchange()).with(MYS_DATA_KEY).noargs();
}
/**********************************苗医生相关数据推送****************************************/
/**********************************数据板块统计相关数据推送****************************************/
public static final String SYNC_SKIN_PROBLEM_DATA_QUEUE = "syncSkinProblemDataQueue";
public static final String SYNC_SKIN_PROBLEM_DATA_KEY = "syncSkinProblemDatakey";
public static final String SYNC_SKIN_PROBLEM_DATA_EXCHANGE = "syncSkinProblemDataExchange";
public static final String SYNC_NEW_SKIN_PROBLEM_DATA_EXCHANGE = "syncNewSkinProblemDataExchange";
public static final String SYNC_NEW_SKIN_PROBLEM_DATA_KEY = "syncNewSkinProblemDatakey";
public static final String SYNC_NEW_SKIN_PROBLEM_DATA_QUEUE = "syncNewSkinProblemDataQueue";
//门店数据同步
public static final String SYNC_NEW_ORG_AND_SHOP_KEY = "syncNewOrgAndShopKey";
public static final String SYNC_NEW_ORG_AND_SHOP_QUEUE = "syncNewOrgAndShopQueue";
public static final String SYNC_NEW_ORG_AND_SHOP_EXCHANGE = "syncNewOrgAndShopExchange";
@Bean
public Queue syncSkinProblemDataQueue() {
return new Queue(SYNC_SKIN_PROBLEM_DATA_QUEUE,true);
}
@Bean
public DirectExchange syncSkinProblemDataExchange() {
return new DirectExchange(SYNC_SKIN_PROBLEM_DATA_EXCHANGE,true,false);
}
@Bean
public Binding syncSkinProblemDatakeyDelay() {
return BindingBuilder.bind(syncSkinProblemDataQueue()).to(syncSkinProblemDataExchange()).with(SYNC_SKIN_PROBLEM_DATA_KEY);
}
@Bean
public DirectExchange syncNewSkinProblemDataExchange() {
return new DirectExchange(SYNC_NEW_SKIN_PROBLEM_DATA_EXCHANGE,true,false);
}
/**
* 同步物联网数据队列
* @return
*/
@Bean
public Queue syncNewSkinProblemDataQueue(){
return new Queue(SYNC_NEW_SKIN_PROBLEM_DATA_QUEUE,true);
}
@Bean
public Binding syncNewSkinProblemDatakeyDelay() {
return BindingBuilder.bind(syncNewSkinProblemDataQueue()).to(syncNewSkinProblemDataExchange()).with(SYNC_NEW_SKIN_PROBLEM_DATA_KEY);
}
/**
* 同步物联网数据交换机
* @return
*/
@Bean
DirectExchange syncNewOrgAndShopExchange(){
return new DirectExchange(SYNC_NEW_ORG_AND_SHOP_EXCHANGE,true,false);
}
/**
* 同步物联网数据队列
* @return
*/
@Bean
public Queue syncNewOrgAndShopQueue(){
return new Queue(SYNC_NEW_ORG_AND_SHOP_QUEUE,true);
}
/**
* 同步物联网数据队列绑定
* @return
*/
@Bean
Binding syncNewOrgAndShopKey(){
return BindingBuilder.bind(syncNewOrgAndShopQueue()).to(syncNewOrgAndShopExchange()).with(SYNC_NEW_ORG_AND_SHOP_KEY);
}
/**********************************数据板块统计相关数据推送****************************************/
/**********************************数据板块下载中心****************************************/
public static final String SYNC_DR_DOWNLOAD_CENTER_KEY = "syncDRDownloadCenterKey";
public static final String SYNC_DR_DOWNLOAD_CENTER_QUEUE = "syncDRDownloadCenterQueue";
public static final String SYNC_DR_DOWNLOAD_CENTER_EXCHANGE = "syncDRDownloadCenterExchange";
/**
* 交换机绑定
*/
@Bean
DirectExchange syncDRDownloadCenterExchange(){
return new DirectExchange(SYNC_DR_DOWNLOAD_CENTER_EXCHANGE,true,false);
}
/**
* 队列绑定
*/
@Bean
public Queue syncDRDownloadCenterQueue(){
return new Queue(SYNC_DR_DOWNLOAD_CENTER_QUEUE,true);
}
/**
* 同步物联网数据队列绑定
*/
@Bean
Binding syncDRDownloadCenterKey(){
return BindingBuilder.bind(syncDRDownloadCenterQueue()).to(syncDRDownloadCenterExchange()).with(SYNC_DR_DOWNLOAD_CENTER_KEY);
}
/**********************************数据板块下载中心****************************************/
}
package com.dr.constant;
/**
* @description 新数据报告常量配置
* @author luocong
* @date 2024/8/7 14:53
* @version 1.0
*/
public class NewDataReportConstant {
private NewDataReportConstant() {
}
public static final String BASE_DR_REDIS_KEY = "dr_djm:";
/**
* 机构门店基本数据处理key
*/
public static final String DR_ORG_INFO_KEY = "org_info";
/**
* 机构门店基本地址信息key
*/
public static final String DR_ORG_SHOP_ADDRESS_KEY = "new_dr:org_shop_add";
/**
* 皮肤问题处理keu
*/
public static final String SKIN_PROB_REC_KEY = "skin_problem";
/**
* 城市线推荐key
*/
public static final String LINE_CITY_REC_KEY = "dr_line_city:";
}
package com.dr.controller;
import com.dr.dto.TokenDTO;
import com.dr.filter.token.JwtHelper;
import com.nimbusds.jose.Payload;
import net.minidev.json.JSONObject;
import org.springframework.util.Assert;
import javax.servlet.http.HttpServletRequest;
public class BaseController {
/**
* 解释token 获取token对象
*
* @param request
* @param jwtHelper
* @return
*/
protected TokenDTO parseTokenData(HttpServletRequest request, JwtHelper jwtHelper) {
String token = request.getHeader("token");
if(token==null || "".equals(token)){
token=request.getHeader("access_token");
}
Payload p = jwtHelper.parseTokenData(token);
JSONObject jsonObject = p.toJSONObject();
Assert.notNull(jsonObject, "token 不能为空");
Assert.notNull(jsonObject.getAsString("uid"), "openid 不能为空");
TokenDTO dto = new TokenDTO();
dto.setUid(jsonObject.getAsString("uid"));
dto.setId(Long.valueOf(jsonObject.getAsString("id")));
return dto;
}
}
package com.dr.controller;
import com.dr.controller.BaseController;
import com.dr.filter.token.JwtHelper;
import com.dr.service.IMeowShopDataReportService;
import com.dr.util.PageUtils;
import com.dr.util.Result;
import com.dr.vo.*;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
/**
* @description 美业喵店小程序数据报告
* @author luocong
* @date 2024/7/26 10:55
* @version 1.0
*/
@Api(tags = "美业喵店小程序数据报告")
@RequestMapping("/djmaftersales/dataReport")
@RestController
public class MeowShopDataReportController extends BaseController {
@Autowired
private IMeowShopDataReportService meowShopDataReportService;
@ApiOperation(value = "业绩排行", notes = "业绩排行", httpMethod = "POST")
@ApiImplicitParams({
@ApiImplicitParam(name = "lineCityId", value = "城市线id", required = true, dataType = "long")
})
@PostMapping("/performanceRank")
public Result<List<NewPerformanceRankVO>> performanceRank(HttpServletRequest request, JwtHelper jwtHelper, @RequestParam(value = "lineCityId") Long lineCityId) {
return this.meowShopDataReportService.performanceRank(request, jwtHelper, lineCityId);
}
@ApiResponses({
@ApiResponse(code = 0, message = "url下载链接", response = Result.class)
})
@ApiOperation(value = "业绩报表下载", notes = "业绩报表下载", httpMethod = "POST")
@ApiImplicitParams({
@ApiImplicitParam(name = "lineCityId", value = "城市线id", required = true, dataType = "long", paramType = "form"),
})
@PostMapping("/performanceDownload")
public Result<Void> performanceDownload(HttpServletRequest request, JwtHelper jwtHelper, @RequestParam(value = "lineCityId") Long lineCityId) {
return this.meowShopDataReportService.performanceDownload(request, jwtHelper, lineCityId);
}
@ApiImplicitParams({
@ApiImplicitParam(name = "shopAccount", value = "门店账号集", dataType = "array", paramType = "form"),
@ApiImplicitParam(name = "selectType", value = "选择类型(0-我的,1-全国)", required = true, dataType = "int", paramType = "form")
})
@ApiOperation(value = "耗材消耗排行", notes = "耗材消耗排行", httpMethod = "POST")
@PostMapping("/consumableRank")
public Result<List<NewConsumableRankVO>> selectConsumableRank(HttpServletRequest request, JwtHelper jwtHelper,
@RequestParam(value = "shopAccount", required = false) String[] shopAccount,
@RequestParam(value = "selectType") Integer selectType) {
return this.meowShopDataReportService.selectConsumableRank(request, jwtHelper, shopAccount, selectType);
}
@ApiImplicitParams({
@ApiImplicitParam(name = "shopAccount", value = "门店账号集", dataType = "array", paramType = "form"),
@ApiImplicitParam(name = "selectType", value = "选择类型(0-我的,1-全国)", required = true, dataType = "int", paramType = "form")
})
@ApiOperation(value = "耗材消耗报表下载", notes = "耗材消耗报表下载", httpMethod = "POST")
@PostMapping("/consumableDownload")
public Result<Void> newConsumableDownload(HttpServletRequest request, JwtHelper jwtHelper,
@RequestParam(value = "shopAccount", required = false) String[] shopAccount,
@RequestParam(value = "selectType") Integer selectType) {
return this.meowShopDataReportService.newConsumableDownload(request, jwtHelper, shopAccount, selectType);
}
@ApiImplicitParams({
@ApiImplicitParam(name = "regionId", value = "区域id", required = true, dataType = "long", paramType = "form")
})
@ApiOperation(value = "皮肤问题推荐方案接口", notes = "皮肤问题推荐方案接口", httpMethod = "POST")
@PostMapping("/skinProblemRecommend")
public Result<List<SkinProblemRecommendVO>> selectSkinProblemRecommend(@RequestParam(value = "regionId") Long regionId) {
return this.meowShopDataReportService.selectSkinProblemRecommend(regionId);
}
@ApiOperation(value = "设备与耗材数据", notes = "设备与耗材数据", httpMethod = "POST")
@PostMapping("/deviceAndConsumable")
public Result<NewDeviceAndConsumableVO> selectDeviceAndConsumable(HttpServletRequest request, JwtHelper jwtHelper) {
return this.meowShopDataReportService.selectDeviceAndConsumable(request, jwtHelper);
}
@ApiOperation(value = "设备实时使用情况", notes = "设备实时使用情况", httpMethod = "POST")
@PostMapping("/deviceRealTime")
public Result<List<NewDeviceRealTimeVO>> selectDeviceRealTime(HttpServletRequest request, JwtHelper jwtHelper) {
return this.meowShopDataReportService.selectDeviceRealTime(request, jwtHelper);
}
@ApiImplicitParams({
@ApiImplicitParam(name = "flag", value = "日期 1-昨天 2-近七天 3-近三十天", required = true, dataType = "int", paramType = "form"),
@ApiImplicitParam(name = "shopAccount", value = "门店账号集,全选不要传值", dataType = "array", paramType = "form")
})
@ApiOperation(value = "员工排行数据", notes = "员工排行数据", httpMethod = "POST")
@PostMapping("/empOperateRank")
public Result<List<NewEmployeeRankVO>> empOperateRank(HttpServletRequest request, JwtHelper jwtHelper, Integer flag, String[] shopAccount) {
return this.meowShopDataReportService.selectEmpOperateRank(request, jwtHelper, flag, shopAccount);
}
@ApiImplicitParams({
@ApiImplicitParam(name = "flag", value = "日期 1-昨天 2-近七天 3-近三十天", required = true, dataType = "int", paramType = "form"),
@ApiImplicitParam(name = "pageNum", value = "页数,默认1", dataType = "int", paramType = "form"),
@ApiImplicitParam(name = "pageSize", value = "条数,默认5", dataType = "int", paramType = "form")
})
@ApiOperation(value = "门店消耗排行数据", notes = "门店消耗排行数据", httpMethod = "POST")
@PostMapping("/shopConsumerRank")
public Result<PageUtils> shopConsumerRank(HttpServletRequest request, JwtHelper jwtHelper,
@RequestParam("flag") Integer flag,
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
@RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize) {
return this.meowShopDataReportService.selectShopConsumerRank(request, jwtHelper, flag, pageNum, pageSize);
}
@ApiImplicitParams({
@ApiImplicitParam(name = "deviceCode", value = "设备类型code", dataType = "string", paramType = "form"),
@ApiImplicitParam(name = "pageNum", value = "页数,默认1", dataType = "int", paramType = "form"),
@ApiImplicitParam(name = "pageSize", value = "条数,默认5", dataType = "int", paramType = "form")
})
@ApiOperation(value = "设备地域分布", notes = "设备地域分布", httpMethod = "POST")
@PostMapping("/regionalDistribution")
public Result<PageUtils> regionalDistribution(HttpServletRequest request, JwtHelper jwtHelper,
@RequestParam("deviceCode") String[] deviceCode,
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
@RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize) {
return this.meowShopDataReportService.selectRegionalDistribution(request, jwtHelper, deviceCode, pageNum, pageSize);
}
@ApiOperation(value = "客户与案例", notes = "客户与案例", httpMethod = "POST")
@PostMapping("/clientAndCase")
public Result<NewClientAndCaseGroupVO> clientAndCase(HttpServletRequest request, JwtHelper jwtHelper) {
return this.meowShopDataReportService.selectClientAndCase(request, jwtHelper);
}
@ApiImplicitParams({
@ApiImplicitParam(name = "flag", value = "日期 1-昨天 2-近七天 3-近三十天", required = true, dataType = "int", paramType = "form"),
@ApiImplicitParam(name = "pageNum", value = "页数,默认1", dataType = "int", paramType = "form"),
@ApiImplicitParam(name = "pageSize", value = "条数,默认5", dataType = "int", paramType = "form")
})
@ApiOperation(value = "检测排行", notes = "检测排行", httpMethod = "POST")
@PostMapping("/checkCaseRank")
public Result<PageUtils> checkCaseRank(HttpServletRequest request, JwtHelper jwtHelper,
@RequestParam("flag") Integer flag,
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
@RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize) {
return this.meowShopDataReportService.selectCheckCaseRank(request, jwtHelper, flag, pageNum, pageSize);
}
@ApiImplicitParams({
@ApiImplicitParam(name = "pageNum", value = "页数,默认1", dataType = "int", paramType = "form"),
@ApiImplicitParam(name = "pageSize", value = "条数,默认5", dataType = "int", paramType = "form")
})
@ApiOperation(value = "产品推广曝光", notes = "产品推广曝光", httpMethod = "POST")
@PostMapping("/productRecommend")
public Result<PageUtils> productRecommend(HttpServletRequest request, JwtHelper jwtHelper,
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
@RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize) {
return this.meowShopDataReportService.selectProductRecommend(request, jwtHelper, pageNum, pageSize);
}
@ApiImplicitParams({
@ApiImplicitParam(name = "flag", value = "日期 1-昨天 2-近七天 3-近三十天", required = true, dataType = "int", paramType = "form"),
@ApiImplicitParam(name = "pageNum", value = "页数,默认1", dataType = "int", paramType = "form"),
@ApiImplicitParam(name = "pageSize", value = "条数,默认5", dataType = "int", paramType = "form")
})
@ApiOperation(value = "客户到店排行", notes = "客户到店排行", httpMethod = "POST")
@PostMapping("/arriveShopRank")
public Result<PageUtils> selectArriveShopRank(HttpServletRequest request, JwtHelper jwtHelper,
@RequestParam("flag") Integer flag,
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
@RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize) {
return this.meowShopDataReportService.selectArriveShopRank(request, jwtHelper, flag, pageNum, pageSize);
}
@ApiImplicitParams({
@ApiImplicitParam(name = "shopAccount", value = "门店账号集", dataType = "array", paramType = "form")
})
@ApiOperation(value = "年龄分布", notes = "年龄分布", httpMethod = "POST")
@PostMapping("/ageDistribution")
public Result<List<NewAgeDistributionVO>> selectAgeDistribution(HttpServletRequest request, JwtHelper jwtHelper, String[] shopAccount) {
return this.meowShopDataReportService.selectAgeDistribution(request, jwtHelper, shopAccount);
}
@ApiImplicitParams({
@ApiImplicitParam(name = "pageNum", value = "页数,默认1", dataType = "int", paramType = "form"),
@ApiImplicitParam(name = "pageSize", value = "条数,默认5", dataType = "int", paramType = "form")
})
@ApiOperation(value = "客户地域分布", notes = "设备地域分布", httpMethod = "POST")
@PostMapping("/clientDistribution")
public Result<PageUtils> selectClientDistribution(HttpServletRequest request, JwtHelper jwtHelper,
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
@RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize) {
return this.meowShopDataReportService.selectClientDistribution(request, jwtHelper, pageNum, pageSize);
}
@ApiImplicitParams({
@ApiImplicitParam(name = "pageNum", value = "页数,默认1", dataType = "int", paramType = "form"),
@ApiImplicitParam(name = "pageSize", value = "条数,默认5", dataType = "int", paramType = "form")
})
@ApiOperation(value = "下载中心查询列表", notes = "下载中心查询列表", httpMethod = "POST")
@PostMapping("/downloadCenter/list")
public Result<PageUtils> selectDownloadList(HttpServletRequest request, JwtHelper jwtHelper,
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
@RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize) {
return this.meowShopDataReportService.selectDownloadList(request, jwtHelper, pageNum, pageSize);
}
}
package com.dr.dto;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;
@Component
@PropertySource("classpath:AppConstant.properties")
public class AppConstantDTO {
@Value("${AppConstant.METIS_BASE_URL}")
public String metisBaseUrl;
}
package com.dr.dto;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;
/**
* @ClassName: BranchMoistenDTO
* @Description: 分润配置表
* @Author: zhangyouhui
* @Date: 2021/12/23 17:20
*/
@Component
@PropertySource("classpath:AppConstant.properties")
public class BranchMoistenDTO {
/**
*员工登录token
*/
@Value("${AppConstant.BRANCHMOISTEN.TOKEN}")
private String TOKEN;
/**
*员工登录token过期时间
*/
@Value("${AppConstant.BRANCHMOISTEN.TOKENBEOVERDUE}")
private Integer TOKENBEOVERDUE;
public String getTOKEN() {
return TOKEN;
}
public Integer getTOKENBEOVERDUE() {
return TOKENBEOVERDUE;
}
}
package com.dr.dto;
import lombok.Data;
import java.io.Serializable;
/**
* @description 设备类型启动次数对象
* @author luocong
* @date 2024/8/24 15:18
* @version 1.0
*/
@Data
public class DeviceTypeStartByMonthDTO implements Serializable {
private static final long serialVersionUID = -8113685688583479564L;
/**
* 设备id
*/
private String deviceid;
/**
* 设备类型code
*/
private String deviceTypeCode;
/**
* 设备类型名称
*/
private String deviceTypeName;
/**
* 启动次数
*/
private String startUpNum;
/**
* 门店账号
*/
private String shopAccount;
/**
* 门店名称
*/
private String shopName;
}
package com.dr.dto;
import lombok.Data;
import java.io.Serializable;
/**
* @Description: 员工权限对象
* @Author: luocong
* @Since: 2022/8/22
* @Version: 1.0.0
*/
@Data
public class EmpPermissionDTO implements Serializable {
private static final long serialVersionUID = -8833257204315870137L;
/**
* 机构账号
*/
private String oAccount;
/**
* 机构名称
*/
private String orgName;
/**
* 门店账号
*/
private String shopAccount;
/**
* 权限 0无 1机构 2 门店
*/
private String powerType;
}
package com.dr.dto;
import lombok.Data;
import java.io.Serializable;
/**
* @description
* @author luocong
* @date 2024/8/16 11:22
* @version 1.0
*/
@Data
public class ParseTokenDTO implements Serializable {
private static final long serialVersionUID = 8367893624887300205L;
/**
* openid
*/
private String openId;
/**
* 用户id
*/
private Long userId;
/**
* 机构账号
*/
private String orgAccount;
/**
* 门店账号
*/
private String shopAccount;
/**
* 权限 0无 1机构 2 门店
*/
private String powerType;
}
package com.dr.dto;
import java.io.Serializable;
import java.util.List;
/**
* Token数据传输对象
* @author nymxj
*
*/
public class TokenDTO implements Serializable{
private static final long serialVersionUID = -5771827353887132409L;
private Long id;
private String uid;
private String state;
private String name;
private List<String> roles;
public TokenDTO(String uid) {
this.uid = uid;
}
public TokenDTO() {
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getUid() {
return uid;
}
public void setUid(String uid) {
this.uid = uid;
}
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
public List<String> getRoles() {
return roles;
}
public void setRoles(List<String> roles) {
this.roles = roles;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
package com.dr.entity;
/**
* @Auther tlw
* @Date 2022/5/5
*/
public class Config {
private Integer id;
private String keystr;
private String keyvalue;
private String remark;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getKeystr() {
return keystr;
}
public void setKeystr(String keystr) {
this.keystr = keystr;
}
public String getKeyvalue() {
return keyvalue;
}
public void setKeyvalue(String keyvalue) {
this.keyvalue = keyvalue;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
}
package com.dr.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
* @description 数据统计-客户使用日志日表
* @author luocong
* @date 2024-08-06 15:59:16
* @version 1.0
*/
@Data
@TableName("dr_client_use_logs_by_day")
public class DrClientUseLogsByDayEntity implements Serializable {
private static final long serialVersionUID = 1L;
/**
* id
*/
@TableId(type = IdType.AUTO)
private Long id;
/**
* 当天日期
*/
private String dailyTime;
/**
* 是否删除(0-否,1是,默认0)
*/
private Integer deleted;
/**
* 创建人名字
*/
private String createUserName;
/**
* 创建时间
*/
private LocalDateTime createTime;
/**
* 修改时间
*/
private LocalDateTime updateTime;
/**
* 修改人名字
*/
private String updateUserName;
/**
* 门店名称
*/
private String shopName;
/**
* 门店账号
*/
private String shopAccount;
/**
* 机构名称
*/
private String orgName;
/**
* 机构账号
*/
private String orgAccount;
/**
* 单次到店客户数
*/
private Integer onceArriveClientNum;
/**
* 多次到店客户数
*/
private Integer moreArriveClientNum;
}
package com.dr.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
* @description 数据统计-耗材使用数据日表
* @author luocong
* @date 2024-08-06 15:59:16
* @version 1.0
*/
@Data
@TableName("dr_consumable_use_info_by_day")
public class DrConsumableUseInfoByDayEntity implements Serializable {
private static final long serialVersionUID = 1L;
/**
* id
*/
@TableId(type = IdType.AUTO)
private Long id;
/**
* 门店名称
*/
private String shopName;
/**
* 门店账号
*/
private String shopAccount;
/**
* 机构名称
*/
private String orgName;
/**
* 机构账号
*/
private String orgAccount;
/**
* 当天日期
*/
private String dailyTime;
/**
* 当天耗材消耗数量
*/
private Integer dailyConsumableUseNum;
/**
* 设备类型code
*/
private String deviceTypeCode;
/**
* 设备类型名称
*/
private String deviceTypeName;
/**
* 耗材类型code
*/
private String consumableTypeCode;
/**
* 耗材类型名称
*/
private String consumableTypeName;
/**
* 门店省行政名称
*/
private String shopProvinceName;
/**
* 门店市行政名称
*/
private String shopCityName;
/**
* 门店区行政名称
*/
private String shopRegionName;
/**
* 门店详细地址
*/
private String shopAddress;
/**
* 是否删除(0-否,1是,默认0)
*/
private Integer deleted;
/**
* 创建人名字
*/
private String createUserName;
/**
* 修改人名字
*/
private String updateUserName;
/**
* 创建时间
*/
private LocalDateTime createTime;
/**
* 修改时间
*/
private LocalDateTime updateTime;
}
package com.dr.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
* @description 数据统计-耗材使用数据月表
* @author luocong
* @date 2024-08-06 15:59:16
* @version 1.0
*/
@Data
@TableName("dr_consumable_use_info_by_month")
public class DrConsumableUseInfoByMonthEntity implements Serializable {
private static final long serialVersionUID = 1L;
/**
* id
*/
@TableId(type = IdType.AUTO)
private Long id;
/**
* 门店名称
*/
private String shopName;
/**
* 门店账号
*/
private String shopAccount;
/**
* 机构名称
*/
private String orgName;
/**
* 机构账号
*/
private String orgAccount;
/**
* 当月日期
*/
private String monthTime;
/**
* 当月耗材消耗数量
*/
private Integer dailyConsumableUseNum;
/**
* 设备类型code
*/
private String deviceTypeCode;
/**
* 设备类型名称
*/
private String deviceTypeName;
/**
* 耗材类型code
*/
private String consumableTypeCode;
/**
* 耗材类型名称
*/
private String consumableTypeName;
/**
* 门店省行政名称
*/
private String shopProvinceName;
/**
* 门店市行政名称
*/
private String shopCityName;
/**
* 门店区行政名称
*/
private String shopRegionName;
/**
* 门店详细地址
*/
private String shopAddress;
/**
* 创建人名字
*/
private String createUserName;
/**
* 创建时间
*/
private LocalDateTime createTime;
/**
* 修改时间
*/
private LocalDateTime updateTime;
/**
* 修改人名字
*/
private String updateUserName;
/**
* 是否删除(0-否,1是,默认0)
*/
private Integer deleted;
}
package com.dr.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
* @description 数据统计-设备启动次数日表
* @author luocong
* @date 2024-08-06 15:59:16
* @version 1.0
*/
@Data
@TableName("dr_device_type_start_by_day")
public class DrDeviceTypeStartByDayEntity implements Serializable {
private static final long serialVersionUID = 1L;
/**
* id
*/
@TableId(type = IdType.AUTO)
private Long id;
/**
* 门店名称
*/
private String shopName;
/**
* 门店账号
*/
private String shopAccount;
/**
* 机构名称
*/
private String orgName;
/**
* 机构账号
*/
private String orgAccount;
/**
* 当天日期
*/
private String dailyTime;
/**
* 设备id
*/
private String deviceid;
/**
* 设备类型code
*/
private String deviceTypeCode;
/**
* 设备类型名称
*/
private String deviceTypeName;
/**
* 启动次数
*/
private Integer startUpNum;
/**
* 门店省行政名称
*/
private String shopProvinceName;
/**
* 门店市行政名称
*/
private String shopCityName;
/**
* 门店区行政名称
*/
private String shopRegionName;
/**
* 门店详细地址
*/
private String shopAddress;
/**
* 是否删除(0-否,1是,默认0)
*/
private Integer deleted;
/**
* 创建人名字
*/
private String createUserName;
/**
* 创建时间
*/
private LocalDateTime createTime;
/**
* 修改时间
*/
private LocalDateTime updateTime;
/**
* 修改人名字
*/
private String updateUserName;
}
package com.dr.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
* @description 数据统计-设备启动次数月表
* @author luocong
* @date 2024-08-06 15:59:16
* @version 1.0
*/
@Data
@TableName("dr_device_type_start_by_month")
public class DrDeviceTypeStartByMonthEntity implements Serializable {
private static final long serialVersionUID = 1L;
/**
* id
*/
@TableId(type = IdType.AUTO)
private Long id;
/**
* 门店名称
*/
private String shopName;
/**
* 门店账号
*/
private String shopAccount;
/**
* 机构名称
*/
private String orgName;
/**
* 机构账号
*/
private String orgAccount;
/**
* 当月日期
*/
private String monthTime;
/**
* 设备id
*/
private String deviceid;
/**
* 设备类型code
*/
private String deviceTypeCode;
/**
* 设备类型名称
*/
private String deviceTypeName;
/**
* 启动次数
*/
private Integer startUpNum;
/**
* 门店省行政名称
*/
private String shopProvinceName;
/**
* 门店市行政名称
*/
private String shopCityName;
/**
* 门店区行政名称
*/
private String shopRegion;
/**
* 门店详细地址
*/
private String shopAddress;
/**
* 是否删除(0-否,1是,默认0)
*/
private Integer deleted;
/**
* 创建人名字
*/
private String createUserName;
/**
* 创建时间
*/
private LocalDateTime createTime;
/**
* 修改时间
*/
private LocalDateTime updateTime;
/**
* 修改人名字
*/
private String updateUserName;
}
package com.dr.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
* @description 数据统计-员工使用设备统计数据日表
* @author luocong
* @date 2024-08-06 15:59:16
* @version 1.0
*/
@Data
@TableName("dr_employee_use_device_count_by_day")
public class DrEmployeeUseDeviceCountByDayEntity implements Serializable {
private static final long serialVersionUID = 1L;
/**
* id
*/
@TableId(type = IdType.AUTO)
private Long id;
/**
* 门店账号
*/
private String shopAccount;
/**
* 门店名称
*/
private String shopName;
/**
* 机构账号
*/
private String orgAccount;
/**
* 机构名称
*/
private String orgName;
/**
* 当天日期
*/
private String dailyTime;
/**
* 操作次数
*/
private Integer operateNum;
/**
* 员工姓名
*/
private String employeeName;
/**
* 门店省行政名称
*/
private String shopProvinceName;
/**
* 门店市行政名称
*/
private String shopCityName;
/**
* 门店区行政名称
*/
private String shopRegion;
/**
* 门店详细地址
*/
private String shopAddress;
/**
* 是否删除(0-否,1是,默认0)
*/
private Integer deleted;
/**
* 创建人名字
*/
private String createUserName;
/**
* 创建时间
*/
private LocalDateTime createTime;
/**
* 修改时间
*/
private LocalDateTime updateTime;
/**
* 修改人名字
*/
private String updateUserName;
}
package com.dr.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
* @description 数据统计-去年皮肤问题明细月表
* @author luocong
* @date 2024-08-06 15:59:16
* @version 1.0
*/
@Data
@TableName("dr_last_year_skin_problem_by_month")
public class DrLastYearSkinProblemByMonthEntity implements Serializable {
private static final long serialVersionUID = 1L;
/**
* id
*/
@TableId(type = IdType.AUTO)
private Long id;
/**
* 门店账号
*/
private String shopAccount;
/**
* 门店名称
*/
private String shopName;
/**
* 机构账号
*/
private String orgAccount;
/**
* 机构名称
*/
private String orgName;
/**
* 当月日期
*/
private String monthTime;
/**
* 黑头数量
*/
private Integer blackhead;
/**
* 严重黑头数量
*/
private Integer seriousBlackhead;
/**
* 粉刺数量
*/
private Integer acne;
/**
* 严重粉刺数量
*/
private Integer seriousAcne;
/**
* 毛孔数量
*/
private Integer pore;
/**
* 严重毛孔数量
*/
private Integer seriousPore;
/**
* 皱纹数量
*/
private Integer wrinkle;
/**
* 严重皱纹数量
*/
private Integer seriousWrinkle;
/**
* 色斑数量
*/
private Integer stain;
/**
* 严重色斑数量
*/
private Integer seriousStain;
/**
* 是否删除(0-否,1是,默认0)
*/
private Integer deleted;
/**
* 创建人名字
*/
private String createUserName;
/**
* 修改人名字
*/
private String updateUserName;
/**
* 创建时间
*/
private LocalDateTime createTime;
/**
* 修改时间
*/
private LocalDateTime updateTime;
/**
* 门店省行政名称
*/
private String shopProvinceName;
/**
* 门店市行政名称
*/
private String shopCityName;
/**
* 门店区行政名称
*/
private String shopRegionName;
/**
* 门店详细地址
*/
private String shopAddress;
}
package com.dr.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
* @description 数据统计-机构、门店数据统计总表
* @author luocong
* @date 2024-08-06 15:59:16
* @version 1.0
*/
@Data
@TableName("dr_org_and_shop_data_count")
public class DrOrgAndShopDataCountEntity implements Serializable {
private static final long serialVersionUID = 1L;
/**
* id
*/
@TableId(type = IdType.AUTO)
private Long id;
/**
* 门店名称
*/
private String shopName;
/**
* 门店账号
*/
private String shopAccount;
/**
* 机构名称
*/
private String orgName;
/**
* 机构账号
*/
private String orgAccount;
/**
* 当天日期
*/
private String dailyTime;
/**
* 设备数量
*/
private Integer deviceNum;
/**
* 门店所在省行政名称
*/
private String shopProvinceName;
/**
* 是否删除(0-否,1是,默认0)
*/
private Integer deleted;
/**
* 创建人名字
*/
private String createUserName;
/**
* 创建时间
*/
private LocalDateTime createTime;
/**
* 修改时间
*/
private LocalDateTime updateTime;
/**
* 修改人名字
*/
private String updateUserName;
/**
* 耗材消耗数量
*/
private Integer consumableUseNum;
/**
* 门店市行政名称
*/
private String shopCityName;
/**
* 门店区行政名称
*/
private String shopRegion;
/**
* 门店详细地址
*/
private String shopAddress;
}
package com.dr.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
* @description 数据统计-门店设备类型地域分布数据表
* @author luocong
* @date 2024-08-06 15:59:16
* @version 1.0
*/
@Data
@TableName("dr_shop_device_type_distribute_by_day")
public class DrShopDeviceTypeDistributeByDayEntity implements Serializable {
private static final long serialVersionUID = 1L;
/**
* id
*/
@TableId(type = IdType.AUTO)
private Long id;
/**
* 门店账号
*/
private String shopAccount;
/**
* 门店名称
*/
private String shopName;
/**
* 机构账号
*/
private String orgAccount;
/**
* 机构名称
*/
private String orgName;
/**
* 当天日期
*/
private String dailyTime;
/**
* 设备类型code
*/
private String deviceTypeCode;
/**
* 设备类型名称
*/
private String deviceTypeName;
/**
* 设备数量
*/
private Integer deviceNum;
/**
* 创建时间
*/
private LocalDateTime createTime;
/**
* 修改时间
*/
private LocalDateTime updateTime;
/**
* 是否删除(0-否,1是,默认0)
*/
private Integer deleted;
/**
* 创建人名字
*/
private String createUserName;
/**
* 修改人名字
*/
private String updateUserName;
/**
* 门店所属国家名称
*/
private String shopCountryName;
/**
* 门店省行政名称
*/
private String shopProvinceName;
/**
* 门店市行政名称
*/
private String shopCityName;
/**
* 门店区行政名称
*/
private String shopRegion;
/**
* 门店详细地址
*/
private String shopAddress;
}
package com.dr.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import org.apache.ibatis.type.JdbcType;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* Created with IntelliJ IDEA.
*
* @Auther: zhangyouhui
* @Date: 2021/03/10/16:11
* @Description:
*/
@TableName("t_wx_appletuser")
public class WxAppletuserEntity {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
@TableId(type = IdType.AUTO)
private Long id;
/**
* 微信小程序唯一id
*/
private String openId;
/**
* 用户手机号码
*/
private String phone;
/**
* 用户头像
*/
private String avatarUrl;
/**
* 用户昵称
*/
private String nickName;
/***
* 是否关注了绑定的公众号
*/
private String officialAccount;
/**
* vip等级
*/
private String vipLevel;
/**
* 门店账号
*/
private String shopAccountNumber;
/**
* uuid
*/
private String unionId;
/**
* 地址
*/
private String address;
/**
* 性别
*/
private String gender;
/**
* 分享code
*/
private String qrcode;
/**
* 状态,0,新客,1,更进中,2,已绑定
*/
private String state;
/**
* 创建时间
*/
private Date createTime;
/**
* 销售账号
*/
private String salesAccountNumber;
/**
* 职位
*/
private String position;
/**
* 机构id
*/
private Integer orgid;
private String sale;
/**
* 喵币数量
*/
@TableField(jdbcType = JdbcType.DECIMAL)
private BigDecimal catcoinNum;
/**
* 会员等级
*/
private Integer memberLevel;
/**
* 主业务员类型 0:员工 1:业务员
*/
private Integer salesmanType;
/**
* 主业务员id
*/
private Integer mainSalesmanId;
/**
* 长期有效成长值
*/
private Integer longTermValue;
/**
* 用户等级升级日期
*/
private Date upgradeTime;
/**
* 展示门店(0,展示,1,不展示)
*/
private String displayShop;
/**
* 最后访问时间
*/
private Date lastVisitTime;
/**
* 会员权益是否通过报价修改过 0:否 1:是
*/
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getOpenId() {
return openId;
}
public void setOpenId(String openId) {
this.openId = openId;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getAvatarUrl() {
return avatarUrl;
}
public void setAvatarUrl(String avatarUrl) {
this.avatarUrl = avatarUrl;
}
public String getNickName() {
return nickName;
}
public void setNickName(String nickName) {
this.nickName = nickName;
}
public String getOfficialAccount() {
return officialAccount;
}
public void setOfficialAccount(String officialAccount) {
this.officialAccount = officialAccount;
}
public String getVipLevel() {
return vipLevel;
}
public void setVipLevel(String vipLevel) {
this.vipLevel = vipLevel;
}
public String getShopAccountNumber() {
return shopAccountNumber;
}
public void setShopAccountNumber(String shopAccountNumber) {
this.shopAccountNumber = shopAccountNumber;
}
public String getUnionId() {
return unionId;
}
public void setUnionId(String unionId) {
this.unionId = unionId;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public String getGender() {
return gender;
}
public void setGender(String gender) {
this.gender = gender;
}
public String getQrcode() {
return qrcode;
}
public void setQrcode(String qrcode) {
this.qrcode = qrcode;
}
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public String getSalesAccountNumber() {
return salesAccountNumber;
}
public void setSalesAccountNumber(String salesAccountNumber) {
this.salesAccountNumber = salesAccountNumber;
}
public String getPosition() {
return position;
}
public void setPosition(String position) {
this.position = position;
}
public Integer getOrgid() {
return orgid;
}
public void setOrgid(Integer orgid) {
this.orgid = orgid;
}
public String getSale() {
return sale;
}
public void setSale(String sale) {
this.sale = sale;
}
public BigDecimal getCatcoinNum() {
return catcoinNum;
}
public void setCatcoinNum(BigDecimal catcoinNum) {
this.catcoinNum = catcoinNum;
}
public Integer getMemberLevel() {
return memberLevel;
}
public void setMemberLevel(Integer memberLevel) {
this.memberLevel = memberLevel;
}
public Integer getSalesmanType() {
return salesmanType;
}
public void setSalesmanType(Integer salesmanType) {
this.salesmanType = salesmanType;
}
public Integer getMainSalesmanId() {
return mainSalesmanId;
}
public void setMainSalesmanId(Integer mainSalesmanId) {
this.mainSalesmanId = mainSalesmanId;
}
public Integer getLongTermValue() {
return longTermValue;
}
public void setLongTermValue(Integer longTermValue) {
this.longTermValue = longTermValue;
}
public Date getUpgradeTime() {
return upgradeTime;
}
public void setUpgradeTime(Date upgradeTime) {
this.upgradeTime = upgradeTime;
}
public String getDisplayShop() {
return displayShop;
}
public void setDisplayShop(String displayShop) {
this.displayShop = displayShop;
}
public Date getLastVisitTime() {
return lastVisitTime;
}
public void setLastVisitTime(Date lastVisitTime) {
this.lastVisitTime = lastVisitTime;
}
@Override
public String toString() {
return "WxAppletuserEntity{" +
"id=" + id +
", openId='" + openId + '\'' +
", phone='" + phone + '\'' +
", avatarUrl='" + avatarUrl + '\'' +
", nickName='" + nickName + '\'' +
", officialAccount='" + officialAccount + '\'' +
", vipLevel='" + vipLevel + '\'' +
", shopAccountNumber='" + shopAccountNumber + '\'' +
", unionId='" + unionId + '\'' +
", address='" + address + '\'' +
", gender='" + gender + '\'' +
", qrcode='" + qrcode + '\'' +
", state='" + state + '\'' +
", createTime=" + createTime +
", salesAccountNumber='" + salesAccountNumber + '\'' +
", position='" + position + '\'' +
", orgid=" + orgid +
", sale='" + sale + '\'' +
", catcoinNum=" + catcoinNum +
", memberLevel=" + memberLevel +
", salesmanType=" + salesmanType +
", mainSalesmanId=" + mainSalesmanId +
", longTermValue=" + longTermValue +
", upgradeTime=" + upgradeTime +
", displayShop='" + displayShop + '\'' +
", lastVisitTime=" + lastVisitTime +
'}';
}
}
package com.dr.filter.token;
import com.dr.dto.BranchMoistenDTO;
import com.dr.util.WxAppletsConstant;
import com.nimbusds.jose.*;
import com.nimbusds.jose.crypto.MACSigner;
import com.nimbusds.jose.crypto.MACVerifier;
import net.minidev.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;
import java.text.ParseException;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.TimeUnit;
/**
*
* @author jytao
*
*/
@Component
public class JwtHelper {
private final Logger log = LoggerFactory.getLogger(this.getClass());
@Autowired
private RedisTemplate<String, String> redisTemplate;
@Autowired
private WxAppletsConstant appConstant;
@Autowired
private BranchMoistenDTO branchMoistenDTO;
/**
* redis 缓存 数据
*/
public void putRedisTemplateToken(String key, String token, int expirationdate) {
try {
redisTemplate.opsForValue().set(key, token, expirationdate, TimeUnit.SECONDS);
} catch (Exception e) {
log.error("数据写入redis 失败");
e.printStackTrace();
}
}
public String getRedisTemplateToken(String key) {
return redisTemplate.opsForValue().get(key);
}
/**
* redis 获取token 过期时间
*/
public Long getTokenExpirationDate(String key) {
return redisTemplate.getExpire(key);
}
/**
* 秘钥
*/
private static final byte[] SECRET = "345R0d227691751vd04467df11ff67JU".getBytes();
/**
* 初始化head部分的数据为 { "alg":"HS256", "type":"JWT" }
*/
private static final JWSHeader header = new JWSHeader(JWSAlgorithm.HS256, JOSEObjectType.JWT, null, null, null,
null, null, null, null, null, null, null, null);
/**
* 生成token,该方法只在用户登录成功后调用
* @param payload 可以存储用户id,token生成时间,token过期时间等自定义字段
* @return token 字符串,若失败则返回null
*/
public String createToken(Map<String, Object> payload) {
String tokenString = null;
// 创建一个 JWS object
JWSObject jwsObject = new JWSObject(header, new Payload(new JSONObject(payload)));
try {
// 将jwsObject 进行HMAC签名
jwsObject.sign(new MACSigner(SECRET));
tokenString = jwsObject.serialize();
} catch (JOSEException e) {
log.error("签名失败 : {}", e.getMessage());
e.printStackTrace();
}
return tokenString;
}
/***
* 重新设置过期时间
*/
public void setUpExpirationDate(String token,String type,Integer typedate) {
try {
JWSObject jwsObject = JWSObject.parse(token);
Payload payload = jwsObject.getPayload();
JSONObject jsonOBj = payload.toJSONObject();
putRedisTemplateToken(type+ jsonOBj.get("uid").toString(), token, typedate);
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* 校验token是否合法,返回Map集合,集合中主要包含 state状态码 data鉴权成功后从token中提取的数据
* 该方法在过滤器中调用,每次请求API时都校验
* @param token
* @param access_token
* @return Map<String, Object>
*/
public Map<String, Object> validToken(String token,String access_token) {
Map<String, Object> resultMap = new HashMap<String, Object>();
String admintoken=null;
if(token!=null){
admintoken=token;
}
if(access_token!=null){
admintoken=access_token;
}
try {
JWSObject jwsObject = JWSObject.parse(admintoken);
Payload payload = jwsObject.getPayload();
JWSVerifier verifier = new MACVerifier(SECRET);
JSONObject jsonOBj = payload.toJSONObject();
// token校验成功(此时没有校验是否过期)
resultMap.put("state", TokenState.VALID.toString());
// 缓存中能否找到token
String newtoken=null;
Long expirationdate =null;
String type=null;
Integer typedate=0;
if(token!=null){
newtoken = getRedisTemplateToken(appConstant.getBEOVERDUE_TOEKN()+ jsonOBj.get("uid").toString());
expirationdate = getTokenExpirationDate(appConstant.getBEOVERDUE_TOEKN() + jsonOBj.get("uid").toString());
type=appConstant.getBEOVERDUE_TOEKN();
//TOKEN_DFT_EXPIRE_TIME
typedate=appConstant.getTOKEN_DFT_EXPIRE_TIME();
}
if(access_token!=null){
newtoken = getRedisTemplateToken(branchMoistenDTO.getTOKEN()+ jsonOBj.get("uid").toString());
expirationdate = getTokenExpirationDate(branchMoistenDTO.getTOKEN()+ jsonOBj.get("uid").toString());
type=branchMoistenDTO.getTOKEN();
typedate=branchMoistenDTO.getTOKENBEOVERDUE();
}
if (jwsObject.verify(verifier)) {
// token是null或者token不一样
if (newtoken == null || (!newtoken.equals(admintoken))) {
resultMap.put("state", TokenState.EXPIRED.toString());
// token过期
} else if (expirationdate == -2) {
resultMap.put("state", TokenState.EXPIRED.toString());
} else {
// 设置过期时间的token
setUpExpirationDate(admintoken,type,typedate);
}
resultMap.put("data", jsonOBj);
} else {
// 校验失败
log.info("传入token=\t" + admintoken);
log.info("缓存token=\t" + newtoken);
resultMap.put("state", TokenState.INVALID.toString());
}
} catch (Exception e) {
resultMap.clear();
resultMap.put("state", TokenState.INVALID.toString());
}
return resultMap;
}
public Object getToken(String key) {
return redisTemplate.opsForValue().get(key);
}
/**
* 解析token,获取token中信息
* @param token
* @return Map<String, Object>
*/
public Payload parseTokenData(String token) {
Payload payload = null;
try {
JWSObject jwsObject = JWSObject.parse(token);
payload = jwsObject.getPayload();
} catch (ParseException e) {
e.printStackTrace();
}
return payload;
}
}
package com.dr.filter.token;
public enum TokenState {
/**
* 过期
*/
EXPIRED("EXPIRED"),
/**
* 无效(token不合法)
*/
INVALID("INVALID"),
/**
* 有效的
*/
VALID("VALID");
private String state;
private TokenState(String state) {
this.state = state;
}
/**
* 根据状态字符串获取token状态枚举对象
* @param tokenState
* @return
*/
public static TokenState getTokenState(String tokenState){
TokenState[] states=TokenState.values();
TokenState ts=null;
for (TokenState state : states) {
if(state.toString().equals(tokenState)){
ts=state;
break;
}
}
return ts;
}
public String toString() {
return this.state;
}
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
}
package com.dr.mapper;
import com.dr.entity.Config;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @Auther tlw
* @Date 2022/5/5
*/
public interface ConfigMapper {
Config findConfigByKeystr(@Param("keystr") String keystr);
List<Config> findConfigListByKeystr(@Param("keystr")String keystr);
}
package com.dr.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dr.entity.DrConsumableUseInfoByDayEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* @description 数据统计-耗材使用数据日表
* @author luocong
* @date 2024-08-06 15:59:16
* @version 1.0
*/
@Mapper
public interface DrConsumableUseInfoByDayMapper extends BaseMapper<DrConsumableUseInfoByDayEntity> {
}
package com.dr.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dr.entity.DrConsumableUseInfoByMonthEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* @description 数据统计-耗材使用数据月表
* @author luocong
* @date 2024-08-06 15:59:16
* @version 1.0
*/
@Mapper
public interface DrConsumableUseInfoByMonthMapper extends BaseMapper<DrConsumableUseInfoByMonthEntity> {
}
package com.dr.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dr.dto.DeviceTypeStartByMonthDTO;
import com.dr.entity.DrDeviceTypeStartByMonthEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Set;
/**
* @description 数据统计-设备启动次数月表
* @author luocong
* @date 2024-08-06 15:59:16
* @version 1.0
*/
@Mapper
public interface DrDeviceTypeStartByMonthMapper extends BaseMapper<DrDeviceTypeStartByMonthEntity> {
/**
* 设备类型分组查询单个设备类型启动次数
*
* @param startTime 开始时间
* @param endTime 结束时间
* @param deviceTypeSet 设备类型集
* @param orgAccount 机构账号
* @param shopAccount 门店账号
* @param lineCityId 城市线id
* @return List<DeviceTypeStartByMonthDTO>
*/
List<DeviceTypeStartByMonthDTO> selectDevStartList(@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("deviceTypeSet") Set<String> deviceTypeSet,
@Param("orgAccount") String orgAccount, @Param("shopAccount") String shopAccount, @Param("lineCityId") Long lineCityId);
}
package com.dr.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dr.entity.DrEmployeeUseDeviceCountByDayEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* @description 数据统计-员工使用设备统计数据日表
* @author luocong
* @date 2024-08-06 15:59:16
* @version 1.0
*/
@Mapper
public interface DrEmployeeUseDeviceCountByDayMapper extends BaseMapper<DrEmployeeUseDeviceCountByDayEntity> {
}
package com.dr.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dr.entity.DrLastYearSkinProblemByMonthEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @description 数据统计-去年皮肤问题明细月表
* @author luocong
* @date 2024-08-06 15:59:16
* @version 1.0
*/
@Mapper
public interface DrLastYearSkinProblemByMonthMapper extends BaseMapper<DrLastYearSkinProblemByMonthEntity> {
/**
* 查询皮肤问题
*
* @param regionId 区域ID
* @param startTime 开始时间
* @param endTime 结束时间
* @return DrLastYearSkinProblemByMonthEntity
*/
List<DrLastYearSkinProblemByMonthEntity> selectSkinProblemRecommend(@Param("regionId") Long regionId, @Param("startTime") String startTime, @Param("endTime") String endTime);
}
package com.dr.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dr.entity.DrOrgAndShopDataCountEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* @description 数据统计-机构、门店数据统计总表
* @author luocong
* @date 2024-08-06 15:59:16
* @version 1.0
*/
@Mapper
public interface DrOrgAndShopDataCountMapper extends BaseMapper<DrOrgAndShopDataCountEntity> {
}
package com.dr.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dr.entity.DrShopDeviceTypeDistributeByDayEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* @description 数据统计-门店设备类型地域分布数据表
* @author luocong
* @date 2024-08-06 15:59:16
* @version 1.0
*/
@Mapper
public interface DrShopDeviceTypeDistributeByDayMapper extends BaseMapper<DrShopDeviceTypeDistributeByDayEntity> {
}
package com.dr.mapper;
import com.dr.dto.EmpPermissionDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper
public interface EmployeeManageMapper {
EmpPermissionDTO findEmpPermission(@Param("openId") String openId, @Param("sAccount") String sAccount);
}
package com.dr.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dr.entity.WxAppletuserEntity;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface WxAppletuserMapper extends BaseMapper<WxAppletuserEntity> {
}
package com.dr.service;
import java.util.List;
import com.dr.entity.Config;
/**
* @Auther tlw
* @Date 2022/5/5
*/
public interface IConfigService {
Config findConfigByKeystr(String keystr);
List<Config> findConfigListByKeystr(String keystr);
}
package com.dr.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.dr.entity.DrClientUseLogsByDayEntity;
/**
* @description 数据统计-客户使用日志日表
* @author luocong
* @date 2024-08-06 15:59:16
* @version 1.0
*/
public interface IDrClientUseLogsByDayService extends IService<DrClientUseLogsByDayEntity> {
}
package com.dr.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.dr.entity.DrConsumableUseInfoByDayEntity;
/**
* @description 数据统计-耗材使用数据日表
* @author luocong
* @date 2024-08-06 15:59:16
* @version 1.0
*/
public interface IDrConsumableUseInfoByDayService extends IService<DrConsumableUseInfoByDayEntity> {
}
package com.dr.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.dr.entity.DrConsumableUseInfoByMonthEntity;
/**
* @description 数据统计-耗材使用数据月表
* @author luocong
* @date 2024-08-06 15:59:16
* @version 1.0
*/
public interface IDrConsumableUseInfoByMonthService extends IService<DrConsumableUseInfoByMonthEntity> {
}
package com.dr.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.dr.entity.DrDeviceTypeStartByDayEntity;
/**
* @description 数据统计-设备启动次数日表
* @author luocong
* @date 2024-08-06 15:59:16
* @version 1.0
*/
public interface IDrDeviceTypeStartByDayService extends IService<DrDeviceTypeStartByDayEntity> {
}
package com.dr.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.dr.dto.DeviceTypeStartByMonthDTO;
import com.dr.entity.DrDeviceTypeStartByMonthEntity;
import java.util.List;
import java.util.Set;
/**
* @description 数据统计-设备启动次数月表
* @author luocong
* @date 2024-08-06 15:59:16
* @version 1.0
*/
public interface IDrDeviceTypeStartByMonthService extends IService<DrDeviceTypeStartByMonthEntity> {
/**
* 设备类型分组查询单个设备类型启动次数
*
* @param startTime 开始时间
* @param endTime 结束时间
* @param deviceTypeSet 设备类型集
* @param orgAccount 机构账号
* @param shopAccount 门店账号
* @param lineCityId 城市线id
* @return List<DeviceTypeStartByMonthDTO>
*/
List<DeviceTypeStartByMonthDTO> selectDevStartList(String startTime, String endTime, Set<String> deviceTypeSet, String orgAccount, String shopAccount, Long lineCityId);
}
package com.dr.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.dr.entity.DrEmployeeUseDeviceCountByDayEntity;
/**
* @description 数据统计-员工使用设备统计数据日表
* @author luocong
* @date 2024-08-06 15:59:16
* @version 1.0
*/
public interface IDrEmployeeUseDeviceCountByDayService extends IService<DrEmployeeUseDeviceCountByDayEntity> {
}
package com.dr.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.dr.entity.DrLastYearSkinProblemByMonthEntity;
import java.util.List;
/**
* @description 数据统计-去年皮肤问题明细月表
* @author luocong
* @date 2024-08-06 15:59:16
* @version 1.0
*/
public interface IDrLastYearSkinProblemByMonthService extends IService<DrLastYearSkinProblemByMonthEntity> {
/**
* 查询皮肤问题
*
* @param regionId 区域ID
* @param startTime 开始时间
* @param endTime 结束时间
* @return DrLastYearSkinProblemByMonthEntity
*/
List<DrLastYearSkinProblemByMonthEntity> selectSkinProblemRecommend(Long regionId, String startTime, String endTime);
}
package com.dr.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.dr.entity.DrOrgAndShopDataCountEntity;
/**
* @description 数据统计-机构、门店数据统计总表
* @author luocong
* @date 2024-08-06 15:59:16
* @version 1.0
*/
public interface IDrOrgAndShopDataCountService extends IService<DrOrgAndShopDataCountEntity> {
}
package com.dr.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.dr.entity.DrShopDeviceTypeDistributeByDayEntity;
/**
* @description 数据统计-门店设备类型地域分布数据表
* @author luocong
* @date 2024-08-06 15:59:16
* @version 1.0
*/
public interface IDrShopDeviceTypeDistributeByDayService extends IService<DrShopDeviceTypeDistributeByDayEntity> {
}
package com.dr.service;
import com.dr.filter.token.JwtHelper;
import com.dr.util.PageUtils;
import com.dr.util.Result;
import com.dr.vo.*;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
/**
* @description
* @author luocong
* @date 2024/8/16 11:08
* @version 1.0
*/
public interface IMeowShopDataReportService {
/**
* 查询设备与耗材数据
*
* @param request request
* @param jwtHelper jwtHelper
* @return Result<NewDeviceAndConsumableVO>
*/
Result<NewDeviceAndConsumableVO> selectDeviceAndConsumable(HttpServletRequest request, JwtHelper jwtHelper);
/**
* 设备实时数据查询
*
* @param request request
* @param jwtHelper jwtHelper
* @return Result<List < NewDeviceRealTimeVO>>
*/
Result<List<NewDeviceRealTimeVO>> selectDeviceRealTime(HttpServletRequest request, JwtHelper jwtHelper);
/**
* 员工排行数据
*
* @param request request
* @param jwtHelper jwtHelper
* @param flag flag
* @param shopAccount shopAccount
* @return Result<List < NewEmployeeRankVO>>
*/
Result<List<NewEmployeeRankVO>> selectEmpOperateRank(HttpServletRequest request, JwtHelper jwtHelper, Integer flag, String[] shopAccount);
/**
* 门店消耗排行数据
*
* @param request request
* @param jwtHelper jwtHelper
* @param flag 日期 1-昨天 2-近七天 3-近三十天
* @param pageNum pageNum
* @param pageSize pageSize
* @return Result<PageUtils>
*/
Result<PageUtils> selectShopConsumerRank(HttpServletRequest request, JwtHelper jwtHelper, Integer flag, Integer pageNum, Integer pageSize);
/**
* 设备地域分布
*
* @param request request
* @param jwtHelper jwtHelper
* @param deviceCode deviceCode
* @param pageNum pageNum
* @param pageSize pageSize
* @return Result<PageUtils>
*/
Result<PageUtils> selectRegionalDistribution(HttpServletRequest request, JwtHelper jwtHelper, String[] deviceCode, Integer pageNum, Integer pageSize);
/**
* 客户与案例
*
* @param request request
* @param jwtHelper jwtHelper
* @return Result<NewClientAndCaseGroup>
*/
Result<NewClientAndCaseGroupVO> selectClientAndCase(HttpServletRequest request, JwtHelper jwtHelper);
/**
* 检测排行
*
* @param request request
* @param jwtHelper jwtHelper
* @param flag 日期 1-昨天 2-近七天 3-近三十天
* @param pageNum pageNum
* @param pageSize pageSize
* @return Result<List < NewCheckCaseRankVO>>
*/
Result<PageUtils> selectCheckCaseRank(HttpServletRequest request, JwtHelper jwtHelper, Integer flag, Integer pageNum, Integer pageSize);
/**
* 产品推荐曝光
*
* @param request request
* @param jwtHelper jwtHelper
* @param pageNum pageNum
* @param pageSize pageSize
* @return
*/
Result<PageUtils> selectProductRecommend(HttpServletRequest request, JwtHelper jwtHelper, Integer pageNum, Integer pageSize);
/**
* 客户到店排行
*
* @param request request
* @param jwtHelper jwtHelper
* @param flag flag
* @param pageNum pageNum
* @param pageSize pageSize
* @return Result<List<NewArriveShopRankVO>>
*/
Result<PageUtils> selectArriveShopRank(HttpServletRequest request, JwtHelper jwtHelper, Integer flag, Integer pageNum, Integer pageSize);
/**
* 年龄分布
*
* @param request request
* @param jwtHelper jwtHelper
* @param shopAccounts 门店账号
* @return Result<List<NewAgeDistributionVO>>
*/
Result<List<NewAgeDistributionVO>> selectAgeDistribution(HttpServletRequest request, JwtHelper jwtHelper, String[] shopAccounts);
/**
* 客户地域分布 - 机构专属
*
* @param request request
* @param jwtHelper jwtHelper
* @param pageNum pageNum
* @param pageSize pageSize
* @return Result<List<NewClientDistributionVO>>
*/
Result<PageUtils> selectClientDistribution(HttpServletRequest request, JwtHelper jwtHelper, Integer pageNum, Integer pageSize);
/**
* 皮肤问题方案推荐
*
* @param regionId 区域id
* @return Result<List<SkinProblemRecommendVO>>
*/
Result<List<SkinProblemRecommendVO>> selectSkinProblemRecommend(Long regionId);
/**
* 耗材消耗排行
*
* @param request request
* @param jwtHelper jwtHelper
* @param shopAccounts 门店账号
* @param selectType 选择类型(0-我的,1-全国)
* @return Result<List<NewConsumableRankVO>>
*/
Result<List<NewConsumableRankVO>> selectConsumableRank(HttpServletRequest request, JwtHelper jwtHelper, String[] shopAccounts, Integer selectType);
/**
* 耗材消耗排行
*
* @param request request
* @param jwtHelper jwtHelper
* @param shopAccounts 门店账号
* @param selectType 选择类型(0-我的,1-全国)
*/
Result<Void> newConsumableDownload(HttpServletRequest request, JwtHelper jwtHelper, String[] shopAccounts, Integer selectType);
/**
* 业绩排行
*
* @param request request
* @param jwtHelper jwtHelper
* @param lineCityId 城市线id
* @return Result<List<NewPerformanceRankVO>>
*/
Result<List<NewPerformanceRankVO>> performanceRank(HttpServletRequest request, JwtHelper jwtHelper, Long lineCityId);
/**
* 业绩报表下载
*
* @param request request
* @param jwtHelper jwtHelper
* @param lineCityId lineCityId
*/
Result<Void> performanceDownload(HttpServletRequest request, JwtHelper jwtHelper, Long lineCityId);
/**
*
* @param request
* @param jwtHelper
* @param pageNum
* @param pageSize
* @return
*/
Result<PageUtils> selectDownloadList(HttpServletRequest request, JwtHelper jwtHelper, Integer pageNum, Integer pageSize);
}
package com.dr.service.impl;
import com.dr.entity.Config;
import com.dr.mapper.ConfigMapper;
import com.dr.service.IConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @Auther tlw
* @Date 2022/5/5
*/
@Service
public class ConfigServiceImpl implements IConfigService {
@Autowired
private ConfigMapper configMapper;
@Override
public Config findConfigByKeystr(String keystr) {
return configMapper.findConfigByKeystr(keystr);
}
@Override
public List<Config> findConfigListByKeystr(String keystr) {
return configMapper.findConfigListByKeystr(keystr);
}
}
package com.dr.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dr.entity.DrConsumableUseInfoByDayEntity;
import com.dr.mapper.DrConsumableUseInfoByDayMapper;
import com.dr.service.IDrConsumableUseInfoByDayService;
import org.springframework.stereotype.Service;
@Service
public class DrConsumableUseInfoByDayServiceImpl extends ServiceImpl<DrConsumableUseInfoByDayMapper, DrConsumableUseInfoByDayEntity> implements IDrConsumableUseInfoByDayService {
}
\ No newline at end of file
package com.dr.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dr.entity.DrConsumableUseInfoByMonthEntity;
import com.dr.mapper.DrConsumableUseInfoByMonthMapper;
import com.dr.service.IDrConsumableUseInfoByMonthService;
import org.springframework.stereotype.Service;
@Service
public class DrConsumableUseInfoByMonthServiceImpl extends ServiceImpl<DrConsumableUseInfoByMonthMapper, DrConsumableUseInfoByMonthEntity> implements IDrConsumableUseInfoByMonthService {
}
\ No newline at end of file
package com.dr.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dr.dto.DeviceTypeStartByMonthDTO;
import com.dr.entity.DrDeviceTypeStartByMonthEntity;
import com.dr.mapper.DrDeviceTypeStartByMonthMapper;
import com.dr.service.IDrDeviceTypeStartByMonthService;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Set;
@Service
public class DrDeviceTypeStartByMonthServiceImpl extends ServiceImpl<DrDeviceTypeStartByMonthMapper, DrDeviceTypeStartByMonthEntity> implements IDrDeviceTypeStartByMonthService {
@Override
public List<DeviceTypeStartByMonthDTO> selectDevStartList(String startTime, String endTime, Set<String> deviceTypeSet, String orgAccount, String shopAccount, Long lineCityId) {
return this.baseMapper.selectDevStartList(startTime, endTime, deviceTypeSet, orgAccount, shopAccount, lineCityId);
}
}
\ No newline at end of file
package com.dr.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dr.entity.DrEmployeeUseDeviceCountByDayEntity;
import com.dr.mapper.DrEmployeeUseDeviceCountByDayMapper;
import com.dr.service.IDrEmployeeUseDeviceCountByDayService;
import org.springframework.stereotype.Service;
@Service
public class DrEmployeeUseDeviceCountByDayServiceImpl extends ServiceImpl<DrEmployeeUseDeviceCountByDayMapper, DrEmployeeUseDeviceCountByDayEntity> implements IDrEmployeeUseDeviceCountByDayService {
}
\ No newline at end of file
package com.dr.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dr.entity.DrLastYearSkinProblemByMonthEntity;
import com.dr.mapper.DrLastYearSkinProblemByMonthMapper;
import com.dr.service.IDrLastYearSkinProblemByMonthService;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class DrLastYearSkinProblemByMonthServiceImpl extends ServiceImpl<DrLastYearSkinProblemByMonthMapper, DrLastYearSkinProblemByMonthEntity> implements IDrLastYearSkinProblemByMonthService {
@Override
public List<DrLastYearSkinProblemByMonthEntity> selectSkinProblemRecommend(Long regionId, String startTime, String endTime) {
return this.baseMapper.selectSkinProblemRecommend(regionId, startTime, endTime);
}
}
\ No newline at end of file
package com.dr.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dr.mapper.DrOrgAndShopDataCountMapper;
import com.dr.service.IDrOrgAndShopDataCountService;
import com.dr.entity.DrOrgAndShopDataCountEntity;
import org.springframework.stereotype.Service;
@Service
public class DrOrgAndShopDataCountServiceImpl extends ServiceImpl<DrOrgAndShopDataCountMapper, DrOrgAndShopDataCountEntity> implements IDrOrgAndShopDataCountService {
}
\ No newline at end of file
package com.dr.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dr.entity.DrShopDeviceTypeDistributeByDayEntity;
import com.dr.mapper.DrShopDeviceTypeDistributeByDayMapper;
import com.dr.service.IDrShopDeviceTypeDistributeByDayService;
import org.springframework.stereotype.Service;
@Service
public class DrShopDeviceTypeDistributeByDayServiceImpl extends ServiceImpl<DrShopDeviceTypeDistributeByDayMapper, DrShopDeviceTypeDistributeByDayEntity> implements IDrShopDeviceTypeDistributeByDayService {
}
\ No newline at end of file
package com.dr.service.impl;
import cn.hutool.core.util.IdUtil;
import cn.hutool.http.HttpUtil;
import com.alibaba.fastjson2.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.dr.config.RabbitMqConfig;
import com.dr.constant.NewDataReportConstant;
import com.dr.filter.token.JwtHelper;
import com.dr.mapper.*;
import com.dr.service.*;
import com.dr.util.*;
import com.dr.vo.*;
import com.dr.dto.*;
import com.dr.entity.*;
import com.nimbusds.jose.Payload;
import net.minidev.json.JSONObject;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.time.LocalDateTime;
import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors;
/**
* @description 喵星球小程序数据报告
* @author luocong
* @date 2024/8/16 11:08
* @version 1.0
*/
@Service
public class MeowShopDataReportServiceImpl implements IMeowShopDataReportService {
//@Value("${METIS_BASE_URL}")
//private String metisBaseUrl;
@Autowired
private AppConstantDTO appConstantDTO;
@Autowired
private WxAppletuserMapper wxAppletuserMapper;
@Autowired
private EmployeeManageMapper employeeManageMapper;
@Autowired
private IDrOrgAndShopDataCountService drOrgAndShopDataCountService;
//@Autowired
//private GestationRecordMapper gestationRecordMapper;
//@Autowired
//private ShopMapper shopMapper;
//@Autowired
//private DeviceTypeMapper deviceTypeMapper;
//@Autowired
//private ConsumManagerMapper consumManagerMapper;
@Autowired
private IDrEmployeeUseDeviceCountByDayService drEmployeeUseDeviceCountByDayService;
@Autowired
private IDrConsumableUseInfoByDayService drConsumableUseInfoByDayService;
@Autowired
private IDrShopDeviceTypeDistributeByDayService drShopDeviceTypeDistributeByDayService;
@Autowired
private IDrLastYearSkinProblemByMonthService drLastYearSkinProblemByMonthService;
@Autowired
private StringRedisTemplate stringRedisTemplate;
@Autowired
private IDrConsumableUseInfoByMonthService drConsumableUseInfoByMonthService;
@Autowired
private IConfigService configService;
@Autowired
private IDrDeviceTypeStartByMonthService drDeviceTypeStartByMonthService;
//@Autowired
//private DrDownloadCenterMapper drDownloadCenterMapper;
public static final String BASE_REDIS_KEY = NewDataReportConstant.BASE_DR_REDIS_KEY + NewDataReportConstant.SKIN_PROB_REC_KEY;
@Override
public Result<NewDeviceAndConsumableVO> selectDeviceAndConsumable(HttpServletRequest request, JwtHelper jwtHelper) {
Result<NewDeviceAndConsumableVO> result = new Result<>();
ParseTokenDTO parseTokenDTO = this.parseToken(request, jwtHelper);
if (null == parseTokenDTO || parseTokenDTO.getPowerType().equals("0")) {
return result.error(-1, "无权限!");
}
LambdaQueryWrapper<DrOrgAndShopDataCountEntity> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(DrOrgAndShopDataCountEntity::getDeleted, 0);
if (parseTokenDTO.getPowerType().equals("1")) {
//机构权限
queryWrapper.eq(DrOrgAndShopDataCountEntity::getOrgAccount, parseTokenDTO.getOrgAccount());
} else if (parseTokenDTO.getPowerType().equals("2")) {
//门店
queryWrapper.eq(DrOrgAndShopDataCountEntity::getShopAccount, parseTokenDTO.getShopAccount());
}
queryWrapper.eq(DrOrgAndShopDataCountEntity::getDeleted, 0);
List<DrOrgAndShopDataCountEntity> list = this.drOrgAndShopDataCountService.list(queryWrapper);
if (CollectionUtils.isEmpty(list)) {
return result;
}
//设备总数
Long deviceNum = list.stream().mapToLong(DrOrgAndShopDataCountEntity::getDeviceNum).sum();
//耗材消耗总数
Long consumableNum = list.stream().mapToLong(DrOrgAndShopDataCountEntity::getConsumableUseNum).sum();
NewDeviceAndConsumableVO newDeviceAndConsumableVO = new NewDeviceAndConsumableVO();
newDeviceAndConsumableVO.setDeviceNumber(deviceNum);
newDeviceAndConsumableVO.setConsumableNumber(consumableNum);
return result.ok(newDeviceAndConsumableVO);
}
@Override
public Result<List<NewDeviceRealTimeVO>> selectDeviceRealTime(HttpServletRequest request, JwtHelper jwtHelper) {
return null;
}
/*
@Override
public Result<List<NewDeviceRealTimeVO>> selectDeviceRealTime(HttpServletRequest request, JwtHelper jwtHelper) {
Result<List<NewDeviceRealTimeVO>> result = new Result<>();
ParseTokenDTO parseTokenDTO = this.parseToken(request, jwtHelper);
if (null == parseTokenDTO || parseTokenDTO.getPowerType().equals("0")) {
return result.error(-1, "无权限!");
}
Shop shop = this.shopMapper.selectByAccounts(parseTokenDTO.getShopAccount());
LambdaQueryWrapper<GestationRecord> qw = new LambdaQueryWrapper<>();
if (parseTokenDTO.getPowerType().equals("1")) {
//机构权限
qw.eq(GestationRecord::getOrgid, shop.getOrgid());
} else if (parseTokenDTO.getPowerType().equals("2")) {
//门店
qw.eq(GestationRecord::getOrgid, shop.getId());
}
List<GestationRecord> gestationRecords = this.gestationRecordMapper.selectList(new LambdaQueryWrapper<GestationRecord>().eq(GestationRecord::getShopid, shop.getId())
.orderByDesc(GestationRecord::getCid)
.last("limit 5"));
if (CollectionUtils.isEmpty(gestationRecords)) {
return result;
}
Set<Integer> shopIds = gestationRecords.stream().map(GestationRecord::getShopid).collect(Collectors.toSet());
if (CollectionUtils.isEmpty(shopIds)) {
return result;
}
List<Shop> shops = this.shopMapper.selectBatchIds(shopIds);
Map<Integer, String> shopMap = shops.stream().collect(Collectors.toMap(Shop::getId, Shop::getShopname));
Set<String> deviceCodes = gestationRecords.stream().map(GestationRecord::getDevicecode).collect(Collectors.toSet());
List<DeviceType> deviceTypes = this.deviceTypeMapper.selectBatchIds(deviceCodes);
Map<String, String> deviceTypeMap = deviceTypes.stream().collect(Collectors.toMap(DeviceType::getCode, DeviceType::getName));
Set<String> consumableNumbers = gestationRecords.stream().map(GestationRecord::getConsumablenumber).collect(Collectors.toSet());
Map<String, String> conMap = new HashMap<>(5);
if (!CollectionUtils.isEmpty(consumableNumbers)) {
List<ConsumManager> consumManagers = this.consumManagerMapper.selectList(new LambdaQueryWrapper<ConsumManager>()
.in(ConsumManager::getConnum, consumableNumbers));
conMap = consumManagers.stream().collect(Collectors.toMap(ConsumManager::getConnum, ConsumManager::getConname));
}
List<NewDeviceRealTimeVO> list = new ArrayList<>();
for (GestationRecord gestationRecord : gestationRecords) {
NewDeviceRealTimeVO newDeviceRealTimeVO = new NewDeviceRealTimeVO();
LocalDateTime localDateTime = DateUtil.longToTimeStamp(gestationRecord.getData());
newDeviceRealTimeVO.setStartTime(localDateTime);
newDeviceRealTimeVO.setShopName(shopMap.get(gestationRecord.getShopid()));
newDeviceRealTimeVO.setDeviceTypeName(deviceTypeMap.get(gestationRecord.getDevicecode()));
newDeviceRealTimeVO.setClientName(gestationRecord.getClientname());
newDeviceRealTimeVO.setEmployeeName(gestationRecord.getOptionname());
newDeviceRealTimeVO.setConsumableTypeName(conMap.get(gestationRecord.getConsumablenumber()));
list.add(newDeviceRealTimeVO);
}
return result.ok(list);
}
*/
@Override
public Result<List<NewEmployeeRankVO>> selectEmpOperateRank(HttpServletRequest request, JwtHelper jwtHelper, Integer flag, String[] shopAccount) {
Result<List<NewEmployeeRankVO>> result = new Result<>();
ParseTokenDTO parseTokenDTO = this.parseToken(request, jwtHelper);
if (null == parseTokenDTO || parseTokenDTO.getPowerType().equals("0")) {
return result.error(-1, "无权限!");
}
LambdaQueryWrapper<DrEmployeeUseDeviceCountByDayEntity> qw = new LambdaQueryWrapper<>();
//日期 1-昨天 2-近七天 3-近三十天
switch (flag) {
case 2:
String sevenDayTime = DateUtil.getBeforeTime(7, DateUtil.patternA, 1);
qw.ge(DrEmployeeUseDeviceCountByDayEntity::getDailyTime, sevenDayTime);
break;
case 3:
String thirtyDayTime = DateUtil.getBeforeTime(30, DateUtil.patternA, 1);
qw.ge(DrEmployeeUseDeviceCountByDayEntity::getDailyTime, thirtyDayTime);
break;
default:
String yesterday = DateUtil.getBeforeTime(1, DateUtil.patternA, 1);
qw.ge(DrEmployeeUseDeviceCountByDayEntity::getDailyTime, yesterday);
break;
}
if (parseTokenDTO.getPowerType().equals("1")) {
//机构权限
qw.eq(DrEmployeeUseDeviceCountByDayEntity::getOrgAccount, parseTokenDTO.getOrgAccount());
List<String> shopAccounts = Arrays.asList(shopAccount);
qw.in(!CollectionUtils.isEmpty(shopAccounts), DrEmployeeUseDeviceCountByDayEntity::getShopAccount, shopAccounts);
} else if (parseTokenDTO.getPowerType().equals("2")) {
//门店
qw.eq(DrEmployeeUseDeviceCountByDayEntity::getShopAccount, parseTokenDTO.getShopAccount());
}
qw.eq(DrEmployeeUseDeviceCountByDayEntity::getDeleted, 0);
List<DrEmployeeUseDeviceCountByDayEntity> drEmployeeUseDeviceCountList = this.drEmployeeUseDeviceCountByDayService.list(qw);
List<NewEmployeeRankVO> list = new ArrayList<>();
Map<String, Long> drEmployeeUseDeviceMap = drEmployeeUseDeviceCountList.stream()
.collect(Collectors.groupingBy(DrEmployeeUseDeviceCountByDayEntity::getEmployeeName,
Collectors.summingLong(DrEmployeeUseDeviceCountByDayEntity::getOperateNum)))
.entrySet().stream().sorted(Map.Entry.comparingByValue(Comparator.reverseOrder()))
.collect(Collectors.toMap(
Map.Entry::getKey,
Map.Entry::getValue,
(oldValue, newValue) -> oldValue, // 处理键冲突,这里保留旧值
LinkedHashMap::new // 保持顺序的 Map
));
drEmployeeUseDeviceMap.forEach((k, v) -> {
NewEmployeeRankVO newEmployeeRankVO = new NewEmployeeRankVO();
newEmployeeRankVO.setEmployeeName(k);
newEmployeeRankVO.setOperationNum(v);
drEmployeeUseDeviceCountList.stream().filter(t -> t.getEmployeeName().equals(k)).findAny().ifPresent(t -> {
newEmployeeRankVO.setShopName(t.getShopName());
});
list.add(newEmployeeRankVO);
});
return result.ok(list);
}
@Override
public Result<PageUtils> selectShopConsumerRank(HttpServletRequest request, JwtHelper jwtHelper, Integer flag, Integer pageNum, Integer pageSize) {
//机构专属
Result<PageUtils> result = new Result<>();
ParseTokenDTO parseTokenDTO = this.parseToken(request, jwtHelper);
if (null == parseTokenDTO || parseTokenDTO.getPowerType().equals("0") || parseTokenDTO.getPowerType().equals("2")) {
return result.error(-1, "无权限!");
}
LambdaQueryWrapper<DrConsumableUseInfoByDayEntity> qw = new LambdaQueryWrapper<>();
//日期 1-昨天 2-近七天 3-近三十天
switch (flag) {
case 2:
String sevenDayTime = DateUtil.getBeforeTime(7, DateUtil.patternA, 1);
qw.ge(DrConsumableUseInfoByDayEntity::getDailyTime, sevenDayTime);
//机构数据
break;
case 3:
String thirtyDayTime = DateUtil.getBeforeTime(30, DateUtil.patternA, 1);
qw.ge(DrConsumableUseInfoByDayEntity::getDailyTime, thirtyDayTime);
break;
default:
String yesterday = DateUtil.getBeforeTime(1, DateUtil.patternA, 1);
qw.ge(DrConsumableUseInfoByDayEntity::getDailyTime, yesterday);
break;
}
qw.eq(DrConsumableUseInfoByDayEntity::getOrgAccount, parseTokenDTO.getOrgAccount());
qw.eq(DrConsumableUseInfoByDayEntity::getDeleted, 0);
List<DrConsumableUseInfoByDayEntity> drConsumableUseInfoByDayList = this.drConsumableUseInfoByDayService.list(qw);
//耗材消耗总数
long conNum = drConsumableUseInfoByDayList.stream().mapToLong(DrConsumableUseInfoByDayEntity::getDailyConsumableUseNum).sum();
if (conNum == 0) {
return result;
}
Map<String, Long> consumableMap = drConsumableUseInfoByDayList.stream()
.collect(Collectors.groupingBy(DrConsumableUseInfoByDayEntity::getShopName,
Collectors.summingLong(DrConsumableUseInfoByDayEntity::getDailyConsumableUseNum)))
.entrySet().stream().sorted(Map.Entry.comparingByValue(Comparator.reverseOrder()))
.collect(Collectors.toMap(
Map.Entry::getKey,
Map.Entry::getValue,
(oldValue, newValue) -> oldValue,
LinkedHashMap::new
));
List<Map.Entry<String, Long>> pageList = consumableMap.entrySet().stream().skip((long) (pageNum - 1) * pageSize)
.limit(pageSize)
.collect(Collectors.toList());
List<NewShopConsumableRankVO> list = new ArrayList<>();
pageList.forEach(
entry -> {
NewShopConsumableRankVO newShopConsumableRankVO = new NewShopConsumableRankVO();
newShopConsumableRankVO.setShopName(entry.getKey());
newShopConsumableRankVO.setOperationNum(entry.getValue());
BigDecimal ratio = new BigDecimal(entry.getValue().toString()).divide(new BigDecimal(Long.toString(conNum)), 2, RoundingMode.HALF_DOWN);
newShopConsumableRankVO.setRatio(ratio.toString());
list.add(newShopConsumableRankVO);
}
);
return result.ok(new PageUtils(list, consumableMap.size(), pageSize, pageNum));
}
@Override
public Result<PageUtils> selectRegionalDistribution(HttpServletRequest request, JwtHelper jwtHelper, String[] deviceCode, Integer pageNum, Integer pageSize) {
//机构专属
Result<PageUtils> result = new Result<>();
ParseTokenDTO parseTokenDTO = this.parseToken(request, jwtHelper);
if (null == parseTokenDTO || parseTokenDTO.getPowerType().equals("0") || parseTokenDTO.getPowerType().equals("2")) {
return result.error(-1, "无权限!");
}
LambdaQueryWrapper<DrShopDeviceTypeDistributeByDayEntity> qw = new LambdaQueryWrapper<>();
List<String> deviceCodeList = Arrays.asList(deviceCode);
qw.in(!CollectionUtils.isEmpty(deviceCodeList), DrShopDeviceTypeDistributeByDayEntity::getDeviceTypeCode, deviceCodeList);
qw.eq(DrShopDeviceTypeDistributeByDayEntity::getOrgAccount, parseTokenDTO.getOrgAccount());
qw.eq(DrShopDeviceTypeDistributeByDayEntity::getDeleted, 0);
List<DrShopDeviceTypeDistributeByDayEntity> drShopDeviceTypeDistributeByDayList = this.drShopDeviceTypeDistributeByDayService.list(qw);
if (CollectionUtils.isEmpty(drShopDeviceTypeDistributeByDayList)) {
return result;
}
Map<String, Long> deviceDistMap = drShopDeviceTypeDistributeByDayList.stream()
.collect(Collectors.groupingBy(DrShopDeviceTypeDistributeByDayEntity::getShopAddress,
Collectors.summingLong(DrShopDeviceTypeDistributeByDayEntity::getDeviceNum)))
.entrySet().stream().sorted(Map.Entry.comparingByValue(Comparator.reverseOrder()))
.collect(Collectors.toMap(
Map.Entry::getKey,
Map.Entry::getValue,
(oldValue, newValue) -> oldValue,
LinkedHashMap::new
));
List<Map.Entry<String, Long>> pageList = deviceDistMap.entrySet().stream().skip((long) (pageNum - 1) * pageSize)
.limit(pageSize)
.collect(Collectors.toList());
List<NewDeviceDistributionVO> list = new ArrayList<>();
pageList.forEach(
entry -> {
NewDeviceDistributionVO newDeviceDistributionVO = new NewDeviceDistributionVO();
newDeviceDistributionVO.setProvinceName(entry.getKey());
newDeviceDistributionVO.setDeviceNum(entry.getValue());
list.add(newDeviceDistributionVO);
}
);
return result.ok(new PageUtils(list, deviceDistMap.size(), pageSize, pageNum));
}
@Override
public Result<NewClientAndCaseGroupVO> selectClientAndCase(HttpServletRequest request, JwtHelper jwtHelper) {
Result<NewClientAndCaseGroupVO> result = new Result<>();
ParseTokenDTO parseTokenDTO = this.parseToken(request, jwtHelper);
if (null == parseTokenDTO || parseTokenDTO.getPowerType().equals("0")) {
return result.error(-1, "无权限!");
}
Map<String, Object> paramMap = new HashMap<>();
paramMap.put("oAccount", parseTokenDTO.getOrgAccount());
if (parseTokenDTO.getPowerType().equals("2")) {
paramMap.put("mAccount", parseTokenDTO.getShopAccount());
}
String body = HttpUtil.post(appConstantDTO.metisBaseUrl + "/new/dataReport/clientAndCase", paramMap);
ApiTemplate apiTemplate = JSON.parseObject(body, ApiTemplate.class);
if (!apiTemplate.getSign().equals(1)) {
return result;
}
NewClientAndCaseGroupVO newClientAndCaseGroupVO = JSON.parseObject(apiTemplate.getData().toString(), NewClientAndCaseGroupVO.class);
return result.ok(newClientAndCaseGroupVO);
}
@Override
public Result<PageUtils> selectCheckCaseRank(HttpServletRequest request, JwtHelper jwtHelper, Integer flag, Integer pageNum, Integer pageSize) {
Result<PageUtils> result = new Result<>();
ParseTokenDTO parseTokenDTO = this.parseToken(request, jwtHelper);
if (null == parseTokenDTO || parseTokenDTO.getPowerType().equals("0") || parseTokenDTO.getPowerType().equals("2")) {
return result.error(-1, "无权限!");
}
Map<String, Object> paramMap = new HashMap<>();
paramMap.put("oAccount", parseTokenDTO.getOrgAccount());
paramMap.put("pageNum", pageNum);
paramMap.put("pageSize", pageSize);
//日期 1-昨天 2-近七天 3-近三十天
switch (flag) {
case 2:
String sevenDayTime = DateUtil.getBeforeTime(7, DateUtil.patternA, 1);
paramMap.put("time", sevenDayTime);
//机构数据
break;
case 3:
String thirtyDayTime = DateUtil.getBeforeTime(30, DateUtil.patternA, 1);
paramMap.put("time", thirtyDayTime);
break;
default:
String yesterday = DateUtil.getBeforeTime(1, DateUtil.patternA, 1);
paramMap.put("time", yesterday);
break;
}
String body = HttpUtil.post(appConstantDTO.metisBaseUrl + "/new/dataReport/checkCaseRank", paramMap);
ApiTemplate apiTemplate = JSON.parseObject(body, ApiTemplate.class);
if (!apiTemplate.getSign().equals(1)) {
return result;
}
List<NewCheckCaseRankVO> list = JSON.parseArray(apiTemplate.getData().toString(), NewCheckCaseRankVO.class);
return result.ok(new PageUtils(list, apiTemplate.getTotal(), pageSize, pageNum));
}
@Override
public Result<PageUtils> selectProductRecommend(HttpServletRequest request, JwtHelper jwtHelper, Integer pageNum, Integer pageSize) {
Result<PageUtils> result = new Result<>();
ParseTokenDTO parseTokenDTO = this.parseToken(request, jwtHelper);
if (null == parseTokenDTO || parseTokenDTO.getPowerType().equals("0")) {
return result.error(-1, "无权限!");
}
Map<String, Object> paramMap = new HashMap<>();
paramMap.put("pageNum", pageNum);
paramMap.put("pageSize", pageSize);
paramMap.put("oAccount", parseTokenDTO.getOrgAccount());
if (parseTokenDTO.getPowerType().equals("2")) {
paramMap.put("mAccount", parseTokenDTO.getShopAccount());
}
String body = HttpUtil.post(appConstantDTO.metisBaseUrl + "/new/dataReport/productRecommend", paramMap);
ApiTemplate apiTemplate = JSON.parseObject(body, ApiTemplate.class);
if (!apiTemplate.getSign().equals(1)) {
return result;
}
List<NewProductRecommendVO> list = JSON.parseArray(apiTemplate.getData().toString(), NewProductRecommendVO.class);
return result.ok(new PageUtils(list, apiTemplate.getTotal(), pageSize, pageNum));
}
@Override
public Result<PageUtils> selectArriveShopRank(HttpServletRequest request, JwtHelper jwtHelper, Integer flag, Integer pageNum, Integer pageSize) {
Result<PageUtils> result = new Result<>();
ParseTokenDTO parseTokenDTO = this.parseToken(request, jwtHelper);
if (null == parseTokenDTO || parseTokenDTO.getPowerType().equals("0") || parseTokenDTO.getPowerType().equals("2")) {
return result.error(-1, "无权限!");
}
Map<String, Object> paramMap = new HashMap<>();
paramMap.put("oAccount", parseTokenDTO.getOrgAccount());
paramMap.put("pageNum", pageNum);
paramMap.put("pageSize", pageSize);
//日期 1-昨天 2-近七天 3-近三十天
switch (flag) {
case 2:
String sevenDayTime = DateUtil.getBeforeTime(7, DateUtil.patternA, 1);
paramMap.put("time", sevenDayTime);
//机构数据
break;
case 3:
String thirtyDayTime = DateUtil.getBeforeTime(30, DateUtil.patternA, 1);
paramMap.put("time", thirtyDayTime);
break;
default:
String yesterday = DateUtil.getBeforeTime(1, DateUtil.patternA, 1);
paramMap.put("time", yesterday);
break;
}
String body = HttpUtil.post(appConstantDTO.metisBaseUrl + "/new/dataReport/arriveShopRank", paramMap);
ApiTemplate apiTemplate = JSON.parseObject(body, ApiTemplate.class);
if (!apiTemplate.getSign().equals(1)) {
return result;
}
List<NewArriveShopRankVO> list = JSON.parseArray(apiTemplate.getData().toString(), NewArriveShopRankVO.class);
return result.ok(new PageUtils(list, apiTemplate.getTotal(), pageSize, pageNum));
}
@Override
public Result<List<NewAgeDistributionVO>> selectAgeDistribution(HttpServletRequest request, JwtHelper jwtHelper, String[] shopAccounts) {
Result<List<NewAgeDistributionVO>> result = new Result<>();
ParseTokenDTO parseTokenDTO = this.parseToken(request, jwtHelper);
if (null == parseTokenDTO || parseTokenDTO.getPowerType().equals("0")) {
return result.error(-1, "无权限!");
}
Map<String, Object> paramMap = new HashMap<>();
paramMap.put("oAccount", parseTokenDTO.getOrgAccount());
List<String> mAccounts = new ArrayList<>();
if (null != shopAccounts && shopAccounts.length > 0) {
mAccounts = Arrays.stream(shopAccounts).collect(Collectors.toList());
}
if (parseTokenDTO.getPowerType().equals("2")) {
mAccounts.add(parseTokenDTO.getShopAccount());
}
paramMap.put("mAccount", mAccounts);
String body = HttpUtil.post(appConstantDTO.metisBaseUrl + "/new/dataReport/ageDistribution", paramMap);
ApiTemplate apiTemplate = JSON.parseObject(body, ApiTemplate.class);
if (!apiTemplate.getSign().equals(1)) {
return result;
}
List<NewAgeDistributionVO> list = JSON.parseArray(apiTemplate.getData().toString(), NewAgeDistributionVO.class);
return result.ok(list);
}
@Override
public Result<PageUtils> selectClientDistribution(HttpServletRequest request, JwtHelper jwtHelper, Integer pageNum, Integer pageSize) {
Result<PageUtils> result = new Result<>();
ParseTokenDTO parseTokenDTO = this.parseToken(request, jwtHelper);
if (null == parseTokenDTO || parseTokenDTO.getPowerType().equals("0") || parseTokenDTO.getPowerType().equals("2")) {
return result.error(-1, "无权限!");
}
Map<String, Object> paramMap = new HashMap<>();
paramMap.put("oAccount", parseTokenDTO.getOrgAccount());
paramMap.put("pageNum", pageNum);
paramMap.put("pageSize", pageSize);
String body = HttpUtil.post(appConstantDTO.metisBaseUrl + "/new/dataReport/clientDistribution", paramMap);
ApiTemplate apiTemplate = JSON.parseObject(body, ApiTemplate.class);
if (!apiTemplate.getSign().equals(1)) {
return result;
}
List<NewClientDistributionVO> list = JSON.parseArray(apiTemplate.getData().toString(), NewClientDistributionVO.class);
return result.ok(new PageUtils(list, apiTemplate.getTotal(), pageSize, pageNum));
}
@Override
public Result<List<SkinProblemRecommendVO>> selectSkinProblemRecommend(Long regionId) {
Result<List<SkinProblemRecommendVO>> result = new Result<>();
String[] currentSeasonTimeRange = DateUtil.getCurrentSeasonTimeRange();
List<DrLastYearSkinProblemByMonthEntity> drLastYearSkinProblemByMonthList = this.drLastYearSkinProblemByMonthService
.selectSkinProblemRecommend(regionId, currentSeasonTimeRange[0], currentSeasonTimeRange[1]);
if (CollectionUtils.isEmpty(drLastYearSkinProblemByMonthList)) {
return result;
}
//黑头数量
BigDecimal one = new BigDecimal("0");
BigDecimal oneTotal = new BigDecimal("0");
//粉刺数量
BigDecimal two = new BigDecimal("0");
BigDecimal twoTotal = new BigDecimal("0");
//毛孔数量
BigDecimal three = new BigDecimal("0");
BigDecimal threeTotal = new BigDecimal("0");
//皱纹数量
BigDecimal four = new BigDecimal("0");
BigDecimal fourTotal = new BigDecimal("0");
//色斑数量
BigDecimal five = new BigDecimal("0");
BigDecimal fiveTotal = new BigDecimal("0");
for (DrLastYearSkinProblemByMonthEntity lastYearSkinProblemByMonthEntity : drLastYearSkinProblemByMonthList) {
//黑头
Integer blackhead = lastYearSkinProblemByMonthEntity.getBlackhead();
Integer seriousBlackhead = lastYearSkinProblemByMonthEntity.getSeriousBlackhead();
oneTotal = oneTotal.add(new BigDecimal(blackhead == null ? 0 : blackhead));
one = one.add(new BigDecimal(seriousBlackhead == null ? 0 : seriousBlackhead));
//粉刺
Integer acne = lastYearSkinProblemByMonthEntity.getAcne();
Integer seriousAcne = lastYearSkinProblemByMonthEntity.getSeriousAcne();
twoTotal = twoTotal.add(new BigDecimal(acne == null ? 0 : acne));
two = two.add(new BigDecimal(seriousAcne == null ? 0 : seriousAcne));
//毛孔
Integer pore = lastYearSkinProblemByMonthEntity.getPore();
Integer seriousPore = lastYearSkinProblemByMonthEntity.getSeriousPore();
threeTotal = threeTotal.add(new BigDecimal(pore == null ? 0 : pore));
three = three.add(new BigDecimal(seriousPore == null ? 0 : seriousPore));
//皱纹
Integer wrinkle = lastYearSkinProblemByMonthEntity.getWrinkle();
Integer seriousWrinkle = lastYearSkinProblemByMonthEntity.getSeriousWrinkle();
fourTotal = fourTotal.add(new BigDecimal(wrinkle == null ? 0 : wrinkle));
four = four.add(new BigDecimal(seriousWrinkle == null ? 0 : seriousWrinkle));
//色斑
Integer stain = lastYearSkinProblemByMonthEntity.getStain();
Integer seriousStain = lastYearSkinProblemByMonthEntity.getSeriousStain();
fiveTotal = fiveTotal.add(new BigDecimal(stain == null ? 0 : stain));
five = five.add(new BigDecimal(seriousStain == null ? 0 : seriousStain));
}
String skinSolveRedisKey = BASE_REDIS_KEY;
List<SkinProblemRecommendVO> list = new ArrayList<>();
for (int i = 12; i <= 16; i++) {
SkinProblemRecommendVO skinProblemRecommendVO = new SkinProblemRecommendVO();
skinProblemRecommendVO.setSkinFlag(i);
Object skinData = this.stringRedisTemplate.opsForHash().get(skinSolveRedisKey, String.valueOf(i));
List<SkinProblemContentVO> skinProblemContentVOS = new ArrayList<>();
if (null != skinData && StringUtils.isNotBlank(skinData.toString())) {
skinProblemContentVOS = JSON.parseArray(skinData.toString(), SkinProblemContentVO.class);
skinProblemContentVOS = skinProblemContentVOS.stream().filter(s -> Arrays.asList(s.getAreaConfigId().split(",")).contains(regionId.toString()))
.collect(Collectors.toList());
}
skinProblemRecommendVO.setSkinProblemContentList(skinProblemContentVOS);
switch (i) {
case 12:
if ("0".equals(oneTotal.toString())) {
skinProblemRecommendVO.setRatio("0");
}
skinProblemRecommendVO.setRatio(one.divide(oneTotal, RoundingMode.HALF_DOWN).toString());
list.add(skinProblemRecommendVO);
break;
case 13: {
if ("0".equals(twoTotal.toString())) {
skinProblemRecommendVO.setRatio("0");
}
skinProblemRecommendVO.setRatio(two.divide(twoTotal, RoundingMode.HALF_DOWN).toString());
list.add(skinProblemRecommendVO);
break;
}
case 14: {
if ("0".equals(threeTotal.toString())) {
skinProblemRecommendVO.setRatio("0");
}
skinProblemRecommendVO.setRatio(three.divide(threeTotal, RoundingMode.HALF_DOWN).toString());
list.add(skinProblemRecommendVO);
break;
}
case 15: {
if ("0".equals(fourTotal.toString())) {
skinProblemRecommendVO.setRatio("0");
}
skinProblemRecommendVO.setRatio(four.divide(fourTotal, RoundingMode.HALF_DOWN).toString());
list.add(skinProblemRecommendVO);
break;
}
case 16: {
if ("0".equals(fiveTotal.toString())) {
skinProblemRecommendVO.setRatio("0");
}
skinProblemRecommendVO.setRatio(five.divide(fiveTotal, RoundingMode.HALF_DOWN).toString());
list.add(skinProblemRecommendVO);
break;
}
default:
skinProblemRecommendVO.setRatio("0");
list.add(skinProblemRecommendVO);
}
}
return result.ok(list);
}
@Override
public Result<List<NewConsumableRankVO>> selectConsumableRank(HttpServletRequest request, JwtHelper jwtHelper, String[] shopAccounts, Integer selectType) {
Result<List<NewConsumableRankVO>> result = new Result<>();
//获取上个月时间
long[] lastMonthMinMaxTimestamp = DateUtil.getLastMonthMinMaxTimestamp();
//获取指定设备类型
String[] consumableDevicetypeCodes = this.configService.findConfigByKeystr("consumable_devicetype_code").getKeyvalue().split(",");
LambdaQueryWrapper<DrConsumableUseInfoByMonthEntity> qw = new LambdaQueryWrapper<>();
qw.eq(DrConsumableUseInfoByMonthEntity::getMonthTime, DateUtil.timeStampToString(lastMonthMinMaxTimestamp[0], DateUtil.patternYM));
qw.in(DrConsumableUseInfoByMonthEntity::getDeviceTypeCode, Arrays.asList(consumableDevicetypeCodes));
List<DrConsumableUseInfoByMonthEntity> list;
if (selectType.equals(0)) {
//我的
ParseTokenDTO parseTokenDTO = this.parseToken(request, jwtHelper);
if (null == parseTokenDTO || parseTokenDTO.getPowerType().equals("0")) {
return result.error(-1, "无权限!");
}
qw.eq(DrConsumableUseInfoByMonthEntity::getOrgAccount, parseTokenDTO.getOrgAccount());
List<String> shopAccountList = new ArrayList<>();
if (null != shopAccounts && shopAccounts.length > 0) {
shopAccountList = Arrays.stream(shopAccounts).collect(Collectors.toList());
}
if (parseTokenDTO.getPowerType().equals("1") && !CollectionUtils.isEmpty(shopAccountList)) {
shopAccountList.add(parseTokenDTO.getShopAccount());
qw.eq(DrConsumableUseInfoByMonthEntity::getShopAccount, parseTokenDTO.getShopAccount());
} else if (parseTokenDTO.getPowerType().equals("2")) {
qw.eq(DrConsumableUseInfoByMonthEntity::getShopAccount, parseTokenDTO.getShopAccount());
}
}
list = this.drConsumableUseInfoByMonthService.list(qw);
if (CollectionUtils.isEmpty(list)) {
return result;
}
Map<String, List<DrConsumableUseInfoByMonthEntity>> deviceTypeGroupMap = list.stream().collect(Collectors.groupingBy(DrConsumableUseInfoByMonthEntity::getDeviceTypeCode));
Map<String, String> deviceTypeMap = list.stream().collect(Collectors.toMap(DrConsumableUseInfoByMonthEntity::getDeviceTypeCode, DrConsumableUseInfoByMonthEntity::getDeviceTypeName, (k1, k2) -> k1));
Map<String, String> consumableTypeMap = list.stream().collect(Collectors.toMap(DrConsumableUseInfoByMonthEntity::getConsumableTypeCode,
DrConsumableUseInfoByMonthEntity::getConsumableTypeName, (k1, k2) -> k1));
List<NewConsumableRankVO> newConsumableRankList = new ArrayList<>();
deviceTypeGroupMap.forEach((deviceTypeCode, item) -> {
Map<String, Integer> conMap = item.stream().collect(Collectors.groupingBy(DrConsumableUseInfoByMonthEntity::getConsumableTypeCode,
Collectors.summingInt(DrConsumableUseInfoByMonthEntity::getDailyConsumableUseNum)));
List<Map.Entry<String, Integer>> topList = conMap.entrySet().stream()
.sorted(Map.Entry.<String, Integer>comparingByValue().reversed())
.limit(3).collect(Collectors.toList());
NewConsumableRankVO newConsumableRankVO = new NewConsumableRankVO();
newConsumableRankVO.setDeviceTypeName(deviceTypeMap.get(deviceTypeCode));
List<NewConsumableListVO> newConsumableList = new ArrayList<>();
AtomicInteger atomicInteger = new AtomicInteger(1);
for (Map.Entry<String, Integer> conTypeNumMap : topList) {
NewConsumableListVO newConsumableListVO = new NewConsumableListVO();
if (selectType.equals(1)) {
newConsumableListVO.setNum(atomicInteger.getAndIncrement());
} else {
newConsumableListVO.setNum(conTypeNumMap.getValue());
}
newConsumableListVO.setConsumableTypeName(consumableTypeMap.get(conTypeNumMap.getKey()));
newConsumableList.add(newConsumableListVO);
}
newConsumableRankVO.setConsumableList(newConsumableList);
newConsumableRankList.add(newConsumableRankVO);
});
return result.ok(newConsumableRankList);
}
@Override
public Result<Void> newConsumableDownload(HttpServletRequest request, JwtHelper jwtHelper, String[] shopAccounts, Integer selectType) {
return null;
}
/*
@Override
public Result<Void> newConsumableDownload(HttpServletRequest request, JwtHelper jwtHelper, String[] shopAccounts, Integer selectType) {
Result<Void> result = new Result<>();
ParseTokenDTO parseTokenDTO = this.parseToken(request, jwtHelper);
if (null == parseTokenDTO || parseTokenDTO.getPowerType().equals("0")) {
return result.error(-1, "无权限!");
}
String uuid = IdUtil.getSnowflakeNextIdStr();
DrDownloadCenterEntity drDownloadCenterEntity = new DrDownloadCenterEntity();
drDownloadCenterEntity.setName("");
drDownloadCenterEntity.setUuid(uuid);
drDownloadCenterEntity.setUrl("");
drDownloadCenterEntity.setOpenId(parseTokenDTO.getOpenId());
drDownloadCenterEntity.setDeleted(0);
LocalDateTime now = LocalDateTime.now();
drDownloadCenterEntity.setCreateTime(now);
drDownloadCenterEntity.setUpdateTime(now);
Shop shop = this.shopMapper.selectByAccounts(parseTokenDTO.getShopAccount());
drDownloadCenterEntity.setShopId(shop.getId().longValue());
drDownloadCenterEntity.setStatus(1);
this.drDownloadCenterMapper.insert(drDownloadCenterEntity);
NewDownloadCenterVO newDownloadCenterVO = new NewDownloadCenterVO();
newDownloadCenterVO.setUuid(uuid);
newDownloadCenterVO.setParseTokenDTO(parseTokenDTO);
newDownloadCenterVO.setConsumerFlag(2);
newDownloadCenterVO.setShopAccounts(shopAccounts);
newDownloadCenterVO.setSelectType(selectType);
Map<String, Object> map = new HashMap<>(1);
map.put("dr_down_key", JSON.toJSONString(newDownloadCenterVO));
RabbitmqSendMessageUtil.sendDelayMessage(RabbitMqConfig.SYNC_DR_DOWNLOAD_CENTER_EXCHANGE, RabbitMqConfig.SYNC_DR_DOWNLOAD_CENTER_KEY,
map, 1000L);
return result;
}
*/
@Override
public Result<List<NewPerformanceRankVO>> performanceRank(HttpServletRequest request, JwtHelper jwtHelper, Long lineCityId) {
Result<List<NewPerformanceRankVO>> result = new Result<>();
ParseTokenDTO parseTokenDTO = this.parseToken(request, jwtHelper);
if (null == parseTokenDTO || parseTokenDTO.getPowerType().equals("0")) {
return result.error(-1, "无权限!");
}
//获取上个季度开始结束时间
LocalDateTime[] lastQuarterDates = DateUtil.getLastQuarterDates();
LocalDateTime quarterStart = lastQuarterDates[0];
LocalDateTime quarterEnd = lastQuarterDates[1];
//获取指定设备类型
Config config = this.configService.findConfigByKeystr("perf_rank");
//得到设备类型对应的业绩价值
Map<String, String> deviceValueMap = Arrays.stream(config.getKeyvalue().split(","))
.map(String::trim)
.map(pair -> pair.split(":"))
.collect(Collectors.toMap(
keyValue -> keyValue[0].trim(),
keyValue -> keyValue[1].trim()
));
Set<String> deviceTypeSet = deviceValueMap.keySet();
//得到分组后本门店下所有设备的次数
List<DeviceTypeStartByMonthDTO> deviceTypeGroupList = this.drDeviceTypeStartByMonthService.selectDevStartList(DateUtil.localDateTimeToString(quarterStart, DateUtil.patternYM),
DateUtil.localDateTimeToString(quarterEnd, DateUtil.patternYM), deviceTypeSet, parseTokenDTO.getOrgAccount(),
"2".equals(parseTokenDTO.getPowerType()) ? parseTokenDTO.getShopAccount() : null, lineCityId);
if (CollectionUtils.isEmpty(deviceTypeGroupList)) {
return result;
}
List<NewPerformanceRankVO> list = new ArrayList<>();
String rankBaseKey = NewDataReportConstant.BASE_DR_REDIS_KEY +
NewDataReportConstant.LINE_CITY_REC_KEY + lineCityId;
Map<String, List<DeviceTypeStartByMonthDTO>> deviceTypeMap = deviceTypeGroupList.stream().collect(Collectors.groupingBy(DeviceTypeStartByMonthDTO::getDeviceTypeCode));
Map<String, String> deviceTypeCodeMap = deviceTypeGroupList.stream().collect(Collectors.toMap(DeviceTypeStartByMonthDTO::getDeviceTypeCode,
DeviceTypeStartByMonthDTO::getDeviceTypeName, (t1, t2) -> t1));
deviceTypeMap.forEach((k, v) -> {
NewPerformanceRankVO newPerformanceRankVO = new NewPerformanceRankVO();
Optional<Integer> maxStartNum = v.stream().map(t -> Integer.parseInt(t.getStartUpNum())).max(Integer::compareTo);
DeviceTypeStartByMonthDTO deviceTypeStartByMonthDTO1 = new DeviceTypeStartByMonthDTO();
if (maxStartNum.isPresent()) {
//得到启动次数最多的设备
List<DeviceTypeStartByMonthDTO> deviceTypeStartByMonthDTOList = v.stream().filter(t -> maxStartNum.get().equals(Integer.parseInt(t.getStartUpNum())))
.collect(Collectors.toList());
//计算排名 查询全部设备类型下的设备
String deviceTypeCode = v.get(0).getDeviceTypeCode();
//查询城市线下设备类型下的所有设备
List<DeviceTypeStartByMonthDTO> cityLineAllDeviceList = this.drDeviceTypeStartByMonthService.selectDevStartList(DateUtil.localDateTimeToString(quarterStart, DateUtil.patternYM),
DateUtil.localDateTimeToString(quarterEnd, DateUtil.patternYM), deviceTypeSet, null, null, lineCityId);
double topOneFlag = 0;
deviceTypeStartByMonthDTO1.setDeviceTypeCode(deviceTypeCode);
deviceTypeStartByMonthDTO1.setDeviceTypeName(deviceTypeCodeMap.get(deviceTypeCode));
for (DeviceTypeStartByMonthDTO deviceTypeStartByMonthDTO : cityLineAllDeviceList) {
//存入redis -->>> 城市线id、设备类型code做key
double startUpNum = Double.parseDouble(deviceTypeStartByMonthDTO.getStartUpNum());
//常规数据
this.stringRedisTemplate.opsForZSet().add(rankBaseKey + ":normal:" + deviceTypeCode, deviceTypeStartByMonthDTO.getDeviceid(), startUpNum);
if (topOneFlag < startUpNum) {
topOneFlag = startUpNum;
deviceTypeStartByMonthDTO1.setDeviceid(deviceTypeStartByMonthDTO.getDeviceid());
deviceTypeStartByMonthDTO1.setStartUpNum(deviceTypeStartByMonthDTO.getStartUpNum());
}
}
//获取标杆设备存入
this.stringRedisTemplate.opsForValue().set(rankBaseKey + ":top_one:" + deviceTypeCode + ":", JSON.toJSONString(deviceTypeStartByMonthDTO1));
//产品说取第一个即可
DeviceTypeStartByMonthDTO deviceTypeStartByMonthDTO = deviceTypeStartByMonthDTOList.get(0);
//获取排名
Long rankNum = this.stringRedisTemplate.opsForZSet().reverseRank(rankBaseKey + ":normal:" + deviceTypeCode, deviceTypeStartByMonthDTO.getDeviceid());
if (null != rankNum) {
++rankNum;
}
newPerformanceRankVO.setRank(rankNum);
}
newPerformanceRankVO.setDeviceTypeCode(k);
newPerformanceRankVO.setDeviceTypeName(deviceTypeCodeMap.get(k));
newPerformanceRankVO.setTopOnePerValue("0");
//计算价值
String startUpNum = deviceTypeStartByMonthDTO1.getStartUpNum();
String myDataValue = deviceValueMap.get(deviceTypeStartByMonthDTO1.getDeviceTypeCode());
BigDecimal myPerValue = new BigDecimal(myDataValue).multiply(new BigDecimal(startUpNum));
newPerformanceRankVO.setPerformanceValue(myPerValue.toString());
//得到标杆设备
Set<String> firstElement = this.stringRedisTemplate.opsForZSet().reverseRange(rankBaseKey + ":" + k, 0, 0);
if (!CollectionUtils.isEmpty(firstElement)) {
String firstData = firstElement.iterator().next();
String firstDataValue = deviceValueMap.get(firstData);
//计算价值
BigDecimal perValue = new BigDecimal(firstData).multiply(new BigDecimal(firstDataValue));
newPerformanceRankVO.setTopOnePerValue(perValue.toString());
}
list.add(newPerformanceRankVO);
});
return result.ok(list);
}
@Override
public Result<Void> performanceDownload(HttpServletRequest request, JwtHelper jwtHelper, Long lineCityId) {
Result<Void> result = new Result<>();
ParseTokenDTO parseTokenDTO = this.parseToken(request, jwtHelper);
if (null == parseTokenDTO || parseTokenDTO.getPowerType().equals("0")) {
return result.error(-1, "无权限!");
}
Map<String, Object> map = new HashMap<>(1);
NewDownloadCenterVO newDownloadCenterVO = new NewDownloadCenterVO();
newDownloadCenterVO.setUuid(IdUtil.getSnowflakeNextIdStr());
newDownloadCenterVO.setLineCityId(lineCityId);
newDownloadCenterVO.setParseTokenDTO(parseTokenDTO);
newDownloadCenterVO.setConsumerFlag(1);
map.put("dr_down_key", JSON.toJSONString(newDownloadCenterVO));
RabbitmqSendMessageUtil.sendDelayMessage(RabbitMqConfig.SYNC_DR_DOWNLOAD_CENTER_EXCHANGE, RabbitMqConfig.SYNC_DR_DOWNLOAD_CENTER_KEY,
map, 1000L);
return result;
}
@Override
public Result<PageUtils> selectDownloadList(HttpServletRequest request, JwtHelper jwtHelper, Integer pageNum, Integer pageSize) {
return null;
}
/*
@Override
public Result<PageUtils> selectDownloadList(HttpServletRequest request, JwtHelper jwtHelper, Integer pageNum, Integer pageSize) {
Result<PageUtils> result = new Result<>();
ParseTokenDTO parseTokenDTO = this.parseToken(request, jwtHelper);
if (null == parseTokenDTO || parseTokenDTO.getPowerType().equals("0")) {
return result.error(-1, "无权限!");
}
Shop shop = this.shopMapper.selectByAccounts(parseTokenDTO.getShopAccount());
Page<DrDownloadCenterEntity> page = Page.of(pageNum, pageSize);
Page<DrDownloadCenterEntity> drDownloadCenterEntityPage = this.drDownloadCenterMapper.selectPage(page, new LambdaQueryWrapper<DrDownloadCenterEntity>()
.eq(DrDownloadCenterEntity::getDeleted, 0)
.eq(DrDownloadCenterEntity::getShopId, shop.getId())
.eq(DrDownloadCenterEntity::getOpenId, parseTokenDTO.getOpenId())
.orderByDesc(DrDownloadCenterEntity::getId));
List<NewDrDownloadCenterVO> list = new ArrayList<>();
if (CollectionUtils.isEmpty(drDownloadCenterEntityPage.getRecords())) {
return result.ok(new PageUtils(list, 0, pageSize, pageNum));
}
drDownloadCenterEntityPage.getRecords().forEach(t -> {
NewDrDownloadCenterVO newDrDownloadCenterVO = new NewDrDownloadCenterVO();
newDrDownloadCenterVO.setFilename(t.getName());
newDrDownloadCenterVO.setDownUrl(t.getUrl());
list.add(newDrDownloadCenterVO);
});
return result.ok(new PageUtils(list, drDownloadCenterEntityPage.getTotal(), pageSize, pageNum));
}
*/
private ParseTokenDTO parseToken(HttpServletRequest request, JwtHelper jwtHelper) {
ParseTokenDTO parseTokenDTO = new ParseTokenDTO();
String token = request.getHeader("token");
Payload payload = jwtHelper.parseTokenData(token);
JSONObject jsonObject = payload.toJSONObject();
parseTokenDTO.setOpenId(jsonObject.getAsString("uid"));
parseTokenDTO.setUserId(Long.valueOf(jsonObject.getAsString("id")));
WxAppletuserEntity user = this.wxAppletuserMapper.selectById(parseTokenDTO.getUserId());
if (StringUtils.isNotBlank(parseTokenDTO.getOpenId()) && StringUtils.isNotBlank(user.getShopAccountNumber())) {
EmpPermissionDTO empPermission = this.employeeManageMapper.findEmpPermission(parseTokenDTO.getOpenId(), user.getShopAccountNumber());
if (null != empPermission) {
parseTokenDTO.setPowerType(empPermission.getPowerType());
parseTokenDTO.setShopAccount(empPermission.getShopAccount());
parseTokenDTO.setOrgAccount(empPermission.getOAccount());
return parseTokenDTO;
}
}
return null;
}
}
package com.dr.util;
import org.springframework.stereotype.Component;
/**
* GRPC 响应模板 form Metis/Moreme
*/
@Component
public class ApiTemplate {
//数据
private Object data;
//请求状态0 失败 1 成功
private Integer sign;
//提示信息
private String messages;
//code业务代码
private Integer code;
private Long total;
/**
* 请求成功模板
*
* @param data 数据实体
* @return 响应数据模板
*/
public ApiTemplate setApiTemplate(Object data) {
this.data = data;
this.sign = 1;
this.messages = "请求成功";
this.code = 200;
return this;
}
/**
* 失败模板
*
* @param messages 失败原因
* @param code BusinessCode 业务状态码
* @return 响应数据模板
*/
public ApiTemplate setApiTemplate(String messages, Integer code) {
this.data = null;
this.sign = 0;
this.messages = messages;
this.code = code;
return this;
}
public Object getData() {
return data;
}
public void setData(Object data) {
this.data = data;
}
public Integer getSign() {
return sign;
}
public void setSign(Integer sign) {
this.sign = sign;
}
public String getMessages() {
return messages;
}
public void setMessages(String messages) {
this.messages = messages;
}
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
public Long getTotal() {
return total;
}
public void setTotal(Long total) {
this.total = total;
}
}
package com.dr.util;
import org.apache.commons.lang3.StringUtils;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.*;
import java.time.format.DateTimeFormatter;
import java.time.temporal.TemporalAdjusters;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
/**
* 说明:日期格式转换工具类
*/
public class DateUtil {
public static final String patternYM = "yyyy-MM";
/**
* @param yyyy
* -MM-dd
* @return
*/
public static final String patternA = "yyyy-MM-dd";
/**
* @param yyyyMMdd
* @return
*/
public static final String patternB = "yyyyMMdd";
/**
* @param yyyy-MM-dd HH-mm-ss
* @return
*/
public static final String patternC = "yyyy-MM-dd HH-mm-ss";
/**
* @param yyyy-MM-dd HH:mm:ss
* @return
*/
public static final String patternD = "yyyy-MM-dd HH:mm:ss";
/**
* @param yyyy-MM-dd HH:mm
* @return
*/
public static final String patternE = "yyyy-MM-dd HH:mm";
/**
* @param yyyyMMddHHmmss
* @return
*/
public static final String patternF = "yyyyMMddHHmmss";
/**
* @param yyyy/MM/dd HH:mm
* @return
*/
public static final String patternG = "yy/MM/dd HH:mm";
private static DateUtil instance;
public static DateUtil getInstance() {
if (instance == null) {
instance = new DateUtil();
}
return instance;
}
/**
* (日期转字符串)
*
* @param date
* @param format
* @return
* @Title date2String
*/
public static String dateString(Date date, String format) {
SimpleDateFormat dateformat = new SimpleDateFormat(format);
return dateformat.format(date);
}
/**
* 格式化日期为yyyy-MM-dd
*
* @param date
* @return
*/
public static String formateDate(Date date) {
return dateToString(date, patternA);
}
/**
* @param //取当天日期
* @return
*/
public Date getDate() {
return Calendar.getInstance().getTime();
}
/**
* @param //取指定年月日的日期 ,格式为yyyy-MM-dd,HH-mm-ss 00-00-00
* @return
*/
public static Date getDate(int year, int month, int day) {
Calendar cal = Calendar.getInstance();
cal.set(year, month - 1, day, 0, 0, 0);
return cal.getTime();
}
/**
* @param //取指定年月日时分秒的时间
* @return
*/
public Date getDate(int year, int month, int date, int hour, int mintue,
int second) {
Calendar cal = Calendar.getInstance();
cal.set(Calendar.YEAR, year);
cal.set(Calendar.MONTH, month - 1);
cal.set(Calendar.DATE, date);
cal.set(Calendar.HOUR_OF_DAY, hour);
cal.set(Calendar.MINUTE, mintue);
cal.set(Calendar.SECOND, second);
return cal.getTime();
}
/**
* @param days=n?,则取n天前,n,则取n天后的日期
* @param date
* @param days
* @return
*/
public static Date getSomeDaysBeforeAfter(Date date, int days) {
GregorianCalendar gc = new GregorianCalendar();
gc.setTime(date);
gc.add(5, days);
gc.set(gc.get(Calendar.YEAR), gc.get(Calendar.MONTH),
gc.get(Calendar.DATE));
return gc.getTime();
}
/**
* 获取变更后的时间
*
* @param date 原时间
* @param type 变动的单位
* @param months 数量
* @return
*/
public static Date getSomeTimeBeforeAfter(Date date, int type, int months) {
GregorianCalendar gc = new GregorianCalendar();
gc.setTime(date);
gc.add(type, months);
gc.set(gc.get(Calendar.YEAR), gc.get(Calendar.MONTH), gc.get(Calendar.DATE));
return gc.getTime();
}
/**
* @param //取指定日期年份
* @return
*/
public static int getDateYear(Date date) {
Calendar c = Calendar.getInstance();
c.setTime(date);
return c.get(Calendar.YEAR);
}
/**
* @param //取指定日期月份
* @return
*/
public static int getDateMonth(Date date) {
Calendar c = Calendar.getInstance();
c.setTime(date);
return c.get(Calendar.MONTH) + 1;
}
/**
* @param //取指定日期日
* @return
*/
public static int getDateDay(Date date) {
Calendar c = Calendar.getInstance();
c.setTime(date);
return c.get(Calendar.DATE);
}
/**
* @param //取指定日期小时
* @return
*/
public int getDateHour(Date date) {
Calendar c = Calendar.getInstance();
c.setTime(date);
return c.get(Calendar.HOUR_OF_DAY);
}
/**
* @param //取指定日期分钟
* @return
*/
public int getDateMinute(Date date) {
Calendar c = Calendar.getInstance();
c.setTime(date);
return c.get(Calendar.MINUTE);
}
/**
* @param //取指定日期的第二天的时间小时秒为00:00:00
* @return
*/
public Date getNextDayStartTime(Date date) {
Calendar c = Calendar.getInstance();
c.setTime(date);
return getNextDayStart(c.get(Calendar.YEAR), c.get(Calendar.MONTH) + 1,
c.get(Calendar.DATE));
}
/**
* @param //取指定年日的下一日的时间,小时,秒为00:00:00
* @param //主要是用来取跨月份的日期
* @return
*/
public Date getNextDayStart(int year, int month, int date) {
month = month - 1;
boolean lastDayOfMonth = false;
boolean lastDayOfYear = false;
Calendar time = Calendar.getInstance();
time.set(year, month, date, 0, 0, 0);
Calendar nextMonthFirstDay = Calendar.getInstance();
nextMonthFirstDay.set(year, month + 1, 1, 0, 0, 0);
if (time.get(Calendar.DAY_OF_YEAR) + 1 == nextMonthFirstDay
.get(Calendar.DAY_OF_YEAR))
lastDayOfMonth = true;
if (time.get(Calendar.DAY_OF_YEAR) == time.getMaximum(Calendar.DATE))
lastDayOfYear = true;
time.roll(Calendar.DATE, 1);
if (lastDayOfMonth)
time.roll(Calendar.MONTH, 1);
if (lastDayOfYear)
time.roll(Calendar.YEAR, 1);
return time.getTime();
}
/**
* @Date: 2020/3/16 11:15
* @Author: yangxin
* @Description: TODO 取指定日期的下一日的时间
*/
public static Date nextDate(Date date, int amount) {
Calendar cal = Calendar.getInstance();
cal.setTime(date);
cal.add(Calendar.DATE, amount);
return cal.getTime();
}
/**
* @Date: 2020/3/16 11:15
* @Author: yangxin
* @Description: TODO 取指定日期的下一日的时间字符串
*/
public static String nextDateStr(Date date, int amount) {
Calendar cal = Calendar.getInstance();
cal.setTime(date);
cal.add(Calendar.DATE, amount);
return dateToString(cal.getTime(), patternD);
}
/**
* @param //指定日期的下的开始时 ,小时,秒为00:00:00
* @return
*/
public Date getStartDateNext(Date date) {
Calendar cal = Calendar.getInstance();
cal.setTime(date);
cal.add(Calendar.DATE, 1);
cal.set(Calendar.HOUR_OF_DAY, 0);
cal.set(Calendar.MINUTE, 0);
cal.set(Calendar.SECOND, 0);
return cal.getTime();
}
/**
* 获取当天开始时间
* @return
*/
public static Date getDayBegin(){
Calendar cal=Calendar.getInstance();
cal.set(Calendar.HOUR_OF_DAY, 0);//0点
cal.set(Calendar.MINUTE, 0);//0分
cal.set(Calendar.SECOND, 0);//0秒
cal.set(Calendar.MILLISECOND, 0);//0毫秒
return cal.getTime();
}
/**
* @param //指定日期的开始时 ,小时,秒为00:00:00
* @return
*/
public Date getStartDateDay(Date date) {
Calendar cal = Calendar.getInstance();
cal.setTime(date);
cal.set(Calendar.HOUR_OF_DAY, 0);
cal.set(Calendar.MINUTE, 0);
cal.set(Calendar.SECOND, 0);
return cal.getTime();
}
/**
* 获取某天前的开始时间
* @return
*/
public static Date getBeginDayOfYesterday(Integer num){
Calendar cal=Calendar.getInstance();
cal.setTime(getDayBegin());//当天开始时间
cal.add(Calendar.DAY_OF_MONTH, -num);//当天月份天数减1
return cal.getTime();
}
/**
* @param //指定日期的结束时 ,小时,秒为23:59:59
* @return
*/
public Date getEndDateDay(Date date) {
if (date == null)
return null;
Calendar cal = Calendar.getInstance();
cal.setTime(date);
cal.set(Calendar.HOUR_OF_DAY, 23);
cal.set(Calendar.MINUTE, 59);
cal.set(Calendar.SECOND, 59);
return cal.getTime();
}
/**
* @param //将指定日 ,以指定pattern格式,输出String
* @return
*/
public static String dateToString(Date date, String pattern) {
if (date == null) {
return "";
} else {
SimpleDateFormat format = new SimpleDateFormat(pattern);
return format.format(date);
}
}
/**
* @param //将指定字符型日期转为日期 ,,格式为指定的pattern
* @return
*/
public static Date stringToDate(String string, String pattern) {
SimpleDateFormat format = (SimpleDateFormat) DateFormat
.getDateInstance();
format.applyPattern(pattern);
try {
return format.parse(string);
} catch (ParseException e) {
return null;
}
}
/**
* @param //将指定字符型日期转为日期 ,指定格式为yyyy-MM-dd
* @return
*/
public static Date stringToDate(String string) {
return stringToDate(string, patternA);
}
/**
* 获得两个日期之间间隔的天
*
* @param startDate 起始年月
* @param endDate 结束年月
* @return int
*/
public static int getDays(Date startDate, Date endDate) {
int elapsed = 0;
Calendar cal = Calendar.getInstance();
cal.setTime(startDate);
Date d1 = cal.getTime();
cal.setTime(endDate);
Date d2 = cal.getTime();
long daterange = d2.getTime() - d1.getTime();
long time = 1000 * 3600 * 24; // �?��的毫秒数
elapsed = (int) (daterange / time);
return elapsed;
}
public static long getDay(String start, String end) throws ParseException {
SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd");
Long c = sf.parse(end).getTime() - sf.parse(start).getTime();
long d = c / 1000 / 60 / 60 / 24;//天
return d;
}
/**
* @param date
* @param startTime 格800,表示上
* @param //endTime格式
* @return
*/
public boolean isWorkHour(Date date, String startTime, String endTime) {// 是否是工作时�?
if (StringUtils.isEmpty(startTime))
startTime = "0800";
if (StringUtils.isEmpty(endTime))
endTime = "2200";
int start = Integer.parseInt(startTime);
int end = Integer.parseInt(endTime);
int hour = getDateHour(date);
int m = getDateMinute(date);
String hstr = hour <= 9 ? "0" + hour : hour + "";
String mstr = m <= 9 ? "0" + m : m + "";
int dateInt = Integer.parseInt(hstr + mstr);
if (dateInt >= start && dateInt <= end) {
return true;
}
return false;
}
// 取日期的当前月
public static Date getMonthFirstDay(Date date) {
return getDate(getDateYear(date), getDateMonth(date), 1);
}
/**
* 获取当前时间字符
*
* @return
*/
public static String getDateOfNow() {
return dateToString(new Date(), patternC);
}
/**
* 将时间戳转换成时间字符串
*
* @param stamp php的时间戳
* @return yyyy-MM-dd HH:mm:ss
*/
public static String changeTimeStampToString(long stamp) {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String dateTime = null;
try {
if (stamp < 9999999999L)
stamp = stamp * 1000L;
dateTime = df.format(stamp);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return dateTime;
}
/**
* 将时间戳转换成时间字符串
*
* @param stamp php的时间戳
* @param pattern 转换的样
* @return 转换后的结果, 仪pattern为准
*/
public static String changeTimeStampToString(long stamp, String pattern) {
SimpleDateFormat df = new SimpleDateFormat(pattern);
String dateTime = null;
try {
if (stamp < 9999999999L)
stamp = stamp * 1000L;
dateTime = df.format(stamp);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return dateTime;
}
/**
* (字符串转日期)
*
* @param date
* @param format
* @return
* @Title string2Date
*/
public static Date string2Date(String date,
String format) {
SimpleDateFormat dateformat = new SimpleDateFormat(format);
try {
return dateformat.parse(date);
} catch (ParseException e) {
e.printStackTrace();
}
return null;
}
/**
* (日期转字符串)
*
* @param date
* @param format
* @return
* @Title date2String
*/
public static String date2String(Date date,
String format) {
SimpleDateFormat dateformat = new SimpleDateFormat(format);
return dateformat.format(date);
}
/**
* 日期转字符串:yyyy-MM-dd HH:mm
*
* @return
* @Title date2String
*/
public static String dateToStr() {
return dateToString(new Date(), patternC);
}
/**
* 获得指定日期的后
*
* @param specifiedDay
* @return
*/
public static String getSpecifiedDayAfter(String specifiedDay) {
Calendar c = Calendar.getInstance();
Date date = null;
try {
date = new SimpleDateFormat("yy-MM-dd").parse(specifiedDay);
} catch (ParseException e) {
e.printStackTrace();
}
c.setTime(date);
int day = c.get(Calendar.DATE);
c.set(Calendar.DATE, day + 1);
String dayAfter = new SimpleDateFormat("yyyy-MM-dd").format(c.getTime());
return dayAfter;
}
/**
* 获得指定日期前几天的日期
*
* @param specifiedDay
* @return
*/
public static String getSpecifiedDay(String specifiedDay, int days) {
Calendar c = Calendar.getInstance();
Date date = null;
try {
date = new SimpleDateFormat("yy-MM-dd").parse(specifiedDay);
} catch (ParseException e) {
e.printStackTrace();
}
c.setTime(date);
int day = c.get(Calendar.DATE);
c.set(Calendar.DATE, day - days);
String dayAfter = new SimpleDateFormat("yyyy-MM-dd").format(c.getTime());
return dayAfter;
}
/**
* 日期间相差的秒数
*
* @param startDate
* @return
*/
public static int calLastedTime(Date startDate, Date endDate) {
long a = endDate.getTime();
long b = startDate.getTime();
int c = (int) ((a - b) / 1000);
return c;
}
/**
* 获取上个月年月
*
* @return
*/
public static String getPreYearMonth(Date date) {
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
calendar.add(Calendar.MONTH, -1);
date = calendar.getTime();
return new SimpleDateFormat("yyyy-MM").format(date);
}
/**
* 获取当前月的第一天
*/
public static Date getSatrtMonthDay() {
Calendar c = Calendar.getInstance();
c.add(Calendar.MONTH, 0);
c.set(Calendar.DAY_OF_MONTH, 1);
return c.getTime();
}
/**
* 获取下个月年月
*
* @return
*/
public static String getNextYearMonth(Date date) {
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
calendar.add(Calendar.MONTH, 1);
date = calendar.getTime();
return new SimpleDateFormat("yyyy-MM").format(date);
}
public static String getAfterSomeMonth(Date date, int months) {
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
calendar.add(Calendar.MONTH, months);
date = calendar.getTime();
return new SimpleDateFormat("yyyy-MM").format(date);
}
/**
* 获取日期的次月5号,写成6号便于判断日期
*
* @return
*/
public static String getNextDate(Date date) {
date.setDate(6);
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
calendar.add(Calendar.MONTH, 1);
date = calendar.getTime();
return new SimpleDateFormat("yyyy-MM-dd").format(date);
}
/**
* 判断俩个日期是否在同一个月
*
* @param date1
* @param date2
* @return
*/
public static boolean isSameYM(Date date1, Date date2) {
boolean istrue = false;
Calendar c1 = Calendar.getInstance();
Calendar c2 = Calendar.getInstance();
c1.setTime(date1);
c2.setTime(date2);
if (c1.get(Calendar.YEAR) == c2.get(Calendar.YEAR) && c1.get(Calendar.MONTH) == c2.get(Calendar.MONTH))
istrue = true;
return istrue;
}
public static boolean isSameDay(Date date1, Date date2) {
return DateUtil.stringToDate(DateUtil.dateToString(date1, patternA), DateUtil.patternA).compareTo(DateUtil.stringToDate(DateUtil.dateToString(date2, patternA), patternA)) == 0;
}
public static Date getLastDay(Date date) {
Calendar ca = Calendar.getInstance();
ca.setTime(date);
ca.set(Calendar.DATE, 1);
ca.roll(Calendar.DATE, -1);
return ca.getTime();
}
/**
* 根据用户生日计算年龄
*
* @author CJJ
*/
public static int getAgeByBirthday(Date birthday) {
Calendar cal = Calendar.getInstance();
if (cal.before(birthday)) {
throw new IllegalArgumentException(
"The birthDay is before Now.It's unbelievable!");
}
int yearNow = cal.get(Calendar.YEAR);
int monthNow = cal.get(Calendar.MONTH) + 1;
int dayOfMonthNow = cal.get(Calendar.DAY_OF_MONTH);
cal.setTime(birthday);
int yearBirth = cal.get(Calendar.YEAR);
int monthBirth = cal.get(Calendar.MONTH) + 1;
int dayOfMonthBirth = cal.get(Calendar.DAY_OF_MONTH);
int age = yearNow - yearBirth;
if (monthNow <= monthBirth) {
if (monthNow == monthBirth) {
if (dayOfMonthNow < dayOfMonthBirth) {
age--;
}
} else {
age--;
}
}
return age;
}
/**
* Date转时间戳
*
* @param data
* @return
* @author zx
* @date 2018年2月26日 下午5:14:54
*/
public static Integer dateForStamp(Date data) {
return (int) (data.getTime() / 1000);
}
/**
* 获取当天任何时间点的时间戳 例如 :getDateString(23,59,59)yyyy-23-59-59
* @param minute
* @param second
* @return
*/
public static String getDateString(Integer hr, Integer minute, Integer second) {
Calendar calendar = Calendar.getInstance();
if (hr == null) {
calendar.set(Calendar.HOUR_OF_DAY, 0);
}else {
if (hr != 0 ) {
calendar.set(Calendar.HOUR_OF_DAY, hr);
}
}
if (minute == null) {
calendar.set(Calendar.MINUTE, 0);
} else {
calendar.set(Calendar.MINUTE, minute);
}
if (second == null) {
calendar.set(Calendar.SECOND, 0);
} else {
calendar.set(Calendar.SECOND, second);
}
return String.valueOf(calendar.getTimeInMillis());
}
/**
* 获取当天零点时间戳
* @return
*/
public static String getDateString() {
return getDateString(null, null, null);
}
/**
* 获取当前小时下任何时间点的时间戳
* @param minute
* @param second
* @return
*/
public static String getDateString(Integer minute, Integer second) {
return getDateString(0, minute,second);
}
/**
* 获取当前小时下零分零秒的时间戳
* @return
*/
public static String getDateHrString() {
return getDateString(0, null,null);
}
/**
* @Date: 2019/8/7 16:48
* @Author: yangxin
* @Description: TODO 获取周期内的起始时间
* @param period 周期
* @param starting_time 生效时间
*/
public static Date getTimeRange(Integer period ,Date starting_time){
Date today = new Date();
//获取到两个时间的时间差,当前时间 减去 生效时间 等于 时间差(days)
long diff = today.getTime() - starting_time.getTime();
long days = diff / (1000 * 60 * 60 * 24);
//将时间差 取余,得知当前时间 在周期中已经 过去了第几天, 我们将这个值名为时间节点(timeNode)
Integer timeNode = (int)days % period;
//调用 获取某天前的开始时间 方法 得到 计算后的最新生效时间
return getBeginDayOfYesterday(timeNode);
}
/**
* 传入时间与当前时间的时间差
* @param date
* @return
*/
public static int timeDifference(Date date)
{
int days = (int) ((date.getTime() - new Date().getTime()) / (1000*3600*24));
return days+1;
}
/**
*
* @param date1 <String>
* @param date2 <String>
* @return int
* @throws ParseException 两个日期相差月数
*/
public static Long getMonthSpace(String date1, String date2){
long result = 0;
Calendar c1 = Calendar.getInstance();
c1.setTime(stringToDate(date1));
Calendar c2 = Calendar.getInstance();
c2.setTime(stringToDate(date2));
//只要年月
long fromYear = c1.get(Calendar.YEAR);
long fromMonth = c1.get(Calendar.MONTH);
long toYear = c2.get(Calendar.YEAR);
long toMonth = c2.get(Calendar.MONTH);
result = toYear * 12 + toMonth - (fromYear * 12 + fromMonth);
return result == 0 ? 1 : Math.abs(result);
}
/**
* 获取前多少天的时间---一天的最小或最大的时间
*
* @param days 前多少天
* @param format 格式化
* @param minOrMaxDate 最小(0)或最大(1)
* @return string 最终的时间
*/
public static String getBeforeTime(long days, String format, Integer minOrMaxDate) {
if (minOrMaxDate.equals(0)) {
return DateTimeFormatter.ofPattern(format).format(LocalDateTime.now().with(LocalTime.MIN).plusDays(-days));
}
return DateTimeFormatter.ofPattern(format).format(LocalDateTime.now().with(LocalTime.MAX).plusDays(-days));
}
/**
* LocalDateTime转Date,格式为yyyy-MM-dd
*
* @param now 时间
* @return Date
*/
/*
public static Date getDateByYyyyMmDd(LocalDateTime now){
DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern(DateUtil.patternA);
SimpleDateFormat simpleDateFormat = new SimpleDateFormat(DateUtil.patternA);
Date date;
try {
date = simpleDateFormat.parse(dateTimeFormatter.format(now));
} catch (ParseException pe) {
throw new BusinessRuntimeException(BusinessCode.C_4000, "日期格式化错误");
}
return date;
}
*/
/**
* String格式转换
*
* @param time 日期
* @param pattern 转换前格式
* @param resPattern 转换后格式
* @return 时间
*/
public static String getStringByYyMmDd(String time, String pattern, String resPattern) {
DateTimeFormatter inputFormatter = DateTimeFormatter.ofPattern(pattern);
LocalDateTime dateTime = LocalDateTime.parse(time, inputFormatter);
DateTimeFormatter outputFormatter = DateTimeFormatter.ofPattern(resPattern);
return dateTime.format(outputFormatter);
}
/**
* 获取前一个季度 以1-3月开始
*
* @return 季度
*/
public static String getPreviousQuarter() {
LocalDate currentDate = LocalDate.now();
// 获取当前月份
Month currentMonth = currentDate.getMonth();
// 计算前一个季度的月份范围
int startMonth;
int endMonth;
if (currentMonth == Month.JANUARY || currentMonth == Month.FEBRUARY || currentMonth == Month.MARCH) {
// 当前是1-3月,前一个季度是10-12月
startMonth = 10;
endMonth = 12;
} else if (currentMonth == Month.APRIL || currentMonth == Month.MAY || currentMonth == Month.JUNE) {
// 当前是4-6月,前一个季度是1-3月
startMonth = 1;
endMonth = 3;
} else if (currentMonth == Month.JULY || currentMonth == Month.AUGUST || currentMonth == Month.SEPTEMBER) {
// 当前是7-9月,前一个季度是4-6月
startMonth = 4;
endMonth = 6;
} else {
// 当前是10-12月,前一个季度是7-9月
startMonth = 7;
endMonth = 9;
}
return startMonth + "-" + endMonth;
}
/**
* 获取季度 年月
*
* @return
*/
public static String getYearPreviousQuarter() {
LocalDate currentDate = LocalDate.now();
// 获取当前月份
Month currentMonth = currentDate.getMonth();
// 获取当前年份
int currentYear = currentDate.getYear();
// 计算前一个季度的月份范围
int startMonth;
int endMonth;
if (currentMonth == Month.JANUARY || currentMonth == Month.FEBRUARY || currentMonth == Month.MARCH) {
// 当前是1-3月,前一个季度是10-12月
startMonth = 10;
endMonth = 12;
currentYear--;
} else if (currentMonth == Month.APRIL || currentMonth == Month.MAY || currentMonth == Month.JUNE) {
// 当前是4-6月,前一个季度是1-3月
startMonth = 1;
endMonth = 3;
} else if (currentMonth == Month.JULY || currentMonth == Month.AUGUST || currentMonth == Month.SEPTEMBER) {
// 当前是7-9月,前一个季度是4-6月
startMonth = 4;
endMonth = 6;
} else {
// 当前是10-12月,前一个季度是7-9月
startMonth = 7;
endMonth = 9;
}
return currentYear + "-" + startMonth + "-" + currentYear + "-" + endMonth;
}
/**
* 获取上个月的最小最大时间
*
* @return 最小 最大时间
*/
public static long[] getLastMonthMinMaxTimestamp() {
// 获取当前日期和时间
LocalDateTime currentDateTime = LocalDateTime.now();
// 获取上个月的日期
LocalDateTime lastMonthDateTime = currentDateTime.minusMonths(1);
// 设置日期为上个月的第一天,并设置时间为最小时间(00:00:00)
LocalDateTime firstDayOfMonth = LocalDateTime.of(lastMonthDateTime.getYear(), lastMonthDateTime.getMonth(), 1, 0, 0, 0);
// 设置日期为上个月的最后一天,并设置时间为最大时间(23:59:59)
LocalDateTime lastDayOfMonth = LocalDateTime.of(lastMonthDateTime.getYear(), lastMonthDateTime.getMonth(), lastMonthDateTime.getMonth().maxLength(), 23, 59, 59);
// 转换为时间戳
long minTimestamp = firstDayOfMonth.atZone(ZoneId.systemDefault()).toInstant().toEpochMilli();
long maxTimestamp = lastDayOfMonth.atZone(ZoneId.systemDefault()).toInstant().toEpochMilli();
return new long[]{minTimestamp, maxTimestamp};
}
/**
* localDateTime 转 string
*
* @param localDateTime 时间
* @param format 格式
* @return 时间
*/
public static String localDateTimeToString(LocalDateTime localDateTime, String format) {
return localDateTime.format(DateTimeFormatter.ofPattern(format));
}
/**
* string 转 long
*
* @param time 时间
* @param format 格式
* @return 时间
*/
/*
public static long stringToTimeStamp(String time, String format){
SimpleDateFormat dateFormat = new SimpleDateFormat(format);
try {
Date date = dateFormat.parse(time);
return date.getTime();
} catch (ParseException pe) {
throw new BusinessRuntimeException(BusinessCode.C_4000, "日期格式化错误");
}
}
*/
/**
* long 转 string
*
* @param time 时间
* @param format 格式
* @return 时间
*/
public static String timeStampToString(long time, String format) {
return DateTimeFormatter.ofPattern(format)
.withZone(ZoneId.systemDefault())
.format(Instant.ofEpochMilli(time));
}
/**
* long 转 localdatetime
*
* @param time 时间
* @return 时间
*/
public static LocalDateTime longToTimeStamp(long time) {
return Instant.ofEpochMilli(time).atZone(ZoneId.systemDefault()).toLocalDateTime();
}
/**
* localdatetime 转 long
*
* @param localDateTime 时间
* @return 时间
*/
public static long timeStampToLong(LocalDateTime localDateTime) {
return localDateTime.atZone(ZoneId.systemDefault()).toInstant().toEpochMilli();
}
/**
* 获取去年处于当前季度的最小最大时间 3-5 6-8...
*
* @return 时间数组 yyyy-MM-dd HH:mm:ss
*/
public static String[] getCurrentSeasonTimeRange() {
LocalDateTime currentDateTime = LocalDateTime.now();
int year = currentDateTime.plusYears(-1).getYear();
Month currentMonth = currentDateTime.getMonth();
String currentSeason = getSeason(currentMonth);
LocalDateTime seasonStart = getSeasonStart(year, currentSeason);
LocalDateTime seasonEnd = getSeasonEnd(year, currentSeason);
DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern(patternA);
return new String[]{dateTimeFormatter.format(seasonStart), dateTimeFormatter.format(seasonEnd)};
}
public static String getSeason(Month month) {
if (month == Month.MARCH || month == Month.APRIL || month == Month.MAY) {
return "Spring";
} else if (month == Month.JUNE || month == Month.JULY || month == Month.AUGUST) {
return "Summer";
} else if (month == Month.SEPTEMBER || month == Month.OCTOBER || month == Month.NOVEMBER) {
return "Autumn";
} else {
return "Winter";
}
}
public static LocalDateTime getSeasonStart(int year, String season) {
if ("Spring".equals(season)) {
return LocalDateTime.of(year, Month.MARCH, 1, 0, 0, 0);
} else if ("Summer".equals(season)) {
return LocalDateTime.of(year, Month.JUNE, 1, 0, 0, 0);
} else if ("Autumn".equals(season)) {
return LocalDateTime.of(year, Month.SEPTEMBER, 1, 0, 0, 0);
} else {
return LocalDateTime.of(year, Month.DECEMBER, 1, 0, 0, 0);
}
}
public static LocalDateTime getSeasonEnd(int year, String season) {
if ("Spring".equals(season)) {
return LocalDateTime.of(year, Month.MAY, 31, 23, 59, 59);
} else if ("Summer".equals(season)) {
return LocalDateTime.of(year, Month.AUGUST, 31, 23, 59, 59);
} else if ("Autumn".equals(season)) {
return LocalDateTime.of(year, Month.NOVEMBER, 30, 23, 59, 59);
} else {
year = year + 1;
YearMonth february = YearMonth.of(year, Month.FEBRUARY);
int lastDayOfMonth = february.lengthOfMonth();
return LocalDateTime.of(year, Month.FEBRUARY, lastDayOfMonth, 23, 59, 59);
}
}
/**
* 获取上个季度的时间
*
* @return LocalDateTime[]
*/
public static LocalDateTime[] getLastQuarterDates() {
LocalDateTime[] dates = new LocalDateTime[2];
LocalDate currentDate = LocalDate.now();
int currentMonthValue = currentDate.getMonthValue();
int firstMonthValue;
int lastMonthValue;
if (currentMonthValue <= 3) {
// 10月
firstMonthValue = 10;
// 12月
lastMonthValue = 12;
} else if (currentMonthValue <= 6) {
// 1月
firstMonthValue = 1;
// 3月
lastMonthValue = 3;
} else if (currentMonthValue <= 9) {
// 4月
firstMonthValue = 4;
// 6月
lastMonthValue = 6;
} else {
// 7月
firstMonthValue = 7;
// 9月
lastMonthValue = 9;
}
LocalDate firstDayOfLastQuarter = LocalDate.of(currentDate.getYear(), firstMonthValue, 1);
LocalDate lastDayOfLastQuarter = LocalDate.of(currentDate.getYear(), lastMonthValue, 1)
.with(TemporalAdjusters.lastDayOfMonth());
LocalDateTime minDate = firstDayOfLastQuarter.atStartOfDay();
LocalDateTime maxDate = lastDayOfLastQuarter.atTime(23, 59, 59);
dates[0] = minDate;
dates[1] = maxDate;
return dates;
}
}
\ No newline at end of file
/**
* Copyright (c) 2016-2019 人人开源 All rights reserved.
*
* https://www.renren.io
*
* 版权所有,侵权必究!
*/
package com.dr.util;
import com.baomidou.mybatisplus.core.metadata.IPage;
import java.io.Serializable;
import java.util.List;
/**
* 分页工具类
*
* @author Mark sunlightcs@gmail.com
*/
public class PageUtils implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 总记录数
*/
private long totalCount;
/**
* 每页记录数
*/
private int pageSize;
/**
* 总页数
*/
private int totalPage;
/**
* 当前页数
*/
private int currPage;
/**
* 列表数据
*/
private List<?> list;
/**
* 分页
* @param list 列表数据
* @param totalCount 总记录数
* @param pageSize 每页记录数
* @param currPage 当前页数
*/
public PageUtils(List<?> list, long totalCount, int pageSize, int currPage) {
this.list = list;
this.totalCount = totalCount;
this.pageSize = pageSize;
this.currPage = currPage;
this.totalPage = (int)Math.ceil((double)totalCount/pageSize);
}
/**
* 分页
*/
public PageUtils(IPage<?> page) {
this.list = page.getRecords();
this.totalCount = (int)page.getTotal();
this.pageSize = (int)page.getSize();
this.currPage = (int)page.getCurrent();
this.totalPage = (int)page.getPages();
}
public long getTotalCount() {
return totalCount;
}
public void setTotalCount(int totalCount) {
this.totalCount = totalCount;
}
public int getPageSize() {
return pageSize;
}
public void setPageSize(int pageSize) {
this.pageSize = pageSize;
}
public int getTotalPage() {
return totalPage;
}
public void setTotalPage(int totalPage) {
this.totalPage = totalPage;
}
public int getCurrPage() {
return currPage;
}
public void setCurrPage(int currPage) {
this.currPage = currPage;
}
public List<?> getList() {
return list;
}
public void setList(List<?> list) {
this.list = list;
}
}
package com.dr.util;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
import javax.annotation.Resource;
import java.util.Map;
/**
* @author songyouyu
* @date 2022/6/9 15:15
*/
@Component
public class RabbitmqSendMessageUtil {
@Resource
private RabbitTemplate rabbitTemplate;
private static RabbitmqSendMessageUtil rabbitmqSendMessageUtil;
@PostConstruct
public void init(){
rabbitmqSendMessageUtil = this;
rabbitmqSendMessageUtil.rabbitTemplate = this.rabbitTemplate;
}
/**
* 发送延迟消息
* @param exchange
* @param routingKey
* @param map
* @param dateTime 毫秒
*/
public static void sendDelayMessage(String exchange, String routingKey, Map<String, Object> map, Long dateTime) {
rabbitmqSendMessageUtil.rabbitTemplate.convertAndSend(exchange, routingKey, map, message -> {
message.getMessageProperties().setHeader("x-delay", dateTime);
return message;
});
}
/**
* 用户下单后确定代理商门店绑定关系
* @param exchange
* @param routingKey
* @param map
*/
public static void sendProxyShopMessage(String exchange, String routingKey, Map<String, Object> map) {
rabbitmqSendMessageUtil.rabbitTemplate.convertAndSend(exchange, routingKey, map);
}
/**
* 用户购买指定商品开通VIP
* @param exchange
* @param routingKey
* @param map
*/
public static void sendUserVipMessage(String exchange, String routingKey, Map<String, Object> map) {
rabbitmqSendMessageUtil.rabbitTemplate.convertAndSend(exchange, routingKey, map);
}
}
package com.dr.util;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.data.redis.core.StringRedisTemplate;
import java.io.Serializable;
/**
* Created with IntelliJ IDEA.
*
* @Auther: zhangyouhui
* @Date: 2021/03/08/18:12
* @Description: 消息返回工具类
*/
@Slf4j
public class Result<T> implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 编码:0表示成功,其他值表示失败
*/
private int code = 0;
/**
* 消息内容
*/
private String msg = "success";
/**
* 响应数据
*/
private T data;
private String token;
public static long getSerialVersionUID() {
return serialVersionUID;
}
public String getToken() {
return token;
}
public void setToken(String token) {
this.token = token;
}
public Result<T> ok(T data) {
this.setCode(0);
this.setData(data);
return this;
}
public boolean success(){
return code == 0;
}
public Result<T> error(int code, String msg) {
this.code = code;
this.msg = msg;
return this;
}
/*public Result<T> errorByLanguage(int code, int language, StringRedisTemplate stringRedisTemplate) {
this.code = code;
Boolean lanFlag = stringRedisTemplate.opsForHash().hasKey(LDMConstant.LANGUAGE_LIST + language, String.valueOf(code));
if(Boolean.TRUE.equals(lanFlag)){
Object lanMsg = stringRedisTemplate.opsForHash().get(LDMConstant.LANGUAGE_LIST + language, String.valueOf(code));
if(null != lanMsg && StringUtils.isNotBlank(lanMsg.toString())){
this.msg = lanMsg.toString();
}
}else {
log.error("---------语言不存在---------code:{}------>language{}", code, language);
throw new BusinessRuntimeException(11001, "language error");
}
return this;
}*/
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public T getData() {
return data;
}
public void setData(T data) {
this.data = data;
}
}
package com.dr.util;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;
/**
* Created with IntelliJ IDEA.
*
* @Auther: zhangyouhui
* @Date: 2021/03/09/10:05
* @Description: 微信小程序常量配置类
*/
@Component
@PropertySource("classpath:AppConstant.properties")
public class WxAppletsConstant {
/**
* 小程序 appId
*/
@Value("${AppConstant.APPID}")
private String APP_ID ="";
/**
* 小程序 appSecret
*/
@Value("${AppConstant.SECRET}")
private String SECRET = "";
/**
* 授权类型
*/
@Value("${AppConstant.GRANTTYPE}")
private String GRANT_TYPE = "";
/**
* 获取OpenId 及SeesionKey的url地址
*/
@Value("${AppConstant.GETOPENIDURL}")
private String GET_OPENID_URL = "";
/**
* redis存储token目录
*/
@Value("${AppConstant.BEOVERDUE_TOEKN}")
private String BEOVERDUE_TOEKN = "";
/**
*
* redis存储sessionkey目录
*/
@Value("${AppConstant.BEOVERDUE_SESSIONKEY}")
private String BEOVERDUE_SESSIONKEY = "";
// Token 默认过期时间15天
@Value("${AppConstant.TOKENDFTEXPIRETIME}")
private Integer TOKEN_DFT_EXPIRE_TIME ;
@Value("${AppConstant.DEVICETYPE}")
private String DEVICETYPE;
public String getBEOVERDUE_TOEKN() {
return BEOVERDUE_TOEKN;
}
public String getBEOVERDUE_SESSIONKEY() {
return BEOVERDUE_SESSIONKEY;
}
public String getDEVICETYPE() {
return DEVICETYPE;
}
public String getAPP_ID() {
return APP_ID;
}
public String getSECRET() {
return SECRET;
}
public String getGRANT_TYPE() {
return GRANT_TYPE;
}
public String getGET_OPENID_URL() {
return GET_OPENID_URL;
}
public Integer getTOKEN_DFT_EXPIRE_TIME() {
return TOKEN_DFT_EXPIRE_TIME;
}
}
package com.dr.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* @description 年龄分布
* @author luocong
* @date 2023/12/4 11:40
* @version 1.0
*/
@ApiModel(value = "NewAgeDistributionVO", description = "年龄分布对象")
@Data
public class NewAgeDistributionVO implements Serializable {
private static final long serialVersionUID = 7183121346355376718L;
@ApiModelProperty(value = "性别 0-男,1-女")
private Integer sex;
@ApiModelProperty(value = "60岁以上")
private String overSixtyYear;
@ApiModelProperty(value = "40-60岁")
private String fortyToSixtyYear;
@ApiModelProperty(value = "30-40岁")
private String thirtyToFortyYear;
@ApiModelProperty(value = "18-30岁")
private String eighteenToThirtyYear;
@ApiModelProperty(value = "18岁以下")
private String underEighteenYear;
}
package com.dr.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* @description 到店排行
* @author luocong
* @date 2023/12/4 11:40
* @version 1.0
*/
@ApiModel(value = "NewArriveShopRankVO", description = "到店排行")
@Data
public class NewArriveShopRankVO implements Serializable {
private static final long serialVersionUID = 4848395767834609852L;
@ApiModelProperty(value = "门店名称")
private String shopName;
@ApiModelProperty(value = "到店人数")
private Long arriveShopNum;
@ApiModelProperty(value = "占比")
private String ratio;
}
package com.dr.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* @description 检测排行对象
* @author luocong
* @date 2023/12/4 11:40
* @version 1.0
*/
@ApiModel(value = "NewCheckCaseRankVO", description = "检测排行对象")
@Data
public class NewCheckCaseRankVO implements Serializable {
private static final long serialVersionUID = 4848395767834609852L;
@ApiModelProperty(value = "门店名称")
private String shopName;
@ApiModelProperty(value = "检测案例数")
private Long checkCaseNum;
@ApiModelProperty(value = "占比")
private String ratio;
}
package com.dr.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* @description 客户与案例数据对象
* @author luocong
* @date 2023/12/2 14:06
* @version 1.0
*/
@ApiModel(value = "NewClientAndCaseGroupVO", description = "客户与案例数据对象")
@Data
public class NewClientAndCaseGroupVO implements Serializable {
private static final long serialVersionUID = -3357931515145301514L;
@ApiModelProperty(value = "案例总数")
private Long caseGroupNum;
@ApiModelProperty(value = "昨日新增案例数")
private Long addCaseByYesterday;
@ApiModelProperty(value = "客户总数")
private Long clientNum;
@ApiModelProperty(value = "单次到店客户数")
private Long onceArriveShopClientNum;
@ApiModelProperty(value = "多次到店客户数")
private Long moreArriveShopClientNum;
@ApiModelProperty(value = "昨日新增客户数")
private Long addClientByYesterday;
}
package com.dr.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* @description 客户地域分布
* @author luocong
* @date 2023/12/4 11:40
* @version 1.0
*/
@ApiModel(value = "NewClientDistributionVO", description = "客户地域分布对象")
@Data
public class NewClientDistributionVO implements Serializable {
private static final long serialVersionUID = 8505699363792365071L;
@ApiModelProperty(value = "省份名称")
private String deviceName;
@ApiModelProperty(value = "门店数量")
private Long shopNum;
@ApiModelProperty(value = "客户数量")
private Long clientNum;
}
package com.dr.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
import lombok.Data;
import java.io.Serializable;
/**
* @description 耗材消耗报表
* @author luocong
* @date 2023/10/31 10:01
* @version 1.0
*/
@ContentRowHeight(150)
@ColumnWidth(35)
@Data
public class NewConsumableDownloadVO implements Serializable {
private static final long serialVersionUID = -31686143367751831L;
@ExcelProperty("门店名称")
private String shopName;
@ExcelProperty("设备类型")
private String deviceTypeName;
@ExcelProperty("耗材类型")
private String consumableTypeName;
@ExcelProperty("消耗量")
private Integer consumerNum;
}
package com.dr.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @description
* @author luocong
* @date 2023/10/26 17:29
* @version 1.0
*/
@ApiModel(value = "NewConsumableListVO", description = "耗材对象")
@Data
@NoArgsConstructor
@AllArgsConstructor
public class NewConsumableListVO implements Serializable {
private static final long serialVersionUID = -8258074442973110834L;
@ApiModelProperty(value = "耗材类型名称")
private String consumableTypeName;
@ApiModelProperty(value = "数量或排名")
private Integer num;
}
package com.dr.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.List;
/**
* @description
* @author luocong
* @date 2023/10/26 17:27
* @version 1.0
*/
@ApiModel(value = "NewConsumableRankVO", description = "耗材消耗排行")
@NoArgsConstructor
@AllArgsConstructor
@Data
public class NewConsumableRankVO implements Serializable {
private static final long serialVersionUID = -1994567169400398216L;
@ApiModelProperty(value = "设备类型名称")
private String deviceTypeName;
@ApiModelProperty(value = "耗材对象")
private List<NewConsumableListVO> consumableList;
}
package com.dr.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* @description 统计设备与耗材消耗数据
* @author luocong
* @date 2023/12/2 14:06
* @version 1.0
*/
@ApiModel(value = "NewDeviceAndConsumableVO", description = "统计设备与耗材消耗数据")
@Data
public class NewDeviceAndConsumableVO implements Serializable {
private static final long serialVersionUID = 7772874501340823347L;
@ApiModelProperty(value = "设备数量")
private Long deviceNumber;
@ApiModelProperty(value = "耗材消耗次数")
private Long consumableNumber;
}
package com.dr.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* @description 设备地域分布对象
* @author luocong
* @date 2023/12/4 11:40
* @version 1.0
*/
@ApiModel(value = "NewDeviceDistributionVO", description = "设备地域分布对象")
@Data
public class NewDeviceDistributionVO implements Serializable {
private static final long serialVersionUID = 5013280554365099795L;
@ApiModelProperty(value = "省份名称")
private String provinceName;
@ApiModelProperty(value = "仪器数")
private Long deviceNum;
}
package com.dr.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
* @description 统计设备与耗材消耗数据
* @author luocong
* @date 2023/12/2 14:06
* @version 1.0
*/
@ApiModel(value = "NewDeviceRealTimeVO", description = "设备实时数据对象")
@Data
public class NewDeviceRealTimeVO implements Serializable {
private static final long serialVersionUID = -7775120696707315537L;
@JsonFormat(pattern = "yyyy/MM/dd HH:mm", timezone = "GMT+8")
@ApiModelProperty(value = "开始时间 ")
private LocalDateTime startTime;
@ApiModelProperty(value = "仪器名称")
private String deviceTypeName;
@ApiModelProperty(value = "操作人员")
private String employeeName;
@ApiModelProperty(value = "顾客名称")
private String clientName;
@ApiModelProperty(value = "耗材名称")
private String consumableTypeName;
@ApiModelProperty(value = "所属门店")
private String shopName;
}
package com.dr.vo;
import com.dr.dto.ParseTokenDTO;
import lombok.Data;
import java.io.Serializable;
/**
* @description 下载中心
* @author luocong
* @date 2023/12/4 11:40
* @version 1.0
*/
@Data
public class NewDownloadCenterVO implements Serializable {
private static final long serialVersionUID = 4916151280858055924L;
/**
* uuid
*/
private String uuid;
/**
* 消费标识(1-业绩排行,2-耗材消耗排行)
*/
private Integer consumerFlag;
/**
* ParseTokenDTO
*/
private ParseTokenDTO parseTokenDTO;
/**
* 城市线id
*/
private Long lineCityId;
/**
* selectType 选择类型(0-我的,1-全国)
*/
private Integer selectType;
/**
* 门店账号
*/
private String[] shopAccounts;
}
package com.dr.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* @description 文件下载中心对象
* @author luocong
* @date 2023/12/4 11:40
* @version 1.0
*/
@ApiModel(value = "NewDrDownloadCenterVO", description = "文件下载中心对象")
@Data
public class NewDrDownloadCenterVO implements Serializable {
private static final long serialVersionUID = 8505699363792365071L;
@ApiModelProperty(value = "文件名称")
private String filename;
@ApiModelProperty(value = "下载链接")
private String downUrl;
}
package com.dr.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* @description 员工排行
* @author luocong
* @date 2023/12/4 11:40
* @version 1.0
*/
@ApiModel(value = "NewEmployeeRankVO", description = "员工排名对象")
@Data
public class NewEmployeeRankVO implements Serializable {
private static final long serialVersionUID = 7183121346355376718L;
@ApiModelProperty(value = "员工姓名")
private String employeeName;
@ApiModelProperty(value = "操作次数")
private Long operationNum;
@ApiModelProperty(value = "门店名称")
private String shopName;
}
package com.dr.vo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @description 机构门店数据同步物联网对象
* @author luocong
* @date 2024/8/29 10:56
* @version 1.0
*/
@NoArgsConstructor
@AllArgsConstructor
@Data
public class NewOrgAndShopConsumeVO implements Serializable {
private static final long serialVersionUID = -8778117513527681936L;
/**
* 机构账号
*/
private String orgAccount;
/**
* 机构名称
*/
private String orgName;
/**
* 门店账号
*/
private String shopAccount;
/**
* 门店名称
*/
private String shopName;
/**
* 门店省名称
*/
private String shopProvinceName;
/**
* 门店市名称
*/
private String shopCityName;
/**
* 门店区名称
*/
private String shopRegionName;
/**
* 详细地址
*/
private String shopAddress;
}
package com.dr.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* @description 业绩排行对象
* @author luocong
* @date 2023/10/20 10:10
* @version 1.0
*/
@ApiModel(value = "NewPerformanceRankVO", description = "业绩排行对象")
@Data
public class NewPerformanceRankVO implements Serializable {
private static final long serialVersionUID = 2905158483403094072L;
@ApiModelProperty(value = "设备类型编码")
private String deviceTypeCode;
@ApiModelProperty(value = "设备类型名称")
private String deviceTypeName;
@ApiModelProperty(value = "业绩排行")
private Long rank;
@ApiModelProperty(value = "业绩价值")
private String performanceValue;
@ApiModelProperty(value = "标杆业绩价值")
private String topOnePerValue;
@ApiModelProperty(value = "门店账号")
private String shopAccount;
@ApiModelProperty(value = "门店名称")
private String shopName;
}
package com.dr.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* @description 产品推广曝光对象
* @author luocong
* @date 2023/12/4 11:40
* @version 1.0
*/
@ApiModel(value = "NewProductRecommendVO", description = "产品推广曝光对象")
@Data
public class NewProductRecommendVO implements Serializable {
private static final long serialVersionUID = 4848395767834609852L;
@ApiModelProperty(value = "产品/仪器")
private String productName;
@ApiModelProperty(value = "推荐量")
private Long recommendNum;
}
package com.dr.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* @description 门店消耗排行
* @author luocong
* @date 2023/12/4 11:40
* @version 1.0
*/
@ApiModel(value = "NewShopConsumableRankVO", description = "门店消耗排行对象")
@Data
public class NewShopConsumableRankVO implements Serializable {
private static final long serialVersionUID = 4848395767834609852L;
@ApiModelProperty(value = "门店名称")
private String shopName;
@ApiModelProperty(value = "耗材消耗次数")
private Long operationNum;
@ApiModelProperty(value = "占比")
private String ratio;
}
package com.dr.vo;
import io.swagger.annotations.ApiModel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @description
* @author luocong
* @date 2023/11/6 10:04
* @version 1.0
*/
@ApiModel(value = "SkinProblemContentVO", description = "推荐内容对象")
@AllArgsConstructor
@NoArgsConstructor
@Data
public class SkinProblemContentVO implements Serializable {
private static final long serialVersionUID = 5540492448805735430L;
/**
* 内容标题
*/
private String contentTitle;
/**
* 封面图
*/
private String coverPicture;
/**
* 跳转链接
*/
private String jumpLinkUrl;
/**
* 视觉效果 0:普通,1:高亮
*/
private Integer view;
/**
* 区域配置表id(多个逗号分割)
*/
private String areaConfigId;
/**
* 所属分类id
*/
private Integer beautyServiceTypeId;
}
package com.dr.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.List;
/**
* @description
* @author luocong
* @date 2023/11/4 15:36
* @version 1.0
*/
@ApiModel(value = "SkinProblemRecommendVO", description = "皮肤问题推荐方案")
@AllArgsConstructor
@NoArgsConstructor
@Data
public class SkinProblemRecommendVO implements Serializable {
private static final long serialVersionUID = -1179193090514776730L;
@ApiModelProperty(value = "12-黑头,13-粉刺,14-毛孔,15-皱纹,16-色斑")
private Integer skinFlag;
@ApiModelProperty(value = "占比")
private String ratio;
@ApiModelProperty(value = "推荐内容")
private List<SkinProblemContentVO> skinProblemContentList;
}
#\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F\u914D\u7F6E-----
AppConstant.APPID=wx8aa5b38ca44ec5c9
AppConstant.SECRET=e6fd4084ab4a2a85691cfe632286551d
AppConstant.GRANTTYPE=authorization_code
AppConstant.GETOPENIDURL=https://api.weixin.qq.com/sns/jscode2session
#60*60*24*60
AppConstant.TOKENDFTEXPIRETIME=5184000
#redis\u5B58\u50A8token\u76EE\u5F55
AppConstant.BEOVERDUE_TOEKN=wxapple:token:
#redis\u5B58\u50A8sesssionkey\u76EE\u5F55
AppConstant.BEOVERDUE_SESSIONKEY=wxapple:sessionkey:
#\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F\u914D\u7F6E-----
#\u77ED\u4FE1\u53D1\u9001\u914D\u7F6E
AppConstant.SID=de744e783e4b4c62d9305316cab46e8e
AppConstant.TOKEN=e6d07eafa4ef85f2b71c7348d5e151ed
AppConstant.DXAPPID=83126e378d914edda98e2716f50ccad8
AppConstant.TEMPLATEID=2380
AppConstant.UID=2d92c6132139467b989d087c84a365d8
#\u4EE5\u5206\u949F\u8BA1\u7B97
AppConstant.MESSAGEDFTEXPIRETIME=3
#\u77ED\u4FE1\u53D1\u9001\u914D\u7F6Emessage
#\u963F\u91CC\u4E91oss\u914D\u7F6E
#\u963F\u91CC\u4E91API\u7684\u5916\u7F51\u57DF\u540D
AppConstant.ENDPOINT=https://oss-cn-shenzhen.aliyuncs.com
#\u963F\u91CC\u4E91API\u7684\u5BC6\u94A5Access Key ID
AppConstant.ACCESS_KEY_ID=LTAI5t67fmqMFCqT6q2FuzpN
#\u963F\u91CC\u4E91API\u7684\u5BC6\u94A5Access Key Secret
AppConstant.ACCESS_KEY_SECRET=eFke8ODvNob4Rbkn1GFDLa3XvV6nyG
#\u963F\u91CC\u4E91API\u7684bucket\u540D\u79F0
AppConstant.BACKET_NAME=djmaftersales
#\u963F\u91CC\u4E91API\u7684\u6587\u4EF6\u5939\u540D\u79F0
AppConstant.FOLDER=img/
#\u963F\u91CC\u4E91oss\u914D\u7F6E
#\u67E5\u8BE2\u9644\u4EF6\u95E8\u5E97\u7684\u65F6\u5019\uFF0C\u7C7B\u578B\u914D\u7F6E ,"DBQ3-3"
AppConstant.DEVICETYPE="DAF03-1","DBQ3-3"
#\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F\u5B58\u50A8token\uFF0C\u548Csessionkey\u89C4\u8303\u5199\u6CD5
AppConstant.wxapple.token=wxapple:token:
AppConstant.wxapple.sessionkey=wxapple:sessionkey:
#\u5FAE\u4FE1\u652F\u4ED8\u914D\u7F6E
#\u5BC6\u94A5
AppConstant.PAYMENT.PAYSECRETKEY=fdsDCDEFC425345233DEFCERFEed2021
#\u5546\u6237api\u8BC1\u4E66\u652F\u4ED8\u8BC1\u4E66
AppConstant.PAYMENT.PAYCERTIFICATE=/cert/apiclient_cert.p12
#\u5546\u6237API\u79C1\u94A5
AppConstant.PAYMENT.PRIVATEKEY=/cert/apiclient_key.pem
AppConstant.PAYMENT.PRIVATECERT=/cert/apiclient_cert.pem
#\u5546\u6237\u53F7
AppConstant.PAYMENT.MCHID=1602367576
#apiV3Key
AppConstant.PAYMENT.APIV3KEY=FVEVD23654fevertf4SCDWDDddee2021
#\u5546\u6237\u8BC1\u4E66\u5E8F\u5217\u53F7
AppConstant.PAYMENT.CERTSERIALNMBER=7677241ADCDBEAAF11E0F48D09172CE8FB99685D
#\u5F85\u652F\u4ED8\u76EE\u5F55,redis\u5B58\u50A8\u8C03\u8D77\u652F\u4ED8\u53C2\u6570,\u76EE\u5F55\u6539\u7684\u8BDD\uFF0Credis\u8FC7\u671F\u673A\u5236\u90A3\u91CC\u8981\u6539\u4E00\u4E0B
AppConstant.PAYMENT.TOBEPAIDORDER=wxorder:beoverdue:
#\u5F85\u652F\u4ED8\u8BA2\u5355\u8FC7\u671F\u65F6\u95F4,\u9ED8\u8BA4\u662F30\u5206\u949F 60*30=1800=30\u5206\u949F//1800
AppConstant.PAYMENT.BEOVERDUEORDER=1800
#15\u5929\u4E3A\u6536\u8D27\u5012\u8BA1\u65F6receiving
AppConstant.PAYMENT.RECEIVING=wxorder:automaticreceipt:
#\u81EA\u52A8\u6536\u8D27\u65F6\u95F4\uFF0C\u9ED8\u8BA4\u662F 15\u5929:60*60*24*15=1296000
AppConstant.PAYMENT.RECEIVINGTIME=1296000
#\u76F4\u64AD\u72B6\u6001
AppConstant.LIVEBROADCAST.STATIC=livebroadcast:state:
#\u76F4\u64AD\u6D88\u606F\u63A8\u9001
AppConstant.LIVEBROADCAST.MESSAGEPUSH=livebroadcast:messagepush:
#\u5458\u5DE5\u767B\u5F55token
AppConstant.BRANCHMOISTEN.TOKEN=wxStaff:
#\u5458\u5DE5\u767B\u5F55token\u8FC7\u671F\u65F6\u95F4\uFF0C\u4EE5\u79D2\u505A\u5355\u4F4D
AppConstant.BRANCHMOISTEN.TOKENBEOVERDUE=3600
AppConstant.METIS_BASE_URL=http://192.168.1.164:8089
...@@ -4,7 +4,7 @@ spring: ...@@ -4,7 +4,7 @@ spring:
datasource: datasource:
type: com.zaxxer.hikari.HikariDataSource type: com.zaxxer.hikari.HikariDataSource
driver-class-name: com.mysql.cj.jdbc.Driver driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://127.0.0.1:3308/aiot?useUnicode=true&allowMultiQueries=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai url: jdbc:mysql://192.168.1.57:3306/metis?useUnicode=true&allowMultiQueries=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai
username: root username: root
password: 123456 password: 123456
hikari: hikari:
......
...@@ -4,7 +4,7 @@ spring: ...@@ -4,7 +4,7 @@ spring:
datasource: datasource:
type: com.zaxxer.hikari.HikariDataSource type: com.zaxxer.hikari.HikariDataSource
driver-class-name: com.mysql.cj.jdbc.Driver driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://192.168.1.72:3308/aiot?useUnicode=true&allowMultiQueries=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai url: jdbc:mysql://192.168.1.57:3306/metis?useUnicode=true&allowMultiQueries=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai
username: root username: root
password: 123456 password: 123456
hikari: hikari:
...@@ -60,3 +60,4 @@ mybatis-plus: ...@@ -60,3 +60,4 @@ mybatis-plus:
# 逻辑未删除值(默认为 0) # 逻辑未删除值(默认为 0)
logic-not-delete-value: 0 logic-not-delete-value: 0
type-aliases-package: com.dr.domain.entity type-aliases-package: com.dr.domain.entity
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.dr.mapper.ConfigMapper">
<select id="findConfigByKeystr" resultType="com.dr.entity.Config">
select * from t_config where keystr = #{keystr}
</select>
<select id="findConfigListByKeystr" resultType="com.dr.entity.Config">
select * from t_config where keystr = #{keystr}
</select>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.dr.mapper.DrDeviceTypeStartByMonthMapper">
<select id="selectDevStartList" resultType="com.dr.dto.DeviceTypeStartByMonthDTO">
SELECT
t1.deviceid AS "deviceid",
t1.device_type_code AS "deviceTypeCode",
t1.device_type_name AS "deviceTypeName",
sum( t1.start_up_num ) AS "startUpNum",
t1.shop_account as "shopAccount",
t1.shop_name as "shopName"
FROM
dr_device_type_start_by_day t1
INNER JOIN t_area t2 ON t1.shop_city_name = t2.`name`
INNER JOIN t_a_config_area t3 ON t2.id = t3.area_id
WHERE
t1.deleted = 0
AND t2.isdel = 0
AND t1.month_time BETWEEN #{startTime} AND #{endTime}
AND t1.device_type_code IN
<foreach collection="deviceTypeSet" item="item" index="index" open="(" separator="," close=")">
#{item}
</foreach>
AND t3.area_config_id = #{lineCityId}
<if test="null != shopAccount">
AND t1.shop_account = #{shopAccount}
</if>
<if test="null != orgAccount">
AND t1.org_account = #{orgAccount}
</if>
GROUP BY
t1.device_type_code,
t1.deviceid
</select>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.dr.mapper.DrLastYearSkinProblemByMonthMapper">
<select id="selectSkinProblemRecommend"
resultType="com.dr.entity.DrLastYearSkinProblemByMonthEntity">
SELECT
t1.*
FROM
dr_last_year_skin_problem_by_month t1
INNER JOIN
t_area t2
ON t1.shop_province_name = t2.`name`
INNER JOIN t_a_config_area t3 ON t2.id = t3.area_id
WHERE
t1.deleted = 0
and t2.isdel = 0
and t3.deleted = 0
and t3.area_config_id = #{regionId}
and t1.month_time between #{startTime} and #{endTime}
</select>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.dr.mapper.EmployeeManageMapper" >
<select id="findEmpPermission" resultType="com.dr.dto.EmpPermissionDTO">
SELECT
ce.power_type AS powerType,
o.accounts AS oAccount,
s.accounts AS shopAccount,
o.orgname AS orgName
FROM
c_employee ce
INNER JOIN t_organization o ON ce.per_id = o.id
INNER JOIN t_shop s ON s.id = ce.per_cus_Id
WHERE
ce.per_cus_Id = s.id and ce.openid =#{openId} and s.accounts = #{sAccount} limit 1
</select>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.dr.mapper.WxAppletuserMapper">
</mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment