Commit ebead53e by peterchu

feat: first commit

parents
.idea
target
[INFO]2021-03-08 16:27:40[getSaleDetailReportData][开始获取数据,参数:{"customerId":"2cb3aa90-7530-11e9-b14b-c81f66ba6a47","endTime_Tic":"2021-03-08 00:00:00","orderStatus":"4","requestId":"","startTime_Tic":"2021-03-07 00:00:00","tableName":"orderinfo,orderpassenger,orderflightinfo,orderpurchase,orderinsurance,ordervalueadded,transactiondetail,transactiondetail_old"}]
[INFO]2021-03-08 16:30:43[getSaleDetailReportData][获取数据成功,共用时:178836]
[INFO]2021-03-08 16:31:28[getSaleDetailReportData][开始获取数据,参数:{"customerId":"2cb3aa90-7530-11e9-b14b-c81f66ba6a47","endTime_Tic":"2021-03-08 00:00:00","orderStatus":"4","requestId":"","startTime_Tic":"2021-03-07 00:00:00","tableName":"orderinfo,orderpassenger,orderflightinfo,orderpurchase,orderinsurance,ordervalueadded,transactiondetail,transactiondetail_old"}]
[INFO]2021-03-08 16:31:29[getSaleDetailReportData][获取数据成功,共用时:962]
\ No newline at end of file
[INFO]2021-03-16 10:29:07[run][启动程序即开始消费响应消息队列]
[INFO]2021-03-16 10:29:07[run][响应消息队列当前长度:0]
\ No newline at end of file
[INFO]2020-12-09 11:33:34[run][启动程序即开始消费响应消息队列]
[INFO]2020-12-09 11:33:34[run][响应消息队列当前长度:0]
[INFO]2020-12-09 11:34:55[run][启动程序即开始消费响应消息队列]
[INFO]2020-12-09 11:34:55[run][响应消息队列当前长度:0]
\ No newline at end of file
[INFO]2021-03-08 16:26:29[run][启动程序即开始消费响应消息队列]
[INFO]2021-03-08 16:26:29[run][响应消息队列当前长度:0]
\ No newline at end of file
2021-03-16 10:29:02 INFO [com.yutu.base.TestSpringApplication]: Starting TestSpringApplication on XB-20200717RJWL with PID 10596 (D:\pc\Project\polestar\iffs-files-services\target\classes started by Administrator in D:\pc\Project\polestar\iffs-files-services)
2021-03-16 10:29:02 INFO [com.yutu.base.TestSpringApplication]: The following profiles are active: test
2021-03-16 10:29:02 INFO [org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext]: Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@37918c79: startup date [Tue Mar 16 10:29:02 CST 2021]; root of context hierarchy
2021-03-16 10:29:02 INFO [org.hibernate.validator.internal.util.Version]: HV000001: Hibernate Validator 5.3.5.Final
2021-03-16 10:29:03 INFO [org.springframework.beans.factory.support.DefaultListableBeanFactory]: Overriding bean definition for bean 'managementServletContext' with a different definition: replacing [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.boot.actuate.autoconfigure.EndpointWebMvcHypermediaManagementContextConfiguration; factoryMethodName=managementServletContext; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/boot/actuate/autoconfigure/EndpointWebMvcHypermediaManagementContextConfiguration.class]] with [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.boot.actuate.autoconfigure.EndpointWebMvcAutoConfiguration; factoryMethodName=managementServletContext; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/boot/actuate/autoconfigure/EndpointWebMvcAutoConfiguration.class]]
2021-03-16 10:29:04 INFO [org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer]: Tomcat initialized with port(s): 8066 (http)
2021-03-16 10:29:04 INFO [org.springframework.web.context.ContextLoader]: Root WebApplicationContext: initialization completed in 2522 ms
2021-03-16 10:29:05 INFO [org.springframework.boot.web.servlet.ServletRegistrationBean]: Mapping servlet: 'dispatcherServlet' to [/]
2021-03-16 10:29:05 INFO [org.springframework.boot.web.servlet.FilterRegistrationBean]: Mapping filter: 'metricsFilter' to: [/*]
2021-03-16 10:29:05 INFO [org.springframework.boot.web.servlet.FilterRegistrationBean]: Mapping filter: 'characterEncodingFilter' to: [/*]
2021-03-16 10:29:05 INFO [org.springframework.boot.web.servlet.FilterRegistrationBean]: Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
2021-03-16 10:29:05 INFO [org.springframework.boot.web.servlet.FilterRegistrationBean]: Mapping filter: 'httpPutFormContentFilter' to: [/*]
2021-03-16 10:29:05 INFO [org.springframework.boot.web.servlet.FilterRegistrationBean]: Mapping filter: 'requestContextFilter' to: [/*]
2021-03-16 10:29:05 INFO [org.springframework.boot.web.servlet.FilterRegistrationBean]: Mapping filter: 'webRequestLoggingFilter' to: [/*]
2021-03-16 10:29:05 INFO [org.springframework.boot.web.servlet.FilterRegistrationBean]: Mapping filter: 'applicationContextIdFilter' to: [/*]
2021-03-16 10:29:05 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping]: Mapped "{[/files/order/exportOrderInfo],methods=[POST]}" onto public com.yutu.base.entity.Response com.yutu.base.controller.DownLoadController.exportOrderInfo(java.lang.String)
2021-03-16 10:29:05 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping]: Mapped "{[/files/saleDetail/updateSaleDetail],methods=[POST]}" onto public com.yutu.base.entity.Response com.yutu.base.controller.DownLoadController.updateSaleDetail(java.lang.String)
2021-03-16 10:29:05 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping]: Mapped "{[/files/download/getSaleDetailData.do],methods=[POST]}" onto public com.yutu.base.entity.Response com.yutu.base.controller.DownLoadController.getSaleDetail(java.lang.String)
2021-03-16 10:29:05 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping]: Mapped "{[/files/download/saleDetailReport.do],methods=[POST]}" onto public com.yutu.base.entity.Response com.yutu.base.controller.DownLoadController.saleDetailReport(java.lang.String)
2021-03-16 10:29:05 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping]: Mapped "{[/files/download/saleDetailReportFromAutoSource.do],methods=[POST]}" onto public com.yutu.base.entity.Response com.yutu.base.controller.DownLoadController.saleDetailReportFromAutoSource(java.lang.String)
2021-03-16 10:29:05 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping]: Mapped "{[/files/parse/toSaleDetail],methods=[POST]}" onto public com.yutu.base.entity.Response com.yutu.base.controller.DownLoadController.parseToSaleDetail(java.lang.String)
2021-03-16 10:29:05 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping]: Mapped "{[/files/download/saleRules.do],methods=[POST]}" onto public com.yutu.base.entity.Response com.yutu.base.controller.DownLoadController.downLoadSaleRules(java.lang.String)
2021-03-16 10:29:05 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping]: Mapped "{[/files/privateFreight/download.do],methods=[POST]}" onto public com.yutu.base.entity.Response com.yutu.base.controller.DownLoadController.exportPrivateFreight(java.lang.String)
2021-03-16 10:29:05 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping]: Mapped "{[/test],methods=[GET]}" onto public java.lang.String com.yutu.base.controller.TestController.test()
2021-03-16 10:29:05 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping]: Mapped "{[/files/upload/saleRules.do],methods=[POST]}" onto public com.yutu.base.entity.Response com.yutu.base.controller.UploadController.uploadSaleRules(java.lang.String)
2021-03-16 10:29:05 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping]: Mapped "{[/files/privateFreight/upload.do],methods=[POST]}" onto public com.yutu.base.entity.Response com.yutu.base.controller.UploadController.uploadPrivateFreight(java.lang.String)
2021-03-16 10:29:05 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping]: Mapped "{[/v2/api-docs],methods=[GET]}" onto public org.springframework.http.ResponseEntity<springfox.documentation.spring.web.json.Json> springfox.documentation.swagger2.web.Swagger2Controller.getDocumentation(java.lang.String)
2021-03-16 10:29:05 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping]: Mapped "{[/swagger-resources]}" onto org.springframework.http.ResponseEntity<java.util.List<springfox.documentation.swagger.web.SwaggerResource>> springfox.documentation.swagger.web.ApiResourceController.swaggerResources()
2021-03-16 10:29:05 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping]: Mapped "{[/configuration/ui]}" onto org.springframework.http.ResponseEntity<springfox.documentation.swagger.web.UiConfiguration> springfox.documentation.swagger.web.ApiResourceController.uiConfiguration()
2021-03-16 10:29:05 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping]: Mapped "{[/configuration/security]}" onto org.springframework.http.ResponseEntity<springfox.documentation.swagger.web.SecurityConfiguration> springfox.documentation.swagger.web.ApiResourceController.securityConfiguration()
2021-03-16 10:29:05 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping]: Mapped "{[/error]}" onto public org.springframework.http.ResponseEntity<java.util.Map<java.lang.String, java.lang.Object>> org.springframework.boot.autoconfigure.web.BasicErrorController.error(javax.servlet.http.HttpServletRequest)
2021-03-16 10:29:05 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping]: Mapped "{[/error],produces=[text/html]}" onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)
2021-03-16 10:29:06 INFO [org.springframework.boot.actuate.endpoint.mvc.EndpointHandlerMapping]: Mapped "{[/mappings || /mappings.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2021-03-16 10:29:06 INFO [org.springframework.boot.actuate.endpoint.mvc.EndpointHandlerMapping]: Mapped "{[/configprops || /configprops.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2021-03-16 10:29:06 INFO [org.springframework.boot.actuate.endpoint.mvc.EndpointHandlerMapping]: Mapped "{[/metrics/{name:.*}],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.MetricsMvcEndpoint.value(java.lang.String)
2021-03-16 10:29:06 INFO [org.springframework.boot.actuate.endpoint.mvc.EndpointHandlerMapping]: Mapped "{[/metrics || /metrics.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2021-03-16 10:29:06 INFO [org.springframework.boot.actuate.endpoint.mvc.EndpointHandlerMapping]: Mapped "{[/heapdump || /heapdump.json],methods=[GET],produces=[application/octet-stream]}" onto public void org.springframework.boot.actuate.endpoint.mvc.HeapdumpMvcEndpoint.invoke(boolean,javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse) throws java.io.IOException,javax.servlet.ServletException
2021-03-16 10:29:06 INFO [org.springframework.boot.actuate.endpoint.mvc.EndpointHandlerMapping]: Mapped "{[/autoconfig || /autoconfig.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2021-03-16 10:29:06 INFO [org.springframework.boot.actuate.endpoint.mvc.EndpointHandlerMapping]: Mapped "{[/trace || /trace.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2021-03-16 10:29:06 INFO [org.springframework.boot.actuate.endpoint.mvc.EndpointHandlerMapping]: Mapped "{[/health || /health.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.HealthMvcEndpoint.invoke(javax.servlet.http.HttpServletRequest,java.security.Principal)
2021-03-16 10:29:06 INFO [org.springframework.boot.actuate.endpoint.mvc.EndpointHandlerMapping]: Mapped "{[/info || /info.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2021-03-16 10:29:06 INFO [org.springframework.boot.actuate.endpoint.mvc.EndpointHandlerMapping]: Mapped "{[/auditevents || /auditevents.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public org.springframework.http.ResponseEntity<?> org.springframework.boot.actuate.endpoint.mvc.AuditEventsMvcEndpoint.findByPrincipalAndAfterAndType(java.lang.String,java.util.Date,java.lang.String)
2021-03-16 10:29:06 INFO [org.springframework.boot.actuate.endpoint.mvc.EndpointHandlerMapping]: Mapped "{[/loggers/{name:.*}],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.LoggersMvcEndpoint.get(java.lang.String)
2021-03-16 10:29:06 INFO [org.springframework.boot.actuate.endpoint.mvc.EndpointHandlerMapping]: Mapped "{[/loggers/{name:.*}],methods=[POST],consumes=[application/vnd.spring-boot.actuator.v1+json || application/json],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.LoggersMvcEndpoint.set(java.lang.String,java.util.Map<java.lang.String, java.lang.String>)
2021-03-16 10:29:06 INFO [org.springframework.boot.actuate.endpoint.mvc.EndpointHandlerMapping]: Mapped "{[/loggers || /loggers.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2021-03-16 10:29:06 INFO [org.springframework.boot.actuate.endpoint.mvc.EndpointHandlerMapping]: Mapped "{[/actuator || /actuator.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public org.springframework.hateoas.ResourceSupport org.springframework.boot.actuate.endpoint.mvc.HalJsonMvcEndpoint.links()
2021-03-16 10:29:06 INFO [org.springframework.boot.actuate.endpoint.mvc.EndpointHandlerMapping]: Mapped "{[/env/{name:.*}],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EnvironmentMvcEndpoint.value(java.lang.String)
2021-03-16 10:29:06 INFO [org.springframework.boot.actuate.endpoint.mvc.EndpointHandlerMapping]: Mapped "{[/env || /env.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2021-03-16 10:29:06 INFO [org.springframework.boot.actuate.endpoint.mvc.EndpointHandlerMapping]: Mapped "{[/dump || /dump.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2021-03-16 10:29:06 INFO [org.springframework.boot.actuate.endpoint.mvc.EndpointHandlerMapping]: Mapped "{[/beans || /beans.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2021-03-16 10:29:06 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter]: Looking for @ControllerAdvice: org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@37918c79: startup date [Tue Mar 16 10:29:02 CST 2021]; root of context hierarchy
2021-03-16 10:29:06 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter]: Detected ResponseBodyAdvice bean in org.springframework.boot.actuate.autoconfigure.EndpointWebMvcHypermediaManagementContextConfiguration$ActuatorEndpointLinksAdvice
2021-03-16 10:29:06 INFO [org.springframework.web.servlet.handler.SimpleUrlHandlerMapping]: Mapped URL path [/webjars/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2021-03-16 10:29:06 INFO [org.springframework.web.servlet.handler.SimpleUrlHandlerMapping]: Mapped URL path [/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2021-03-16 10:29:06 INFO [org.springframework.web.servlet.mvc.method.annotation.ExceptionHandlerExceptionResolver]: Detected ResponseBodyAdvice implementation in org.springframework.boot.actuate.autoconfigure.EndpointWebMvcHypermediaManagementContextConfiguration$ActuatorEndpointLinksAdvice
2021-03-16 10:29:06 INFO [org.springframework.web.servlet.handler.SimpleUrlHandlerMapping]: Mapped URL path [/**/favicon.ico] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2021-03-16 10:29:06 INFO [org.springframework.jmx.export.annotation.AnnotationMBeanExporter]: Registering beans for JMX exposure on startup
2021-03-16 10:29:06 INFO [org.springframework.boot.actuate.endpoint.jmx.EndpointMBeanExporter]: Registering beans for JMX exposure on startup
2021-03-16 10:29:06 INFO [org.springframework.context.support.DefaultLifecycleProcessor]: Starting beans in phase 0
2021-03-16 10:29:06 INFO [org.springframework.boot.actuate.endpoint.jmx.EndpointMBeanExporter]: Located managed bean 'auditEventsEndpoint': registering with JMX server as MBean [org.springframework.boot:type=Endpoint,name=auditEventsEndpoint]
2021-03-16 10:29:06 INFO [org.springframework.boot.actuate.endpoint.jmx.EndpointMBeanExporter]: Located managed bean 'requestMappingEndpoint': registering with JMX server as MBean [org.springframework.boot:type=Endpoint,name=requestMappingEndpoint]
2021-03-16 10:29:06 INFO [org.springframework.boot.actuate.endpoint.jmx.EndpointMBeanExporter]: Located managed bean 'environmentEndpoint': registering with JMX server as MBean [org.springframework.boot:type=Endpoint,name=environmentEndpoint]
2021-03-16 10:29:06 INFO [org.springframework.boot.actuate.endpoint.jmx.EndpointMBeanExporter]: Located managed bean 'healthEndpoint': registering with JMX server as MBean [org.springframework.boot:type=Endpoint,name=healthEndpoint]
2021-03-16 10:29:06 INFO [org.springframework.boot.actuate.endpoint.jmx.EndpointMBeanExporter]: Located managed bean 'beansEndpoint': registering with JMX server as MBean [org.springframework.boot:type=Endpoint,name=beansEndpoint]
2021-03-16 10:29:06 INFO [org.springframework.boot.actuate.endpoint.jmx.EndpointMBeanExporter]: Located managed bean 'infoEndpoint': registering with JMX server as MBean [org.springframework.boot:type=Endpoint,name=infoEndpoint]
2021-03-16 10:29:06 INFO [org.springframework.boot.actuate.endpoint.jmx.EndpointMBeanExporter]: Located managed bean 'loggersEndpoint': registering with JMX server as MBean [org.springframework.boot:type=Endpoint,name=loggersEndpoint]
2021-03-16 10:29:06 INFO [org.springframework.boot.actuate.endpoint.jmx.EndpointMBeanExporter]: Located managed bean 'metricsEndpoint': registering with JMX server as MBean [org.springframework.boot:type=Endpoint,name=metricsEndpoint]
2021-03-16 10:29:06 INFO [org.springframework.boot.actuate.endpoint.jmx.EndpointMBeanExporter]: Located managed bean 'traceEndpoint': registering with JMX server as MBean [org.springframework.boot:type=Endpoint,name=traceEndpoint]
2021-03-16 10:29:06 INFO [org.springframework.boot.actuate.endpoint.jmx.EndpointMBeanExporter]: Located managed bean 'dumpEndpoint': registering with JMX server as MBean [org.springframework.boot:type=Endpoint,name=dumpEndpoint]
2021-03-16 10:29:06 INFO [org.springframework.boot.actuate.endpoint.jmx.EndpointMBeanExporter]: Located managed bean 'autoConfigurationReportEndpoint': registering with JMX server as MBean [org.springframework.boot:type=Endpoint,name=autoConfigurationReportEndpoint]
2021-03-16 10:29:06 INFO [org.springframework.boot.actuate.endpoint.jmx.EndpointMBeanExporter]: Located managed bean 'configurationPropertiesReportEndpoint': registering with JMX server as MBean [org.springframework.boot:type=Endpoint,name=configurationPropertiesReportEndpoint]
2021-03-16 10:29:07 INFO [org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer]: Tomcat started on port(s): 8066 (http)
2021-03-16 10:29:07 INFO [saleDetail]: [updateSaleDetailQueue] 刷新报表队列 当前长度:0
2021-03-16 10:29:07 INFO [com.yutu.base.TestSpringApplication]: Started TestSpringApplication in 5.76 seconds (JVM running for 6.892)
2021-03-16 10:37:58 INFO [org.springframework.web.servlet.DispatcherServlet]: FrameworkServlet 'dispatcherServlet': initialization started
2021-03-16 10:37:58 INFO [org.springframework.web.servlet.DispatcherServlet]: FrameworkServlet 'dispatcherServlet': initialization completed in 23 ms
2021-03-16 10:37:58 WARN [org.springframework.web.servlet.PageNotFound]: Request method 'GET' not supported
2021-03-16 10:38:17 WARN [org.springframework.web.servlet.mvc.support.DefaultHandlerExceptionResolver]: Failed to read HTTP message: org.springframework.http.converter.HttpMessageNotReadableException: Required request body is missing: public com.yutu.base.entity.Response com.yutu.base.controller.DownLoadController.getSaleDetail(java.lang.String)
2020-12-09 11:33:18 INFO [com.yutu.base.TestSpringApplication]: Starting TestSpringApplication on WANGYU-YUTU with PID 9192 (D:\Work\Workspaces\yutu\iffs-files-services\target\classes started by stjim in D:\Work\Workspaces\yutu\iffs-files-services)
2020-12-09 11:33:18 INFO [com.yutu.base.TestSpringApplication]: The following profiles are active: prod
2020-12-09 11:33:18 INFO [org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext]: Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@1187c9e8: startup date [Wed Dec 09 11:33:18 CST 2020]; root of context hierarchy
2020-12-09 11:33:18 INFO [org.hibernate.validator.internal.util.Version]: HV000001: Hibernate Validator 5.3.5.Final
2020-12-09 11:33:20 INFO [org.springframework.beans.factory.support.DefaultListableBeanFactory]: Overriding bean definition for bean 'managementServletContext' with a different definition: replacing [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.boot.actuate.autoconfigure.EndpointWebMvcHypermediaManagementContextConfiguration; factoryMethodName=managementServletContext; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/boot/actuate/autoconfigure/EndpointWebMvcHypermediaManagementContextConfiguration.class]] with [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.boot.actuate.autoconfigure.EndpointWebMvcAutoConfiguration; factoryMethodName=managementServletContext; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/boot/actuate/autoconfigure/EndpointWebMvcAutoConfiguration.class]]
2020-12-09 11:33:23 INFO [org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer]: Tomcat initialized with port(s): 8066 (http)
2020-12-09 11:33:24 INFO [org.springframework.web.context.ContextLoader]: Root WebApplicationContext: initialization completed in 5733 ms
2020-12-09 11:33:25 INFO [org.springframework.boot.web.servlet.ServletRegistrationBean]: Mapping servlet: 'dispatcherServlet' to [/]
2020-12-09 11:33:25 INFO [org.springframework.boot.web.servlet.FilterRegistrationBean]: Mapping filter: 'metricsFilter' to: [/*]
2020-12-09 11:33:25 INFO [org.springframework.boot.web.servlet.FilterRegistrationBean]: Mapping filter: 'characterEncodingFilter' to: [/*]
2020-12-09 11:33:25 INFO [org.springframework.boot.web.servlet.FilterRegistrationBean]: Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
2020-12-09 11:33:25 INFO [org.springframework.boot.web.servlet.FilterRegistrationBean]: Mapping filter: 'httpPutFormContentFilter' to: [/*]
2020-12-09 11:33:25 INFO [org.springframework.boot.web.servlet.FilterRegistrationBean]: Mapping filter: 'requestContextFilter' to: [/*]
2020-12-09 11:33:25 INFO [org.springframework.boot.web.servlet.FilterRegistrationBean]: Mapping filter: 'webRequestLoggingFilter' to: [/*]
2020-12-09 11:33:25 INFO [org.springframework.boot.web.servlet.FilterRegistrationBean]: Mapping filter: 'applicationContextIdFilter' to: [/*]
2020-12-09 11:33:27 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping]: Mapped "{[/files/download/saleDetailReport.do],methods=[POST]}" onto public com.yutu.base.entity.Response com.yutu.base.controller.DownLoadController.saleDetailReport(java.lang.String)
2020-12-09 11:33:27 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping]: Mapped "{[/files/order/exportOrderInfo],methods=[POST]}" onto public com.yutu.base.entity.Response com.yutu.base.controller.DownLoadController.exportOrderInfo(java.lang.String)
2020-12-09 11:33:27 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping]: Mapped "{[/files/saleDetail/updateSaleDetail],methods=[POST]}" onto public com.yutu.base.entity.Response com.yutu.base.controller.DownLoadController.updateSaleDetail(java.lang.String)
2020-12-09 11:33:27 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping]: Mapped "{[/files/download/getSaleDetailData.do],methods=[POST]}" onto public com.yutu.base.entity.Response com.yutu.base.controller.DownLoadController.getSaleDetail(java.lang.String)
2020-12-09 11:33:27 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping]: Mapped "{[/files/download/saleRules.do],methods=[POST]}" onto public com.yutu.base.entity.Response com.yutu.base.controller.DownLoadController.downLoadSaleRules(java.lang.String)
2020-12-09 11:33:27 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping]: Mapped "{[/files/parse/toSaleDetail],methods=[POST]}" onto public com.yutu.base.entity.Response com.yutu.base.controller.DownLoadController.parseToSaleDetail(java.lang.String)
2020-12-09 11:33:27 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping]: Mapped "{[/files/privateFreight/download.do],methods=[POST]}" onto public com.yutu.base.entity.Response com.yutu.base.controller.DownLoadController.exportPrivateFreight(java.lang.String)
2020-12-09 11:33:27 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping]: Mapped "{[/files/download/saleDetailReportFromAutoSource.do],methods=[POST]}" onto public com.yutu.base.entity.Response com.yutu.base.controller.DownLoadController.saleDetailReportFromAutoSource(java.lang.String)
2020-12-09 11:33:27 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping]: Mapped "{[/test],methods=[GET]}" onto public java.lang.String com.yutu.base.controller.TestController.test()
2020-12-09 11:33:27 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping]: Mapped "{[/files/upload/saleRules.do],methods=[POST]}" onto public com.yutu.base.entity.Response com.yutu.base.controller.UploadController.uploadSaleRules(java.lang.String)
2020-12-09 11:33:27 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping]: Mapped "{[/files/privateFreight/upload.do],methods=[POST]}" onto public com.yutu.base.entity.Response com.yutu.base.controller.UploadController.uploadPrivateFreight(java.lang.String)
2020-12-09 11:33:27 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping]: Mapped "{[/v2/api-docs],methods=[GET]}" onto public org.springframework.http.ResponseEntity<springfox.documentation.spring.web.json.Json> springfox.documentation.swagger2.web.Swagger2Controller.getDocumentation(java.lang.String)
2020-12-09 11:33:27 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping]: Mapped "{[/configuration/security]}" onto org.springframework.http.ResponseEntity<springfox.documentation.swagger.web.SecurityConfiguration> springfox.documentation.swagger.web.ApiResourceController.securityConfiguration()
2020-12-09 11:33:28 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping]: Mapped "{[/configuration/ui]}" onto org.springframework.http.ResponseEntity<springfox.documentation.swagger.web.UiConfiguration> springfox.documentation.swagger.web.ApiResourceController.uiConfiguration()
2020-12-09 11:33:28 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping]: Mapped "{[/swagger-resources]}" onto org.springframework.http.ResponseEntity<java.util.List<springfox.documentation.swagger.web.SwaggerResource>> springfox.documentation.swagger.web.ApiResourceController.swaggerResources()
2020-12-09 11:33:28 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping]: Mapped "{[/error]}" onto public org.springframework.http.ResponseEntity<java.util.Map<java.lang.String, java.lang.Object>> org.springframework.boot.autoconfigure.web.BasicErrorController.error(javax.servlet.http.HttpServletRequest)
2020-12-09 11:33:28 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping]: Mapped "{[/error],produces=[text/html]}" onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)
2020-12-09 11:33:29 INFO [org.springframework.boot.actuate.endpoint.mvc.EndpointHandlerMapping]: Mapped "{[/env/{name:.*}],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EnvironmentMvcEndpoint.value(java.lang.String)
2020-12-09 11:33:29 INFO [org.springframework.boot.actuate.endpoint.mvc.EndpointHandlerMapping]: Mapped "{[/env || /env.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2020-12-09 11:33:29 INFO [org.springframework.boot.actuate.endpoint.mvc.EndpointHandlerMapping]: Mapped "{[/metrics/{name:.*}],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.MetricsMvcEndpoint.value(java.lang.String)
2020-12-09 11:33:29 INFO [org.springframework.boot.actuate.endpoint.mvc.EndpointHandlerMapping]: Mapped "{[/metrics || /metrics.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2020-12-09 11:33:29 INFO [org.springframework.boot.actuate.endpoint.mvc.EndpointHandlerMapping]: Mapped "{[/auditevents || /auditevents.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public org.springframework.http.ResponseEntity<?> org.springframework.boot.actuate.endpoint.mvc.AuditEventsMvcEndpoint.findByPrincipalAndAfterAndType(java.lang.String,java.util.Date,java.lang.String)
2020-12-09 11:33:29 INFO [org.springframework.boot.actuate.endpoint.mvc.EndpointHandlerMapping]: Mapped "{[/actuator || /actuator.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public org.springframework.hateoas.ResourceSupport org.springframework.boot.actuate.endpoint.mvc.HalJsonMvcEndpoint.links()
2020-12-09 11:33:29 INFO [org.springframework.boot.actuate.endpoint.mvc.EndpointHandlerMapping]: Mapped "{[/beans || /beans.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2020-12-09 11:33:29 INFO [org.springframework.boot.actuate.endpoint.mvc.EndpointHandlerMapping]: Mapped "{[/mappings || /mappings.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2020-12-09 11:33:29 INFO [org.springframework.boot.actuate.endpoint.mvc.EndpointHandlerMapping]: Mapped "{[/autoconfig || /autoconfig.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2020-12-09 11:33:29 INFO [org.springframework.boot.actuate.endpoint.mvc.EndpointHandlerMapping]: Mapped "{[/configprops || /configprops.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2020-12-09 11:33:29 INFO [org.springframework.boot.actuate.endpoint.mvc.EndpointHandlerMapping]: Mapped "{[/info || /info.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2020-12-09 11:33:29 INFO [org.springframework.boot.actuate.endpoint.mvc.EndpointHandlerMapping]: Mapped "{[/heapdump || /heapdump.json],methods=[GET],produces=[application/octet-stream]}" onto public void org.springframework.boot.actuate.endpoint.mvc.HeapdumpMvcEndpoint.invoke(boolean,javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse) throws java.io.IOException,javax.servlet.ServletException
2020-12-09 11:33:29 INFO [org.springframework.boot.actuate.endpoint.mvc.EndpointHandlerMapping]: Mapped "{[/trace || /trace.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2020-12-09 11:33:29 INFO [org.springframework.boot.actuate.endpoint.mvc.EndpointHandlerMapping]: Mapped "{[/loggers/{name:.*}],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.LoggersMvcEndpoint.get(java.lang.String)
2020-12-09 11:33:29 INFO [org.springframework.boot.actuate.endpoint.mvc.EndpointHandlerMapping]: Mapped "{[/loggers/{name:.*}],methods=[POST],consumes=[application/vnd.spring-boot.actuator.v1+json || application/json],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.LoggersMvcEndpoint.set(java.lang.String,java.util.Map<java.lang.String, java.lang.String>)
2020-12-09 11:33:29 INFO [org.springframework.boot.actuate.endpoint.mvc.EndpointHandlerMapping]: Mapped "{[/loggers || /loggers.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2020-12-09 11:33:29 INFO [org.springframework.boot.actuate.endpoint.mvc.EndpointHandlerMapping]: Mapped "{[/health || /health.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.HealthMvcEndpoint.invoke(javax.servlet.http.HttpServletRequest,java.security.Principal)
2020-12-09 11:33:29 INFO [org.springframework.boot.actuate.endpoint.mvc.EndpointHandlerMapping]: Mapped "{[/dump || /dump.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2020-12-09 11:33:30 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter]: Looking for @ControllerAdvice: org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@1187c9e8: startup date [Wed Dec 09 11:33:18 CST 2020]; root of context hierarchy
2020-12-09 11:33:30 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter]: Detected ResponseBodyAdvice bean in org.springframework.boot.actuate.autoconfigure.EndpointWebMvcHypermediaManagementContextConfiguration$ActuatorEndpointLinksAdvice
2020-12-09 11:33:31 INFO [org.springframework.web.servlet.handler.SimpleUrlHandlerMapping]: Mapped URL path [/webjars/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2020-12-09 11:33:31 INFO [org.springframework.web.servlet.handler.SimpleUrlHandlerMapping]: Mapped URL path [/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2020-12-09 11:33:31 INFO [org.springframework.web.servlet.mvc.method.annotation.ExceptionHandlerExceptionResolver]: Detected ResponseBodyAdvice implementation in org.springframework.boot.actuate.autoconfigure.EndpointWebMvcHypermediaManagementContextConfiguration$ActuatorEndpointLinksAdvice
2020-12-09 11:33:31 INFO [org.springframework.web.servlet.handler.SimpleUrlHandlerMapping]: Mapped URL path [/**/favicon.ico] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2020-12-09 11:33:32 INFO [org.springframework.jmx.export.annotation.AnnotationMBeanExporter]: Registering beans for JMX exposure on startup
2020-12-09 11:33:32 INFO [org.springframework.boot.actuate.endpoint.jmx.EndpointMBeanExporter]: Registering beans for JMX exposure on startup
2020-12-09 11:33:32 INFO [org.springframework.context.support.DefaultLifecycleProcessor]: Starting beans in phase 0
2020-12-09 11:33:32 INFO [org.springframework.boot.actuate.endpoint.jmx.EndpointMBeanExporter]: Located managed bean 'auditEventsEndpoint': registering with JMX server as MBean [org.springframework.boot:type=Endpoint,name=auditEventsEndpoint]
2020-12-09 11:33:32 INFO [org.springframework.boot.actuate.endpoint.jmx.EndpointMBeanExporter]: Located managed bean 'requestMappingEndpoint': registering with JMX server as MBean [org.springframework.boot:type=Endpoint,name=requestMappingEndpoint]
2020-12-09 11:33:32 INFO [org.springframework.boot.actuate.endpoint.jmx.EndpointMBeanExporter]: Located managed bean 'environmentEndpoint': registering with JMX server as MBean [org.springframework.boot:type=Endpoint,name=environmentEndpoint]
2020-12-09 11:33:32 INFO [org.springframework.boot.actuate.endpoint.jmx.EndpointMBeanExporter]: Located managed bean 'healthEndpoint': registering with JMX server as MBean [org.springframework.boot:type=Endpoint,name=healthEndpoint]
2020-12-09 11:33:32 INFO [org.springframework.boot.actuate.endpoint.jmx.EndpointMBeanExporter]: Located managed bean 'beansEndpoint': registering with JMX server as MBean [org.springframework.boot:type=Endpoint,name=beansEndpoint]
2020-12-09 11:33:32 INFO [org.springframework.boot.actuate.endpoint.jmx.EndpointMBeanExporter]: Located managed bean 'infoEndpoint': registering with JMX server as MBean [org.springframework.boot:type=Endpoint,name=infoEndpoint]
2020-12-09 11:33:32 INFO [org.springframework.boot.actuate.endpoint.jmx.EndpointMBeanExporter]: Located managed bean 'loggersEndpoint': registering with JMX server as MBean [org.springframework.boot:type=Endpoint,name=loggersEndpoint]
2020-12-09 11:33:32 INFO [org.springframework.boot.actuate.endpoint.jmx.EndpointMBeanExporter]: Located managed bean 'metricsEndpoint': registering with JMX server as MBean [org.springframework.boot:type=Endpoint,name=metricsEndpoint]
2020-12-09 11:33:32 INFO [org.springframework.boot.actuate.endpoint.jmx.EndpointMBeanExporter]: Located managed bean 'traceEndpoint': registering with JMX server as MBean [org.springframework.boot:type=Endpoint,name=traceEndpoint]
2020-12-09 11:33:32 INFO [org.springframework.boot.actuate.endpoint.jmx.EndpointMBeanExporter]: Located managed bean 'dumpEndpoint': registering with JMX server as MBean [org.springframework.boot:type=Endpoint,name=dumpEndpoint]
2020-12-09 11:33:32 INFO [org.springframework.boot.actuate.endpoint.jmx.EndpointMBeanExporter]: Located managed bean 'autoConfigurationReportEndpoint': registering with JMX server as MBean [org.springframework.boot:type=Endpoint,name=autoConfigurationReportEndpoint]
2020-12-09 11:33:32 INFO [org.springframework.boot.actuate.endpoint.jmx.EndpointMBeanExporter]: Located managed bean 'configurationPropertiesReportEndpoint': registering with JMX server as MBean [org.springframework.boot:type=Endpoint,name=configurationPropertiesReportEndpoint]
2020-12-09 11:33:34 INFO [org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer]: Tomcat started on port(s): 8066 (http)
2020-12-09 11:33:34 INFO [com.yutu.base.TestSpringApplication]: Started TestSpringApplication in 17.562 seconds (JVM running for 22.51)
2020-12-09 11:33:34 INFO [saleDetail]: [updateSaleDetailQueue] 刷新报表队列 当前长度:0
2020-12-09 11:34:07 INFO [org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext]: Closing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@1187c9e8: startup date [Wed Dec 09 11:33:18 CST 2020]; root of context hierarchy
2020-12-09 11:34:07 INFO [org.springframework.context.support.DefaultLifecycleProcessor]: Stopping beans in phase 0
2020-12-09 11:34:07 INFO [org.springframework.boot.actuate.endpoint.jmx.EndpointMBeanExporter]: Unregistering JMX-exposed beans on shutdown
2020-12-09 11:34:07 INFO [org.springframework.boot.actuate.endpoint.jmx.EndpointMBeanExporter]: Unregistering JMX-exposed beans
2020-12-09 11:34:07 INFO [org.springframework.jmx.export.annotation.AnnotationMBeanExporter]: Unregistering JMX-exposed beans on shutdown
2020-12-09 11:34:42 INFO [com.yutu.base.TestSpringApplication]: Starting TestSpringApplication on WANGYU-YUTU with PID 14544 (D:\Work\Workspaces\yutu\iffs-files-services\target\classes started by stjim in D:\Work\Workspaces\yutu\iffs-files-services)
2020-12-09 11:34:42 INFO [com.yutu.base.TestSpringApplication]: The following profiles are active: test
2020-12-09 11:34:42 INFO [org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext]: Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@127a7a2e: startup date [Wed Dec 09 11:34:42 CST 2020]; root of context hierarchy
2020-12-09 11:34:43 INFO [org.hibernate.validator.internal.util.Version]: HV000001: Hibernate Validator 5.3.5.Final
2020-12-09 11:34:45 INFO [org.springframework.beans.factory.support.DefaultListableBeanFactory]: Overriding bean definition for bean 'managementServletContext' with a different definition: replacing [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.boot.actuate.autoconfigure.EndpointWebMvcHypermediaManagementContextConfiguration; factoryMethodName=managementServletContext; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/boot/actuate/autoconfigure/EndpointWebMvcHypermediaManagementContextConfiguration.class]] with [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.boot.actuate.autoconfigure.EndpointWebMvcAutoConfiguration; factoryMethodName=managementServletContext; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/boot/actuate/autoconfigure/EndpointWebMvcAutoConfiguration.class]]
2020-12-09 11:34:47 INFO [org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer]: Tomcat initialized with port(s): 8800 (http)
2020-12-09 11:34:48 INFO [org.springframework.web.context.ContextLoader]: Root WebApplicationContext: initialization completed in 5104 ms
2020-12-09 11:34:48 INFO [org.springframework.boot.web.servlet.ServletRegistrationBean]: Mapping servlet: 'dispatcherServlet' to [/]
2020-12-09 11:34:48 INFO [org.springframework.boot.web.servlet.FilterRegistrationBean]: Mapping filter: 'metricsFilter' to: [/*]
2020-12-09 11:34:48 INFO [org.springframework.boot.web.servlet.FilterRegistrationBean]: Mapping filter: 'characterEncodingFilter' to: [/*]
2020-12-09 11:34:48 INFO [org.springframework.boot.web.servlet.FilterRegistrationBean]: Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
2020-12-09 11:34:48 INFO [org.springframework.boot.web.servlet.FilterRegistrationBean]: Mapping filter: 'httpPutFormContentFilter' to: [/*]
2020-12-09 11:34:48 INFO [org.springframework.boot.web.servlet.FilterRegistrationBean]: Mapping filter: 'requestContextFilter' to: [/*]
2020-12-09 11:34:48 INFO [org.springframework.boot.web.servlet.FilterRegistrationBean]: Mapping filter: 'webRequestLoggingFilter' to: [/*]
2020-12-09 11:34:48 INFO [org.springframework.boot.web.servlet.FilterRegistrationBean]: Mapping filter: 'applicationContextIdFilter' to: [/*]
2020-12-09 11:34:51 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping]: Mapped "{[/files/parse/toSaleDetail],methods=[POST]}" onto public com.yutu.base.entity.Response com.yutu.base.controller.DownLoadController.parseToSaleDetail(java.lang.String)
2020-12-09 11:34:51 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping]: Mapped "{[/files/download/saleDetailReportFromAutoSource.do],methods=[POST]}" onto public com.yutu.base.entity.Response com.yutu.base.controller.DownLoadController.saleDetailReportFromAutoSource(java.lang.String)
2020-12-09 11:34:51 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping]: Mapped "{[/files/download/saleRules.do],methods=[POST]}" onto public com.yutu.base.entity.Response com.yutu.base.controller.DownLoadController.downLoadSaleRules(java.lang.String)
2020-12-09 11:34:51 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping]: Mapped "{[/files/privateFreight/download.do],methods=[POST]}" onto public com.yutu.base.entity.Response com.yutu.base.controller.DownLoadController.exportPrivateFreight(java.lang.String)
2020-12-09 11:34:51 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping]: Mapped "{[/files/download/saleDetailReport.do],methods=[POST]}" onto public com.yutu.base.entity.Response com.yutu.base.controller.DownLoadController.saleDetailReport(java.lang.String)
2020-12-09 11:34:51 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping]: Mapped "{[/files/order/exportOrderInfo],methods=[POST]}" onto public com.yutu.base.entity.Response com.yutu.base.controller.DownLoadController.exportOrderInfo(java.lang.String)
2020-12-09 11:34:51 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping]: Mapped "{[/files/saleDetail/updateSaleDetail],methods=[POST]}" onto public com.yutu.base.entity.Response com.yutu.base.controller.DownLoadController.updateSaleDetail(java.lang.String)
2020-12-09 11:34:51 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping]: Mapped "{[/files/download/getSaleDetailData.do],methods=[POST]}" onto public com.yutu.base.entity.Response com.yutu.base.controller.DownLoadController.getSaleDetail(java.lang.String)
2020-12-09 11:34:51 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping]: Mapped "{[/test],methods=[GET]}" onto public java.lang.String com.yutu.base.controller.TestController.test()
2020-12-09 11:34:51 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping]: Mapped "{[/files/privateFreight/upload.do],methods=[POST]}" onto public com.yutu.base.entity.Response com.yutu.base.controller.UploadController.uploadPrivateFreight(java.lang.String)
2020-12-09 11:34:51 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping]: Mapped "{[/files/upload/saleRules.do],methods=[POST]}" onto public com.yutu.base.entity.Response com.yutu.base.controller.UploadController.uploadSaleRules(java.lang.String)
2020-12-09 11:34:51 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping]: Mapped "{[/v2/api-docs],methods=[GET]}" onto public org.springframework.http.ResponseEntity<springfox.documentation.spring.web.json.Json> springfox.documentation.swagger2.web.Swagger2Controller.getDocumentation(java.lang.String)
2020-12-09 11:34:51 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping]: Mapped "{[/configuration/ui]}" onto org.springframework.http.ResponseEntity<springfox.documentation.swagger.web.UiConfiguration> springfox.documentation.swagger.web.ApiResourceController.uiConfiguration()
2020-12-09 11:34:51 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping]: Mapped "{[/swagger-resources]}" onto org.springframework.http.ResponseEntity<java.util.List<springfox.documentation.swagger.web.SwaggerResource>> springfox.documentation.swagger.web.ApiResourceController.swaggerResources()
2020-12-09 11:34:51 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping]: Mapped "{[/configuration/security]}" onto org.springframework.http.ResponseEntity<springfox.documentation.swagger.web.SecurityConfiguration> springfox.documentation.swagger.web.ApiResourceController.securityConfiguration()
2020-12-09 11:34:51 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping]: Mapped "{[/error]}" onto public org.springframework.http.ResponseEntity<java.util.Map<java.lang.String, java.lang.Object>> org.springframework.boot.autoconfigure.web.BasicErrorController.error(javax.servlet.http.HttpServletRequest)
2020-12-09 11:34:51 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping]: Mapped "{[/error],produces=[text/html]}" onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)
2020-12-09 11:34:52 INFO [org.springframework.boot.actuate.endpoint.mvc.EndpointHandlerMapping]: Mapped "{[/configprops || /configprops.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2020-12-09 11:34:52 INFO [org.springframework.boot.actuate.endpoint.mvc.EndpointHandlerMapping]: Mapped "{[/health || /health.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.HealthMvcEndpoint.invoke(javax.servlet.http.HttpServletRequest,java.security.Principal)
2020-12-09 11:34:52 INFO [org.springframework.boot.actuate.endpoint.mvc.EndpointHandlerMapping]: Mapped "{[/env/{name:.*}],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EnvironmentMvcEndpoint.value(java.lang.String)
2020-12-09 11:34:52 INFO [org.springframework.boot.actuate.endpoint.mvc.EndpointHandlerMapping]: Mapped "{[/env || /env.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2020-12-09 11:34:52 INFO [org.springframework.boot.actuate.endpoint.mvc.EndpointHandlerMapping]: Mapped "{[/loggers/{name:.*}],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.LoggersMvcEndpoint.get(java.lang.String)
2020-12-09 11:34:52 INFO [org.springframework.boot.actuate.endpoint.mvc.EndpointHandlerMapping]: Mapped "{[/loggers/{name:.*}],methods=[POST],consumes=[application/vnd.spring-boot.actuator.v1+json || application/json],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.LoggersMvcEndpoint.set(java.lang.String,java.util.Map<java.lang.String, java.lang.String>)
2020-12-09 11:34:52 INFO [org.springframework.boot.actuate.endpoint.mvc.EndpointHandlerMapping]: Mapped "{[/loggers || /loggers.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2020-12-09 11:34:52 INFO [org.springframework.boot.actuate.endpoint.mvc.EndpointHandlerMapping]: Mapped "{[/mappings || /mappings.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2020-12-09 11:34:52 INFO [org.springframework.boot.actuate.endpoint.mvc.EndpointHandlerMapping]: Mapped "{[/autoconfig || /autoconfig.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2020-12-09 11:34:52 INFO [org.springframework.boot.actuate.endpoint.mvc.EndpointHandlerMapping]: Mapped "{[/heapdump || /heapdump.json],methods=[GET],produces=[application/octet-stream]}" onto public void org.springframework.boot.actuate.endpoint.mvc.HeapdumpMvcEndpoint.invoke(boolean,javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse) throws java.io.IOException,javax.servlet.ServletException
2020-12-09 11:34:52 INFO [org.springframework.boot.actuate.endpoint.mvc.EndpointHandlerMapping]: Mapped "{[/metrics/{name:.*}],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.MetricsMvcEndpoint.value(java.lang.String)
2020-12-09 11:34:52 INFO [org.springframework.boot.actuate.endpoint.mvc.EndpointHandlerMapping]: Mapped "{[/metrics || /metrics.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2020-12-09 11:34:52 INFO [org.springframework.boot.actuate.endpoint.mvc.EndpointHandlerMapping]: Mapped "{[/actuator || /actuator.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public org.springframework.hateoas.ResourceSupport org.springframework.boot.actuate.endpoint.mvc.HalJsonMvcEndpoint.links()
2020-12-09 11:34:52 INFO [org.springframework.boot.actuate.endpoint.mvc.EndpointHandlerMapping]: Mapped "{[/info || /info.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2020-12-09 11:34:52 INFO [org.springframework.boot.actuate.endpoint.mvc.EndpointHandlerMapping]: Mapped "{[/beans || /beans.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2020-12-09 11:34:52 INFO [org.springframework.boot.actuate.endpoint.mvc.EndpointHandlerMapping]: Mapped "{[/auditevents || /auditevents.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public org.springframework.http.ResponseEntity<?> org.springframework.boot.actuate.endpoint.mvc.AuditEventsMvcEndpoint.findByPrincipalAndAfterAndType(java.lang.String,java.util.Date,java.lang.String)
2020-12-09 11:34:52 INFO [org.springframework.boot.actuate.endpoint.mvc.EndpointHandlerMapping]: Mapped "{[/trace || /trace.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2020-12-09 11:34:52 INFO [org.springframework.boot.actuate.endpoint.mvc.EndpointHandlerMapping]: Mapped "{[/dump || /dump.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2020-12-09 11:34:53 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter]: Looking for @ControllerAdvice: org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@127a7a2e: startup date [Wed Dec 09 11:34:42 CST 2020]; root of context hierarchy
2020-12-09 11:34:53 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter]: Detected ResponseBodyAdvice bean in org.springframework.boot.actuate.autoconfigure.EndpointWebMvcHypermediaManagementContextConfiguration$ActuatorEndpointLinksAdvice
2020-12-09 11:34:53 INFO [org.springframework.web.servlet.handler.SimpleUrlHandlerMapping]: Mapped URL path [/webjars/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2020-12-09 11:34:53 INFO [org.springframework.web.servlet.handler.SimpleUrlHandlerMapping]: Mapped URL path [/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2020-12-09 11:34:53 INFO [org.springframework.web.servlet.mvc.method.annotation.ExceptionHandlerExceptionResolver]: Detected ResponseBodyAdvice implementation in org.springframework.boot.actuate.autoconfigure.EndpointWebMvcHypermediaManagementContextConfiguration$ActuatorEndpointLinksAdvice
2020-12-09 11:34:53 INFO [org.springframework.web.servlet.handler.SimpleUrlHandlerMapping]: Mapped URL path [/**/favicon.ico] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2020-12-09 11:34:54 INFO [org.springframework.jmx.export.annotation.AnnotationMBeanExporter]: Registering beans for JMX exposure on startup
2020-12-09 11:34:54 INFO [org.springframework.boot.actuate.endpoint.jmx.EndpointMBeanExporter]: Registering beans for JMX exposure on startup
2020-12-09 11:34:54 INFO [org.springframework.context.support.DefaultLifecycleProcessor]: Starting beans in phase 0
2020-12-09 11:34:54 INFO [org.springframework.boot.actuate.endpoint.jmx.EndpointMBeanExporter]: Located managed bean 'auditEventsEndpoint': registering with JMX server as MBean [org.springframework.boot:type=Endpoint,name=auditEventsEndpoint]
2020-12-09 11:34:54 INFO [org.springframework.boot.actuate.endpoint.jmx.EndpointMBeanExporter]: Located managed bean 'requestMappingEndpoint': registering with JMX server as MBean [org.springframework.boot:type=Endpoint,name=requestMappingEndpoint]
2020-12-09 11:34:54 INFO [org.springframework.boot.actuate.endpoint.jmx.EndpointMBeanExporter]: Located managed bean 'environmentEndpoint': registering with JMX server as MBean [org.springframework.boot:type=Endpoint,name=environmentEndpoint]
2020-12-09 11:34:54 INFO [org.springframework.boot.actuate.endpoint.jmx.EndpointMBeanExporter]: Located managed bean 'healthEndpoint': registering with JMX server as MBean [org.springframework.boot:type=Endpoint,name=healthEndpoint]
2020-12-09 11:34:54 INFO [org.springframework.boot.actuate.endpoint.jmx.EndpointMBeanExporter]: Located managed bean 'beansEndpoint': registering with JMX server as MBean [org.springframework.boot:type=Endpoint,name=beansEndpoint]
2020-12-09 11:34:54 INFO [org.springframework.boot.actuate.endpoint.jmx.EndpointMBeanExporter]: Located managed bean 'infoEndpoint': registering with JMX server as MBean [org.springframework.boot:type=Endpoint,name=infoEndpoint]
2020-12-09 11:34:54 INFO [org.springframework.boot.actuate.endpoint.jmx.EndpointMBeanExporter]: Located managed bean 'loggersEndpoint': registering with JMX server as MBean [org.springframework.boot:type=Endpoint,name=loggersEndpoint]
2020-12-09 11:34:54 INFO [org.springframework.boot.actuate.endpoint.jmx.EndpointMBeanExporter]: Located managed bean 'metricsEndpoint': registering with JMX server as MBean [org.springframework.boot:type=Endpoint,name=metricsEndpoint]
2020-12-09 11:34:54 INFO [org.springframework.boot.actuate.endpoint.jmx.EndpointMBeanExporter]: Located managed bean 'traceEndpoint': registering with JMX server as MBean [org.springframework.boot:type=Endpoint,name=traceEndpoint]
2020-12-09 11:34:54 INFO [org.springframework.boot.actuate.endpoint.jmx.EndpointMBeanExporter]: Located managed bean 'dumpEndpoint': registering with JMX server as MBean [org.springframework.boot:type=Endpoint,name=dumpEndpoint]
2020-12-09 11:34:54 INFO [org.springframework.boot.actuate.endpoint.jmx.EndpointMBeanExporter]: Located managed bean 'autoConfigurationReportEndpoint': registering with JMX server as MBean [org.springframework.boot:type=Endpoint,name=autoConfigurationReportEndpoint]
2020-12-09 11:34:54 INFO [org.springframework.boot.actuate.endpoint.jmx.EndpointMBeanExporter]: Located managed bean 'configurationPropertiesReportEndpoint': registering with JMX server as MBean [org.springframework.boot:type=Endpoint,name=configurationPropertiesReportEndpoint]
2020-12-09 11:34:55 INFO [org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer]: Tomcat started on port(s): 8800 (http)
2020-12-09 11:34:55 INFO [saleDetail]: [updateSaleDetailQueue] 刷新报表队列 当前长度:0
2020-12-09 11:34:55 INFO [com.yutu.base.TestSpringApplication]: Started TestSpringApplication in 14.283 seconds (JVM running for 17.606)
2020-12-09 11:36:36 INFO [org.springframework.web.servlet.DispatcherServlet]: FrameworkServlet 'dispatcherServlet': initialization started
2020-12-09 11:36:38 INFO [org.springframework.web.servlet.DispatcherServlet]: FrameworkServlet 'dispatcherServlet': initialization completed in 2304 ms
2020-12-09 11:59:58 INFO [org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext]: Closing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@127a7a2e: startup date [Wed Dec 09 11:34:42 CST 2020]; root of context hierarchy
2020-12-09 11:59:58 INFO [org.springframework.context.support.DefaultLifecycleProcessor]: Stopping beans in phase 0
2020-12-09 11:59:58 INFO [org.springframework.boot.actuate.endpoint.jmx.EndpointMBeanExporter]: Unregistering JMX-exposed beans on shutdown
2020-12-09 11:59:58 INFO [org.springframework.boot.actuate.endpoint.jmx.EndpointMBeanExporter]: Unregistering JMX-exposed beans
2020-12-09 11:59:58 INFO [org.springframework.jmx.export.annotation.AnnotationMBeanExporter]: Unregistering JMX-exposed beans on shutdown
2021-03-08 16:25:50 INFO [com.yutu.base.TestSpringApplication]: Starting TestSpringApplication on WANGYU-YUTU with PID 17380 (D:\Work\Workspaces\yutu\iffs-files-services\target\classes started by stjim in D:\Work\Workspaces\yutu\iffs-files-services)
2021-03-08 16:25:50 INFO [com.yutu.base.TestSpringApplication]: The following profiles are active: test
2021-03-08 16:25:50 INFO [org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext]: Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@1187c9e8: startup date [Mon Mar 08 16:25:50 CST 2021]; root of context hierarchy
2021-03-08 16:25:53 INFO [org.hibernate.validator.internal.util.Version]: HV000001: Hibernate Validator 5.3.5.Final
2021-03-08 16:26:00 INFO [org.springframework.beans.factory.support.DefaultListableBeanFactory]: Overriding bean definition for bean 'managementServletContext' with a different definition: replacing [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.boot.actuate.autoconfigure.EndpointWebMvcHypermediaManagementContextConfiguration; factoryMethodName=managementServletContext; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/boot/actuate/autoconfigure/EndpointWebMvcHypermediaManagementContextConfiguration.class]] with [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.boot.actuate.autoconfigure.EndpointWebMvcAutoConfiguration; factoryMethodName=managementServletContext; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/boot/actuate/autoconfigure/EndpointWebMvcAutoConfiguration.class]]
2021-03-08 16:26:05 INFO [org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer]: Tomcat initialized with port(s): 8066 (http)
2021-03-08 16:26:06 INFO [org.springframework.web.context.ContextLoader]: Root WebApplicationContext: initialization completed in 15511 ms
2021-03-08 16:26:11 INFO [org.springframework.boot.web.servlet.ServletRegistrationBean]: Mapping servlet: 'dispatcherServlet' to [/]
2021-03-08 16:26:11 INFO [org.springframework.boot.web.servlet.FilterRegistrationBean]: Mapping filter: 'metricsFilter' to: [/*]
2021-03-08 16:26:11 INFO [org.springframework.boot.web.servlet.FilterRegistrationBean]: Mapping filter: 'characterEncodingFilter' to: [/*]
2021-03-08 16:26:11 INFO [org.springframework.boot.web.servlet.FilterRegistrationBean]: Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
2021-03-08 16:26:11 INFO [org.springframework.boot.web.servlet.FilterRegistrationBean]: Mapping filter: 'httpPutFormContentFilter' to: [/*]
2021-03-08 16:26:11 INFO [org.springframework.boot.web.servlet.FilterRegistrationBean]: Mapping filter: 'requestContextFilter' to: [/*]
2021-03-08 16:26:11 INFO [org.springframework.boot.web.servlet.FilterRegistrationBean]: Mapping filter: 'webRequestLoggingFilter' to: [/*]
2021-03-08 16:26:11 INFO [org.springframework.boot.web.servlet.FilterRegistrationBean]: Mapping filter: 'applicationContextIdFilter' to: [/*]
2021-03-08 16:26:16 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping]: Mapped "{[/files/download/saleDetailReport.do],methods=[POST]}" onto public com.yutu.base.entity.Response com.yutu.base.controller.DownLoadController.saleDetailReport(java.lang.String)
2021-03-08 16:26:16 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping]: Mapped "{[/files/download/getSaleDetailData.do],methods=[POST]}" onto public com.yutu.base.entity.Response com.yutu.base.controller.DownLoadController.getSaleDetail(java.lang.String)
2021-03-08 16:26:16 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping]: Mapped "{[/files/saleDetail/updateSaleDetail],methods=[POST]}" onto public com.yutu.base.entity.Response com.yutu.base.controller.DownLoadController.updateSaleDetail(java.lang.String)
2021-03-08 16:26:16 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping]: Mapped "{[/files/order/exportOrderInfo],methods=[POST]}" onto public com.yutu.base.entity.Response com.yutu.base.controller.DownLoadController.exportOrderInfo(java.lang.String)
2021-03-08 16:26:16 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping]: Mapped "{[/files/privateFreight/download.do],methods=[POST]}" onto public com.yutu.base.entity.Response com.yutu.base.controller.DownLoadController.exportPrivateFreight(java.lang.String)
2021-03-08 16:26:16 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping]: Mapped "{[/files/download/saleRules.do],methods=[POST]}" onto public com.yutu.base.entity.Response com.yutu.base.controller.DownLoadController.downLoadSaleRules(java.lang.String)
2021-03-08 16:26:16 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping]: Mapped "{[/files/download/saleDetailReportFromAutoSource.do],methods=[POST]}" onto public com.yutu.base.entity.Response com.yutu.base.controller.DownLoadController.saleDetailReportFromAutoSource(java.lang.String)
2021-03-08 16:26:16 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping]: Mapped "{[/files/parse/toSaleDetail],methods=[POST]}" onto public com.yutu.base.entity.Response com.yutu.base.controller.DownLoadController.parseToSaleDetail(java.lang.String)
2021-03-08 16:26:16 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping]: Mapped "{[/test],methods=[GET]}" onto public java.lang.String com.yutu.base.controller.TestController.test()
2021-03-08 16:26:16 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping]: Mapped "{[/files/upload/saleRules.do],methods=[POST]}" onto public com.yutu.base.entity.Response com.yutu.base.controller.UploadController.uploadSaleRules(java.lang.String)
2021-03-08 16:26:16 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping]: Mapped "{[/files/privateFreight/upload.do],methods=[POST]}" onto public com.yutu.base.entity.Response com.yutu.base.controller.UploadController.uploadPrivateFreight(java.lang.String)
2021-03-08 16:26:16 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping]: Mapped "{[/v2/api-docs],methods=[GET]}" onto public org.springframework.http.ResponseEntity<springfox.documentation.spring.web.json.Json> springfox.documentation.swagger2.web.Swagger2Controller.getDocumentation(java.lang.String)
2021-03-08 16:26:16 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping]: Mapped "{[/configuration/security]}" onto org.springframework.http.ResponseEntity<springfox.documentation.swagger.web.SecurityConfiguration> springfox.documentation.swagger.web.ApiResourceController.securityConfiguration()
2021-03-08 16:26:16 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping]: Mapped "{[/swagger-resources]}" onto org.springframework.http.ResponseEntity<java.util.List<springfox.documentation.swagger.web.SwaggerResource>> springfox.documentation.swagger.web.ApiResourceController.swaggerResources()
2021-03-08 16:26:16 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping]: Mapped "{[/configuration/ui]}" onto org.springframework.http.ResponseEntity<springfox.documentation.swagger.web.UiConfiguration> springfox.documentation.swagger.web.ApiResourceController.uiConfiguration()
2021-03-08 16:26:16 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping]: Mapped "{[/error]}" onto public org.springframework.http.ResponseEntity<java.util.Map<java.lang.String, java.lang.Object>> org.springframework.boot.autoconfigure.web.BasicErrorController.error(javax.servlet.http.HttpServletRequest)
2021-03-08 16:26:16 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping]: Mapped "{[/error],produces=[text/html]}" onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)
2021-03-08 16:26:18 INFO [org.springframework.boot.actuate.endpoint.mvc.EndpointHandlerMapping]: Mapped "{[/info || /info.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2021-03-08 16:26:18 INFO [org.springframework.boot.actuate.endpoint.mvc.EndpointHandlerMapping]: Mapped "{[/loggers/{name:.*}],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.LoggersMvcEndpoint.get(java.lang.String)
2021-03-08 16:26:18 INFO [org.springframework.boot.actuate.endpoint.mvc.EndpointHandlerMapping]: Mapped "{[/loggers/{name:.*}],methods=[POST],consumes=[application/vnd.spring-boot.actuator.v1+json || application/json],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.LoggersMvcEndpoint.set(java.lang.String,java.util.Map<java.lang.String, java.lang.String>)
2021-03-08 16:26:18 INFO [org.springframework.boot.actuate.endpoint.mvc.EndpointHandlerMapping]: Mapped "{[/loggers || /loggers.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2021-03-08 16:26:18 INFO [org.springframework.boot.actuate.endpoint.mvc.EndpointHandlerMapping]: Mapped "{[/trace || /trace.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2021-03-08 16:26:18 INFO [org.springframework.boot.actuate.endpoint.mvc.EndpointHandlerMapping]: Mapped "{[/auditevents || /auditevents.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public org.springframework.http.ResponseEntity<?> org.springframework.boot.actuate.endpoint.mvc.AuditEventsMvcEndpoint.findByPrincipalAndAfterAndType(java.lang.String,java.util.Date,java.lang.String)
2021-03-08 16:26:18 INFO [org.springframework.boot.actuate.endpoint.mvc.EndpointHandlerMapping]: Mapped "{[/autoconfig || /autoconfig.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2021-03-08 16:26:18 INFO [org.springframework.boot.actuate.endpoint.mvc.EndpointHandlerMapping]: Mapped "{[/env/{name:.*}],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EnvironmentMvcEndpoint.value(java.lang.String)
2021-03-08 16:26:18 INFO [org.springframework.boot.actuate.endpoint.mvc.EndpointHandlerMapping]: Mapped "{[/env || /env.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2021-03-08 16:26:18 INFO [org.springframework.boot.actuate.endpoint.mvc.EndpointHandlerMapping]: Mapped "{[/metrics/{name:.*}],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.MetricsMvcEndpoint.value(java.lang.String)
2021-03-08 16:26:18 INFO [org.springframework.boot.actuate.endpoint.mvc.EndpointHandlerMapping]: Mapped "{[/metrics || /metrics.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2021-03-08 16:26:18 INFO [org.springframework.boot.actuate.endpoint.mvc.EndpointHandlerMapping]: Mapped "{[/beans || /beans.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2021-03-08 16:26:18 INFO [org.springframework.boot.actuate.endpoint.mvc.EndpointHandlerMapping]: Mapped "{[/configprops || /configprops.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2021-03-08 16:26:18 INFO [org.springframework.boot.actuate.endpoint.mvc.EndpointHandlerMapping]: Mapped "{[/heapdump || /heapdump.json],methods=[GET],produces=[application/octet-stream]}" onto public void org.springframework.boot.actuate.endpoint.mvc.HeapdumpMvcEndpoint.invoke(boolean,javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse) throws java.io.IOException,javax.servlet.ServletException
2021-03-08 16:26:18 INFO [org.springframework.boot.actuate.endpoint.mvc.EndpointHandlerMapping]: Mapped "{[/dump || /dump.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2021-03-08 16:26:18 INFO [org.springframework.boot.actuate.endpoint.mvc.EndpointHandlerMapping]: Mapped "{[/mappings || /mappings.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2021-03-08 16:26:18 INFO [org.springframework.boot.actuate.endpoint.mvc.EndpointHandlerMapping]: Mapped "{[/actuator || /actuator.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public org.springframework.hateoas.ResourceSupport org.springframework.boot.actuate.endpoint.mvc.HalJsonMvcEndpoint.links()
2021-03-08 16:26:18 INFO [org.springframework.boot.actuate.endpoint.mvc.EndpointHandlerMapping]: Mapped "{[/health || /health.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.HealthMvcEndpoint.invoke(javax.servlet.http.HttpServletRequest,java.security.Principal)
2021-03-08 16:26:22 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter]: Looking for @ControllerAdvice: org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@1187c9e8: startup date [Mon Mar 08 16:25:50 CST 2021]; root of context hierarchy
2021-03-08 16:26:23 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter]: Detected ResponseBodyAdvice bean in org.springframework.boot.actuate.autoconfigure.EndpointWebMvcHypermediaManagementContextConfiguration$ActuatorEndpointLinksAdvice
2021-03-08 16:26:23 INFO [org.springframework.web.servlet.handler.SimpleUrlHandlerMapping]: Mapped URL path [/webjars/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2021-03-08 16:26:23 INFO [org.springframework.web.servlet.handler.SimpleUrlHandlerMapping]: Mapped URL path [/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2021-03-08 16:26:23 INFO [org.springframework.web.servlet.mvc.method.annotation.ExceptionHandlerExceptionResolver]: Detected ResponseBodyAdvice implementation in org.springframework.boot.actuate.autoconfigure.EndpointWebMvcHypermediaManagementContextConfiguration$ActuatorEndpointLinksAdvice
2021-03-08 16:26:23 INFO [org.springframework.web.servlet.handler.SimpleUrlHandlerMapping]: Mapped URL path [/**/favicon.ico] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2021-03-08 16:26:25 INFO [org.springframework.jmx.export.annotation.AnnotationMBeanExporter]: Registering beans for JMX exposure on startup
2021-03-08 16:26:25 INFO [org.springframework.boot.actuate.endpoint.jmx.EndpointMBeanExporter]: Registering beans for JMX exposure on startup
2021-03-08 16:26:25 INFO [org.springframework.context.support.DefaultLifecycleProcessor]: Starting beans in phase 0
2021-03-08 16:26:25 INFO [org.springframework.boot.actuate.endpoint.jmx.EndpointMBeanExporter]: Located managed bean 'auditEventsEndpoint': registering with JMX server as MBean [org.springframework.boot:type=Endpoint,name=auditEventsEndpoint]
2021-03-08 16:26:25 INFO [org.springframework.boot.actuate.endpoint.jmx.EndpointMBeanExporter]: Located managed bean 'requestMappingEndpoint': registering with JMX server as MBean [org.springframework.boot:type=Endpoint,name=requestMappingEndpoint]
2021-03-08 16:26:26 INFO [org.springframework.boot.actuate.endpoint.jmx.EndpointMBeanExporter]: Located managed bean 'environmentEndpoint': registering with JMX server as MBean [org.springframework.boot:type=Endpoint,name=environmentEndpoint]
2021-03-08 16:26:26 INFO [org.springframework.boot.actuate.endpoint.jmx.EndpointMBeanExporter]: Located managed bean 'healthEndpoint': registering with JMX server as MBean [org.springframework.boot:type=Endpoint,name=healthEndpoint]
2021-03-08 16:26:26 INFO [org.springframework.boot.actuate.endpoint.jmx.EndpointMBeanExporter]: Located managed bean 'beansEndpoint': registering with JMX server as MBean [org.springframework.boot:type=Endpoint,name=beansEndpoint]
2021-03-08 16:26:26 INFO [org.springframework.boot.actuate.endpoint.jmx.EndpointMBeanExporter]: Located managed bean 'infoEndpoint': registering with JMX server as MBean [org.springframework.boot:type=Endpoint,name=infoEndpoint]
2021-03-08 16:26:26 INFO [org.springframework.boot.actuate.endpoint.jmx.EndpointMBeanExporter]: Located managed bean 'loggersEndpoint': registering with JMX server as MBean [org.springframework.boot:type=Endpoint,name=loggersEndpoint]
2021-03-08 16:26:26 INFO [org.springframework.boot.actuate.endpoint.jmx.EndpointMBeanExporter]: Located managed bean 'metricsEndpoint': registering with JMX server as MBean [org.springframework.boot:type=Endpoint,name=metricsEndpoint]
2021-03-08 16:26:26 INFO [org.springframework.boot.actuate.endpoint.jmx.EndpointMBeanExporter]: Located managed bean 'traceEndpoint': registering with JMX server as MBean [org.springframework.boot:type=Endpoint,name=traceEndpoint]
2021-03-08 16:26:26 INFO [org.springframework.boot.actuate.endpoint.jmx.EndpointMBeanExporter]: Located managed bean 'dumpEndpoint': registering with JMX server as MBean [org.springframework.boot:type=Endpoint,name=dumpEndpoint]
2021-03-08 16:26:26 INFO [org.springframework.boot.actuate.endpoint.jmx.EndpointMBeanExporter]: Located managed bean 'autoConfigurationReportEndpoint': registering with JMX server as MBean [org.springframework.boot:type=Endpoint,name=autoConfigurationReportEndpoint]
2021-03-08 16:26:26 INFO [org.springframework.boot.actuate.endpoint.jmx.EndpointMBeanExporter]: Located managed bean 'configurationPropertiesReportEndpoint': registering with JMX server as MBean [org.springframework.boot:type=Endpoint,name=configurationPropertiesReportEndpoint]
2021-03-08 16:26:29 INFO [org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer]: Tomcat started on port(s): 8066 (http)
2021-03-08 16:26:29 INFO [com.yutu.base.TestSpringApplication]: Started TestSpringApplication in 43.433 seconds (JVM running for 54.856)
2021-03-08 16:26:29 INFO [saleDetail]: [updateSaleDetailQueue] 刷新报表队列 当前长度:0
2021-03-08 16:27:00 INFO [org.springframework.web.servlet.DispatcherServlet]: FrameworkServlet 'dispatcherServlet': initialization started
2021-03-08 16:27:00 INFO [org.springframework.web.servlet.DispatcherServlet]: FrameworkServlet 'dispatcherServlet': initialization completed in 126 ms
2021-03-08 17:40:12 INFO [org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext]: Closing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@1187c9e8: startup date [Mon Mar 08 16:25:50 CST 2021]; root of context hierarchy
2021-03-08 17:40:12 INFO [org.springframework.context.support.DefaultLifecycleProcessor]: Stopping beans in phase 0
2021-03-08 17:40:13 INFO [org.springframework.boot.actuate.endpoint.jmx.EndpointMBeanExporter]: Unregistering JMX-exposed beans on shutdown
2021-03-08 17:40:13 INFO [org.springframework.boot.actuate.endpoint.jmx.EndpointMBeanExporter]: Unregistering JMX-exposed beans
2021-03-08 17:40:13 INFO [org.springframework.jmx.export.annotation.AnnotationMBeanExporter]: Unregistering JMX-exposed beans on shutdown
[INFO]2020-12-09 11:59:21[run][执行新增 SaleLog 数量:1条! 成功:1条! 耗时长:618ms,剩余0条日志数据]
[INFO]2020-12-09 11:59:27[run][执行新增 SaleLog 数量:1条! 成功:1条! 耗时长:4205ms,剩余0条日志数据]
\ No newline at end of file
[INFO]2020-12-09 11:36:50[uploadSaleRules][上传销售规则,参数:{"customerId":"2cb3aa90-7530-11e9-b14b-c81f66ba6a47","filePath":"D:\\\\webService\\\\overseasCheetah_ExcelFile/2cb3aa90-7530-11e9-b14b-c81f66ba6a47/SalesRulesUpLoad/20201209\\1607483667248workpolicy.xlsx","operator":"%E7%8E%8B%E7%A6%B9"}]
[ERROR]2020-12-09 11:39:09[uploadSaleRules][UpLoadExcelSaleRulesInsert Failed.[uploadInsert],[NoteResult]:{}{"errorMessage":"数据异常","status":"FAILED"}]java.lang.NumberFormatException: For input string: "2019-06-25T14:41:16.000+0000"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Long.parseLong(Long.java:589)
at java.lang.Long.parseLong(Long.java:631)
at com.alibaba.fastjson.parser.deserializer.TimestampDeserializer.cast(TimestampDeserializer.java:46)
at com.alibaba.fastjson.parser.deserializer.AbstractDateDeserializer.deserialze(AbstractDateDeserializer.java:98)
at Fastjson_ASM_SaleStore_1.deserialze(Unknown Source)
at com.alibaba.fastjson.parser.DefaultJSONParser.parseArray(DefaultJSONParser.java:630)
at com.alibaba.fastjson.parser.DefaultJSONParser.parseArray(DefaultJSONParser.java:566)
at com.alibaba.fastjson.parser.DefaultJSONParser.parseArray(DefaultJSONParser.java:561)
at com.alibaba.fastjson.JSON.parseArray(JSON.java:347)
at com.yutu.base.service.UploadService.uploadSaleRules(UploadService.java:63)
at com.yutu.base.controller.UploadController.uploadSaleRules(UploadController.java:23)
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:133)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:97)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:967)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:901)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:872)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:661)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.boot.web.filter.ApplicationContextHeaderFilter.doFilterInternal(ApplicationContextHeaderFilter.java:55)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.boot.actuate.trace.WebRequestTraceFilter.doFilterInternal(WebRequestTraceFilter.java:110)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.web.filter.HttpPutFormContentFilter.doFilterInternal(HttpPutFormContentFilter.java:105)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:81)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.boot.actuate.autoconfigure.MetricsFilter.doFilterInternal(MetricsFilter.java:106)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:478)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:80)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:799)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:861)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1455)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)
[INFO]2020-12-09 11:39:28[uploadSaleRules][上传结果:Response{status=FAILED, errorMessage='数据异常', data=null}]
[INFO]2020-12-09 11:39:41[uploadSaleRules][上传销售规则,参数:{"customerId":"2cb3aa90-7530-11e9-b14b-c81f66ba6a47","filePath":"D:\\\\webService\\\\overseasCheetah_ExcelFile/2cb3aa90-7530-11e9-b14b-c81f66ba6a47/SalesRulesUpLoad/20201209\\1607483667248workpolicy.xlsx","operator":"%E7%8E%8B%E7%A6%B9"}]
[ERROR]2020-12-09 11:41:37[uploadSaleRules][UpLoadExcelSaleRulesInsert Failed.[uploadInsert],[NoteResult]:{}{"errorMessage":"数据异常","status":"FAILED"}]java.lang.NumberFormatException: For input string: "2019-06-25T14:41:16.000+0000"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Long.parseLong(Long.java:589)
at java.lang.Long.parseLong(Long.java:631)
at com.alibaba.fastjson.parser.deserializer.TimestampDeserializer.cast(TimestampDeserializer.java:46)
at com.alibaba.fastjson.parser.deserializer.AbstractDateDeserializer.deserialze(AbstractDateDeserializer.java:98)
at Fastjson_ASM_SaleStore_1.deserialze(Unknown Source)
at com.alibaba.fastjson.parser.DefaultJSONParser.parseArray(DefaultJSONParser.java:630)
at com.alibaba.fastjson.parser.DefaultJSONParser.parseArray(DefaultJSONParser.java:566)
at com.alibaba.fastjson.parser.DefaultJSONParser.parseArray(DefaultJSONParser.java:561)
at com.alibaba.fastjson.JSON.parseArray(JSON.java:347)
at com.yutu.base.service.UploadService.uploadSaleRules(UploadService.java:63)
at com.yutu.base.controller.UploadController.uploadSaleRules(UploadController.java:23)
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:133)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:97)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:967)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:901)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:872)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:661)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.boot.web.filter.ApplicationContextHeaderFilter.doFilterInternal(ApplicationContextHeaderFilter.java:55)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.boot.actuate.trace.WebRequestTraceFilter.doFilterInternal(WebRequestTraceFilter.java:110)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.web.filter.HttpPutFormContentFilter.doFilterInternal(HttpPutFormContentFilter.java:105)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:81)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.boot.actuate.autoconfigure.MetricsFilter.doFilterInternal(MetricsFilter.java:106)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:478)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:80)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:799)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:861)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1455)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)
[INFO]2020-12-09 11:41:37[uploadSaleRules][上传结果:Response{status=FAILED, errorMessage='数据异常', data=null}]
[INFO]2020-12-09 11:41:52[uploadSaleRules][上传销售规则,参数:{"customerId":"2cb3aa90-7530-11e9-b14b-c81f66ba6a47","filePath":"D:\\\\webService\\\\overseasCheetah_ExcelFile/2cb3aa90-7530-11e9-b14b-c81f66ba6a47/SalesRulesUpLoad/20201209\\1607483667248workpolicy.xlsx","operator":"%E7%8E%8B%E7%A6%B9"}]
[ERROR]2020-12-09 11:44:50[uploadSaleRules][UpLoadExcelSaleRulesInsert Failed.[uploadInsert],[NoteResult]:{}{"errorMessage":"数据异常","status":"FAILED"}]java.lang.NumberFormatException: For input string: "2019-06-25T14:41:16.000+0000"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Long.parseLong(Long.java:589)
at java.lang.Long.parseLong(Long.java:631)
at com.alibaba.fastjson.parser.deserializer.TimestampDeserializer.cast(TimestampDeserializer.java:46)
at com.alibaba.fastjson.parser.deserializer.AbstractDateDeserializer.deserialze(AbstractDateDeserializer.java:98)
at Fastjson_ASM_SaleStore_1.deserialze(Unknown Source)
at com.alibaba.fastjson.parser.DefaultJSONParser.parseArray(DefaultJSONParser.java:630)
at com.alibaba.fastjson.parser.DefaultJSONParser.parseArray(DefaultJSONParser.java:566)
at com.alibaba.fastjson.parser.DefaultJSONParser.parseArray(DefaultJSONParser.java:561)
at com.alibaba.fastjson.JSON.parseArray(JSON.java:347)
at com.yutu.base.service.UploadService.uploadSaleRules(UploadService.java:63)
at com.yutu.base.controller.UploadController.uploadSaleRules(UploadController.java:23)
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:133)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:97)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:967)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:901)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:872)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:661)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.boot.web.filter.ApplicationContextHeaderFilter.doFilterInternal(ApplicationContextHeaderFilter.java:55)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.boot.actuate.trace.WebRequestTraceFilter.doFilterInternal(WebRequestTraceFilter.java:110)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.web.filter.HttpPutFormContentFilter.doFilterInternal(HttpPutFormContentFilter.java:105)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:81)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.boot.actuate.autoconfigure.MetricsFilter.doFilterInternal(MetricsFilter.java:106)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:478)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:80)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:799)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:861)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1455)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)
[INFO]2020-12-09 11:45:03[uploadSaleRules][上传结果:Response{status=FAILED, errorMessage='数据异常', data=null}]
[INFO]2020-12-09 11:45:14[uploadSaleRules][上传销售规则,参数:{"customerId":"2cb3aa90-7530-11e9-b14b-c81f66ba6a47","filePath":"D:\\\\webService\\\\overseasCheetah_ExcelFile/2cb3aa90-7530-11e9-b14b-c81f66ba6a47/SalesRulesUpLoad/20201209\\1607483667248workpolicy.xlsx","operator":"%E7%8E%8B%E7%A6%B9"}]
[INFO]2020-12-09 11:58:38[uploadSaleRules][获取数据库全部已有 Id,总用时:49204 ms]
[INFO]2020-12-09 11:58:46[uploadSaleRules][本次导入数据:2条--%E7%8E%8B%E7%A6%B9]
[INFO]2020-12-09 11:59:06[uploadSaleRules][待插入数据:2条]
[INFO]2020-12-09 11:59:58[saveSaleRulesBatch][批量新增成功,数量:2]
[INFO]2020-12-09 11:59:58[uploadSaleRules][已插入数据:2条,总用时:32747ms]
[INFO]2020-12-09 11:59:58[uploadSaleRules][待更新数据:0条]
[INFO]2020-12-09 11:59:58[uploadSaleRules][上传结果:Response{status=SUCCEED, errorMessage='null', data=文件上传成功,数据导入成功!}]
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="Spring" name="Spring">
<configuration />
</facet>
<facet type="web" name="Web">
<configuration>
<webroots />
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter:1.5.4.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot:1.5.4.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-context:4.3.9.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-autoconfigure:1.5.4.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-core:4.3.9.RELEASE" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Maven: org.yaml:snakeyaml:1.17" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-web:1.5.4.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-tomcat:1.5.4.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-core:8.5.15" level="project" />
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-el:8.5.15" level="project" />
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-websocket:8.5.15" level="project" />
<orderEntry type="library" name="Maven: org.hibernate:hibernate-validator:5.3.5.Final" level="project" />
<orderEntry type="library" name="Maven: javax.validation:validation-api:1.1.0.Final" level="project" />
<orderEntry type="library" name="Maven: org.jboss.logging:jboss-logging:3.3.1.Final" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.8.8" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.8.0" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.8.8" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-web:4.3.9.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-aop:4.3.9.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-beans:4.3.9.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-webmvc:4.3.9.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-expression:4.3.9.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-configuration-processor:1.5.4.RELEASE" level="project" />
<orderEntry type="library" name="Maven: com.vaadin.external.google:android-json:0.0.20131108.vaadin1" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-test:4.3.12.RELEASE" level="project" />
<orderEntry type="library" name="Maven: com.alibaba:fastjson:1.1.43" level="project" />
<orderEntry type="library" name="Maven: dom4j:dom4j:1.6" level="project" />
<orderEntry type="library" name="Maven: xml-apis:xml-apis:1.4.01" level="project" />
<orderEntry type="library" name="Maven: io.springfox:springfox-swagger2:2.2.2" level="project" />
<orderEntry type="library" name="Maven: org.mapstruct:mapstruct:1.0.0.CR1" level="project" />
<orderEntry type="library" name="Maven: io.swagger:swagger-annotations:1.5.3" level="project" />
<orderEntry type="library" name="Maven: io.swagger:swagger-models:1.5.3" level="project" />
<orderEntry type="library" name="Maven: io.springfox:springfox-spi:2.2.2" level="project" />
<orderEntry type="library" name="Maven: io.springfox:springfox-core:2.2.2" level="project" />
<orderEntry type="library" name="Maven: io.springfox:springfox-schema:2.2.2" level="project" />
<orderEntry type="library" name="Maven: io.springfox:springfox-swagger-common:2.2.2" level="project" />
<orderEntry type="library" name="Maven: io.springfox:springfox-spring-web:2.2.2" level="project" />
<orderEntry type="library" name="Maven: com.google.guava:guava:18.0" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml:classmate:1.3.3" level="project" />
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.25" level="project" />
<orderEntry type="library" name="Maven: org.aspectj:aspectjrt:1.8.10" level="project" />
<orderEntry type="library" name="Maven: org.aspectj:aspectjweaver:1.8.10" level="project" />
<orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-core:1.2.0.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-metadata:1.2.0.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.hateoas:spring-hateoas:0.23.0.RELEASE" level="project" />
<orderEntry type="library" name="Maven: io.springfox:springfox-swagger-ui:2.2.2" level="project" />
<orderEntry type="library" name="Maven: log4j:log4j:1.2.17" level="project" />
<orderEntry type="library" name="Maven: org.slf4j:slf4j-nop:1.7.24" level="project" />
<orderEntry type="library" name="Maven: commons-logging:commons-logging:1.1.1" level="project" />
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpclient:4.5.6" level="project" />
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore:4.4.6" level="project" />
<orderEntry type="library" name="Maven: commons-codec:commons-codec:1.10" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-lang3:3.4" level="project" />
<orderEntry type="library" name="Maven: commons-httpclient:commons-httpclient:3.1" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-actuator:1.5.4.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-actuator:1.5.4.RELEASE" level="project" />
<orderEntry type="library" name="Maven: net.sourceforge.jexcelapi:jxl:2.6.12" level="project" />
<orderEntry type="library" name="Maven: org.apache.poi:poi:3.17" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-collections4:4.1" level="project" />
<orderEntry type="library" name="Maven: org.apache.poi:poi-ooxml:3.17" level="project" />
<orderEntry type="library" name="Maven: org.apache.poi:poi-ooxml-schemas:3.17" level="project" />
<orderEntry type="library" name="Maven: org.apache.xmlbeans:xmlbeans:2.6.0" level="project" />
<orderEntry type="library" name="Maven: stax:stax-api:1.0.1" level="project" />
<orderEntry type="library" name="Maven: com.github.virtuald:curvesapi:1.04" level="project" />
</component>
</module>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>polestar-files-services</groupId>
<artifactId>polestar-files-services</artifactId>
<version>1.0.15</version>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.4.RELEASE</version>
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
</properties>
<dependencies>
<!--用于指定排除spring-boot-starter中的spring-boot-starter-logging日志依赖
然后引入自己的所选的日志依赖 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<!--spring-boot-web依赖-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!-- spring-boot-configuration-processor:
在代码中轻松的使用@ConfigurationProperties注解注入属性文件配置的属性值
-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>4.3.12.RELEASE</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.1.43</version>
</dependency>
<dependency>
<groupId>dom4j</groupId>
<artifactId>dom4j</artifactId>
<version>1.6</version>
</dependency>
<!-- spring-swagger -->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.2.2</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.2.2</version>
</dependency>
<!-- log4j日志 -->
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-nop</artifactId>
<version>1.7.24</version>
</dependency>
<!-- https://mvnrepository.com/artifact/commons-logging/commons-logging -->
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.6</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.4</version>
</dependency>
<dependency>
<groupId>commons-httpclient</groupId>
<artifactId>commons-httpclient</artifactId>
<version>3.1</version>
</dependency>
<!--spring-boot健康检查-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<!--jxl操作Ecxel相关-->
<dependency>
<groupId>net.sourceforge.jexcelapi</groupId>
<artifactId>jxl</artifactId>
<version>2.6.12</version>
</dependency>
<!--poi操作Ecxel相关-->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.17</version>
</dependency>
<!--poi在3.7版本以后WorkbookFactory等类加载必须引入-->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.17</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
\ No newline at end of file
Manifest-Version: 1.0
Main-Class: com.yutu.base.TestSpringApplication
package com.yutu.base;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
/**
* 入口类
*/
@EnableSwagger2
@RestController
@SpringBootApplication(scanBasePackages="com.yutu.base")
public class TestSpringApplication {
public static void main(String[] args) {
SpringApplication.run(TestSpringApplication.class, args);
}
}
package com.yutu.base.controller;
import com.yutu.base.entity.Response;
import com.yutu.base.entity.SaleDetail;
import com.yutu.base.service.DownLoadService;
import com.yutu.base.service.OrderService;
import com.yutu.base.service.PrivateFreightService;
import com.yutu.base.service.SaleDetailService;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("files/")
public class DownLoadController {
private Logger logger = Logger.getLogger("download");
@Autowired
private DownLoadService downLoadService;
@Autowired
private SaleDetailService saleDetailService;
@Autowired
private OrderService orderService;
@Autowired
private PrivateFreightService privateFreightService;
/**
* 获取销售数据
* @param requestBody
* @return
*/
@RequestMapping(value = "download/getSaleDetailData.do",method = RequestMethod.POST)
public Response getSaleDetail(@RequestBody String requestBody){
return downLoadService.getSaleDetailReportData(requestBody);
}
/**
* 下载销售报表
* @param requestBody
* @return
*/
@RequestMapping(value = "download/saleDetailReport.do",method = RequestMethod.POST)
public Response saleDetailReport(@RequestBody String requestBody){
return downLoadService.downLoadSaleDetailReport(requestBody);
}
/**
* 下载销售报表(符合查询条件时,直接从数据库SaleDetail表中直接下载获取报表数据)
* @param requestBody
* @return
*/
@RequestMapping(value = "download/saleDetailReportFromAutoSource.do",method = RequestMethod.POST)
public Response saleDetailReportFromAutoSource(@RequestBody String requestBody){
return downLoadService.downLoadSaleDetailFromAutoSource(requestBody);
}
/**
* 传入报表数据,解析为saleDetail表数据对象List
* @param requestBody
* @return
*/
@RequestMapping(value = "parse/toSaleDetail",method = RequestMethod.POST)
public Response parseToSaleDetail(@RequestBody String requestBody){
return downLoadService.parseToSaleDetail(requestBody);
}
/**
* 下载加价规则
* @param requestBody
* @return
*/
@RequestMapping(value = "download/saleRules.do",method = RequestMethod.POST)
public Response downLoadSaleRules(@RequestBody String requestBody){
logger.info("下载加价规则,参数:"+requestBody);
return downLoadService.downLoadSaleRules(requestBody);
}
/**
* 队列更新报表数据
* @param requestBody
* @return
*/
@RequestMapping(value = "saleDetail/updateSaleDetail",method = RequestMethod.POST)
public Response updateSaleDetail(@RequestBody String requestBody){
return saleDetailService.updateSaleDetail(requestBody);
}
/**
* 按照生单日期导出订单信息
*/
@RequestMapping(value = "order/exportOrderInfo",method = RequestMethod.POST)
public Response exportOrderInfo(@RequestBody String requestBody){
return orderService.exportOrderInfo(requestBody);
}
/**
* 按照指定条件导出私有运价底价配置
*/
@RequestMapping(value = "privateFreight/download.do",method = RequestMethod.POST)
public Response exportPrivateFreight(@RequestBody String requestBody){
return privateFreightService.exportPrivateFreight(requestBody);
}
}
package com.yutu.base.controller;
import io.swagger.annotations.ApiOperation;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import java.text.SimpleDateFormat;
import java.util.Date;
@RestController
public class TestController {
Logger logger = Logger.getLogger("test");
@RequestMapping(value="/test",method = RequestMethod.GET)
@ApiOperation("测试")
public String test(){
try {
System.out.println("Test测试接口响应,时间 = "+new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
return "hello";
}catch (Exception e){
}
return "";
}
}
package com.yutu.base.controller;
import com.yutu.base.entity.Response;
import com.yutu.base.service.UploadService;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("files/")
public class UploadController {
Logger logger = Logger.getLogger("upload");
@Autowired
private UploadService uploadService;
@RequestMapping(value = "upload/saleRules.do",method = RequestMethod.POST)
public Response uploadSaleRules(@RequestBody String requestBody){
logger.info("上传销售规则,参数:"+requestBody);
Response response = uploadService.uploadSaleRules(requestBody);
logger.info("上传结果:"+response);
return response;
}
@RequestMapping(value = "privateFreight/upload.do",method = RequestMethod.POST)
public Response uploadPrivateFreight(@RequestBody String requestBody){
logger.info("上传销售规则,参数:"+requestBody);
Response response = uploadService.uploadPrivateFreight(requestBody);
logger.info("上传结果:"+response);
return response;
}
}
package com.yutu.base.entity;
import java.io.Serializable;
public class ExtraData<T> implements Serializable{
/**
*
*/
private static final long serialVersionUID = 1L;
private T paramData;
private String msg;
public T getParamData() {
return paramData;
}
public void setParamData(T paramData) {
this.paramData = paramData;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public ExtraData(T paramData, String msg) {
super();
this.paramData = paramData;
this.msg = msg;
}
public ExtraData() {
super();
}
@Override
public String toString() {
return "ExtraData [paramData=" + paramData + ", msg=" + msg + "]";
}
}
package com.yutu.base.entity;
import java.io.Serializable;
public class NoteResult implements Serializable{
private static final long serialVersionUID = 1L;
/**
* 状态码 0-成功 2-失败
*/
private int status;
/**
* 消息提示,如(成功)
*/
private String msg;
/**
* 额外信息
*/
private String info;
/**
* 设置要返回的具体数据
*/
private Object data;//返回的数据
public NoteResult(){
}
public NoteResult(int status, String msg, Object data) {
this.status = status;
this.msg = msg;
this.data = data;
}
public Object getData() {
return data;
}
public void setData(Object data) {
this.data = data;
}
public int getStatus() {
return status;
}
public void setStatus(int status) {
this.status = status;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public String getInfo() {
return info;
}
public void setInfo(String info) {
this.info = info;
}
@Override
public String toString() {
return "NoteResult [status=" + status + ", msg=" + msg + ", info="
+ info + ", data=" + data + "]";
}
}
package com.yutu.base.entity;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.yutu.base.utils.JsonDateSerializer;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import java.util.Objects;
/**
* 私有运价实体类
* @author wangycuhen
*
*/
public class PrivateFreight implements Serializable {
private String id;//id
private String customerId;//客户Id
private String carrier;//航司
private String org;//出发
private String dst;//抵达
private String cabin;//舱位
private String flightNo;//航班
private Double floorPrice;//底价票
private Double floorTax;//底价税
private String ruleCodeIds;//适用规则Ids
private String operator;//操作者
private Date updateTime;//更新时间
private Date createTime;//创建时间
private List<RuleCode> ruleCodes;//规则实体List
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getCustomerId() {
return customerId;
}
public void setCustomerId(String customerId) {
this.customerId = customerId;
}
public String getCarrier() {
return carrier;
}
public void setCarrier(String carrier) {
this.carrier = carrier;
}
public String getOrg() {
return org;
}
public void setOrg(String org) {
this.org = org;
}
public String getDst() {
return dst;
}
public void setDst(String dst) {
this.dst = dst;
}
public String getCabin() {
return cabin;
}
public void setCabin(String cabin) {
this.cabin = cabin;
}
public String getFlightNo() {
return flightNo;
}
public void setFlightNo(String flightNo) {
this.flightNo = flightNo;
}
public Double getFloorPrice() {
return floorPrice;
}
public void setFloorPrice(Double floorPrice) {
this.floorPrice = floorPrice;
}
public Double getFloorTax() {
return floorTax;
}
public void setFloorTax(Double floorTax) {
this.floorTax = floorTax;
}
public String getRuleCodeIds() {
return ruleCodeIds;
}
public void setRuleCodeIds(String ruleCodeIds) {
this.ruleCodeIds = ruleCodeIds;
}
public List<RuleCode> getRuleCodes() {
return ruleCodes;
}
public void setRuleCodes(List<RuleCode> ruleCodes) {
this.ruleCodes = ruleCodes;
}
public String getOperator() {
return operator;
}
public void setOperator(String operator) {
this.operator = operator;
}
@JsonSerialize(using= JsonDateSerializer.class)
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
@JsonSerialize(using=JsonDateSerializer.class)
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public PrivateFreight() {
}
public PrivateFreight(String id, String customerId, String carrier, String org, String dst, String cabin, String flightNo, Double floorPrice, Double floorTax, String ruleCodeIds, String operator, Date updateTime, Date createTime, List<RuleCode> ruleCodes) {
this.id = id;
this.customerId = customerId;
this.carrier = carrier;
this.org = org;
this.dst = dst;
this.cabin = cabin;
this.flightNo = flightNo;
this.floorPrice = floorPrice;
this.floorTax = floorTax;
this.ruleCodeIds = ruleCodeIds;
this.operator = operator;
this.updateTime = updateTime;
this.createTime = createTime;
this.ruleCodes = ruleCodes;
}
@Override
public String toString() {
return "PrivateFreight{" +
"id='" + id + '\'' +
", customerId='" + customerId + '\'' +
", carrier='" + carrier + '\'' +
", org='" + org + '\'' +
", dst='" + dst + '\'' +
", cabin='" + cabin + '\'' +
", flightNo='" + flightNo + '\'' +
", floorPrice=" + floorPrice +
", floorTax=" + floorTax +
", ruleCodeIds='" + ruleCodeIds + '\'' +
", operator='" + operator + '\'' +
", updateTime=" + updateTime +
", createTime=" + createTime +
", ruleCodes=" + ruleCodes +
'}';
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
PrivateFreight that = (PrivateFreight) o;
return Objects.equals(id, that.id) &&
Objects.equals(customerId, that.customerId) &&
Objects.equals(carrier, that.carrier) &&
Objects.equals(org, that.org) &&
Objects.equals(dst, that.dst) &&
Objects.equals(cabin, that.cabin) &&
Objects.equals(flightNo, that.flightNo) &&
Objects.equals(floorPrice, that.floorPrice) &&
Objects.equals(floorTax, that.floorTax) &&
Objects.equals(ruleCodeIds, that.ruleCodeIds) &&
Objects.equals(operator, that.operator) &&
Objects.equals(updateTime, that.updateTime) &&
Objects.equals(createTime, that.createTime) &&
Objects.equals(ruleCodes, that.ruleCodes);
}
@Override
public int hashCode() {
return Objects.hash(id, customerId, carrier, org, dst, cabin, flightNo, floorPrice, floorTax, ruleCodeIds, operator, updateTime, createTime, ruleCodes);
}
}
package com.yutu.base.entity;
import java.io.Serializable;
/**
* 统一的响应实体类
*/
public class Response implements Serializable{
private Response.Status status;
private String errorMessage;
private Object data;
public Status getStatus() {
return status;
}
public void setStatus(Status status) {
this.status = status;
}
public String getErrorMessage() {
return errorMessage;
}
public void setErrorMessage(String errorMessage) {
this.errorMessage = errorMessage;
}
public Object getData() {
return data;
}
public void setData(Object data) {
this.data = data;
}
public static Response success(){
Response response=new Response();
response.setStatus(Status.SUCCEED);
return response;
}
public static Response success(Object data){
Response response=new Response();
response.setData(data);
response.setStatus(Status.SUCCEED);
return response;
}
public static Response error(String errorMessage){
Response response=new Response();
response.setStatus(Status.FAILED);
response.setErrorMessage(errorMessage);
return response;
}
public static enum Status {
SUCCEED,
FAILED,
NONE,
TICKET_DATE_ERROR,//航班日期错误
FLIGHT_INFO_ERROR,//航程信息错误
PASSENGER_INFO_ERROR,//乘客信息错误
SERVER_INTRRNAL_ERROR;//服务内部错误
private Status() {
}
}
@Override
public String toString() {
return "Response{" +
"status=" + status +
", errorMessage='" + errorMessage + '\'' +
", data=" + data +
'}';
}
}
package com.yutu.base.entity;
import java.util.Objects;
/**
* 私有运价适用规则实体
*/
public class RuleCode {
private String id;
private String type;//DR 日期范围、WR 星期范围、FN 适用国籍、DN 不适用国籍、AR 年龄范围、PA 购票须知
private String typeDesc;//类型描述 DR 日期范围、WR 星期范围、FN 适用国籍、DN 不适用国籍、AR 年龄范围、PA 购票须知
//DR 20190410-20190510、WR 23456 17、FN CN,JP、DN CN,JP、AR 18-45、PA 购票须知123
private String value;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getTypeDesc() {
return typeDesc;
}
public void setTypeDesc(String typeDesc) {
this.typeDesc = typeDesc;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public RuleCode() {
}
public RuleCode(String id, String type, String typeDesc, String value) {
this.id = id;
this.type = type;
this.typeDesc = typeDesc;
this.value = value;
}
@Override
public String toString() {
return "RuleCode{" +
"id='" + id + '\'' +
", type='" + type + '\'' +
", typeDesc='" + typeDesc + '\'' +
", value='" + value + '\'' +
'}';
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
RuleCode ruleCode = (RuleCode) o;
return Objects.equals(id, ruleCode.id) &&
Objects.equals(type, ruleCode.type) &&
Objects.equals(typeDesc, ruleCode.typeDesc) &&
Objects.equals(value, ruleCode.value);
}
@Override
public int hashCode() {
return Objects.hash(id, type, typeDesc, value);
}
}
package com.yutu.base.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;
import java.util.Date;
/**
* 销售明细实体类
*/
public class SaleDetail implements Serializable {
private static final long serialVersionUID = 1L;
private String id;
private String key;//唯一标识 customerId_fromDate_toDate
private Date createTime;//创建时间
private Date updateTime;//更新时间
private Integer sortIndex;
private Date createOrderTime; // sheet.addCell(new Label(0,0,"生单时间",wcf2));
private Date ticketTime; // sheet.addCell(new Label(1,0,"出票时间",wcf2));
private String outerOrderNo; // sheet.addCell(new Label(2,0,"订单号",wcf2));
private String channel; // sheet.addCell(new Label(3,0,"销售渠道",wcf2));
private String store; // sheet.addCell(new Label(4,0,"销售店铺",wcf2));
private String tairLine; // sheet.addCell(new Label(5,0,"航线",wcf2));
private String flightTime; // sheet.addCell(new Label(6,0,"起飞时间",wcf2));
private String flightNumber; // sheet.addCell(new Label(7,0,"航班号",wcf2));
private String tripType; // sheet.addCell(new Label(8,0,"行程类型",wcf2));
private String pnrType; // sheet.addCell(new Label(9,0,"票号类型",wcf2));
private String pnr; // sheet.addCell(new Label(10,0,"编码",wcf2));
private Integer passengerCount; // sheet.addCell(new Label(11,0,"人数",wcf2));
private Double salePrice; // sheet.addCell(new Label(12,0,"销售—金额",wcf2));
private Double luggagePrice; // sheet.addCell(new Label(13,0,"行李总金额",wcf2));
private Integer points; // sheet.addCell(new Label(14,0,"采购积分",wcf2));
private String purchaseCurrency; // sheet.addCell(new Label(15,0,"采购币种",wcf2));
private Double purchasePrice_local; // sheet.addCell(new Label(16,0,"采购金额(外)",wcf2));
private Double purchasePrice_rmb; // sheet.addCell(new Label(17,0,"采购金额(本)",wcf2));
private Double transactionDetail_local; // sheet.addCell(new Label(18,0,"支付明细(外)",wcf2));
private Double transactionDetail_rmb; // sheet.addCell(new Label(19,0,"支付明细(本)",wcf2));
private String payMethod; // sheet.addCell(new Label(20,0,"支付方式",wcf2));
private String cardNumber; // sheet.addCell(new Label(21,0,"卡号",wcf2));
private Double profit; // sheet.addCell(new Label(22,0,"利润",wcf2));
private String transactionNumber; // sheet.addCell(new Label(23,0,"交易流水号",wcf2));
private String orderValueAddedNo; // sheet.addCell(new Label(24,0,"辅营订单号",wcf2));
private String purchaseChannel; // sheet.addCell(new Label(25,0,"采购渠道",wcf2));
private String purchaseAccount; // sheet.addCell(new Label(26,0,"采购账户",wcf2));
private String purchaseOrderNo; // sheet.addCell(new Label(27,0,"采购订单号",wcf2));
private String policyType; // sheet.addCell(new Label(28,0,"政策类型",wcf2));
private String policyCode; // sheet.addCell(new Label(29,0,"政策编码",wcf2));
private String orderStatus; // sheet.addCell(new Label(30,0,"订单状态",wcf2));
private String operator; // sheet.addCell(new Label(31,0,"出票人",wcf2));
private Date purchaseTime; // sheet.addCell(new Label(32,0,"采购时间",wcf2));
private String orderValueAdded; // sheet.addCell(new Label(33,0,"附加产品",wcf2));
private String orderValueAddedSpecific; // sheet.addCell(new Label(34,0,"附加产品规格",wcf2));
private String remark; // sheet.addCell(new Label(35,0,"备注",wcf2));
private String officalReceivedPaymentStatus; // sheet.addCell(new Label(36,0,"财务-回款状态",wcf2));
private Double officalActualExpendAmount; // sheet.addCell(new Label(37,0,"财务-实际支出金额",wcf2));
private Double officalBalance; // sheet.addCell(new Label(38,0,"财务-补差",wcf2));
private Date officalRateAdjustDate; // sheet.addCell(new Label(39,0,"财务-外币调整日期",wcf2));
private String passengerNames; //采购信息本次采购的乘客姓名
private Integer adultCount; //采购的成人数量
private Integer childCount; //采购的儿童数量
public Integer getAdultCount() {
return adultCount;
}
public void setAdultCount(Integer adultCount) {
this.adultCount = adultCount;
}
public Integer getChildCount() {
return childCount;
}
public void setChildCount(Integer childCount) {
this.childCount = childCount;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public Integer getSortIndex() {
return sortIndex;
}
public void setSortIndex(Integer sortIndex) {
this.sortIndex = sortIndex;
}
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
public Date getCreateOrderTime() {
return createOrderTime;
}
public void setCreateOrderTime(Date createOrderTime) {
this.createOrderTime = createOrderTime;
}
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
public Date getTicketTime() {
return ticketTime;
}
public void setTicketTime(Date ticketTime) {
this.ticketTime = ticketTime;
}
public String getOuterOrderNo() {
return outerOrderNo;
}
public void setOuterOrderNo(String outerOrderNo) {
this.outerOrderNo = outerOrderNo;
}
public String getChannel() {
return channel;
}
public void setChannel(String channel) {
this.channel = channel;
}
public String getStore() {
return store;
}
public void setStore(String store) {
this.store = store;
}
public String getTairLine() {
return tairLine;
}
public void setTairLine(String tairLine) {
this.tairLine = tairLine;
}
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
public String getFlightTime() {
return flightTime;
}
public void setFlightTime(String flightTime) {
this.flightTime = flightTime;
}
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
public String getFlightNumber() {
return flightNumber;
}
public void setFlightNumber(String flightNumber) {
this.flightNumber = flightNumber;
}
public String getTripType() {
return tripType;
}
public void setTripType(String tripType) {
this.tripType = tripType;
}
public String getPnrType() {
return pnrType;
}
public void setPnrType(String pnrType) {
this.pnrType = pnrType;
}
public String getPnr() {
return pnr;
}
public void setPnr(String pnr) {
this.pnr = pnr;
}
public Integer getPassengerCount() {
return passengerCount;
}
public void setPassengerCount(Integer passengerCount) {
this.passengerCount = passengerCount;
}
public Double getSalePrice() {
return salePrice;
}
public void setSalePrice(Double salePrice) {
this.salePrice = salePrice;
}
public Double getLuggagePrice() {
return luggagePrice;
}
public void setLuggagePrice(Double luggagePrice) {
this.luggagePrice = luggagePrice;
}
public Integer getPoints() {
return points;
}
public void setPoints(Integer points) {
this.points = points;
}
public String getPurchaseCurrency() {
return purchaseCurrency;
}
public void setPurchaseCurrency(String purchaseCurrency) {
this.purchaseCurrency = purchaseCurrency;
}
public Double getPurchasePrice_local() {
return purchasePrice_local;
}
public void setPurchasePrice_local(Double purchasePrice_local) {
this.purchasePrice_local = purchasePrice_local;
}
public Double getPurchasePrice_rmb() {
return purchasePrice_rmb;
}
public void setPurchasePrice_rmb(Double purchasePrice_rmb) {
this.purchasePrice_rmb = purchasePrice_rmb;
}
public Double getTransactionDetail_local() {
return transactionDetail_local;
}
public void setTransactionDetail_local(Double transactionDetail_local) {
this.transactionDetail_local = transactionDetail_local;
}
public Double getTransactionDetail_rmb() {
return transactionDetail_rmb;
}
public void setTransactionDetail_rmb(Double transactionDetail_rmb) {
this.transactionDetail_rmb = transactionDetail_rmb;
}
public String getPayMethod() {
return payMethod;
}
public void setPayMethod(String payMethod) {
this.payMethod = payMethod;
}
public String getCardNumber() {
return cardNumber;
}
public void setCardNumber(String cardNumber) {
this.cardNumber = cardNumber;
}
public Double getProfit() {
return profit;
}
public void setProfit(Double profit) {
this.profit = profit;
}
public String getTransactionNumber() {
return transactionNumber;
}
public void setTransactionNumber(String transactionNumber) {
this.transactionNumber = transactionNumber;
}
public String getOrderValueAddedNo() {
return orderValueAddedNo;
}
public void setOrderValueAddedNo(String orderValueAddedNo) {
this.orderValueAddedNo = orderValueAddedNo;
}
public String getPurchaseChannel() {
return purchaseChannel;
}
public void setPurchaseChannel(String purchaseChannel) {
this.purchaseChannel = purchaseChannel;
}
public String getPurchaseAccount() {
return purchaseAccount;
}
public void setPurchaseAccount(String purchaseAccount) {
this.purchaseAccount = purchaseAccount;
}
public String getPurchaseOrderNo() {
return purchaseOrderNo;
}
public void setPurchaseOrderNo(String purchaseOrderNo) {
this.purchaseOrderNo = purchaseOrderNo;
}
public String getPolicyType() {
return policyType;
}
public void setPolicyType(String policyType) {
this.policyType = policyType;
}
public String getPolicyCode() {
return policyCode;
}
public void setPolicyCode(String policyCode) {
this.policyCode = policyCode;
}
public String getOrderStatus() {
return orderStatus;
}
public void setOrderStatus(String orderStatus) {
this.orderStatus = orderStatus;
}
public String getOperator() {
return operator;
}
public void setOperator(String operator) {
this.operator = operator;
}
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
public Date getPurchaseTime() {
return purchaseTime;
}
public void setPurchaseTime(Date purchaseTime) {
this.purchaseTime = purchaseTime;
}
public String getOrderValueAdded() {
return orderValueAdded;
}
public void setOrderValueAdded(String orderValueAdded) {
this.orderValueAdded = orderValueAdded;
}
public String getOrderValueAddedSpecific() {
return orderValueAddedSpecific;
}
public void setOrderValueAddedSpecific(String orderValueAddedSpecific) {
this.orderValueAddedSpecific = orderValueAddedSpecific;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public String getOfficalReceivedPaymentStatus() {
return officalReceivedPaymentStatus;
}
public void setOfficalReceivedPaymentStatus(String officalReceivedPaymentStatus) {
this.officalReceivedPaymentStatus = officalReceivedPaymentStatus;
}
public Double getOfficalActualExpendAmount() {
return officalActualExpendAmount;
}
public void setOfficalActualExpendAmount(Double officalActualExpendAmount) {
this.officalActualExpendAmount = officalActualExpendAmount;
}
public Double getOfficalBalance() {
return officalBalance;
}
public void setOfficalBalance(Double officalBalance) {
this.officalBalance = officalBalance;
}
public Date getOfficalRateAdjustDate() {
return officalRateAdjustDate;
}
public void setOfficalRateAdjustDate(Date officalRateAdjustDate) {
this.officalRateAdjustDate = officalRateAdjustDate;
}
public String getPassengerNames() {
return passengerNames;
}
public void setPassengerNames(String passengerNames) {
this.passengerNames = passengerNames;
}
public SaleDetail() {
}
public SaleDetail(String id, String key, Date createTime, Date updateTime, Integer sortIndex, Date createOrderTime, Date ticketTime, String outerOrderNo, String channel, String store, String tairLine, String flightTime, String flightNumber, String tripType, String pnrType, String pnr, Integer passengerCount, Double salePrice, Double luggagePrice, Integer points, String purchaseCurrency, Double purchasePrice_local, Double purchasePrice_rmb, Double transactionDetail_local, Double transactionDetail_rmb, String payMethod, String cardNumber, Double profit, String transactionNumber, String orderValueAddedNo, String purchaseChannel, String purchaseAccount, String purchaseOrderNo, String policyType, String policyCode, String orderStatus, String operator, Date purchaseTime, String orderValueAdded, String orderValueAddedSpecific, String remark, String officalReceivedPaymentStatus, Double officalActualExpendAmount, Double officalBalance, Date officalRateAdjustDate, String passengerNames, Integer adultCount, Integer childCount) {
this.id = id;
this.key = key;
this.createTime = createTime;
this.updateTime = updateTime;
this.sortIndex = sortIndex;
this.createOrderTime = createOrderTime;
this.ticketTime = ticketTime;
this.outerOrderNo = outerOrderNo;
this.channel = channel;
this.store = store;
this.tairLine = tairLine;
this.flightTime = flightTime;
this.flightNumber = flightNumber;
this.tripType = tripType;
this.pnrType = pnrType;
this.pnr = pnr;
this.passengerCount = passengerCount;
this.salePrice = salePrice;
this.luggagePrice = luggagePrice;
this.points = points;
this.purchaseCurrency = purchaseCurrency;
this.purchasePrice_local = purchasePrice_local;
this.purchasePrice_rmb = purchasePrice_rmb;
this.transactionDetail_local = transactionDetail_local;
this.transactionDetail_rmb = transactionDetail_rmb;
this.payMethod = payMethod;
this.cardNumber = cardNumber;
this.profit = profit;
this.transactionNumber = transactionNumber;
this.orderValueAddedNo = orderValueAddedNo;
this.purchaseChannel = purchaseChannel;
this.purchaseAccount = purchaseAccount;
this.purchaseOrderNo = purchaseOrderNo;
this.policyType = policyType;
this.policyCode = policyCode;
this.orderStatus = orderStatus;
this.operator = operator;
this.purchaseTime = purchaseTime;
this.orderValueAdded = orderValueAdded;
this.orderValueAddedSpecific = orderValueAddedSpecific;
this.remark = remark;
this.officalReceivedPaymentStatus = officalReceivedPaymentStatus;
this.officalActualExpendAmount = officalActualExpendAmount;
this.officalBalance = officalBalance;
this.officalRateAdjustDate = officalRateAdjustDate;
this.passengerNames = passengerNames;
this.adultCount = adultCount;
this.childCount = childCount;
}
@Override
public String toString() {
return "SaleDetail{" +
"id='" + id + '\'' +
", key='" + key + '\'' +
", createTime=" + createTime +
", updateTime=" + updateTime +
", sortIndex=" + sortIndex +
", createOrderTime=" + createOrderTime +
", ticketTime=" + ticketTime +
", outerOrderNo='" + outerOrderNo + '\'' +
", channel='" + channel + '\'' +
", store='" + store + '\'' +
", tairLine='" + tairLine + '\'' +
", flightTime='" + flightTime + '\'' +
", flightNumber='" + flightNumber + '\'' +
", tripType='" + tripType + '\'' +
", pnrType='" + pnrType + '\'' +
", pnr='" + pnr + '\'' +
", passengerCount=" + passengerCount +
", salePrice=" + salePrice +
", luggagePrice=" + luggagePrice +
", points=" + points +
", purchaseCurrency='" + purchaseCurrency + '\'' +
", purchasePrice_local=" + purchasePrice_local +
", purchasePrice_rmb=" + purchasePrice_rmb +
", transactionDetail_local=" + transactionDetail_local +
", transactionDetail_rmb=" + transactionDetail_rmb +
", payMethod='" + payMethod + '\'' +
", cardNumber='" + cardNumber + '\'' +
", profit=" + profit +
", transactionNumber='" + transactionNumber + '\'' +
", orderValueAddedNo='" + orderValueAddedNo + '\'' +
", purchaseChannel='" + purchaseChannel + '\'' +
", purchaseAccount='" + purchaseAccount + '\'' +
", purchaseOrderNo='" + purchaseOrderNo + '\'' +
", policyType='" + policyType + '\'' +
", policyCode='" + policyCode + '\'' +
", orderStatus='" + orderStatus + '\'' +
", operator='" + operator + '\'' +
", purchaseTime=" + purchaseTime +
", orderValueAdded='" + orderValueAdded + '\'' +
", orderValueAddedSpecific='" + orderValueAddedSpecific + '\'' +
", remark='" + remark + '\'' +
", officalReceivedPaymentStatus='" + officalReceivedPaymentStatus + '\'' +
", officalActualExpendAmount=" + officalActualExpendAmount +
", officalBalance=" + officalBalance +
", officalRateAdjustDate=" + officalRateAdjustDate +
", passengerNames='" + passengerNames + '\'' +
", adultCount=" + adultCount +
", childCount=" + childCount +
'}';
}
}
package com.yutu.base.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;
import java.util.Date;
/**
*
* @author 99689
*
*/
public class SaleLog implements Serializable{
/**
*
*/
private static final long serialVersionUID = 1L;
private String id;
private String customerId;
private String referenceId;
private String logType;
private String operatorAction;
private String extraData;
private String operatorId;
private String operator;
private Date createTime;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getCustomerId() {
return customerId;
}
public void setCustomerId(String customerId) {
this.customerId = customerId;
}
public String getReferenceId() {
return referenceId;
}
public void setReferenceId(String referenceId) {
this.referenceId = referenceId;
}
public String getLogType() {
return logType;
}
public void setLogType(String logType) {
this.logType = logType;
}
public String getOperatorAction() {
return operatorAction;
}
public void setOperatorAction(String operatorAction) {
this.operatorAction = operatorAction;
}
public String getExtraData() {
return extraData;
}
public void setExtraData(String extraData) {
this.extraData = extraData;
}
public String getOperatorId() {
return operatorId;
}
public void setOperatorId(String operatorId) {
this.operatorId = operatorId;
}
public String getOperator() {
return operator;
}
public void setOperator(String operator) {
this.operator = operator;
}
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public SaleLog(String id, String customerId, String referenceId, String logType, String operatorAction,
String extraData, String operatorId, String operator, Date createTime) {
super();
this.id = id;
this.customerId = customerId;
this.referenceId = referenceId;
this.logType = logType;
this.operatorAction = operatorAction;
this.extraData = extraData;
this.operatorId = operatorId;
this.operator = operator;
this.createTime = createTime;
}
public SaleLog() {
super();
}
@Override
public String toString() {
return "SaleLog [id=" + id + ", customerId=" + customerId + ", referenceId=" + referenceId + ", logType="
+ logType + ", operatorAction=" + operatorAction + ", extraData=" + extraData + ", operatorId="
+ operatorId + ", operator=" + operator + ", createTime=" + createTime + "]";
}
}
package com.yutu.base.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;
import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.Date;
import java.util.Objects;
/**
* 国际机票销售规则实体类
* @author Administrator
*
*/
public class SaleRules implements Serializable {
private static final long serialVersionUID = 1L;
private String id;//主键id
private String customerId;//客户id
private String channelId;//渠道编号 适用的渠道编号 TongCheng,Taobao,Ctrip,Qunar
private String store; //站点店铺代码
private String ruleCode; //规则编码
private String carrier;//航司代码
private String org;//出发地代码
private String dst;//抵达地代码
private Integer routeType;//行程类型 0:不限制 1:单程 2:往返
private Integer policyType;//政策类型 1:普通 2:积分 3:普通促销 4:扣位 5:积分促销
private String policyDesc;//政策类型描述
private Integer point;//积分
private Integer costPrice;//底价
private String saleSdate;//销售开始日期
private String saleEdate;//销售结束日期
private String ticketDays;//提前出票天数范围
private String tripSdate;//旅行开始日期
private String tripEdate;//旅行结束日期
private Integer status;//状态
private Integer maxPrice;//匹配的最高价格
private Integer minPrice;//匹配的最低价
private Integer minProfit;//最低利润值
private BigDecimal adultPricePoint;//成人价格加点
private Integer adultAddPrice;//成人加价
private Integer adultAddTax;//成人税费加价
private BigDecimal adultTaxPoint;//成人税费加点
private BigDecimal childPricePoint;//儿童价格加点
private Integer childAddPrice;//儿童加价
private Integer childAddTax;//儿童税费加价
private BigDecimal childTaxPoint;//儿童税费加点
private String operator;//操作员名称
private Date createTime;
private Date updateTime;
private Integer deleted;//删除标识,0默认未删除,1已删除
private String notApplicableFlightNum;//不适用航班号
private String applyFlightNum;//适用航班号
private Integer remainCabinNum;//剩余座位数
private String cabinCode;//舱位代码
private String flightCycle;//航班周期 可为空或""表示不限制,值=1357表示只适用于周1,3,5,日执飞航班
private Double floorPrice;//底价票面
private Double floorTax;//底价税
private Integer fitShare;//适用共享 默认1,0:不适用,1:适用
private String fitNationality;//适用国籍 默认空,国家两字代码,多个用逗号隔开
private String disFitNationality;//不适用国籍 默认空,国家两字代码,多个用逗号隔开
private String ageRange;//年龄范围 默认空,如30-45,不支持多范围
private String attention;//购票需知 默认空,自由文本
public SaleRules(){}
public SaleRules(String id, String customerId, String channelId, String store, String ruleCode, String carrier, String org, String dst, Integer routeType, Integer policyType, String policyDesc, Integer point, Integer costPrice, String saleSdate, String saleEdate, String ticketDays, String tripSdate, String tripEdate, Integer status, Integer maxPrice, Integer minPrice, Integer minProfit, BigDecimal adultPricePoint, Integer adultAddPrice, Integer adultAddTax, BigDecimal adultTaxPoint, BigDecimal childPricePoint, Integer childAddPrice, Integer childAddTax, BigDecimal childTaxPoint, String operator, Date createTime, Date updateTime, Integer deleted, String notApplicableFlightNum, String applyFlightNum, Integer remainCabinNum, String cabinCode) {
this.id = id;
this.customerId = customerId;
this.channelId = channelId;
this.store = store;
this.ruleCode = ruleCode;
this.carrier = carrier;
this.org = org;
this.dst = dst;
this.routeType = routeType;
this.policyType = policyType;
this.policyDesc = policyDesc;
this.point = point;
this.costPrice = costPrice;
this.saleSdate = saleSdate;
this.saleEdate = saleEdate;
this.ticketDays = ticketDays;
this.tripSdate = tripSdate;
this.tripEdate = tripEdate;
this.status = status;
this.maxPrice = maxPrice;
this.minPrice = minPrice;
this.minProfit = minProfit;
this.adultPricePoint = adultPricePoint;
this.adultAddPrice = adultAddPrice;
this.adultAddTax = adultAddTax;
this.adultTaxPoint = adultTaxPoint;
this.childPricePoint = childPricePoint;
this.childAddPrice = childAddPrice;
this.childAddTax = childAddTax;
this.childTaxPoint = childTaxPoint;
this.operator = operator;
this.createTime = createTime;
this.updateTime = updateTime;
this.deleted = deleted;
this.notApplicableFlightNum = notApplicableFlightNum;
this.applyFlightNum = applyFlightNum;
this.remainCabinNum = remainCabinNum;
this.cabinCode = cabinCode;
}
public SaleRules(String id, String customerId, String channelId, String store, String ruleCode, String carrier, String org, String dst, Integer routeType, Integer policyType, String policyDesc, Integer point, Integer costPrice, String saleSdate, String saleEdate, String ticketDays, String tripSdate, String tripEdate, Integer status, Integer maxPrice, Integer minPrice, Integer minProfit, BigDecimal adultPricePoint, Integer adultAddPrice, Integer adultAddTax, BigDecimal adultTaxPoint, BigDecimal childPricePoint, Integer childAddPrice, Integer childAddTax, BigDecimal childTaxPoint, String operator, Date createTime, Date updateTime, Integer deleted, String notApplicableFlightNum, String applyFlightNum, Integer remainCabinNum, String cabinCode, String flightCycle, Double floorPrice, Double floorTax, Integer fitShare, String fitNationality, String disFitNationality, String ageRange, String attention) {
this.id = id;
this.customerId = customerId;
this.channelId = channelId;
this.store = store;
this.ruleCode = ruleCode;
this.carrier = carrier;
this.org = org;
this.dst = dst;
this.routeType = routeType;
this.policyType = policyType;
this.policyDesc = policyDesc;
this.point = point;
this.costPrice = costPrice;
this.saleSdate = saleSdate;
this.saleEdate = saleEdate;
this.ticketDays = ticketDays;
this.tripSdate = tripSdate;
this.tripEdate = tripEdate;
this.status = status;
this.maxPrice = maxPrice;
this.minPrice = minPrice;
this.minProfit = minProfit;
this.adultPricePoint = adultPricePoint;
this.adultAddPrice = adultAddPrice;
this.adultAddTax = adultAddTax;
this.adultTaxPoint = adultTaxPoint;
this.childPricePoint = childPricePoint;
this.childAddPrice = childAddPrice;
this.childAddTax = childAddTax;
this.childTaxPoint = childTaxPoint;
this.operator = operator;
this.createTime = createTime;
this.updateTime = updateTime;
this.deleted = deleted;
this.notApplicableFlightNum = notApplicableFlightNum;
this.applyFlightNum = applyFlightNum;
this.remainCabinNum = remainCabinNum;
this.cabinCode = cabinCode;
this.flightCycle = flightCycle;
this.floorPrice = floorPrice;
this.floorTax = floorTax;
this.fitShare = fitShare;
this.fitNationality = fitNationality;
this.disFitNationality = disFitNationality;
this.ageRange = ageRange;
this.attention = attention;
}
public String getCabinCode() {
return cabinCode;
}
public void setCabinCode(String cabinCode) {
this.cabinCode = cabinCode;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getCustomerId() {
return customerId;
}
public void setCustomerId(String customerId) {
this.customerId = customerId;
}
public String getChannelId() {
return channelId;
}
public void setChannelId(String channelId) {
this.channelId = channelId;
}
public String getStore() {
return store;
}
public void setStore(String store) {
this.store = store;
}
public String getCarrier() {
return carrier;
}
public void setCarrier(String carrier) {
this.carrier = carrier;
}
public String getOrg() {
return org;
}
public void setOrg(String org) {
this.org = org;
}
public String getDst() {
return dst;
}
public void setDst(String dst) {
this.dst = dst;
}
/**
* 政策类型 1:普通 2:积分 3:普通促销 4:扣位 5:积分促销
* @return
*/
public Integer getPolicyType() {
return policyType;
}
public void setPolicyType(Integer policyType) {
this.policyType = policyType;
}
public String getPolicyDesc() {
return policyDesc;
}
public void setPolicyDesc(String policyDesc) {
this.policyDesc = policyDesc;
}
public String getSaleSdate() {
return saleSdate;
}
public void setSaleSdate(String saleSdate) {
this.saleSdate = saleSdate;
}
public String getSaleEdate() {
return saleEdate;
}
public void setSaleEdate(String saleEdate) {
this.saleEdate = saleEdate;
}
public String getTicketDays() {
return ticketDays;
}
public void setTicketDays(String ticketDays) {
this.ticketDays = ticketDays;
}
public String getTripSdate() {
return tripSdate;
}
public void setTripSdate(String tripSdate) {
this.tripSdate = tripSdate;
}
public String getTripEdate() {
return tripEdate;
}
public void setTripEdate(String tripEdate) {
this.tripEdate = tripEdate;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public Integer getMaxPrice() {
return maxPrice;
}
public void setMaxPrice(Integer maxPrice) {
this.maxPrice = maxPrice;
}
public Integer getMinPrice() {
return minPrice;
}
public void setMinPrice(Integer minPrice) {
this.minPrice = minPrice;
}
public Integer getMinProfit() {
return minProfit;
}
public void setMinProfit(Integer minProfit) {
this.minProfit = minProfit;
}
public BigDecimal getAdultPricePoint() {
return adultPricePoint;
}
public void setAdultPricePoint(BigDecimal adultPricePoint) {
this.adultPricePoint = adultPricePoint;
}
public Integer getAdultAddPrice() {
return adultAddPrice;
}
public void setAdultAddPrice(Integer adultAddPrice) {
this.adultAddPrice = adultAddPrice;
}
public Integer getAdultAddTax() {
return adultAddTax;
}
public void setAdultAddTax(Integer adultAddTax) {
this.adultAddTax = adultAddTax;
}
public BigDecimal getAdultTaxPoint() {
return adultTaxPoint;
}
public void setAdultTaxPoint(BigDecimal adultTaxPoint) {
this.adultTaxPoint = adultTaxPoint;
}
public BigDecimal getChildPricePoint() {
return childPricePoint;
}
public void setChildPricePoint(BigDecimal childPricePoint) {
this.childPricePoint = childPricePoint;
}
public Integer getChildAddPrice() {
return childAddPrice;
}
public void setChildAddPrice(Integer childAddPrice) {
this.childAddPrice = childAddPrice;
}
public Integer getChildAddTax() {
return childAddTax;
}
public void setChildAddTax(Integer childAddTax) {
this.childAddTax = childAddTax;
}
public BigDecimal getChildTaxPoint() {
return childTaxPoint;
}
public void setChildTaxPoint(BigDecimal childTaxPoint) {
this.childTaxPoint = childTaxPoint;
}
public String getOperator() {
return operator;
}
public void setOperator(String operator) {
this.operator = operator;
}
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public Integer getRouteType() {
return routeType;
}
public void setRouteType(Integer routeType) {
this.routeType = routeType;
}
public Integer getPoint() {
return point;
}
public void setPoint(Integer point) {
this.point = point;
}
public Integer getCostPrice() {
return costPrice;
}
public void setCostPrice(Integer costPrice) {
this.costPrice = costPrice;
}
public String getRuleCode() {
return ruleCode;
}
public void setRuleCode(String ruleCode) {
this.ruleCode = ruleCode;
}
public Integer getDeleted() {
return deleted;
}
public void setDeleted(Integer deleted) {
this.deleted = deleted;
}
public String getNotApplicableFlightNum() {
return notApplicableFlightNum;
}
public void setNotApplicableFlightNum(String notApplicableFlightNum) {
this.notApplicableFlightNum = notApplicableFlightNum;
}
public String getApplyFlightNum() {
return applyFlightNum;
}
public void setApplyFlightNum(String applyFlightNum) {
this.applyFlightNum = applyFlightNum;
}
public Integer getRemainCabinNum() {
return remainCabinNum;
}
public void setRemainCabinNum(Integer remainCabinNum) {
this.remainCabinNum = remainCabinNum;
}
public String getFlightCycle() {
return flightCycle;
}
public void setFlightCycle(String flightCycle) {
this.flightCycle = flightCycle;
}
public Double getFloorPrice() {
return floorPrice;
}
public void setFloorPrice(Double floorPrice) {
this.floorPrice = floorPrice;
}
public Double getFloorTax() {
return floorTax;
}
public void setFloorTax(Double floorTax) {
this.floorTax = floorTax;
}
public Integer getFitShare() {
return fitShare;
}
public void setFitShare(Integer fitShare) {
this.fitShare = fitShare;
}
public String getFitNationality() {
return fitNationality;
}
public void setFitNationality(String fitNationality) {
this.fitNationality = fitNationality;
}
public String getDisFitNationality() {
return disFitNationality;
}
public void setDisFitNationality(String disFitNationality) {
this.disFitNationality = disFitNationality;
}
public String getAgeRange() {
return ageRange;
}
public void setAgeRange(String ageRange) {
this.ageRange = ageRange;
}
public String getAttention() {
return attention;
}
public void setAttention(String attention) {
this.attention = attention;
}
@Override
public String toString() {
return "SaleRules{" +
"id='" + id + '\'' +
", customerId='" + customerId + '\'' +
", channelId='" + channelId + '\'' +
", store='" + store + '\'' +
", ruleCode='" + ruleCode + '\'' +
", carrier='" + carrier + '\'' +
", org='" + org + '\'' +
", dst='" + dst + '\'' +
", routeType=" + routeType +
", policyType=" + policyType +
", policyDesc='" + policyDesc + '\'' +
", point=" + point +
", costPrice=" + costPrice +
", saleSdate='" + saleSdate + '\'' +
", saleEdate='" + saleEdate + '\'' +
", ticketDays='" + ticketDays + '\'' +
", tripSdate='" + tripSdate + '\'' +
", tripEdate='" + tripEdate + '\'' +
", status=" + status +
", maxPrice=" + maxPrice +
", minPrice=" + minPrice +
", minProfit=" + minProfit +
", adultPricePoint=" + adultPricePoint +
", adultAddPrice=" + adultAddPrice +
", adultAddTax=" + adultAddTax +
", adultTaxPoint=" + adultTaxPoint +
", childPricePoint=" + childPricePoint +
", childAddPrice=" + childAddPrice +
", childAddTax=" + childAddTax +
", childTaxPoint=" + childTaxPoint +
", operator='" + operator + '\'' +
", createTime=" + createTime +
", updateTime=" + updateTime +
", deleted=" + deleted +
", notApplicableFlightNum='" + notApplicableFlightNum + '\'' +
", applyFlightNum='" + applyFlightNum + '\'' +
", remainCabinNum=" + remainCabinNum +
", cabinCode='" + cabinCode + '\'' +
", flightCycle='" + flightCycle + '\'' +
", floorPrice=" + floorPrice +
", floorTax=" + floorTax +
", fitShare=" + fitShare +
", fitNationality='" + fitNationality + '\'' +
", disFitNationality='" + disFitNationality + '\'' +
", ageRange='" + ageRange + '\'' +
", attention='" + attention + '\'' +
'}';
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
SaleRules saleRules = (SaleRules) o;
return Objects.equals(id, saleRules.id) &&
Objects.equals(customerId, saleRules.customerId) &&
Objects.equals(channelId, saleRules.channelId) &&
Objects.equals(store, saleRules.store) &&
Objects.equals(ruleCode, saleRules.ruleCode) &&
Objects.equals(carrier, saleRules.carrier) &&
Objects.equals(org, saleRules.org) &&
Objects.equals(dst, saleRules.dst) &&
Objects.equals(routeType, saleRules.routeType) &&
Objects.equals(policyType, saleRules.policyType) &&
Objects.equals(policyDesc, saleRules.policyDesc) &&
Objects.equals(point, saleRules.point) &&
Objects.equals(costPrice, saleRules.costPrice) &&
Objects.equals(saleSdate, saleRules.saleSdate) &&
Objects.equals(saleEdate, saleRules.saleEdate) &&
Objects.equals(ticketDays, saleRules.ticketDays) &&
Objects.equals(tripSdate, saleRules.tripSdate) &&
Objects.equals(tripEdate, saleRules.tripEdate) &&
Objects.equals(status, saleRules.status) &&
Objects.equals(maxPrice, saleRules.maxPrice) &&
Objects.equals(minPrice, saleRules.minPrice) &&
Objects.equals(minProfit, saleRules.minProfit) &&
Objects.equals(adultPricePoint, saleRules.adultPricePoint) &&
Objects.equals(adultAddPrice, saleRules.adultAddPrice) &&
Objects.equals(adultAddTax, saleRules.adultAddTax) &&
Objects.equals(adultTaxPoint, saleRules.adultTaxPoint) &&
Objects.equals(childPricePoint, saleRules.childPricePoint) &&
Objects.equals(childAddPrice, saleRules.childAddPrice) &&
Objects.equals(childAddTax, saleRules.childAddTax) &&
Objects.equals(childTaxPoint, saleRules.childTaxPoint) &&
Objects.equals(operator, saleRules.operator) &&
Objects.equals(createTime, saleRules.createTime) &&
Objects.equals(updateTime, saleRules.updateTime) &&
Objects.equals(deleted, saleRules.deleted) &&
Objects.equals(notApplicableFlightNum, saleRules.notApplicableFlightNum) &&
Objects.equals(applyFlightNum, saleRules.applyFlightNum) &&
Objects.equals(remainCabinNum, saleRules.remainCabinNum) &&
Objects.equals(cabinCode, saleRules.cabinCode) &&
Objects.equals(flightCycle, saleRules.flightCycle) &&
Objects.equals(floorPrice, saleRules.floorPrice) &&
Objects.equals(floorTax, saleRules.floorTax) &&
Objects.equals(fitShare, saleRules.fitShare) &&
Objects.equals(fitNationality, saleRules.fitNationality) &&
Objects.equals(disFitNationality, saleRules.disFitNationality) &&
Objects.equals(ageRange, saleRules.ageRange) &&
Objects.equals(attention, saleRules.attention);
}
@Override
public int hashCode() {
return Objects.hash(id, customerId, channelId, store, ruleCode, carrier, org, dst, routeType, policyType, policyDesc, point, costPrice, saleSdate, saleEdate, ticketDays, tripSdate, tripEdate, status, maxPrice, minPrice, minProfit, adultPricePoint, adultAddPrice, adultAddTax, adultTaxPoint, childPricePoint, childAddPrice, childAddTax, childTaxPoint, operator, createTime, updateTime, deleted, notApplicableFlightNum, applyFlightNum, remainCabinNum, cabinCode, flightCycle, floorPrice, floorTax, fitShare, fitNationality, disFitNationality, ageRange, attention);
}
}
package com.yutu.base.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.sql.Timestamp;
public class SaleStore {
private String id;
private String customerId;
private String channleId;
private String storeCode;
private Integer status;
private String swichType;
private String saleBeginTime;
private String saleEndTime;
private String contact;
private String minCabinCount;
private String testRule;
private String tele;
private String email;
private String operator;
private Timestamp createtime;
private Timestamp updatetime;
public SaleStore() {
}
public SaleStore(String id, String customerId, String channleId, String storeCode, Integer status, String swichType,
String saleBeginTime, String saleEndTime, String contact, String minCabinCount, String testRule,
String tele, String email, String operator, Timestamp createtime, Timestamp updatetime) {
super();
this.id = id;
this.customerId = customerId;
this.channleId = channleId;
this.storeCode = storeCode;
this.status = status;
this.swichType = swichType;
this.saleBeginTime = saleBeginTime;
this.saleEndTime = saleEndTime;
this.contact = contact;
this.minCabinCount = minCabinCount;
this.testRule = testRule;
this.tele = tele;
this.email = email;
this.operator = operator;
this.createtime = createtime;
this.updatetime = updatetime;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getCustomerId() {
return customerId;
}
public void setCustomerId(String customerId) {
this.customerId = customerId;
}
public String getChannleId() {
return channleId;
}
public void setChannleId(String channleId) {
this.channleId = channleId;
}
public String getStoreCode() {
return storeCode;
}
public void setStoreCode(String storeCode) {
this.storeCode = storeCode;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public String getSwichType() {
return swichType;
}
public void setSwichType(String swichType) {
this.swichType = swichType;
}
public String getSaleBeginTime() {
return saleBeginTime;
}
public void setSaleBeginTime(String saleBeginTime) {
this.saleBeginTime = saleBeginTime;
}
public String getSaleEndTime() {
return saleEndTime;
}
public void setSaleEndTime(String saleEndTime) {
this.saleEndTime = saleEndTime;
}
public String getContact() {
return contact;
}
public void setContact(String contact) {
this.contact = contact;
}
public String getMinCabinCount() {
return minCabinCount;
}
public void setMinCabinCount(String minCabinCount) {
this.minCabinCount = minCabinCount;
}
public String getTestRule() {
return testRule;
}
public void setTestRule(String testRule) {
this.testRule = testRule;
}
public String getTele() {
return tele;
}
public void setTele(String tele) {
this.tele = tele;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getOperator() {
return operator;
}
public void setOperator(String operator) {
this.operator = operator;
}
public Timestamp getCreatetime() {
return createtime;
}
public void setCreatetime(Timestamp createtime) {
this.createtime = createtime;
}
public Timestamp getUpdatetime() {
return updatetime;
}
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
public void setUpdatetime(Timestamp updatetime) {
this.updatetime = updatetime;
}
@Override
public String toString() {
return "SaleStore [id=" + id + ", customerId=" + customerId + ", channleId=" + channleId + ", storeCode="
+ storeCode + ", status=" + status + ", swichType=" + swichType + ", saleBeginTime=" + saleBeginTime
+ ", saleEndTime=" + saleEndTime + ", contact=" + contact + ", minCabinCount=" + minCabinCount
+ ", testRule=" + testRule + ", tele=" + tele + ", email=" + email + ", operator=" + operator
+ ", createtime=" + createtime + ", updatetime=" + updatetime + "]";
}
}
package com.yutu.base.entity;
public class Store {
private String id;
private String customerId;
private String channelCode;
private String storeName;
private String storeShortName;
private String storeCode;
private String domain;
private String status;
public String getStoreCode() {
return storeCode;
}
public void setStoreCode(String storeCode) {
this.storeCode = storeCode;
}
public String getCustomerId() {
return customerId;
}
public void setCustomerId(String customerId) {
this.customerId = customerId;
}
public String getChannelCode() {
return channelCode;
}
public void setChannelCode(String channelCode) {
this.channelCode = channelCode;
}
public String getStoreName() {
return storeName;
}
public void setStoreName(String storeName) {
this.storeName = storeName;
}
public String getStoreShortName() {
return storeShortName;
}
public void setStoreShortName(String storeShortName) {
this.storeShortName = storeShortName;
}
public String getDomain() {
return domain;
}
public void setDomain(String domain) {
this.domain = domain;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
@Override
public String toString() {
return "Store{" +
"id='" + id + '\'' +
", customerId='" + customerId + '\'' +
", channelCode='" + channelCode + '\'' +
", storeName='" + storeName + '\'' +
", storeShortName='" + storeShortName + '\'' +
", storeCode='" + storeCode + '\'' +
", domain='" + domain + '\'' +
", status='" + status + '\'' +
'}';
}
}
package com.yutu.base.entity;
import java.io.Serializable;
public class User implements Serializable{
private String userID; //用户ID
private String CustomerID;//用户所在公司的ID号
private String name; //姓名-真实的名字
private String username;
public User() {
super();
// TODO Auto-generated constructor stub
}
public User(String userID, String name) {
super();
this.userID = userID;
this.name = name;
}
public User(String userID, String customerID, String name, String username) {
super();
this.userID = userID;
CustomerID = customerID;
this.name = name;
this.username=username;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getUserID() {
return userID;
}
public void setUserID(String userID) {
this.userID = userID;
}
public String getCustomerID() {
return CustomerID;
}
public void setCustomerID(String customerID) {
CustomerID = customerID;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Override
public String toString() {
return "User{" +
"userID='" + userID + '\'' +
", CustomerID='" + CustomerID + '\'' +
", name='" + name + '\'' +
", username='" + username + '\'' +
'}';
}
}
\ No newline at end of file
package com.yutu.base.service;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yutu.base.entity.Store;
import com.yutu.base.entity.User;
import com.yutu.base.utils.httpClient.HttpUtil;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
/**
* 基础业务层
* 当前包含,User、Store等
*/
@Service
public class BaseService {
@Value("${spring.urlConfig.dataApiUrl}")
private String dataApiUrl;
public List<User> getUsers(){
List<User> userList = new ArrayList<>();
String result= HttpUtil.httpGet(dataApiUrl+"rest/user/selectAllUsers","");
if(StringUtils.isNotBlank(result)){
JSONObject resultObj = JSONObject.parseObject(result);
if(resultObj.getInteger("status") == 0){
JSONArray dataArr = resultObj.getJSONArray("data");
for(int i =0;i<dataArr.size();i++){
JSONObject data = dataArr.getJSONObject(i);
User user = new User();
user.setUserID(data.getString("id"));
user.setCustomerID(data.getString("customerId"));
user.setName(data.getString("loginName"));
user.setUsername(data.getString("userName"));
userList.add(user);
}
}
}
return userList;
}
public List<Store> getStores(){
List<Store> storeList = new ArrayList<>();
String result= HttpUtil.httpGet(dataApiUrl+"rest/store/selectAllStores","");
if(StringUtils.isNotBlank(result)){
JSONObject resultObj = JSONObject.parseObject(result);
if(resultObj.getInteger("status") == 0){
JSONArray dataArr = resultObj.getJSONArray("data");
for(int i =0;i<dataArr.size();i++){
JSONObject data = dataArr.getJSONObject(i);
Store store = new Store();
store.setId(data.getString("id"));
store.setCustomerId(data.getString("customerId"));
store.setChannelCode(data.getString("channelCode"));
store.setStoreName(data.getString("storeName"));
store.setStoreShortName(data.getString("storeShortName"));
store.setStoreCode(data.getString("storeCode"));
store.setStatus(data.getString("status"));
store.setDomain(data.getString("domain"));
storeList.add(store);
}
}
}
return storeList;
}
}
package com.yutu.base.service;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import com.yutu.base.entity.NoteResult;
import com.yutu.base.entity.Response;
import com.yutu.base.entity.SaleDetail;
import com.yutu.base.entity.SaleRules;
import com.yutu.base.utils.HttpsSendData;
import org.apache.commons.lang3.StringUtils;
import org.apache.log4j.Logger;
import org.apache.poi.hssf.usermodel.*;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.VerticalAlignment;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.io.*;
import java.text.SimpleDateFormat;
import java.util.*;
@Service
public class DownLoadService {
private Logger logger = Logger.getLogger("download");
@Value("${spring.urlConfig.overseasAirTicketUrl}")
private String overseasAirTicketUrl;
@Value("${spring.urlConfig.productServiceUrl}")
private String productServiceUrl;
@Value("${spring.pathConfig.saleReportExcelPath}")
private String saleReportExcelPath;
@Value("${spring.pathConfig.saleDetailReportExcelPath}")
private String saleDetailReportExcelPath;
@Autowired
private SaleDetailReportService saleDetailReportService;
@Autowired
private ParseToSaleDetail parseToSaleDetail;
/**
* 获取销售数据
* @param requestBody
* @return
*/
public Response getSaleDetailReportData(String requestBody){
if(StringUtils.isBlank(requestBody)){
return Response.error("参数不能为空 [requestBody]");
}
logger.info("开始获取数据,参数:" + requestBody);
long beginTime = System.currentTimeMillis();
String result = HttpsSendData.getPost(overseasAirTicketUrl+"orderInfo/getReportExcelData.do",requestBody);
if(StringUtils.isBlank(result)){
return Response.error("获取数据失败");
}
JSONObject resultObj = JSONObject.parseObject(result);
if(resultObj.getInteger("status") != 0){
return Response.error("获取数据失败");
}
logger.info("获取数据成功,共用时:" + (System.currentTimeMillis()-beginTime));
Map<String,String> resultMap = resultObj.getObject("data",Map.class);
Response response = new Response();
response.setStatus(Response.Status.SUCCEED);
response.setData(resultMap);
response.setErrorMessage("获取成功");
return response;
}
/**
* 下载销售报表
* @param requestBody
* @return
*/
public Response downLoadSaleDetailReport(String requestBody){
if(StringUtils.isBlank(requestBody)){
return Response.error("参数不能为空 [requestBody]");
}
String customerId = JSONObject.parseObject(requestBody).getString("customerId");
logger.info("开始获取数据,参数:" + requestBody);
long beginTime = System.currentTimeMillis();
String result = HttpsSendData.getPost(overseasAirTicketUrl+"orderInfo/getReportExcelData.do",requestBody);
if(StringUtils.isBlank(result)){
return Response.error("获取数据失败");
}
JSONObject resultObj = JSONObject.parseObject(result);
if(resultObj.getInteger("status") != 0){
return Response.error("获取数据失败");
}
logger.info("获取数据成功,共用时:" + (System.currentTimeMillis()-beginTime));
logger.info("开始解析数据生成报表 ...");
Map<String,String> resultMap = resultObj.getObject("data",Map.class);
Response response = new Response();
try{
final String filePath = saleDetailReportExcelPath + customerId + "/SalesDetailReport/";//指定文件保存路径
String path = saleDetailReportService.createExcel(resultMap, filePath, "");
response.setStatus(Response.Status.SUCCEED);
response.setData(path);
response.setErrorMessage("生成成功,总用时:"+(System.currentTimeMillis()-beginTime)+"ms");
logger.info("生成销售明细报表,总用时:"+(System.currentTimeMillis()-beginTime)+"ms");
return response;
}catch (Exception e){
logger.error("生成报表发生异常",e);
return Response.error("生成报表发生异常");
}
}
/**
* 下载加价规则
* @param requestBody
* @return
*/
public Response downLoadSaleRules(String requestBody){
JSONObject requestObj = JSONObject.parseObject(requestBody);
String customerId = requestObj.getString("customerId");
long beginTime = System.currentTimeMillis();
//请求运价直连工程获取源数据
String result=HttpsSendData.getPost(productServiceUrl+"SaleRules/findByCustomerId.do", requestBody);
if(StringUtils.isBlank(result)){
return Response.error("获取加价规则源数据异常");
}
JSONObject resultObj = JSONObject.parseObject(result);
if(resultObj.getInteger("status") != 0){
return Response.error("获取加价规则源数据失败");
}
JSONArray dataArr = resultObj.getJSONArray("data");
if(dataArr.size() == 0){
return Response.error("加价规则源数据共 0 条");
}
List<SaleRules> saleRules = new ArrayList<>();
for(int i=0;i<dataArr.size();i++){
JSONObject data = dataArr.getJSONObject(i);
SaleRules saleRule = new SaleRules(data.getString("id"),data.getString("customerId"),data.getString("channelId"),
data.getString("store"),data.getString("ruleCode"),data.getString("carrier"),data.getString("org"),
data.getString("dst"),data.getInteger("routeType"),data.getInteger("policyType"),data.getString("policyDesc"),
data.getInteger("point"),data.getInteger("costPrice"),data.getString("saleSdate"),data.getString("saleEdate"),
data.getString("ticketDays"),data.getString("tripSdate"),data.getString("tripEdate"),data.getInteger("status"),
data.getInteger("maxPrice"),data.getInteger("minPrice"),data.getInteger("minProfit"),
data.getBigDecimal("adultPricePoint"),data.getInteger("adultAddPrice"),data.getInteger("adultAddTax"),data.getBigDecimal("adultTaxPoint"),
data.getBigDecimal("childPricePoint"),data.getInteger("childAddPrice"),data.getInteger("childAddTax"),data.getBigDecimal("childTaxPoint"),
data.getString("operator"),data.getDate("createTime"),data.getDate("updateTime"),data.getInteger("deleted"),
data.getString("notApplicableFlightNum"),data.getString("applyFlightNum"),data.getInteger("remainCabinNum"),data.getString("cabinCode"),
data.getString("flightCycle"),data.getDouble("floorPrice"),data.getDouble("floorTax"),data.getInteger("fitShare"),data.getString("fitNationality"),
data.getString("disFitNationality"),data.getString("ageRange"),data.getString("attention"));
saleRules.add(saleRule);
}
String filePath = saleReportExcelPath+customerId+"/SaleRulesExcel\\";
File temp = new File(filePath);
if (!temp.exists()) { temp.mkdir(); }
SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日HH时mm分ss秒");
String date = sdf.format(new Date());
File file = new File(date+"~销售规则.xls");
FileOutputStream os = null;
HSSFWorkbook book = null;
try {
//创建工作薄
book = new HSSFWorkbook();
HSSFSheet sheet = book.createSheet("销售规则");
sheet.setColumnWidth(31, 7500);
// 创建单元格样式
HSSFCellStyle cellStyleTitle = book.createCellStyle();
// 指定单元格居中对齐
cellStyleTitle.setAlignment(HorizontalAlignment.CENTER);
// 指定单元格垂直居中对齐
cellStyleTitle.setVerticalAlignment(VerticalAlignment.CENTER);
// 指定当单元格内容显示不下时自动换行
cellStyleTitle.setWrapText(false);
// ------------------------------------------------------------------
HSSFCellStyle cellStyle = book.createCellStyle();
// 指定单元格居中对齐
cellStyle.setAlignment(HorizontalAlignment.CENTER);
// 指定单元格垂直居中对齐
cellStyle.setVerticalAlignment(VerticalAlignment.CENTER);
// 指定当单元格内容显示不下时自动换行
cellStyle.setWrapText(false);
// ------------------------------------------------------------------
// 设置单元格字体
HSSFFont font = book.createFont();
font.setBold(true);
font.setFontName("宋体");
font.setColor(new Short("255"));
font.setFontHeight((short) 200);
cellStyleTitle.setFont(font);
//创建标题行
Row title = sheet.createRow(0);
title.setRowStyle(cellStyleTitle);
title.createCell(0).setCellValue("渠道");
title.createCell(1).setCellValue("店铺编码");
title.createCell(2).setCellValue("规则编号");
title.createCell(3).setCellValue("航司两字代码");
title.createCell(4).setCellValue("出港");
title.createCell(5).setCellValue("到港");
title.createCell(6).setCellValue("适用航班号");
title.createCell(7).setCellValue("不适用航班号");
title.createCell(8).setCellValue("行程类型");
title.createCell(9).setCellValue("政策类型");
title.createCell(10).setCellValue("政策描述");
title.createCell(11).setCellValue("积分值");
title.createCell(12).setCellValue("底价");
title.createCell(13).setCellValue("销售开始日期");
title.createCell(14).setCellValue("销售结束日期");
title.createCell(15).setCellValue("提前出票天数");
title.createCell(16).setCellValue("旅行开始日期");
title.createCell(17).setCellValue("旅行结束日期");
title.createCell(18).setCellValue("状态");
title.createCell(19).setCellValue("最小金额");
title.createCell(20).setCellValue("最大金额");
title.createCell(21).setCellValue("最低利润值");
title.createCell(22).setCellValue("成人加点");
title.createCell(23).setCellValue("成人留钱");
title.createCell(24).setCellValue("成人加税");
title.createCell(25).setCellValue("成人加税点");
title.createCell(26).setCellValue("儿童加点");
title.createCell(27).setCellValue("儿童留钱");
title.createCell(28).setCellValue("儿童加税");
title.createCell(29).setCellValue("儿童加税点");
title.createCell(30).setCellValue("舱位代码");
title.createCell(31).setCellValue("销售规则Id");
title.createCell(32).setCellValue("航班周期");
title.createCell(33).setCellValue("底价票");
title.createCell(34).setCellValue("底价税");
title.createCell(35).setCellValue("适用共享");
title.createCell(36).setCellValue("适用国籍");
title.createCell(37).setCellValue("不适用国籍");
title.createCell(38).setCellValue("年龄范围");
title.createCell(39).setCellValue("购票需知");
//遍历销售规则数据列表
for (int i = 0; i < saleRules.size(); i++) {
Row r = sheet.createRow(i+1);
Cell channelIdCell = r.createCell(0);
channelIdCell.setCellStyle(cellStyle);
if (saleRules.get(i).getChannelId()==null) {
channelIdCell.setCellValue("*");
}else{
channelIdCell.setCellValue(saleRules.get(i).getChannelId());
}
Cell store = r.createCell(1);
store.setCellStyle(cellStyle);
if (saleRules.get(i).getStore()==null) {
store.setCellValue("*");
}else{
store.setCellValue(saleRules.get(i).getStore());
}
Cell ruleCode = r.createCell(2);
ruleCode.setCellStyle(cellStyle);
if (saleRules.get(i).getRuleCode()==null) {
ruleCode.setCellValue("");
}else{
ruleCode.setCellValue(saleRules.get(i).getRuleCode());
}
Cell carrierCell = r.createCell(3);
carrierCell.setCellStyle(cellStyle);
if (saleRules.get(i).getCarrier()==null) {
carrierCell.setCellValue("");
}else{
carrierCell.setCellValue(saleRules.get(i).getCarrier());
}
Cell orgCell = r.createCell(4);
orgCell.setCellStyle(cellStyle);
if (saleRules.get(i).getOrg()==null) {
orgCell.setCellValue("*");
}else{
orgCell.setCellValue(saleRules.get(i).getOrg());
}
Cell dstCell = r.createCell(5);
dstCell.setCellStyle(cellStyle);
if (saleRules.get(i).getDst()==null) {
dstCell.setCellValue("*");
}else{
dstCell.setCellValue(saleRules.get(i).getDst());
}
Cell applyFlightNumCell = r.createCell(6);
applyFlightNumCell.setCellStyle(cellStyle);
if (StringUtils.isBlank(saleRules.get(i).getApplyFlightNum())) {
applyFlightNumCell.setCellValue("");
}else{
applyFlightNumCell.setCellValue(saleRules.get(i).getApplyFlightNum());
}
Cell notApplicableFlightNumCell = r.createCell(7);
notApplicableFlightNumCell.setCellStyle(cellStyle);
if (StringUtils.isBlank(saleRules.get(i).getNotApplicableFlightNum())) {
notApplicableFlightNumCell.setCellValue("");
}else{
notApplicableFlightNumCell.setCellValue(saleRules.get(i).getNotApplicableFlightNum());
}
Cell routeTypeCell = r.createCell(8);
routeTypeCell.setCellStyle(cellStyle);
if (saleRules.get(i).getRouteType()==null) {
routeTypeCell.setCellValue("不限");
}else if (saleRules.get(i).getRouteType()==0) {
routeTypeCell.setCellValue("不限");
}else if (saleRules.get(i).getRouteType()==1) {
routeTypeCell.setCellValue("单程");
}else if (saleRules.get(i).getRouteType()==2) {
routeTypeCell.setCellValue("往返");
}else{
routeTypeCell.setCellValue("不限");
}
Cell policyType = r.createCell(9);
policyType.setCellStyle(cellStyle);
if (saleRules.get(i).getPolicyType()==null) {
policyType.setCellValue("普通");
}else if (saleRules.get(i).getPolicyType()==1) {
policyType.setCellValue("普通");
}else if (saleRules.get(i).getPolicyType()==2) {
policyType.setCellValue("积分");
}else if (saleRules.get(i).getPolicyType()==3) {
policyType.setCellValue("普通促销");
}else if (saleRules.get(i).getPolicyType()==4) {
policyType.setCellValue("扣位");
}else if (saleRules.get(i).getPolicyType()==5) {
policyType.setCellValue("促销积分");
}else if (saleRules.get(i).getPolicyType()==6) {
policyType.setCellValue("AG");
}else if (saleRules.get(i).getPolicyType()==7) {
policyType.setCellValue("私有运价");
}else{
policyType.setCellValue("普通");
}
Cell policyDesc = r.createCell(10);
policyDesc.setCellStyle(cellStyle);
if (saleRules.get(i).getPolicyDesc()==null) {
policyDesc.setCellValue("");
}else{
policyDesc.setCellValue(saleRules.get(i).getPolicyDesc());
}
Cell point = r.createCell(11);
point.setCellStyle(cellStyle);
if (saleRules.get(i).getPoint()==null) {
point.setCellValue("");
}else{
point.setCellValue(saleRules.get(i).getPoint());
}
Cell costPrice = r.createCell(12);
costPrice.setCellStyle(cellStyle);
if (saleRules.get(i).getCostPrice()==null) {
costPrice.setCellValue("");
}else{
costPrice.setCellValue(saleRules.get(i).getCostPrice());
}
Cell saleSdate = r.createCell(13);
saleSdate.setCellStyle(cellStyle);
if (saleRules.get(i).getSaleSdate()==null) {
saleSdate.setCellValue("");
}else{
saleSdate.setCellValue(saleRules.get(i).getSaleSdate());
}
Cell saleEdate = r.createCell(14);
saleEdate.setCellStyle(cellStyle);
if (saleRules.get(i).getSaleEdate()==null) {
saleEdate.setCellValue("");
}else{
saleEdate.setCellValue(saleRules.get(i).getSaleEdate());
}
Cell ticketDays = r.createCell(15);
ticketDays.setCellStyle(cellStyle);
if (saleRules.get(i).getTicketDays()==null) {
ticketDays.setCellValue("");
}else{
ticketDays.setCellValue(saleRules.get(i).getTicketDays());
}
Cell tripSdate = r.createCell(16);
tripSdate.setCellStyle(cellStyle);
if (saleRules.get(i).getTripSdate()==null) {
tripSdate.setCellValue("");
}else{
tripSdate.setCellValue(saleRules.get(i).getTripSdate());
}
Cell tripEdate = r.createCell(17);
tripEdate.setCellStyle(cellStyle);
if (saleRules.get(i).getTripEdate()==null) {
tripEdate.setCellValue("");
}else{
tripEdate.setCellValue(saleRules.get(i).getTripEdate());
}
Cell statusCell = r.createCell(18);
statusCell.setCellStyle(cellStyle);
if (saleRules.get(i).getStatus()==null) {
statusCell.setCellValue("禁用");
}else if (saleRules.get(i).getStatus()==0) {
statusCell.setCellValue("禁用");
}else if (saleRules.get(i).getStatus()==1) {
statusCell.setCellValue("启用");
}else{
statusCell.setCellValue("禁用");
}
Cell minPrice = r.createCell(19);
minPrice.setCellStyle(cellStyle);
if (saleRules.get(i).getMinPrice()==null) {
minPrice.setCellValue("");
}else{
minPrice.setCellValue(saleRules.get(i).getMinPrice());
}
Cell maxPrice = r.createCell(20);
maxPrice.setCellStyle(cellStyle);
if (saleRules.get(i).getMaxPrice()==null) {
maxPrice.setCellValue("");
}else{
maxPrice.setCellValue(saleRules.get(i).getMaxPrice());
}
Cell minProfit = r.createCell(21);
minProfit.setCellStyle(cellStyle);
if (saleRules.get(i).getMinProfit()==null) {
minProfit.setCellValue("");
}else{
minProfit.setCellValue(saleRules.get(i).getMinProfit());
}
Cell adultPricePoint = r.createCell(22);
adultPricePoint.setCellStyle(cellStyle);
if (saleRules.get(i).getAdultPricePoint()==null) {
adultPricePoint.setCellValue(0.0);
}else{
adultPricePoint.setCellValue(saleRules.get(i).getAdultPricePoint().toString());
}
Cell adultAddPrice = r.createCell(23);
adultAddPrice.setCellStyle(cellStyle);
if (saleRules.get(i).getAdultAddPrice()==null) {
adultAddPrice.setCellValue(0);
}else{
adultAddPrice.setCellValue(saleRules.get(i).getAdultAddPrice());
}
Cell adultAddTax = r.createCell(24);
adultAddTax.setCellStyle(cellStyle);
if (saleRules.get(i).getAdultAddTax()==null) {
adultAddTax.setCellValue(0);
}else{
adultAddTax.setCellValue(saleRules.get(i).getAdultAddTax());
}
// Cell adultTaxPoint = r.createCell(23);
// adultTaxPoint.setCellStyle(cellStyle);
// if (saleRules.get(i).getAdultPricePoint()==null) {
// adultTaxPoint.setCellValue(0.0);
// }else{
// adultTaxPoint.setCellValue(saleRules.get(i).getAdultPricePoint().toString());
// }
Cell adultTaxPoint = r.createCell(25);
adultTaxPoint.setCellStyle(cellStyle);
if (saleRules.get(i).getAdultTaxPoint()==null) {
adultTaxPoint.setCellValue(0.0);
}else{
adultTaxPoint.setCellValue(saleRules.get(i).getAdultTaxPoint().toString());
}
Cell childPricePoint = r.createCell(26);
childPricePoint.setCellStyle(cellStyle);
if (saleRules.get(i).getChildPricePoint()==null) {
childPricePoint.setCellValue(0.0);
}else{
childPricePoint.setCellValue(saleRules.get(i).getChildPricePoint().toString());
}
Cell childAddPrice = r.createCell(27);
childAddPrice.setCellStyle(cellStyle);
if (saleRules.get(i).getChildAddPrice()==null) {
childAddPrice.setCellValue(0);
}else{
childAddPrice.setCellValue(saleRules.get(i).getChildAddPrice());
}
Cell childAddTax = r.createCell(28);
childAddTax.setCellStyle(cellStyle);
if (saleRules.get(i).getChildAddTax()==null) {
childAddTax.setCellValue(0);
}else{
childAddTax.setCellValue(saleRules.get(i).getChildAddTax());
}
Cell childTaxPoint = r.createCell(29);
childTaxPoint.setCellStyle(cellStyle);
if (saleRules.get(i).getChildTaxPoint()==null) {
childTaxPoint.setCellValue(0.0);
}else{
childTaxPoint.setCellValue(saleRules.get(i).getChildTaxPoint().toString());
}
Cell cabinCode = r.createCell(30);
cabinCode.setCellStyle(cellStyle);
cabinCode.setCellValue(saleRules.get(i).getCabinCode());
Cell saleRuleId = r.createCell(31);
saleRuleId.setCellStyle(cellStyle);
if (saleRuleId!=null) {
saleRuleId.setCellValue(saleRules.get(i).getId());
}
Cell flightCycle = r.createCell(32);
flightCycle.setCellStyle(cellStyle);
if (StringUtils.isBlank(saleRules.get(i).getFlightCycle())) {
flightCycle.setCellValue("");
}else{
flightCycle.setCellValue(saleRules.get(i).getFlightCycle());
}
Cell floorPrice = r.createCell(33);
floorPrice.setCellStyle(cellStyle);
if (saleRules.get(i).getFloorPrice() == null) {
floorPrice.setCellValue("");
}else{
floorPrice.setCellValue(saleRules.get(i).getFloorPrice());
}
Cell floorTax = r.createCell(34);
floorTax.setCellStyle(cellStyle);
if (saleRules.get(i).getFloorTax() == null) {
floorTax.setCellValue("");
}else{
floorTax.setCellValue(saleRules.get(i).getFloorTax());
}
Cell fitShare = r.createCell(35);
fitShare.setCellStyle(cellStyle);
if (saleRules.get(i).getFitShare() == null) {
fitShare.setCellValue("");
}else{
if(saleRules.get(i).getFitShare() == 1){
fitShare.setCellValue("适用");
}else if(saleRules.get(i).getFitShare() == 0){
fitShare.setCellValue("不适用");
}else {
fitShare.setCellValue(saleRules.get(i).getFitShare());
}
}
Cell fitNationality = r.createCell(36);
fitNationality.setCellStyle(cellStyle);
if (saleRules.get(i).getFitNationality() == null) {
fitNationality.setCellValue("");
}else{
fitNationality.setCellValue(saleRules.get(i).getFitNationality());
}
Cell disFitNationality = r.createCell(37);
fitNationality.setCellStyle(cellStyle);
if (saleRules.get(i).getDisFitNationality() == null) {
disFitNationality.setCellValue("");
}else{
disFitNationality.setCellValue(saleRules.get(i).getDisFitNationality());
}
Cell ageRange = r.createCell(38);
ageRange.setCellStyle(cellStyle);
if (saleRules.get(i).getAgeRange() == null) {
ageRange.setCellValue("");
}else{
ageRange.setCellValue(saleRules.get(i).getAgeRange());
}
Cell attention = r.createCell(39);
attention.setCellStyle(cellStyle);
if (saleRules.get(i).getAttention() == null) {
attention.setCellValue("");
}else{
attention.setCellValue(saleRules.get(i).getAttention());
}
}
//创建输出流
os = new FileOutputStream(filePath+file);
//将book中的数据写出
book.write(os);
}catch (Exception e) {
logger.error("fail:",e);
}finally {
try {
if(book!=null){
book.close();
}
if(os!=null){
os.close();
}
}catch (Exception e){
logger.error("关闭流异常",e);
}
}
Response response = new Response();
response.setStatus(Response.Status.SUCCEED);
response.setData(filePath+file);
return response;
}
public static HSSFWorkbook getBook(File file) {
HSSFWorkbook book = null ;
try {
book = new HSSFWorkbook(new FileInputStream(file));
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return book;
}
protected static Object getCellString(HSSFCell cell) {
Object result = null;
if (cell != null) {
int cellType = cell.getCellType();
switch (cellType) {
case HSSFCell.CELL_TYPE_STRING:
result = cell.getStringCellValue();
break;
case HSSFCell.CELL_TYPE_NUMERIC:
result = cell.getNumericCellValue();
break;
case HSSFCell.CELL_TYPE_FORMULA:
result = cell.getNumericCellValue();
break;
case HSSFCell.CELL_TYPE_ERROR:
result = null;
break;
case HSSFCell.CELL_TYPE_BOOLEAN:
result = cell.getBooleanCellValue();
break;
case HSSFCell.CELL_TYPE_BLANK:
result = null;
break;
}
}
return result;
}
public Response parseToSaleDetail(String requestBody){
logger.info("自动报表任务请求解析报表。。。");
if(StringUtils.isBlank(requestBody)){
return Response.error("参数为空");
}
JSONObject obj = JSONObject.parseObject(requestBody);
Map<String, String> params = JSONObject.parseObject(obj.getString("data"), new TypeReference<Map<String, String>>(){});
String key = obj.getString("info");
//将Map解析为报表内容对象
List<SaleDetail> saleDetailList = new ArrayList<>();
try{
//解析主逻辑
saleDetailList = parseToSaleDetail.parseToSaleDetailMain(params,key);
}catch (Exception e){
logger.error("[自动报表] 解析Map到SaleDetail List 出现异常",e);
}
logger.info("自动报表任务解析数据完成,解析结果:saleDetailList.size() = " + saleDetailList.size());
return Response.success(saleDetailList);
}
public Response downLoadSaleDetailFromAutoSource(String requestBody){
String keyList = JSONObject.parseObject(requestBody).getString("keyList");
logger.info("[AutoSource] 从saleDetail表数据中直接下载报表,keyList="+keyList);
long beginTime = System.currentTimeMillis();
Map<String,String> params = new HashMap<>();
params.put("keyList",keyList);
String result = HttpsSendData.send(overseasAirTicketUrl + "autoSaleDetai/findByKeyList.do",params);
NoteResult noteResult = JSONObject.parseObject(result, NoteResult.class);
if(noteResult.getStatus() != 0){
logger.error("[AutoSource] 从saleDetail表中查询报表数据失败,keyList="+keyList);
return Response.error("[AutoSource] 从saleDetail表中查询报表数据失败,key="+keyList);
}
List<SaleDetail> saleDetails = JSONArray.parseArray(JSONArray.toJSONString(noteResult.getData()),SaleDetail.class);
Response response = new Response();
logger.info("[AutoSource] 获取数据库表数据,总用时:"+(System.currentTimeMillis()-beginTime)+"ms");
try{
String customerId = keyList.substring(0,keyList.indexOf("_"));
final String filePath = saleDetailReportExcelPath + customerId + "/SalesDetailReport/";//指定文件保存路径
String path = parseToSaleDetail.createSaleDetailReport(saleDetails,filePath);
response.setStatus(Response.Status.SUCCEED);
response.setData(path);
response.setErrorMessage("[AutoSource] 生成报表成功,总用时:"+(System.currentTimeMillis()-beginTime)+"ms");
logger.info("[AutoSource] 生成销售明细报表,总用时:"+(System.currentTimeMillis()-beginTime)+"ms");
return response;
}catch (Exception e){
logger.error("[AutoSource] 生成报表发生异常",e);
return Response.error("[AutoSource] 生成报表发生异常");
}
}
}
package com.yutu.base.service;
import com.alibaba.fastjson.JSONObject;
import com.yutu.base.entity.Response;
import com.yutu.base.utils.HttpsSendData;
import org.apache.log4j.Logger;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.*;
/**
* 静态消息队列包含了异步响应的发送地址和发送内容
*/
@Component
public class MessageQueueController implements CommandLineRunner {
private static Logger logger = Logger.getLogger("messagequeue");
//响应消息队列,元素 Map<响应url,响应对象>
public static BlockingQueue<Map<String, Response>> responseMessageQueue = new LinkedBlockingDeque<>();
//提供入队列方法
public static void setResponseMessageQueue(String responseUrl,Response response) {
Map<String,Response> responseMap = new HashMap<>();
responseMap.put(responseUrl,response);
try{
responseMessageQueue.put(responseMap);
}catch (Exception e){
logger.error("响应消息队列,入队列异常,参数:"+responseUrl+","+response);
}
}
@Override
public void run(String... args) throws Exception {
//启动即加载本任务
logger.info("启动程序即开始消费响应消息队列");
consumeResponseMessageQueue();
}
//消费响应消息队列
private void consumeResponseMessageQueue(){
ExecutorService threadPool = Executors.newFixedThreadPool(1);
Runnable consumeTask = new Runnable() {
@Override
public void run() {
while (true){
logger.info("响应消息队列当前长度:"+responseMessageQueue.size());
Map<String,Response> map = null;
try {
map = responseMessageQueue.take();
for(Map.Entry entry:map.entrySet()){
String url = String.valueOf(entry.getKey());
Response response = (Response)entry.getValue();
logger.info("响应消息队列,获取和执行发送任务,参数:responseUrl="+url+",Response="+response);
sendResponse(url,response);
}
}catch (Exception e) {
logger.error("响应消息队列执行任务时异常,参数"+map);
}
}
}
};
threadPool.execute(consumeTask);
}
//发送响应消息
private void sendResponse(String url,Response response){
try{
HttpsSendData.getPost(url, JSONObject.toJSONString(response));
}catch (Exception e){
logger.error("发送异步响应消息异常",e);
}
}
}
package com.yutu.base.service;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yutu.base.entity.NoteResult;
import com.yutu.base.entity.Response;
import com.yutu.base.entity.Store;
import com.yutu.base.entity.User;
import com.yutu.base.utils.HttpsSendData;
import com.yutu.base.utils.MyComparator;
import jxl.CellView;
import jxl.Workbook;
import jxl.format.Alignment;
import jxl.format.Colour;
import jxl.format.UnderlineStyle;
import jxl.write.*;
import jxl.write.Number;
import org.apache.commons.lang3.StringUtils;
import org.apache.log4j.Logger;
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
import org.apache.poi.hssf.usermodel.HSSFFont;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Service;
import java.io.File;
import java.io.FileOutputStream;
import java.text.DecimalFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
/**
* 订单相关业务层
*/
@Service
public class OrderService extends BaseService{
private Logger logger = Logger.getLogger("orderService");
@Value("${spring.urlConfig.overseasAirTicketUrl}")
private String overseasAirTicketUrl;
@Value("${spring.pathConfig.saleReportExcelPath}")
private String saleReportExcelPath;
public Response exportOrderInfo(String requestBody){
if(StringUtils.isBlank(requestBody)){
return Response.error("参数不能为空");
}
JSONObject reqObj = JSONObject.parseObject(requestBody);
if(reqObj == null){
return Response.error("参数有误");
}
String startTime = reqObj.getString("startTime");
String endTime = reqObj.getString("endTime");
String customerId = reqObj.getString("customerId");
if(StringUtils.isBlank(startTime) || StringUtils.isBlank(endTime) || StringUtils.isBlank(customerId)){
return Response.error("参数不能为空,必传参数:startTime、endTime、customerId");
}
Map<String,String> params = new HashMap<>();
params.put("startTime",startTime);
params.put("endTime",endTime);
params.put("CustomerId",customerId);
params.put("pagination","1");
params.put("line_number","10000");
NoteResult nr = getOrderInfos(params);
if(nr.getStatus() != 0){
return Response.error("查询数据为空");
}
JSONArray orderInfos = (JSONArray) nr.getData();
String filePath = createOrderInfoExcel(orderInfos,customerId,startTime);
Response response = Response.success();
response.setData(filePath);
response.setErrorMessage("生成订单信息完毕!");
return response;
}
//获取指定生单时间范围的全部订单
public NoteResult getOrderInfos(Map<String,String> paramsMap){
NoteResult noteResult = new NoteResult(2,null,null);
paramsMap.put("OrderStatus","2");
String result2= HttpsSendData.send(overseasAirTicketUrl+"/orderInfo/findAllBy.do", paramsMap);
JSONObject jsonObject2 = JSONObject.parseObject(result2);
JSONArray jsonArray2 = jsonObject2.getJSONArray("data");
paramsMap.put("OrderStatus","3");
String result3= HttpsSendData.send(overseasAirTicketUrl+"/orderInfo/findAllBy.do", paramsMap);
JSONObject jsonObject3 = JSONObject.parseObject(result3);
JSONArray jsonArray3 = jsonObject3.getJSONArray("data");
paramsMap.put("OrderStatus","4");
String result4= HttpsSendData.send(overseasAirTicketUrl+"/orderInfo/findAllBy.do", paramsMap);
JSONObject jsonObject4 = JSONObject.parseObject(result4);
JSONArray jsonArray4 = jsonObject4.getJSONArray("data");
jsonArray4.addAll(jsonArray2);
jsonArray4.addAll(jsonArray3);
if(jsonArray4!=null && jsonArray4.size() > 0){
noteResult.setStatus(0);
noteResult.setMsg("获取成功");
noteResult.setData(jsonArray4);
}
return noteResult;
}
//解析订单信息生成订单信息Excel表
public String createOrderInfoExcel(JSONArray orderInfos,String customerId,String startTime) {
String fileBasePath = saleReportExcelPath + customerId + "/OrderInfoExcel/";;
SimpleDateFormat sdf = new SimpleDateFormat("yyyy_MM_dd_HH_mm_ss");
String date = sdf.format(new Date());
File file = new File( startTime.replace(" ","").replace(":","")+ "订单信息"+date+".xls");
System.out.println(file);
FileOutputStream os = null;
HSSFWorkbook book = null;
try{
//创建工作薄
book = new HSSFWorkbook();
HSSFSheet sheet = book.createSheet("订单信息");
sheet.setColumnWidth(2, 25 * 256);
sheet.setColumnWidth(3, 25 * 256);
sheet.setColumnWidth(6, 30 * 256);
sheet.setColumnWidth(1, 21 * 256);
sheet.setColumnWidth(9, 21 * 256);
// 创建单元格样式
HSSFCellStyle cellStyleTitle = book.createCellStyle();
// 指定单元格居中对齐
// cellStyleTitle.setAlignment(HSSFCellStyle.ALIGN_CENTER);
// 指定单元格垂直居中对齐
// cellStyleTitle.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);
// 指定当单元格内容显示不下时自动换行
cellStyleTitle.setWrapText(true);
// ------------------------------------------------------------------
HSSFCellStyle cellStyle = book.createCellStyle();
// 指定单元格居中对齐
// cellStyle.setAlignment(HSSFCellStyle.ALIGN_CENTER);
// 指定单元格垂直居中对齐
// cellStyle.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);
// 指定当单元格内容显示不下时自动换行
cellStyle.setWrapText(true);
// ------------------------------------------------------------------
// 设置单元格字体
HSSFFont font = book.createFont();
// font.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
font.setFontName("宋体");
font.setColor(new Short("255"));
font.setFontHeight((short) 200);
cellStyleTitle.setFont(font);
//创建标题行
Row title = sheet.createRow(0);
title.setRowStyle(cellStyleTitle);
//航司
Cell carrierTitle = title.createCell(0);
carrierTitle.setCellStyle(cellStyleTitle);
carrierTitle.setCellValue("序号");
//信用余额
Cell creditTitle = title.createCell(1);
creditTitle.setCellStyle(cellStyleTitle);
creditTitle.setCellValue("生单时间");
//账户编码
Cell accountIdTitle = title.createCell(2);
accountIdTitle.setCellStyle(cellStyleTitle);
accountIdTitle.setCellValue("本地订单号");
//账户
Cell accountTitle = title.createCell(3);
accountTitle.setCellStyle(cellStyleTitle);
accountTitle.setCellValue("外部订单号");
//账户
Cell statusTitle = title.createCell(4);
statusTitle.setCellStyle(cellStyleTitle);
statusTitle.setCellValue("订单状态");
//密码
Cell passwordTitle = title.createCell(5);
passwordTitle.setCellStyle(cellStyleTitle);
passwordTitle.setCellValue("渠道");
//邮箱密码
Cell mailPasswordTitle = title.createCell(6);
mailPasswordTitle.setCellStyle(cellStyleTitle);
mailPasswordTitle.setCellValue("乘客姓名(票号)");
//积分值
Cell pointTitle = title.createCell(7);
pointTitle.setCellStyle(cellStyleTitle);
pointTitle.setCellValue("行程");
//可用旅客人数
Cell usableNumTitle = title.createCell(8);
usableNumTitle.setCellStyle(cellStyleTitle);
usableNumTitle.setCellValue("航班号");
Cell flightTimeTitle = title.createCell(9);
flightTimeTitle.setCellStyle(cellStyleTitle);
flightTimeTitle.setCellValue("起飞时间");
//遍历销售规则数据列表
for (int i = 0; i < orderInfos.size(); i++) {
Row r = sheet.createRow(i + 1);
Cell indeixCell = r.createCell(0);
indeixCell.setCellStyle(cellStyle);
indeixCell.setCellValue(i + 1);
Cell usablePassengerNumCell = r.createCell(1);
usablePassengerNumCell.setCellStyle(cellStyle);
if (orderInfos.getJSONObject(i).getString("createTime") != null) {
usablePassengerNumCell.setCellValue(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(orderInfos.getJSONObject(i).getDate("createTime")));
}
Cell carrierCell = r.createCell(2);
carrierCell.setCellStyle(cellStyle);
if (orderInfos.getJSONObject(i).getString("orderNo") != null) {
carrierCell.setCellValue(orderInfos.getJSONObject(i).getString("orderNo"));
}
Cell accountIdCell = r.createCell(3);
accountIdCell.setCellStyle(cellStyle);
if (orderInfos.getJSONObject(i).getString("outerOrderNo") != null) {
accountIdCell.setCellValue(orderInfos.getJSONObject(i).getString("outerOrderNo"));
}
String status = "";
if(orderInfos.getJSONObject(i).getInteger("orderStatus") == 2){
status = "待出票";
}else if(orderInfos.getJSONObject(i).getInteger("orderStatus") == 3){
status = "出票中";
}else if(orderInfos.getJSONObject(i).getInteger("orderStatus") == 4){
status = "已出票";
}
Cell statusCell = r.createCell(4);
statusCell.setCellStyle(cellStyle);
statusCell.setCellValue(status);
Cell accountCell = r.createCell(5);
accountCell.setCellStyle(cellStyle);
if (orderInfos.getJSONObject(i).getString("orderBelong") != null) {
accountCell.setCellValue(orderInfos.getJSONObject(i).getString("orderBelong"));
}
JSONArray passengers = orderInfos.getJSONObject(i).getJSONArray("orderPassengers");
JSONArray flights = orderInfos.getJSONObject(i).getJSONArray("orderFlightInfos");
String passengerInfo = "";
for (int j = 0; j < passengers.size(); j++) {
JSONObject pass = passengers.getJSONObject(j);
String name = pass.getString("passengerName");
String pnr = pass.getString("ticketNumber");
if(StringUtils.isBlank(passengerInfo)){
passengerInfo += name + "(" + pnr + ");";
}else{
passengerInfo += "\n\r"+ name + "(" + pnr + ");";
}
}
Cell passwordCell = r.createCell(6);
passwordCell.setCellStyle(cellStyle);
passwordCell.setCellValue(passengerInfo);
String flightInfo = "";
String flightNumber = "";
String flightTime = "";
for (int j = 0; j < flights.size(); j++) {
JSONObject flight = flights.getJSONObject(j);
String org = flight.getString("org");
String dst = flight.getString("dst");
if(StringUtils.isBlank(flightInfo)){
flightInfo += org + "-" + dst;
}else {
flightInfo += "\n\r"+ org + "-" + dst;
}
String flightNo = flight.getString("flightNo");
if(StringUtils.isBlank(flightNo)){
flightNumber += flightNo;
}else {
flightNumber += "\n\r"+ flightNo;
}
String flightTimeStr = flight.getString("flightTime");
if(StringUtils.isBlank(flightTimeStr)){
flightTime += flightTimeStr;
}else {
flightTime += "\n\r"+ flightTimeStr;
}
}
Cell emailPassCell = r.createCell(7);
emailPassCell.setCellStyle(cellStyle);
emailPassCell.setCellValue(flightInfo);
Cell pointCell = r.createCell(8);
pointCell.setCellStyle(cellStyle);
pointCell.setCellValue(flightNumber);
Cell flightTimeCell = r.createCell(9);
flightTimeCell.setCellStyle(cellStyle);
flightTimeCell.setCellValue(flightTime);
}
//创建输出流
os = new FileOutputStream(fileBasePath + file);
//将book中的数据写出
book.write(os);
}catch (Exception e){
logger.info("生成订单信息Excel异常,异常信息",e);
}finally {
try {
os.close();//关闭流
book.close();
} catch (Exception e2) {
e2.printStackTrace();
}
}
return fileBasePath + file;
}
}
package com.yutu.base.service;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yutu.base.entity.Response;
import com.yutu.base.entity.SaleDetail;
import com.yutu.base.entity.Store;
import com.yutu.base.entity.User;
import io.swagger.models.auth.In;
import jxl.CellView;
import jxl.Workbook;
import jxl.format.Alignment;
import jxl.format.Colour;
import jxl.format.UnderlineStyle;
import jxl.write.*;
import jxl.write.Number;
import org.apache.commons.lang3.StringUtils;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
import java.io.File;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.*;
/**
* 将传入的销售报表明细解析成List<SaleDetail>
*/
@Service
@Component
public class ParseToSaleDetail extends BaseService{
private Logger logger = Logger.getLogger("download");
//生成销售明细报表
public List<SaleDetail> parseToSaleDetailMain(Map<String,String> map,String key){
List<User> userlist = getUsers();
List<Store> storelist = getStores();
logger.info("[自动报表] 开始解析报表对象");
List<SaleDetail> saleDetailList = new ArrayList<>();
String orderDetail = map.get("other");
String purchase = map.get("orderpurchase");
String transactiondetail = map.get("transactiondetail");
JSONArray orderArr = JSONArray.parseArray(orderDetail);
JSONArray purchArr = JSONArray.parseArray(purchase);
JSONArray transArr = JSONArray.parseArray(transactiondetail);
try{
int num = 0;//当前行
int count_transDetail = 0;
int count_saleOrder = 0;
String orderIdStr = "";
//遍历采购信息
for(int k=0;k<purchArr.size();k++){
SaleDetail temp = new SaleDetail();
temp.setId(UUID.randomUUID().toString());
temp.setCreateTime(new Date());
temp.setUpdateTime(new Date());
temp.setKey(key);//标识
temp.setOfficalReceivedPaymentStatus("");
temp.setOfficalActualExpendAmount(0.0);
temp.setOfficalBalance(0.0);
temp.setOfficalRateAdjustDate(null);
//num值每次更新的时候,就给List<SaleDetail> 更新对象数量
saleDetailList.add(temp);
int mergeNum = 0;//合并行数
Double profit = 0.0;//利润
JSONObject purchObj = purchArr.getJSONObject(k);
Integer deleted = purchObj.getInteger("deleted");
if(deleted != 0){//已作废、非完整的 的采购信息跳过
continue;
}
String purchaseId = purchObj.getString("purchaseId");//采购id
String saleOrderId = purchObj.getString("orderId");//销售id
if("".equals(saleOrderId) || saleOrderId==null) continue;
String flightInfoIds = purchObj.getString("flightInfoIds");//航班id
String passengerIds = purchObj.getString("passengerIds");//乘客id
int flightSize = flightInfoIds.replace(",","").length()/36;//行程段数
int passengerSize = passengerIds.replace(",","").length()/36;//乘客人量
String route = purchObj.getString("routeType");
String orderTripType = "";//订单行程类型
String routeType = convertRouteType(route);//采购行程类型
String ticketType = convertRouteType(route);//票号类型
String points = purchObj.getString("points");//使用积分
String localCurrency = purchObj.getString("localCurrencyCode");//采购币种
String currency = purchObj.getString("currencyCode");//采购币种
String localTotalPrice = purchObj.getString("localTotalPrice");//外币金额
String purchaseTotalPrice = purchObj.getString("purchaseTotalPrice");//本币金额
String orderValuedAddedOrderNo = purchObj.getString("orderValuedAddedOrderNo");//增值服务单号
String purchaseChannel = purchObj.getString("purchaseChannel");//采购渠道
String purchaseAccount = purchObj.getString("purchaseAccount");//采购账户
String purchaseOrderNo = purchObj.getString("purchaseOrderNo");//采购订单号
String purchaseOperator = purchObj.getString("purchaseOperator");//出票人
String purchaseTime = purchObj.getString("purchaseTime");//出票时间
String remarkText = purchObj.getString("remarkText");//备注信息
String trueName = "";
if(userlist!=null && userlist.size()>0){
for(int tName=0;tName<userlist.size();tName++){
if(userlist.get(tName).getUserID().equals(purchaseOperator)){
trueName=userlist.get(tName).getUsername();//出票人真名
break;
}
}
}
String orderType = purchObj.getString("orderType");
orderType = convertOrderType(orderType);
String owPolicyType = "";//政策类型
String rtPolicyType = "";//政策类型(返程)
String owPolicyCode = "";
String rtPolicyCode = "";
List<String> policySourceArr = new ArrayList<String>();
saleDetailList.get(num).setPoints(Integer.parseInt(points));//14
saleDetailList.get(num).setPurchaseCurrency(localCurrency);//15
saleDetailList.get(num).setOrderValueAddedNo(orderValuedAddedOrderNo);//24
saleDetailList.get(num).setPurchaseChannel(purchaseChannel);//25
saleDetailList.get(num).setPurchaseAccount(purchaseAccount);//26
saleDetailList.get(num).setPurchaseOrderNo(purchaseOrderNo);//27
saleDetailList.get(num).setOperator(trueName);//31
saleDetailList.get(num).setPurchaseTime(purchObj.getDate("purchaseTime"));//32
saleDetailList.get(num).setOrderValueAdded(orderType);//33
saleDetailList.get(num).setRemark(remarkText);//35
saleDetailList.get(num).setPurchasePrice_local(Double.parseDouble(localTotalPrice));//16
saleDetailList.get(num).setPurchasePrice_rmb(Double.parseDouble(purchaseTotalPrice));//17
//反推销售单信息
count_saleOrder = 0;
Double combinOrderTotalPrice = 0.0;
String ORDERID = "";
Date createTime = null;//采购时间
Date ticketTime = null;//出票时间
String outerOrderNo = "";//外币订单号
Store store = new Store();//店铺信息
String flightLine = "";
String flightTime = "";
String flightNo = "";
String productType = "";//附加产品类型
String productDetail = "";//附加产品规格
String pnr = "";
String ticketNumber = "";
String status = "";
Double orderValuedPrice = 0.0;
for(int j=0;j<orderArr.size();j++){
JSONObject orderObj = orderArr.getJSONObject(j);
String orderId = orderObj.getString("iD");
if(saleOrderId.indexOf(orderId)>-1){//匹配成功
ORDERID = orderId;
count_saleOrder++;
//num值每次更新的时候,就给List<SaleDetail> 更新对象数量
if(count_saleOrder > 1){
SaleDetail temp1 = new SaleDetail();
temp1.setId(UUID.randomUUID().toString());
temp1.setCreateTime(new Date());
temp1.setUpdateTime(new Date());
temp1.setKey(key);//标识
temp1.setOfficalReceivedPaymentStatus("");
temp1.setOfficalActualExpendAmount(0.0);
temp1.setOfficalBalance(0.0);
temp1.setOfficalRateAdjustDate(null);
saleDetailList.add(temp1);
}
createTime = orderObj.getDate("createTime");
ticketTime = orderObj.getDate("ticketTime");
outerOrderNo = orderObj.getString("outerOrderNo");
String orderBelong = orderObj.getString("orderBelong");
if(storelist!=null && storelist.size()>0){
for(int tName=0;tName<storelist.size();tName++){
if(storelist.get(tName).getId().equals(orderBelong)){
store = storelist.get(tName);
break;
}
}
}
String saleTotlalPrice = orderObj.getString("totalPrice");
int orderStatus = orderObj.getInteger("orderStatus");//订单状态
String policySource = orderObj.getString("policySource");//政策信息
status = convertOrderStatus(orderStatus);
saleDetailList.get(num+count_saleOrder-1).setCreateOrderTime(orderObj.getDate("createTime"));//0
saleDetailList.get(num+count_saleOrder-1).setTicketTime(orderObj.getDate("ticketTime"));//1
saleDetailList.get(num+count_saleOrder-1).setOuterOrderNo(outerOrderNo);//2
saleDetailList.get(num+count_saleOrder-1).setChannel(store.getChannelCode());//3
saleDetailList.get(num+count_saleOrder-1).setStore(store.getStoreShortName());//4
saleDetailList.get(num+count_saleOrder-1).setOrderStatus(status);//30
//政策信息
if(policySource!=null && !"".equals(policySource)){
policySourceArr = Arrays.asList(policySource.split("_",-1));
}
if(policySourceArr.size()==2){// 去哪儿、同城、航管等 //单程
if("0".equals(policySourceArr.get(0))) owPolicyType = "默认";
if("1".equals(policySourceArr.get(0))) owPolicyType = "普通";
if("2".equals(policySourceArr.get(0))) owPolicyType = "积分";
if("3".equals(policySourceArr.get(0))) owPolicyType = "普通促销";
owPolicyCode = policySourceArr.get(1);
saleDetailList.get(num+count_saleOrder-2).setPolicyType(owPolicyType);//28
saleDetailList.get(num+count_saleOrder-2).setPolicyCode(policySourceArr.get(1));//29
}
if(policySourceArr.size()==4){// 淘宝-->单程或者往返 其他平台-->往返
if("0".equals(policySourceArr.get(0))) owPolicyType = "默认";
if("1".equals(policySourceArr.get(0))) owPolicyType = "普通";
if("2".equals(policySourceArr.get(0))) owPolicyType = "积分";
if("3".equals(policySourceArr.get(0))) owPolicyType = "普通促销";
if("0".equals(policySourceArr.get(2))) rtPolicyType = "默认";
if("1".equals(policySourceArr.get(2))) rtPolicyType = "普通";
if("2".equals(policySourceArr.get(2))) rtPolicyType = "积分";
if("3".equals(policySourceArr.get(2))) rtPolicyType = "普通促销";
if("".equals(policySourceArr.get(2)) && "".equals(policySourceArr.get(3))){
saleDetailList.get(num+count_saleOrder-1).setPolicyType(owPolicyType);//28
saleDetailList.get(num+count_saleOrder-1).setPolicyCode(policySourceArr.get(1));//29
}else{
saleDetailList.get(num+count_saleOrder-1).setPolicyType("去程:"+owPolicyType+"\r\n回程:"+rtPolicyType);//28
saleDetailList.get(num+count_saleOrder-1).setPolicyCode("去程:"+policySourceArr.get(1)+"\r\n回程:"+policySourceArr.get(3));//29
owPolicyCode = "去程:"+owPolicyType+"\r\n回程:"+rtPolicyType;
rtPolicyCode = "去程:"+policySourceArr.get(1)+"\r\n回程:"+policySourceArr.get(3);
}
}
if(policySourceArr.size()>=6){// 最新更新后政策信息
if("0".equals(policySourceArr.get(1))) owPolicyType = "默认";
if("1".equals(policySourceArr.get(1))) owPolicyType = "普通";
if("2".equals(policySourceArr.get(1))) owPolicyType = "积分";
if("3".equals(policySourceArr.get(1))) owPolicyType = "普通促销";
if("4".equals(policySourceArr.get(1))) owPolicyType = "官网押位";
if("0".equals(policySourceArr.get(4))) rtPolicyType = "默认";
if("1".equals(policySourceArr.get(4))) rtPolicyType = "普通";
if("2".equals(policySourceArr.get(4))) rtPolicyType = "积分";
if("3".equals(policySourceArr.get(4))) rtPolicyType = "普通促销";
if("4".equals(policySourceArr.get(4))) rtPolicyType = "官网押位";
if("".equals(policySourceArr.get(4))){
saleDetailList.get(num+count_saleOrder-1).setPolicyType(owPolicyType);//28
saleDetailList.get(num+count_saleOrder-1).setPolicyCode(policySourceArr.get(2));//29
}else{
saleDetailList.get(num+count_saleOrder-1).setPolicyType("去程:"+owPolicyType+"\r\n回程:"+rtPolicyType);//28
saleDetailList.get(num+count_saleOrder-1).setPolicyCode("去程:"+policySourceArr.get(2)+"\r\n回程:"+policySourceArr.get(5));//29
owPolicyCode = "去程:"+owPolicyType+"\r\n回程:"+rtPolicyType;
rtPolicyCode = "去程:"+policySourceArr.get(2)+"\r\n回程:"+policySourceArr.get(5);
}
}
//写入附加产品规格
JSONArray ordervalueadded_info=orderObj.getJSONArray("ordervalueadded");//附加产品信息json
if(!"".equals(ordervalueadded_info) &&ordervalueadded_info!=null){
for(int x=0;x<ordervalueadded_info.size();x++){
JSONObject ordervalueadded_data=ordervalueadded_info.getJSONObject(x);
productType = ordervalueadded_data.getString("productType");//产品类型
String specifications = ordervalueadded_data.getString("specifications");//产品规格
String productUnit = ordervalueadded_data.getString("productUnit");//产品单位
String quantity = ordervalueadded_data.getString("quantity");//购买数量
String price = ordervalueadded_data.getString("price");//购买价格
String tripType = ordervalueadded_data.getString("tripType");//行程类型
String passengerName = ordervalueadded_data.getString("passengerName");//乘客姓名
if("1".equals(productType)){
productType = "行李";
}else if("2".equals(productType)){
productType = "值机";
}else if("3".equals(productType)){
productType = "餐食";
}else if("4".equals(productType)){
productType = "WIFI";
}
if("0".equals(tripType)){
tripType = "所有";
}else if("1".equals(tripType)){
tripType = "单去程";
}else if("2".equals(tripType)){
tripType = "单回程";
}
//2019-03-29注释,原因:订单信息中行李价格为单份总价,并非单价,数量代表一份行李的数量,重量代表一份行李重量
//orderValuedPrice += Double.parseDouble(price)*Double.parseDouble(quantity);
orderValuedPrice += Double.parseDouble(price);
productDetail += ("["+passengerName+"-规格:"+specifications+productUnit+";数量:"+quantity+";价格:"+price+";行程:"+tripType+"];");
}
}
//销售金额
if(orderIdStr.indexOf(orderId)==-1){
orderIdStr += orderId;
}else{
saleTotlalPrice = "0";
orderValuedPrice = 0.0;
}
saleDetailList.get(num+count_saleOrder-1).setOrderValueAddedSpecific(productDetail);
saleDetailList.get(num+count_saleOrder-1).setLuggagePrice(orderValuedPrice);
saleDetailList.get(num+count_saleOrder-1).setSalePrice(Double.parseDouble(saleTotlalPrice));
combinOrderTotalPrice += Double.parseDouble(saleTotlalPrice);
//航班信息
JSONArray flightArr = orderObj.getJSONArray("orderflightinfo");
flightLine = "";
flightTime = "";
flightNo = "";
if(flightArr.size()==1) orderTripType = "单程";
if(flightArr.size()==2) orderTripType = "往返";
if(flightArr.size()==3) orderTripType = "转机";
for(int fli=0;fli<flightArr.size();fli++){
JSONObject flightObject = flightArr.getJSONObject(fli);
String flightId = flightObject.getString("iD");
if(flightSize==1){
if(flightInfoIds.indexOf(flightId)>-1){
flightLine = flightObject.getString("org")+"-"+flightObject.getString("dst");
flightTime = flightObject.getString("flightTime");
flightNo = flightObject.getString("flightNo");
}
}else{
if(flightInfoIds.indexOf(flightId)>-1){
if(fli != flightArr.size()-1){
flightLine += flightObject.getString("org")+"-"+flightObject.getString("dst")+"\n";
flightNo += flightObject.getString("flightNo")+"\n";
}else {
flightLine += flightObject.getString("org")+"-"+flightObject.getString("dst");
flightNo += flightObject.getString("flightNo");
}
flightTime += flightObject.getString("flightTime");
}
}
}
saleDetailList.get(num+count_saleOrder-1).setTairLine(flightLine);//5
saleDetailList.get(num+count_saleOrder-1).setFlightTime(flightTime);//6
saleDetailList.get(num+count_saleOrder-1).setFlightNumber(flightNo);//7
saleDetailList.get(num+count_saleOrder-1).setTripType(orderTripType);//8
saleDetailList.get(num+count_saleOrder-1).setPnrType(ticketType);//9
//乘客信息
String passengerNames = "";
Integer adultCount = 0;
Integer childCount = 0;
JSONArray passengerArr = orderObj.getJSONArray("orderpassenger");
for(int pass=0;pass<passengerArr.size();pass++){
JSONObject passengerObj = passengerArr.getJSONObject(pass);
String passengerId = passengerObj.getString("iD");
if(passengerIds.indexOf(passengerId)>-1){
pnr = passengerObj.getString("pnr");
ticketNumber = passengerObj.getString("ticketNumber");
passengerNames += passengerObj.getString("passengerName")+",";
Integer passengerType = passengerObj.getInteger("passengerType");
if(passengerType == 0){
adultCount ++ ;
}else {
childCount ++ ;
}
}
}
if(pnr.indexOf("/")>-1){
if("去程".equals(routeType) || "往返".equals(routeType)){
pnr = pnr.substring(0,pnr.indexOf("/"));
}else{
pnr = pnr.substring(pnr.indexOf("/")+1);
}
}
saleDetailList.get(num+count_saleOrder-1).setPnr(pnr);
saleDetailList.get(num+count_saleOrder-1).setPassengerCount(passengerSize);
if(StringUtils.isNotBlank(passengerNames)){
passengerNames = passengerNames.substring(0,passengerNames.length()-1);
}
saleDetailList.get(num+count_saleOrder-1).setPassengerNames(passengerNames);
saleDetailList.get(num+count_saleOrder-1).setAdultCount(adultCount);
saleDetailList.get(num+count_saleOrder-1).setChildCount(childCount);
}
}
//写入利润
profit = combinOrderTotalPrice - Double.parseDouble(purchaseTotalPrice) + orderValuedPrice;
saleDetailList.get(num).setProfit(profit);
//正推交易流水
count_transDetail = 0;
String purchaseId_trans = "";
String orderId_trans = "";
String accountId = "";
String cardNumber = "";
String transactionNumber = "";
String localPrice = "";
String rmbPrice = "";
if(transArr.size()>0){
for(int m=0;m<transArr.size();m++){
JSONObject transObj = transArr.getJSONObject(m);
String transId = transObj.getString("id");
purchaseId_trans = transObj.getString("purchaseId");
orderId_trans = transObj.getString("orderId");
accountId = transObj.getString("accountId");
cardNumber = transObj.getString("cardNumber");
transactionNumber = transObj.getString("transactionNumber");
localPrice = transObj.getString("localPrice");
rmbPrice = transObj.getString("rmbPrice");
if(purchaseId.equals(purchaseId_trans)){
count_transDetail++;
if(count_transDetail > 1){
SaleDetail temp2 = new SaleDetail();
temp2.setId(UUID.randomUUID().toString());
temp2.setCreateTime(new Date());
temp2.setUpdateTime(new Date());
temp2.setKey(key);//标识
temp2.setOfficalReceivedPaymentStatus("");
temp2.setOfficalActualExpendAmount(0.0);
temp2.setOfficalBalance(0.0);
temp2.setOfficalRateAdjustDate(null);
saleDetailList.add(temp2);
System.out.println(num + count_transDetail - 1);
}
saleDetailList.get(num+count_transDetail-1).setTransactionDetail_local(Double.parseDouble(localPrice));//18
saleDetailList.get(num+count_transDetail-1).setTransactionDetail_rmb(Double.parseDouble(rmbPrice));//19
saleDetailList.get(num+count_transDetail-1).setPayMethod(accountId);//20
saleDetailList.get(num+count_transDetail-1).setCardNumber(cardNumber);//21
saleDetailList.get(num+count_transDetail-1).setTransactionNumber(transactionNumber);//23
}else{
//以前的报表导出的订单
for(int ord = 0;ord<orderArr.size();ord++){
JSONObject orderInfo=orderArr.getJSONObject(ord);
JSONArray transcationDetail_old = orderInfo.getJSONArray("transactiondetail_old");
if(transcationDetail_old!=null && !"".equals(transcationDetail_old)){
for(int tra = 0;tra<transcationDetail_old.size();tra++){
JSONObject traObj = transcationDetail_old.getJSONObject(tra);
orderId_trans = traObj.getString("orderId");
accountId = traObj.getString("accountId");
cardNumber = traObj.getString("cardNumber");
transactionNumber = traObj.getString("transactionNumber");
localPrice = traObj.getString("localPrice");
rmbPrice = traObj.getString("rmbPrice");
if(ORDERID.equals(orderId_trans)){
count_transDetail++;
// sheet.addCell(new Label(20,num+count_transDetail-1,accountId,wcf2));
// sheet.addCell(new Label(21,num+count_transDetail-1,cardNumber,wcf2));
// sheet.addCell(new Label(23,num+count_transDetail-1,transactionNumber,wcf2));
// sheet.addCell(new jxl.write.Number(18,num+count_transDetail-1,Double.parseDouble(localPrice),wcf2));
// sheet.addCell(new jxl.write.Number(19,num+count_transDetail-1,Double.parseDouble(rmbPrice),wcf2));
}
}
}
}
}
}
}
else{
//以前的报表导出的订单
for(int ord = 0;ord<orderArr.size();ord++){
JSONObject orderInfo=orderArr.getJSONObject(ord);
JSONArray transcationDetail_old = orderInfo.getJSONArray("transactiondetail_old");
if(transcationDetail_old!=null && !"".equals(transcationDetail_old)){
if(transcationDetail_old.size()>0){
for(int tra = 0;tra<transcationDetail_old.size();tra++){
JSONObject traObj = transcationDetail_old.getJSONObject(tra);
orderId_trans = traObj.getString("orderId");
accountId = traObj.getString("accountId");
cardNumber = traObj.getString("cardNumber");
transactionNumber = traObj.getString("transactionNumber");
localPrice = traObj.getString("localPrice");
rmbPrice = traObj.getString("rmbPrice");
if(ORDERID.equals(orderId_trans)){
count_transDetail++;
// sheet.addCell(new Label(20,num+count_transDetail-1,accountId,wcf2));
// sheet.addCell(new Label(21,num+count_transDetail-1,cardNumber,wcf2));
// sheet.addCell(new Label(23,num+count_transDetail-1,transactionNumber,wcf2));
// sheet.addCell(new jxl.write.Number(18,num+count_transDetail-1,Double.parseDouble(localPrice),wcf2));
// sheet.addCell(new Number(19,num+count_transDetail-1,Double.parseDouble(rmbPrice),wcf2));
break;
}
}
}
}
}
}
int D_value = 0;
D_value = Math.abs(count_saleOrder - count_transDetail);
mergeNum = count_saleOrder>count_transDetail?count_saleOrder:count_transDetail;
//销售单对支付信息 一对多,多余的行填充重复的销售单信息
if(count_saleOrder==1 && count_transDetail>1){
for(int repeat = 0;repeat < (count_transDetail-count_saleOrder) ;repeat++){
saleDetailList.get(num + repeat +1).setCreateTime(createTime);
saleDetailList.get(num + repeat +1).setTicketTime(ticketTime);
saleDetailList.get(num + repeat +1).setOuterOrderNo(outerOrderNo);
saleDetailList.get(num + repeat +1).setChannel("");
saleDetailList.get(num + repeat +1).setStore("");
saleDetailList.get(num + repeat +1).setTairLine(flightLine);
saleDetailList.get(num + repeat +1).setFlightTime(flightTime);
saleDetailList.get(num + repeat +1).setFlightNumber(flightNo);
saleDetailList.get(num + repeat +1).setTripType(orderTripType);
saleDetailList.get(num + repeat +1).setPnrType(ticketType);
saleDetailList.get(num + repeat +1).setPnr(pnr);
}
//sheet.mergeCells(12,num,12,num+mergeNum-1);//合并订单金额
}
// //合并采购信息
// sheet.mergeCells(11,num,11,num+mergeNum-1);
// sheet.mergeCells(14,num,14,num+mergeNum-1);
// sheet.mergeCells(15,num,15,num+mergeNum-1);
// sheet.mergeCells(16,num,16,num+mergeNum-1);
// sheet.mergeCells(17,num,17,num+mergeNum-1);
// sheet.mergeCells(22,num,22,num+mergeNum-1);
// sheet.mergeCells(24,num,24,num+mergeNum-1);
// sheet.mergeCells(25,num,25,num+mergeNum-1);
// sheet.mergeCells(26,num,26,num+mergeNum-1);
// sheet.mergeCells(27,num,27,num+mergeNum-1);
// sheet.mergeCells(33,num,33,num+mergeNum-1);
// sheet.mergeCells(35,num,35,num+mergeNum-1);
num += mergeNum;
}
logger.info("解析销售报表明细成功!");
}catch (Exception e) {
e.printStackTrace();
logger.error("解析销售报表明细异常",e);
}finally{
}
return saleDetailList;
}
/**
* 将毫秒数转化为日期格式
* @param timeMs 传入毫秒数
* @return
*/
public String date_s(String timeMs){
// long time=Long.parseLong(timeMs);
// Date date=new Date(time);
// SimpleDateFormat sdf=new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
// return sdf.format(date).toString();
return timeMs;
}
public String date_alt(String timeMs){
try{
long time=Long.parseLong(timeMs);
Date date=new Date(time);
SimpleDateFormat sdf=new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
return sdf.format(date);
}catch (Exception e){
}
return timeMs;
}
public Date str2Date(String timeMs){
try{
long time=Long.parseLong(timeMs);
Date date=new Date(time);
return date;
}catch (Exception e){
}
return new Date();
}
public String OperName(String userId){
String TrueName="";
List<User> list= new ArrayList<>();
for(int n=0;n<list.size();n++){
if(list.get(n).getUserID().equals(userId)){
TrueName=list.get(n).getName();
}
}
return TrueName;
}
//订单状态转换
public String convertOrderStatus(int orderStatus){
String status = "";
switch (orderStatus) {
case 0:status = "未支付";
break;
case 2:status = "等待出票";
break;
case 3:status = "出票中";
break;
case 4:status = "已出票";
break;
case 5:status = "出票失败";
break;
default:status ="";
break;
}
return status;
}
public String convertRouteType(String key){
switch (key) {
case "OW":key = "去程";
break;
case "RT":key = "回程";
break;
case "OWRT":key = "往返";
break;
default:key ="";
break;
}
return key;
}
public String convertTripType(String key){
switch (key) {
case "OW":key = "单程";
break;
case "RT":key = "单程";
break;
case "OWRT":key = "往返";
break;
default:key ="";
break;
}
return key;
}
public String convertOrderType(String key){
switch (key) {
case "ticket":key = "";
break;
case "luggage":key = "行李";
break;
case "food":key = "餐食";
break;
case "checkin":key = "值机";
break;
default:key ="";
break;
}
return key;
}
public String createSaleDetailReport(List<SaleDetail> saleDetails,String filePath){
logger.info("开始生成报表");
File files = new File(filePath);
if (!files.exists()) { files.mkdir(); }
WritableWorkbook workbook = null;
String file = filePath + new SimpleDateFormat("yyMMddHHmmss").format(new Date())+".xls";
try{
workbook = Workbook.createWorkbook(new File(file));
DecimalFormat df = new DecimalFormat("######0.00");
WritableFont wf = new WritableFont(WritableFont.ARIAL, 10, WritableFont.BOLD, false, UnderlineStyle.NO_UNDERLINE, Colour.BLACK);
WritableFont wf_auto = new WritableFont(WritableFont.ARIAL, 10, WritableFont.BOLD, false, UnderlineStyle.NO_UNDERLINE, Colour.BLACK);
WritableCellFormat wcf_integer = new WritableCellFormat(wf_auto,NumberFormats.INTEGER); // 整数
WritableCellFormat wcf_float = new WritableCellFormat(wf_auto,NumberFormats.FLOAT); // 小数
wcf_integer.setAlignment(Alignment.CENTRE); // 设置对齐方式
wcf_float.setAlignment(Alignment.CENTRE); // 设置对齐方式
WritableCellFormat wcf = new WritableCellFormat(wf); // 单元格定义
wcf.setAlignment(Alignment.CENTRE); // 设置对齐方式
WritableCellFormat wcf1 = new WritableCellFormat(wf); // 单元格定义
wcf1.setAlignment(Alignment.CENTRE); // 设置对齐方式
WritableCellFormat wcf2 = new WritableCellFormat();
wcf2.setAlignment(Alignment.CENTRE); // 设置对齐方式
wcf2.setVerticalAlignment(jxl.format.VerticalAlignment.CENTRE);
wcf2.setWrap(true);
WritableSheet sheet = workbook.createSheet("First Sheet", 0);//创建新的一页
CellView cellView = new CellView();
cellView.setAutosize(true); //设置自动大小
cellView.setFormat(wcf1);
CellView cellView_float = new CellView();
cellView.setAutosize(true); //设置自动大小
cellView.setFormat(wcf_float);
sheet.setColumnView(0,cellView);
sheet.setColumnView(1,cellView);
sheet.setColumnView(2,cellView);
sheet.setColumnView(3,cellView);
sheet.setColumnView(4,cellView);
sheet.setColumnView(5,cellView);
sheet.setColumnView(6,cellView);
sheet.setColumnView(7,cellView);
sheet.setColumnView(8,cellView);
sheet.setColumnView(9,cellView);
sheet.setColumnView(10,cellView);
sheet.setColumnView(11,cellView);
sheet.setColumnView(12,cellView);
sheet.setColumnView(13,cellView);
sheet.setColumnView(14,cellView);
sheet.setColumnView(15,cellView);
sheet.setColumnView(16,cellView);
sheet.setColumnView(17,cellView);
sheet.setColumnView(18,cellView);
sheet.setColumnView(19,cellView);
sheet.setColumnView(20,cellView);
sheet.setColumnView(21,cellView);
sheet.setColumnView(22,cellView);
sheet.setColumnView(23,cellView);
sheet.setColumnView(24,cellView);
sheet.setColumnView(25,cellView);
sheet.setColumnView(26,cellView);
sheet.setColumnView(27,cellView);
sheet.setColumnView(28,cellView);
sheet.setColumnView(29,cellView);
sheet.setColumnView(30,cellView);
sheet.setColumnView(31,cellView);
sheet.setColumnView(32,cellView);
sheet.setColumnView(33,cellView);
sheet.setColumnView(34,cellView);
sheet.setColumnView(35,cellView);
sheet.setColumnView(36,cellView);
sheet.setColumnView(37,cellView);
sheet.setColumnView(38,cellView);
sheet.setColumnView(39,cellView);
sheet.setColumnView(40,cellView);
sheet.setColumnView(41,cellView);
sheet.getSettings().setDefaultColumnWidth(22);//设置默认宽度22px
sheet.addCell(new Label(0,0,"生单时间",wcf2));
sheet.addCell(new Label(1,0,"出票时间",wcf2));
sheet.addCell(new Label(2,0,"订单号",wcf2));
sheet.addCell(new Label(3,0,"销售渠道",wcf2));
sheet.addCell(new Label(4,0,"销售店铺",wcf2));
sheet.addCell(new Label(5,0,"航线",wcf2));
sheet.addCell(new Label(6,0,"起飞时间",wcf2));
sheet.addCell(new Label(7,0,"航班号",wcf2));
sheet.addCell(new Label(8,0,"行程类型",wcf2));
sheet.addCell(new Label(9,0,"票号类型",wcf2));
sheet.addCell(new Label(10,0,"编码",wcf2));
sheet.addCell(new Label(11,0,"人数",wcf2));
sheet.addCell(new Label(12,0,"成人数量",wcf2));
sheet.addCell(new Label(13,0,"儿童数量",wcf2));
sheet.addCell(new Label(14,0,"销售—金额",wcf2));
sheet.addCell(new Label(15,0,"行李总金额",wcf2));
sheet.addCell(new Label(16,0,"采购积分",wcf2));
sheet.addCell(new Label(17,0,"采购币种",wcf2));
sheet.addCell(new Label(18,0,"采购金额(外)",wcf2));
sheet.addCell(new Label(19,0,"采购金额(本)",wcf2));
sheet.addCell(new Label(20,0,"支付明细(外)",wcf2));
sheet.addCell(new Label(21,0,"支付明细(本)",wcf2));
sheet.addCell(new Label(22,0,"支付方式",wcf2));
sheet.addCell(new Label(23,0,"卡号",wcf2));
sheet.addCell(new Label(24,0,"利润",wcf2));
sheet.addCell(new Label(25,0,"交易流水号",wcf2));
sheet.addCell(new Label(26,0,"辅营订单号",wcf2));
sheet.addCell(new Label(27,0,"采购渠道",wcf2));
sheet.addCell(new Label(28,0,"采购账户",wcf2));
sheet.addCell(new Label(29,0,"采购订单号",wcf2));
sheet.addCell(new Label(30,0,"政策类型",wcf2));
sheet.addCell(new Label(31,0,"政策编码",wcf2));
sheet.addCell(new Label(32,0,"订单状态",wcf2));
sheet.addCell(new Label(33,0,"出票人",wcf2));
sheet.addCell(new Label(34,0,"采购时间",wcf2));
sheet.addCell(new Label(35,0,"附加产品",wcf2));
sheet.addCell(new Label(36,0,"附加产品规格",wcf2));
sheet.addCell(new Label(37,0,"备注",wcf2));
sheet.addCell(new Label(38,0,"财务-回款状态",wcf2));
sheet.addCell(new Label(39,0,"财务-实际支出金额",wcf2));
sheet.addCell(new Label(40,0,"财务-补差",wcf2));
sheet.addCell(new Label(41,0,"财务-外币调整日期",wcf2));
sheet.addCell(new Label(42,0,"航司",wcf2));
sheet.addCell(new Label(43,0,"旅客姓名",wcf2));
//遍历采购信息
if(saleDetails == null || saleDetails.size() == 0){
logger.info("获取销售明细表数据为空,saleDetails.size()=0");
}else{
for (int i = 0; i < saleDetails.size(); i++) {
SaleDetail saleDetail = saleDetails.get(i);
Integer count = 0;
if(i-1 > 0){//如果本票号与上一行票号一致,合并
String pnr = saleDetail.getPnr();
for (int j = i-1; j >= 0; j--) {
if(saleDetails.size() > i+1){
if(pnr.equals(saleDetails.get(i+1).getPnr()) && saleDetails.get(i+1).getPurchaseTime() == null){
break;
}
}
if(pnr.equals(saleDetails.get(j).getPnr()) && saleDetail.getPurchaseTime() == null){
count ++;
}else{
break;
}
}
}
if(saleDetail.getCreateOrderTime()!=null){
sheet.addCell(new Label(0,i+1,date_alt(String.valueOf(saleDetail.getCreateOrderTime().getTime())),wcf2));
}else{
if(saleDetails.get(i-1) != null){
if(saleDetail.getOuterOrderNo().equals(saleDetails.get(i-1).getOuterOrderNo())){
if(saleDetails.get(i-1).getCreateOrderTime() != null){
saleDetail.setCreateOrderTime(saleDetails.get(i-1).getCreateOrderTime());
}
sheet.addCell(new Label(0,i+1,date_alt(String.valueOf(saleDetails.get(i-1).getCreateOrderTime().getTime())),wcf2));
}
}
}
if(saleDetail.getTicketTime()!=null){
sheet.addCell(new Label(1,i+1,date_alt(String.valueOf(saleDetail.getTicketTime().getTime())),wcf2));
}
if(saleDetail.getOuterOrderNo()!=null){
sheet.addCell(new Label(2,i+1,saleDetail.getOuterOrderNo(),wcf2));
}
if(StringUtils.isNotBlank(saleDetail.getChannel())){
sheet.addCell(new Label(3,i+1,saleDetail.getChannel(),wcf2));
}else{
if(saleDetails.get(i-1) != null){
if(saleDetail.getOuterOrderNo().equals(saleDetails.get(i-1).getOuterOrderNo())){
sheet.addCell(new Label(3,i+1,saleDetails.get(i-1).getChannel(),wcf2));
}
}
}
if(StringUtils.isNotBlank(saleDetail.getStore())){
sheet.addCell(new Label(4,i+1,saleDetail.getStore(),wcf2));
}else{
if(saleDetails.get(i-1) != null){
if(saleDetail.getOuterOrderNo().equals(saleDetails.get(i-1).getOuterOrderNo())){
sheet.addCell(new Label(4,i+1,saleDetails.get(i-1).getStore(),wcf2));
}
}
}
if(saleDetail.getTairLine()!=null){
sheet.addCell(new Label(5,i+1,saleDetail.getTairLine(),wcf2));
}
if(saleDetail.getFlightTime()!=null){
String flightTime = saleDetail.getFlightTime();
if(saleDetail.getFlightTime().length() == 13){
flightTime = date_alt(saleDetail.getFlightTime());
sheet.addCell(new Label(6,i+1,flightTime,wcf2));
}else if(saleDetail.getFlightTime().length() == 26){
String flight_from = flightTime.substring(0,13);
String flight_ret = flightTime.substring(13);
sheet.addCell(new Label(6,i+1,date_alt(flight_from)+"\n"
+date_alt(flight_ret),wcf2));
}
}
if(saleDetail.getFlightNumber()!=null){
sheet.addCell(new Label(7,i+1,saleDetail.getFlightNumber(),wcf2));
}
if(saleDetail.getTripType()!=null){
sheet.addCell(new Label(8,i+1,saleDetail.getTripType(),wcf2));
}
if(saleDetail.getPnrType()!=null){
sheet.addCell(new Label(9,i+1,saleDetail.getPnrType(),wcf2));
}
if(saleDetail.getPnr()!=null){
sheet.addCell(new Label(10,i+1,saleDetail.getPnr(),wcf2));
}
if(saleDetail.getPassengerCount()!=null){
sheet.addCell(new Number(11,i+1,saleDetail.getPassengerCount(),wcf2));
}
if(saleDetail.getAdultCount()!=null){
sheet.addCell(new Number(12,i+1,saleDetail.getAdultCount(),wcf2));
}
if(saleDetail.getChildCount()!=null){
sheet.addCell(new Number(13,i+1,saleDetail.getChildCount(),wcf2));
}
if(saleDetail.getSalePrice()!=null){
sheet.addCell(new Number(14,i+1,saleDetail.getSalePrice(),wcf2));
}
if(saleDetail.getLuggagePrice()!=null){
sheet.addCell(new Number(15,i+1,saleDetail.getLuggagePrice(),wcf2));
}
if(saleDetail.getPoints()!=null){
sheet.addCell(new Number(16,i+1,saleDetail.getPoints(),wcf2));
}
if(saleDetail.getPurchaseCurrency()!=null){
sheet.addCell(new Label(17,i+1,saleDetail.getPurchaseCurrency(),wcf2));
}
if(saleDetail.getPurchasePrice_local()!=null){
sheet.addCell(new Number(18,i+1,saleDetail.getPurchasePrice_local(),wcf2));
}
if(saleDetail.getPurchasePrice_rmb()!=null){
sheet.addCell(new Number(19,i+1,saleDetail.getPurchasePrice_rmb(),wcf2));
}
if(saleDetail.getTransactionDetail_local()!=null){
sheet.addCell(new Number(20,i+1,saleDetail.getTransactionDetail_local(),wcf2));
}
if(saleDetail.getTransactionDetail_rmb()!=null){
sheet.addCell(new Number(21,i+1,saleDetail.getTransactionDetail_rmb(),wcf2));
}
if(saleDetail.getPayMethod()!=null){
sheet.addCell(new Label(22,i+1,saleDetail.getPayMethod(),wcf2));
}
if(saleDetail.getCardNumber()!=null){
sheet.addCell(new Label(23,i+1,saleDetail.getCardNumber(),wcf2));
}
if(saleDetail.getProfit()!=null){
sheet.addCell(new Number(24,i+1,saleDetail.getProfit(),wcf2));
}
if(saleDetail.getTransactionNumber()!=null){
sheet.addCell(new Label(25,i+1,saleDetail.getTransactionNumber(),wcf2));
}
if(saleDetail.getOrderValueAddedNo()!=null){
sheet.addCell(new Label(26,i+1,saleDetail.getOrderValueAddedNo(),wcf2));
}
if(saleDetail.getPurchaseChannel()!=null){
sheet.addCell(new Label(27,i+1,saleDetail.getPurchaseChannel(),wcf2));
}
if(saleDetail.getPurchaseAccount()!=null){
sheet.addCell(new Label(28,i+1,saleDetail.getPurchaseAccount(),wcf2));
}
if(saleDetail.getPurchaseOrderNo()!=null){
sheet.addCell(new Label(29,i+1,saleDetail.getPurchaseOrderNo(),wcf2));
}
if(saleDetail.getPolicyType()!=null){
sheet.addCell(new Label(30,i+1,saleDetail.getPolicyType(),wcf2));
}
if(saleDetail.getPolicyCode()!=null){
sheet.addCell(new Label(31,i+1,saleDetail.getPolicyCode(),wcf2));
}
if(saleDetail.getOrderStatus()!=null){
sheet.addCell(new Label(32,i+1,saleDetail.getOrderStatus(),wcf2));
}
if(saleDetail.getOperator()!=null){
sheet.addCell(new Label(33,i+1,saleDetail.getOperator(),wcf2));
}
if(saleDetail.getPurchaseTime()!=null){
sheet.addCell(new Label(34,i+1,date_alt(String.valueOf(saleDetail.getPurchaseTime().getTime())),wcf2));
}
if(saleDetail.getOrderValueAdded()!=null){
sheet.addCell(new Label(35,i+1,saleDetail.getOrderValueAdded(),wcf2));
}
if(saleDetail.getOrderValueAddedSpecific()!=null){
sheet.addCell(new Label(36,i+1,saleDetail.getOrderValueAddedSpecific(),wcf2));
}
if(saleDetail.getRemark()!=null){
sheet.addCell(new Label(37,i+1,saleDetail.getRemark(),wcf2));
}
if(saleDetail.getOfficalReceivedPaymentStatus()!=null){
sheet.addCell(new Label(38,i+1,saleDetail.getOfficalReceivedPaymentStatus(),wcf2));
}
sheet.addCell(new Label(39,i+1,"",wcf2));
sheet.addCell(new Label(40,i+1,"",wcf2));
sheet.addCell(new Label(41,i+1,"",wcf2));
String carrier = "";//航司
if(StringUtils.isNotBlank(saleDetail.getFlightNumber())){
carrier = saleDetail.getFlightNumber().substring(0,2);
}
sheet.addCell(new Label(42,i+1,carrier,wcf2));
if(StringUtils.isNotBlank(saleDetail.getPassengerNames())){
sheet.addCell(new Label(43,i+1,saleDetail.getPassengerNames(),wcf2));
}
if(count > 0){//本采购信息对应票号
sheet.mergeCells(10,i+1-count,10,i+1);
sheet.mergeCells(11,i+1-count,11,i+1);
sheet.mergeCells(16,i+1-count,14,i+1);
sheet.mergeCells(17,i+1-count,15,i+1);
sheet.mergeCells(18,i+1-count,16,i+1);
sheet.mergeCells(19,i+1-count,17,i+1);
sheet.mergeCells(24,i+1-count,22,i+1);
sheet.mergeCells(26,i+1-count,24,i+1);
sheet.mergeCells(27,i+1-count,25,i+1);
sheet.mergeCells(28,i+1-count,26,i+1);
sheet.mergeCells(29,i+1-count,27,i+1);
sheet.mergeCells(33,i+1-count,31,i+1);
sheet.mergeCells(34,i+1-count,32,i+1);
sheet.mergeCells(43,i+1-count,41,i+1);
}
}
}
logger.info("生成销售明细报表成功!");
}catch (Exception e) {
e.printStackTrace();
logger.error("导出Execl异常",e);
}finally{
try{
workbook.write();
workbook.close();
}catch (Exception e){
}
}
return file;
}
}
package com.yutu.base.service;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yutu.base.entity.NoteResult;
import com.yutu.base.entity.Response;
import com.yutu.base.utils.HttpsSendData;
import org.apache.commons.lang3.StringUtils;
import org.apache.log4j.Logger;
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
import org.apache.poi.hssf.usermodel.HSSFFont;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.io.File;
import java.io.FileOutputStream;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
/**
* 订单相关业务层
*/
@Service
public class PrivateFreightService extends BaseService{
private Logger logger = Logger.getLogger("privateFreightService");
@Value("${spring.urlConfig.productServiceUrl}")
private String productServiceUrl;
@Value("${spring.pathConfig.saleReportExcelPath}")
private String saleReportExcelPath;
public Response exportPrivateFreight(String requestBody){
if(StringUtils.isBlank(requestBody)){
return Response.error("参数不能为空");
}
JSONObject reqObj = JSONObject.parseObject(requestBody);
if(reqObj == null){
return Response.error("参数有误");
}
String customerId = reqObj.getString("customerId");
if(StringUtils.isBlank(customerId)){
return Response.error("参数不能为空,必传参数:customerId");
}
String carrier = reqObj.getString("carrier");
String org = reqObj.getString("org");
String dst = reqObj.getString("dst");
String startIndex = reqObj.getString("startIndex");
String count = reqObj.getString("count");
String flightNo = reqObj.getString("flightNo");
String cabin = reqObj.getString("cabin");
JSONObject params = new JSONObject();
params.put("customerId",customerId);
params.put("carrier",carrier);
params.put("org",org);
params.put("dst",dst);
params.put("flightNo",flightNo);
params.put("cabin",cabin);
params.put("startIndex","1");
params.put("count","100000");
NoteResult nr = getPrivateFreights(params);
if(nr.getStatus() != 0){
return Response.error("查询数据为空");
}
JSONArray privateFreights = (JSONArray) nr.getData();
String filePath = createPrivateFreightExcel(privateFreights,customerId);
Response response = Response.success();
response.setData(filePath);
response.setErrorMessage("生成订单信息完毕!");
return response;
}
//获取指定条件下全部数据
public NoteResult getPrivateFreights(JSONObject paramsMap){
NoteResult noteResult = new NoteResult(2,null,null);
Map<String,String> map = new HashMap<>();
map.put("reqBody",paramsMap.toJSONString());
String result= HttpsSendData.send(productServiceUrl+"privateFreight/findByCondition.do", map);
JSONObject jsonObject = JSONObject.parseObject(result);
if(jsonObject!=null && jsonObject.size() > 0){
noteResult.setStatus(0);
noteResult.setMsg("获取成功");
noteResult.setData(jsonObject.getJSONArray("data"));
}
return noteResult;
}
//解析数据生成Excel表
public String createPrivateFreightExcel(JSONArray privateFreights,String customerId) {
String fileBasePath = saleReportExcelPath + customerId + "/PrivateFreightExcel/";;
SimpleDateFormat sdf = new SimpleDateFormat("yyyy_MM_dd_HH_mm_ss");
String date = sdf.format(new Date());
File file = new File( "私有运价底价配置"+date+".xls");
System.out.println(file);
FileOutputStream os = null;
HSSFWorkbook book = null;
try{
//创建工作薄
book = new HSSFWorkbook();
HSSFSheet sheet = book.createSheet("私有运价底价配置");
sheet.setColumnWidth(8, 21 * 456);
sheet.setColumnWidth(9, 21 * 456);
// 创建单元格样式
HSSFCellStyle cellStyleTitle = book.createCellStyle();
// 指定单元格居中对齐
// cellStyleTitle.setAlignment(HSSFCellStyle.ALIGN_CENTER);
// 指定单元格垂直居中对齐
// cellStyleTitle.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);
// 指定当单元格内容显示不下时自动换行
cellStyleTitle.setWrapText(true);
// ------------------------------------------------------------------
HSSFCellStyle cellStyle = book.createCellStyle();
// 指定单元格居中对齐
// cellStyle.setAlignment(HSSFCellStyle.ALIGN_CENTER);
// 指定单元格垂直居中对齐
// cellStyle.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);
// 指定当单元格内容显示不下时自动换行
cellStyle.setWrapText(true);
// ------------------------------------------------------------------
// 设置单元格字体
HSSFFont font = book.createFont();
// font.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
font.setFontName("宋体");
font.setColor(new Short("255"));
font.setFontHeight((short) 200);
cellStyleTitle.setFont(font);
//创建标题行
Row title = sheet.createRow(0);
title.setRowStyle(cellStyleTitle);
//航司
Cell carrierTitle = title.createCell(0);
carrierTitle.setCellStyle(cellStyleTitle);
carrierTitle.setCellValue("序号");
//信用余额
Cell creditTitle = title.createCell(1);
creditTitle.setCellStyle(cellStyleTitle);
creditTitle.setCellValue("航司");
//账户编码
Cell accountIdTitle = title.createCell(2);
accountIdTitle.setCellStyle(cellStyleTitle);
accountIdTitle.setCellValue("出发");
//账户
Cell accountTitle = title.createCell(3);
accountTitle.setCellStyle(cellStyleTitle);
accountTitle.setCellValue("抵达");
//账户
Cell statusTitle = title.createCell(4);
statusTitle.setCellStyle(cellStyleTitle);
statusTitle.setCellValue("航班号");
//密码
Cell passwordTitle = title.createCell(5);
passwordTitle.setCellStyle(cellStyleTitle);
passwordTitle.setCellValue("舱位");
//邮箱密码
Cell mailPasswordTitle = title.createCell(6);
mailPasswordTitle.setCellStyle(cellStyleTitle);
mailPasswordTitle.setCellValue("底价票面");
//积分值
Cell pointTitle = title.createCell(7);
pointTitle.setCellStyle(cellStyleTitle);
pointTitle.setCellValue("底价税");
//可用旅客人数
Cell usableNumTitle = title.createCell(8);
usableNumTitle.setCellStyle(cellStyleTitle);
usableNumTitle.setCellValue("规则编码");
//id
Cell idTitle = title.createCell(9);
idTitle.setCellStyle(cellStyleTitle);
idTitle.setCellValue("私有运价id");
//遍历销售规则数据列表
for (int i = 0; i < privateFreights.size(); i++) {
Row r = sheet.createRow(i + 1);
Cell indeixCell = r.createCell(0);
indeixCell.setCellStyle(cellStyle);
indeixCell.setCellValue(i + 1);
Cell usablePassengerNumCell = r.createCell(1);
usablePassengerNumCell.setCellStyle(cellStyle);
if (privateFreights.getJSONObject(i).getString("carrier") != null) {
usablePassengerNumCell.setCellValue(privateFreights.getJSONObject(i).getString("carrier"));
}
Cell carrierCell = r.createCell(2);
carrierCell.setCellStyle(cellStyle);
if (privateFreights.getJSONObject(i).getString("org") != null) {
carrierCell.setCellValue(privateFreights.getJSONObject(i).getString("org"));
}
Cell accountIdCell = r.createCell(3);
accountIdCell.setCellStyle(cellStyle);
if (privateFreights.getJSONObject(i).getString("dst") != null) {
accountIdCell.setCellValue(privateFreights.getJSONObject(i).getString("dst"));
}
Cell statusCell = r.createCell(4);
statusCell.setCellStyle(cellStyle);
if (privateFreights.getJSONObject(i).getString("flightNo") != null) {
statusCell.setCellValue(privateFreights.getJSONObject(i).getString("flightNo"));
}
Cell accountCell = r.createCell(5);
accountCell.setCellStyle(cellStyle);
if (privateFreights.getJSONObject(i).getString("cabin") != null) {
accountCell.setCellValue(privateFreights.getJSONObject(i).getString("cabin"));
}
Cell emailPassCell = r.createCell(6);
emailPassCell.setCellStyle(cellStyle);
if (privateFreights.getJSONObject(i).getString("floorPrice") != null) {
emailPassCell.setCellValue(privateFreights.getJSONObject(i).getString("floorPrice"));
}
Cell pointCell = r.createCell(7);
pointCell.setCellStyle(cellStyle);
if (privateFreights.getJSONObject(i).getString("floorTax") != null) {
pointCell.setCellValue(privateFreights.getJSONObject(i).getString("floorTax"));
}
Cell flightTimeCell = r.createCell(8);
flightTimeCell.setCellStyle(cellStyle);
if (privateFreights.getJSONObject(i).getString("ruleCodeIds") != null) {
flightTimeCell.setCellValue(privateFreights.getJSONObject(i).getString("ruleCodeIds"));
}
Cell idCell = r.createCell(9);
idCell.setCellStyle(cellStyle);
if (privateFreights.getJSONObject(i).getString("id") != null) {
idCell.setCellValue(privateFreights.getJSONObject(i).getString("id"));
}
}
//创建输出流
os = new FileOutputStream(fileBasePath + file);
//将book中的数据写出
book.write(os);
}catch (Exception e){
logger.info("生成订单信息Excel异常,异常信息",e);
}finally {
try {
os.close();//关闭流
book.close();
} catch (Exception e2) {
e2.printStackTrace();
}
}
return fileBasePath + file;
}
}
package com.yutu.base.service;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yutu.base.entity.Response;
import com.yutu.base.entity.Store;
import com.yutu.base.entity.User;
import com.yutu.base.utils.MyComparator;
import jxl.CellView;
import jxl.Workbook;
import jxl.format.Alignment;
import jxl.format.Colour;
import jxl.format.UnderlineStyle;
import jxl.write.*;
import jxl.write.Number;
import org.apache.commons.lang3.StringUtils;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.io.File;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.*;
@Service
public class SaleDetailReportService extends BaseService {
private Logger logger = Logger.getLogger("download");
public Map<String, String> createSaleDetailReport(Map<String, JSONArray> resultMap, String[] tableNames, String filePath, String requestId) {
logger.info("开始解析数据");
long beginTime = System.currentTimeMillis();
JSONArray resultArr = resultMap.get("orderinfo");
List<String> tableNameList = Arrays.asList(tableNames);
for (int k = 0; k < resultArr.size(); k++) {
JSONObject orderInfoObj = resultArr.getJSONObject(k);
String id = orderInfoObj.getString("id");
for (int t = 0; t < tableNameList.size(); t++) {
JSONArray Arr = resultMap.get(tableNameList.get(t));//乘客信息表中匹配该订单
JSONArray array = new JSONArray();
for (int a = 0; a < Arr.size(); a++) {
String orderId = "";
if ("ordervalueadded".equals(tableNames[t])) {
orderId = Arr.getJSONObject(a).getString("orderId");
} else if ("orderpurchase".equals(tableNames[t])) {
} else if ("transactiondetail_old".equals(tableNames[t])) {
orderId = Arr.getJSONObject(a).getString("orderId");
} else {
orderId = Arr.getJSONObject(a).getString("order_ID");
}
if (id.equals(orderId)) {
array.add(Arr.getJSONObject(a));
resultArr.getJSONObject(k).put(tableNames[t], array);
}
}
}
}
JSONArray puchArr = resultMap.get("orderpurchase");
JSONArray transArr = resultMap.get("transactiondetail");
//去除采购信息的重复信息,并将orderId逗号分隔写入orderIds
List<Integer> listRemove = new ArrayList<>();
for (int s = 0; s < puchArr.size(); s++) {
JSONObject puchObj_out = puchArr.getJSONObject(s);
String purchaseId_out = puchObj_out.getString("purchaseId");
String orderId_out = puchObj_out.getString("orderId");
String passengerIds_out = puchObj_out.getString("passengerIds");
String flightInfoIds_out = puchObj_out.getString("flightInfoIds");
for (int i = 0; i < puchArr.size(); i++) {
if (i == s) continue;
JSONObject puchObj_in = puchArr.getJSONObject(i);
String purchaseId_in = puchObj_in.getString("purchaseId");
String orderId_in = puchObj_in.getString("orderId");
String passengerIds_in = puchObj_in.getString("passengerIds");
String flightInfoIds_in = puchObj_in.getString("flightInfoIds");
if (purchaseId_out.equals(purchaseId_in)) {
listRemove.add(i);
orderId_out += "," + orderId_in;
passengerIds_out += "," + passengerIds_in;
flightInfoIds_out += "," + flightInfoIds_in;
passengerIds_out = removeDuplicateStr(passengerIds_out);
flightInfoIds_out = removeDuplicateStr(flightInfoIds_out);
puchObj_out.remove("orderId");
puchObj_out.remove("passengerIds");
puchObj_out.remove("flightInfoIds");
puchObj_in.remove("orderId");
puchObj_out.put("orderId", orderId_out);
puchObj_out.put("passengerIds", passengerIds_out);
puchObj_out.put("flightInfoIds", flightInfoIds_out);
puchObj_in.put("orderId", "");
}
}
}
List<Object> transList = Arrays.asList(transArr.toArray());
transList = removeDuplicateList(transList);
JSONArray transConvert = new JSONArray();
for (Object obj : transList) {
transConvert.add(obj);
}
puchArr = sortJsonArray(puchArr);
Map<String, String> map = new HashMap<String, String>();//进行数据整合后的 Map
map.put("orderpurchase", puchArr.toJSONString());
map.put("transactiondetail", transConvert.toJSONString());
map.put("other", resultArr.toJSONString());
logger.info("解析数据完毕,共用时:" + (System.currentTimeMillis() - beginTime) + " ms");
return map;
}
//去除Str重复
public String removeDuplicateStr(String str) {
if (str == null || "".equals(str)) return str;
List<String> strList = Arrays.asList(str.split(",", -1));
Set set = new HashSet();
List newList = new ArrayList();
for (Iterator iter = strList.iterator(); iter.hasNext(); ) {
Object element = iter.next();
if (set.add(element))
newList.add(element);
}
str = "";
for (Object obj : newList) {
str += "," + obj;
}
return str.substring(1);
}
//去除List重复
public List removeDuplicateList(List list) {
Set set = new HashSet();
List newList = new ArrayList();
for (Iterator iter = list.iterator(); iter.hasNext(); ) {
Object element = iter.next();
if (set.add(element))
newList.add(element);
}
return newList;
}
//jsonarray排序
public JSONArray sortJsonArray(JSONArray jsonArr) {
//转成list
List<JSONObject> list = new ArrayList<JSONObject>();
JSONObject jsonObj = null;
for (int i = 0; i < jsonArr.size(); i++) {
jsonObj = (JSONObject) jsonArr.get(i);
list.add(jsonObj);
}
Collections.sort(list, new MyComparator());
jsonArr.clear();
for (int i = 0; i < list.size(); i++) {
jsonObj = list.get(i);
jsonArr.add(jsonObj);
}
//jsonArr排序
return jsonArr;
}
//生成销售明细报表
public String createExcel(Map<String, String> map, String filePath, String requestId) throws Exception {
logger.info("开始生成报表");
List<User> userlist = getUsers();
List<Store> storelist = getStores();
File files = new File(filePath);
if (!files.exists()) {
files.mkdir();
}
String file = filePath + new SimpleDateFormat("yyMMddHHmmss").format(new Date()) + ".xls";
WritableWorkbook workbook = Workbook.createWorkbook(new File(file));
DecimalFormat df = new DecimalFormat("######0.00");
String orderDetail = map.get("other");
String purchase = map.get("orderpurchase");
String transactiondetail = map.get("transactiondetail");
JSONArray orderArr = JSONArray.parseArray(orderDetail);
JSONArray purchArr = JSONArray.parseArray(purchase);
JSONArray transArr = JSONArray.parseArray(transactiondetail);
try {
WritableFont wf = new WritableFont(WritableFont.ARIAL, 10, WritableFont.BOLD, false, UnderlineStyle.NO_UNDERLINE, Colour.BLACK);
WritableFont wf_auto = new WritableFont(WritableFont.ARIAL, 10, WritableFont.BOLD, false, UnderlineStyle.NO_UNDERLINE, Colour.BLACK);
WritableCellFormat wcf_integer = new WritableCellFormat(wf_auto, NumberFormats.INTEGER); // 整数
WritableCellFormat wcf_float = new WritableCellFormat(wf_auto, NumberFormats.FLOAT); // 小数
//wcf_integer.setBackground(Colour.LIGHT_ORANGE); // 设置单元格的背景颜色(海洋蓝)
wcf_integer.setAlignment(Alignment.CENTRE); // 设置对齐方式
//wcf_float.setBackground(Colour.LIGHT_ORANGE); // 设置单元格的背景颜色(海洋蓝)
wcf_float.setAlignment(Alignment.CENTRE); // 设置对齐方式
WritableCellFormat wcf = new WritableCellFormat(wf); // 单元格定义
//wcf.setBackground(Colour.LIGHT_ORANGE); // 设置单元格的背景颜色(海洋蓝)
wcf.setAlignment(Alignment.CENTRE); // 设置对齐方式
WritableCellFormat wcf1 = new WritableCellFormat(wf); // 单元格定义
//wcf1.setBackground(Colour.PALE_BLUE); // 设置单元格的背景颜色 (苍白之蓝)
wcf1.setAlignment(Alignment.CENTRE); // 设置对齐方式
WritableCellFormat wcf2 = new WritableCellFormat();
wcf2.setAlignment(Alignment.CENTRE); // 设置对齐方式
wcf2.setVerticalAlignment(jxl.format.VerticalAlignment.CENTRE);
wcf2.setWrap(true);
WritableSheet sheet = workbook.createSheet("First Sheet", 0);//创建新的一页
CellView cellView = new CellView();
cellView.setAutosize(true); //设置自动大小
cellView.setFormat(wcf1);
CellView cellView_float = new CellView();
cellView.setAutosize(true); //设置自动大小
cellView.setFormat(wcf_float);
sheet.setColumnView(0, cellView);
sheet.setColumnView(1, cellView);
sheet.setColumnView(2, cellView);
sheet.setColumnView(3, cellView);
sheet.setColumnView(4, cellView);
sheet.setColumnView(5, cellView);
sheet.setColumnView(6, cellView);
sheet.setColumnView(7, cellView);
sheet.setColumnView(8, cellView);
sheet.setColumnView(9, cellView);
sheet.setColumnView(10, cellView);
sheet.setColumnView(11, cellView);
sheet.setColumnView(12, cellView);
sheet.setColumnView(13, cellView);
sheet.setColumnView(14, cellView);
sheet.setColumnView(15, cellView);
sheet.setColumnView(16, cellView);
sheet.setColumnView(17, cellView);
sheet.setColumnView(18, cellView);
sheet.setColumnView(19, cellView);
sheet.setColumnView(20, cellView);
sheet.setColumnView(21, cellView);
sheet.setColumnView(22, cellView);
sheet.setColumnView(23, cellView);
sheet.setColumnView(24, cellView);
sheet.setColumnView(25, cellView);
sheet.setColumnView(26, cellView);
sheet.setColumnView(27, cellView);
sheet.setColumnView(28, cellView);
sheet.setColumnView(29, cellView);
sheet.setColumnView(30, cellView);
sheet.setColumnView(31, cellView);
sheet.setColumnView(32, cellView);
sheet.setColumnView(33, cellView);
sheet.setColumnView(34, cellView);
sheet.setColumnView(35, cellView);
sheet.setColumnView(36, cellView);
sheet.setColumnView(37, cellView);
sheet.setColumnView(38, cellView);
sheet.getSettings().setDefaultColumnWidth(22);//设置默认宽度22px
sheet.addCell(new Label(0, 0, "生单时间", wcf2));
sheet.addCell(new Label(1, 0, "出票时间", wcf2));
sheet.addCell(new Label(2, 0, "订单号", wcf2));
sheet.addCell(new Label(3, 0, "销售渠道", wcf2));
sheet.addCell(new Label(4, 0, "销售店铺", wcf2));
sheet.addCell(new Label(5, 0, "航线", wcf2));
sheet.addCell(new Label(6, 0, "起飞时间", wcf2));
sheet.addCell(new Label(7, 0, "航班号", wcf2));
sheet.addCell(new Label(8, 0, "行程类型", wcf2));
sheet.addCell(new Label(9, 0, "票号类型", wcf2));
sheet.addCell(new Label(10, 0, "编码", wcf2));
sheet.addCell(new Label(11, 0, "人数", wcf2));
sheet.addCell(new Label(12, 0, "销售—金额", wcf2));
sheet.addCell(new Label(13, 0, "行李总金额", wcf2));
sheet.addCell(new Label(14, 0, "采购积分", wcf2));
sheet.addCell(new Label(15, 0, "采购币种", wcf2));
sheet.addCell(new Label(16, 0, "采购金额(外)", wcf2));
sheet.addCell(new Label(17, 0, "采购金额(本)", wcf2));
sheet.addCell(new Label(18, 0, "支付明细(外)", wcf2));
sheet.addCell(new Label(19, 0, "支付明细(本)", wcf2));
sheet.addCell(new Label(20, 0, "支付方式", wcf2));
sheet.addCell(new Label(21, 0, "卡号", wcf2));
sheet.addCell(new Label(22, 0, "利润", wcf2));
sheet.addCell(new Label(23, 0, "交易流水号", wcf2));
sheet.addCell(new Label(24, 0, "辅营订单号", wcf2));
sheet.addCell(new Label(25, 0, "采购渠道", wcf2));
sheet.addCell(new Label(26, 0, "采购账户", wcf2));
sheet.addCell(new Label(27, 0, "采购订单号", wcf2));
sheet.addCell(new Label(28, 0, "政策类型", wcf2));
sheet.addCell(new Label(29, 0, "政策编码", wcf2));
sheet.addCell(new Label(30, 0, "订单状态", wcf2));
sheet.addCell(new Label(31, 0, "出票人", wcf2));
sheet.addCell(new Label(32, 0, "采购时间", wcf2));
sheet.addCell(new Label(33, 0, "附加产品", wcf2));
sheet.addCell(new Label(34, 0, "附加产品规格", wcf2));
sheet.addCell(new Label(35, 0, "备注", wcf2));
sheet.addCell(new Label(36, 0, "财务-回款状态", wcf2));
sheet.addCell(new Label(37, 0, "财务-实际支出金额", wcf2));
sheet.addCell(new Label(38, 0, "财务-补差", wcf2));
sheet.addCell(new Label(39, 0, "财务-外币调整日期", wcf2));
//遍历采购信息
int num = 1;//当前行
int count_transDetail = 0;
int count_saleOrder = 0;
String orderIdStr = "";
for (int k = 0; k < purchArr.size(); k++) {
int mergeNum = 0;//合并行数
Double profit = 0.0;//利润
JSONObject purchObj = purchArr.getJSONObject(k);
Integer deleted = purchObj.getInteger("deleted");
if (deleted != 0) {//已作废的采购信息跳过
continue;
}
String purchaseId = purchObj.getString("purchaseId");//采购id
String saleOrderId = purchObj.getString("orderId");//销售id
if ("".equals(saleOrderId) || saleOrderId == null) continue;
String flightInfoIds = purchObj.getString("flightInfoIds");//航班id
String passengerIds = purchObj.getString("passengerIds");//乘客id
int flightSize = flightInfoIds.replace(",", "").length() / 36;//行程段数
int passengerSize = passengerIds.replace(",", "").length() / 36;//乘客人量
String route = purchObj.getString("routeType");
String orderTripType = "";//订单行程类型
String routeType = convertRouteType(route);//采购行程类型
String ticketType = convertRouteType(route);//票号类型
String points = purchObj.getString("points");//使用积分
String localCurrency = purchObj.getString("localCurrencyCode");//采购币种
String currency = purchObj.getString("currencyCode");//采购币种
String localTotalPrice = purchObj.getString("localTotalPrice");//外币金额
String purchaseTotalPrice = purchObj.getString("purchaseTotalPrice");//本币金额
String orderValuedAddedOrderNo = purchObj.getString("orderValuedAddedOrderNo");//增值服务单号
String purchaseChannel = purchObj.getString("purchaseChannel");//采购渠道
String purchaseAccount = purchObj.getString("purchaseAccount");//采购账户
String purchaseOrderNo = purchObj.getString("purchaseOrderNo");//采购订单号
String purchaseOperator = purchObj.getString("purchaseOperator");//出票人
String purchaseTime = purchObj.getString("purchaseTime");//出票时间
String remarkText = purchObj.getString("remarkText");//备注信息
String trueName = "";
if (userlist != null && userlist.size() > 0) {
for (int tName = 0; tName < userlist.size(); tName++) {
if (userlist.get(tName).getUserID().equals(purchaseOperator)) {
trueName = userlist.get(tName).getUsername();//出票人真名
break;
}
}
}
String orderType = purchObj.getString("orderType");
orderType = convertOrderType(orderType);
String owPolicyType = "";//政策类型
String rtPolicyType = "";//政策类型(返程)
String owPolicyCode = "";
String rtPolicyCode = "";
List<String> policySourceArr = new ArrayList<String>();
sheet.addCell(new Number(14, num, Double.parseDouble(points), wcf2));
sheet.addCell(new Label(15, num, localCurrency, wcf2));
sheet.addCell(new Label(24, num, orderValuedAddedOrderNo, wcf2));
sheet.addCell(new Label(25, num, purchaseChannel, wcf2));
sheet.addCell(new Label(26, num, purchaseAccount, wcf2));
sheet.addCell(new Label(27, num, purchaseOrderNo, wcf2));
sheet.addCell(new Label(31, num, trueName, wcf2));
sheet.addCell(new Label(32, num, date_alt(purchaseTime), wcf2));
sheet.addCell(new Label(33, num, orderType, wcf2));
sheet.addCell(new Label(35, num, remarkText, wcf2));
sheet.addCell(new Number(16, num, Double.parseDouble(localTotalPrice), wcf2));
sheet.addCell(new Number(17, num, Double.parseDouble(purchaseTotalPrice), wcf2));
//反推销售单信息
count_saleOrder = 0;
Double combinOrderTotalPrice = 0.0;
String ORDERID = "";
String createTime = "";//采购时间
String ticketTime = "";//出票时间
String outerOrderNo = "";//外币订单号
Store store = new Store();//店铺信息
String flightLine = "";
String flightTime = "";
String flightNo = "";
String productType = "";//附加产品类型
String productDetail = "";//附加产品规格
String pnr = "";
String ticketNumber = "";
String status = "";
Double orderValuedPrice = 0.0;
for (int j = 0; j < orderArr.size(); j++) {
JSONObject orderObj = orderArr.getJSONObject(j);
String orderId = orderObj.getString("iD");
// if(orderArr.size() == 1){
// ORDERID = orderId;//为合适以前的报表,此变量只在匹配交易信息时匹配orderid,因为历史问题导致purhaseId字段无用
// }
if (saleOrderId.indexOf(orderId) > -1) {//匹配成功
ORDERID = orderId;
count_saleOrder++;
createTime = orderObj.getString("createTime");
createTime = date_alt(createTime);
ticketTime = orderObj.getString("ticketTime");
ticketTime = date_alt(ticketTime);
outerOrderNo = orderObj.getString("outerOrderNo");
String orderBelong = orderObj.getString("orderBelong");
if (storelist != null && storelist.size() > 0) {
for (int tName = 0; tName < storelist.size(); tName++) {
if (storelist.get(tName).getId().equals(orderBelong)) {
store = storelist.get(tName);
break;
}
}
}
String saleTotlalPrice = orderObj.getString("totalPrice");
int orderStatus = orderObj.getInteger("orderStatus");//订单状态
String policySource = orderObj.getString("policySource");//政策信息
status = convertOrderStatus(orderStatus);
sheet.addCell(new Label(0, num + count_saleOrder - 1, createTime, wcf2));
sheet.addCell(new Label(1, num + count_saleOrder - 1, ticketTime, wcf2));
sheet.addCell(new Label(2, num + count_saleOrder - 1, outerOrderNo, wcf2));
sheet.addCell(new Label(3, num + count_saleOrder - 1, store.getChannelCode(), wcf2));
sheet.addCell(new Label(4, num + count_saleOrder - 1, store.getStoreShortName(), wcf2));
sheet.addCell(new Label(30, num + count_saleOrder - 1, status, wcf2));
//政策信息
if (policySource != null && !"".equals(policySource)) {
policySourceArr = Arrays.asList(policySource.split("_", -1));
}
if (policySourceArr.size() == 2) {// 去哪儿、同城、航管等 //单程
if ("0".equals(policySourceArr.get(0))) owPolicyType = "默认";
if ("1".equals(policySourceArr.get(0))) owPolicyType = "普通";
if ("2".equals(policySourceArr.get(0))) owPolicyType = "积分";
if ("3".equals(policySourceArr.get(0))) owPolicyType = "普通促销";
owPolicyCode = policySourceArr.get(1);
sheet.addCell(new Label(28, num + count_saleOrder - 1, owPolicyType, wcf2));//转换后政策类型
sheet.addCell(new Label(29, num + count_saleOrder - 1, policySourceArr.get(1), wcf2));//转换后政策编码
}
if (policySourceArr.size() == 4) {// 淘宝-->单程或者往返 其他平台-->往返
if ("0".equals(policySourceArr.get(0))) owPolicyType = "默认";
if ("1".equals(policySourceArr.get(0))) owPolicyType = "普通";
if ("2".equals(policySourceArr.get(0))) owPolicyType = "积分";
if ("3".equals(policySourceArr.get(0))) owPolicyType = "普通促销";
if ("0".equals(policySourceArr.get(2))) rtPolicyType = "默认";
if ("1".equals(policySourceArr.get(2))) rtPolicyType = "普通";
if ("2".equals(policySourceArr.get(2))) rtPolicyType = "积分";
if ("3".equals(policySourceArr.get(2))) rtPolicyType = "普通促销";
if ("".equals(policySourceArr.get(2)) && "".equals(policySourceArr.get(3))) {
sheet.addCell(new Label(28, num + count_saleOrder - 1, owPolicyType, wcf2));//转换后政策类型
sheet.addCell(new Label(29, num + count_saleOrder - 1, policySourceArr.get(1), wcf2));//转换后政策编码
} else {
sheet.addCell(new Label(28, num + count_saleOrder - 1,
"去程:" + owPolicyType + "\r\n回程:" + rtPolicyType, wcf2));//转换后政策类型
sheet.addCell(new Label(29, num + count_saleOrder - 1,
"去程:" + policySourceArr.get(1) + "\r\n回程:" + policySourceArr.get(3), wcf2));//转换后政策编码
owPolicyCode = "去程:" + owPolicyType + "\r\n回程:" + rtPolicyType;
rtPolicyCode = "去程:" + policySourceArr.get(1) + "\r\n回程:" + policySourceArr.get(3);
}
}
if (policySourceArr.size() >= 6) {// 最新更新后政策信息
if ("0".equals(policySourceArr.get(1))) owPolicyType = "默认";
if ("1".equals(policySourceArr.get(1))) owPolicyType = "普通";
if ("2".equals(policySourceArr.get(1))) owPolicyType = "积分";
if ("3".equals(policySourceArr.get(1))) owPolicyType = "普通促销";
if ("4".equals(policySourceArr.get(1))) owPolicyType = "官网押位";
if ("0".equals(policySourceArr.get(4))) rtPolicyType = "默认";
if ("1".equals(policySourceArr.get(4))) rtPolicyType = "普通";
if ("2".equals(policySourceArr.get(4))) rtPolicyType = "积分";
if ("3".equals(policySourceArr.get(4))) rtPolicyType = "普通促销";
if ("4".equals(policySourceArr.get(4))) rtPolicyType = "官网押位";
if ("".equals(policySourceArr.get(4))) {
sheet.addCell(new Label(28, num + count_saleOrder - 1, owPolicyType, wcf2));//转换后政策类型
sheet.addCell(new Label(29, num + count_saleOrder - 1, policySourceArr.get(2), wcf2));//转换后政策编码
} else {
sheet.addCell(new Label(28, num + count_saleOrder - 1,
"去程:" + owPolicyType + "\r\n回程:" + rtPolicyType, wcf2));//转换后政策类型
sheet.addCell(new Label(29, num + count_saleOrder - 1,
"去程:" + policySourceArr.get(2) + "\r\n回程:" + policySourceArr.get(5), wcf2));//转换后政策编码
owPolicyCode = "去程:" + owPolicyType + "\r\n回程:" + rtPolicyType;
rtPolicyCode = "去程:" + policySourceArr.get(2) + "\r\n回程:" + policySourceArr.get(5);
}
}
//写入附加产品规格
JSONArray ordervalueadded_info = orderObj.getJSONArray("ordervalueadded");//附加产品信息json
if (!"".equals(ordervalueadded_info) && ordervalueadded_info != null) {
for (int x = 0; x < ordervalueadded_info.size(); x++) {
JSONObject ordervalueadded_data = ordervalueadded_info.getJSONObject(x);
productType = ordervalueadded_data.getString("productType");//产品类型
String specifications = ordervalueadded_data.getString("specifications");//产品规格
String productUnit = ordervalueadded_data.getString("productUnit");//产品单位
String quantity = ordervalueadded_data.getString("quantity");//购买数量
String price = ordervalueadded_data.getString("price");//购买价格
String tripType = ordervalueadded_data.getString("tripType");//行程类型
String passengerName = ordervalueadded_data.getString("passengerName");//乘客姓名
if ("1".equals(productType)) {
productType = "行李";
} else if ("2".equals(productType)) {
productType = "值机";
} else if ("3".equals(productType)) {
productType = "餐食";
} else if ("4".equals(productType)) {
productType = "WIFI";
}
if ("0".equals(tripType)) {
tripType = "所有";
} else if ("1".equals(tripType)) {
tripType = "单去程";
} else if ("2".equals(tripType)) {
tripType = "单回程";
}
// orderValuedPrice += Double.parseDouble(price)*Double.parseDouble(quantity);
orderValuedPrice += Double.parseDouble(price);
productDetail += ("[" + passengerName + "-规格:" + specifications + productUnit + ";数量:" + quantity + ";价格:" + price + ";行程:" + tripType + "];");
}
}
//销售金额
if (orderIdStr.indexOf(orderId) == -1) {
orderIdStr += orderId;
} else {
saleTotlalPrice = "0";
orderValuedPrice = 0.0;
}
sheet.addCell(new Label(34, num + count_saleOrder - 1, productDetail, wcf2));
sheet.addCell(new Number(13, num + count_saleOrder - 1, orderValuedPrice, wcf2));
sheet.addCell(new Number(12, num + count_saleOrder - 1, Double.parseDouble(saleTotlalPrice), wcf2));
combinOrderTotalPrice += Double.parseDouble(saleTotlalPrice);
//航班信息
JSONArray flightArr = orderObj.getJSONArray("orderflightinfo");
flightLine = "";
flightTime = "";
flightNo = "";
if (flightArr.size() == 1) orderTripType = "单程";
if (flightArr.size() == 2) orderTripType = "往返";
if (flightArr.size() == 3) orderTripType = "转机";
for (int fli = 0; fli < flightArr.size(); fli++) {
JSONObject flightObject = flightArr.getJSONObject(fli);
String flightId = flightObject.getString("iD");
if (flightSize == 1) {
if (flightInfoIds.indexOf(flightId) > -1) {
flightLine = flightObject.getString("org") + "-" + flightObject.getString("dst");
flightTime = flightObject.getString("flightTime");
flightNo = flightObject.getString("flightNo");
}
} else {
if (flightInfoIds.indexOf(flightId) > -1) {
flightLine += flightObject.getString("org") + "-" + flightObject.getString("dst") + "\r\n";
flightTime += flightObject.getString("flightTime");
flightNo += flightObject.getString("flightNo");
}
}
}
sheet.addCell(new Label(5, num + count_saleOrder - 1, flightLine, wcf2));
sheet.addCell(new Label(6, num + count_saleOrder - 1, date_alt(String.valueOf(flightTime)), wcf2));
sheet.addCell(new Label(7, num + count_saleOrder - 1, flightNo, wcf2));
sheet.addCell(new Label(8, num + count_saleOrder - 1, orderTripType, wcf2));
sheet.addCell(new Label(9, num + count_saleOrder - 1, ticketType, wcf2));
//乘客信息
JSONArray passengerArr = orderObj.getJSONArray("orderpassenger");
for (int pass = 0; pass < passengerArr.size(); pass++) {
JSONObject passengerObj = passengerArr.getJSONObject(pass);
String passengerId = passengerObj.getString("iD");
if (passengerIds.indexOf(passengerId) > -1) {
pnr = passengerObj.getString("pnr");
ticketNumber = passengerObj.getString("ticketNumber");
}
}
if (pnr.indexOf("/") > -1) {
if ("去程".equals(routeType) || "往返".equals(routeType)) {
pnr = pnr.substring(0, pnr.indexOf("/"));
} else {
pnr = pnr.substring(pnr.indexOf("/") + 1);
}
}
sheet.addCell(new Label(10, num, pnr, wcf2));
sheet.addCell(new Number(11, num, passengerSize, wcf2));
}
}
//写入利润
profit = combinOrderTotalPrice - Double.parseDouble(purchaseTotalPrice) + orderValuedPrice;
sheet.addCell(new Number(22, num, profit, wcf2));
//正推交易流水
count_transDetail = 0;
String purchaseId_trans = "";
String orderId_trans = "";
String accountId = "";
String cardNumber = "";
String transactionNumber = "";
String localPrice = "";
String rmbPrice = "";
if (transArr.size() > 0) {
for (int m = 0; m < transArr.size(); m++) {
JSONObject transObj = transArr.getJSONObject(m);
String transId = transObj.getString("id");
purchaseId_trans = transObj.getString("purchaseId");
orderId_trans = transObj.getString("orderId");
accountId = transObj.getString("accountId");
cardNumber = transObj.getString("cardNumber");
transactionNumber = transObj.getString("transactionNumber");
localPrice = transObj.getString("localPrice");
rmbPrice = transObj.getString("rmbPrice");
if (purchaseId.equals(purchaseId_trans)) {
count_transDetail++;
sheet.addCell(new Label(20, num + count_transDetail - 1, accountId, wcf2));
sheet.addCell(new Label(21, num + count_transDetail - 1, cardNumber, wcf2));
sheet.addCell(new Label(23, num + count_transDetail - 1, transactionNumber, wcf2));
sheet.addCell(new Number(18, num + count_transDetail - 1, Double.parseDouble(localPrice), wcf2));
sheet.addCell(new Number(19, num + count_transDetail - 1, Double.parseDouble(rmbPrice), wcf2));
} else {
//以前的报表导出的订单
for (int ord = 0; ord < orderArr.size(); ord++) {
JSONObject orderInfo = orderArr.getJSONObject(ord);
JSONArray transcationDetail_old = orderInfo.getJSONArray("transactiondetail_old");
if (transcationDetail_old != null && !"".equals(transcationDetail_old)) {
for (int tra = 0; tra < transcationDetail_old.size(); tra++) {
JSONObject traObj = transcationDetail_old.getJSONObject(tra);
orderId_trans = traObj.getString("orderId");
accountId = traObj.getString("accountId");
cardNumber = traObj.getString("cardNumber");
transactionNumber = traObj.getString("transactionNumber");
localPrice = traObj.getString("localPrice");
rmbPrice = traObj.getString("rmbPrice");
if (ORDERID.equals(orderId_trans)) {
count_transDetail++;
sheet.addCell(new Label(20, num + count_transDetail - 1, accountId, wcf2));
sheet.addCell(new Label(21, num + count_transDetail - 1, cardNumber, wcf2));
sheet.addCell(new Label(23, num + count_transDetail - 1, transactionNumber, wcf2));
sheet.addCell(new Number(18, num + count_transDetail - 1, Double.parseDouble(localPrice), wcf2));
sheet.addCell(new Number(19, num + count_transDetail - 1, Double.parseDouble(rmbPrice), wcf2));
}
}
}
}
}
}
} else {
//以前的报表导出的订单
for (int ord = 0; ord < orderArr.size(); ord++) {
JSONObject orderInfo = orderArr.getJSONObject(ord);
JSONArray transcationDetail_old = orderInfo.getJSONArray("transactiondetail_old");
if (transcationDetail_old != null && !"".equals(transcationDetail_old)) {
if (transcationDetail_old.size() > 0) {
for (int tra = 0; tra < transcationDetail_old.size(); tra++) {
JSONObject traObj = transcationDetail_old.getJSONObject(tra);
orderId_trans = traObj.getString("orderId");
accountId = traObj.getString("accountId");
cardNumber = traObj.getString("cardNumber");
transactionNumber = traObj.getString("transactionNumber");
localPrice = traObj.getString("localPrice");
rmbPrice = traObj.getString("rmbPrice");
if (ORDERID.equals(orderId_trans)) {
count_transDetail++;
sheet.addCell(new Label(20, num + count_transDetail - 1, accountId, wcf2));
sheet.addCell(new Label(21, num + count_transDetail - 1, cardNumber, wcf2));
sheet.addCell(new Label(23, num + count_transDetail - 1, transactionNumber, wcf2));
sheet.addCell(new Number(18, num + count_transDetail - 1, Double.parseDouble(localPrice), wcf2));
sheet.addCell(new Number(19, num + count_transDetail - 1, Double.parseDouble(rmbPrice), wcf2));
break;
}
}
}
}
}
}
int D_value = 0;
D_value = Math.abs(count_saleOrder - count_transDetail);
mergeNum = count_saleOrder > count_transDetail ? count_saleOrder : count_transDetail;
//销售单对支付信息 一对多,多余的行填充重复的销售单信息
if (count_saleOrder == 1 && count_transDetail > 1) {
for (int repeat = 0; repeat < (count_transDetail - count_saleOrder); repeat++) {
sheet.addCell(new Label(0, num + repeat + 1, createTime, wcf2));
sheet.addCell(new Label(1, num + repeat + 1, ticketTime, wcf2));
sheet.addCell(new Label(2, num + repeat + 1, outerOrderNo, wcf2));
sheet.addCell(new Label(3, num + repeat + 1, store.getChannelCode(), wcf2));
sheet.addCell(new Label(4, num + repeat + 1, store.getStoreShortName(), wcf2));
sheet.addCell(new Label(5, num + repeat + 1, flightLine, wcf2));
sheet.addCell(new Label(6, num + repeat + 1, date_alt(String.valueOf(flightTime)), wcf2));
sheet.addCell(new Label(7, num + repeat + 1, flightNo, wcf2));
sheet.addCell(new Label(8, num + repeat + 1, orderTripType, wcf2));
sheet.addCell(new Label(9, num + repeat + 1, ticketType, wcf2));
sheet.addCell(new Label(10, num + repeat + 1, pnr, wcf2));
// sheet.addCell(new Label(27,num + repeat +1 ,owPolicyCode,wcf2));
// sheet.addCell(new Label(28,num + repeat +1 ,rtPolicyCode,wcf2));
// sheet.addCell(new Label(29,num + repeat +1 ,status,wcf2));
// sheet.addCell(new Label(30,num + repeat +1 ,trueName,wcf2));
}
sheet.mergeCells(12, num, 12, num + mergeNum - 1);//合并订单金额
}
//合并采购信息
sheet.mergeCells(11, num, 11, num + mergeNum - 1);
sheet.mergeCells(14, num, 14, num + mergeNum - 1);
sheet.mergeCells(15, num, 15, num + mergeNum - 1);
sheet.mergeCells(16, num, 16, num + mergeNum - 1);
sheet.mergeCells(17, num, 17, num + mergeNum - 1);
sheet.mergeCells(22, num, 22, num + mergeNum - 1);
sheet.mergeCells(24, num, 24, num + mergeNum - 1);
sheet.mergeCells(25, num, 25, num + mergeNum - 1);
sheet.mergeCells(26, num, 26, num + mergeNum - 1);
sheet.mergeCells(27, num, 27, num + mergeNum - 1);
//sheet.mergeCells(31,num,31,num+mergeNum-1);
sheet.mergeCells(33, num, 33, num + mergeNum - 1);
sheet.mergeCells(35, num, 35, num + mergeNum - 1);
//合并销售单信息
if (count_saleOrder < count_transDetail && D_value > 0) {
// sheet.mergeCells(0,num+count_saleOrder-1,0,num+D_value);
// sheet.mergeCells(1,num+count_saleOrder-1,1,num+D_value);
// sheet.mergeCells(2,num+count_saleOrder-1,2,num+D_value);
// sheet.mergeCells(3,num+count_saleOrder-1,3,num+D_value);
// sheet.mergeCells(4,num+count_saleOrder-1,4,num+D_value);
// sheet.mergeCells(5,num+count_saleOrder-1,5,num+D_value);
// sheet.mergeCells(6,num+count_saleOrder-1,6,num+D_value);
// sheet.mergeCells(7,num+count_saleOrder-1,7,num+D_value);
// sheet.mergeCells(8,num+count_saleOrder-1,8,num+D_value);
// sheet.mergeCells(9,num+count_saleOrder-1,9,num+D_value);
// sheet.mergeCells(12,num+count_saleOrder-1,12,num+D_value);
// sheet.mergeCells(30,num+count_saleOrder-1,29,num+D_value);
}
num += mergeNum;
}
logger.info("生成销售明细报表成功!");
//生成完毕后,将响应结果存入消息队列
// Response response = new Response();
// response.setData(file);
// response.setStatus(Response.Status.SUCCEED);
// response.setErrorMessage(requestId);
// String responseUrl = overseasCheetahUrl + "receive/saleReportResponse.do";
// MessageQueueController.setResponseMessageQueue(responseUrl,response);
} catch (Exception e) {
e.printStackTrace();
logger.error("导出Execl异常", e);
} finally {
workbook.write();
workbook.close();
}
return file;
}
/**
* 将毫秒数转化为日期格式
*
* @param timeMs 传入毫秒数
* @return
*/
public String date_s(String timeMs) {
// long time=Long.parseLong(timeMs);
// Date date=new Date(time);
// SimpleDateFormat sdf=new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
// return sdf.format(date).toString();
return timeMs;
}
public String date_alt(String timeMs) {
try {
long time = Long.parseLong(timeMs);
Date date = new Date(time);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
return sdf.format(date);
} catch (Exception e) {
}
return timeMs;
}
public String OperName(String userId) {
String TrueName = "";
List<User> list = new ArrayList<>();
for (int n = 0; n < list.size(); n++) {
if (list.get(n).getUserID().equals(userId)) {
TrueName = list.get(n).getName();
}
}
return TrueName;
}
//订单状态转换
public String convertOrderStatus(int orderStatus) {
String status = "";
switch (orderStatus) {
case 0:
status = "未支付";
break;
case 2:
status = "等待出票";
break;
case 3:
status = "出票中";
break;
case 4:
status = "已出票";
break;
case 5:
status = "出票失败";
break;
default:
status = "";
break;
}
return status;
}
public String convertRouteType(String key) {
switch (key) {
case "OW":
key = "去程";
break;
case "RT":
key = "回程";
break;
case "OWRT":
key = "往返";
break;
default:
key = "";
break;
}
return key;
}
public String convertTripType(String key) {
switch (key) {
case "OW":
key = "单程";
break;
case "RT":
key = "单程";
break;
case "OWRT":
key = "往返";
break;
default:
key = "";
break;
}
return key;
}
public String convertOrderType(String key) {
switch (key) {
case "ticket":
key = "";
break;
case "luggage":
key = "行李";
break;
case "food":
key = "餐食";
break;
case "checkin":
key = "值机";
break;
default:
key = "";
break;
}
return key;
}
}
package com.yutu.base.service;
import com.alibaba.fastjson.JSONObject;
import com.yutu.base.entity.Response;
import com.yutu.base.utils.HttpsSendData;
import org.apache.commons.lang3.StringUtils;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Service;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.LinkedBlockingDeque;
/**
* 销售明细报表相关操作
*/
@Service
public class SaleDetailService implements CommandLineRunner {
@Value("${spring.urlConfig.overseasAirTicketUrl}")
private String overseasAirTicketUrl;
private static Logger logger = Logger.getLogger("saleDetail");
//任务消息队列,元素 调用AirTicket工程刷新SaleDetail表数据 的参数Map<String,String>
public static BlockingQueue<Map<String,String>> updateSaleDetailQueue = new LinkedBlockingDeque<>();
//提供入队列方法
public static void setUpdateSaleDetailQueue(Map<String,String> paramsMap) {
try{
updateSaleDetailQueue.put(paramsMap);
}catch (Exception e){
logger.error("updateSaleDetailQueue 队列,入队列异常,参数:" + paramsMap);
}
}
/**
* 采购信息更新时,更新报表数据,以队列方式执行
* @param requestBody
* @return
*/
public Response updateSaleDetail(String requestBody){
System.out.println(requestBody);
if(StringUtils.isBlank(requestBody)){
return Response.error("[updateSaleDetail] 参数不合法,requestBody=null");
}
JSONObject reqObj = JSONObject.parseObject(requestBody);
String customerId = reqObj.getString("customerId");
String startTime = reqObj.getString("startTime");
String endTime = reqObj.getString("endTime");
if(StringUtils.isBlank(customerId) || StringUtils.isBlank(startTime) || StringUtils.isBlank(endTime)){
return Response.error("[updateSaleDetail] 参数不合法");
}
try{
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Date endDate = sdf.parse(endTime);
if(endDate.getTime() > new Date().getTime()){
return Response.error("[updateSaleDetail] 当天订单采购信息修改不触发刷新报表数据,endTime="+endTime);
}
Map<String,String> paramsMap = new HashMap<>();
paramsMap.put("customerId",customerId);
paramsMap.put("startTime",startTime);
paramsMap.put("endTime",endTime);
setUpdateSaleDetailQueue(paramsMap);//入队列
logger.info("[updateSaleDetail] 采购信息变动,刷新报表数据任务已加入队列,参数:"+paramsMap);
logger.info("[updateSaleDetail] 当前队列长度 updateSaleDetailQueue.size()="+updateSaleDetailQueue.size());
return Response.success("[updateSaleDetail] 已加入队列");
}catch (Exception e){
logger.error("updateSaleDetail 发生异常",e);
}
return Response.error("未知原因失败");
}
@Override
public void run(String... args) throws Exception {
consumeUpdateSaleDetailQueue();
}
//消费响应消息队列
private void consumeUpdateSaleDetailQueue(){
ExecutorService threadPool = Executors.newFixedThreadPool(1);
Runnable consumeTask = new Runnable() {
@Override
public void run() {
while (true){
logger.info("[updateSaleDetailQueue] 刷新报表队列 当前长度:"+updateSaleDetailQueue.size());
Map<String,String> map = null;
try {
//调用AirTicket工程刷新SaleDetail表数据
map = updateSaleDetailQueue.take();
HttpsSendData.send(overseasAirTicketUrl+"autoSaleDetai/updateSaleDetail.do",map);
logger.info("刷新报表已执行,参数:"+map);
}catch (Exception e) {
logger.error("刷新报表队列执行任务时异常,参数"+map);
}
}
}
};
threadPool.execute(consumeTask);
}
}
package com.yutu.base.service;
import com.yutu.base.entity.SaleRules;
import org.apache.commons.lang3.StringUtils;
import java.math.BigDecimal;
public class SaleRulesService {
public String getExtraData(SaleRules oldRule, SaleRules newRule) {
StringBuilder builder = new StringBuilder();
//状态变化
if( oldRule!=null ){
if(oldRule.getStatus() !=null ){
if (oldRule.getStatus() != newRule.getStatus()) {
builder.append("状态变化:[" + getStatusText(oldRule.getStatus()) + "-->"
+ getStatusText(newRule.getStatus()) + "];");
}
}
if(oldRule.getSaleSdate() !=null ){
if (!oldRule.getSaleSdate().equals(newRule.getSaleSdate()) ||
!oldRule.getSaleEdate().equals(newRule.getSaleEdate())) {
builder.append("销售有效期变化:[" + oldRule.getSaleSdate() + "-" + oldRule.getSaleEdate() + "-->" +
newRule.getSaleSdate() + "-" + newRule.getSaleEdate() + "];");
}
}
if(oldRule.getTripSdate() !=null){
if (!oldRule.getTripSdate().equals(newRule.getTripSdate()) ||
!oldRule.getTripEdate().equals(newRule.getTripEdate())) {
builder.append("旅行有效期变化:[" + oldRule.getTripSdate() + "-" + oldRule.getTripEdate() + "-->" +
newRule.getTripSdate() + "-" + newRule.getTripEdate() + "];");
}
}
if(oldRule.getTicketDays() !=null){
if (!oldRule.getTicketDays().equals(newRule.getTicketDays())) {
builder.append("提前购票天数变化:[" + oldRule.getTicketDays() + "-->" +
newRule.getTicketDays() + "];");
}
}
if(oldRule.getMinPrice() != null){
if (!oldRule.getMinPrice().equals(newRule.getMinPrice()) ||
!oldRule.getMaxPrice().equals(newRule.getMaxPrice())) {
builder.append("价格区间变化:[" + oldRule.getMinPrice() + "-" + oldRule.getMaxPrice() + "-->" +
newRule.getMinPrice() + "-" + newRule.getMaxPrice() + "];");
}
}
if(oldRule.getAdultPricePoint() !=null ){
if ((oldRule.getAdultPricePoint().subtract(newRule.getAdultPricePoint()).compareTo(BigDecimal.ZERO) != 0) ||
oldRule.getAdultAddPrice() != newRule.getAdultAddPrice() ||
(oldRule.getAdultTaxPoint().subtract(newRule.getAdultTaxPoint()).compareTo(BigDecimal.ZERO) != 0) ||
oldRule.getAdultAddTax() != newRule.getAdultAddTax()) {
builder.append("成人返点/留钱变化:[" + oldRule.getAdultPricePoint() + "/" + oldRule.getAdultAddPrice() +
"/" + oldRule.getAdultTaxPoint() + "/" + oldRule.getAdultAddTax() +
"-->" + newRule.getAdultPricePoint() + "/" + newRule.getAdultAddPrice() +
"/" + newRule.getAdultTaxPoint() + "/" + newRule.getAdultAddTax() + "];");
}
}
if(oldRule.getChildPricePoint() !=null ){
if ((oldRule.getChildPricePoint().subtract(newRule.getChildPricePoint()).compareTo(BigDecimal.ZERO) != 0) ||
!oldRule.getChildAddPrice().equals(newRule.getChildAddPrice()) ||
(oldRule.getChildTaxPoint().subtract(newRule.getChildTaxPoint()).compareTo(BigDecimal.ZERO) != 0) ||
!oldRule.getChildAddTax().equals(newRule.getChildAddTax())) {
builder.append("儿童返点/留钱变化:[" + oldRule.getChildPricePoint() + "/" + oldRule.getChildAddPrice() +
"/" + oldRule.getChildTaxPoint() + "/" + oldRule.getChildAddTax() +
"-->" + newRule.getChildPricePoint() + "/" + newRule.getChildAddPrice() +
"/" + newRule.getChildTaxPoint() + "/" + newRule.getChildAddTax() + "];");
}
}
Integer oldMinProfit = oldRule.getMinProfit();
if (oldMinProfit == null) oldMinProfit = 0;
if (!oldMinProfit.equals(newRule.getMinProfit())) {
builder.append("最低利润变化:[" + oldRule.getMinProfit() + "-->" + newRule.getMinProfit() + "]");
}
Integer oldPoint = oldRule.getPoint();
if (oldPoint == null) oldPoint = 0;
if (!oldPoint.equals(newRule.getPoint())) {
builder.append("积分值变化:[" + oldPoint + "-->" + newRule.getPoint() + "]");
}
}
if (StringUtils.isBlank(builder.toString())) builder.append("变化内容为空");
return builder.toString();
}
public String getStatusText(Integer status) {
String oldStatusText = "";
if (status == 0) {
oldStatusText = "禁用";
} else if (status == 1) {
oldStatusText = "启用";
} else {
oldStatusText = "其他";
}
return oldStatusText;
}
}
package com.yutu.base.service;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yutu.base.entity.SaleLog;
import com.yutu.base.utils.HttpsSendData;
import org.apache.commons.lang3.StringUtils;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.LinkedBlockingQueue;
/**
* 定时任务业务层
*/
@Component
public class ScheduleService implements CommandLineRunner {
private static Logger logger = Logger.getLogger("schedule");
@Value("${spring.urlConfig.polestarLogsServicesUrl}")
private String polestarLogsServicesUrl;
@Value("${spring.urlConfig.productServiceUrl}")
private String productServiceUrl;
private SimpleDateFormat sdf = null;
//政策操作日志缓存队列
public static BlockingQueue<SaleLog> saleLogQueue = new LinkedBlockingQueue<>();
public static void setSaleLogQueue(SaleLog saleLog){
try {
saleLogQueue.put(saleLog);
}catch (Exception exception) {
logger.error("政策操作日志设置失败" + JSONObject.toJSONString(saleLog),exception);
}
}
@Override
public void run(String... args) throws Exception {
startScheduleTask();
}
/**
* 政策操作日志通过队列写入MongoDB
*/
private void startScheduleTask(){
ExecutorService threadPool = Executors.newFixedThreadPool(1);
Runnable saveSaleLog = new Runnable() {
@Override
public void run() {
if(saleLogQueue == null) {
logger.error("saleLogQueue is null");
return;
}
List<SaleLog> list = new ArrayList<>();
SaleLog saleLog = null;
while (true){
try {
list.clear();
int num = 0;
Long difference = 0L;
int size = saleLogQueue.size() > 100 ? 100 : saleLogQueue.size();
if(size > 0) {
for (int i = 0; i < size; i++) {
saleLog = saleLogQueue.take();
list.add(saleLog);
}
if(list.size()>0){
Long startTime = System.currentTimeMillis();
//saveSaleLogsToMongoDBBatch(list);//批量插入
saveSaleLogsToMongoDBBatchNew(list);
Long endTime = System.currentTimeMillis();
difference = endTime - startTime;
logger.info("执行新增 SaleLog 数量:"+list.size()+"条! 成功:"+list.size()+"条!"
+" 耗时长:"+String.valueOf(difference)+"ms,剩余"+saleLogQueue.size()+"条日志数据");
}
}else {
Thread.sleep(1000);
}
}catch (Exception e) {
logger.error("销售政策操作日志写入异常-----", e);
}
}
}
};
threadPool.execute(saveSaleLog);
}
//MongoDB.logcenter数据库入库(批量插入)
public void saveSaleLogsToMongoDBBatch(List<SaleLog> saleLogList){
JSONArray array = new JSONArray();
if(saleLogList==null || saleLogList.size()==0){
return;
}
for(int i=0;i<saleLogList.size();i++){
SaleLog saleLog = saleLogList.get(i);
JSONObject object = new JSONObject();
object.put("Id",saleLog.getId());
object.put("customerId",saleLog.getCustomerId());
object.put("referenceId",saleLog.getReferenceId());
object.put("logType",saleLog.getLogType());
object.put("operatorAction",saleLog.getOperatorAction());
object.put("extraData",saleLog.getExtraData());
object.put("operatorId",saleLog.getOperatorId());
object.put("operator",saleLog.getOperator());
object.put("createTime",saleLog.getCreateTime());
array.add(object);
}
try{
HttpsSendData.getPost(polestarLogsServicesUrl+"saleLog/saveSaleLogBatch",JSONObject.toJSONString(array));
}catch (Exception e){
logger.error("政策日志写入MongoDB异常",e);
}
return;
}
//政策日志结构变动,mongodb新数据库需要新字段
public void saveSaleLogsToMongoDBBatchNew(List<SaleLog> saleLogList){
try {
if (saleLogList == null || saleLogList.size() == 0) {
return;
}
List<String> referenceIdList = new ArrayList<>();
for (int i = 0; i < saleLogList.size(); i++) {
referenceIdList.add(saleLogList.get(i).getReferenceId());
}
sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
//通过政策IdList 查询获取政策创建时间 得到 Map<referenceId,ruleCreateTime>
Map<String, Date> ruleCreateTimeMap = new HashMap<>();
List<String> ruleCreateTimeList = getRuleCreateTimeListBy(referenceIdList);
if(ruleCreateTimeList.size() == 0){
return;
}
for (int i = 0; i < ruleCreateTimeList.size(); i++) {
String ruleCreateTimeStr = ruleCreateTimeList.get(i);
String ruleCreateTime = ruleCreateTimeStr.substring(ruleCreateTimeStr.indexOf("^")+1);
ruleCreateTimeMap.put(ruleCreateTimeStr.substring(0,ruleCreateTimeStr.indexOf("^")), sdf.parse(ruleCreateTime));
}
JSONArray array = JSONArray.parseArray(JSONArray.toJSONString(saleLogList));
//遍历更新SaleLog
JSONArray arrayNew = new JSONArray();
for (int i = 0; i < array.size(); i++) {
JSONObject saleLog = array.getJSONObject(i);
String referenceId = saleLog.getString("referenceId");
saleLog.put("ruleCreateTime",ruleCreateTimeMap.get(referenceId));
arrayNew.add(saleLog);
}
HttpsSendData.getPost(polestarLogsServicesUrl+"saleLog/saveSaleLogBatch",JSONObject.toJSONString(arrayNew));
} catch (Exception e) {
logger.error("政策日志写入MongoDB异常", e);
}
return;
}
//获取政策创建时间
public List<String> getRuleCreateTimeListBy(List<String> referenceIdList){
List<String> resultArr = new ArrayList<>();
String url = productServiceUrl + "SaleRules/getRuleCreateTimeListBy.do";
String result = HttpsSendData.getPost(url,JSONArray.toJSONString(referenceIdList));
if(StringUtils.isBlank(result)){
return resultArr;
}
resultArr = JSONArray.parseArray(result,String.class);
return resultArr;
}
}
package com.yutu.base.service;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yutu.base.entity.*;
import com.yutu.base.utils.HttpsSendData;
import com.yutu.base.utils.commonUtil;
import org.apache.commons.lang3.StringUtils;
import org.apache.log4j.Logger;
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.ss.usermodel.*;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.io.FileInputStream;
import java.math.BigDecimal;
import java.sql.Timestamp;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.regex.Pattern;
@Service
public class UploadService {
private static Logger logger = Logger.getLogger("upload");
@Value("${spring.urlConfig.productServiceUrl}")
private String productServiceUrl;
/**
* 销售政策上传主方法
* @param requestBody
* @return
*/
public Response uploadSaleRules(String requestBody) {
if(StringUtils.isBlank(requestBody)){
return Response.error("参数不能为空!");
}
JSONObject reqObj = JSONObject.parseObject(requestBody);
String filePath = reqObj.getString("filePath");
String customerId = reqObj.getString("customerId");
String operator = reqObj.getString("operator");
List<SaleRules> updateList = new ArrayList<>();//更新的政策
List<SaleRules> insertList = new ArrayList<>();//新增的政策
// 创建返回信息对象
Response response = Response.error("数据异常");
try {
//读取一次渠道店铺信息
Map<String,String> params = new HashMap<>();
params.put("customerId",customerId);
String saleStores = HttpsSendData.send(productServiceUrl+"saleStore/findStoreByCustomerId.do",params);
if(StringUtils.isBlank(saleStores)){
return Response.error("获取店铺信息失败!");
}
JSONObject saleStoreObj = JSONObject.parseObject(saleStores);
if(saleStoreObj.getInteger("status") != 0){
return Response.error("获取店铺信息失败!");
}
//将查询得到店铺的数据解析成List<SaleStore>
String storeArrStr = saleStoreObj.getJSONArray("data").toJSONString();
List<SaleStore> storeList = JSONObject.parseArray(storeArrStr, SaleStore.class);
long beginTime = System.currentTimeMillis();
//读取一次现有数据库内已存在数据
params = new HashMap<>();
params.put("customerId",customerId);
String IdResult = HttpsSendData.send(productServiceUrl+"SaleRules/findIdByCustomerId.do",params);
if(StringUtils.isBlank(IdResult)){
return Response.error("获取已有全部 政策ID 失败!");
}
JSONObject IdResultObj = JSONObject.parseObject(IdResult);
if(IdResultObj.getInteger("status") != 0){
return Response.error("获取已有全部 政策ID 失败!");
}
//将查询得到的Id数据解析成List<String>
String IdArrStr = IdResultObj.getJSONArray("data").toJSONString();
List<String> ids = JSONObject.parseArray(IdArrStr, String.class);
logger.info("获取数据库全部已有 Id,总用时:"+(System.currentTimeMillis()-beginTime)+" ms");
//List<String> ids = new ArrayList<>();
@SuppressWarnings("unchecked")
// 开启工作簿
Workbook workbook = WorkbookFactory.create(new FileInputStream(filePath));
// 默认为第一页
Sheet sheet = workbook.getSheetAt(0);
// 记录上传信息大小及人员
logger.info("本次导入数据:" + sheet.getLastRowNum() + "条--" + operator);
// 开始读取数据
for (int i = 0; i < sheet.getLastRowNum(); i++) {
Row row = sheet.getRow(i + 1);
String channel = getCellString(row.getCell(0));
if (StringUtils.isBlank(channel)){
break;
}
if (row != null) {
SaleRules rules = getSaleRules(row, i + 1, response, customerId, operator,storeList);
if (ids.contains(rules.getId())) {
updateList.add(rules);
} else {
if(rules.getId() == null || rules.getId().length() != 36 )
rules.setId(commonUtil.createId());
insertList.add(rules);
}
}
} // 循环结束
Timestamp createTime = new Timestamp(System.currentTimeMillis());
Timestamp updateTime = new Timestamp(System.currentTimeMillis());
// 执行新增或更新
logger.info("待插入数据:" + insertList.size() + "条");
int index = 0 ;
if (!insertList.isEmpty()) {
//1.写入政策日志
for (SaleRules rules : insertList) {
ExtraData<SaleRules> extraData = new ExtraData<SaleRules>(rules, "成功");
String operatotAtion = operator + "上传新增";
SaleLog saleLog = new SaleLog(commonUtil.createId(), customerId, rules.getId(), "saleRule", operatotAtion,
JSONObject.toJSONString(extraData), null, operator, createTime);
ScheduleService.setSaleLogQueue(saleLog);//入队列
index ++;
}
//2.新增数据入库 insertList
long beginSave = System.currentTimeMillis();
int num = saveSaleRulesBatch(insertList);
logger.info("已插入数据:" + num + "条,总用时:"+(System.currentTimeMillis()-beginSave) + "ms");
}
logger.info("待更新数据:" + updateList.size() + "条");
index = 0;
if (!updateList.isEmpty()) {
//1.写入政策日志
for (SaleRules rules : updateList) {
String Id = rules.getId();
params = new HashMap<>();
params.put("id",Id);
String saleRules = HttpsSendData.send(productServiceUrl+"SaleRules/findById.do",params);
JSONObject saleRulesObj = JSONObject.parseObject(saleRules);
SaleRules oldRule = JSONObject.parseObject(saleRulesObj.getJSONObject("data").toJSONString(),SaleRules.class);
String extraData = new SaleRulesService().getExtraData(oldRule, rules);
String operatotAtion = operator + "上传更新";
SaleLog saleLog = new SaleLog(commonUtil.createId(), customerId, rules.getId(), "saleRule", operatotAtion,
extraData, null, operator, new Date());
ScheduleService.setSaleLogQueue(saleLog);//入队列
index ++;
}
//2.更新数据入库 updateList
long beginUpdate = System.currentTimeMillis();
int num = updateSaleRulesBatch(updateList);
logger.info("已更新数据:" + num + "条,总用时:"+(System.currentTimeMillis()-beginUpdate) + "ms");
}
} catch (Exception e) {
logger.error("UpLoadExcelSaleRulesInsert Failed.[uploadInsert],[NoteResult]:{}"+JSONObject.toJSONString(response),e);
return response;
}
return Response.success("文件上传成功,数据导入成功!");
}
//批量新增
public int saveSaleRulesBatch(List<SaleRules> insertList){
List<JSONObject> paramsList = handleSaleRuleList(insertList);
int total = 0;
if(paramsList.size() > 0){
for (int i = 0; i < paramsList.size(); i++) {
String result = HttpsSendData.getPost(
productServiceUrl+"SaleRules/saveSaleRulesBatch.do",JSONObject.toJSONString(paramsList.get(i)));
JSONObject resultObj = JSONObject.parseObject(result);
if(resultObj.getInteger("status") == 0){
logger.info("批量新增成功,数量:"+resultObj.getInteger("data"));
total += resultObj.getInteger("data");
}
}
}
return total;
}
//批量更新
public int updateSaleRulesBatch(List<SaleRules> updateList){
List<JSONObject> paramsList = handleSaleRuleList(updateList);
int total = 0;
if(paramsList.size() > 0){
for (int i = 0; i < paramsList.size(); i++) {
String result = HttpsSendData.getPost(
productServiceUrl+"SaleRules/updateSaleRulesBatch.do",JSONObject.toJSONString(paramsList.get(i)));
JSONObject resultObj = JSONObject.parseObject(result);
if(resultObj == null){
logger.info("批量更新失败,result:" + result);
return 0;
}
if(resultObj.getInteger("status") == 0){
logger.info("批量更新成功,数量:" + resultObj.getInteger("data"));
total += resultObj.getInteger("data");
}
}
}
return total;
}
//批量操作时把数据分批执行
public List<JSONObject> handleSaleRuleList(List<SaleRules> saleRuleList){
List<JSONObject> paramsList = new ArrayList<>();
if(saleRuleList.size() <= 0){
}
if(saleRuleList.size() > 0 && saleRuleList.size() <= 500){//大于0 小于等于500一次性批量执行
JSONArray dataArr = JSONArray.parseArray(JSON.toJSONString(saleRuleList));
JSONObject params = new JSONObject();
params.put("data",dataArr);
paramsList.add(params);
}
if(saleRuleList.size() > 500){//大于500 需要分批次执行
List<SaleRules> tempList = new ArrayList<>();//临时List
for (int i = 0; i < saleRuleList.size(); i++) {
tempList.add(saleRuleList.get(i));
if(tempList.size() >= 500 || i == saleRuleList.size()-1){//满500构造一个List<JSONObject>,最后一个元素装入后执行
JSONArray tempArr = JSONArray.parseArray(JSON.toJSONString(tempList));
JSONObject params = new JSONObject();
params.put("data",tempArr);
paramsList.add(params);
tempList.clear();//清空临时List
}
}
}
return paramsList;
}
/**
* 行数据转换为销售规则类
* @param row 行对象
* @param rowNum 行数
* @param customerId 客户id
* @param operator 操作员
* @return
*/
public static SaleRules getSaleRules(Row row, Integer rowNum, Response response, String customerId,
String operator,List<SaleStore> storeList) {
SaleRules rules = null;
try {
String id = getCellString(row.getCell(31));
String channelId = toConverString(row, 0, rowNum, response);
String store = toConverString(row, 1, rowNum, response);
List<String> channelIdArr = Arrays.asList(channelId.split(",",-1));
List<String> storeArr = Arrays.asList(store.split(",",-1));
if(!"*".equals(channelId) && !"*".equals(store)){ //渠道不为 *
if(!"".equals(channelId) && channelId!=null && channelIdArr.size()>0){
//1.检查渠道、店铺是否存在
for(int j=0;j<channelIdArr.size();j++){ //遍历渠道
for(int k=0;k<storeList.size();k++){
//渠道是否存在
if(channelIdArr.get(j).equals(storeList.get(k).getChannleId())){
//检查渠道对应的店铺是否存在
if(store.indexOf(storeList.get(k).getStoreCode())==-1){
if("Qunar".endsWith(storeList.get(k).getChannleId())
|| "taobao".endsWith(storeList.get(k).getChannleId())){ //Qunar过滤掉
}else{
response.setErrorMessage("渠道对应的店铺缺失,在" + (rowNum + 1) + "行1列! "+channelIdArr.get(j));
throw new RuntimeException("渠道对应的店铺缺失,在" + (rowNum + 1) + "行1列!");
}
}
break;
}else{
if(k==storeList.size()-1){
response.setErrorMessage("渠道不存在,在" + (rowNum + 1) + "行1列! "+channelIdArr.get(j));
throw new RuntimeException("渠道不存在,在" + (rowNum + 1) + "行1列!");
}
}
}
}
for(int j=0;j<storeArr.size();j++){ //遍历店铺
for(int k=0;k<storeList.size();k++){
//店铺是否存在
if(storeArr.get(j).equals(storeList.get(k).getStoreCode())){
//检查店铺对应的渠道是否(全部)存在
if(channelId.indexOf(storeList.get(k).getChannleId())==-1){
response.setErrorMessage("店铺对应渠道缺失,在" + (rowNum + 1) + "行2列! "+storeArr.get(j));
throw new RuntimeException("店铺对应渠道缺失,在" + (rowNum + 1) + "行2列!");
}
break;
}else{
if(k==storeList.size()-1){
response.setErrorMessage("店铺不存在,在" + (rowNum + 1) + "行2列! "+storeArr.get(j));
throw new RuntimeException("店铺不存在,在" + (rowNum + 1) + "行2列!");
}
}
}
}
}
}else{
}
String ruleCode = getCellString(row.getCell(2));
String carrier = toConverString(row, 3, rowNum, response);
String org = toConverString(row, 4, rowNum, response);
String dst = toConverString(row, 5, rowNum, response);
String applyFlightNum = getCellString(row.getCell(6));
String notApplicableFlightNum = getCellString(row.getCell(7));
if (StringUtils.isNotBlank(applyFlightNum)&&StringUtils.isNotBlank(notApplicableFlightNum)){
response.setErrorMessage("适用航班号和不适用航班号不能同时录入,在" + (rowNum + 1) + "行8列!");
throw new RuntimeException("适用航班号和不适用航班号不能同时录入,在" + (rowNum + 1) + "行8列!");
}
String route = toConverString(row, 8, rowNum, response);
Integer routeType = null;
if ("0".equals(route) || "0.0".equals(route)) {
routeType = 0;
} else if ("1".equals(route) || "1.0".equals(route)) {
routeType = 1;
} else if ("2".equals(route) || "2.0".equals(route)) {
routeType = 2;
} else if ("不限".equals(route)) {
routeType = 0;
} else if ("单程".equals(route)) {
routeType = 1;
} else if ("往返".equals(route)) {
routeType = 2;
} else {
response.setErrorMessage("行程类型错误,在" + (rowNum + 1) + "行9列!");
throw new RuntimeException("行程类型错误,在" + (rowNum + 1) + "行9列!");
}
String policy = toConverString(row, 9, rowNum, response);
Integer policyType = null;
if ("普通".equals(policy)) {
policyType = 1;
} else if ("积分".equals(policy)) {
policyType = 2;
} else if ("普通促销".equals(policy)) {
policyType = 3;
} else if ("扣位".equals(policy)) {
policyType = 4;
} else if ("促销积分".equals(policy)) {
policyType = 5;
} else if ("AG".equals(policy)) {
policyType = 6;
} else if ("私有运价".equals(policy)) {
policyType = 7;
} else if ("1".equals(policy) || "1.0".equals(policy)) {
policyType = 1;
} else if ("2".equals(policy) || "2.0".equals(policy)) {
policyType = 2;
} else if ("3".equals(policy) || "3.0".equals(policy)) {
policyType = 3;
} else if ("4".equals(policy) || "4.0".equals(policy)) {
policyType = 4;
} else if ("5".equals(policy) || "5.0".equals(policy)) {
policyType = 5;
} else if ("6".equals(policy) || "6.0".equals(policy)) {
policyType = 6;
} else if ("7".equals(policy) || "7.0".equals(policy)) {
policyType = 7;
} else {
response.setErrorMessage("政策类型错误,在" + (rowNum + 1) + "行10列!");
throw new RuntimeException("政策类型错误,在" + (rowNum + 1) + "行10列!");
}
String policyDesc = getCellString(row.getCell(10));
if (policyDesc == null) {
policyDesc = "";
}
Integer point = toConverInteger(row, 11, rowNum, response);
Integer costPrice = toConverInteger(row, 12, rowNum, response);
String saleSdate = toConverString(row, 13, rowNum, response);
saleSdate = removeZero(saleSdate);
if(!isValidDate(saleSdate)){
response.setErrorMessage("日期格式不正确,在" + (rowNum + 1) + "行14列!");
throw new RuntimeException("日期格式不正确,在" + (rowNum + 1) + "行14列!");
}
String saleEdate = toConverString(row, 14, rowNum, response);
saleEdate = removeZero(saleEdate);
if(!isValidDate(saleEdate)){
response.setErrorMessage("日期格式不正确,在" + (rowNum + 1) + "行15列!");
throw new RuntimeException("日期格式不正确,在" + (rowNum + 1) + "行15列!");
}
String ticketDays = getCellString(row.getCell(15));
if (ticketDays == null) {
ticketDays = "";
}
if(!checkTicketDays(ticketDays)) {
response.setErrorMessage("提前出票天数不正确,在" + (rowNum + 1) + "行16列!");
throw new RuntimeException("提前出票天数不正确,在" + (rowNum + 1) + "行16列!");
}
String tripSdate = getCellString(row.getCell(16));
tripSdate = removeZero(tripSdate);
if(!isValidDate(tripSdate)){
response.setErrorMessage("日期格式不正确,在" + (rowNum + 1) + "行17列!");
throw new RuntimeException("日期格式不正确,在" + (rowNum + 1) + "行17列!");
}
String tripEdate = getCellString(row.getCell(17));
tripEdate = removeZero(tripEdate);
if(!isValidDate(tripEdate)){
response.setErrorMessage("日期格式不正确,在" + (rowNum + 1) + "行18列!");
throw new RuntimeException("日期格式不正确,在" + (rowNum + 1) + "行18列!");
}
String statusType = toConverString(row, 18, rowNum, response);
int status = 0;
if ("启用".equals(statusType)) {
status = 1;
} else if ("禁用".equals(statusType)) {
status = 0;
} else if ("0".equals(statusType) || "0.0".equals(statusType)) {
status = 0;
} else if ("1".equals(statusType) || "1.0".equals(statusType)) {
status = 1;
} else {
response.setErrorMessage("状态信息不正确,在" + (rowNum + 1) + "行19列!");
throw new RuntimeException();
}
Integer minPrice = toConverInteger(row, 19, rowNum, response);
Integer maxPrice = toConverInteger(row, 20, rowNum, response);
Integer minProfit = toConverInteger(row, 21, rowNum, response);
BigDecimal adultPricePoint = new BigDecimal(getCellString(row.getCell(22)));
Integer adultAddPrice = toConverInteger(row, 23, rowNum, response);
if (adultAddPrice == null) {
response.setErrorMessage("在" + (rowNum + 1) + "行24列格式不正确--不能为空");
throw new RuntimeException("在" + (rowNum + 1) + "行24列格式不正确--不能为空");
}
Integer adultAddTax = toConverInteger(row, 24, rowNum, response);
if (adultAddTax == null) {
response.setErrorMessage("在" + (rowNum + 1) + "行25列格式不正确--不能为空");
throw new RuntimeException("在" + (rowNum + 1) + "行25列格式不正确--不能为空");
}
BigDecimal adultTaxPoint = new BigDecimal(getCellString(row.getCell(25)));
BigDecimal childPricePoint = new BigDecimal(getCellString(row.getCell(26)));
Integer childAddPrice = toConverInteger(row, 27, rowNum, response);
if (childAddPrice == null) {
response.setErrorMessage("在" + (rowNum + 1) + "行28列格式不正确--不能为空");
throw new RuntimeException("在" + (rowNum + 1) + "行28列格式不正确--不能为空");
}
Integer childAddTax = toConverInteger(row, 28, rowNum, response);
if (childAddTax == null) {
response.setErrorMessage("在" + (rowNum + 1) + "行29列格式不正确--不能为空");
throw new RuntimeException("在" + (rowNum + 1) + "行29列格式不正确--不能为空");
}
BigDecimal childTaxPoint = new BigDecimal(getCellString(row.getCell(29)));
Timestamp date = new Timestamp(System.currentTimeMillis());
String cabinCode = getCellString(row.getCell(30));
//31列为政策Id
String flightCycle = getCellString(row.getCell(32));
if(StringUtils.isBlank(flightCycle)){
flightCycle = null;
}
String floorPriceStr = getCellString(row.getCell(33));
Double floorPrice = null;
if(StringUtils.isNotBlank(floorPriceStr)){
floorPrice = Double.parseDouble(floorPriceStr);
}
String floorTaxStr = getCellString(row.getCell(34));
Double floorTax = null;
if(StringUtils.isNotBlank(floorTaxStr)){
floorTax = Double.parseDouble(floorTaxStr);
}
if(policyType == 7){//若是私有运价 底价票、税、舱位代码不能为空
if(StringUtils.isBlank(floorPriceStr) || StringUtils.isBlank(floorTaxStr) || StringUtils.isBlank(cabinCode)){
response.setErrorMessage("在" + (rowNum + 1) + "行内容不正确--私有运价的底价票、税、舱位代码不能为空");
throw new RuntimeException("在" + (rowNum + 1) + "行内容不正确--私有运价的底价票、税、舱位代码不能为空");
}
}
String fitShareStr = getCellString(row.getCell(35));
Integer fitShare = 0;
if("适用".equals(fitShareStr)){
fitShare = 1;
}
String fitNationality = getCellString(row.getCell(36));
if(StringUtils.isBlank(fitNationality)){
fitNationality = null;
}
String disFitNationality = getCellString(row.getCell(37));
if(StringUtils.isBlank(disFitNationality)){
disFitNationality = null;
}
String ageRange = getCellString(row.getCell(38));
if(StringUtils.isBlank(ageRange)){
ageRange = null;
}
String attention = getCellString(row.getCell(39));
if(StringUtils.isBlank(attention)){
attention = null;
}
rules = new SaleRules(id, customerId, channelId, store, ruleCode, carrier, org, dst, routeType, policyType,
policyDesc, point, costPrice, saleSdate, saleEdate, ticketDays, tripSdate, tripEdate, status,
maxPrice, minPrice, minProfit, adultPricePoint, adultAddPrice, adultAddTax, adultTaxPoint,
childPricePoint, childAddPrice, childAddTax, childTaxPoint, operator, date, date,0,notApplicableFlightNum,applyFlightNum,null,cabinCode,
flightCycle,floorPrice,floorTax,fitShare,fitNationality,disFitNationality,ageRange,attention);
} catch (Exception e) {
logger.error("UpLoadExcelSaleRulesInsert Failed.[getSaleRules],[Response]:{}"+JSONObject.toJSONString(response),e);
throw new RuntimeException("createSaleRules:NoteResult:" + response);
}
return rules;
}
/**
* 检查ticketDays格式
* @param ticketDays
* @return
*/
public static Boolean checkTicketDays(String ticketDays) {
final Pattern pattern = Pattern.compile("\\d*\\-\\d*");
return pattern.matcher(ticketDays).find();
}
/**
* 数据转字符串判定类,进行非空判定
* @param row 行对象
* @param cellNum 列数
* @param rowNum 行数
* @return 返回获取的数据
*/
public static String toConverString(Row row, Integer cellNum, Integer rowNum, Response response) {
String cellString = getCellString(row.getCell(cellNum));
String value = "";
try {
if (cellString == null || "".equals(cellString)) {
throw new RuntimeException();
}
value = cellString;
} catch (Exception e) {
logger.info("fail", e);
response.setErrorMessage("在" + (rowNum + 1) + "行" + (cellNum + 1) + "列格式不正确--不能为空");
throw new RuntimeException();
}
return value;
}
/**
* 去零操作
* @param string 需要去零的字符串 ,日期操作时使用
* @return 返回去零结果
*/
public static String removeZero(String string) {
String value = "";
if (string != null && !"".equals(string)) {
DecimalFormat df = new DecimalFormat("0");
value = df.format(Double.valueOf(string));
}
return value;
}
/**
* 转换为整数型的格式
* @param row 行元素
* @param cellNum 列数
* @param rowNum 行数
* @return 返回转换后的结果
*/
public static Integer toConverInteger(Row row, Integer cellNum, Integer rowNum, Response response) {
String cellString = getCellString(row.getCell(cellNum));
DecimalFormat df = new DecimalFormat("0");
Integer value = null;
try {
if (cellString == null||"".equals(cellString)) {
return value;
}
value = Integer.valueOf(df.format(Double.valueOf(cellString)));
} catch (Exception e) {
response.setErrorMessage("在" + (rowNum + 1) + "行" + (cellNum + 1) + "列格式不正确");
logger.info("fail", e);
throw new RuntimeException();
}
return value;
}
/**
* 对单元格进行数据获取
* @param cell 单元格对象
* @return 统一返回字符串
*/
protected static String getCellString(Cell cell) {
String result = null;
if (cell != null) {
int cellType = cell.getCellType();
switch (cellType) {
case HSSFCell.CELL_TYPE_STRING:
result = cell.getStringCellValue();
break;
case HSSFCell.CELL_TYPE_NUMERIC:
result = String.valueOf(cell.getNumericCellValue());
break;
case HSSFCell.CELL_TYPE_FORMULA:
result = String.valueOf(cell.getNumericCellValue());
break;
case HSSFCell.CELL_TYPE_ERROR:
result = null;
break;
case HSSFCell.CELL_TYPE_BOOLEAN:
result = String.valueOf(cell.getBooleanCellValue());
break;
case HSSFCell.CELL_TYPE_BLANK:
result = null;
break;
}
}
return result;
}
public static boolean isValidDate(String str) {
boolean convertSuccess=true;
if(str.length()!=8){
convertSuccess=false;
return convertSuccess;
}
// 指定日期格式为四位年/两位月份/两位日期,注意yyyy/MM/dd格式;
SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd");
try { // 设置lenient为false. 否则SimpleDateFormat会比较宽松地验证日期,比如2007/02/29会被接受,并转换成2007/03/01
format.setLenient(false);
format.parse(str);
} catch (Exception e) {
e.printStackTrace();// 如果throw java.text.ParseException或者NullPointerException,就说明格式不对
convertSuccess=false;
}
return convertSuccess;
}
//上传私有运价底价配置
public Response uploadPrivateFreight(String requestBody) {
if (StringUtils.isBlank(requestBody)) {
return Response.error("requestBody参数不能为空!");
}
JSONObject reqObj = JSONObject.parseObject(requestBody);
String filePath = reqObj.getString("filePath");
String customerId = reqObj.getString("customerId");
String operator = reqObj.getString("operator");
if(StringUtils.isBlank(customerId)){
return Response.error("customerId参数不能为空!");
}
List<PrivateFreight> updateList = new ArrayList<>();//更新的私有运价配置
List<PrivateFreight> insertList = new ArrayList<>();//新增的私有运价配置
// 创建返回信息对象
Response response = Response.error("数据异常");
try{
Map<String,String> params = new HashMap<>();
params.put("customerId",customerId);
long beginTime = System.currentTimeMillis();
//读取一次现有数据库内已存在数据
params = new HashMap<>();
params.put("customerId",customerId);
String IdResult = HttpsSendData.send(productServiceUrl+"privateFreight/findIdByCustomerId.do",params);
if(StringUtils.isBlank(IdResult)){
return Response.error("获取已有全部 私有运价底价配置ID 失败!");
}
JSONObject IdResultObj = JSONObject.parseObject(IdResult);
if(IdResultObj.getInteger("status") != 0){
return Response.error("获取已有全部 私有运价底价配置ID 失败!");
}
//将查询得到的Id数据解析成List<String>
String IdArrStr = IdResultObj.getJSONArray("data").toJSONString();
List<String> ids = JSONObject.parseArray(IdArrStr, String.class);
logger.info("获取数据库全部已有 私有运价底价配置Id,总用时:"+(System.currentTimeMillis()-beginTime)+" ms");
@SuppressWarnings("unchecked")
// 开启工作簿
Workbook workbook = WorkbookFactory.create(new FileInputStream(filePath));
// 默认为第一页
Sheet sheet = workbook.getSheetAt(0);
// 记录上传信息大小及人员
logger.info("本次导入数据:" + sheet.getLastRowNum() + "条--" + operator);
// 开始读取数据
for (int i = 0; i < sheet.getLastRowNum(); i++) {
Row row = sheet.getRow(i + 1);
String channel = getCellString(row.getCell(0));
if (StringUtils.isBlank(channel)){
break;
}
if (row != null) {
PrivateFreight privateFreight = getPrivateFreights(row, i + 1, response, customerId, operator);
if (ids.contains(privateFreight.getId())) {
updateList.add(privateFreight);
} else {
if(privateFreight.getId() == null || privateFreight.getId().length() != 36 )
privateFreight.setId(commonUtil.createId());
insertList.add(privateFreight);
}
}
} // 循环结束
// 执行新增或更新
logger.info("待插入数据:" + insertList.size() + "条");
int index = 0 ;
if (!insertList.isEmpty()) {
//新增数据入库 insertList
long beginSave = System.currentTimeMillis();
int num = savePrivateFreightsBatch(insertList);
logger.info("已插入数据:" + num + "条,总用时:"+(System.currentTimeMillis()-beginSave) + "ms");
}
logger.info("待更新数据:" + updateList.size() + "条");
index = 0;
if (!updateList.isEmpty()) {
//更新数据入库 updateList
long beginUpdate = System.currentTimeMillis();
int num = updatePrivateFreightsBatch(updateList);
logger.info("已更新数据:" + num + "条,总用时:"+(System.currentTimeMillis()-beginUpdate) + "ms");
}
return Response.success("文件上传成功,数据导入成功!");
}catch (Exception e){
logger.error("上传失败",e);
}
return response;
}
public static PrivateFreight getPrivateFreights(Row row, Integer rowNum, Response response, String customerId, String operator) {
PrivateFreight privateFreight = null;
try {
String id = getCellString(row.getCell(9));
if(StringUtils.isBlank(id)){
id = UUID.randomUUID().toString();
}
String carrier = getCellString(row.getCell(1));
if(StringUtils.isBlank(carrier)){
response.setErrorMessage("在" + (rowNum + 1) + "行内容不正确--航司缺失!");
throw new RuntimeException("在" + (rowNum + 1) + "行内容不正确--航司缺失!");
}
String org = getCellString(row.getCell(2));
if(StringUtils.isBlank(org)){
response.setErrorMessage("在" + (rowNum + 1) + "行内容不正确--出发地缺失!");
throw new RuntimeException("在" + (rowNum + 1) + "行内容不正确--出发地缺失!");
}
String dst = getCellString(row.getCell(3));
if(StringUtils.isBlank(dst)){
response.setErrorMessage("在" + (rowNum + 1) + "行内容不正确--抵达地缺失!");
throw new RuntimeException("在" + (rowNum + 1) + "行内容不正确--抵达地缺失!");
}
String flightNo = getCellString(row.getCell(4));
if(StringUtils.isBlank(flightNo)){
response.setErrorMessage("在" + (rowNum + 1) + "行内容不正确--航班号缺失!");
throw new RuntimeException("在" + (rowNum + 1) + "行内容不正确--航班号缺失!");
}
String cabin = getCellString(row.getCell(5));
if(StringUtils.isBlank(cabin)){
response.setErrorMessage("在" + (rowNum + 1) + "行内容不正确--舱位代码缺失!");
throw new RuntimeException("在" + (rowNum + 1) + "行内容不正确--舱位代码缺失!");
}
String floorPriceStr = getCellString(row.getCell(6));
if(StringUtils.isBlank(floorPriceStr)){
response.setErrorMessage("在" + (rowNum + 1) + "行内容不正确--底价票面不能为空!");
throw new RuntimeException("在" + (rowNum + 1) + "行内容不正确--底价票面不能为空!");
}
String floorTaxStr = getCellString(row.getCell(7));
if(StringUtils.isBlank(floorTaxStr)){
response.setErrorMessage("在" + (rowNum + 1) + "行内容不正确--底价税不能为空!");
throw new RuntimeException("在" + (rowNum + 1) + "行内容不正确--底价税不能为空!");
}
String ruleCodeIds = getCellString(row.getCell(8));
if(StringUtils.isBlank(ruleCodeIds)){
response.setErrorMessage("在" + (rowNum + 1) + "行内容不正确--规则编码缺失!");
throw new RuntimeException("在" + (rowNum + 1) + "行内容不正确--规则编码缺失!");
}
//对规则Id进行正则判断
List<String> ruleCodeIdArr = Arrays.asList(ruleCodeIds.split(","));
boolean isMatch = Boolean.FALSE;
if(ruleCodeIdArr != null && ruleCodeIdArr.size() > 0){
for (int i = 0; i < ruleCodeIdArr.size(); i++) {
String ruleCode = ruleCodeIdArr.get(i);
if(ruleCode.indexOf(",") == -1){
if(ruleCode.indexOf("DR-") == 0){
isMatch = Pattern.matches("^[A-Z]{2}-(\\d){8}-(\\d){8}$", ruleCode);
}else if(ruleCode.indexOf("FW-") == 0){
isMatch = Pattern.matches("^[A-Z]{2}-(\\d){1,7}$", ruleCode);
}else if(ruleCode.indexOf("FN-") == 0 || ruleCode.indexOf("DN-") == 0){
isMatch = Pattern.matches("^[A-Z]{2}-[A-Z]{2}(~[A-Z]{2})*$", ruleCode);
}else if(ruleCode.indexOf("AR-") == 0){
isMatch = Pattern.matches("^[A-Z]{2}-(\\d){2}-(\\d){2}$", ruleCode);
}else if(ruleCode.indexOf("PA-") == 0){
isMatch = Pattern.matches("^[A-Z]{2}-.*$", ruleCode);
}
}
if(!isMatch){
logger.info("规则编码错误的值是:"+ruleCode);
break;
}
}
}
if(!isMatch){//匹配失败
response.setErrorMessage("在" + (rowNum + 1) + "行内容不正确--规则编码格式不正确!");
throw new RuntimeException("在" + (rowNum + 1) + "行内容不正确--规则编码格式不正确!");
}
privateFreight = new PrivateFreight(id, customerId,carrier,org,dst,cabin,flightNo,
Double.parseDouble(floorPriceStr),Double.parseDouble(floorTaxStr),ruleCodeIds,
operator,new Date(),new Date(),null);
} catch (Exception e) {
logger.error("UpLoadExcelPrivateFreightsInsert Failed.[getPrivateFreights],[Response]:{}"+JSONObject.toJSONString(response),e);
throw new RuntimeException("UpLoadPrivateFreights:NoteResult:" + response);
}
return privateFreight;
}
// public static void main(String[] args) {
// boolean isMatch = Pattern.matches("^[A-Z]{2}-(\\d){8}-(\\d){8}$", "DR-20190426-20190430");
// System.out.println(isMatch);
// }
//批量新增
public int savePrivateFreightsBatch(List<PrivateFreight> insertList){
int total = 0;
if(insertList.size() > 0){
JSONArray insertArr = JSONObject.parseArray(JSONObject.toJSONString(insertList));
Map<String,String> map = new HashMap<>();
map.put("reqBody",insertArr.toJSONString());
String result = HttpsSendData.send(productServiceUrl+"privateFreight/insertBatch.do",map);
JSONObject resultObj = JSONObject.parseObject(result);
if(resultObj.getInteger("status") == 0){
logger.info("批量新增成功,数量:"+resultObj.getInteger("data"));
total += resultObj.getInteger("data");
}
}
return total;
}
//批量更新
public int updatePrivateFreightsBatch(List<PrivateFreight> updateList){
int total = 0;
if(updateList.size() > 0){
JSONArray updateArr = JSONObject.parseArray(JSONObject.toJSONString(updateList));
Map<String,String> map = new HashMap<>();
map.put("reqBody",updateArr.toJSONString());
String result = HttpsSendData.send(productServiceUrl+"privateFreight/updateBatch.do",map);
JSONObject resultObj = JSONObject.parseObject(result);
if(resultObj == null){
logger.info("批量更新失败,result:" + result);
return 0;
}
if(resultObj.getInteger("status") == 0){
logger.info("批量更新成功,数量:" + resultObj.getInteger("data"));
total += resultObj.getInteger("data");
}
}
return total;
}
}
package com.yutu.base.utils;
import java.util.concurrent.CyclicBarrier;
/**
* 线程的循环屏障(解决并发任务执行需要等待全部线程执行完毕的情况)
*/
public class CyclicBarrierUtil {
public static class MyRunable implements Runnable {
CyclicBarrier _cb;
int _i = 0;
public MyRunable(CyclicBarrier cb, int i) {
this._cb = cb;
this._i = i;
}
@Override
public void run() {
try {
Thread.sleep((long) (Math.random() * 100));
System.out.println("thread " + _i + " done,正在等候其它线程完成...");
_cb.await();
} catch (Exception e) {
e.printStackTrace();
}
}
}
// public static void main(String[] args) throws Exception {
//
// final int threadNum = 10;
// CyclicBarrier cb = new CyclicBarrier(threadNum + 1);//注意:10个子线程 + 1个主线程
//
// for (int i = 0; i < threadNum; i++) {
// new Thread(new MyRunable(cb, i)).start();
// }
//
// cb.await();
// System.out.println("-----------\n所有thread执行完成!");
// }
}
package com.yutu.base.utils;
import org.apache.commons.lang3.time.DateFormatUtils;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
/**
* 项目名称:polestarOtaOrder
* 类名称:DateUtil
* 类描述: 时间操作类
* @author wang yu
* 创建时间:2017-11-01 10:27AM
* @version
*/
public class DateUtil {
/**
* 生成ISO-8601 规范的时间格式
* @param date
* @return
*/
public static String formatISO8601DateString(Date date){
String pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSZ";
return DateFormatUtils.format(date, pattern);
}
/**
* 获取原时间戳
* @param reverseTime
* @return
*/
public static Long recoverReverseTime(Long reverseTime){
long longTime = Long.MAX_VALUE - reverseTime;
return longTime/1000000;
}
/*
* 获取系统当前日期及时间
* */
public static Date getCurrentTime(){
SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date currentTime=null;
try {
currentTime= sdf.parse(sdf.format(new Date()));
} catch (ParseException e) {
e.printStackTrace();
}
return currentTime;
}
/**
* 生成页面普通展示时间
* @param date
* @return
*/
public static String formatNormalDateString(Date date){
String pattern = "yyyy-MM-dd HH:mm:ss";
return DateFormatUtils.format(date, pattern);
}
/**
* 日期转换成字符串
* @param date
* @return str
*/
public static String DateToStr(Date date,String formatPattern) {
SimpleDateFormat format = new SimpleDateFormat(formatPattern);
String str = format.format(date);
return str;
}
/**
* 字符串转换成日期
* @param str
* @return date
*/
public static Date StrToDate(String str,String formatPattern) {
SimpleDateFormat format = new SimpleDateFormat(formatPattern);
Date date = null;
try {
date = format.parse(str);
} catch (ParseException e) {
e.printStackTrace();
}
return date;
}
/*
* 将当前日期增加天数
* @param date 要计算的日期
* @param days 要增加的天数
* @return 计算后的新日期
* */
public static Date dayAdd(Date date,int days){
Calendar ca = Calendar.getInstance();//得到一个Calendar的实例
ca.setTime(date); //设置时间
ca.add(Calendar.DAY_OF_MONTH, days); //年份减1
date = ca.getTime(); //结果
return date;
}
/*
* 将时间转换为时间戳
*/
public static String dateToStamp(String s) throws ParseException{
String res;
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date date = simpleDateFormat.parse(s);
long ts = date.getTime();
res = String.valueOf(ts);
return res;
}
/*
* 将时间戳转换为时间
*/
public static String stampToDate(String s){
String res;
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
long lt = new Long(s);
Date date = new Date(lt);
res = simpleDateFormat.format(date);
return res;
}
}
package com.yutu.base.utils;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.UUID;
import javax.servlet.ServletException;
import javax.servlet.ServletInputStream;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.log4j.Logger;
public class FileReceiveServlet extends HttpServlet{
/**
* Logger for this class
*/
private static final Logger logger = Logger.getLogger(FileReceiveServlet.class);
private static final long serialVersionUID = 1L;
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
doPost(req, resp);
}
@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
fileReceive(req,resp);
}
public void fileReceive(HttpServletRequest req, HttpServletResponse resp) {
logger.info("接收文件+++++++++++++++++++");
try {
String fileName = "d:/airpxml/"+UUID.randomUUID().toString()+".zip";
ServletInputStream in = req.getInputStream();
File f = new File(fileName);
FileOutputStream fos = new FileOutputStream(f);
byte[] b = new byte[1024];
int n=0;
while((n=in.read(b))!=-1){
System.out.println(n);
fos.write(b,0,n);
}
fos.close();
in.close();
} catch (Exception e) {
logger.info("接收失败+++++++++++++++++"+e.getMessage());
e.printStackTrace();
}
}
}
package com.yutu.base.utils;
import org.apache.commons.lang3.StringUtils;
import java.io.File;
import java.io.FileOutputStream;
import java.util.Date;
public class FileWriter {
public static void write(String str){
try {
String witePath = "E:/write"+new Date()+".txt";
File file = new File(witePath);
if(!file.exists()){
file.mkdir();
}
FileOutputStream os = new FileOutputStream(file);
if(StringUtils.isBlank(str)){
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
package com.yutu.base.utils;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.httpclient.*;
import org.apache.commons.httpclient.methods.GetMethod;
import org.apache.commons.httpclient.methods.PostMethod;
import org.apache.commons.httpclient.methods.StringRequestEntity;
import org.apache.commons.httpclient.params.HttpClientParams;
import org.apache.commons.httpclient.params.HttpMethodParams;
import org.apache.log4j.Logger;
import java.io.IOException;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Scanner;
public class HttpsSendData {
/**
* @param url 请求地址
* @param paramsMap 将参数的名作为键
* @return
*/
public static Logger logger= Logger.getLogger(HttpsSendData.class.getName());
public static String send(String url, Map<String, String> paramsMap) {
String result = null;
PostMethod postMethod = null;
HttpClient httpClient = new HttpClient();
httpClient.getParams().setParameter(
HttpMethodParams.HTTP_CONTENT_CHARSET, "utf-8");
postMethod = new PostMethod(url);
if (paramsMap != null && paramsMap.size() > 0) {
NameValuePair[] datas = new NameValuePair[paramsMap.size()];
int index = 0;
for (String key : paramsMap.keySet()) {
datas[index++] = new NameValuePair(key,paramsMap.get(key));
}
postMethod.setRequestBody(datas);
}
HttpClientParams httparams = new HttpClientParams();
httparams.setSoTimeout(300000);
postMethod.setParams(httparams);
try {
int statusCode = httpClient.executeMethod(postMethod);
if (statusCode == HttpStatus.SC_OK) {
//result = postMethod.getResponseBodyAsString();//原来的方式
InputStream is = postMethod.getResponseBodyAsStream();
Scanner scanner = new Scanner(is, "UTF-8");
result=scanner.useDelimiter("\\A").next();
} else {
System.out.println("请求状态:"+statusCode);
}
} catch (Exception e) {
e.printStackTrace();
}finally {
if (postMethod != null) {
//释放链接
postMethod.releaseConnection();
}
if(url.contains("insert.do") || url.contains("update.do") || url.contains("delete")){
logger.info("url:"+url);
logger.info("paramsMap:"+paramsMap);
logger.info("result:"+ JSONObject.toJSONString(result));
}
if(url.contains("notify") || url.contains("assistant")){
logger.info("url:"+url);
logger.info("paramsMap:"+paramsMap);
logger.info("result:"+ JSONObject.toJSONString(result));
}
if(url.contains("ia")){
logger.info("url:"+url);
logger.info("paramsMap:"+paramsMap);
logger.info("result:"+ JSONObject.toJSONString(result));
}
}
return result;
}
public static String getPost(String url, String body) {
//System.out.println("准备开始发送请求:"+System.currentTimeMillis());
String result = null;
PostMethod postMethod = new PostMethod(url);
if(body!=null && !"".equals(body)){
StringRequestEntity requestEntity;
try {
requestEntity = new StringRequestEntity(body,"application/json","UTF-8");
postMethod.setRequestEntity(requestEntity);
} catch (UnsupportedEncodingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
HttpClientParams httparams = new HttpClientParams();
httparams.setSoTimeout(180000);
postMethod.setParams(httparams);
postMethod.setRequestHeader("Content-Type","application/json;charset=UTF-8");
HttpClient httpClient = new HttpClient();
httpClient.getParams().setParameter(
HttpMethodParams.HTTP_CONTENT_CHARSET, "utf-8");
try {
int statusCode = httpClient.executeMethod(postMethod);
if (statusCode == HttpStatus.SC_OK) {
//result = postMethod.getResponseBodyAsString();//原来的方式
InputStream is = postMethod.getResponseBodyAsStream();
Scanner scanner = new Scanner(is, "UTF-8");
result=scanner.useDelimiter("\\A").next();
} else {
System.out.println("请求状态:"+statusCode);
}
} catch (Exception e) {
e.printStackTrace();
}finally {
if (postMethod != null) {
//释放链接
postMethod.releaseConnection();
}
}
//System.out.println("收到响应:"+System.currentTimeMillis());
return result;
}
public static String httpPost(String url, String body) {
//System.out.println("准备开始发送请求:"+System.currentTimeMillis());
String result = null;
PostMethod postMethod = new PostMethod(url);
if(body!=null && !"".equals(body)){
StringRequestEntity requestEntity;
try {
requestEntity = new StringRequestEntity(body,"application/json","UTF-8");
postMethod.setRequestEntity(requestEntity);
} catch (UnsupportedEncodingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
HttpClientParams httparams = new HttpClientParams();
httparams.setSoTimeout(180000);
postMethod.setParams(httparams);
postMethod.setRequestHeader("Content-Type","application/json;charset=UTF-8");
HttpClient httpClient = new HttpClient();
httpClient.getParams().setParameter(
HttpMethodParams.HTTP_CONTENT_CHARSET, "utf-8");
try {
int statusCode = httpClient.executeMethod(postMethod);
if (statusCode == HttpStatus.SC_OK) {
//result = postMethod.getResponseBodyAsString();//原来的方式
InputStream is = postMethod.getResponseBodyAsStream();
Scanner scanner = new Scanner(is, "UTF-8");
result=scanner.useDelimiter("\\A").next();
} else {
System.out.println("请求状态:"+statusCode);
}
} catch (Exception e) {
e.printStackTrace();
}finally {
if (postMethod != null) {
//释放链接
postMethod.releaseConnection();
}
}
//System.out.println("收到响应:"+System.currentTimeMillis());
return result;
}
}
package com.yutu.base.utils;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;
/**
* @description 用于定义将实体对象中的值转换为json时要转换的时间字符串格式,需要在实体类的getTime
* 方法上打标记:@JsonSerialize(using=JsonDateSerializer.class)
* 如果实体类用的类型为java.sql.Timestamp则 这里要用java.util.Date类型类转换
* 不能用java.sql.Date
* @author aokunsang
* @date 2013-5-28
*/
public class JsonDateSerializer extends JsonSerializer<Date> {
@Override
public void serialize(Date value,
JsonGenerator jsonGenerator,
SerializerProvider provider)
throws IOException, JsonProcessingException {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
jsonGenerator.writeString(sdf.format(value));
}
}
package com.yutu.base.utils;
import java.io.UnsupportedEncodingException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
public class MD5 {
/**
* Md5加密(32位)
* @param str
* @return
*/
public static String getMD5Str(String str){
MessageDigest messageDigest = null;
try
{
messageDigest = MessageDigest.getInstance("MD5");
messageDigest.reset();
messageDigest.update(str.getBytes("UTF-8"));
} catch (NoSuchAlgorithmException e)
{
System.out.println("NoSuchAlgorithmException caught!");
System.exit(-1);
} catch (UnsupportedEncodingException e)
{
e.printStackTrace();
}
byte[] byteArray = messageDigest.digest();
StringBuffer md5StrBuff = new StringBuffer();
for (int i = 0; i < byteArray.length; i++)
{
if (Integer.toHexString(0xFF & byteArray[i]).length() == 1)
md5StrBuff.append("0").append(Integer.toHexString(0xFF & byteArray[i]));
else
md5StrBuff.append(Integer.toHexString(0xFF & byteArray[i]));
}
return md5StrBuff.toString();
}
}
package com.yutu.base.utils;
import com.alibaba.fastjson.JSONObject;
import java.util.Comparator;
public class MyComparator implements Comparator<JSONObject> {
@Override
public int compare(JSONObject o1, JSONObject o2) {
String key1 = o1.getString("purchaseTime");
String key2 = o2.getString("purchaseTime");
Double double1 = Double.parseDouble(key1);
Double double2 = Double.parseDouble(key2);
if(double1>double2){
return 1;
}
return 0;
}
}
package com.yutu.base.utils;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.codec.Charsets;
import javax.crypto.Cipher;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.UnsupportedEncodingException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.UUID;
public class commonUtil {
/**使用统一的UTF-8方式获得字符串md5值*/
public final static String getMD5(String s) {
char hexDigits[]={'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'};
try {
byte[] btInput = s.getBytes("utf-8");
// 获得MD5摘要算法的 MessageDigest 对象
MessageDigest mdInst = MessageDigest.getInstance("MD5");
// 使用指定的字节更新摘要
mdInst.update(btInput);
// 获得密文
byte[] md = mdInst.digest();
// 把密文转换成十六进制的字符串形式
int j = md.length;
char str[] = new char[j * 2];
int k = 0;
for (int i = 0; i < j; i++) {
byte byte0 = md[i];
str[k++] = hexDigits[byte0 >>> 4 & 0xf];
str[k++] = hexDigits[byte0 & 0xf];
}
return new String(str);
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
/**
* 生成UUID值
* @return
*/
public static String createId(){
UUID uid=UUID.randomUUID();//每次产生一个随机字符串,具有唯一性
return uid.toString();
}
/**
* 如果字符串参数不为空则去掉前后空格后返回,如果字符串为空字符串则返回null
* @param str
* @return
*/
public static String initStr(String str){
if(str!=null){
str=str.trim();
if("".equals(str)){
str=null;
}
}
return str;
}
/**
* 初始化 HttpServletResponse对象 返回输出流
* @param resp
* @return
* @throws IOException
*/
public static PrintWriter InitResponse(HttpServletResponse resp) throws IOException{
resp.setCharacterEncoding("utf-8");//
resp.setContentType("text/plain;charset=utf-8");
PrintWriter pw = resp.getWriter();
return pw;
}
/**
*
* @param req http请求对象
* @return 返回http请求字符串(utf-8编码)
* @throws IOException
*/
public static String getRequestBody(HttpServletRequest req) throws IOException{
InputStream is=req.getInputStream();
StringBuffer sb = new StringBuffer();
byte[] bs = new byte[4096];
int length = 0;
try {
while ((length = is.read(bs)) > 0) {
sb.append(new String(bs, 0 , length,"utf-8"));
}
is.close();
} catch (Exception e) {
e.printStackTrace();
}
return sb.toString();
}
/**
* 判断字符串数组中的元素是否全不为空或者为空字符串
* @param params
* @return 字符串数组中有一个元素为空或空字符串则返回false,否则返回true
*/
public static boolean checkParameter(String[] params){
boolean b=true;
if(params!=null && params.length>0){
for(int i=0;i<params.length;i++){
if(params[i]==null || "".equals(params[i])){
b=false;
break;
}
}
}else{
b=false;
}
return b;
}
/**
* 将时间字符串转换为Timestamp类型
* @param timeStr 时间字符串(yyyy-MM-dd HH:mm:ss)
* @return
*/
public static Timestamp stringToTime(String timeStr){
Timestamp ttime=null;
if(timeStr!=null && !"".equals(timeStr)){
SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
Date date=sdf.parse(timeStr);
ttime=new Timestamp(date.getTime());
} catch (Exception e) {
System.out.println("时间字符串转换为Timestamp时异常");
}
}
return ttime;
}
/**
* 将时间字符串转换为Timestamp类型
* @param timeStr 时间字符串(yyyyMMdd)
* @return
*/
public static Timestamp stringToTimeRule(String timeStr){
Timestamp ttime=null;
if(timeStr!=null && !"".equals(timeStr)){
SimpleDateFormat sdf=new SimpleDateFormat("yyyyMMdd");
try {
Date date=sdf.parse(timeStr);
ttime=new Timestamp(date.getTime());
} catch (Exception e) {
System.out.println("时间字符串转换为Timestamp时异常");
}
}
return ttime;
}
/**
* 根据指定格式获得当前时间字符串
* @param timeFormat
* @return
*/
public static String sysTimeString(String timeFormat){
String timeStr=null;
if(timeFormat==null || "".equals(timeFormat)){
timeFormat="yyyy-MM-dd HH:mm:ss";
}
try {
SimpleDateFormat sdf=new SimpleDateFormat(timeFormat);
timeStr=sdf.format(new Date());
} catch (Exception e) {
System.out.println("时间格式错误:"+timeFormat);
}
return timeStr;
}
/**
* 将时间字符串从旧的格式转换为新的格式
* @param timeString 时间字符串
* @param formatOld 原格式
* @param formatNew 目标格式
* @return 目标格式的时间字符串
*/
public static String timeStringConvert(String timeString,
String formatOld,String formatNew){
String timeStr=null;
try {
SimpleDateFormat sdfOld=new SimpleDateFormat(formatOld);
SimpleDateFormat sdfNew=new SimpleDateFormat(formatNew);
Date date=sdfOld.parse(timeString);
timeStr=sdfNew.format(date);
} catch (Exception e) {
System.out.println("将旧时间字符串转换为新的时间字符串时异常");
}
return timeStr;
}
/**
* 判断字符串是否为空字符串,如果为空则返回null,否则返回字符串本身
* @param str
*/
public static String initString(String str){
if("".equals(str)){
str=null;
}
return str;
}
/**
* 将double类型数据转为整数,如果有小数点则进位
* @param d double类型数据
* @return 整数
*/
public static Integer toInteger(Double d){
Integer retInt=null;
if(d!=null){
Integer dempInt=d.intValue();
if(d>dempInt){
dempInt+=1;
}
retInt=dempInt;
}
return retInt;
}
/**
* 加密
* @param content 需要加密的内容
* @param password 加密密码
* @return
*/
public static String encrypt(String content, String password){
String result=null;
try {
byte[] raw = password.getBytes(Charsets.UTF_8);
if (raw.length != 16) {
throw new IllegalArgumentException("Invalid key size. " + password + ", 密钥token长度不是16位");
}
SecretKeySpec skeySpec = new SecretKeySpec(raw, "AES");
Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding");
cipher.init(Cipher.ENCRYPT_MODE, skeySpec, new IvParameterSpec(new byte[16])); // zero IV
byte[] finaly = cipher.doFinal(content.getBytes(Charsets.UTF_8));
result=new String(org.apache.commons.codec.binary.Base64.encodeBase64(finaly));
} catch (Exception e) {
//logger.error(e.getMessage(), e);
//throw e;
System.out.println("加密方法中出现异常");
e.printStackTrace();
}
return result;
}
/**
* 解密
* @param content 需要解密的内容
* @param password 加密密码
* @return
*/
public static String decrypt(String content, String password){
String result=null;
try {
byte[] raw = password.getBytes(Charsets.UTF_8);
if (raw.length != 16) {
throw new IllegalArgumentException("Invalid key size. " + password + ", 密钥token长度不是16位");
}
SecretKeySpec skeySpec = new SecretKeySpec(raw, "AES");
Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding");
cipher.init(Cipher.DECRYPT_MODE, skeySpec, new IvParameterSpec(new byte[16]));
byte[] toDecrypt = org.apache.commons.codec.binary.Base64.decodeBase64(content.getBytes());
byte[] original = cipher.doFinal(toDecrypt);
result=new String(original, Charsets.UTF_8);
}catch (Exception e){
//logger.error(e.getMessage(), e);
//throw e;
System.out.println("解密方法中出现异常");
e.printStackTrace();
}
return result;
}
/**
* 生成系统的Sign
* @param timeStr
* @return
*/
//FF813302B268A3D074ABBEFCCB469A51
public static String systemSign(String method){
SimpleDateFormat sdf=new SimpleDateFormat("yyyyMMdd");
String time=sdf.format(new Date());
String str=method+time+"33C30CBEM3E7894555D1F17F66C9EB5D";
String sign=getMD5(str);
return sign;
}
/**
* 判断是否为所传参数是否为json格式
* @param josn
* @return
*/
public static boolean VerificationJson(String json){
boolean boo=false;
try{
if("".equals(json)||json==null){
return boo;
}
JSONObject.parseObject(json);
boo=true;
}catch (Exception e) {
boo=false;
}
//System.out.println("参数:"+json+"是否为json格式:"+boo);
return boo;
}
/**
* 将字符串数组中的所有字符串一次累加生成新字符串后返回
* @param args 字符串数组
* @return
*/
public static String createKey(String[] args){
StringBuilder sb=new StringBuilder("");
if(args!=null){
for(int i=0;i<args.length;i++){
String arg=args[i];
if(i==args.length-1){
sb.append(arg==null? "":arg);
}
else{
sb.append((arg==null? "":arg)+":");
}
}
}
return sb.toString();
}
/**
* Md5加密(32位)
* @param str
* @return
*/
public static String getMD5Str(String str){
MessageDigest messageDigest = null;
try
{
messageDigest = MessageDigest.getInstance("MD5");
messageDigest.reset();
messageDigest.update(str.getBytes("UTF-8"));
} catch (NoSuchAlgorithmException e)
{
System.out.println("NoSuchAlgorithmException caught!");
System.exit(-1);
} catch (UnsupportedEncodingException e)
{
e.printStackTrace();
}
byte[] byteArray = messageDigest.digest();
StringBuffer md5StrBuff = new StringBuffer();
for (int i = 0; i < byteArray.length; i++)
{
if (Integer.toHexString(0xFF & byteArray[i]).length() == 1)
md5StrBuff.append("0").append(Integer.toHexString(0xFF & byteArray[i]));
else
md5StrBuff.append(Integer.toHexString(0xFF & byteArray[i]));
}
return md5StrBuff.toString();
}
}
package com.yutu.base.utils.httpClient;
/**
* HttpClient4.5
* @author Administrator
*
*/
//public class HttpClientUtil {
// private static SSLConnectionSocketFactory sslsf = null;
// private static PoolingHttpClientConnectionManager cm = null;
// private static SSLContextBuilder builder = null;
// private static RequestConfig reqConfig;
// static {
// try {
// builder = new SSLContextBuilder();
// // 全部信任 不做身份鉴定
// builder.loadTrustMaterial(null, new TrustStrategy() {
// public boolean isTrusted(X509Certificate[] x509Certificates, String s) throws CertificateException {
// return true;
// }
// });
// reqConfig=RequestConfig.custom()
// .setCookieSpec(CookieSpecs.STANDARD)
// .setExpectContinueEnabled(true)//2017-10-14
// .setTargetPreferredAuthSchemes(Arrays.asList(AuthSchemes.NTLM, AuthSchemes.DIGEST))//2017-10-14
// .setProxyPreferredAuthSchemes(Arrays.asList(AuthSchemes.BASIC))//2017-10-14
// .setSocketTimeout(1000*20)
// .setConnectTimeout(1000*25)
// .setConnectionRequestTimeout(1000*30)
// .build();
// sslsf = new SSLConnectionSocketFactory(builder.build(), new String[]{"SSLv2Hello", "SSLv3", "TLSv1", "TLSv1.2"}, null, NoopHostnameVerifier.INSTANCE);
// Registry<ConnectionSocketFactory> registry = RegistryBuilder.<ConnectionSocketFactory>create()
// .register("http", new PlainConnectionSocketFactory())
// .register("https", sslsf)
// .build();
// // Create socket configuration
// SocketConfig socketConfig = SocketConfig.custom()//2017-10-14
// .setSoTimeout(1000*20)//2017-10-14
// .setTcpNoDelay(true)//2017-10-14
// .build();//2017-10-14
// cm = new PoolingHttpClientConnectionManager(registry);
// cm.setDefaultSocketConfig(socketConfig);//2017-10-14
// // Validate connections after 10 sec of inactivity
// cm.setValidateAfterInactivity(1000*20);//2017-10-14
// cm.setMaxTotal(400);//设置最大连接数(全局最大连接数)
// cm.setDefaultMaxPerRoute(40);//一个路由的最大连接数(连接同一主机的最大连接数)
// } catch (Exception e) {
// e.printStackTrace();
// }
// }
// /**
// * 获取HttpClient
// * @return HttpClient客户端
// */
// public static CloseableHttpClient getHttpClient(){
// /*未设置代理IP之前的获得https的httpClient对象方式*/
// CloseableHttpClient httpClient = HttpClients.custom()
// .setDefaultRequestConfig(reqConfig)
// .setSSLSocketFactory(sslsf)
// .setConnectionManager(cm)
// .setConnectionManagerShared(true)
// .build();
// return httpClient;
// }
// /**
// * 创建HttpClient,传入的参数用于获取服务端相应的cookie
// * @param cookieStore 用于最后获取服务端cookie的CookieStore
// * @return
// */
// public static CloseableHttpClient getHttpClient(CookieStore cookieStore){
// CloseableHttpClient httpClient = HttpClients.custom()
// .setDefaultRequestConfig(reqConfig)
// .setDefaultCookieStore(cookieStore)
// .setSSLSocketFactory(sslsf)
// .setConnectionManager(cm)
// .setConnectionManagerShared(true)
// .build();
// return httpClient;
// }
//
//
// /**
// * 获取使用默认代理的HttpClient(无需认证信息)
// * @param proxyIp 代理IP
// * @param port 代理端口
// * @return HttpClient客户端
// */
// public static CloseableHttpClient getHttpClient(String proxyIp,Integer port){
// HttpClientBuilder httpBuider = HttpClients.custom();
// if(proxyIp!=null && port!=null){
// HttpHost proxy = new HttpHost(proxyIp, port);
// DefaultProxyRoutePlanner routePlanner = new DefaultProxyRoutePlanner(proxy);
// httpBuider.setRoutePlanner(routePlanner);
// }
// CloseableHttpClient httpClient=httpBuider
// .setDefaultRequestConfig(reqConfig)
// .setSSLSocketFactory(sslsf)
// .setConnectionManager(cm)
// .setConnectionManagerShared(true)
// .build();
// return httpClient;
// }
// /**
// * 关闭CloseableHttpClient
// * @param httpClient
// */
// public static void closeHttpClient(CloseableHttpClient httpClient){
// if(httpClient!=null){
// try {
// httpClient.close();
// } catch (IOException e) {
// e.printStackTrace();
// }
// }
// }
//}
package com.yutu.base.utils.httpClient;//package com.yutu.base.util.httpClient;
//
//
//
//
//
//public class HttpConfigUtil {
// /**
// * 获取http请求中基础的请求头的集合 (Header)
// * headerMap map中key为header的名,value为header的值
// * @return Header 集合
// */
// public static List<Header> getHttpHeaders(Map<String,String> headerMap){
// List<Header> headers=new ArrayList<Header>();
// headers.add(new BasicHeader("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:53.0) Gecko/20100101 Firefox/53.0"));
// headers.add(new BasicHeader("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"));
// headers.add(new BasicHeader("Accept-Language", "zh-CN,zh;q=0.8,en-US;q=0.5,en;q=0.3"));
// headers.add(new BasicHeader("Accept-Encoding", "gzip, deflate"));
// //headers.add(new BasicHeader("Cookie", ""));
// headers.add(new BasicHeader("Connection", "keep-alive"));
// headers.add(new BasicHeader("Upgrade-Insecure-Requests", "1"));
// String user="yutu.test";
// String key="bbb75df1fe48720c";
// String timeStamp= "";
// try {
// timeStamp = DateUtil.dateToStamp(DateUtil.DateToStr(new Date(),"yyyy-MM-dd HH:mm:ss"));
// }
// catch (Exception e){
// e.printStackTrace();
// }
// String sign= MD5Util.MD5(key+user+timeStamp);
// headers.add(new BasicHeader("user", user));
// headers.add(new BasicHeader("timeStamp", timeStamp));
// headers.add(new BasicHeader("sign", sign));
// if(headerMap!=null){
// Set<Entry<String, String>> entrySet=headerMap.entrySet();
// for(Entry<String,String> entry:entrySet){
// headers.add(new BasicHeader(entry.getKey(), entry.getValue()));
// }
// }
// return headers;
// }
//}
package com.yutu.base.utils.httpClient;
import com.yutu.base.utils.DateUtil;
import com.yutu.base.utils.MD5;
import org.apache.commons.httpclient.HttpStatus;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.message.BasicHeader;
import org.apache.http.params.CoreConnectionPNames;
import org.apache.http.util.EntityUtils;
import java.io.IOException;
import java.net.CookieStore;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
public class HttpUtil {
/**
* 发送get请求
*
* @param url
* 路径
* @return
*/
public static String httpGet(String url, String cookie) {
// get请求返回结果
String result = null;
String proxyIp=null;
try {
DefaultHttpClient client = new DefaultHttpClient();
// 发送get请求
HttpGet request = new HttpGet(url);
if(cookie!=null&&!"".equals(cookie)){
request.setHeader("cookie", cookie);
}
String user="yutu.test";
String key="bbb75df1fe48720c";
String timeStamp= "";
try {
timeStamp = DateUtil.dateToStamp(DateUtil.DateToStr(new Date(),"yyyy-MM-dd HH:mm:ss"));
}
catch (Exception e){
e.printStackTrace();
}
String sign= MD5.getMD5Str(key+user+timeStamp);
request.addHeader(new BasicHeader("user", user));
request.addHeader(new BasicHeader("timeStamp", timeStamp));
request.addHeader(new BasicHeader("sign", sign));
HttpResponse response = client.execute(request);
/** 请求发送成功,并得到响应 **/
if (response.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
/** 读取服务器返回过来的字符串 **/
result = EntityUtils.toString(response.getEntity());
} else {
// logger.error("get请求提交失败:" + url);
System.out.println("{请求FAIL}"+response.getStatusLine().getStatusCode());
result=Integer.toString(response.getStatusLine().getStatusCode());
}
} catch (IOException e) {
// logger.error("get请求提交失败:" + url, e);
e.printStackTrace();
result=e.getMessage();
}
return result;
}
/**
* 发送get请求
*
* @param url
* 路径
* @return
*/
public static String httpPost(String url, HttpEntity entity, String cookie, String contentType) {
// get请求返回结果
String result = null;
String proxyIp=null;
String setCookie=null;
CookieStore cookiestore=null;
Map<String,Object> resultMap=new HashMap<String,Object>();
try {
DefaultHttpClient client = new DefaultHttpClient();
client.getParams().setParameter(CoreConnectionPNames.CONNECTION_TIMEOUT, 15000);
client.getParams().setParameter(CoreConnectionPNames.SO_TIMEOUT, 30000);
// 发送Post请求
HttpPost request = new HttpPost(url);
if(cookie!=null&&!"".equals(cookie)){
request.setHeader("Cookie", cookie);
}
if(contentType!=null&&!"".equals(contentType)){
request.setHeader("Content-Type", contentType);
}
request.setEntity(entity);
HttpResponse response = client.execute(request);
/** 请求发送成功,并得到响应 **/
if (response.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
/** 读取服务器返回过来的字符串 **/
result = EntityUtils.toString(response.getEntity());
} else {
// logger.error("get请求提交失败:" + url);
System.out.println("{请求结果FAIL}"+response.getStatusLine().getStatusCode());
result=Integer.toString(response.getStatusLine().getStatusCode());
}
} catch (IOException e) {
// logger.error("get请求提交失败:" + url, e);
e.printStackTrace();
result=e.getMessage();
}
return result;
}
}
spring:
urlConfig:
overseasCheetahUrl: 'http://127.0.0.1:18092/polestar/'
overseasAirTicketUrl: 'http://127.0.0.1:18071/OverseasAirTicket/'
productServiceUrl: 'http://127.0.0.1:28071/20160907_InterfaceConnected/'
polestarLogsServicesUrl: 'http://127.0.0.1:8089/'
dataApiUrl: 'http://127.0.0.1:38071/iffs-data-api/'
pathConfig:
saleReportExcelPath: 'F:/overseasCheetah_ExcelFile/'
saleDetailReportExcelPath: 'F:\\overseasCheetah_ExcelFile/'
server:
port: 8066
compression:
enabled: true
mime-types: application/json,application/xml,application/octet-stream,textml,text/xml,text/plain
min-response-size: 1024
tomcat:
max-connections: 2000
max-threads: 2000
spring:
urlConfig:
overseasCheetahUrl: 'http://192.168.0.88:9050/polestar/'
overseasAirTicketUrl: 'http://192.168.0.88:9011/OverseasAirTicket/'
productServiceUrl: 'http://192.168.0.88:9010/20160907_InterfaceConnected/'
polestarLogsServicesUrl: 'http://192.168.0.88:8055/'
dataApiUrl: 'http://14.18.207.103:38071/iffs-data-api/'
pathConfig:
saleReportExcelPath: 'E:/overseasCheetah_ExcelFile/'
saleDetailReportExcelPath: 'E:\\overseasCheetah_ExcelFile/'
server:
port: 8333
compression:
enabled: true
mime-types: application/json,application/xml,application/octet-stream,textml,text/xml,text/plain
min-response-size: 1024
tomcat:
max-connections: 2000
max-threads: 2000
spring:
urlConfig:
overseasCheetahUrl: 'http://127.0.0.1:18092/polestar/'
overseasAirTicketUrl: 'http://127.0.0.1:18071/OverseasAirTicket/'
productServiceUrl: 'http://127.0.0.1:28071/20160907_InterfaceConnected/'
polestarLogsServicesUrl: 'http://127.0.0.1:8089/'
dataApiUrl: 'http://14.18.207.91:38071/iffs-data-api/'
pathConfig:
saleReportExcelPath: 'F:/overseasCheetah_ExcelFile/'
saleDetailReportExcelPath: 'F:\\overseasCheetah_ExcelFile/'
server:
port: 8066
compression:
enabled: true
mime-types: application/json,application/xml,application/octet-stream,textml,text/xml,text/plain
min-response-size: 1024
tomcat:
max-connections: 2000
max-threads: 2000
spring:
profiles:
active: test
management:
security:
enabled: false
\ No newline at end of file
log4j.rootLogger=info,dailyRollingFile,stdout
log4j.appender.dailyRollingFile=org.apache.log4j.DailyRollingFileAppender
log4j.appender.dailyRollingFile.DatePattern='.'yyyy-MM-dd
log4j.appender.dailyRollingFile.File=./logs/polestar-files-services/polestar-files-services.log
log4j.appender.dailyRollingFile.layout=org.apache.log4j.PatternLayout
log4j.appender.dailyRollingFile.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p [%c]: %m%n
log4j.appender.dailyRollingFile.Append=true
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d yyyy-MM-dd HH:mm:ss %p [%c] %m%n
log4j.logger.test=INFO,test,stdout
log4j.additivity.test = false
log4j.appender.test=org.apache.log4j.DailyRollingFileAppender
log4j.appender.test.File=./logs/test/test.log
log4j.appender.test.layout=org.apache.log4j.PatternLayout
log4j.appender.test.layout.ConversionPattern=%n[%p]%d{yyyy-MM-dd HH\:mm\:ss}[%M][%m]
log4j.logger.upload=INFO,upload,stdout
log4j.additivity.upload = false
log4j.appender.upload=org.apache.log4j.DailyRollingFileAppender
log4j.appender.upload.File=./logs/upload/upload.log
log4j.appender.upload.layout=org.apache.log4j.PatternLayout
log4j.appender.upload.layout.ConversionPattern=%n[%p]%d{yyyy-MM-dd HH\:mm\:ss}[%M][%m]
log4j.logger.download=INFO,download,stdout
log4j.additivity.download = false
log4j.appender.download=org.apache.log4j.DailyRollingFileAppender
log4j.appender.download.File=./logs/download/download.log
log4j.appender.download.layout=org.apache.log4j.PatternLayout
log4j.appender.download.layout.ConversionPattern=%n[%p]%d{yyyy-MM-dd HH\:mm\:ss}[%M][%m]
log4j.logger.messagequeue=INFO,messagequeue,stdout
log4j.additivity.messagequeue = false
log4j.appender.messagequeue=org.apache.log4j.DailyRollingFileAppender
log4j.appender.messagequeue.File=./logs/messagequeue/messagequeue.log
log4j.appender.messagequeue.layout=org.apache.log4j.PatternLayout
log4j.appender.messagequeue.layout.ConversionPattern=%n[%p]%d{yyyy-MM-dd HH\:mm\:ss}[%M][%m]
log4j.logger.schedule=INFO,schedule,stdout
log4j.additivity.schedule = false
log4j.appender.schedule=org.apache.log4j.DailyRollingFileAppender
log4j.appender.schedule.File=./logs/schedule/schedule.log
log4j.appender.schedule.layout=org.apache.log4j.PatternLayout
log4j.appender.schedule.layout.ConversionPattern=%n[%p]%d{yyyy-MM-dd HH\:mm\:ss}[%M][%m]
log4j.logger.orderService=INFO,orderService,stdout
log4j.additivity.orderService = false
log4j.appender.orderService=org.apache.log4j.DailyRollingFileAppender
log4j.appender.orderService.File=./logs/orderService/orderService.log
log4j.appender.orderService.layout=org.apache.log4j.PatternLayout
log4j.appender.orderService.layout.ConversionPattern=%n[%p]%d{yyyy-MM-dd HH\:mm\:ss}[%M][%m]
报表服务备忘记录 polestar-files-services
报表服务备忘记录 polestar-files-services
0. gitlab: http://118.190.49.40/peterchu/polestar-files-services.git
1. 上传销售规则,参数
D:\pc\Project\polestar\polestar-files-services\logs\upload
[INFO]2020-12-09 11:36:50[uploadSaleRules][上传销售规则,参数:{"customerId":"2cb3aa90-7530-11e9-b14b-c81f66ba6a47","filePath":"D:\\\\webService\\\\overseasCheetah_ExcelFile/2cb3aa90-7530-11e9-b14b-c81f66ba6a47/SalesRulesUpLoad/20201209\\1607483667248workpolicy.xlsx","operator":"%E7%8E%8B%E7%A6%B9"}]
2. 接口参数模板
D:\pc\Project\polestar\polestar-files-services\.idea\httpRequests\http-requests-log.http
3.
\ No newline at end of file
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