4.5
4.5.1 MyBatis SQL 根据 date 查询预约设置,查询结果为 0:
<select id="selectCountByDate" parameterType="java.util.Date" resultType="long">
select count(id) from t_ordersetting where orderDate = #{orderDate}
</select>
4.5.2
根据 date 范围查询预约设置:查询结果没有最后一天
<select id="queryOrderSettingBetweenDate" parameterType="map" resultType="com.wl.health.pojo.OrderSetting">
select * from t_ordersetting where orderDate between #{beginDay} and #{endDay}
</select>
4.5.3
根据 date 修改可预约数量,传入 date 如 2020-5-8 会报错,规律是天的位置如果是个位数就会报错,但是用0补为2位就正常,如修改为 2020-5-08 就不会报错。
错误信息如下:
14:46:20,078 DEBUG DispatcherServlet:891 - DispatcherServlet with name 'springmvc' processing POST request for [/ordersetting/editNumberByDate]
14:46:20,078 DEBUG RequestMappingHandlerMapping:312 - Looking up handler method for path /ordersetting/editNumberByDate
14:46:20,078 DEBUG RequestMappingHandlerMapping:319 - Returning handler method [public com.wl.health.entity.Result com.wl.health.controller.OrderSettingController.editNumberByDate(com.wl.health.pojo.OrderSetting)]
14:46:20,078 DEBUG DefaultListableBeanFactory:254 - Returning cached instance of singleton bean 'orderSettingController'
14:46:20,079 DEBUG RequestResponseBodyMethodProcessor:201 - Read [class com.wl.health.pojo.OrderSetting] as "application/json;charset=UTF-8" with [com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter@191f014]
14:46:20,082 DEBUG ServletInvocableHandlerMethod:167 - Failed to resolve argument 0 of type 'com.wl.health.pojo.OrderSetting'
org.springframework.http.converter.HttpMessageNotReadableException: JSON parse error: For input string: "2020-5-8"; nested exception is com.alibaba.fastjson.JSONException: For input string: "2020-5-8"
at com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter.readType(FastJsonHttpMessageConverter.java:205)
at com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter.read(FastJsonHttpMessageConverter.java:177)
at org.springframework.web.servlet.mvc.method.annotation.AbstractMessageConverterMethodArgumentResolver.readWithMessageConverters(AbstractMessageConverterMethodArgumentResolver.java:206)
at org.springframework.web.servlet.mvc.method.annotation.RequestResponseBodyMethodProcessor.readWithMessageConverters(RequestResponseBodyMethodProcessor.java:157)
at org.springframework.web.servlet.mvc.method.annotation.RequestResponseBodyMethodProcessor.resolveArgument(RequestResponseBodyMethodProcessor.java:130)
at org.springframework.web.method.support.HandlerMethodArgumentResolverComposite.resolveArgument(HandlerMethodArgumentResolverComposite.java:124)
at org.springframework.web.method.support.InvocableHandlerMethod.getMethodArgumentValues(InvocableHandlerMethod.java:161)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:131)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:102)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:877)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:783)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:991)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:925)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:974)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:877)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:851)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1041)
at org.apache.coyote.AbstractProtocolSocketProcessor.run(JIoEndpoint.java:310)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: com.alibaba.fastjson.JSONException: For input string: "2020-5-8"
at com.alibaba.fastjson.parser.DefaultJSONParser.parseObject(DefaultJSONParser.java:665)
at com.alibaba.fastjson.JSON.parseObject(JSON.java:365)
at com.alibaba.fastjson.JSON.parseObject(JSON.java:333)
at com.alibaba.fastjson.JSON.parseObject(JSON.java:296)
at com.alibaba.fastjson.JSON.parseObject(JSON.java:402)
at com.alibaba.fastjson.JSON.parseObject(JSON.java:484)
at com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter.readType(FastJsonHttpMessageConverter.java:203)
... 41 more
Caused by: java.lang.NumberFormatException: For input string: "2020-5-8"
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.serializer.DateCodec.cast(DateCodec.java:244)
at com.alibaba.fastjson.parser.deserializer.AbstractDateDeserializer.deserialze(AbstractDateDeserializer.java:138)
at com.alibaba.fastjson.parser.deserializer.AbstractDateDeserializer.deserialze(AbstractDateDeserializer.java:15)
at com.alibaba.fastjson.parser.deserializer.DefaultFieldDeserializer.parseField(DefaultFieldDeserializer.java:86)
at com.alibaba.fastjson.parser.deserializer.JavaBeanDeserializer.parseField(JavaBeanDeserializer.java:1078)
at com.alibaba.fastjson.parser.deserializer.JavaBeanDeserializer.deserialze(JavaBeanDeserializer.java:773)
at com.alibaba.fastjson.parser.deserializer.JavaBeanDeserializer.parseRest(JavaBeanDeserializer.java:1283)
at com.alibaba.fastjson.parser.deserializer.FastjsonASMDeserializer_1_OrderSetting.deserialze(Unknown Source)
at com.alibaba.fastjson.parser.deserializer.JavaBeanDeserializer.deserialze(JavaBeanDeserializer.java:267)
at com.alibaba.fastjson.parser.DefaultJSONParser.parseObject(DefaultJSONParser.java:661)
... 47 more
14:46:20,084 DEBUG ExceptionHandlerExceptionResolver:137 - Resolving exception from handler [public com.wl.health.entity.Result com.wl.health.controller.OrderSettingController.editNumberByDate(com.wl.health.pojo.OrderSetting)]: org.springframework.http.converter.HttpMessageNotReadableException: JSON parse error: For input string: "2020-5-8"; nested exception is com.alibaba.fastjson.JSONException: For input string: "2020-5-8"
14:46:20,085 DEBUG ResponseStatusExceptionResolver:137 - Resolving exception from handler [public com.wl.health.entity.Result com.wl.health.controller.OrderSettingController.editNumberByDate(com.wl.health.pojo.OrderSetting)]: org.springframework.http.converter.HttpMessageNotReadableException: JSON parse error: For input string: "2020-5-8"; nested exception is com.alibaba.fastjson.JSONException: For input string: "2020-5-8"
14:46:20,085 DEBUG DefaultHandlerExceptionResolver:137 - Resolving exception from handler [public com.wl.health.entity.Result com.wl.health.controller.OrderSettingController.editNumberByDate(com.wl.health.pojo.OrderSetting)]: org.springframework.http.converter.HttpMessageNotReadableException: JSON parse error: For input string: "2020-5-8"; nested exception is com.alibaba.fastjson.JSONException: For input string: "2020-5-8"
14:46:20,085 WARN DefaultHandlerExceptionResolver:419 - Failed to read HTTP message: org.springframework.http.converter.HttpMessageNotReadableException: JSON parse error: For input string: "2020-5-8"; nested exception is com.alibaba.fastjson.JSONException: For input string: "2020-5-8"
14:46:20,085 DEBUG DispatcherServlet:1076 - Null ModelAndView returned to DispatcherServlet with name 'springmvc': assuming HandlerAdapter completed request handling
14:46:20,086 DEBUG DispatcherServlet:1000 - Successfully completed request
14:46:22,464 DEBUG HeartBeatTask:64 - [DUBBO] Send heartbeat to remote channel /169.254.140.113:20881, cause: The channel has no data-transmission exceeds a heartbeat period: 60000ms, dubbo version: 2.6.0, current host: 169.254.140.113
14:46:22,466 DEBUG HeartbeatHandler:80 - [DUBBO] Receive heartbeat response in thread New I/O client worker #1-3, dubbo version: 2.6.0, current host: 169.254.140.113
14:46:22,993 DEBUG ClientCnxn:742 - Got ping response for sessionid: 0x100004d8e6e0002 after 0ms
14:46:32,993 DEBUG ClientCnxn:742 - Got ping response for sessionid: 0x100004d8e6e0002 after 1ms