diff --git a/error.log b/error.log new file mode 100644 index 00000000..7dc8057c --- /dev/null +++ b/error.log @@ -0,0 +1,239 @@ +2023-11-24 10:56:26,020 ERROR (UserCenter.java:74)- ------------------------------Kzk4xEVyxaDQghFfhXKI/g== +2023-11-24 11:13:08,714 ERROR (UserCenter.java:74)- ------------------------------Kzk4xEVyxaDQghFfhXKI/g== +2023-11-24 11:13:58,800 ERROR (UserCenter.java:74)- ------------------------------Kzk4xEVyxaDQghFfhXKI/g== +2023-11-24 11:15:07,389 ERROR (UserCenter.java:74)- ------------------------------Kzk4xEVyxaDQghFfhXKI/g== +2023-11-24 11:15:14,684 ERROR (UserCenter.java:74)- ------------------------------Kzk4xEVyxaDQghFfhXKI/g== +2023-11-24 11:15:28,916 ERROR (UserCenter.java:74)- ------------------------------Kzk4xEVyxaDQghFfhXKI/g== +2023-11-24 13:30:09,188 ERROR (ResponseMsgUtil.java:59)- ---controller error--- +com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $ + at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:226) + at com.google.gson.Gson.fromJson(Gson.java:927) + at com.google.gson.Gson.fromJson(Gson.java:892) + at com.google.gson.Gson.fromJson(Gson.java:841) + at com.google.gson.Gson.fromJson(Gson.java:813) + at cn.binarywang.wx.miniapp.bean.WxMaPhoneNumberInfo.fromJson(WxMaPhoneNumberInfo.java:23) + at cn.binarywang.wx.miniapp.api.impl.WxMaUserServiceImpl.getPhoneNoInfo(WxMaUserServiceImpl.java:56) + at com.web.controller.LoginController.wxMini(LoginController.java:245) + 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:209) + at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:136) + 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:891) + at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:797) + 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:661) + at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:851) + 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.web.filter.CorsFilter.doFilterInternal(CorsFilter.java:96) + 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 com.alibaba.csp.sentinel.adapter.servlet.CommonFilter.doFilter(CommonFilter.java:110) + 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:109) + 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:93) + 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:200) + 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:493) + at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140) + at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81) + 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:800) + at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) + at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:806) + at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1498) + 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) +Caused by: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $ + at com.google.gson.stream.JsonReader.beginObject(JsonReader.java:385) + at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:215) + ... 68 common frames omitted +2023-11-24 13:31:41,124 ERROR (UserCenter.java:74)- ------------------------------Kzk4xEVyxaDQghFfhXKI/g== +2023-11-24 13:46:21,025 ERROR (UserCenter.java:74)- ------------------------------Kzk4xEVyxaDQghFfhXKI/g== +2023-11-24 14:21:02,835 ERROR (UserCenter.java:74)- ------------------------------Kzk4xEVyxaDQghFfhXKI/g== +2023-11-24 14:27:07,253 ERROR (UserCenter.java:74)- ------------------------------Kzk4xEVyxaDQghFfhXKI/g== +2023-11-24 14:33:09,302 ERROR (UserCenter.java:74)- ------------------------------Kzk4xEVyxaDQghFfhXKI/g== +2023-11-24 14:33:35,050 ERROR (UserCenter.java:74)- ------------------------------Kzk4xEVyxaDQghFfhXKI/g== +2023-11-24 14:34:22,404 ERROR (UserCenter.java:74)- ------------------------------Kzk4xEVyxaDQghFfhXKI/g== +2023-11-24 14:36:33,686 ERROR (UserCenter.java:74)- ------------------------------Kzk4xEVyxaDQghFfhXKI/g== +2023-11-24 14:37:12,540 ERROR (ResponseMsgUtil.java:59)- ---controller error--- +com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $ + at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:226) + at com.google.gson.Gson.fromJson(Gson.java:927) + at com.google.gson.Gson.fromJson(Gson.java:892) + at com.google.gson.Gson.fromJson(Gson.java:841) + at com.google.gson.Gson.fromJson(Gson.java:813) + at cn.binarywang.wx.miniapp.bean.WxMaPhoneNumberInfo.fromJson(WxMaPhoneNumberInfo.java:23) + at cn.binarywang.wx.miniapp.api.impl.WxMaUserServiceImpl.getPhoneNoInfo(WxMaUserServiceImpl.java:56) + at com.web.controller.LoginController.wxMini(LoginController.java:245) + 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:209) + at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:136) + 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:891) + at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:797) + 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:661) + at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:851) + 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.web.filter.CorsFilter.doFilterInternal(CorsFilter.java:96) + 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 com.alibaba.csp.sentinel.adapter.servlet.CommonFilter.doFilter(CommonFilter.java:110) + 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:109) + 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:93) + 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:200) + 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:493) + at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140) + at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81) + 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:800) + at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) + at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:806) + at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1498) + 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) +Caused by: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $ + at com.google.gson.stream.JsonReader.beginObject(JsonReader.java:385) + at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:215) + ... 68 common frames omitted +2023-11-24 14:39:54,738 ERROR (ResponseMsgUtil.java:59)- ---controller error--- +com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $ + at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:226) + at com.google.gson.Gson.fromJson(Gson.java:927) + at com.google.gson.Gson.fromJson(Gson.java:892) + at com.google.gson.Gson.fromJson(Gson.java:841) + at com.google.gson.Gson.fromJson(Gson.java:813) + at cn.binarywang.wx.miniapp.bean.WxMaPhoneNumberInfo.fromJson(WxMaPhoneNumberInfo.java:23) + at cn.binarywang.wx.miniapp.api.impl.WxMaUserServiceImpl.getPhoneNoInfo(WxMaUserServiceImpl.java:56) + at com.web.controller.LoginController.wxMini(LoginController.java:245) + 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:209) + at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:136) + 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:891) + at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:797) + 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:661) + at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:851) + 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.web.filter.CorsFilter.doFilterInternal(CorsFilter.java:96) + 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 com.alibaba.csp.sentinel.adapter.servlet.CommonFilter.doFilter(CommonFilter.java:110) + 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:109) + 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:93) + 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:200) + 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:493) + at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140) + at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81) + 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:800) + at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) + at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:806) + at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1498) + 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) +Caused by: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $ + at com.google.gson.stream.JsonReader.beginObject(JsonReader.java:385) + at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:215) + ... 68 common frames omitted diff --git a/hai-bweb/src/main/java/com/bweb/controller/ApiCouponController.java b/hai-bweb/src/main/java/com/bweb/controller/ApiCouponController.java index 79fd6f7c..9a25622a 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/ApiCouponController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/ApiCouponController.java @@ -6,8 +6,10 @@ import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import com.hai.common.utils.ResponseMsgUtil; import com.hai.config.PetroConfig; +import com.hai.entity.ApiCoupon; import com.hai.model.ResponseData; import com.hai.openApi.service.ApiBlxCouponService; +import com.hai.openApi.service.ApiCouponService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.slf4j.Logger; @@ -19,6 +21,7 @@ import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import javax.annotation.Resource; +import java.util.Date; import java.util.HashMap; @Controller @@ -31,6 +34,9 @@ public class ApiCouponController { @Resource private ApiBlxCouponService apiBlxCouponService; + @Resource + private ApiCouponService apiCouponService; + @RequestMapping(value = "/getBlxCouponList", method = RequestMethod.GET) @@ -62,6 +68,54 @@ public class ApiCouponController { if (jsonObject.getString("code").equals("1")) { String data = PetroConfig.decrypt(jsonObject.getString("biz_content")); JSONArray jsonArray = JSONArray.parseArray(data); + + System.out.println(jsonArray); + ApiCoupon apiCoupon; + + for (int i = 0; i < jsonArray.size(); i++) { + + JSONObject object = jsonArray.getJSONObject(i); + apiCoupon = apiCouponService.findCoupon(object.getString("request_code")); + + System.out.println(object); + System.out.println(object.getString("request_code")); + System.out.println(apiCoupon); + + + + if (apiCoupon == null ) { + if (object.getInteger("status") == 1 && object.getInteger("total_num") > 0) { + apiCoupon = new ApiCoupon(); + apiCoupon.setCode(object.getString("request_code")); + apiCoupon.setDesc(object.getString("ticket_desc")); + apiCoupon.setGoodsType(object.getString("goods_type")); + apiCoupon.setName(object.getString("ticket_name")); + apiCoupon.setEffectiveDays(object.getInteger("effective_days")); + apiCoupon.setImg(object.getString("img")); + apiCoupon.setCreateTime(new Date()); + apiCoupon.setUpdateTime(new Date()); + apiCoupon.setStatus(1); + apiCoupon.setType(type); + apiCoupon.setPrice(object.getInteger("face_amount")); + apiCouponService.insertCoupon(apiCoupon); + } + + } else { + apiCoupon.setCode(object.getString("request_code")); + apiCoupon.setDesc(object.getString("ticket_desc")); + apiCoupon.setName(object.getString("ticket_name")); + apiCoupon.setGoodsType(object.getString("goods_type")); + apiCoupon.setEffectiveDays(object.getInteger("effective_days")); + apiCoupon.setImg(object.getString("img")); + apiCoupon.setUpdateTime(new Date()); + apiCoupon.setPrice(object.getInteger("face_amount")); + apiCoupon.setType(type); + apiCoupon.setStatus(object.getInteger("status")); + apiCouponService.editCoupon(apiCoupon); + } + } + + return ResponseMsgUtil.success(jsonArray); } return ResponseMsgUtil.success("请求失败"); diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighDiscountPackageAgentController.java b/hai-bweb/src/main/java/com/bweb/controller/HighDiscountPackageAgentController.java index 8d37dcb9..f35991c8 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighDiscountPackageAgentController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighDiscountPackageAgentController.java @@ -50,7 +50,7 @@ public class HighDiscountPackageAgentController { @RequestMapping(value="/distribute",method = RequestMethod.POST) @ResponseBody - @ApiOperation(value = "分发优惠券") + @ApiOperation(value = "分发优惠券包") public ResponseData distribute(@RequestBody JSONObject object, HttpServletRequest request) { try { @@ -71,6 +71,7 @@ public class HighDiscountPackageAgentController { Map mapParent = new HashMap<>(); mapParent.put("agentId" , object.getLong("parentAgentId")); mapParent.put("discountPackageId" , object.getLong("discountPackageId")); + mapParent.put("type" , 1); HighDiscountPackageAgentRel discountPackageAgentRelParent = discountPackageAgentService.getDetailRelByMap(mapParent); if (discountPackageAgentRelParent != null && discountPackageAgentRelParent.getStockCount() < object.getInteger("num") ) { @@ -96,6 +97,7 @@ public class HighDiscountPackageAgentController { Map map = new HashMap<>(); map.put("agentId" , object.getLong("agentId")); map.put("discountPackageId" , object.getLong("discountPackageId")); + map.put("type" , 1); HighDiscountPackageAgentRel discountPackageAgentRel = discountPackageAgentService.getDetailRelByMap(map); HighDiscountPackageAgentRecord discountPackageAgentRecord = new HighDiscountPackageAgentRecord(); @@ -104,6 +106,7 @@ public class HighDiscountPackageAgentController { if (discountPackageAgentRel == null) { discountPackageAgentRel = new HighDiscountPackageAgentRel(); discountPackageAgentRel.setStatus(1); + discountPackageAgentRel.setType(1); discountPackageAgentRel.setOpId(userInfoModel.getSecUser().getId()); discountPackageAgentRel.setOpName(userInfoModel.getSecUser().getLoginName()); discountPackageAgentRel.setAgentId(object.getLong("agentId")); @@ -121,6 +124,7 @@ public class HighDiscountPackageAgentController { discountPackageAgentService.insertDiscountPackageAgentRel(discountPackageAgentRel); } else { discountPackageAgentRel.setUpdateTime(new Date()); + discountPackageAgentRel.setType(1); discountPackageAgentService.updateDiscountPackageAgentRel(discountPackageAgentRel); } @@ -131,6 +135,7 @@ public class HighDiscountPackageAgentController { discountPackageAgentRecord.setCreateTime(new Date()); discountPackageAgentRecord.setUpdateTime(new Date()); discountPackageAgentRecord.setStatus(1); + discountPackageAgentRecord.setType(1); discountPackageAgentRecord.setOpId(userInfoModel.getSecUser().getId()); discountPackageAgentRecord.setOpName(userInfoModel.getSecUser().getLoginName()); discountPackageAgentRecord.setCount(object.getInteger("num")); @@ -139,7 +144,6 @@ public class HighDiscountPackageAgentController { discountPackageAgentService.insertDiscountPackageAgentRecord(discountPackageAgentRecord); - return ResponseMsgUtil.success("操作成功"); } catch (Exception e) { @@ -151,12 +155,14 @@ public class HighDiscountPackageAgentController { @RequestMapping(value = "/getDiscountPackageAgentRelList", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "获取优惠券包代理商关联列表") - public ResponseData getDiscountPackageAgentRelList(@RequestParam(name = "agentId", required = false) Long agentId) { + public ResponseData getDiscountPackageAgentRelList(@RequestParam(name = "agentId", required = false) Long agentId, + @RequestParam(name = "type", required = false) Long type) { try { Map map = new HashMap<>(); map.put("agentId",agentId); + map.put("type",type); List list = discountPackageAgentService.getListRel(map); @@ -171,13 +177,16 @@ public class HighDiscountPackageAgentController { @RequestMapping(value = "/getDiscountPackageAgentRecord", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "获取优惠券包代理商分发记录列表") - public ResponseData getDiscountPackageAgentRecord(@RequestParam(name = "agentId", required = false) Long agentId,@RequestParam(name = "discountPackageId", required = false) Long discountPackageId) { + public ResponseData getDiscountPackageAgentRecord(@RequestParam(name = "agentId", required = false) Long agentId, + @RequestParam(name = "type", required = false) Integer type, + @RequestParam(name = "discountPackageId", required = false) Long discountPackageId) { try { Map map = new HashMap<>(); map.put("agentId",agentId); map.put("discountPackageId",discountPackageId); + map.put("type",type); List list = discountPackageAgentService.getListRecord(map); @@ -189,5 +198,45 @@ public class HighDiscountPackageAgentController { } } + @RequestMapping(value = "/generateDiscountPackageAgentCode", method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "绑定优惠券包") + public ResponseData generateDiscountPackageAgentCode(@RequestBody JSONObject object) { + try { + + if (object.getLong("agentId") == null || + object.getInteger("discountPackageId") == null || + object.getInteger("num") == null) { + log.error("discountPackageAgent -> distribute() error!","参数错误"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + + + HighDiscountPackage discountPackage = discountPackageService.findDiscountPackageById(object.getInteger("discountPackageId")); + HighAgent agent = highAgentService.findByAgentMsgId(object.getLong("agentId")); + + if (discountPackage == null || agent == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "相关内容不存在!"); + } + + JSONObject objectMap = new JSONObject(); + + objectMap.put("agentId",agent.getId()); + objectMap.put("agentName",agent.getAgentName()); + objectMap.put("discountPackageId",object.getInteger("discountPackageId")); + objectMap.put("discountPackageName",discountPackage.getTitle()); + objectMap.put("num" , object.getInteger("num")); + objectMap.put("serialNumber" , object.getString("serialNumber")); + + discountPackageAgentService.generateDiscountPackageAgentCode(objectMap); + + return ResponseMsgUtil.success("生成成功"); + + } catch (Exception e) { + log.error("HighOrderController --> getUserOrderList() error!", e); + return ResponseMsgUtil.exception(e); + } + } + } diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighDiscountPackageController.java b/hai-bweb/src/main/java/com/bweb/controller/HighDiscountPackageController.java index 8b18d2c7..b1ed1c8d 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighDiscountPackageController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighDiscountPackageController.java @@ -750,6 +750,9 @@ public class HighDiscountPackageController { public ResponseData giveAwayAgent(@RequestBody JSONObject body) { try { + System.out.println("====================代理商赠送请求body==============================="); + System.out.println(body); + if (body == null || body.getLong("agentId") == null || body.getLong("discountPackageId") == null || @@ -759,9 +762,11 @@ public class HighDiscountPackageController { throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); } + Map mapParent = new HashMap<>(); mapParent.put("agentId" , body.getLong("agentId")); mapParent.put("discountPackageId" , body.getLong("discountPackageId")); + mapParent.put("type" , 1); HighDiscountPackageAgentRel discountPackageAgentRelParent = discountPackageAgentService.getDetailRelByMap(mapParent); if (discountPackageAgentRelParent != null && discountPackageAgentRelParent.getStockCount() < body.getInteger("num") ) { @@ -770,11 +775,6 @@ public class HighDiscountPackageController { } - discountPackageAgentRelParent.setStockCount(discountPackageAgentRelParent.getStockCount()-body.getInteger("num")); - discountPackageAgentRelParent.setSalesCount(discountPackageAgentRelParent.getSalesCount() + body.getInteger("num")); - - discountPackageAgentService.updateDiscountPackageAgentRel(discountPackageAgentRelParent); - List phoneList = new ArrayList<>(); phoneList.add(body.getString("phone")); @@ -782,6 +782,12 @@ public class HighDiscountPackageController { highDiscountPackageService.giveAway(body.getLong("discountPackageId"), phoneList); } + + discountPackageAgentRelParent.setStockCount(discountPackageAgentRelParent.getStockCount()-body.getInteger("num")); + discountPackageAgentRelParent.setSalesCount(discountPackageAgentRelParent.getSalesCount() + body.getInteger("num")); + + discountPackageAgentService.updateDiscountPackageAgentRel(discountPackageAgentRelParent); + return ResponseMsgUtil.success("赠送成功!"); } catch (Exception e) { diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighTestController.java b/hai-bweb/src/main/java/com/bweb/controller/HighTestController.java index 050deb20..91393873 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighTestController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighTestController.java @@ -1 +1 @@ - package com.bweb.controller; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.hai.common.exception.ErrorCode; import com.hai.common.exception.ErrorHelp; import com.hai.common.exception.SysCode; import com.hai.common.pay.util.sdk.WXPayConstants; import com.hai.common.utils.HttpsUtils; import com.hai.common.utils.ResponseMsgUtil; import com.hai.common.utils.WxUtils; import com.hai.config.*; import com.hai.entity.*; import com.hai.enum_type.GasOilPriceStatusEnum; import com.hai.model.HighMerchantModel; import com.hai.model.HighMerchantStoreModel; import com.hai.model.ResponseData; import com.hai.openApi.config.BlxConfig; import com.hai.order.service.OrderService; import com.hai.order.type.OrderProductType; import com.hai.order.type.OrderRefundOpUserType; import com.hai.order.utils.OrderUtil; import com.hai.pay.channel.huipay.config.HuiConfig; import com.hai.service.*; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.apache.commons.collections4.MapUtils; import org.apache.commons.lang3.StringUtils; import org.bouncycastle.LICENSE; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import java.io.FileOutputStream; import java.io.InputStream; import java.math.BigDecimal; import java.net.URL; import java.net.URLConnection; import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; /** * @Auther: 胡锐 * @Description: * @Date: 2021/3/26 23:08 */ @Controller @RequestMapping(value = "/test") @Api(value = "订单接口") public class HighTestController { private static Logger log = LoggerFactory.getLogger(HighTestController.class); @Resource private BsOrderRebateService bsOrderRebateService; @Resource private HighGoldRecService highGoldRecService; @Resource private OrderService orderService; @Resource private HighUserCardService highUserCardService; @Resource private HighOrderService highOrderService; @Resource private HighUserService highUserService; @Resource private HighGasService gasService; @Resource private HighMerchantService highMerchantService; @Resource private HighMerchantStoreService highMerchantStoreService; @Resource private HighGasOilPriceService highGasOilPriceService; @Resource private HuiConfig huiConfig; @Resource private CommonService commonService; @Resource private HighOilCardOrderService highOilCardOrderService; @RequestMapping(value="/resolveResponse",method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "解析") public ResponseData resolveResponse( @RequestParam(name = "data", required = false) String data ) { try { JSONObject cardInfoObject = HuiLianTongUnionCardConfig.resolveResponse(data); return ResponseMsgUtil.success(cardInfoObject); } catch (Exception e) { log.error("getUserByTelephone",e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getHuiLianTongCardConsume", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询汇联通工会卡消费记录") public ResponseData getHuiLianTongCardConsume(@RequestParam(name = "businessType", required = true) String businessType, @RequestParam(name = "cardNo", required = true) String cardNo, @RequestParam(name = "sdate", required = true) Long sdate, @RequestParam(name = "edate", required = true) Long edate, @RequestParam(name = "pageNum", required = true) Integer pageNum, @RequestParam(name = "pageSize", required = true) Integer pageSize, HttpServletRequest request) { try { JSONObject consumptionRecord = HuiLianTongUnionCardConfig.queryConsumptionRecordByBusiness(businessType, cardNo, sdate, edate, pageNum, pageSize); if (StringUtils.isBlank(consumptionRecord.getString("data"))) { throw ErrorHelp.genException(SysCode.System, ErrorCode.REQUEST_ERROR, ""); } JSONArray array = HuiLianTongUnionCardConfig.resolveResponse(consumptionRecord.getString("data")).getJSONArray("records"); return ResponseMsgUtil.success(array); } catch (Exception e) { log.error("HighUserCardController --> getHuiLianTongCardConsume() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/createOrder", method = RequestMethod.POST) @ResponseBody @ApiOperation(value = "创建订单") public ResponseData createOrder(@RequestBody JSONObject object) { try { Map mapPost = new HashMap<>(); mapPost.put("merchId" , "20230258302"); mapPost.put("timetable" , new Date().getTime()); mapPost.put("orderNo" , "TEST" + OrderUtil.generateOrderNo()); mapPost.put("productType" , object.getString("productType")); mapPost.put("content" , object.getJSONObject("content").toString()); mapPost.put("sign" , WxUtils.generateSignApi(mapPost, "0C7897EA3BD96156A5881618FF2FF645", WXPayConstants.SignType.MD5)); return ResponseMsgUtil.success(HttpsUtils.doPost("http://localhost:9902/v1/order/createOrder" , mapPost , new HashMap<>())); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/payOrder", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "支付订单") public ResponseData payOrder(@RequestParam(name = "mchOrderNo", required = true) String mchOrderNo) { try { Map mapPost = new HashMap<>(); mapPost.put("apiKey" , "0C7897EA3BD96156A5881618FF2FF645"); mapPost.put("merchId" , "20230258302"); mapPost.put("mchOrderNo" , mchOrderNo); Map map = new HashMap<>(); map.put("apiKey" , "0C7897EA3BD96156A5881618FF2FF645"); map.put("merchId" , "20230258302"); map.put("mchOrderNo" , mchOrderNo); System.out.println(map); mapPost.put("sign" , WxUtils.generateSignApi(map, MapUtils.getString(map, "apiKey"), WXPayConstants.SignType.MD5)); return ResponseMsgUtil.success(HttpsUtils.doPost("http://localhost:9902/v1/order/orderPay" , mapPost , new HashMap<>())); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/queryOrderDetail", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询订单详情") public ResponseData queryOrderDetail(@RequestParam(name = "mchOrderNo", required = true) String mchOrderNo) { try { Map mapPost = new HashMap<>(); mapPost.put("apiKey" , "0C7897EA3BD96156A5881618FF2FF645"); mapPost.put("merchId" , "20230258302"); mapPost.put("mchOrderNo" , mchOrderNo); Map map = new HashMap<>(); map.put("apiKey" , "0C7897EA3BD96156A5881618FF2FF645"); map.put("merchId" , "20230258302"); map.put("mchOrderNo" , mchOrderNo); System.out.println(map); mapPost.put("sign" , WxUtils.generateSignApi(map, MapUtils.getString(map, "apiKey"), WXPayConstants.SignType.MD5)); return ResponseMsgUtil.success(HttpsUtils.doPost("http://localhost:9902/v1/order/queryOrderDetail" , mapPost , new HashMap<>())); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/deposit", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "工会卡充值") public ResponseData deposit(@RequestParam(name = "orderNo", required = true) String orderNo) { try { HighOrder order = highOrderService.getOrderByOrderNo(orderNo); HighChildOrder highChildOrder = order.getHighChildOrderList().get(0); if (order.getOrderStatus() != 2) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "订单状态错误"); } // 汇联通充值 String goodsDesc = "汇联通充值"+order.getPayPrice()+"元"; String tranDesc = ""; String businessType = "ghk_deposit"; String orderNoAgain = OrderUtil.generateOrderNo(); order.setOrderStatus(Integer.valueOf(3)); order.setRemarks("工会卡再次充值订单号" + orderNoAgain); highOrderService.updateOrder(order); // 汇联通卡充值 JSONObject deposit = HuiLianTongUnionCardConfig.deposit(orderNoAgain, highChildOrder.getGoodsSpecName(), order.getPayPrice(), businessType, order.getPaySerialNo(), goodsDesc); return ResponseMsgUtil.success( HuiLianTongUnionCardConfig.resolveResponse(deposit.getString("data"))); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getHuiLianTongCardByCardNo", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "根据卡号查询汇联通工会卡详情") public ResponseData getHuiLianTongCardByCardNo(@RequestParam(name = "cardNo", required = true) String cardNo) { try { // 查询工会卡 JSONObject cardInfo = HuiLianTongUnionCardConfig.queryBalance(cardNo); JSONObject resolveResponse = HuiLianTongUnionCardConfig.resolveResponse(cardInfo.getString("data")); return ResponseMsgUtil.success(resolveResponse); } catch (Exception e) { log.error("HighUserCardController --> getHuiLianTongCardByCardNo() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/consumption", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "工会卡支付") public ResponseData consumption(@RequestParam(name = "payRealPrice", required = true) BigDecimal payRealPrice, @RequestParam(name = "cardNo", required = true) String cardNo) { try { String goodsDesc = ""; String tranDesc = ""; String instCode = "11101527"; String businessType = "hisen_consume"; // 工会卡支付 JSONObject consumption = HuiLianTongUnionCardConfig.consumption(OrderUtil.generateOrderNo(), cardNo, payRealPrice, businessType, instCode, goodsDesc, tranDesc); if (!consumption.getString("respCode").equals("0000")) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, consumption.getString("respMessage")); } // 响应参数 JSONObject consumptionResult = HuiLianTongUnionCardConfig.resolveResponse(consumption.getString("data")); if (consumptionResult.getBoolean("success") != true) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, consumptionResult.getString("message")); } return ResponseMsgUtil.success(consumptionResult); } catch (Exception e) { log.error("HighUserCardController --> getHuiLianTongCardByCardNo() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/refundOrder", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "工会卡退款") public ResponseData refundOrder(@RequestParam(name = "orderNo", required = true) String orderNo) { try { HighOrder order = highOrderService.getOrderByOrderNo(orderNo); if (order.getOrderStatus() != 2) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "订单状态错误"); } orderService.refundOrder(order, OrderProductType.getDataByType(order.getProductType()).getName() + "退款",OrderRefundOpUserType.TYPE1, null, "系统自动退款"); if (order.getProductType().equals(4)) { HighUser user = highUserService.findByUserId(order.getMemId()); // 获取应退款积分 int integralNum = order.getTotalPrice().multiply(new BigDecimal(100)).intValue(); if ( integralNum> user.getGold()) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "积分数量不足"); } String remark = "订单" + order.getOrderNo() + "退还积分:" + integralNum; // 积分退款 highUserService.goldHandle(user.getId(), integralNum,2, 3, order.getId() , remark , order.getOrderNo()); } return ResponseMsgUtil.success("退款成功"); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/externalOrderRefund", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "对外订单退款") public ResponseData externalOrderRefund(@RequestParam(name = "paySerialNo", required = true) String paySerialNo, @RequestParam(name = "WxMchId", required = true) String WxMchId, @RequestParam(name = "payRealPrice", required = true) String payRealPrice) { try { Map mapPost = new HashMap<>(); mapPost.put("apiKey" , "B94B5E62807FA56A7260AB581D8A1B48"); mapPost.put("merchId" , "20230394901"); mapPost.put("paySerialNo" , paySerialNo); mapPost.put("wxMchId" , WxMchId); mapPost.put("payRealPrice" , payRealPrice); mapPost.put("refundPrice" , payRealPrice); Map map = new HashMap<>(); map.put("apiKey" , "B94B5E62807FA56A7260AB581D8A1B48"); map.put("merchId" , "20230394901"); map.put("paySerialNo" , paySerialNo); map.put("wxMchId" , WxMchId); map.put("payRealPrice" , payRealPrice); map.put("refundPrice" , payRealPrice); System.out.println(map); mapPost.put("sign" , WxUtils.generateSignApi(map, MapUtils.getString(map, "apiKey"), WXPayConstants.SignType.MD5)); return ResponseMsgUtil.success(HttpsUtils.doPost("https://hsg.dctpay.com/v1/order/externalOrderRefund" , mapPost , new HashMap<>())); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getBlxCouponBalance", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询停车券") public ResponseData getBlxCouponBalance(@RequestParam(name = "phone", required = true) String phone) { try { highUserCardService.getBlxCouponBalance(phone); return ResponseMsgUtil.success("object"); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/queryJsParking", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询捷顺停车场") public ResponseData queryJsParking(@RequestParam(name = "gps", required = true) String gps) { try { Map mapPost = new HashMap<>(); mapPost.put("merchId" , "20230258302"); mapPost.put("gps" , gps); mapPost.put("range" , "1000"); mapPost.put("sign" , WxUtils.generateSignApi(mapPost, "0C7897EA3BD96156A5881618FF2FF645", WXPayConstants.SignType.MD5)); return ResponseMsgUtil.success(HttpsUtils.doPost("http://localhost:9902/v1/blxCoupon/queryJsParking" , mapPost , new HashMap<>())); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getUserCouponPage", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询捷顺停车场") public ResponseData getUserCouponPage(@RequestParam(name = "phone", required = true) String phone) { try { Map mapPost = new HashMap<>(); mapPost.put("merchId" , "20230258302"); mapPost.put("phone" , phone); mapPost.put("sign" , WxUtils.generateSignApi(mapPost, "0C7897EA3BD96156A5881618FF2FF645", WXPayConstants.SignType.MD5)); return ResponseMsgUtil.success(HttpsUtils.doPost("http://localhost:9902/v1/blxCoupon/getUserCouponPage" , mapPost , new HashMap<>())); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/queryJsOrderList", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询车牌订单列表信息") public ResponseData queryJsOrderList(@RequestParam(name = "carNo", required = true) String carNo, @RequestParam(name = "orderStatus", required = true) String orderStatus) { try { Map mapPost = new HashMap<>(); mapPost.put("merchId" , "20230258302"); mapPost.put("orderStatus" , orderStatus); mapPost.put("carNo" , carNo); mapPost.put("sign" , WxUtils.generateSignApi(mapPost, "0C7897EA3BD96156A5881618FF2FF645", WXPayConstants.SignType.MD5)); return ResponseMsgUtil.success(HttpsUtils.doPost("http://localhost:9902/v1/blxCoupon/queryJsOrderList" , mapPost , new HashMap<>())); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getCouponList", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询车牌订单列表信息") public ResponseData getCouponList() { try { Map mapPost = new HashMap<>(); mapPost.put("merchId" , "20230258302"); mapPost.put("sign" , WxUtils.generateSignApi(mapPost, "0C7897EA3BD96156A5881618FF2 FF645", WXPayConstants.SignType.MD5)); return ResponseMsgUtil.success(HttpsUtils.doPost("http://localhost:9902/v1/blxCoupon/getCouponList" , mapPost , new HashMap<>())); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/sendCoupon", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "发放券") public ResponseData sendCoupon(@RequestParam(name = "couponCode", required = true) String couponCode, @RequestParam(name = "receiverCount", required = true) String receiverCount, @RequestParam(name = "receiverPhone", required = true) String receiverPhone) { try { Map mapPost = new HashMap<>(); mapPost.put("merchId" , "20230258302"); mapPost.put("sign" , WxUtils.generateSignApi(mapPost, "0C7897EA3BD96156A5881618FF2FF645", WXPayConstants.SignType.MD5)); return ResponseMsgUtil.success(HttpsUtils.doPost("http://localhost:9902/v1/blxCoupon/getCouponList" , mapPost , new HashMap<>())); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/preorder", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "发起支付") public ResponseData preorder() { try { JSONObject object = new JSONObject(); object.put("outTradeNo" , "HUI" + OrderUtil.generateOrderNo()); object.put("transType" , "JSAPI"); object.put("payMode" , "WECHAT"); object.put("totalAmount" , "0.01"); object.put("profitSharing" , 0); object.put("subject" , "测试"); object.put("userId" , "oUGn_4unIjp90MY-oEXluY4laDrQ"); return ResponseMsgUtil.success(huiConfig.preorder(object)); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/queryGasInfoListByPage", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询团油门店") public ResponseData queryGasInfoListByPage() { try { HighMerchantModel merchant = highMerchantService.getMerchantById(39L); if (merchant == null) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到商户"); } JSONObject jsonObjectP = TuanYouConfig.queryGasInfoListByPage(1, 1000); JSONObject resultObjectP = jsonObjectP.getObject("result", JSONObject.class); for (int i = 1; i <= resultObjectP.getInteger("totalPageNum").intValue();i++) { JSONObject jsonObject = TuanYouConfig.queryGasInfoListByPage(i, 1000); JSONObject resultObject = jsonObject.getObject("result", JSONObject.class); JSONArray jsonArray = resultObject.getJSONArray("gasInfoList"); HighMerchantStore highMerchantStore; HighGasOilPrice highGasOilPrice; for (Object gasObject : jsonArray) { JSONObject object = JSONObject.parseObject(JSONObject.toJSONString(gasObject)); HighMerchantStoreModel store = highMerchantStoreService.getMerchantStoreByKey(object.getString("gasId")); if (store != null) { store.setType(1); store.setSourceType(2); store.setMerchantId(merchant.getId()); store.setCompanyId(merchant.getCompanyId()); store.setStoreKey(object.getString("gasId")); store.setStoreName(object.getString("gasName")); store.setStoreLogo(object.getString("gasLogoSmall")); store.setRegionId(object.getLong("provinceCode")); store.setRegionName(object.getString("provinceName")); store.setAddress(object.getString("gasAddress")); store.setLongitude(object.getString("gasAddressLongitude")); store.setLatitude(object.getString("gasAddressLatitude")); store.setStatus(object.getInteger("gasStatus")); store.setPrestoreType(0); store.setOperatorId(0L); store.setOperatorName("系统创建"); store.setUpdateTime(new Date()); store.setExt1(object.getString("gasSourceId")); highMerchantStoreService.updateMerchantStoreDetail(store); JSONArray oilPriceList = object.getJSONArray("oilPriceList"); for (Object oilPrice : oilPriceList) { JSONObject oilPriceObject = JSONObject.parseObject(JSONObject.toJSONString(oilPrice)); // 查询门店油号 highGasOilPrice = highGasOilPriceService.getGasOilPriceByStoreAndOilNo(store.getId(), oilPriceObject.getString("oilNo")); if (highGasOilPrice == null) { highGasOilPrice = new HighGasOilPrice(); highGasOilPrice.setMerchantStoreId(store.getId()); highGasOilPrice.setOilNo(oilPriceObject.getString("oilNo")); highGasOilPrice.setOilNoName(oilPriceObject.getString("oilNoName")); highGasOilPrice.setPriceVip(oilPriceObject.getBigDecimal("priceVip")); highGasOilPrice.setPriceGun(oilPriceObject.getBigDecimal("priceGun")); highGasOilPrice.setPriceOfficial(oilPriceObject.getBigDecimal("priceOfficial")); highGasOilPrice.setOilType(oilPriceObject.getInteger("oilType")); highGasOilPrice.setOilTypeName(oilPriceObject.getString("oilTypeName")); highGasOilPrice.setStatus(GasOilPriceStatusEnum.status1.getStatus()); } else { highGasOilPrice.setMerchantStoreId(store.getId()); highGasOilPrice.setOilNo(oilPriceObject.getString("oilNo")); highGasOilPrice.setOilNoName(oilPriceObject.getString("oilNoName")); highGasOilPrice.setPriceVip(oilPriceObject.getBigDecimal("priceVip")); highGasOilPrice.setPriceGun(oilPriceObject.getBigDecimal("priceGun")); highGasOilPrice.setPriceOfficial(oilPriceObject.getBigDecimal("priceOfficial")); highGasOilPrice.setOilType(oilPriceObject.getInteger("oilType")); highGasOilPrice.setOilTypeName(oilPriceObject.getString("oilTypeName")); } highGasOilPriceService.editGasOilPrice(highGasOilPrice); } } else { highMerchantStore = new HighMerchantStore(); highMerchantStore.setType(1); highMerchantStore.setSourceType(2); highMerchantStore.setMerchantId(merchant.getId()); highMerchantStore.setCompanyId(merchant.getCompanyId()); highMerchantStore.setStoreKey(object.getString("gasId")); highMerchantStore.setStoreName(object.getString("gasName")); highMerchantStore.setStoreLogo(object.getString("gasLogoSmall")); highMerchantStore.setRegionId(object.getLong("provinceCode")); highMerchantStore.setRegionName(object.getString("provinceName")); highMerchantStore.setAddress(object.getString("gasAddress")); highMerchantStore.setLongitude(object.getString("gasAddressLongitude")); highMerchantStore.setLatitude(object.getString("gasAddressLatitude")); highMerchantStore.setStatus(1); highMerchantStore.setPrestoreType(0); highMerchantStore.setOperatorId(0L); highMerchantStore.setOperatorName("系统创建"); highMerchantStore.setCreateTime(new Date()); highMerchantStore.setUpdateTime(new Date()); highMerchantStore.setExt1(object.getString("gasSourceId")); HighMerchantStoreModel merchantStoreModel = new HighMerchantStoreModel(); BeanUtils.copyProperties(highMerchantStore, merchantStoreModel); highMerchantStoreService.insertMerchantStore(merchantStoreModel); JSONArray oilPriceList = object.getJSONArray("oilPriceList"); for (Object oilPrice : oilPriceList) { JSONObject oilPriceObject = JSONObject.parseObject(JSONObject.toJSONString(oilPrice)); highGasOilPrice = new HighGasOilPrice(); highGasOilPrice.setMerchantStoreId(merchantStoreModel.getId()); highGasOilPrice.setOilNo(oilPriceObject.getString("oilNo")); highGasOilPrice.setOilNoName(oilPriceObject.getString("oilNoName")); highGasOilPrice.setPriceVip(oilPriceObject.getBigDecimal("priceVip")); highGasOilPrice.setPriceGun(oilPriceObject.getBigDecimal("priceGun")); highGasOilPrice.setPriceOfficial(oilPriceObject.getBigDecimal("priceOfficial")); highGasOilPrice.setOilType(oilPriceObject.getInteger("oilType")); highGasOilPrice.setOilTypeName(oilPriceObject.getString("oilTypeName")); highGasOilPriceService.editGasOilPrice(highGasOilPrice); } } } } return ResponseMsgUtil.success("完成"); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/test", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "测试") public ResponseData test(@RequestParam(name = "no", required = true) String no) { try { JSONObject jsonObject = DianConfig.getGasInfoByGasId(no); return ResponseMsgUtil.success(jsonObject); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getGasInfoAll", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "获取全量油站") public ResponseData getGasInfoAll() { try { HighMerchantModel merchant = highMerchantService.getMerchantById(39L); JSONObject jsonObject = DianConfig.getGasInfoAll(); JSONArray resultObject = jsonObject.getObject("result", JSONArray.class); for (int i = 0; i < resultObject.size();i++) { Object objectData = resultObject.get(i); JSONObject object = JSONObject.parseObject(JSONObject.toJSONString(objectData)); HighMerchantStore highMerchantStore; HighGasOilPrice highGasOilPrice; HighMerchantStoreModel store = highMerchantStoreService.getMerchantStoreByKey(object.getString("jyzid")); SecRegion region = commonService.getRegionsByName(object.getString("province")); if (store != null) { store.setType(1); store.setSourceType(6); store.setMerchantId(merchant.getId()); store.setCompanyId(merchant.getCompanyId()); store.setStoreKey(object.getString("jyzid")); store.setStoreName(object.getString("mingcheng")); store.setStoreLogo(object.getString("tupian")); store.setRegionId(region.getRegionId()); store.setRegionName(object.getString("province")); store.setAddress(object.getString("dizhi")); store.setLongitude(object.getString("lng")); store.setLatitude(object.getString("lat")); store.setStatus(object.getInteger("zhuangtai")); store.setPrestoreType(0); store.setOperatorId(0L); store.setOperatorName("系统创建"); store.setUpdateTime(new Date()); store.setExt1(object.getString("gasSourceId")); highMerchantStoreService.updateMerchantStoreDetail(store); JSONArray oilPriceList = object.getJSONArray("oilPriceList"); for (Object oilPrice : oilPriceList) { JSONObject oilPriceObject = JSONObject.parseObject(JSONObject.toJSONString(oilPrice)); // 查询门店油号 highGasOilPrice = highGasOilPriceService.getGasOilPriceByStoreAndOilNo(store.getId(), oilPriceObject.getString("youhao")); if (highGasOilPrice == null) { highGasOilPrice = new HighGasOilPrice(); highGasOilPrice.setMerchantStoreId(store.getId()); highGasOilPrice.setOilNo(oilPriceObject.getString("youhao")); highGasOilPrice.setOilNoName(oilPriceObject.getString("youhao") + "#"); highGasOilPrice.setPriceVip(oilPriceObject.getBigDecimal("priceVip")); highGasOilPrice.setPriceGun(oilPriceObject.getBigDecimal("priceGun")); highGasOilPrice.setPriceOfficial(oilPriceObject.getBigDecimal("priceGun")); highGasOilPrice.setOilType(oilPriceObject.getInteger("oiltype")); highGasOilPrice.setOilTypeName(oilPriceObject.getString("oiltype").equals("1") ? "汽油": "柴油"); highGasOilPrice.setStatus(GasOilPriceStatusEnum.status1.getStatus()); } else { highGasOilPrice.setMerchantStoreId(store.getId()); highGasOilPrice.setOilNo(oilPriceObject.getString("youhao")); highGasOilPrice.setOilNoName( oilPriceObject.getString("youhao") + "#"); highGasOilPrice.setPriceVip(oilPriceObject.getBigDecimal("priceVip")); highGasOilPrice.setPriceGun(oilPriceObject.getBigDecimal("priceGun")); highGasOilPrice.setPriceOfficial(oilPriceObject.getBigDecimal("priceGun")); highGasOilPrice.setOilType(oilPriceObject.getInteger("oiltype")); highGasOilPrice.setOilTypeName(oilPriceObject.getString("oiltype").equals("1") ? "汽油": "柴油"); } highGasOilPriceService.editGasOilPrice(highGasOilPrice); } } else { highMerchantStore = new HighMerchantStore(); highMerchantStore.setType(1); highMerchantStore.setSourceType(6); highMerchantStore.setMerchantId(merchant.getId()); highMerchantStore.setCompanyId(merchant.getCompanyId()); highMerchantStore.setStoreKey(object.getString("jyzid")); highMerchantStore.setStoreName(object.getString("mingcheng")); highMerchantStore.setStoreLogo(object.getString("tupian")); highMerchantStore.setRegionId(region.getRegionId()); highMerchantStore.setRegionName(object.getString("province")); highMerchantStore.setAddress(object.getString("dizhi")); highMerchantStore.setLongitude(object.getString("lng")); highMerchantStore.setLatitude(object.getString("lat")); highMerchantStore.setStatus(1); highMerchantStore.setPrestoreType(0); highMerchantStore.setOperatorId(0L); highMerchantStore.setOperatorName("系统创建"); highMerchantStore.setCreateTime(new Date()); highMerchantStore.setUpdateTime(new Date()); highMerchantStore.setExt1(object.getString("gasSourceId")); HighMerchantStoreModel merchantStoreModel = new HighMerchantStoreModel(); BeanUtils.copyProperties(highMerchantStore, merchantStoreModel); highMerchantStoreService.insertMerchantStore(merchantStoreModel); JSONArray oilPriceList = object.getJSONArray("oilPriceList"); for (Object oilPrice : oilPriceList) { JSONObject oilPriceObject = JSONObject.parseObject(JSONObject.toJSONString(oilPrice)); highGasOilPrice = new HighGasOilPrice(); highGasOilPrice.setMerchantStoreId(merchantStoreModel.getId()); highGasOilPrice.setOilNo(oilPriceObject.getString("youhao")); highGasOilPrice.setOilNoName(oilPriceObject.getString("youhao") + "#"); highGasOilPrice.setPriceVip(oilPriceObject.getBigDecimal("priceVip")); highGasOilPrice.setPriceGun(oilPriceObject.getBigDecimal("priceGun")); highGasOilPrice.setPriceOfficial(oilPriceObject.getBigDecimal("priceGun")); highGasOilPrice.setOilType(oilPriceObject.getInteger("oiltype")); highGasOilPrice.setOilTypeName(oilPriceObject.getString("oiltype").equals("1") ? "汽油": "柴油"); highGasOilPriceService.editGasOilPrice(highGasOilPrice); } } } return ResponseMsgUtil.success(jsonObject); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getOrderPay", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "getOrderPay") public ResponseData getOrderPay(@RequestParam(name = "orderNo", required = true) String orderNo) { try { HighOilCardOrder highOilCardOrder = highOilCardOrderService.findOrder(orderNo); highOilCardOrder.setStatus(2); JSONObject object = KytcService.getOrderPay(highOilCardOrder.getThirdOrderNo() , highOilCardOrder.getPrice() , highOilCardOrder.getCardNo()); highOilCardOrder.setExt1(object.toJSONString()); highOilCardOrderService.updateOilCardOrder(highOilCardOrder); return ResponseMsgUtil.success("成功"); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getOrderInfo", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "getOrderInfo") public ResponseData getOrderInfo(@RequestParam(name = "orderNo", required = true) String orderNo) { try { HighOilCardOrder highOilCardOrder = highOilCardOrderService.findOrder(orderNo); JSONObject object = KytcService.getOrderInfo(highOilCardOrder.getThirdOrderNo()); highOilCardOrder.setExt2(object.toJSONString()); if (object.getBoolean("State") == true) { JSONObject jsonObject = object.getJSONObject("Data"); if (jsonObject.getInteger("OilOrderState") == 2) { highOilCardOrder.setStatus(3); HighOrder highOrder = highOrderService.getOrderByOrderNo(highOilCardOrder.getOrderNo()); highOrder.setOrderStatus(3); highOrder.getHighChildOrderList().get(0).setChildOrderStatus(3); highOrderService.updateOrder(highOrder); } } highOilCardOrderService.updateOilCardOrder(highOilCardOrder); return ResponseMsgUtil.success("成功"); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getLogisticsMsg", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "获取物流") public ResponseData getLogisticsMsg(@RequestParam(name = "no", required = true) String no) { try { JSONObject jsonObjects = CommonConfig.getLogisticsMsg(no); return ResponseMsgUtil.success(jsonObjects); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/synCouponRule", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "获取卡券") public ResponseData synCouponRule() { try { return ResponseMsgUtil.success(PetroConfig.synCouponRule()); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getCoupon", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "卡券下单") public ResponseData getCoupon() { try { JSONObject jsonObject = PetroConfig.getCoupon("16000443991501" , "18090580471" , OrderUtil.generateOrderNo()); String data = PetroConfig.decrypt(jsonObject.getString("biz_content")); JSONObject object = JSONObject.parseObject(data); return ResponseMsgUtil.success(object); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/decrypt", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "解码") public ResponseData decrypt(@RequestParam(name = "content", required = true) String content) { try { String data = PetroConfig.decrypt(content); return ResponseMsgUtil.success(data); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/deleteOilNo", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "删除油品") public ResponseData deleteOilNo() { try { gasService.deleteOilNo(); return ResponseMsgUtil.success("1231243"); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getJiaHaoYouAllStation", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "加好油油站刷新") public ResponseData getJiaHaoYouAllStation() { try { gasService.getJiaHaoYouAllStation(); return ResponseMsgUtil.success("1231243"); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getDianAllStation", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "点点网络") public ResponseData getDianAllStation() { try { gasService.getDianAllStation(); return ResponseMsgUtil.success("1231243"); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() err1or!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/integralRebateOrder", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "积分返利") public ResponseData integralRebateOrder() { try { // 查询满足初步返利条件订单 List order = highOrderService.integralRebateOrder(); for (HighOrder highOrder : order) { // 查询是否存在积分记录 Map map = new HashMap<>(); map.put("goldType", 1); map.put("resType", 4); map.put("userId", highOrder.getMemId()); map.put("resId", highOrder.getId()); List goldRecs = highGoldRecService.getGoldRec(map); // 判断是否重复赠送积分 if (goldRecs.size() == 0) { bsOrderRebateService.insertOrderRebate(highOrder); } highOrder.setWhetherRebate(true); highOrderService.updateOrderDetail(highOrder); } return ResponseMsgUtil.success("1231243"); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() err1or!", e); return ResponseMsgUtil.exception(e); } } } \ No newline at end of file + package com.bweb.controller; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.hai.common.exception.ErrorCode; import com.hai.common.exception.ErrorHelp; import com.hai.common.exception.SysCode; import com.hai.common.pay.util.sdk.WXPayConstants; import com.hai.common.utils.HttpsUtils; import com.hai.common.utils.ResponseMsgUtil; import com.hai.common.utils.WxUtils; import com.hai.config.*; import com.hai.entity.*; import com.hai.enum_type.GasOilPriceStatusEnum; import com.hai.model.HighMerchantModel; import com.hai.model.HighMerchantStoreModel; import com.hai.model.ResponseData; import com.hai.openApi.config.BlxConfig; import com.hai.order.service.OrderService; import com.hai.order.type.OrderProductType; import com.hai.order.type.OrderRefundOpUserType; import com.hai.order.utils.OrderUtil; import com.hai.pay.channel.huipay.config.HuiConfig; import com.hai.service.*; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.apache.commons.collections4.MapUtils; import org.apache.commons.lang3.StringUtils; import org.bouncycastle.LICENSE; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import java.io.FileOutputStream; import java.io.InputStream; import java.math.BigDecimal; import java.net.URL; import java.net.URLConnection; import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; /** * @Auther: 胡锐 * @Description: * @Date: 2021/3/26 23:08 */ @Controller @RequestMapping(value = "/test") @Api(value = "订单接口") public class HighTestController { private static Logger log = LoggerFactory.getLogger(HighTestController.class); @Resource private BsOrderRebateService bsOrderRebateService; @Resource private HighGoldRecService highGoldRecService; @Resource private OrderService orderService; @Resource private HighUserCardService highUserCardService; @Resource private HighOrderService highOrderService; @Resource private HighUserService highUserService; @Resource private HighGasService gasService; @Resource private HighMerchantService highMerchantService; @Resource private HighMerchantStoreService highMerchantStoreService; @Resource private HighGasOilPriceService highGasOilPriceService; @Resource private HuiConfig huiConfig; @Resource private CommonService commonService; @Resource private HighOilCardOrderService highOilCardOrderService; @RequestMapping(value="/resolveResponse",method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "解析") public ResponseData resolveResponse( @RequestParam(name = "data", required = false) String data ) { try { JSONObject cardInfoObject = HuiLianTongUnionCardConfig.resolveResponse(data); return ResponseMsgUtil.success(cardInfoObject); } catch (Exception e) { log.error("getUserByTelephone",e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getHuiLianTongCardConsume", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询汇联通工会卡消费记录") public ResponseData getHuiLianTongCardConsume(@RequestParam(name = "businessType", required = true) String businessType, @RequestParam(name = "cardNo", required = true) String cardNo, @RequestParam(name = "sdate", required = true) Long sdate, @RequestParam(name = "edate", required = true) Long edate, @RequestParam(name = "pageNum", required = true) Integer pageNum, @RequestParam(name = "pageSize", required = true) Integer pageSize, HttpServletRequest request) { try { JSONObject consumptionRecord = HuiLianTongUnionCardConfig.queryConsumptionRecordByBusiness(businessType, cardNo, sdate, edate, pageNum, pageSize); if (StringUtils.isBlank(consumptionRecord.getString("data"))) { throw ErrorHelp.genException(SysCode.System, ErrorCode.REQUEST_ERROR, ""); } JSONArray array = HuiLianTongUnionCardConfig.resolveResponse(consumptionRecord.getString("data")).getJSONArray("records"); return ResponseMsgUtil.success(array); } catch (Exception e) { log.error("HighUserCardController --> getHuiLianTongCardConsume() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/createOrder", method = RequestMethod.POST) @ResponseBody @ApiOperation(value = "创建订单") public ResponseData createOrder(@RequestBody JSONObject object) { try { Map mapPost = new HashMap<>(); mapPost.put("merchId" , "20230258302"); mapPost.put("timetable" , new Date().getTime()); mapPost.put("orderNo" , "TEST" + OrderUtil.generateOrderNo()); mapPost.put("productType" , object.getString("productType")); mapPost.put("content" , object.getJSONObject("content").toString()); mapPost.put("sign" , WxUtils.generateSignApi(mapPost, "0C7897EA3BD96156A5881618FF2FF645", WXPayConstants.SignType.MD5)); return ResponseMsgUtil.success(HttpsUtils.doPost("http://localhost:9902/v1/order/createOrder" , mapPost , new HashMap<>())); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/payOrder", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "支付订单") public ResponseData payOrder(@RequestParam(name = "mchOrderNo", required = true) String mchOrderNo) { try { Map mapPost = new HashMap<>(); mapPost.put("apiKey" , "0C7897EA3BD96156A5881618FF2FF645"); mapPost.put("merchId" , "20230258302"); mapPost.put("mchOrderNo" , mchOrderNo); Map map = new HashMap<>(); map.put("apiKey" , "0C7897EA3BD96156A5881618FF2FF645"); map.put("merchId" , "20230258302"); map.put("mchOrderNo" , mchOrderNo); System.out.println(map); mapPost.put("sign" , WxUtils.generateSignApi(map, MapUtils.getString(map, "apiKey"), WXPayConstants.SignType.MD5)); return ResponseMsgUtil.success(HttpsUtils.doPost("http://localhost:9902/v1/order/orderPay" , mapPost , new HashMap<>())); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/queryOrderDetail", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询订单详情") public ResponseData queryOrderDetail(@RequestParam(name = "mchOrderNo", required = true) String mchOrderNo) { try { Map mapPost = new HashMap<>(); mapPost.put("apiKey" , "0C7897EA3BD96156A5881618FF2FF645"); mapPost.put("merchId" , "20230258302"); mapPost.put("mchOrderNo" , mchOrderNo); Map map = new HashMap<>(); map.put("apiKey" , "0C7897EA3BD96156A5881618FF2FF645"); map.put("merchId" , "20230258302"); map.put("mchOrderNo" , mchOrderNo); System.out.println(map); mapPost.put("sign" , WxUtils.generateSignApi(map, MapUtils.getString(map, "apiKey"), WXPayConstants.SignType.MD5)); return ResponseMsgUtil.success(HttpsUtils.doPost("http://localhost:9902/v1/order/queryOrderDetail" , mapPost , new HashMap<>())); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/deposit", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "工会卡充值") public ResponseData deposit(@RequestParam(name = "orderNo", required = true) String orderNo) { try { HighOrder order = highOrderService.getOrderByOrderNo(orderNo); HighChildOrder highChildOrder = order.getHighChildOrderList().get(0); if (order.getOrderStatus() != 2) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "订单状态错误"); } // 汇联通充值 String goodsDesc = "汇联通充值"+order.getPayPrice()+"元"; String tranDesc = ""; String businessType = "ghk_deposit"; String orderNoAgain = OrderUtil.generateOrderNo(); order.setOrderStatus(Integer.valueOf(3)); order.setRemarks("工会卡再次充值订单号" + orderNoAgain); highOrderService.updateOrder(order); // 汇联通卡充值 JSONObject deposit = HuiLianTongUnionCardConfig.deposit(orderNoAgain, highChildOrder.getGoodsSpecName(), order.getPayPrice(), businessType, order.getPaySerialNo(), goodsDesc); return ResponseMsgUtil.success( HuiLianTongUnionCardConfig.resolveResponse(deposit.getString("data"))); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getHuiLianTongCardByCardNo", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "根据卡号查询汇联通工会卡详情") public ResponseData getHuiLianTongCardByCardNo(@RequestParam(name = "cardNo", required = true) String cardNo) { try { // 查询工会卡 JSONObject cardInfo = HuiLianTongUnionCardConfig.queryBalance(cardNo); JSONObject resolveResponse = HuiLianTongUnionCardConfig.resolveResponse(cardInfo.getString("data")); return ResponseMsgUtil.success(resolveResponse); } catch (Exception e) { log.error("HighUserCardController --> getHuiLianTongCardByCardNo() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/consumption", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "工会卡支付") public ResponseData consumption(@RequestParam(name = "payRealPrice", required = true) BigDecimal payRealPrice, @RequestParam(name = "cardNo", required = true) String cardNo) { try { String goodsDesc = ""; String tranDesc = ""; String instCode = "11101527"; String businessType = "hisen_consume"; // 工会卡支付 JSONObject consumption = HuiLianTongUnionCardConfig.consumption(OrderUtil.generateOrderNo(), cardNo, payRealPrice, businessType, instCode, goodsDesc, tranDesc); if (!consumption.getString("respCode").equals("0000")) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, consumption.getString("respMessage")); } // 响应参数 JSONObject consumptionResult = HuiLianTongUnionCardConfig.resolveResponse(consumption.getString("data")); if (consumptionResult.getBoolean("success") != true) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, consumptionResult.getString("message")); } return ResponseMsgUtil.success(consumptionResult); } catch (Exception e) { log.error("HighUserCardController --> getHuiLianTongCardByCardNo() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/refundOrder", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "工会卡退款") public ResponseData refundOrder(@RequestParam(name = "orderNo", required = true) String orderNo) { try { HighOrder order = highOrderService.getOrderByOrderNo(orderNo); if (order.getOrderStatus() != 2) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "订单状态错误"); } orderService.refundOrder(order, OrderProductType.getDataByType(order.getProductType()).getName() + "退款",OrderRefundOpUserType.TYPE1, null, "系统自动退款"); if (order.getProductType().equals(4)) { HighUser user = highUserService.findByUserId(order.getMemId()); // 获取应退款积分 int integralNum = order.getTotalPrice().multiply(new BigDecimal(100)).intValue(); if ( integralNum> user.getGold()) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "积分数量不足"); } String remark = "订单" + order.getOrderNo() + "退还积分:" + integralNum; // 积分退款 highUserService.goldHandle(user.getId(), integralNum,2, 3, order.getId() , remark , order.getOrderNo()); } return ResponseMsgUtil.success("退款成功"); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/externalOrderRefund", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "对外订单退款") public ResponseData externalOrderRefund(@RequestParam(name = "paySerialNo", required = true) String paySerialNo, @RequestParam(name = "WxMchId", required = true) String WxMchId, @RequestParam(name = "payRealPrice", required = true) String payRealPrice) { try { Map mapPost = new HashMap<>(); mapPost.put("apiKey" , "B94B5E62807FA56A7260AB581D8A1B48"); mapPost.put("merchId" , "20230394901"); mapPost.put("paySerialNo" , paySerialNo); mapPost.put("wxMchId" , WxMchId); mapPost.put("payRealPrice" , payRealPrice); mapPost.put("refundPrice" , payRealPrice); Map map = new HashMap<>(); map.put("apiKey" , "B94B5E62807FA56A7260AB581D8A1B48"); map.put("merchId" , "20230394901"); map.put("paySerialNo" , paySerialNo); map.put("wxMchId" , WxMchId); map.put("payRealPrice" , payRealPrice); map.put("refundPrice" , payRealPrice); System.out.println(map); mapPost.put("sign" , WxUtils.generateSignApi(map, MapUtils.getString(map, "apiKey"), WXPayConstants.SignType.MD5)); return ResponseMsgUtil.success(HttpsUtils.doPost("https://hsg.dctpay.com/v1/order/externalOrderRefund" , mapPost , new HashMap<>())); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getBlxCouponBalance", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询停车券") public ResponseData getBlxCouponBalance(@RequestParam(name = "phone", required = true) String phone) { try { highUserCardService.getBlxCouponBalance(phone); return ResponseMsgUtil.success("object"); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/queryJsParking", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询捷顺停车场") public ResponseData queryJsParking(@RequestParam(name = "gps", required = true) String gps) { try { Map mapPost = new HashMap<>(); mapPost.put("merchId" , "20230258302"); mapPost.put("gps" , gps); mapPost.put("range" , "1000"); mapPost.put("sign" , WxUtils.generateSignApi(mapPost, "0C7897EA3BD96156A5881618FF2FF645", WXPayConstants.SignType.MD5)); return ResponseMsgUtil.success(HttpsUtils.doPost("http://localhost:9902/v1/blxCoupon/queryJsParking" , mapPost , new HashMap<>())); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getUserCouponPage", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询捷顺停车场") public ResponseData getUserCouponPage(@RequestParam(name = "phone", required = true) String phone) { try { Map mapPost = new HashMap<>(); mapPost.put("merchId" , "20230258302"); mapPost.put("phone" , phone); mapPost.put("sign" , WxUtils.generateSignApi(mapPost, "0C7897EA3BD96156A5881618FF2FF645", WXPayConstants.SignType.MD5)); return ResponseMsgUtil.success(HttpsUtils.doPost("http://localhost:9902/v1/blxCoupon/getUserCouponPage" , mapPost , new HashMap<>())); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/queryJsOrderList", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询车牌订单列表信息") public ResponseData queryJsOrderList(@RequestParam(name = "carNo", required = true) String carNo, @RequestParam(name = "orderStatus", required = true) String orderStatus) { try { Map mapPost = new HashMap<>(); mapPost.put("merchId" , "20230258302"); mapPost.put("orderStatus" , orderStatus); mapPost.put("carNo" , carNo); mapPost.put("sign" , WxUtils.generateSignApi(mapPost, "0C7897EA3BD96156A5881618FF2FF645", WXPayConstants.SignType.MD5)); return ResponseMsgUtil.success(HttpsUtils.doPost("http://localhost:9902/v1/blxCoupon/queryJsOrderList" , mapPost , new HashMap<>())); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/sendCoupon", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "发放券") public ResponseData sendCoupon(@RequestParam(name = "couponCode", required = true) String couponCode, @RequestParam(name = "receiverCount", required = true) String receiverCount, @RequestParam(name = "receiverPhone", required = true) String receiverPhone) { try { Map mapPost = new HashMap<>(); mapPost.put("merchId" , "20230258302"); mapPost.put("sign" , WxUtils.generateSignApi(mapPost, "0C7897EA3BD96156A5881618FF2FF645", WXPayConstants.SignType.MD5)); return ResponseMsgUtil.success(HttpsUtils.doPost("http://localhost:9902/v1/blxCoupon/getCouponList" , mapPost , new HashMap<>())); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/preorder", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "发起支付") public ResponseData preorder() { try { JSONObject object = new JSONObject(); object.put("outTradeNo" , "HUI" + OrderUtil.generateOrderNo()); object.put("transType" , "JSAPI"); object.put("payMode" , "WECHAT"); object.put("totalAmount" , "0.01"); object.put("profitSharing" , 0); object.put("subject" , "测试"); object.put("userId" , "oUGn_4unIjp90MY-oEXluY4laDrQ"); return ResponseMsgUtil.success(huiConfig.preorder(object)); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/queryGasInfoListByPage", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询团油门店") public ResponseData queryGasInfoListByPage() { try { HighMerchantModel merchant = highMerchantService.getMerchantById(39L); if (merchant == null) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到商户"); } JSONObject jsonObjectP = TuanYouConfig.queryGasInfoListByPage(1, 1000); JSONObject resultObjectP = jsonObjectP.getObject("result", JSONObject.class); for (int i = 1; i <= resultObjectP.getInteger("totalPageNum").intValue();i++) { JSONObject jsonObject = TuanYouConfig.queryGasInfoListByPage(i, 1000); JSONObject resultObject = jsonObject.getObject("result", JSONObject.class); JSONArray jsonArray = resultObject.getJSONArray("gasInfoList"); HighMerchantStore highMerchantStore; HighGasOilPrice highGasOilPrice; for (Object gasObject : jsonArray) { JSONObject object = JSONObject.parseObject(JSONObject.toJSONString(gasObject)); HighMerchantStoreModel store = highMerchantStoreService.getMerchantStoreByKey(object.getString("gasId")); if (store != null) { store.setType(1); store.setSourceType(2); store.setMerchantId(merchant.getId()); store.setCompanyId(merchant.getCompanyId()); store.setStoreKey(object.getString("gasId")); store.setStoreName(object.getString("gasName")); store.setStoreLogo(object.getString("gasLogoSmall")); store.setRegionId(object.getLong("provinceCode")); store.setRegionName(object.getString("provinceName")); store.setAddress(object.getString("gasAddress")); store.setLongitude(object.getString("gasAddressLongitude")); store.setLatitude(object.getString("gasAddressLatitude")); store.setStatus(object.getInteger("gasStatus")); store.setPrestoreType(0); store.setOperatorId(0L); store.setOperatorName("系统创建"); store.setUpdateTime(new Date()); store.setExt1(object.getString("gasSourceId")); highMerchantStoreService.updateMerchantStoreDetail(store); JSONArray oilPriceList = object.getJSONArray("oilPriceList"); for (Object oilPrice : oilPriceList) { JSONObject oilPriceObject = JSONObject.parseObject(JSONObject.toJSONString(oilPrice)); // 查询门店油号 highGasOilPrice = highGasOilPriceService.getGasOilPriceByStoreAndOilNo(store.getId(), oilPriceObject.getString("oilNo")); if (highGasOilPrice == null) { highGasOilPrice = new HighGasOilPrice(); highGasOilPrice.setMerchantStoreId(store.getId()); highGasOilPrice.setOilNo(oilPriceObject.getString("oilNo")); highGasOilPrice.setOilNoName(oilPriceObject.getString("oilNoName")); highGasOilPrice.setPriceVip(oilPriceObject.getBigDecimal("priceVip")); highGasOilPrice.setPriceGun(oilPriceObject.getBigDecimal("priceGun")); highGasOilPrice.setPriceOfficial(oilPriceObject.getBigDecimal("priceOfficial")); highGasOilPrice.setOilType(oilPriceObject.getInteger("oilType")); highGasOilPrice.setOilTypeName(oilPriceObject.getString("oilTypeName")); highGasOilPrice.setStatus(GasOilPriceStatusEnum.status1.getStatus()); } else { highGasOilPrice.setMerchantStoreId(store.getId()); highGasOilPrice.setOilNo(oilPriceObject.getString("oilNo")); highGasOilPrice.setOilNoName(oilPriceObject.getString("oilNoName")); highGasOilPrice.setPriceVip(oilPriceObject.getBigDecimal("priceVip")); highGasOilPrice.setPriceGun(oilPriceObject.getBigDecimal("priceGun")); highGasOilPrice.setPriceOfficial(oilPriceObject.getBigDecimal("priceOfficial")); highGasOilPrice.setOilType(oilPriceObject.getInteger("oilType")); highGasOilPrice.setOilTypeName(oilPriceObject.getString("oilTypeName")); } highGasOilPriceService.editGasOilPrice(highGasOilPrice); } } else { highMerchantStore = new HighMerchantStore(); highMerchantStore.setType(1); highMerchantStore.setSourceType(2); highMerchantStore.setMerchantId(merchant.getId()); highMerchantStore.setCompanyId(merchant.getCompanyId()); highMerchantStore.setStoreKey(object.getString("gasId")); highMerchantStore.setStoreName(object.getString("gasName")); highMerchantStore.setStoreLogo(object.getString("gasLogoSmall")); highMerchantStore.setRegionId(object.getLong("provinceCode")); highMerchantStore.setRegionName(object.getString("provinceName")); highMerchantStore.setAddress(object.getString("gasAddress")); highMerchantStore.setLongitude(object.getString("gasAddressLongitude")); highMerchantStore.setLatitude(object.getString("gasAddressLatitude")); highMerchantStore.setStatus(1); highMerchantStore.setPrestoreType(0); highMerchantStore.setOperatorId(0L); highMerchantStore.setOperatorName("系统创建"); highMerchantStore.setCreateTime(new Date()); highMerchantStore.setUpdateTime(new Date()); highMerchantStore.setExt1(object.getString("gasSourceId")); HighMerchantStoreModel merchantStoreModel = new HighMerchantStoreModel(); BeanUtils.copyProperties(highMerchantStore, merchantStoreModel); highMerchantStoreService.insertMerchantStore(merchantStoreModel); JSONArray oilPriceList = object.getJSONArray("oilPriceList"); for (Object oilPrice : oilPriceList) { JSONObject oilPriceObject = JSONObject.parseObject(JSONObject.toJSONString(oilPrice)); highGasOilPrice = new HighGasOilPrice(); highGasOilPrice.setMerchantStoreId(merchantStoreModel.getId()); highGasOilPrice.setOilNo(oilPriceObject.getString("oilNo")); highGasOilPrice.setOilNoName(oilPriceObject.getString("oilNoName")); highGasOilPrice.setPriceVip(oilPriceObject.getBigDecimal("priceVip")); highGasOilPrice.setPriceGun(oilPriceObject.getBigDecimal("priceGun")); highGasOilPrice.setPriceOfficial(oilPriceObject.getBigDecimal("priceOfficial")); highGasOilPrice.setOilType(oilPriceObject.getInteger("oilType")); highGasOilPrice.setOilTypeName(oilPriceObject.getString("oilTypeName")); highGasOilPriceService.editGasOilPrice(highGasOilPrice); } } } } return ResponseMsgUtil.success("完成"); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/test", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "测试") public ResponseData test(@RequestParam(name = "no", required = true) String no) { try { JSONObject jsonObject = DianConfig.getGasInfoByGasId(no); return ResponseMsgUtil.success(jsonObject); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getGasInfoAll", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "获取全量油站") public ResponseData getGasInfoAll() { try { HighMerchantModel merchant = highMerchantService.getMerchantById(39L); JSONObject jsonObject = DianConfig.getGasInfoAll(); JSONArray resultObject = jsonObject.getObject("result", JSONArray.class); for (int i = 0; i < resultObject.size();i++) { Object objectData = resultObject.get(i); JSONObject object = JSONObject.parseObject(JSONObject.toJSONString(objectData)); HighMerchantStore highMerchantStore; HighGasOilPrice highGasOilPrice; HighMerchantStoreModel store = highMerchantStoreService.getMerchantStoreByKey(object.getString("jyzid")); SecRegion region = commonService.getRegionsByName(object.getString("province")); if (store != null) { store.setType(1); store.setSourceType(6); store.setMerchantId(merchant.getId()); store.setCompanyId(merchant.getCompanyId()); store.setStoreKey(object.getString("jyzid")); store.setStoreName(object.getString("mingcheng")); store.setStoreLogo(object.getString("tupian")); store.setRegionId(region.getRegionId()); store.setRegionName(object.getString("province")); store.setAddress(object.getString("dizhi")); store.setLongitude(object.getString("lng")); store.setLatitude(object.getString("lat")); store.setStatus(object.getInteger("zhuangtai")); store.setPrestoreType(0); store.setOperatorId(0L); store.setOperatorName("系统创建"); store.setUpdateTime(new Date()); store.setExt1(object.getString("gasSourceId")); highMerchantStoreService.updateMerchantStoreDetail(store); JSONArray oilPriceList = object.getJSONArray("oilPriceList"); for (Object oilPrice : oilPriceList) { JSONObject oilPriceObject = JSONObject.parseObject(JSONObject.toJSONString(oilPrice)); // 查询门店油号 highGasOilPrice = highGasOilPriceService.getGasOilPriceByStoreAndOilNo(store.getId(), oilPriceObject.getString("youhao")); if (highGasOilPrice == null) { highGasOilPrice = new HighGasOilPrice(); highGasOilPrice.setMerchantStoreId(store.getId()); highGasOilPrice.setOilNo(oilPriceObject.getString("youhao")); highGasOilPrice.setOilNoName(oilPriceObject.getString("youhao") + "#"); highGasOilPrice.setPriceVip(oilPriceObject.getBigDecimal("priceVip")); highGasOilPrice.setPriceGun(oilPriceObject.getBigDecimal("priceGun")); highGasOilPrice.setPriceOfficial(oilPriceObject.getBigDecimal("priceGun")); highGasOilPrice.setOilType(oilPriceObject.getInteger("oiltype")); highGasOilPrice.setOilTypeName(oilPriceObject.getString("oiltype").equals("1") ? "汽油": "柴油"); highGasOilPrice.setStatus(GasOilPriceStatusEnum.status1.getStatus()); } else { highGasOilPrice.setMerchantStoreId(store.getId()); highGasOilPrice.setOilNo(oilPriceObject.getString("youhao")); highGasOilPrice.setOilNoName( oilPriceObject.getString("youhao") + "#"); highGasOilPrice.setPriceVip(oilPriceObject.getBigDecimal("priceVip")); highGasOilPrice.setPriceGun(oilPriceObject.getBigDecimal("priceGun")); highGasOilPrice.setPriceOfficial(oilPriceObject.getBigDecimal("priceGun")); highGasOilPrice.setOilType(oilPriceObject.getInteger("oiltype")); highGasOilPrice.setOilTypeName(oilPriceObject.getString("oiltype").equals("1") ? "汽油": "柴油"); } highGasOilPriceService.editGasOilPrice(highGasOilPrice); } } else { highMerchantStore = new HighMerchantStore(); highMerchantStore.setType(1); highMerchantStore.setSourceType(6); highMerchantStore.setMerchantId(merchant.getId()); highMerchantStore.setCompanyId(merchant.getCompanyId()); highMerchantStore.setStoreKey(object.getString("jyzid")); highMerchantStore.setStoreName(object.getString("mingcheng")); highMerchantStore.setStoreLogo(object.getString("tupian")); highMerchantStore.setRegionId(region.getRegionId()); highMerchantStore.setRegionName(object.getString("province")); highMerchantStore.setAddress(object.getString("dizhi")); highMerchantStore.setLongitude(object.getString("lng")); highMerchantStore.setLatitude(object.getString("lat")); highMerchantStore.setStatus(1); highMerchantStore.setPrestoreType(0); highMerchantStore.setOperatorId(0L); highMerchantStore.setOperatorName("系统创建"); highMerchantStore.setCreateTime(new Date()); highMerchantStore.setUpdateTime(new Date()); highMerchantStore.setExt1(object.getString("gasSourceId")); HighMerchantStoreModel merchantStoreModel = new HighMerchantStoreModel(); BeanUtils.copyProperties(highMerchantStore, merchantStoreModel); highMerchantStoreService.insertMerchantStore(merchantStoreModel); JSONArray oilPriceList = object.getJSONArray("oilPriceList"); for (Object oilPrice : oilPriceList) { JSONObject oilPriceObject = JSONObject.parseObject(JSONObject.toJSONString(oilPrice)); highGasOilPrice = new HighGasOilPrice(); highGasOilPrice.setMerchantStoreId(merchantStoreModel.getId()); highGasOilPrice.setOilNo(oilPriceObject.getString("youhao")); highGasOilPrice.setOilNoName(oilPriceObject.getString("youhao") + "#"); highGasOilPrice.setPriceVip(oilPriceObject.getBigDecimal("priceVip")); highGasOilPrice.setPriceGun(oilPriceObject.getBigDecimal("priceGun")); highGasOilPrice.setPriceOfficial(oilPriceObject.getBigDecimal("priceGun")); highGasOilPrice.setOilType(oilPriceObject.getInteger("oiltype")); highGasOilPrice.setOilTypeName(oilPriceObject.getString("oiltype").equals("1") ? "汽油": "柴油"); highGasOilPriceService.editGasOilPrice(highGasOilPrice); } } } return ResponseMsgUtil.success(jsonObject); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getOrderPay", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "getOrderPay") public ResponseData getOrderPay(@RequestParam(name = "orderNo", required = true) String orderNo) { try { HighOilCardOrder highOilCardOrder = highOilCardOrderService.findOrder(orderNo); highOilCardOrder.setStatus(2); JSONObject object = KytcService.getOrderPay(highOilCardOrder.getThirdOrderNo() , highOilCardOrder.getPrice() , highOilCardOrder.getCardNo()); highOilCardOrder.setExt1(object.toJSONString()); highOilCardOrderService.updateOilCardOrder(highOilCardOrder); return ResponseMsgUtil.success("成功"); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getOrderInfo", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "getOrderInfo") public ResponseData getOrderInfo(@RequestParam(name = "orderNo", required = true) String orderNo) { try { HighOilCardOrder highOilCardOrder = highOilCardOrderService.findOrder(orderNo); JSONObject object = KytcService.getOrderInfo(highOilCardOrder.getThirdOrderNo()); highOilCardOrder.setExt2(object.toJSONString()); if (object.getBoolean("State") == true) { JSONObject jsonObject = object.getJSONObject("Data"); if (jsonObject.getInteger("OilOrderState") == 2) { highOilCardOrder.setStatus(3); HighOrder highOrder = highOrderService.getOrderByOrderNo(highOilCardOrder.getOrderNo()); highOrder.setOrderStatus(3); highOrder.getHighChildOrderList().get(0).setChildOrderStatus(3); highOrderService.updateOrder(highOrder); } } highOilCardOrderService.updateOilCardOrder(highOilCardOrder); return ResponseMsgUtil.success("成功"); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getLogisticsMsg", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "获取物流") public ResponseData getLogisticsMsg(@RequestParam(name = "no", required = true) String no) { try { JSONObject jsonObjects = CommonConfig.getLogisticsMsg(no); return ResponseMsgUtil.success(jsonObjects); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/synCouponRule", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "获取卡券") public ResponseData synCouponRule() { try { return ResponseMsgUtil.success(PetroConfig.synCouponRule()); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getCoupon", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "卡券下单") public ResponseData getCoupon() { try { JSONObject jsonObject = PetroConfig.getCoupon("16000443991501" , "18090580471" , OrderUtil.generateOrderNo()); String data = PetroConfig.decrypt(jsonObject.getString("biz_content")); JSONObject object = JSONObject.parseObject(data); return ResponseMsgUtil.success(object); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/decrypt", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "解码") public ResponseData decrypt(@RequestParam(name = "content", required = true) String content) { try { String data = PetroConfig.decrypt(content); return ResponseMsgUtil.success(data); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/deleteOilNo", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "删除油品") public ResponseData deleteOilNo() { try { gasService.deleteOilNo(); return ResponseMsgUtil.success("1231243"); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getJiaHaoYouAllStation", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "加好油油站刷新") public ResponseData getJiaHaoYouAllStation() { try { gasService.getJiaHaoYouAllStation(); return ResponseMsgUtil.success("1231243"); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getDianAllStation", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "点点网络") public ResponseData getDianAllStation() { try { gasService.getDianAllStation(); return ResponseMsgUtil.success("1231243"); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() err1or!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/integralRebateOrder", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "积分返利") public ResponseData integralRebateOrder() { try { // 查询满足初步返利条件订单 List order = highOrderService.integralRebateOrder(); for (HighOrder highOrder : order) { // 查询是否存在积分记录 Map map = new HashMap<>(); map.put("goldType", 1); map.put("resType", 4); map.put("userId", highOrder.getMemId()); map.put("resId", highOrder.getId()); List goldRecs = highGoldRecService.getGoldRec(map); // 判断是否重复赠送积分 if (goldRecs.size() == 0) { bsOrderRebateService.insertOrderRebate(highOrder); } highOrder.setWhetherRebate(true); highOrderService.updateOrderDetail(highOrder); } return ResponseMsgUtil.success("1231243"); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() err1or!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getApiCoupon", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "获取卡券") public ResponseData getApiCoupon() { try { // 查询满足初步返利条件订单 List order = highOrderService.integralRebateOrder(); for (HighOrder highOrder : order) { // 查询是否存在积分记录 Map map = new HashMap<>(); map.put("goldType", 1); map.put("resType", 4); map.put("userId", highOrder.getMemId()); map.put("resId", highOrder.getId()); List goldRecs = highGoldRecService.getGoldRec(map); // 判断是否重复赠送积分 if (goldRecs.size() == 0) { bsOrderRebateService.insertOrderRebate(highOrder); } highOrder.setWhetherRebate(true); highOrderService.updateOrderDetail(highOrder); } return ResponseMsgUtil.success("1231243"); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() err1or!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getCouponList", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询车牌订单列表信息") public ResponseData getCouponList() { try { Map mapPost = new HashMap<>(); mapPost.put("merchId" , "20230258302"); mapPost.put("timetable" , new Date().getTime()); mapPost.put("sign" , WxUtils.generateSignApi(mapPost, "0C7897EA3BD96156A5881618FF2FF645", WXPayConstants.SignType.MD5)); return ResponseMsgUtil.success(HttpsUtils.doPost("http://localhost:9902/v1/apiCoupon/getCouponList" , mapPost , new HashMap<>())); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } } \ No newline at end of file diff --git a/hai-cweb/src/main/java/com/cweb/controller/HighDiscountPackageController.java b/hai-cweb/src/main/java/com/cweb/controller/HighDiscountPackageController.java index b4160ea0..b1d98c34 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/HighDiscountPackageController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/HighDiscountPackageController.java @@ -1,15 +1,19 @@ package com.cweb.controller; +import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; +import com.hai.common.Base64Util; import com.hai.common.exception.ErrorCode; import com.hai.common.exception.ErrorHelp; import com.hai.common.exception.SysCode; +import com.hai.common.security.AESEncodeUtil; import com.hai.common.security.SessionObject; import com.hai.common.security.UserCenter; import com.hai.common.utils.ResponseMsgUtil; import com.hai.entity.*; +import com.hai.model.HighUserModel; import com.hai.model.ResponseData; import com.hai.model.UserInfoModel; import com.hai.service.*; @@ -24,10 +28,7 @@ import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; @Controller @RequestMapping(value = "/discountPackage") @@ -45,12 +46,17 @@ public class HighDiscountPackageController { @Resource private HighDiscountService highDiscountService; + + @Resource + private CommonService commonService; + @RequestMapping(value = "/getDiscountPackageList", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "获取优惠券包列表") public ResponseData getDiscountPackageList(@RequestParam(name = "companyId", required = true) String companyId, @RequestParam(name = "usingAttribution", required = false) Integer usingAttribution, @RequestParam(name = "title", required = false) String title, + @RequestParam(name = "showLabel", required = false) String showLabel, @RequestParam(name = "pageNum", required = true) Integer pageNum, @RequestParam(name = "pageSize", required = true) Integer pageSize) { try { @@ -59,6 +65,7 @@ public class HighDiscountPackageController { map.put("companyId", companyId); map.put("usingAttribution", usingAttribution); map.put("title" , title); + map.put("showLabel" , showLabel); map.put("salesType" , 1); map.put("status" , 1); PageHelper.startPage(pageNum, pageSize); @@ -86,9 +93,11 @@ public class HighDiscountPackageController { for (HighDiscountPackageDetails discount: detailsList) { discount.setDiscountDetail(highDiscountService.getDiscountById(Long.parseLong(discount.getDiscountId().toString()))); } + map.put("msg", commonService.findSecConfigByType("DISCOUNT_PACKAGE_DETAIL").getCodeValue()); map.put("discountList", detailsList); return ResponseMsgUtil.success(map); } + return ResponseMsgUtil.success(null); } catch (Exception e) { @@ -97,6 +106,38 @@ public class HighDiscountPackageController { } } + @RequestMapping(value = "/receivePackage", method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "领取券包") + public ResponseData receivePackage(@RequestParam(name = "code", required = false) String code) { + try { + // 用户 + String jsonData; + try { + jsonData = AESEncodeUtil.aesDecrypt(Base64Util.decode(code)); + } catch (Exception e) { + log.error("HighDiscountController -> getDiscountByQrCode() error!","code解码错误"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "code解码错误"); + } + + JSONObject jsonObject = JSON.parseObject(jsonData); + String type = jsonObject.getString("type"); + + if (!type.equals("DISCOUNT_PACKAGE")){ + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "当前业务不支持!"); + } + + + highDiscountPackageService.receivePackage(jsonObject.getInteger("id") , code); + + return ResponseMsgUtil.success("领取成功!"); + + } catch (Exception e) { + log.error("HighDiscountPackageController --> giveAway() error!", e); + return ResponseMsgUtil.exception(e); + } + } + } diff --git a/hai-cweb/src/main/java/com/cweb/controller/HighUserCommonController.java b/hai-cweb/src/main/java/com/cweb/controller/HighUserCommonController.java deleted file mode 100644 index d48a59ec..00000000 --- a/hai-cweb/src/main/java/com/cweb/controller/HighUserCommonController.java +++ /dev/null @@ -1,200 +0,0 @@ -package com.cweb.controller; - -import com.alibaba.fastjson.JSONObject; -import com.hai.common.exception.ErrorCode; -import com.hai.common.exception.ErrorHelp; -import com.hai.common.exception.SysCode; -import com.hai.common.security.*; -import com.hai.common.utils.*; -import com.hai.config.UnionUserConfig; -import com.hai.entity.HighUser; -import com.hai.model.HighUserModel; -import com.hai.model.ResponseData; -import com.hai.service.HighUserService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.apache.commons.lang3.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.ResponseBody; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.util.Date; -import java.util.Objects; - -@Controller -@RequestMapping(value = "/user") -@Api(value = "用户共用接口") -public class HighUserCommonController { - - private static final Logger log = LoggerFactory.getLogger(WechatController.class); - - @Resource - private HighUserService highUserService; - - @Resource - private RedisUtil redisUtil; - - @Resource - private UnionUserConfig unionUserConfig; - - @Resource - private UserCenter userCenter; - - @RequestMapping(value = "/login", method = RequestMethod.GET) - @ResponseBody - @ApiOperation(value = "登录接口【用户不存在会自动注册】") - public ResponseData login(@RequestParam(value = "phone", required = true) String phone, - @RequestParam(value = "code", required = true) String code, - @RequestParam(value = "openId", required = false) String openId, - @RequestParam(value = "popularizeUserId", required = false) Long popularizeUserId, - @RequestParam(value = "regionId", required = false) String regionId, - HttpServletRequest request, HttpServletResponse response) { - try { - - // 获取手机号验证码 - String phoneSmsCode = (String) redisUtil.get("SMS_"+phone); - // 校验验证码 - if (StringUtils.isBlank(phoneSmsCode) || !Objects.equals(phoneSmsCode,code)) { - log.error("HighUserController --> bindUserPhone() error!", "验证码错误"); - throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "验证码错误"); - } - redisUtil.del("SMS_"+phone); - - HighUser user = highUserService.findByPhone(phone); - - - - if(user == null) { - user = new HighUser(); - user.setName("用户" + IDGenerator.nextId(5)); - user.setPhone(phone); - user.setRegTime(new Date()); - user.setGold(0); - user.setOpenIdH5(openId); - user.setStatus(1); - // 用户信息完整状态 - // 0:完整 - // 1:需要填写用户信息 - // 2:需要填写手机号 - user.setInfoCompleteStatus(1); - - highUserService.insertUser(user , popularizeUserId); - } else { - user.setOpenIdH5(openId); - highUserService.updateUser(user); - } - - HighUserModel highUserModel = new HighUserModel(); - HighUser detailData = highUserService.getDetailDataByUser(user.getId()); - detailData.setPassword(null); - highUserModel.setHighUser(detailData); - SessionObject so = new SessionObject(user.getPhone(), 1 , highUserModel); - userCenter.save(request, response, so); - return ResponseMsgUtil.success(so); - } catch (Exception e) { - return ResponseMsgUtil.exception(e); - } - } - - @RequestMapping(value = "/unionPhoneLogin", method = RequestMethod.GET) - @ResponseBody - @ApiOperation(value = "银联授权手机号登录接口") - public ResponseData unionPhoneLogin(@RequestParam(value = "code", required = true) String code, - @RequestParam(value = "popularizeUserId", required = false) Long popularizeUserId, - @RequestParam(value = "regionId", required = false) String regionId, - HttpServletRequest request, HttpServletResponse response) { - try { - - // 获取应用访问令牌 - String backendToken = unionUserConfig.getBackendToken(); - - // 获取授权访问令牌 - JSONObject token = unionUserConfig.getAccessToken(backendToken, code); - if (token == null || !token.getString("resp").equals("00")) { - throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, token.getString("msg")); - } - - // 获取用户手机号 - JSONObject userMobile = unionUserConfig.getUserMobile(backendToken, token.getJSONObject("params").getString("accessToken"), token.getJSONObject("params").getString("openId")); - if (userMobile == null || !userMobile.getString("resp").equals("00")) { - throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, userMobile.getString("msg")); - } - // 解密,获取手机号 - String mobile = UnionUtils.getDecryptedValue(userMobile.getJSONObject("params").getString("mobile"), unionUserConfig.getRsaKey()); - HighUser user = highUserService.findByPhone(mobile); - if(user == null) { - user = new HighUser(); - user.setName("用户" + IDGenerator.nextId(5)); - user.setPhone(mobile); - user.setRegTime(new Date()); - user.setGold(0); - user.setUnionOpenId(token.getJSONObject("params").getString("openId")); - user.setUnionUnionId(token.getJSONObject("params").getString("unionId")); - user.setStatus(1); - // 用户信息完整状态 - // 0:完整 - // 1:需要填写用户信息 - // 2:需要填写手机号 - user.setInfoCompleteStatus(1); - highUserService.insertUser(user , popularizeUserId); - } else { - user.setUnionOpenId(token.getJSONObject("params").getString("openId")); - user.setUnionUnionId(token.getJSONObject("params").getString("unionId")); - highUserService.updateUser(user); - } - - HighUserModel highUserModel = new HighUserModel(); - HighUser detailData = highUserService.getDetailDataByUser(user.getId()); - detailData.setPassword(null); - highUserModel.setHighUser(detailData); - SessionObject so = new SessionObject(user.getPhone(), 1 , highUserModel); - userCenter.save(request, response, so); - return ResponseMsgUtil.success(so); - } catch (Exception e) { - return ResponseMsgUtil.exception(e); - } - } - - @RequestMapping(value = "/loginOut", method = RequestMethod.GET) - @ResponseBody - @ApiOperation(value = "退出登录") - public ResponseData loginOut(HttpServletRequest request, HttpServletResponse response) { - try { - // 用户信息 - HighUserModel sessionModel = userCenter.getSessionModel(HighUserModel.class); - if (sessionModel == null) { - throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到用户信息"); - } - userCenter.remove(request, response); - return ResponseMsgUtil.success("退出成功"); - } catch (Exception e) { - return ResponseMsgUtil.exception(e); - } - } - - - @RequestMapping(value = "/ip", method = RequestMethod.GET) - @ResponseBody - @ApiOperation(value = "退出登录") - public ResponseData ip(HttpServletRequest request, HttpServletResponse response) { - try { - // 113.205.199.32 - // ; - // return ResponseMsgUtil.success(RequestUtils.getRequestIp()); - return ResponseMsgUtil.success(HttpsUtils.doGet("https://api.map.baidu.com/location/ip?ak=X4sSdXsohVOMb1tNiLZloD9ows5FaNjq&ip=113.205.199.32&coor=gcj02")); - - } catch (Exception e) { - return ResponseMsgUtil.exception(e); - } - } - -} - - diff --git a/hai-cweb/src/main/java/com/cweb/controller/WechatController.java b/hai-cweb/src/main/java/com/cweb/controller/WechatController.java deleted file mode 100644 index 8b21d5a3..00000000 --- a/hai-cweb/src/main/java/com/cweb/controller/WechatController.java +++ /dev/null @@ -1,372 +0,0 @@ -package com.cweb.controller; - -import cn.binarywang.wx.miniapp.api.WxMaService; -import cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult; -import cn.binarywang.wx.miniapp.bean.WxMaPhoneNumberInfo; -import cn.binarywang.wx.miniapp.bean.WxMaUserInfo; -import com.alibaba.fastjson.JSONObject; -import com.cweb.config.SessionKeyCache; -import com.cweb.config.SysConst; - -import com.github.pagehelper.Page; -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.hai.common.exception.ErrorCode; -import com.hai.common.exception.ErrorHelp; -import com.hai.common.exception.SysCode; -import com.hai.common.security.*; -import com.hai.common.utils.*; -import com.hai.config.WxMaConfiguration; -import com.hai.entity.HighUser; -import com.hai.model.HighUserModel; -import com.hai.model.ResponseData; -import com.hai.service.HighUserPayPasswordService; -import com.hai.service.HighUserService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.apache.commons.lang3.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.net.URLEncoder; -import java.util.*; - -@Controller -@RequestMapping(value = "/wechat") -@Api(value = "微信授权") -public class WechatController { - - private static final Logger log = LoggerFactory.getLogger(WechatController.class); - - private static final String WX_OPENID_SESSION_REDIS = "WX_OPENID_SESSION_REDIS"; - - @Autowired - private UserCenter userCenter; - - @Resource - private HighUserService highUserService; - - @Resource - private RedisUtil redisUtil; - - @RequestMapping(value = "/handleCode", method = RequestMethod.GET) - @ResponseBody - @ApiOperation(value = "小程序code解析") - public ResponseData compairCode(@RequestParam(value = "code", required = true) String code, - HttpServletRequest request, HttpServletResponse response) { - try { - //校验code,openId不能同时为空 - if (StringUtils.isEmpty(code)) { - throw ErrorHelp.genException(SysCode.MiniProgram, ErrorCode.REQ_PARAMS_ERROR, ""); - } - //请求微信api,获取用户session_key以及openId - final WxMaService wxService = WxMaConfiguration.getMaService(); - WxMaJscode2SessionResult session = wxService.jsCode2SessionInfo(code); - //保存小程序用户登录的openId及sessionKey信息 - redisUtil.hset(WX_OPENID_SESSION_REDIS, session.getOpenid(), session); - JSONObject jo = new JSONObject(); - jo.put("openId", session.getOpenid()); - return ResponseMsgUtil.success(jo); - } catch (Exception e) { - return ResponseMsgUtil.exception(e); - } - } - - @RequestMapping(value = "/loginByPhone", method = RequestMethod.GET) - @ResponseBody - @ApiOperation(value = "小程序根据手机号登录或注册") - public ResponseData loginByPhone(@RequestParam(value = "encryptedData", required = true) String encryptedData, - @RequestParam(value = "iv", required = true) String iv, - @RequestParam(value = "openId", required = true) String openId, - @RequestParam(value = "popularizeUserId", required = false) Long popularizeUserId, - @RequestParam(value = "regionId", required = false) String regionId, - HttpServletRequest request, HttpServletResponse response) { - try { - - log.error("origin encryptedData:" + encryptedData + ";iv:" + iv); - //校验openId不能为空 - //encryptedData,iv与unionId不能同时为空 - encryptedData = encryptedData.replace(" ", "+"); - iv = iv.replace(" ", "+"); - log.error("dest encryptedData:" + encryptedData + ";iv:" + iv); - if (StringUtils.isEmpty(openId) - || StringUtils.isEmpty(encryptedData) || StringUtils.isEmpty(iv)) { - throw ErrorHelp.genException(SysCode.MiniProgram, ErrorCode.REQ_PARAMS_ERROR, ""); - } - //请求微信api,获取用户session_key以及openId - Object skObject = redisUtil.hget(WX_OPENID_SESSION_REDIS, openId); - if (skObject == null) { - throw ErrorHelp.genException(SysCode.MiniProgram, ErrorCode.WECHAT_LOGIN_ERROR); - } - WxMaJscode2SessionResult session = (WxMaJscode2SessionResult) skObject; - - final WxMaService wxService = WxMaConfiguration.getMaService(); - WxMaPhoneNumberInfo phoneNoInfo = wxService.getUserService().getPhoneNoInfo(session.getSessionKey(), encryptedData, iv); - if (phoneNoInfo == null || StringUtils.isEmpty(phoneNoInfo.getPurePhoneNumber())) { - throw ErrorHelp.genException(SysCode.MiniProgram, ErrorCode.WECHAT_DECRYPT_ERROR, "用户phoneNumber解析失败"); - } - - - // 根据手机号查询用户 - HighUser user = highUserService.findByPhone(phoneNoInfo.getPurePhoneNumber()); - if (user == null) { - user = new HighUser(); - user.setName("用户" + IDGenerator.nextId(5)); - user.setPhone(phoneNoInfo.getPurePhoneNumber()); - user.setRegTime(new Date()); - user.setGold(0); - user.setOpenId(session.getOpenid()); - user.setUnionId(session.getUnionid()); - user.setStatus(1); - // 用户信息完整状态 - // 0:完整 - // 1:需要填写用户信息 - // 2:需要填写手机号 - user.setInfoCompleteStatus(1); - highUserService.insertUser(user , popularizeUserId); - } else { - if (session.getOpenid() == null) { - user.setOpenId(session.getOpenid()); - user.setUnionId(session.getUnionid()); - highUserService.updateUser(user); - } - } - - // 定义个人所有数据 - HighUserModel highUserModel = new HighUserModel(); - HighUser detailData = highUserService.getDetailDataByUser(user.getId()); - detailData.setPassword(null); - highUserModel.setHighUser(detailData); - SessionObject so = new SessionObject(user.getPhone(), 1, highUserModel); - userCenter.save(request, response, so); - - return ResponseMsgUtil.success(so); - - } catch (Exception e) { - return ResponseMsgUtil.exception(e); - } - } - - - @RequestMapping(value = "/getUserInfo", method = RequestMethod.GET) - @ResponseBody - @ApiOperation(value = "小程序获取用户信息") - public ResponseData getUserInfo(@RequestParam(value = "encryptedData", required = true) String encryptedData, - @RequestParam(value = "iv", required = true) String iv, - @RequestParam(value = "openId", required = true) String openId, - HttpServletRequest request, HttpServletResponse response) { - try { - - // 用户 - SessionObject sessionObject = userCenter.getSessionObject(request); - HighUserModel userInfoModel = (HighUserModel) sessionObject.getObject(); - - //校验openId不能为空 - //encryptedData,iv与unionId不能同时为空 - encryptedData = encryptedData.replace(" ", "+"); - iv = iv.replace(" ", "+"); - if (StringUtils.isEmpty(openId) || StringUtils.isEmpty(encryptedData) || StringUtils.isEmpty(iv)) { - throw ErrorHelp.genException(SysCode.MiniProgram, ErrorCode.REQ_PARAMS_ERROR, ""); - } - //请求微信api,获取用户session_key以及openId - Object skObject = redisUtil.hget(WX_OPENID_SESSION_REDIS, openId); - if (skObject == null) { - throw ErrorHelp.genException(SysCode.MiniProgram, ErrorCode.WECHAT_LOGIN_ERROR); - } - WxMaJscode2SessionResult session = (WxMaJscode2SessionResult) skObject; - - final WxMaService wxService = WxMaConfiguration.getMaService(); - WxMaUserInfo userInfo = wxService.getUserService().getUserInfo(session.getSessionKey(), encryptedData, iv); - if (userInfo == null) { - throw ErrorHelp.genException(SysCode.MiniProgram, ErrorCode.WECHAT_DECRYPT_ERROR, "用户phoneNumber解析失败"); - } - - HighUser user = highUserService.findByUserId(userInfoModel.getHighUser().getId()); - if (user == null) { - throw ErrorHelp.genException(SysCode.MiniProgram, ErrorCode.COMMON_ERROR, "未找到用户信息"); - } - // 用户信息完整状态 - // 0:完整 - // 1:需要填写用户信息 - // 2:需要填写手机号 - if (user.getInfoCompleteStatus() == 1) { - if (StringUtils.isNotBlank(user.getPhone())) { - user.setInfoCompleteStatus(0); - } else { - user.setInfoCompleteStatus(2); - } - } - user.setName(userInfo.getNickName()); - user.setHeaderImg(userInfo.getAvatarUrl()); - highUserService.updateUser(user); - - // 定义个人所有数据 - HighUserModel highUserModel = new HighUserModel(); - HighUser detailData = highUserService.getDetailDataByUser(user.getId()); - detailData.setPassword(null); - highUserModel.setHighUser(detailData); - if (user.getPhone() == null) { - log.error("login error!", "未绑定手机号"); - throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未绑定手机号"); - } - SessionObject so = new SessionObject(user.getPhone(), 1, highUserModel); - userCenter.save(request, response, so); - - return ResponseMsgUtil.success(so); - - } catch (Exception e) { - return ResponseMsgUtil.exception(e); - } - } - - @RequestMapping(value = "/getH5AccessToken", method = RequestMethod.GET) - @ResponseBody - @ApiOperation(value = "【H5】获取AccessToken") - public ResponseData getH5AccessToken(@RequestParam(value = "code", required = true) String code) { - try { - Map params = new HashMap<>(); - params.put("appid", SysConst.getSysConfig().getWxH5AppId()); - params.put("secret", SysConst.getSysConfig().getWxH5AppSecret()); - params.put("code", code); - params.put("grant_type", "authorization_code"); - return ResponseMsgUtil.success(HttpsUtils.doGet("https://api.weixin.qq.com/sns/oauth2/access_token", params)); - - } catch (Exception e) { - return ResponseMsgUtil.exception(e); - } - } - - @RequestMapping(value = "/loginByTel", method = RequestMethod.GET) - @ResponseBody - @ApiOperation(value = "根据手机号码登陆") - public ResponseData loginByTel(@RequestParam(value = "phone", required = true) String phone, - @RequestParam(value = "code", required = true) String code, - @RequestParam(value = "popularizeUserId", required = false) Long popularizeUserId, - @RequestParam(value = "regionId", required = false) String regionId, - HttpServletRequest request, HttpServletResponse response) { - try { - - - // 获取手机号验证码 - String phoneSmsCode = (String) redisUtil.get("SMS_"+ phone); - - // 验证码校验 - if (!(StringUtils.isNotBlank(phoneSmsCode) && Objects.equals(phoneSmsCode,code))) { - throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "验证码错误"); - } - - // 根据手机号查询用户 - HighUser user = highUserService.findByPhone(phone); - - if (user == null) { - user = new HighUser(); - user.setName("用户" + IDGenerator.nextId(5)); - user.setPhone(phone); - user.setRegTime(new Date()); - user.setGold(0); - user.setStatus(1); - // 用户信息完整状态 - // 0:完整 - // 1:需要填写用户信息 - // 2:需要填写手机号 - user.setInfoCompleteStatus(1); - highUserService.insertUser(user , popularizeUserId); - } - // 定义个人所有数据 - HighUserModel highUserModel = new HighUserModel(); - HighUser detailData = highUserService.getDetailDataByUser(user.getId()); - detailData.setPassword(null); - highUserModel.setHighUser(detailData); - SessionObject so = new SessionObject(user.getPhone(), 1, highUserModel); - userCenter.save(request, response, so); - return ResponseMsgUtil.success(so); - - } catch (Exception e) { - return ResponseMsgUtil.exception(e); - } - } - - @RequestMapping(value = "/loginBySilence", method = RequestMethod.GET) - @ResponseBody - @ApiOperation(value = "根据手机号码登陆") - public ResponseData loginByTel(@RequestParam(value = "phone", required = true) String phone, - HttpServletRequest request, HttpServletResponse response) { - try { - - - // 根据手机号查询用户 - HighUser user = highUserService.findByPhone(phone); - - if (user == null) { - user = new HighUser(); - user.setName("用户" + IDGenerator.nextId(5)); - user.setPhone(phone); - user.setRegTime(new Date()); - user.setGold(0); - user.setStatus(1); - // 用户信息完整状态 - // 0:完整 - // 1:需要填写用户信息 - // 2:需要填写手机号 - user.setInfoCompleteStatus(1); - highUserService.insertUser(user , null); - } - - // 定义个人所有数据 - HighUserModel highUserModel = new HighUserModel(); - HighUser detailData = highUserService.getDetailDataByUser(user.getId()); - detailData.setPassword(null); - highUserModel.setHighUser(detailData); - SessionObject so = new SessionObject(user.getPhone(), 1, highUserModel); - userCenter.save(request, response, so); - return ResponseMsgUtil.success(so); - - } catch (Exception e) { - return ResponseMsgUtil.exception(e); - } - } - - @RequestMapping(value = "/getH5AccessByOpenId", method = RequestMethod.GET) - @ResponseBody - @ApiOperation(value = "【H5】通过openId查询") - public ResponseData getH5AccessByOpenId(@RequestParam(value = "openId", required = true) String openId, - HttpServletRequest request, HttpServletResponse response) { - try { - - HighUser user = highUserService.findByOpenIdH5(openId); - - if (user == null) { - user = new HighUser(); - user.setName("临时游客"); - user.setRegTime(new Date()); - user.setGold(0); - user.setOpenId(openId); - user.setStatus(1); - // 用户信息完整状态 - // 0:完整 - // 1:需要填写用户信息 - // 2:需要填写手机号 - user.setInfoCompleteStatus(1); - return ResponseMsgUtil.success(user); - } else { - // 定义个人所有数据 - HighUserModel highUserModel = new HighUserModel(); - HighUser detailData = highUserService.getDetailDataByUser(user.getId()); - detailData.setPassword(null); - highUserModel.setHighUser(detailData); - SessionObject so = new SessionObject(user.getPhone(), 1, highUserModel); - userCenter.save(request, response, so); - return ResponseMsgUtil.success(so); - } - - } catch (Exception e) { - return ResponseMsgUtil.exception(e); - } - } -} diff --git a/hai-order/src/main/java/com/web/controller/OrderPayController.java b/hai-order/src/main/java/com/web/controller/OrderPayController.java index 354ac687..28381e9a 100644 --- a/hai-order/src/main/java/com/web/controller/OrderPayController.java +++ b/hai-order/src/main/java/com/web/controller/OrderPayController.java @@ -168,6 +168,7 @@ public class OrderPayController { Integer payPlatformType = 1; String payPlatformKey = null; String payPlatformMerNo = null; + System.out.println(order); if (PlatformType.TYPE2.getNumber().equals(body.getInteger("platformType"))) { weChatPayReqInfo.setSub_mch_id(WxOrderConfig.MCH_ID_1648729281); @@ -198,21 +199,21 @@ public class OrderPayController { } else { weChatPayReqInfo.setSub_mch_id(WxOrderConfig.MCH_ID_1634835264); } - } else { - weChatPayReqInfo.setSub_mch_id(WxOrderConfig.MCH_ID_1614670195); - } - } else if (order.getProductType().equals(OrderProductType.PRODUCT_TYPE5.getNumber())) { - HighCoupon coupon = couponService.getCouponById(order.getHighChildOrderList().get(0).getGoodsId()); - if (coupon.getCouponSource() != null && coupon.getCouponSource().equals(4)) { - if (order.getMemDiscountId() != null) { - weChatPayReqInfo.setSub_mch_id(WxOrderConfig.MCH_ID_1614670195); - } else { - weChatPayReqInfo.setSub_mch_id(WxOrderConfig.MCH_ID_1634835264); + }else if(coupon.getCouponSource().equals(8)) { + // 查询支付配置 + HighGasChannelConfig gasChannelConfig = gasChannelConfigService.getConfig(GasChannel.type3); + if (gasChannelConfig == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未配置支付参数,请稍后重试!"); } + payPlatformType = gasChannelConfig.getPayPlatformType(); + payPlatformMerNo = gasChannelConfig.getPayPlatformMerNo(); + payPlatformKey = gasChannelConfig.getPayPlatformMerKey(); + + weChatPayReqInfo.setSub_mch_id(gasChannelConfig.getPayPlatformMerNo()); + profitSharing = gasChannelConfig.getProfitSharingStatus().equals(true) ? "Y" : "N"; } else { weChatPayReqInfo.setSub_mch_id(WxOrderConfig.MCH_ID_1614670195); } - } else if (order.getProductType().equals(OrderProductType.PRODUCT_TYPE6.getNumber())) { // 查询油站 HighMerchantStoreModel store = merchantStoreService.getMerchantStoreById(order.getHighChildOrderList().get(0).getGoodsId()); @@ -396,6 +397,8 @@ public class OrderPayController { SortedMap sortedMap; + System.out.println("-----------------------" + payPlatformType); + if (payPlatformType == 2) { objectGas.put("outTradeNo" , order.getOrderNo()); objectGas.put("transType" , "JSAPI"); diff --git a/hai-schedule/src/main/java/com/hai/schedule/HighGasSchedule.java b/hai-schedule/src/main/java/com/hai/schedule/HighGasSchedule.java index d6eadabb..d0a7b8bf 100644 --- a/hai-schedule/src/main/java/com/hai/schedule/HighGasSchedule.java +++ b/hai-schedule/src/main/java/com/hai/schedule/HighGasSchedule.java @@ -163,7 +163,7 @@ public class HighGasSchedule { // gasService.getDianAllStation(); // } - @Scheduled(cron = "7 0 0 * * ?") // 每日凌晨00:00:7执行一次 + @Scheduled(cron = "0 5 0 * * ?") // 每日凌晨00:00:7执行一次 public void deleteOilNo() { gasService.deleteOilNo(); } diff --git a/hai-service/src/main/java/com/hai/dao/ApiCouponMapper.java b/hai-service/src/main/java/com/hai/dao/ApiCouponMapper.java new file mode 100644 index 00000000..b0f012ab --- /dev/null +++ b/hai-service/src/main/java/com/hai/dao/ApiCouponMapper.java @@ -0,0 +1,142 @@ +package com.hai.dao; + +import com.hai.entity.ApiCoupon; +import com.hai.entity.ApiCouponExample; +import java.util.List; +import org.apache.ibatis.annotations.Delete; +import org.apache.ibatis.annotations.DeleteProvider; +import org.apache.ibatis.annotations.Insert; +import org.apache.ibatis.annotations.InsertProvider; +import org.apache.ibatis.annotations.Options; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Result; +import org.apache.ibatis.annotations.Results; +import org.apache.ibatis.annotations.Select; +import org.apache.ibatis.annotations.SelectProvider; +import org.apache.ibatis.annotations.Update; +import org.apache.ibatis.annotations.UpdateProvider; +import org.apache.ibatis.type.JdbcType; +import org.springframework.stereotype.Repository; + +/** + * + * 代码由工具生成,请勿修改!!! + * 如果需要扩展请在其父类进行扩展 + * + **/ +@Repository +public interface ApiCouponMapper extends ApiCouponMapperExt { + @SelectProvider(type=ApiCouponSqlProvider.class, method="countByExample") + long countByExample(ApiCouponExample example); + + @DeleteProvider(type=ApiCouponSqlProvider.class, method="deleteByExample") + int deleteByExample(ApiCouponExample example); + + @Delete({ + "delete from api_coupon", + "where id = #{id,jdbcType=BIGINT}" + }) + int deleteByPrimaryKey(Long id); + + @Insert({ + "insert into api_coupon (`type`, goods_type, ", + "`name`, code, `desc`, ", + "price, img, effective_days, ", + "create_time, update_time, ", + "`status`, op_id, op_name, ", + "ext_1, ext_2, ext_3)", + "values (#{type,jdbcType=INTEGER}, #{goodsType,jdbcType=VARCHAR}, ", + "#{name,jdbcType=VARCHAR}, #{code,jdbcType=VARCHAR}, #{desc,jdbcType=VARCHAR}, ", + "#{price,jdbcType=INTEGER}, #{img,jdbcType=VARCHAR}, #{effectiveDays,jdbcType=INTEGER}, ", + "#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ", + "#{status,jdbcType=INTEGER}, #{opId,jdbcType=BIGINT}, #{opName,jdbcType=VARCHAR}, ", + "#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" + }) + @Options(useGeneratedKeys=true,keyProperty="id") + int insert(ApiCoupon record); + + @InsertProvider(type=ApiCouponSqlProvider.class, method="insertSelective") + @Options(useGeneratedKeys=true,keyProperty="id") + int insertSelective(ApiCoupon record); + + @SelectProvider(type=ApiCouponSqlProvider.class, method="selectByExample") + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="type", property="type", jdbcType=JdbcType.INTEGER), + @Result(column="goods_type", property="goodsType", jdbcType=JdbcType.VARCHAR), + @Result(column="name", property="name", jdbcType=JdbcType.VARCHAR), + @Result(column="code", property="code", jdbcType=JdbcType.VARCHAR), + @Result(column="desc", property="desc", jdbcType=JdbcType.VARCHAR), + @Result(column="price", property="price", jdbcType=JdbcType.INTEGER), + @Result(column="img", property="img", jdbcType=JdbcType.VARCHAR), + @Result(column="effective_days", property="effectiveDays", jdbcType=JdbcType.INTEGER), + @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="status", property="status", jdbcType=JdbcType.INTEGER), + @Result(column="op_id", property="opId", jdbcType=JdbcType.BIGINT), + @Result(column="op_name", property="opName", jdbcType=JdbcType.VARCHAR), + @Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), + @Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR), + @Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR) + }) + List selectByExample(ApiCouponExample example); + + @Select({ + "select", + "id, `type`, goods_type, `name`, code, `desc`, price, img, effective_days, create_time, ", + "update_time, `status`, op_id, op_name, ext_1, ext_2, ext_3", + "from api_coupon", + "where id = #{id,jdbcType=BIGINT}" + }) + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="type", property="type", jdbcType=JdbcType.INTEGER), + @Result(column="goods_type", property="goodsType", jdbcType=JdbcType.VARCHAR), + @Result(column="name", property="name", jdbcType=JdbcType.VARCHAR), + @Result(column="code", property="code", jdbcType=JdbcType.VARCHAR), + @Result(column="desc", property="desc", jdbcType=JdbcType.VARCHAR), + @Result(column="price", property="price", jdbcType=JdbcType.INTEGER), + @Result(column="img", property="img", jdbcType=JdbcType.VARCHAR), + @Result(column="effective_days", property="effectiveDays", jdbcType=JdbcType.INTEGER), + @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="status", property="status", jdbcType=JdbcType.INTEGER), + @Result(column="op_id", property="opId", jdbcType=JdbcType.BIGINT), + @Result(column="op_name", property="opName", jdbcType=JdbcType.VARCHAR), + @Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), + @Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR), + @Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR) + }) + ApiCoupon selectByPrimaryKey(Long id); + + @UpdateProvider(type=ApiCouponSqlProvider.class, method="updateByExampleSelective") + int updateByExampleSelective(@Param("record") ApiCoupon record, @Param("example") ApiCouponExample example); + + @UpdateProvider(type=ApiCouponSqlProvider.class, method="updateByExample") + int updateByExample(@Param("record") ApiCoupon record, @Param("example") ApiCouponExample example); + + @UpdateProvider(type=ApiCouponSqlProvider.class, method="updateByPrimaryKeySelective") + int updateByPrimaryKeySelective(ApiCoupon record); + + @Update({ + "update api_coupon", + "set `type` = #{type,jdbcType=INTEGER},", + "goods_type = #{goodsType,jdbcType=VARCHAR},", + "`name` = #{name,jdbcType=VARCHAR},", + "code = #{code,jdbcType=VARCHAR},", + "`desc` = #{desc,jdbcType=VARCHAR},", + "price = #{price,jdbcType=INTEGER},", + "img = #{img,jdbcType=VARCHAR},", + "effective_days = #{effectiveDays,jdbcType=INTEGER},", + "create_time = #{createTime,jdbcType=TIMESTAMP},", + "update_time = #{updateTime,jdbcType=TIMESTAMP},", + "`status` = #{status,jdbcType=INTEGER},", + "op_id = #{opId,jdbcType=BIGINT},", + "op_name = #{opName,jdbcType=VARCHAR},", + "ext_1 = #{ext1,jdbcType=VARCHAR},", + "ext_2 = #{ext2,jdbcType=VARCHAR},", + "ext_3 = #{ext3,jdbcType=VARCHAR}", + "where id = #{id,jdbcType=BIGINT}" + }) + int updateByPrimaryKey(ApiCoupon record); +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/dao/ApiCouponMapperExt.java b/hai-service/src/main/java/com/hai/dao/ApiCouponMapperExt.java new file mode 100644 index 00000000..728b6f4b --- /dev/null +++ b/hai-service/src/main/java/com/hai/dao/ApiCouponMapperExt.java @@ -0,0 +1,7 @@ +package com.hai.dao; + +/** + * mapper扩展类 + */ +public interface ApiCouponMapperExt { +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/dao/ApiCouponSqlProvider.java b/hai-service/src/main/java/com/hai/dao/ApiCouponSqlProvider.java new file mode 100644 index 00000000..934b55bd --- /dev/null +++ b/hai-service/src/main/java/com/hai/dao/ApiCouponSqlProvider.java @@ -0,0 +1,402 @@ +package com.hai.dao; + +import com.hai.entity.ApiCoupon; +import com.hai.entity.ApiCouponExample.Criteria; +import com.hai.entity.ApiCouponExample.Criterion; +import com.hai.entity.ApiCouponExample; +import java.util.List; +import java.util.Map; +import org.apache.ibatis.jdbc.SQL; + +public class ApiCouponSqlProvider { + + public String countByExample(ApiCouponExample example) { + SQL sql = new SQL(); + sql.SELECT("count(*)").FROM("api_coupon"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String deleteByExample(ApiCouponExample example) { + SQL sql = new SQL(); + sql.DELETE_FROM("api_coupon"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String insertSelective(ApiCoupon record) { + SQL sql = new SQL(); + sql.INSERT_INTO("api_coupon"); + + if (record.getType() != null) { + sql.VALUES("`type`", "#{type,jdbcType=INTEGER}"); + } + + if (record.getGoodsType() != null) { + sql.VALUES("goods_type", "#{goodsType,jdbcType=VARCHAR}"); + } + + if (record.getName() != null) { + sql.VALUES("`name`", "#{name,jdbcType=VARCHAR}"); + } + + if (record.getCode() != null) { + sql.VALUES("code", "#{code,jdbcType=VARCHAR}"); + } + + if (record.getDesc() != null) { + sql.VALUES("`desc`", "#{desc,jdbcType=VARCHAR}"); + } + + if (record.getPrice() != null) { + sql.VALUES("price", "#{price,jdbcType=INTEGER}"); + } + + if (record.getImg() != null) { + sql.VALUES("img", "#{img,jdbcType=VARCHAR}"); + } + + if (record.getEffectiveDays() != null) { + sql.VALUES("effective_days", "#{effectiveDays,jdbcType=INTEGER}"); + } + + if (record.getCreateTime() != null) { + sql.VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}"); + } + + if (record.getUpdateTime() != null) { + sql.VALUES("update_time", "#{updateTime,jdbcType=TIMESTAMP}"); + } + + if (record.getStatus() != null) { + sql.VALUES("`status`", "#{status,jdbcType=INTEGER}"); + } + + if (record.getOpId() != null) { + sql.VALUES("op_id", "#{opId,jdbcType=BIGINT}"); + } + + if (record.getOpName() != null) { + sql.VALUES("op_name", "#{opName,jdbcType=VARCHAR}"); + } + + if (record.getExt1() != null) { + sql.VALUES("ext_1", "#{ext1,jdbcType=VARCHAR}"); + } + + if (record.getExt2() != null) { + sql.VALUES("ext_2", "#{ext2,jdbcType=VARCHAR}"); + } + + if (record.getExt3() != null) { + sql.VALUES("ext_3", "#{ext3,jdbcType=VARCHAR}"); + } + + return sql.toString(); + } + + public String selectByExample(ApiCouponExample example) { + SQL sql = new SQL(); + if (example != null && example.isDistinct()) { + sql.SELECT_DISTINCT("id"); + } else { + sql.SELECT("id"); + } + sql.SELECT("`type`"); + sql.SELECT("goods_type"); + sql.SELECT("`name`"); + sql.SELECT("code"); + sql.SELECT("`desc`"); + sql.SELECT("price"); + sql.SELECT("img"); + sql.SELECT("effective_days"); + sql.SELECT("create_time"); + sql.SELECT("update_time"); + sql.SELECT("`status`"); + sql.SELECT("op_id"); + sql.SELECT("op_name"); + sql.SELECT("ext_1"); + sql.SELECT("ext_2"); + sql.SELECT("ext_3"); + sql.FROM("api_coupon"); + applyWhere(sql, example, false); + + if (example != null && example.getOrderByClause() != null) { + sql.ORDER_BY(example.getOrderByClause()); + } + + return sql.toString(); + } + + public String updateByExampleSelective(Map parameter) { + ApiCoupon record = (ApiCoupon) parameter.get("record"); + ApiCouponExample example = (ApiCouponExample) parameter.get("example"); + + SQL sql = new SQL(); + sql.UPDATE("api_coupon"); + + if (record.getId() != null) { + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + } + + if (record.getType() != null) { + sql.SET("`type` = #{record.type,jdbcType=INTEGER}"); + } + + if (record.getGoodsType() != null) { + sql.SET("goods_type = #{record.goodsType,jdbcType=VARCHAR}"); + } + + if (record.getName() != null) { + sql.SET("`name` = #{record.name,jdbcType=VARCHAR}"); + } + + if (record.getCode() != null) { + sql.SET("code = #{record.code,jdbcType=VARCHAR}"); + } + + if (record.getDesc() != null) { + sql.SET("`desc` = #{record.desc,jdbcType=VARCHAR}"); + } + + if (record.getPrice() != null) { + sql.SET("price = #{record.price,jdbcType=INTEGER}"); + } + + if (record.getImg() != null) { + sql.SET("img = #{record.img,jdbcType=VARCHAR}"); + } + + if (record.getEffectiveDays() != null) { + sql.SET("effective_days = #{record.effectiveDays,jdbcType=INTEGER}"); + } + + if (record.getCreateTime() != null) { + sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); + } + + if (record.getUpdateTime() != null) { + sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}"); + } + + if (record.getStatus() != null) { + sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); + } + + if (record.getOpId() != null) { + sql.SET("op_id = #{record.opId,jdbcType=BIGINT}"); + } + + if (record.getOpName() != null) { + sql.SET("op_name = #{record.opName,jdbcType=VARCHAR}"); + } + + if (record.getExt1() != null) { + sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); + } + + if (record.getExt2() != null) { + sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); + } + + if (record.getExt3() != null) { + sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); + } + + applyWhere(sql, example, true); + return sql.toString(); + } + + public String updateByExample(Map parameter) { + SQL sql = new SQL(); + sql.UPDATE("api_coupon"); + + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + sql.SET("`type` = #{record.type,jdbcType=INTEGER}"); + sql.SET("goods_type = #{record.goodsType,jdbcType=VARCHAR}"); + sql.SET("`name` = #{record.name,jdbcType=VARCHAR}"); + sql.SET("code = #{record.code,jdbcType=VARCHAR}"); + sql.SET("`desc` = #{record.desc,jdbcType=VARCHAR}"); + sql.SET("price = #{record.price,jdbcType=INTEGER}"); + sql.SET("img = #{record.img,jdbcType=VARCHAR}"); + sql.SET("effective_days = #{record.effectiveDays,jdbcType=INTEGER}"); + sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); + sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}"); + sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); + sql.SET("op_id = #{record.opId,jdbcType=BIGINT}"); + sql.SET("op_name = #{record.opName,jdbcType=VARCHAR}"); + sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); + sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); + sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); + + ApiCouponExample example = (ApiCouponExample) parameter.get("example"); + applyWhere(sql, example, true); + return sql.toString(); + } + + public String updateByPrimaryKeySelective(ApiCoupon record) { + SQL sql = new SQL(); + sql.UPDATE("api_coupon"); + + if (record.getType() != null) { + sql.SET("`type` = #{type,jdbcType=INTEGER}"); + } + + if (record.getGoodsType() != null) { + sql.SET("goods_type = #{goodsType,jdbcType=VARCHAR}"); + } + + if (record.getName() != null) { + sql.SET("`name` = #{name,jdbcType=VARCHAR}"); + } + + if (record.getCode() != null) { + sql.SET("code = #{code,jdbcType=VARCHAR}"); + } + + if (record.getDesc() != null) { + sql.SET("`desc` = #{desc,jdbcType=VARCHAR}"); + } + + if (record.getPrice() != null) { + sql.SET("price = #{price,jdbcType=INTEGER}"); + } + + if (record.getImg() != null) { + sql.SET("img = #{img,jdbcType=VARCHAR}"); + } + + if (record.getEffectiveDays() != null) { + sql.SET("effective_days = #{effectiveDays,jdbcType=INTEGER}"); + } + + if (record.getCreateTime() != null) { + sql.SET("create_time = #{createTime,jdbcType=TIMESTAMP}"); + } + + if (record.getUpdateTime() != null) { + sql.SET("update_time = #{updateTime,jdbcType=TIMESTAMP}"); + } + + if (record.getStatus() != null) { + sql.SET("`status` = #{status,jdbcType=INTEGER}"); + } + + if (record.getOpId() != null) { + sql.SET("op_id = #{opId,jdbcType=BIGINT}"); + } + + if (record.getOpName() != null) { + sql.SET("op_name = #{opName,jdbcType=VARCHAR}"); + } + + if (record.getExt1() != null) { + sql.SET("ext_1 = #{ext1,jdbcType=VARCHAR}"); + } + + if (record.getExt2() != null) { + sql.SET("ext_2 = #{ext2,jdbcType=VARCHAR}"); + } + + if (record.getExt3() != null) { + sql.SET("ext_3 = #{ext3,jdbcType=VARCHAR}"); + } + + sql.WHERE("id = #{id,jdbcType=BIGINT}"); + + return sql.toString(); + } + + protected void applyWhere(SQL sql, ApiCouponExample example, boolean includeExamplePhrase) { + if (example == null) { + return; + } + + String parmPhrase1; + String parmPhrase1_th; + String parmPhrase2; + String parmPhrase2_th; + String parmPhrase3; + String parmPhrase3_th; + if (includeExamplePhrase) { + parmPhrase1 = "%s #{example.oredCriteria[%d].allCriteria[%d].value}"; + parmPhrase1_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}"; + parmPhrase2 = "%s #{example.oredCriteria[%d].allCriteria[%d].value} and #{example.oredCriteria[%d].criteria[%d].secondValue}"; + parmPhrase2_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{example.oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}"; + parmPhrase3 = "#{example.oredCriteria[%d].allCriteria[%d].value[%d]}"; + parmPhrase3_th = "#{example.oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}"; + } else { + parmPhrase1 = "%s #{oredCriteria[%d].allCriteria[%d].value}"; + parmPhrase1_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}"; + parmPhrase2 = "%s #{oredCriteria[%d].allCriteria[%d].value} and #{oredCriteria[%d].criteria[%d].secondValue}"; + parmPhrase2_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}"; + parmPhrase3 = "#{oredCriteria[%d].allCriteria[%d].value[%d]}"; + parmPhrase3_th = "#{oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}"; + } + + StringBuilder sb = new StringBuilder(); + List oredCriteria = example.getOredCriteria(); + boolean firstCriteria = true; + for (int i = 0; i < oredCriteria.size(); i++) { + Criteria criteria = oredCriteria.get(i); + if (criteria.isValid()) { + if (firstCriteria) { + firstCriteria = false; + } else { + sb.append(" or "); + } + + sb.append('('); + List criterions = criteria.getAllCriteria(); + boolean firstCriterion = true; + for (int j = 0; j < criterions.size(); j++) { + Criterion criterion = criterions.get(j); + if (firstCriterion) { + firstCriterion = false; + } else { + sb.append(" and "); + } + + if (criterion.isNoValue()) { + sb.append(criterion.getCondition()); + } else if (criterion.isSingleValue()) { + if (criterion.getTypeHandler() == null) { + sb.append(String.format(parmPhrase1, criterion.getCondition(), i, j)); + } else { + sb.append(String.format(parmPhrase1_th, criterion.getCondition(), i, j,criterion.getTypeHandler())); + } + } else if (criterion.isBetweenValue()) { + if (criterion.getTypeHandler() == null) { + sb.append(String.format(parmPhrase2, criterion.getCondition(), i, j, i, j)); + } else { + sb.append(String.format(parmPhrase2_th, criterion.getCondition(), i, j, criterion.getTypeHandler(), i, j, criterion.getTypeHandler())); + } + } else if (criterion.isListValue()) { + sb.append(criterion.getCondition()); + sb.append(" ("); + List listItems = (List) criterion.getValue(); + boolean comma = false; + for (int k = 0; k < listItems.size(); k++) { + if (comma) { + sb.append(", "); + } else { + comma = true; + } + if (criterion.getTypeHandler() == null) { + sb.append(String.format(parmPhrase3, i, j, k)); + } else { + sb.append(String.format(parmPhrase3_th, i, j, k, criterion.getTypeHandler())); + } + } + sb.append(')'); + } + } + sb.append(')'); + } + } + + if (sb.length() > 0) { + sql.WHERE(sb.toString()); + } + } +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/dao/HighDiscountPackageAgentCodeMapper.java b/hai-service/src/main/java/com/hai/dao/HighDiscountPackageAgentCodeMapper.java new file mode 100644 index 00000000..3effec8a --- /dev/null +++ b/hai-service/src/main/java/com/hai/dao/HighDiscountPackageAgentCodeMapper.java @@ -0,0 +1,148 @@ +package com.hai.dao; + +import com.hai.entity.HighDiscountPackageAgentCode; +import com.hai.entity.HighDiscountPackageAgentCodeExample; +import java.util.List; +import org.apache.ibatis.annotations.Delete; +import org.apache.ibatis.annotations.DeleteProvider; +import org.apache.ibatis.annotations.Insert; +import org.apache.ibatis.annotations.InsertProvider; +import org.apache.ibatis.annotations.Options; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Result; +import org.apache.ibatis.annotations.Results; +import org.apache.ibatis.annotations.Select; +import org.apache.ibatis.annotations.SelectProvider; +import org.apache.ibatis.annotations.Update; +import org.apache.ibatis.annotations.UpdateProvider; +import org.apache.ibatis.type.JdbcType; +import org.springframework.stereotype.Repository; + +/** + * + * 代码由工具生成,请勿修改!!! + * 如果需要扩展请在其父类进行扩展 + * + **/ +@Repository +public interface HighDiscountPackageAgentCodeMapper extends HighDiscountPackageAgentCodeMapperExt { + @SelectProvider(type=HighDiscountPackageAgentCodeSqlProvider.class, method="countByExample") + long countByExample(HighDiscountPackageAgentCodeExample example); + + @DeleteProvider(type=HighDiscountPackageAgentCodeSqlProvider.class, method="deleteByExample") + int deleteByExample(HighDiscountPackageAgentCodeExample example); + + @Delete({ + "delete from high_discount_package_agent_code", + "where id = #{id,jdbcType=BIGINT}" + }) + int deleteByPrimaryKey(Long id); + + @Insert({ + "insert into high_discount_package_agent_code (discount_package_id, discount_package_name, ", + "agent_id, agent_name, ", + "discount_package_actual_id, discount_agent_batch_id, ", + "code, qr_code, qr_code_url, ", + "create_time, update_time, ", + "`status`, op_id, op_name, ", + "ext_1, ext_2, ext_3)", + "values (#{discountPackageId,jdbcType=BIGINT}, #{discountPackageName,jdbcType=VARCHAR}, ", + "#{agentId,jdbcType=BIGINT}, #{agentName,jdbcType=VARCHAR}, ", + "#{discountPackageActualId,jdbcType=BIGINT}, #{discountAgentBatchId,jdbcType=BIGINT}, ", + "#{code,jdbcType=VARCHAR}, #{qrCode,jdbcType=VARCHAR}, #{qrCodeUrl,jdbcType=VARCHAR}, ", + "#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ", + "#{status,jdbcType=INTEGER}, #{opId,jdbcType=BIGINT}, #{opName,jdbcType=VARCHAR}, ", + "#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" + }) + @Options(useGeneratedKeys=true,keyProperty="id") + int insert(HighDiscountPackageAgentCode record); + + @InsertProvider(type=HighDiscountPackageAgentCodeSqlProvider.class, method="insertSelective") + @Options(useGeneratedKeys=true,keyProperty="id") + int insertSelective(HighDiscountPackageAgentCode record); + + @SelectProvider(type=HighDiscountPackageAgentCodeSqlProvider.class, method="selectByExample") + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="discount_package_id", property="discountPackageId", jdbcType=JdbcType.BIGINT), + @Result(column="discount_package_name", property="discountPackageName", jdbcType=JdbcType.VARCHAR), + @Result(column="agent_id", property="agentId", jdbcType=JdbcType.BIGINT), + @Result(column="agent_name", property="agentName", jdbcType=JdbcType.VARCHAR), + @Result(column="discount_package_actual_id", property="discountPackageActualId", jdbcType=JdbcType.BIGINT), + @Result(column="discount_agent_batch_id", property="discountAgentBatchId", jdbcType=JdbcType.BIGINT), + @Result(column="code", property="code", jdbcType=JdbcType.VARCHAR), + @Result(column="qr_code", property="qrCode", jdbcType=JdbcType.VARCHAR), + @Result(column="qr_code_url", property="qrCodeUrl", jdbcType=JdbcType.VARCHAR), + @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="status", property="status", jdbcType=JdbcType.INTEGER), + @Result(column="op_id", property="opId", jdbcType=JdbcType.BIGINT), + @Result(column="op_name", property="opName", jdbcType=JdbcType.VARCHAR), + @Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), + @Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR), + @Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR) + }) + List selectByExample(HighDiscountPackageAgentCodeExample example); + + @Select({ + "select", + "id, discount_package_id, discount_package_name, agent_id, agent_name, discount_package_actual_id, ", + "discount_agent_batch_id, code, qr_code, qr_code_url, create_time, update_time, ", + "`status`, op_id, op_name, ext_1, ext_2, ext_3", + "from high_discount_package_agent_code", + "where id = #{id,jdbcType=BIGINT}" + }) + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="discount_package_id", property="discountPackageId", jdbcType=JdbcType.BIGINT), + @Result(column="discount_package_name", property="discountPackageName", jdbcType=JdbcType.VARCHAR), + @Result(column="agent_id", property="agentId", jdbcType=JdbcType.BIGINT), + @Result(column="agent_name", property="agentName", jdbcType=JdbcType.VARCHAR), + @Result(column="discount_package_actual_id", property="discountPackageActualId", jdbcType=JdbcType.BIGINT), + @Result(column="discount_agent_batch_id", property="discountAgentBatchId", jdbcType=JdbcType.BIGINT), + @Result(column="code", property="code", jdbcType=JdbcType.VARCHAR), + @Result(column="qr_code", property="qrCode", jdbcType=JdbcType.VARCHAR), + @Result(column="qr_code_url", property="qrCodeUrl", jdbcType=JdbcType.VARCHAR), + @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="status", property="status", jdbcType=JdbcType.INTEGER), + @Result(column="op_id", property="opId", jdbcType=JdbcType.BIGINT), + @Result(column="op_name", property="opName", jdbcType=JdbcType.VARCHAR), + @Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), + @Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR), + @Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR) + }) + HighDiscountPackageAgentCode selectByPrimaryKey(Long id); + + @UpdateProvider(type=HighDiscountPackageAgentCodeSqlProvider.class, method="updateByExampleSelective") + int updateByExampleSelective(@Param("record") HighDiscountPackageAgentCode record, @Param("example") HighDiscountPackageAgentCodeExample example); + + @UpdateProvider(type=HighDiscountPackageAgentCodeSqlProvider.class, method="updateByExample") + int updateByExample(@Param("record") HighDiscountPackageAgentCode record, @Param("example") HighDiscountPackageAgentCodeExample example); + + @UpdateProvider(type=HighDiscountPackageAgentCodeSqlProvider.class, method="updateByPrimaryKeySelective") + int updateByPrimaryKeySelective(HighDiscountPackageAgentCode record); + + @Update({ + "update high_discount_package_agent_code", + "set discount_package_id = #{discountPackageId,jdbcType=BIGINT},", + "discount_package_name = #{discountPackageName,jdbcType=VARCHAR},", + "agent_id = #{agentId,jdbcType=BIGINT},", + "agent_name = #{agentName,jdbcType=VARCHAR},", + "discount_package_actual_id = #{discountPackageActualId,jdbcType=BIGINT},", + "discount_agent_batch_id = #{discountAgentBatchId,jdbcType=BIGINT},", + "code = #{code,jdbcType=VARCHAR},", + "qr_code = #{qrCode,jdbcType=VARCHAR},", + "qr_code_url = #{qrCodeUrl,jdbcType=VARCHAR},", + "create_time = #{createTime,jdbcType=TIMESTAMP},", + "update_time = #{updateTime,jdbcType=TIMESTAMP},", + "`status` = #{status,jdbcType=INTEGER},", + "op_id = #{opId,jdbcType=BIGINT},", + "op_name = #{opName,jdbcType=VARCHAR},", + "ext_1 = #{ext1,jdbcType=VARCHAR},", + "ext_2 = #{ext2,jdbcType=VARCHAR},", + "ext_3 = #{ext3,jdbcType=VARCHAR}", + "where id = #{id,jdbcType=BIGINT}" + }) + int updateByPrimaryKey(HighDiscountPackageAgentCode record); +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/dao/HighDiscountPackageAgentCodeMapperExt.java b/hai-service/src/main/java/com/hai/dao/HighDiscountPackageAgentCodeMapperExt.java new file mode 100644 index 00000000..258a25c8 --- /dev/null +++ b/hai-service/src/main/java/com/hai/dao/HighDiscountPackageAgentCodeMapperExt.java @@ -0,0 +1,7 @@ +package com.hai.dao; + +/** + * mapper扩展类 + */ +public interface HighDiscountPackageAgentCodeMapperExt { +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/dao/HighDiscountPackageAgentCodeSqlProvider.java b/hai-service/src/main/java/com/hai/dao/HighDiscountPackageAgentCodeSqlProvider.java new file mode 100644 index 00000000..e4206c82 --- /dev/null +++ b/hai-service/src/main/java/com/hai/dao/HighDiscountPackageAgentCodeSqlProvider.java @@ -0,0 +1,416 @@ +package com.hai.dao; + +import com.hai.entity.HighDiscountPackageAgentCode; +import com.hai.entity.HighDiscountPackageAgentCodeExample.Criteria; +import com.hai.entity.HighDiscountPackageAgentCodeExample.Criterion; +import com.hai.entity.HighDiscountPackageAgentCodeExample; +import java.util.List; +import java.util.Map; +import org.apache.ibatis.jdbc.SQL; + +public class HighDiscountPackageAgentCodeSqlProvider { + + public String countByExample(HighDiscountPackageAgentCodeExample example) { + SQL sql = new SQL(); + sql.SELECT("count(*)").FROM("high_discount_package_agent_code"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String deleteByExample(HighDiscountPackageAgentCodeExample example) { + SQL sql = new SQL(); + sql.DELETE_FROM("high_discount_package_agent_code"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String insertSelective(HighDiscountPackageAgentCode record) { + SQL sql = new SQL(); + sql.INSERT_INTO("high_discount_package_agent_code"); + + if (record.getDiscountPackageId() != null) { + sql.VALUES("discount_package_id", "#{discountPackageId,jdbcType=BIGINT}"); + } + + if (record.getDiscountPackageName() != null) { + sql.VALUES("discount_package_name", "#{discountPackageName,jdbcType=VARCHAR}"); + } + + if (record.getAgentId() != null) { + sql.VALUES("agent_id", "#{agentId,jdbcType=BIGINT}"); + } + + if (record.getAgentName() != null) { + sql.VALUES("agent_name", "#{agentName,jdbcType=VARCHAR}"); + } + + if (record.getDiscountPackageActualId() != null) { + sql.VALUES("discount_package_actual_id", "#{discountPackageActualId,jdbcType=BIGINT}"); + } + + if (record.getDiscountAgentBatchId() != null) { + sql.VALUES("discount_agent_batch_id", "#{discountAgentBatchId,jdbcType=BIGINT}"); + } + + if (record.getCode() != null) { + sql.VALUES("code", "#{code,jdbcType=VARCHAR}"); + } + + if (record.getQrCode() != null) { + sql.VALUES("qr_code", "#{qrCode,jdbcType=VARCHAR}"); + } + + if (record.getQrCodeUrl() != null) { + sql.VALUES("qr_code_url", "#{qrCodeUrl,jdbcType=VARCHAR}"); + } + + if (record.getCreateTime() != null) { + sql.VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}"); + } + + if (record.getUpdateTime() != null) { + sql.VALUES("update_time", "#{updateTime,jdbcType=TIMESTAMP}"); + } + + if (record.getStatus() != null) { + sql.VALUES("`status`", "#{status,jdbcType=INTEGER}"); + } + + if (record.getOpId() != null) { + sql.VALUES("op_id", "#{opId,jdbcType=BIGINT}"); + } + + if (record.getOpName() != null) { + sql.VALUES("op_name", "#{opName,jdbcType=VARCHAR}"); + } + + if (record.getExt1() != null) { + sql.VALUES("ext_1", "#{ext1,jdbcType=VARCHAR}"); + } + + if (record.getExt2() != null) { + sql.VALUES("ext_2", "#{ext2,jdbcType=VARCHAR}"); + } + + if (record.getExt3() != null) { + sql.VALUES("ext_3", "#{ext3,jdbcType=VARCHAR}"); + } + + return sql.toString(); + } + + public String selectByExample(HighDiscountPackageAgentCodeExample example) { + SQL sql = new SQL(); + if (example != null && example.isDistinct()) { + sql.SELECT_DISTINCT("id"); + } else { + sql.SELECT("id"); + } + sql.SELECT("discount_package_id"); + sql.SELECT("discount_package_name"); + sql.SELECT("agent_id"); + sql.SELECT("agent_name"); + sql.SELECT("discount_package_actual_id"); + sql.SELECT("discount_agent_batch_id"); + sql.SELECT("code"); + sql.SELECT("qr_code"); + sql.SELECT("qr_code_url"); + sql.SELECT("create_time"); + sql.SELECT("update_time"); + sql.SELECT("`status`"); + sql.SELECT("op_id"); + sql.SELECT("op_name"); + sql.SELECT("ext_1"); + sql.SELECT("ext_2"); + sql.SELECT("ext_3"); + sql.FROM("high_discount_package_agent_code"); + applyWhere(sql, example, false); + + if (example != null && example.getOrderByClause() != null) { + sql.ORDER_BY(example.getOrderByClause()); + } + + return sql.toString(); + } + + public String updateByExampleSelective(Map parameter) { + HighDiscountPackageAgentCode record = (HighDiscountPackageAgentCode) parameter.get("record"); + HighDiscountPackageAgentCodeExample example = (HighDiscountPackageAgentCodeExample) parameter.get("example"); + + SQL sql = new SQL(); + sql.UPDATE("high_discount_package_agent_code"); + + if (record.getId() != null) { + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + } + + if (record.getDiscountPackageId() != null) { + sql.SET("discount_package_id = #{record.discountPackageId,jdbcType=BIGINT}"); + } + + if (record.getDiscountPackageName() != null) { + sql.SET("discount_package_name = #{record.discountPackageName,jdbcType=VARCHAR}"); + } + + if (record.getAgentId() != null) { + sql.SET("agent_id = #{record.agentId,jdbcType=BIGINT}"); + } + + if (record.getAgentName() != null) { + sql.SET("agent_name = #{record.agentName,jdbcType=VARCHAR}"); + } + + if (record.getDiscountPackageActualId() != null) { + sql.SET("discount_package_actual_id = #{record.discountPackageActualId,jdbcType=BIGINT}"); + } + + if (record.getDiscountAgentBatchId() != null) { + sql.SET("discount_agent_batch_id = #{record.discountAgentBatchId,jdbcType=BIGINT}"); + } + + if (record.getCode() != null) { + sql.SET("code = #{record.code,jdbcType=VARCHAR}"); + } + + if (record.getQrCode() != null) { + sql.SET("qr_code = #{record.qrCode,jdbcType=VARCHAR}"); + } + + if (record.getQrCodeUrl() != null) { + sql.SET("qr_code_url = #{record.qrCodeUrl,jdbcType=VARCHAR}"); + } + + if (record.getCreateTime() != null) { + sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); + } + + if (record.getUpdateTime() != null) { + sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}"); + } + + if (record.getStatus() != null) { + sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); + } + + if (record.getOpId() != null) { + sql.SET("op_id = #{record.opId,jdbcType=BIGINT}"); + } + + if (record.getOpName() != null) { + sql.SET("op_name = #{record.opName,jdbcType=VARCHAR}"); + } + + if (record.getExt1() != null) { + sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); + } + + if (record.getExt2() != null) { + sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); + } + + if (record.getExt3() != null) { + sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); + } + + applyWhere(sql, example, true); + return sql.toString(); + } + + public String updateByExample(Map parameter) { + SQL sql = new SQL(); + sql.UPDATE("high_discount_package_agent_code"); + + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + sql.SET("discount_package_id = #{record.discountPackageId,jdbcType=BIGINT}"); + sql.SET("discount_package_name = #{record.discountPackageName,jdbcType=VARCHAR}"); + sql.SET("agent_id = #{record.agentId,jdbcType=BIGINT}"); + sql.SET("agent_name = #{record.agentName,jdbcType=VARCHAR}"); + sql.SET("discount_package_actual_id = #{record.discountPackageActualId,jdbcType=BIGINT}"); + sql.SET("discount_agent_batch_id = #{record.discountAgentBatchId,jdbcType=BIGINT}"); + sql.SET("code = #{record.code,jdbcType=VARCHAR}"); + sql.SET("qr_code = #{record.qrCode,jdbcType=VARCHAR}"); + sql.SET("qr_code_url = #{record.qrCodeUrl,jdbcType=VARCHAR}"); + sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); + sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}"); + sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); + sql.SET("op_id = #{record.opId,jdbcType=BIGINT}"); + sql.SET("op_name = #{record.opName,jdbcType=VARCHAR}"); + sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); + sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); + sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); + + HighDiscountPackageAgentCodeExample example = (HighDiscountPackageAgentCodeExample) parameter.get("example"); + applyWhere(sql, example, true); + return sql.toString(); + } + + public String updateByPrimaryKeySelective(HighDiscountPackageAgentCode record) { + SQL sql = new SQL(); + sql.UPDATE("high_discount_package_agent_code"); + + if (record.getDiscountPackageId() != null) { + sql.SET("discount_package_id = #{discountPackageId,jdbcType=BIGINT}"); + } + + if (record.getDiscountPackageName() != null) { + sql.SET("discount_package_name = #{discountPackageName,jdbcType=VARCHAR}"); + } + + if (record.getAgentId() != null) { + sql.SET("agent_id = #{agentId,jdbcType=BIGINT}"); + } + + if (record.getAgentName() != null) { + sql.SET("agent_name = #{agentName,jdbcType=VARCHAR}"); + } + + if (record.getDiscountPackageActualId() != null) { + sql.SET("discount_package_actual_id = #{discountPackageActualId,jdbcType=BIGINT}"); + } + + if (record.getDiscountAgentBatchId() != null) { + sql.SET("discount_agent_batch_id = #{discountAgentBatchId,jdbcType=BIGINT}"); + } + + if (record.getCode() != null) { + sql.SET("code = #{code,jdbcType=VARCHAR}"); + } + + if (record.getQrCode() != null) { + sql.SET("qr_code = #{qrCode,jdbcType=VARCHAR}"); + } + + if (record.getQrCodeUrl() != null) { + sql.SET("qr_code_url = #{qrCodeUrl,jdbcType=VARCHAR}"); + } + + if (record.getCreateTime() != null) { + sql.SET("create_time = #{createTime,jdbcType=TIMESTAMP}"); + } + + if (record.getUpdateTime() != null) { + sql.SET("update_time = #{updateTime,jdbcType=TIMESTAMP}"); + } + + if (record.getStatus() != null) { + sql.SET("`status` = #{status,jdbcType=INTEGER}"); + } + + if (record.getOpId() != null) { + sql.SET("op_id = #{opId,jdbcType=BIGINT}"); + } + + if (record.getOpName() != null) { + sql.SET("op_name = #{opName,jdbcType=VARCHAR}"); + } + + if (record.getExt1() != null) { + sql.SET("ext_1 = #{ext1,jdbcType=VARCHAR}"); + } + + if (record.getExt2() != null) { + sql.SET("ext_2 = #{ext2,jdbcType=VARCHAR}"); + } + + if (record.getExt3() != null) { + sql.SET("ext_3 = #{ext3,jdbcType=VARCHAR}"); + } + + sql.WHERE("id = #{id,jdbcType=BIGINT}"); + + return sql.toString(); + } + + protected void applyWhere(SQL sql, HighDiscountPackageAgentCodeExample example, boolean includeExamplePhrase) { + if (example == null) { + return; + } + + String parmPhrase1; + String parmPhrase1_th; + String parmPhrase2; + String parmPhrase2_th; + String parmPhrase3; + String parmPhrase3_th; + if (includeExamplePhrase) { + parmPhrase1 = "%s #{example.oredCriteria[%d].allCriteria[%d].value}"; + parmPhrase1_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}"; + parmPhrase2 = "%s #{example.oredCriteria[%d].allCriteria[%d].value} and #{example.oredCriteria[%d].criteria[%d].secondValue}"; + parmPhrase2_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{example.oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}"; + parmPhrase3 = "#{example.oredCriteria[%d].allCriteria[%d].value[%d]}"; + parmPhrase3_th = "#{example.oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}"; + } else { + parmPhrase1 = "%s #{oredCriteria[%d].allCriteria[%d].value}"; + parmPhrase1_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}"; + parmPhrase2 = "%s #{oredCriteria[%d].allCriteria[%d].value} and #{oredCriteria[%d].criteria[%d].secondValue}"; + parmPhrase2_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}"; + parmPhrase3 = "#{oredCriteria[%d].allCriteria[%d].value[%d]}"; + parmPhrase3_th = "#{oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}"; + } + + StringBuilder sb = new StringBuilder(); + List oredCriteria = example.getOredCriteria(); + boolean firstCriteria = true; + for (int i = 0; i < oredCriteria.size(); i++) { + Criteria criteria = oredCriteria.get(i); + if (criteria.isValid()) { + if (firstCriteria) { + firstCriteria = false; + } else { + sb.append(" or "); + } + + sb.append('('); + List criterions = criteria.getAllCriteria(); + boolean firstCriterion = true; + for (int j = 0; j < criterions.size(); j++) { + Criterion criterion = criterions.get(j); + if (firstCriterion) { + firstCriterion = false; + } else { + sb.append(" and "); + } + + if (criterion.isNoValue()) { + sb.append(criterion.getCondition()); + } else if (criterion.isSingleValue()) { + if (criterion.getTypeHandler() == null) { + sb.append(String.format(parmPhrase1, criterion.getCondition(), i, j)); + } else { + sb.append(String.format(parmPhrase1_th, criterion.getCondition(), i, j,criterion.getTypeHandler())); + } + } else if (criterion.isBetweenValue()) { + if (criterion.getTypeHandler() == null) { + sb.append(String.format(parmPhrase2, criterion.getCondition(), i, j, i, j)); + } else { + sb.append(String.format(parmPhrase2_th, criterion.getCondition(), i, j, criterion.getTypeHandler(), i, j, criterion.getTypeHandler())); + } + } else if (criterion.isListValue()) { + sb.append(criterion.getCondition()); + sb.append(" ("); + List listItems = (List) criterion.getValue(); + boolean comma = false; + for (int k = 0; k < listItems.size(); k++) { + if (comma) { + sb.append(", "); + } else { + comma = true; + } + if (criterion.getTypeHandler() == null) { + sb.append(String.format(parmPhrase3, i, j, k)); + } else { + sb.append(String.format(parmPhrase3_th, i, j, k, criterion.getTypeHandler())); + } + } + sb.append(')'); + } + } + sb.append(')'); + } + } + + if (sb.length() > 0) { + sql.WHERE(sb.toString()); + } + } +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/dao/HighDiscountPackageAgentRecordMapper.java b/hai-service/src/main/java/com/hai/dao/HighDiscountPackageAgentRecordMapper.java index 85fb9365..fad968e7 100644 --- a/hai-service/src/main/java/com/hai/dao/HighDiscountPackageAgentRecordMapper.java +++ b/hai-service/src/main/java/com/hai/dao/HighDiscountPackageAgentRecordMapper.java @@ -39,16 +39,16 @@ public interface HighDiscountPackageAgentRecordMapper extends HighDiscountPackag int deleteByPrimaryKey(Long id); @Insert({ - "insert into high_discount_package_agent_record (discount_package_title, discount_package_id, ", - "agent_name, agent_id, ", - "`count`, front_count, ", + "insert into high_discount_package_agent_record (`type`, discount_package_title, ", + "discount_package_id, agent_name, ", + "agent_id, `count`, front_count, ", "after_count, create_time, ", "update_time, `status`, ", "op_id, op_name, ext_1, ", "ext_2, ext_3)", - "values (#{discountPackageTitle,jdbcType=VARCHAR}, #{discountPackageId,jdbcType=BIGINT}, ", - "#{agentName,jdbcType=VARCHAR}, #{agentId,jdbcType=BIGINT}, ", - "#{count,jdbcType=INTEGER}, #{frontCount,jdbcType=INTEGER}, ", + "values (#{type,jdbcType=INTEGER}, #{discountPackageTitle,jdbcType=VARCHAR}, ", + "#{discountPackageId,jdbcType=BIGINT}, #{agentName,jdbcType=VARCHAR}, ", + "#{agentId,jdbcType=BIGINT}, #{count,jdbcType=INTEGER}, #{frontCount,jdbcType=INTEGER}, ", "#{afterCount,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, ", "#{updateTime,jdbcType=TIMESTAMP}, #{status,jdbcType=INTEGER}, ", "#{opId,jdbcType=BIGINT}, #{opName,jdbcType=VARCHAR}, #{ext1,jdbcType=VARCHAR}, ", @@ -64,6 +64,7 @@ public interface HighDiscountPackageAgentRecordMapper extends HighDiscountPackag @SelectProvider(type=HighDiscountPackageAgentRecordSqlProvider.class, method="selectByExample") @Results({ @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="type", property="type", jdbcType=JdbcType.INTEGER), @Result(column="discount_package_title", property="discountPackageTitle", jdbcType=JdbcType.VARCHAR), @Result(column="discount_package_id", property="discountPackageId", jdbcType=JdbcType.BIGINT), @Result(column="agent_name", property="agentName", jdbcType=JdbcType.VARCHAR), @@ -84,14 +85,15 @@ public interface HighDiscountPackageAgentRecordMapper extends HighDiscountPackag @Select({ "select", - "id, discount_package_title, discount_package_id, agent_name, agent_id, `count`, ", - "front_count, after_count, create_time, update_time, `status`, op_id, op_name, ", - "ext_1, ext_2, ext_3", + "id, `type`, discount_package_title, discount_package_id, agent_name, agent_id, ", + "`count`, front_count, after_count, create_time, update_time, `status`, op_id, ", + "op_name, ext_1, ext_2, ext_3", "from high_discount_package_agent_record", "where id = #{id,jdbcType=BIGINT}" }) @Results({ @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="type", property="type", jdbcType=JdbcType.INTEGER), @Result(column="discount_package_title", property="discountPackageTitle", jdbcType=JdbcType.VARCHAR), @Result(column="discount_package_id", property="discountPackageId", jdbcType=JdbcType.BIGINT), @Result(column="agent_name", property="agentName", jdbcType=JdbcType.VARCHAR), @@ -121,7 +123,8 @@ public interface HighDiscountPackageAgentRecordMapper extends HighDiscountPackag @Update({ "update high_discount_package_agent_record", - "set discount_package_title = #{discountPackageTitle,jdbcType=VARCHAR},", + "set `type` = #{type,jdbcType=INTEGER},", + "discount_package_title = #{discountPackageTitle,jdbcType=VARCHAR},", "discount_package_id = #{discountPackageId,jdbcType=BIGINT},", "agent_name = #{agentName,jdbcType=VARCHAR},", "agent_id = #{agentId,jdbcType=BIGINT},", diff --git a/hai-service/src/main/java/com/hai/dao/HighDiscountPackageAgentRecordSqlProvider.java b/hai-service/src/main/java/com/hai/dao/HighDiscountPackageAgentRecordSqlProvider.java index 6be56880..6761d6b0 100644 --- a/hai-service/src/main/java/com/hai/dao/HighDiscountPackageAgentRecordSqlProvider.java +++ b/hai-service/src/main/java/com/hai/dao/HighDiscountPackageAgentRecordSqlProvider.java @@ -28,6 +28,10 @@ public class HighDiscountPackageAgentRecordSqlProvider { SQL sql = new SQL(); sql.INSERT_INTO("high_discount_package_agent_record"); + if (record.getType() != null) { + sql.VALUES("`type`", "#{type,jdbcType=INTEGER}"); + } + if (record.getDiscountPackageTitle() != null) { sql.VALUES("discount_package_title", "#{discountPackageTitle,jdbcType=VARCHAR}"); } @@ -98,6 +102,7 @@ public class HighDiscountPackageAgentRecordSqlProvider { } else { sql.SELECT("id"); } + sql.SELECT("`type`"); sql.SELECT("discount_package_title"); sql.SELECT("discount_package_id"); sql.SELECT("agent_name"); @@ -134,6 +139,10 @@ public class HighDiscountPackageAgentRecordSqlProvider { sql.SET("id = #{record.id,jdbcType=BIGINT}"); } + if (record.getType() != null) { + sql.SET("`type` = #{record.type,jdbcType=INTEGER}"); + } + if (record.getDiscountPackageTitle() != null) { sql.SET("discount_package_title = #{record.discountPackageTitle,jdbcType=VARCHAR}"); } @@ -203,6 +212,7 @@ public class HighDiscountPackageAgentRecordSqlProvider { sql.UPDATE("high_discount_package_agent_record"); sql.SET("id = #{record.id,jdbcType=BIGINT}"); + sql.SET("`type` = #{record.type,jdbcType=INTEGER}"); sql.SET("discount_package_title = #{record.discountPackageTitle,jdbcType=VARCHAR}"); sql.SET("discount_package_id = #{record.discountPackageId,jdbcType=BIGINT}"); sql.SET("agent_name = #{record.agentName,jdbcType=VARCHAR}"); @@ -228,6 +238,10 @@ public class HighDiscountPackageAgentRecordSqlProvider { SQL sql = new SQL(); sql.UPDATE("high_discount_package_agent_record"); + if (record.getType() != null) { + sql.SET("`type` = #{type,jdbcType=INTEGER}"); + } + if (record.getDiscountPackageTitle() != null) { sql.SET("discount_package_title = #{discountPackageTitle,jdbcType=VARCHAR}"); } diff --git a/hai-service/src/main/java/com/hai/dao/HighDiscountPackageAgentRelMapper.java b/hai-service/src/main/java/com/hai/dao/HighDiscountPackageAgentRelMapper.java index 485205a1..2f9d367f 100644 --- a/hai-service/src/main/java/com/hai/dao/HighDiscountPackageAgentRelMapper.java +++ b/hai-service/src/main/java/com/hai/dao/HighDiscountPackageAgentRelMapper.java @@ -39,18 +39,20 @@ public interface HighDiscountPackageAgentRelMapper extends HighDiscountPackageAg int deleteByPrimaryKey(Long id); @Insert({ - "insert into high_discount_package_agent_rel (discount_package_title, discount_package_id, ", - "agent_name, agent_id, ", - "stock_count, sales_count, ", - "create_time, update_time, ", - "`status`, op_id, op_name, ", - "ext_1, ext_2, ext_3)", - "values (#{discountPackageTitle,jdbcType=VARCHAR}, #{discountPackageId,jdbcType=BIGINT}, ", - "#{agentName,jdbcType=VARCHAR}, #{agentId,jdbcType=BIGINT}, ", - "#{stockCount,jdbcType=INTEGER}, #{salesCount,jdbcType=INTEGER}, ", - "#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ", - "#{status,jdbcType=INTEGER}, #{opId,jdbcType=BIGINT}, #{opName,jdbcType=VARCHAR}, ", - "#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" + "insert into high_discount_package_agent_rel (`type`, discount_package_title, ", + "discount_package_id, agent_name, ", + "agent_id, stock_count, ", + "sales_count, create_time, ", + "update_time, `status`, ", + "op_id, op_name, ext_1, ", + "ext_2, ext_3)", + "values (#{type,jdbcType=INTEGER}, #{discountPackageTitle,jdbcType=VARCHAR}, ", + "#{discountPackageId,jdbcType=BIGINT}, #{agentName,jdbcType=VARCHAR}, ", + "#{agentId,jdbcType=BIGINT}, #{stockCount,jdbcType=INTEGER}, ", + "#{salesCount,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, ", + "#{updateTime,jdbcType=TIMESTAMP}, #{status,jdbcType=INTEGER}, ", + "#{opId,jdbcType=BIGINT}, #{opName,jdbcType=VARCHAR}, #{ext1,jdbcType=VARCHAR}, ", + "#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" }) @Options(useGeneratedKeys=true,keyProperty="id") int insert(HighDiscountPackageAgentRel record); @@ -62,6 +64,7 @@ public interface HighDiscountPackageAgentRelMapper extends HighDiscountPackageAg @SelectProvider(type=HighDiscountPackageAgentRelSqlProvider.class, method="selectByExample") @Results({ @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="type", property="type", jdbcType=JdbcType.INTEGER), @Result(column="discount_package_title", property="discountPackageTitle", jdbcType=JdbcType.VARCHAR), @Result(column="discount_package_id", property="discountPackageId", jdbcType=JdbcType.BIGINT), @Result(column="agent_name", property="agentName", jdbcType=JdbcType.VARCHAR), @@ -81,14 +84,15 @@ public interface HighDiscountPackageAgentRelMapper extends HighDiscountPackageAg @Select({ "select", - "id, discount_package_title, discount_package_id, agent_name, agent_id, stock_count, ", - "sales_count, create_time, update_time, `status`, op_id, op_name, ext_1, ext_2, ", - "ext_3", + "id, `type`, discount_package_title, discount_package_id, agent_name, agent_id, ", + "stock_count, sales_count, create_time, update_time, `status`, op_id, op_name, ", + "ext_1, ext_2, ext_3", "from high_discount_package_agent_rel", "where id = #{id,jdbcType=BIGINT}" }) @Results({ @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="type", property="type", jdbcType=JdbcType.INTEGER), @Result(column="discount_package_title", property="discountPackageTitle", jdbcType=JdbcType.VARCHAR), @Result(column="discount_package_id", property="discountPackageId", jdbcType=JdbcType.BIGINT), @Result(column="agent_name", property="agentName", jdbcType=JdbcType.VARCHAR), @@ -117,7 +121,8 @@ public interface HighDiscountPackageAgentRelMapper extends HighDiscountPackageAg @Update({ "update high_discount_package_agent_rel", - "set discount_package_title = #{discountPackageTitle,jdbcType=VARCHAR},", + "set `type` = #{type,jdbcType=INTEGER},", + "discount_package_title = #{discountPackageTitle,jdbcType=VARCHAR},", "discount_package_id = #{discountPackageId,jdbcType=BIGINT},", "agent_name = #{agentName,jdbcType=VARCHAR},", "agent_id = #{agentId,jdbcType=BIGINT},", diff --git a/hai-service/src/main/java/com/hai/dao/HighDiscountPackageAgentRelSqlProvider.java b/hai-service/src/main/java/com/hai/dao/HighDiscountPackageAgentRelSqlProvider.java index 9e4bab30..73682e9d 100644 --- a/hai-service/src/main/java/com/hai/dao/HighDiscountPackageAgentRelSqlProvider.java +++ b/hai-service/src/main/java/com/hai/dao/HighDiscountPackageAgentRelSqlProvider.java @@ -28,6 +28,10 @@ public class HighDiscountPackageAgentRelSqlProvider { SQL sql = new SQL(); sql.INSERT_INTO("high_discount_package_agent_rel"); + if (record.getType() != null) { + sql.VALUES("`type`", "#{type,jdbcType=INTEGER}"); + } + if (record.getDiscountPackageTitle() != null) { sql.VALUES("discount_package_title", "#{discountPackageTitle,jdbcType=VARCHAR}"); } @@ -94,6 +98,7 @@ public class HighDiscountPackageAgentRelSqlProvider { } else { sql.SELECT("id"); } + sql.SELECT("`type`"); sql.SELECT("discount_package_title"); sql.SELECT("discount_package_id"); sql.SELECT("agent_name"); @@ -129,6 +134,10 @@ public class HighDiscountPackageAgentRelSqlProvider { sql.SET("id = #{record.id,jdbcType=BIGINT}"); } + if (record.getType() != null) { + sql.SET("`type` = #{record.type,jdbcType=INTEGER}"); + } + if (record.getDiscountPackageTitle() != null) { sql.SET("discount_package_title = #{record.discountPackageTitle,jdbcType=VARCHAR}"); } @@ -194,6 +203,7 @@ public class HighDiscountPackageAgentRelSqlProvider { sql.UPDATE("high_discount_package_agent_rel"); sql.SET("id = #{record.id,jdbcType=BIGINT}"); + sql.SET("`type` = #{record.type,jdbcType=INTEGER}"); sql.SET("discount_package_title = #{record.discountPackageTitle,jdbcType=VARCHAR}"); sql.SET("discount_package_id = #{record.discountPackageId,jdbcType=BIGINT}"); sql.SET("agent_name = #{record.agentName,jdbcType=VARCHAR}"); @@ -218,6 +228,10 @@ public class HighDiscountPackageAgentRelSqlProvider { SQL sql = new SQL(); sql.UPDATE("high_discount_package_agent_rel"); + if (record.getType() != null) { + sql.SET("`type` = #{type,jdbcType=INTEGER}"); + } + if (record.getDiscountPackageTitle() != null) { sql.SET("discount_package_title = #{discountPackageTitle,jdbcType=VARCHAR}"); } diff --git a/hai-service/src/main/java/com/hai/dao/HighDiscountPackageMapper.java b/hai-service/src/main/java/com/hai/dao/HighDiscountPackageMapper.java index 894b79a3..ec2c52dc 100644 --- a/hai-service/src/main/java/com/hai/dao/HighDiscountPackageMapper.java +++ b/hai-service/src/main/java/com/hai/dao/HighDiscountPackageMapper.java @@ -40,25 +40,25 @@ public interface HighDiscountPackageMapper extends HighDiscountPackageMapperExt @Insert({ "insert into high_discount_package (company_id, using_attribution, ", - "title, sales_type, ", - "effective_tiem, price, ", - "purchase_num, list_img, ", - "banner_img, details_img, ", - "created_user_id, created_time, ", - "updated_user_id, updated_time, ", - "`status`, total_stock, ", - "surplus_stock, ext_1, ", - "ext_2, ext_3)", + "show_label, title, ", + "sales_type, effective_tiem, ", + "price, purchase_num, ", + "list_img, banner_img, ", + "details_img, created_user_id, ", + "created_time, updated_user_id, ", + "updated_time, `status`, ", + "total_stock, surplus_stock, ", + "ext_1, ext_2, ext_3)", "values (#{companyId,jdbcType=INTEGER}, #{usingAttribution,jdbcType=INTEGER}, ", - "#{title,jdbcType=VARCHAR}, #{salesType,jdbcType=INTEGER}, ", - "#{effectiveTiem,jdbcType=TIMESTAMP}, #{price,jdbcType=DECIMAL}, ", - "#{purchaseNum,jdbcType=INTEGER}, #{listImg,jdbcType=VARCHAR}, ", - "#{bannerImg,jdbcType=VARCHAR}, #{detailsImg,jdbcType=VARCHAR}, ", - "#{createdUserId,jdbcType=INTEGER}, #{createdTime,jdbcType=TIMESTAMP}, ", - "#{updatedUserId,jdbcType=INTEGER}, #{updatedTime,jdbcType=TIMESTAMP}, ", - "#{status,jdbcType=INTEGER}, #{totalStock,jdbcType=INTEGER}, ", - "#{surplusStock,jdbcType=INTEGER}, #{ext1,jdbcType=VARCHAR}, ", - "#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" + "#{showLabel,jdbcType=VARCHAR}, #{title,jdbcType=VARCHAR}, ", + "#{salesType,jdbcType=INTEGER}, #{effectiveTiem,jdbcType=TIMESTAMP}, ", + "#{price,jdbcType=DECIMAL}, #{purchaseNum,jdbcType=INTEGER}, ", + "#{listImg,jdbcType=VARCHAR}, #{bannerImg,jdbcType=VARCHAR}, ", + "#{detailsImg,jdbcType=VARCHAR}, #{createdUserId,jdbcType=INTEGER}, ", + "#{createdTime,jdbcType=TIMESTAMP}, #{updatedUserId,jdbcType=INTEGER}, ", + "#{updatedTime,jdbcType=TIMESTAMP}, #{status,jdbcType=INTEGER}, ", + "#{totalStock,jdbcType=INTEGER}, #{surplusStock,jdbcType=INTEGER}, ", + "#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" }) @Options(useGeneratedKeys=true,keyProperty="id") int insert(HighDiscountPackage record); @@ -72,6 +72,7 @@ public interface HighDiscountPackageMapper extends HighDiscountPackageMapperExt @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true), @Result(column="company_id", property="companyId", jdbcType=JdbcType.INTEGER), @Result(column="using_attribution", property="usingAttribution", jdbcType=JdbcType.INTEGER), + @Result(column="show_label", property="showLabel", jdbcType=JdbcType.VARCHAR), @Result(column="title", property="title", jdbcType=JdbcType.VARCHAR), @Result(column="sales_type", property="salesType", jdbcType=JdbcType.INTEGER), @Result(column="effective_tiem", property="effectiveTiem", jdbcType=JdbcType.TIMESTAMP), @@ -95,8 +96,8 @@ public interface HighDiscountPackageMapper extends HighDiscountPackageMapperExt @Select({ "select", - "id, company_id, using_attribution, title, sales_type, effective_tiem, price, ", - "purchase_num, list_img, banner_img, details_img, created_user_id, created_time, ", + "id, company_id, using_attribution, show_label, title, sales_type, effective_tiem, ", + "price, purchase_num, list_img, banner_img, details_img, created_user_id, created_time, ", "updated_user_id, updated_time, `status`, total_stock, surplus_stock, ext_1, ", "ext_2, ext_3", "from high_discount_package", @@ -106,6 +107,7 @@ public interface HighDiscountPackageMapper extends HighDiscountPackageMapperExt @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true), @Result(column="company_id", property="companyId", jdbcType=JdbcType.INTEGER), @Result(column="using_attribution", property="usingAttribution", jdbcType=JdbcType.INTEGER), + @Result(column="show_label", property="showLabel", jdbcType=JdbcType.VARCHAR), @Result(column="title", property="title", jdbcType=JdbcType.VARCHAR), @Result(column="sales_type", property="salesType", jdbcType=JdbcType.INTEGER), @Result(column="effective_tiem", property="effectiveTiem", jdbcType=JdbcType.TIMESTAMP), @@ -140,6 +142,7 @@ public interface HighDiscountPackageMapper extends HighDiscountPackageMapperExt "update high_discount_package", "set company_id = #{companyId,jdbcType=INTEGER},", "using_attribution = #{usingAttribution,jdbcType=INTEGER},", + "show_label = #{showLabel,jdbcType=VARCHAR},", "title = #{title,jdbcType=VARCHAR},", "sales_type = #{salesType,jdbcType=INTEGER},", "effective_tiem = #{effectiveTiem,jdbcType=TIMESTAMP},", diff --git a/hai-service/src/main/java/com/hai/dao/HighDiscountPackageSqlProvider.java b/hai-service/src/main/java/com/hai/dao/HighDiscountPackageSqlProvider.java index b303f25e..1157cf78 100644 --- a/hai-service/src/main/java/com/hai/dao/HighDiscountPackageSqlProvider.java +++ b/hai-service/src/main/java/com/hai/dao/HighDiscountPackageSqlProvider.java @@ -36,6 +36,10 @@ public class HighDiscountPackageSqlProvider { sql.VALUES("using_attribution", "#{usingAttribution,jdbcType=INTEGER}"); } + if (record.getShowLabel() != null) { + sql.VALUES("show_label", "#{showLabel,jdbcType=VARCHAR}"); + } + if (record.getTitle() != null) { sql.VALUES("title", "#{title,jdbcType=VARCHAR}"); } @@ -120,6 +124,7 @@ public class HighDiscountPackageSqlProvider { } sql.SELECT("company_id"); sql.SELECT("using_attribution"); + sql.SELECT("show_label"); sql.SELECT("title"); sql.SELECT("sales_type"); sql.SELECT("effective_tiem"); @@ -167,6 +172,10 @@ public class HighDiscountPackageSqlProvider { sql.SET("using_attribution = #{record.usingAttribution,jdbcType=INTEGER}"); } + if (record.getShowLabel() != null) { + sql.SET("show_label = #{record.showLabel,jdbcType=VARCHAR}"); + } + if (record.getTitle() != null) { sql.SET("title = #{record.title,jdbcType=VARCHAR}"); } @@ -250,6 +259,7 @@ public class HighDiscountPackageSqlProvider { sql.SET("id = #{record.id,jdbcType=INTEGER}"); sql.SET("company_id = #{record.companyId,jdbcType=INTEGER}"); sql.SET("using_attribution = #{record.usingAttribution,jdbcType=INTEGER}"); + sql.SET("show_label = #{record.showLabel,jdbcType=VARCHAR}"); sql.SET("title = #{record.title,jdbcType=VARCHAR}"); sql.SET("sales_type = #{record.salesType,jdbcType=INTEGER}"); sql.SET("effective_tiem = #{record.effectiveTiem,jdbcType=TIMESTAMP}"); @@ -286,6 +296,10 @@ public class HighDiscountPackageSqlProvider { sql.SET("using_attribution = #{usingAttribution,jdbcType=INTEGER}"); } + if (record.getShowLabel() != null) { + sql.SET("show_label = #{showLabel,jdbcType=VARCHAR}"); + } + if (record.getTitle() != null) { sql.SET("title = #{title,jdbcType=VARCHAR}"); } diff --git a/hai-service/src/main/java/com/hai/entity/ApiCoupon.java b/hai-service/src/main/java/com/hai/entity/ApiCoupon.java new file mode 100644 index 00000000..8f3fc113 --- /dev/null +++ b/hai-service/src/main/java/com/hai/entity/ApiCoupon.java @@ -0,0 +1,321 @@ +package com.hai.entity; + +import java.io.Serializable; +import java.util.Date; + +/** + * api_coupon + * @author + */ +/** + * + * 代码由工具生成 + * + **/ +public class ApiCoupon implements Serializable { + /** + * 主键 + */ + private Long id; + + /** + * 类型:1,四川中石油 2.贵州中石油 + */ + private Integer type; + + /** + * 产品类型 4001:油品券,4002:汽油券,4003 柴油券 + */ + private String goodsType; + + /** + * 卡券 + */ + private String name; + + /** + * 编码 + */ + private String code; + + /** + * 描述 + */ + private String desc; + + /** + * 金额(单位:分) + */ + private Integer price; + + /** + * 卡券图片 + */ + private String img; + + /** + * 有效天数 + */ + private Integer effectiveDays; + + /** + * 创建时间 + */ + private Date createTime; + + /** + * 更新时间 + */ + private Date updateTime; + + /** + * 状态 1:正常 0 删除 + */ + private Integer status; + + /** + * 操作人 + */ + private Long opId; + + /** + * 操作人名称 + */ + private String opName; + + /** + * ext_1 + */ + private String ext1; + + /** + * ext_2 + */ + private String ext2; + + /** + * ext_3 + */ + private String ext3; + + private static final long serialVersionUID = 1L; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Integer getType() { + return type; + } + + public void setType(Integer type) { + this.type = type; + } + + public String getGoodsType() { + return goodsType; + } + + public void setGoodsType(String goodsType) { + this.goodsType = goodsType; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getDesc() { + return desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } + + public Integer getPrice() { + return price; + } + + public void setPrice(Integer price) { + this.price = price; + } + + public String getImg() { + return img; + } + + public void setImg(String img) { + this.img = img; + } + + public Integer getEffectiveDays() { + return effectiveDays; + } + + public void setEffectiveDays(Integer effectiveDays) { + this.effectiveDays = effectiveDays; + } + + 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 getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public Long getOpId() { + return opId; + } + + public void setOpId(Long opId) { + this.opId = opId; + } + + public String getOpName() { + return opName; + } + + public void setOpName(String opName) { + this.opName = opName; + } + + public String getExt1() { + return ext1; + } + + public void setExt1(String ext1) { + this.ext1 = ext1; + } + + public String getExt2() { + return ext2; + } + + public void setExt2(String ext2) { + this.ext2 = ext2; + } + + public String getExt3() { + return ext3; + } + + public void setExt3(String ext3) { + this.ext3 = ext3; + } + + @Override + public boolean equals(Object that) { + if (this == that) { + return true; + } + if (that == null) { + return false; + } + if (getClass() != that.getClass()) { + return false; + } + ApiCoupon other = (ApiCoupon) that; + return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) + && (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType())) + && (this.getGoodsType() == null ? other.getGoodsType() == null : this.getGoodsType().equals(other.getGoodsType())) + && (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName())) + && (this.getCode() == null ? other.getCode() == null : this.getCode().equals(other.getCode())) + && (this.getDesc() == null ? other.getDesc() == null : this.getDesc().equals(other.getDesc())) + && (this.getPrice() == null ? other.getPrice() == null : this.getPrice().equals(other.getPrice())) + && (this.getImg() == null ? other.getImg() == null : this.getImg().equals(other.getImg())) + && (this.getEffectiveDays() == null ? other.getEffectiveDays() == null : this.getEffectiveDays().equals(other.getEffectiveDays())) + && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) + && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime())) + && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus())) + && (this.getOpId() == null ? other.getOpId() == null : this.getOpId().equals(other.getOpId())) + && (this.getOpName() == null ? other.getOpName() == null : this.getOpName().equals(other.getOpName())) + && (this.getExt1() == null ? other.getExt1() == null : this.getExt1().equals(other.getExt1())) + && (this.getExt2() == null ? other.getExt2() == null : this.getExt2().equals(other.getExt2())) + && (this.getExt3() == null ? other.getExt3() == null : this.getExt3().equals(other.getExt3())); + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); + result = prime * result + ((getType() == null) ? 0 : getType().hashCode()); + result = prime * result + ((getGoodsType() == null) ? 0 : getGoodsType().hashCode()); + result = prime * result + ((getName() == null) ? 0 : getName().hashCode()); + result = prime * result + ((getCode() == null) ? 0 : getCode().hashCode()); + result = prime * result + ((getDesc() == null) ? 0 : getDesc().hashCode()); + result = prime * result + ((getPrice() == null) ? 0 : getPrice().hashCode()); + result = prime * result + ((getImg() == null) ? 0 : getImg().hashCode()); + result = prime * result + ((getEffectiveDays() == null) ? 0 : getEffectiveDays().hashCode()); + result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); + result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode()); + result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode()); + result = prime * result + ((getOpId() == null) ? 0 : getOpId().hashCode()); + result = prime * result + ((getOpName() == null) ? 0 : getOpName().hashCode()); + result = prime * result + ((getExt1() == null) ? 0 : getExt1().hashCode()); + result = prime * result + ((getExt2() == null) ? 0 : getExt2().hashCode()); + result = prime * result + ((getExt3() == null) ? 0 : getExt3().hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append(" ["); + sb.append("Hash = ").append(hashCode()); + sb.append(", id=").append(id); + sb.append(", type=").append(type); + sb.append(", goodsType=").append(goodsType); + sb.append(", name=").append(name); + sb.append(", code=").append(code); + sb.append(", desc=").append(desc); + sb.append(", price=").append(price); + sb.append(", img=").append(img); + sb.append(", effectiveDays=").append(effectiveDays); + sb.append(", createTime=").append(createTime); + sb.append(", updateTime=").append(updateTime); + sb.append(", status=").append(status); + sb.append(", opId=").append(opId); + sb.append(", opName=").append(opName); + sb.append(", ext1=").append(ext1); + sb.append(", ext2=").append(ext2); + sb.append(", ext3=").append(ext3); + sb.append(", serialVersionUID=").append(serialVersionUID); + sb.append("]"); + return sb.toString(); + } +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/entity/ApiCouponExample.java b/hai-service/src/main/java/com/hai/entity/ApiCouponExample.java new file mode 100644 index 00000000..b39c6a81 --- /dev/null +++ b/hai-service/src/main/java/com/hai/entity/ApiCouponExample.java @@ -0,0 +1,1333 @@ +package com.hai.entity; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class ApiCouponExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + private Integer limit; + + private Long offset; + + public ApiCouponExample() { + oredCriteria = new ArrayList(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + public void setLimit(Integer limit) { + this.limit = limit; + } + + public Integer getLimit() { + return limit; + } + + public void setOffset(Long offset) { + this.offset = offset; + } + + public Long getOffset() { + return offset; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andTypeIsNull() { + addCriterion("`type` is null"); + return (Criteria) this; + } + + public Criteria andTypeIsNotNull() { + addCriterion("`type` is not null"); + return (Criteria) this; + } + + public Criteria andTypeEqualTo(Integer value) { + addCriterion("`type` =", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotEqualTo(Integer value) { + addCriterion("`type` <>", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThan(Integer value) { + addCriterion("`type` >", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThanOrEqualTo(Integer value) { + addCriterion("`type` >=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThan(Integer value) { + addCriterion("`type` <", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThanOrEqualTo(Integer value) { + addCriterion("`type` <=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeIn(List values) { + addCriterion("`type` in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotIn(List values) { + addCriterion("`type` not in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeBetween(Integer value1, Integer value2) { + addCriterion("`type` between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotBetween(Integer value1, Integer value2) { + addCriterion("`type` not between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andGoodsTypeIsNull() { + addCriterion("goods_type is null"); + return (Criteria) this; + } + + public Criteria andGoodsTypeIsNotNull() { + addCriterion("goods_type is not null"); + return (Criteria) this; + } + + public Criteria andGoodsTypeEqualTo(String value) { + addCriterion("goods_type =", value, "goodsType"); + return (Criteria) this; + } + + public Criteria andGoodsTypeNotEqualTo(String value) { + addCriterion("goods_type <>", value, "goodsType"); + return (Criteria) this; + } + + public Criteria andGoodsTypeGreaterThan(String value) { + addCriterion("goods_type >", value, "goodsType"); + return (Criteria) this; + } + + public Criteria andGoodsTypeGreaterThanOrEqualTo(String value) { + addCriterion("goods_type >=", value, "goodsType"); + return (Criteria) this; + } + + public Criteria andGoodsTypeLessThan(String value) { + addCriterion("goods_type <", value, "goodsType"); + return (Criteria) this; + } + + public Criteria andGoodsTypeLessThanOrEqualTo(String value) { + addCriterion("goods_type <=", value, "goodsType"); + return (Criteria) this; + } + + public Criteria andGoodsTypeLike(String value) { + addCriterion("goods_type like", value, "goodsType"); + return (Criteria) this; + } + + public Criteria andGoodsTypeNotLike(String value) { + addCriterion("goods_type not like", value, "goodsType"); + return (Criteria) this; + } + + public Criteria andGoodsTypeIn(List values) { + addCriterion("goods_type in", values, "goodsType"); + return (Criteria) this; + } + + public Criteria andGoodsTypeNotIn(List values) { + addCriterion("goods_type not in", values, "goodsType"); + return (Criteria) this; + } + + public Criteria andGoodsTypeBetween(String value1, String value2) { + addCriterion("goods_type between", value1, value2, "goodsType"); + return (Criteria) this; + } + + public Criteria andGoodsTypeNotBetween(String value1, String value2) { + addCriterion("goods_type not between", value1, value2, "goodsType"); + return (Criteria) this; + } + + public Criteria andNameIsNull() { + addCriterion("`name` is null"); + return (Criteria) this; + } + + public Criteria andNameIsNotNull() { + addCriterion("`name` is not null"); + return (Criteria) this; + } + + public Criteria andNameEqualTo(String value) { + addCriterion("`name` =", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotEqualTo(String value) { + addCriterion("`name` <>", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThan(String value) { + addCriterion("`name` >", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThanOrEqualTo(String value) { + addCriterion("`name` >=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThan(String value) { + addCriterion("`name` <", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThanOrEqualTo(String value) { + addCriterion("`name` <=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLike(String value) { + addCriterion("`name` like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotLike(String value) { + addCriterion("`name` not like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameIn(List values) { + addCriterion("`name` in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameNotIn(List values) { + addCriterion("`name` not in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameBetween(String value1, String value2) { + addCriterion("`name` between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andNameNotBetween(String value1, String value2) { + addCriterion("`name` not between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andCodeIsNull() { + addCriterion("code is null"); + return (Criteria) this; + } + + public Criteria andCodeIsNotNull() { + addCriterion("code is not null"); + return (Criteria) this; + } + + public Criteria andCodeEqualTo(String value) { + addCriterion("code =", value, "code"); + return (Criteria) this; + } + + public Criteria andCodeNotEqualTo(String value) { + addCriterion("code <>", value, "code"); + return (Criteria) this; + } + + public Criteria andCodeGreaterThan(String value) { + addCriterion("code >", value, "code"); + return (Criteria) this; + } + + public Criteria andCodeGreaterThanOrEqualTo(String value) { + addCriterion("code >=", value, "code"); + return (Criteria) this; + } + + public Criteria andCodeLessThan(String value) { + addCriterion("code <", value, "code"); + return (Criteria) this; + } + + public Criteria andCodeLessThanOrEqualTo(String value) { + addCriterion("code <=", value, "code"); + return (Criteria) this; + } + + public Criteria andCodeLike(String value) { + addCriterion("code like", value, "code"); + return (Criteria) this; + } + + public Criteria andCodeNotLike(String value) { + addCriterion("code not like", value, "code"); + return (Criteria) this; + } + + public Criteria andCodeIn(List values) { + addCriterion("code in", values, "code"); + return (Criteria) this; + } + + public Criteria andCodeNotIn(List values) { + addCriterion("code not in", values, "code"); + return (Criteria) this; + } + + public Criteria andCodeBetween(String value1, String value2) { + addCriterion("code between", value1, value2, "code"); + return (Criteria) this; + } + + public Criteria andCodeNotBetween(String value1, String value2) { + addCriterion("code not between", value1, value2, "code"); + return (Criteria) this; + } + + public Criteria andDescIsNull() { + addCriterion("`desc` is null"); + return (Criteria) this; + } + + public Criteria andDescIsNotNull() { + addCriterion("`desc` is not null"); + return (Criteria) this; + } + + public Criteria andDescEqualTo(String value) { + addCriterion("`desc` =", value, "desc"); + return (Criteria) this; + } + + public Criteria andDescNotEqualTo(String value) { + addCriterion("`desc` <>", value, "desc"); + return (Criteria) this; + } + + public Criteria andDescGreaterThan(String value) { + addCriterion("`desc` >", value, "desc"); + return (Criteria) this; + } + + public Criteria andDescGreaterThanOrEqualTo(String value) { + addCriterion("`desc` >=", value, "desc"); + return (Criteria) this; + } + + public Criteria andDescLessThan(String value) { + addCriterion("`desc` <", value, "desc"); + return (Criteria) this; + } + + public Criteria andDescLessThanOrEqualTo(String value) { + addCriterion("`desc` <=", value, "desc"); + return (Criteria) this; + } + + public Criteria andDescLike(String value) { + addCriterion("`desc` like", value, "desc"); + return (Criteria) this; + } + + public Criteria andDescNotLike(String value) { + addCriterion("`desc` not like", value, "desc"); + return (Criteria) this; + } + + public Criteria andDescIn(List values) { + addCriterion("`desc` in", values, "desc"); + return (Criteria) this; + } + + public Criteria andDescNotIn(List values) { + addCriterion("`desc` not in", values, "desc"); + return (Criteria) this; + } + + public Criteria andDescBetween(String value1, String value2) { + addCriterion("`desc` between", value1, value2, "desc"); + return (Criteria) this; + } + + public Criteria andDescNotBetween(String value1, String value2) { + addCriterion("`desc` not between", value1, value2, "desc"); + return (Criteria) this; + } + + public Criteria andPriceIsNull() { + addCriterion("price is null"); + return (Criteria) this; + } + + public Criteria andPriceIsNotNull() { + addCriterion("price is not null"); + return (Criteria) this; + } + + public Criteria andPriceEqualTo(Integer value) { + addCriterion("price =", value, "price"); + return (Criteria) this; + } + + public Criteria andPriceNotEqualTo(Integer value) { + addCriterion("price <>", value, "price"); + return (Criteria) this; + } + + public Criteria andPriceGreaterThan(Integer value) { + addCriterion("price >", value, "price"); + return (Criteria) this; + } + + public Criteria andPriceGreaterThanOrEqualTo(Integer value) { + addCriterion("price >=", value, "price"); + return (Criteria) this; + } + + public Criteria andPriceLessThan(Integer value) { + addCriterion("price <", value, "price"); + return (Criteria) this; + } + + public Criteria andPriceLessThanOrEqualTo(Integer value) { + addCriterion("price <=", value, "price"); + return (Criteria) this; + } + + public Criteria andPriceIn(List values) { + addCriterion("price in", values, "price"); + return (Criteria) this; + } + + public Criteria andPriceNotIn(List values) { + addCriterion("price not in", values, "price"); + return (Criteria) this; + } + + public Criteria andPriceBetween(Integer value1, Integer value2) { + addCriterion("price between", value1, value2, "price"); + return (Criteria) this; + } + + public Criteria andPriceNotBetween(Integer value1, Integer value2) { + addCriterion("price not between", value1, value2, "price"); + return (Criteria) this; + } + + public Criteria andImgIsNull() { + addCriterion("img is null"); + return (Criteria) this; + } + + public Criteria andImgIsNotNull() { + addCriterion("img is not null"); + return (Criteria) this; + } + + public Criteria andImgEqualTo(String value) { + addCriterion("img =", value, "img"); + return (Criteria) this; + } + + public Criteria andImgNotEqualTo(String value) { + addCriterion("img <>", value, "img"); + return (Criteria) this; + } + + public Criteria andImgGreaterThan(String value) { + addCriterion("img >", value, "img"); + return (Criteria) this; + } + + public Criteria andImgGreaterThanOrEqualTo(String value) { + addCriterion("img >=", value, "img"); + return (Criteria) this; + } + + public Criteria andImgLessThan(String value) { + addCriterion("img <", value, "img"); + return (Criteria) this; + } + + public Criteria andImgLessThanOrEqualTo(String value) { + addCriterion("img <=", value, "img"); + return (Criteria) this; + } + + public Criteria andImgLike(String value) { + addCriterion("img like", value, "img"); + return (Criteria) this; + } + + public Criteria andImgNotLike(String value) { + addCriterion("img not like", value, "img"); + return (Criteria) this; + } + + public Criteria andImgIn(List values) { + addCriterion("img in", values, "img"); + return (Criteria) this; + } + + public Criteria andImgNotIn(List values) { + addCriterion("img not in", values, "img"); + return (Criteria) this; + } + + public Criteria andImgBetween(String value1, String value2) { + addCriterion("img between", value1, value2, "img"); + return (Criteria) this; + } + + public Criteria andImgNotBetween(String value1, String value2) { + addCriterion("img not between", value1, value2, "img"); + return (Criteria) this; + } + + public Criteria andEffectiveDaysIsNull() { + addCriterion("effective_days is null"); + return (Criteria) this; + } + + public Criteria andEffectiveDaysIsNotNull() { + addCriterion("effective_days is not null"); + return (Criteria) this; + } + + public Criteria andEffectiveDaysEqualTo(Integer value) { + addCriterion("effective_days =", value, "effectiveDays"); + return (Criteria) this; + } + + public Criteria andEffectiveDaysNotEqualTo(Integer value) { + addCriterion("effective_days <>", value, "effectiveDays"); + return (Criteria) this; + } + + public Criteria andEffectiveDaysGreaterThan(Integer value) { + addCriterion("effective_days >", value, "effectiveDays"); + return (Criteria) this; + } + + public Criteria andEffectiveDaysGreaterThanOrEqualTo(Integer value) { + addCriterion("effective_days >=", value, "effectiveDays"); + return (Criteria) this; + } + + public Criteria andEffectiveDaysLessThan(Integer value) { + addCriterion("effective_days <", value, "effectiveDays"); + return (Criteria) this; + } + + public Criteria andEffectiveDaysLessThanOrEqualTo(Integer value) { + addCriterion("effective_days <=", value, "effectiveDays"); + return (Criteria) this; + } + + public Criteria andEffectiveDaysIn(List values) { + addCriterion("effective_days in", values, "effectiveDays"); + return (Criteria) this; + } + + public Criteria andEffectiveDaysNotIn(List values) { + addCriterion("effective_days not in", values, "effectiveDays"); + return (Criteria) this; + } + + public Criteria andEffectiveDaysBetween(Integer value1, Integer value2) { + addCriterion("effective_days between", value1, value2, "effectiveDays"); + return (Criteria) this; + } + + public Criteria andEffectiveDaysNotBetween(Integer value1, Integer value2) { + addCriterion("effective_days not between", value1, value2, "effectiveDays"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNull() { + addCriterion("create_time is null"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNotNull() { + addCriterion("create_time is not null"); + return (Criteria) this; + } + + public Criteria andCreateTimeEqualTo(Date value) { + addCriterion("create_time =", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotEqualTo(Date value) { + addCriterion("create_time <>", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThan(Date value) { + addCriterion("create_time >", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) { + addCriterion("create_time >=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThan(Date value) { + addCriterion("create_time <", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThanOrEqualTo(Date value) { + addCriterion("create_time <=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeIn(List values) { + addCriterion("create_time in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotIn(List values) { + addCriterion("create_time not in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeBetween(Date value1, Date value2) { + addCriterion("create_time between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotBetween(Date value1, Date value2) { + addCriterion("create_time not between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNull() { + addCriterion("update_time is null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNotNull() { + addCriterion("update_time is not null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeEqualTo(Date value) { + addCriterion("update_time =", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotEqualTo(Date value) { + addCriterion("update_time <>", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThan(Date value) { + addCriterion("update_time >", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) { + addCriterion("update_time >=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThan(Date value) { + addCriterion("update_time <", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThanOrEqualTo(Date value) { + addCriterion("update_time <=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIn(List values) { + addCriterion("update_time in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotIn(List values) { + addCriterion("update_time not in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeBetween(Date value1, Date value2) { + addCriterion("update_time between", value1, value2, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotBetween(Date value1, Date value2) { + addCriterion("update_time not between", value1, value2, "updateTime"); + return (Criteria) this; + } + + public Criteria andStatusIsNull() { + addCriterion("`status` is null"); + return (Criteria) this; + } + + public Criteria andStatusIsNotNull() { + addCriterion("`status` is not null"); + return (Criteria) this; + } + + public Criteria andStatusEqualTo(Integer value) { + addCriterion("`status` =", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotEqualTo(Integer value) { + addCriterion("`status` <>", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusGreaterThan(Integer value) { + addCriterion("`status` >", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusGreaterThanOrEqualTo(Integer value) { + addCriterion("`status` >=", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLessThan(Integer value) { + addCriterion("`status` <", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLessThanOrEqualTo(Integer value) { + addCriterion("`status` <=", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusIn(List values) { + addCriterion("`status` in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotIn(List values) { + addCriterion("`status` not in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusBetween(Integer value1, Integer value2) { + addCriterion("`status` between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotBetween(Integer value1, Integer value2) { + addCriterion("`status` not between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria andOpIdIsNull() { + addCriterion("op_id is null"); + return (Criteria) this; + } + + public Criteria andOpIdIsNotNull() { + addCriterion("op_id is not null"); + return (Criteria) this; + } + + public Criteria andOpIdEqualTo(Long value) { + addCriterion("op_id =", value, "opId"); + return (Criteria) this; + } + + public Criteria andOpIdNotEqualTo(Long value) { + addCriterion("op_id <>", value, "opId"); + return (Criteria) this; + } + + public Criteria andOpIdGreaterThan(Long value) { + addCriterion("op_id >", value, "opId"); + return (Criteria) this; + } + + public Criteria andOpIdGreaterThanOrEqualTo(Long value) { + addCriterion("op_id >=", value, "opId"); + return (Criteria) this; + } + + public Criteria andOpIdLessThan(Long value) { + addCriterion("op_id <", value, "opId"); + return (Criteria) this; + } + + public Criteria andOpIdLessThanOrEqualTo(Long value) { + addCriterion("op_id <=", value, "opId"); + return (Criteria) this; + } + + public Criteria andOpIdIn(List values) { + addCriterion("op_id in", values, "opId"); + return (Criteria) this; + } + + public Criteria andOpIdNotIn(List values) { + addCriterion("op_id not in", values, "opId"); + return (Criteria) this; + } + + public Criteria andOpIdBetween(Long value1, Long value2) { + addCriterion("op_id between", value1, value2, "opId"); + return (Criteria) this; + } + + public Criteria andOpIdNotBetween(Long value1, Long value2) { + addCriterion("op_id not between", value1, value2, "opId"); + return (Criteria) this; + } + + public Criteria andOpNameIsNull() { + addCriterion("op_name is null"); + return (Criteria) this; + } + + public Criteria andOpNameIsNotNull() { + addCriterion("op_name is not null"); + return (Criteria) this; + } + + public Criteria andOpNameEqualTo(String value) { + addCriterion("op_name =", value, "opName"); + return (Criteria) this; + } + + public Criteria andOpNameNotEqualTo(String value) { + addCriterion("op_name <>", value, "opName"); + return (Criteria) this; + } + + public Criteria andOpNameGreaterThan(String value) { + addCriterion("op_name >", value, "opName"); + return (Criteria) this; + } + + public Criteria andOpNameGreaterThanOrEqualTo(String value) { + addCriterion("op_name >=", value, "opName"); + return (Criteria) this; + } + + public Criteria andOpNameLessThan(String value) { + addCriterion("op_name <", value, "opName"); + return (Criteria) this; + } + + public Criteria andOpNameLessThanOrEqualTo(String value) { + addCriterion("op_name <=", value, "opName"); + return (Criteria) this; + } + + public Criteria andOpNameLike(String value) { + addCriterion("op_name like", value, "opName"); + return (Criteria) this; + } + + public Criteria andOpNameNotLike(String value) { + addCriterion("op_name not like", value, "opName"); + return (Criteria) this; + } + + public Criteria andOpNameIn(List values) { + addCriterion("op_name in", values, "opName"); + return (Criteria) this; + } + + public Criteria andOpNameNotIn(List values) { + addCriterion("op_name not in", values, "opName"); + return (Criteria) this; + } + + public Criteria andOpNameBetween(String value1, String value2) { + addCriterion("op_name between", value1, value2, "opName"); + return (Criteria) this; + } + + public Criteria andOpNameNotBetween(String value1, String value2) { + addCriterion("op_name not between", value1, value2, "opName"); + return (Criteria) this; + } + + public Criteria andExt1IsNull() { + addCriterion("ext_1 is null"); + return (Criteria) this; + } + + public Criteria andExt1IsNotNull() { + addCriterion("ext_1 is not null"); + return (Criteria) this; + } + + public Criteria andExt1EqualTo(String value) { + addCriterion("ext_1 =", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1NotEqualTo(String value) { + addCriterion("ext_1 <>", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1GreaterThan(String value) { + addCriterion("ext_1 >", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1GreaterThanOrEqualTo(String value) { + addCriterion("ext_1 >=", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1LessThan(String value) { + addCriterion("ext_1 <", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1LessThanOrEqualTo(String value) { + addCriterion("ext_1 <=", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1Like(String value) { + addCriterion("ext_1 like", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1NotLike(String value) { + addCriterion("ext_1 not like", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1In(List values) { + addCriterion("ext_1 in", values, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1NotIn(List values) { + addCriterion("ext_1 not in", values, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1Between(String value1, String value2) { + addCriterion("ext_1 between", value1, value2, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1NotBetween(String value1, String value2) { + addCriterion("ext_1 not between", value1, value2, "ext1"); + return (Criteria) this; + } + + public Criteria andExt2IsNull() { + addCriterion("ext_2 is null"); + return (Criteria) this; + } + + public Criteria andExt2IsNotNull() { + addCriterion("ext_2 is not null"); + return (Criteria) this; + } + + public Criteria andExt2EqualTo(String value) { + addCriterion("ext_2 =", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2NotEqualTo(String value) { + addCriterion("ext_2 <>", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2GreaterThan(String value) { + addCriterion("ext_2 >", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2GreaterThanOrEqualTo(String value) { + addCriterion("ext_2 >=", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2LessThan(String value) { + addCriterion("ext_2 <", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2LessThanOrEqualTo(String value) { + addCriterion("ext_2 <=", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2Like(String value) { + addCriterion("ext_2 like", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2NotLike(String value) { + addCriterion("ext_2 not like", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2In(List values) { + addCriterion("ext_2 in", values, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2NotIn(List values) { + addCriterion("ext_2 not in", values, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2Between(String value1, String value2) { + addCriterion("ext_2 between", value1, value2, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2NotBetween(String value1, String value2) { + addCriterion("ext_2 not between", value1, value2, "ext2"); + return (Criteria) this; + } + + public Criteria andExt3IsNull() { + addCriterion("ext_3 is null"); + return (Criteria) this; + } + + public Criteria andExt3IsNotNull() { + addCriterion("ext_3 is not null"); + return (Criteria) this; + } + + public Criteria andExt3EqualTo(String value) { + addCriterion("ext_3 =", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3NotEqualTo(String value) { + addCriterion("ext_3 <>", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3GreaterThan(String value) { + addCriterion("ext_3 >", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3GreaterThanOrEqualTo(String value) { + addCriterion("ext_3 >=", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3LessThan(String value) { + addCriterion("ext_3 <", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3LessThanOrEqualTo(String value) { + addCriterion("ext_3 <=", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3Like(String value) { + addCriterion("ext_3 like", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3NotLike(String value) { + addCriterion("ext_3 not like", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3In(List values) { + addCriterion("ext_3 in", values, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3NotIn(List values) { + addCriterion("ext_3 not in", values, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3Between(String value1, String value2) { + addCriterion("ext_3 between", value1, value2, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3NotBetween(String value1, String value2) { + addCriterion("ext_3 not between", value1, value2, "ext3"); + return (Criteria) this; + } + } + + /** + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/entity/HighDiscountPackage.java b/hai-service/src/main/java/com/hai/entity/HighDiscountPackage.java index 41715a32..1052a277 100644 --- a/hai-service/src/main/java/com/hai/entity/HighDiscountPackage.java +++ b/hai-service/src/main/java/com/hai/entity/HighDiscountPackage.java @@ -29,6 +29,11 @@ public class HighDiscountPackage implements Serializable { */ private Integer usingAttribution; + /** + * 展示标签 + */ + private String showLabel; + /** * 标题 */ @@ -145,6 +150,14 @@ public class HighDiscountPackage implements Serializable { this.usingAttribution = usingAttribution; } + public String getShowLabel() { + return showLabel; + } + + public void setShowLabel(String showLabel) { + this.showLabel = showLabel; + } + public String getTitle() { return title; } @@ -304,6 +317,7 @@ public class HighDiscountPackage implements Serializable { return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) && (this.getCompanyId() == null ? other.getCompanyId() == null : this.getCompanyId().equals(other.getCompanyId())) && (this.getUsingAttribution() == null ? other.getUsingAttribution() == null : this.getUsingAttribution().equals(other.getUsingAttribution())) + && (this.getShowLabel() == null ? other.getShowLabel() == null : this.getShowLabel().equals(other.getShowLabel())) && (this.getTitle() == null ? other.getTitle() == null : this.getTitle().equals(other.getTitle())) && (this.getSalesType() == null ? other.getSalesType() == null : this.getSalesType().equals(other.getSalesType())) && (this.getEffectiveTiem() == null ? other.getEffectiveTiem() == null : this.getEffectiveTiem().equals(other.getEffectiveTiem())) @@ -331,6 +345,7 @@ public class HighDiscountPackage implements Serializable { result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); result = prime * result + ((getCompanyId() == null) ? 0 : getCompanyId().hashCode()); result = prime * result + ((getUsingAttribution() == null) ? 0 : getUsingAttribution().hashCode()); + result = prime * result + ((getShowLabel() == null) ? 0 : getShowLabel().hashCode()); result = prime * result + ((getTitle() == null) ? 0 : getTitle().hashCode()); result = prime * result + ((getSalesType() == null) ? 0 : getSalesType().hashCode()); result = prime * result + ((getEffectiveTiem() == null) ? 0 : getEffectiveTiem().hashCode()); @@ -361,6 +376,7 @@ public class HighDiscountPackage implements Serializable { sb.append(", id=").append(id); sb.append(", companyId=").append(companyId); sb.append(", usingAttribution=").append(usingAttribution); + sb.append(", showLabel=").append(showLabel); sb.append(", title=").append(title); sb.append(", salesType=").append(salesType); sb.append(", effectiveTiem=").append(effectiveTiem); diff --git a/hai-service/src/main/java/com/hai/entity/HighDiscountPackageAgentCode.java b/hai-service/src/main/java/com/hai/entity/HighDiscountPackageAgentCode.java new file mode 100644 index 00000000..7244034d --- /dev/null +++ b/hai-service/src/main/java/com/hai/entity/HighDiscountPackageAgentCode.java @@ -0,0 +1,337 @@ +package com.hai.entity; + +import java.io.Serializable; +import java.util.Date; + +/** + * high_discount_package_agent_code + * @author + */ +/** + * + * 代码由工具生成 + * + **/ +public class HighDiscountPackageAgentCode implements Serializable { + /** + * 主键 + */ + private Long id; + + /** + * 券包id + */ + private Long discountPackageId; + + /** + * 券包名称 + */ + private String discountPackageName; + + /** + * 代理商id + */ + private Long agentId; + + /** + * 代理商名称 + */ + private String agentName; + + /** + * 券包实际库存id + */ + private Long discountPackageActualId; + + /** + * 批次id + */ + private Long discountAgentBatchId; + + /** + * 编码 + */ + private String code; + + /** + * 二维码 + */ + private String qrCode; + + /** + * 二维码地址 + */ + private String qrCodeUrl; + + /** + * 创建时间 + */ + private Date createTime; + + /** + * 更新时间 + */ + private Date updateTime; + + /** + * 状态 0:删除 1:待领取 2:待使用 3:已使用 4:已过期 5:已分配 + */ + private Integer status; + + /** + * 操作人 + */ + private Long opId; + + /** + * 操作人名称 + */ + private String opName; + + /** + * ext_1 + */ + private String ext1; + + /** + * ext_2 + */ + private String ext2; + + /** + * ext_3 + */ + private String ext3; + + private static final long serialVersionUID = 1L; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getDiscountPackageId() { + return discountPackageId; + } + + public void setDiscountPackageId(Long discountPackageId) { + this.discountPackageId = discountPackageId; + } + + public String getDiscountPackageName() { + return discountPackageName; + } + + public void setDiscountPackageName(String discountPackageName) { + this.discountPackageName = discountPackageName; + } + + public Long getAgentId() { + return agentId; + } + + public void setAgentId(Long agentId) { + this.agentId = agentId; + } + + public String getAgentName() { + return agentName; + } + + public void setAgentName(String agentName) { + this.agentName = agentName; + } + + public Long getDiscountPackageActualId() { + return discountPackageActualId; + } + + public void setDiscountPackageActualId(Long discountPackageActualId) { + this.discountPackageActualId = discountPackageActualId; + } + + public Long getDiscountAgentBatchId() { + return discountAgentBatchId; + } + + public void setDiscountAgentBatchId(Long discountAgentBatchId) { + this.discountAgentBatchId = discountAgentBatchId; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getQrCode() { + return qrCode; + } + + public void setQrCode(String qrCode) { + this.qrCode = qrCode; + } + + public String getQrCodeUrl() { + return qrCodeUrl; + } + + public void setQrCodeUrl(String qrCodeUrl) { + this.qrCodeUrl = qrCodeUrl; + } + + 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 getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public Long getOpId() { + return opId; + } + + public void setOpId(Long opId) { + this.opId = opId; + } + + public String getOpName() { + return opName; + } + + public void setOpName(String opName) { + this.opName = opName; + } + + public String getExt1() { + return ext1; + } + + public void setExt1(String ext1) { + this.ext1 = ext1; + } + + public String getExt2() { + return ext2; + } + + public void setExt2(String ext2) { + this.ext2 = ext2; + } + + public String getExt3() { + return ext3; + } + + public void setExt3(String ext3) { + this.ext3 = ext3; + } + + @Override + public boolean equals(Object that) { + if (this == that) { + return true; + } + if (that == null) { + return false; + } + if (getClass() != that.getClass()) { + return false; + } + HighDiscountPackageAgentCode other = (HighDiscountPackageAgentCode) that; + return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) + && (this.getDiscountPackageId() == null ? other.getDiscountPackageId() == null : this.getDiscountPackageId().equals(other.getDiscountPackageId())) + && (this.getDiscountPackageName() == null ? other.getDiscountPackageName() == null : this.getDiscountPackageName().equals(other.getDiscountPackageName())) + && (this.getAgentId() == null ? other.getAgentId() == null : this.getAgentId().equals(other.getAgentId())) + && (this.getAgentName() == null ? other.getAgentName() == null : this.getAgentName().equals(other.getAgentName())) + && (this.getDiscountPackageActualId() == null ? other.getDiscountPackageActualId() == null : this.getDiscountPackageActualId().equals(other.getDiscountPackageActualId())) + && (this.getDiscountAgentBatchId() == null ? other.getDiscountAgentBatchId() == null : this.getDiscountAgentBatchId().equals(other.getDiscountAgentBatchId())) + && (this.getCode() == null ? other.getCode() == null : this.getCode().equals(other.getCode())) + && (this.getQrCode() == null ? other.getQrCode() == null : this.getQrCode().equals(other.getQrCode())) + && (this.getQrCodeUrl() == null ? other.getQrCodeUrl() == null : this.getQrCodeUrl().equals(other.getQrCodeUrl())) + && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) + && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime())) + && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus())) + && (this.getOpId() == null ? other.getOpId() == null : this.getOpId().equals(other.getOpId())) + && (this.getOpName() == null ? other.getOpName() == null : this.getOpName().equals(other.getOpName())) + && (this.getExt1() == null ? other.getExt1() == null : this.getExt1().equals(other.getExt1())) + && (this.getExt2() == null ? other.getExt2() == null : this.getExt2().equals(other.getExt2())) + && (this.getExt3() == null ? other.getExt3() == null : this.getExt3().equals(other.getExt3())); + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); + result = prime * result + ((getDiscountPackageId() == null) ? 0 : getDiscountPackageId().hashCode()); + result = prime * result + ((getDiscountPackageName() == null) ? 0 : getDiscountPackageName().hashCode()); + result = prime * result + ((getAgentId() == null) ? 0 : getAgentId().hashCode()); + result = prime * result + ((getAgentName() == null) ? 0 : getAgentName().hashCode()); + result = prime * result + ((getDiscountPackageActualId() == null) ? 0 : getDiscountPackageActualId().hashCode()); + result = prime * result + ((getDiscountAgentBatchId() == null) ? 0 : getDiscountAgentBatchId().hashCode()); + result = prime * result + ((getCode() == null) ? 0 : getCode().hashCode()); + result = prime * result + ((getQrCode() == null) ? 0 : getQrCode().hashCode()); + result = prime * result + ((getQrCodeUrl() == null) ? 0 : getQrCodeUrl().hashCode()); + result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); + result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode()); + result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode()); + result = prime * result + ((getOpId() == null) ? 0 : getOpId().hashCode()); + result = prime * result + ((getOpName() == null) ? 0 : getOpName().hashCode()); + result = prime * result + ((getExt1() == null) ? 0 : getExt1().hashCode()); + result = prime * result + ((getExt2() == null) ? 0 : getExt2().hashCode()); + result = prime * result + ((getExt3() == null) ? 0 : getExt3().hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append(" ["); + sb.append("Hash = ").append(hashCode()); + sb.append(", id=").append(id); + sb.append(", discountPackageId=").append(discountPackageId); + sb.append(", discountPackageName=").append(discountPackageName); + sb.append(", agentId=").append(agentId); + sb.append(", agentName=").append(agentName); + sb.append(", discountPackageActualId=").append(discountPackageActualId); + sb.append(", discountAgentBatchId=").append(discountAgentBatchId); + sb.append(", code=").append(code); + sb.append(", qrCode=").append(qrCode); + sb.append(", qrCodeUrl=").append(qrCodeUrl); + sb.append(", createTime=").append(createTime); + sb.append(", updateTime=").append(updateTime); + sb.append(", status=").append(status); + sb.append(", opId=").append(opId); + sb.append(", opName=").append(opName); + sb.append(", ext1=").append(ext1); + sb.append(", ext2=").append(ext2); + sb.append(", ext3=").append(ext3); + sb.append(", serialVersionUID=").append(serialVersionUID); + sb.append("]"); + return sb.toString(); + } +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/entity/HighDiscountPackageAgentCodeExample.java b/hai-service/src/main/java/com/hai/entity/HighDiscountPackageAgentCodeExample.java new file mode 100644 index 00000000..de87ecbd --- /dev/null +++ b/hai-service/src/main/java/com/hai/entity/HighDiscountPackageAgentCodeExample.java @@ -0,0 +1,1393 @@ +package com.hai.entity; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class HighDiscountPackageAgentCodeExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + private Integer limit; + + private Long offset; + + public HighDiscountPackageAgentCodeExample() { + oredCriteria = new ArrayList(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + public void setLimit(Integer limit) { + this.limit = limit; + } + + public Integer getLimit() { + return limit; + } + + public void setOffset(Long offset) { + this.offset = offset; + } + + public Long getOffset() { + return offset; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andDiscountPackageIdIsNull() { + addCriterion("discount_package_id is null"); + return (Criteria) this; + } + + public Criteria andDiscountPackageIdIsNotNull() { + addCriterion("discount_package_id is not null"); + return (Criteria) this; + } + + public Criteria andDiscountPackageIdEqualTo(Long value) { + addCriterion("discount_package_id =", value, "discountPackageId"); + return (Criteria) this; + } + + public Criteria andDiscountPackageIdNotEqualTo(Long value) { + addCriterion("discount_package_id <>", value, "discountPackageId"); + return (Criteria) this; + } + + public Criteria andDiscountPackageIdGreaterThan(Long value) { + addCriterion("discount_package_id >", value, "discountPackageId"); + return (Criteria) this; + } + + public Criteria andDiscountPackageIdGreaterThanOrEqualTo(Long value) { + addCriterion("discount_package_id >=", value, "discountPackageId"); + return (Criteria) this; + } + + public Criteria andDiscountPackageIdLessThan(Long value) { + addCriterion("discount_package_id <", value, "discountPackageId"); + return (Criteria) this; + } + + public Criteria andDiscountPackageIdLessThanOrEqualTo(Long value) { + addCriterion("discount_package_id <=", value, "discountPackageId"); + return (Criteria) this; + } + + public Criteria andDiscountPackageIdIn(List values) { + addCriterion("discount_package_id in", values, "discountPackageId"); + return (Criteria) this; + } + + public Criteria andDiscountPackageIdNotIn(List values) { + addCriterion("discount_package_id not in", values, "discountPackageId"); + return (Criteria) this; + } + + public Criteria andDiscountPackageIdBetween(Long value1, Long value2) { + addCriterion("discount_package_id between", value1, value2, "discountPackageId"); + return (Criteria) this; + } + + public Criteria andDiscountPackageIdNotBetween(Long value1, Long value2) { + addCriterion("discount_package_id not between", value1, value2, "discountPackageId"); + return (Criteria) this; + } + + public Criteria andDiscountPackageNameIsNull() { + addCriterion("discount_package_name is null"); + return (Criteria) this; + } + + public Criteria andDiscountPackageNameIsNotNull() { + addCriterion("discount_package_name is not null"); + return (Criteria) this; + } + + public Criteria andDiscountPackageNameEqualTo(String value) { + addCriterion("discount_package_name =", value, "discountPackageName"); + return (Criteria) this; + } + + public Criteria andDiscountPackageNameNotEqualTo(String value) { + addCriterion("discount_package_name <>", value, "discountPackageName"); + return (Criteria) this; + } + + public Criteria andDiscountPackageNameGreaterThan(String value) { + addCriterion("discount_package_name >", value, "discountPackageName"); + return (Criteria) this; + } + + public Criteria andDiscountPackageNameGreaterThanOrEqualTo(String value) { + addCriterion("discount_package_name >=", value, "discountPackageName"); + return (Criteria) this; + } + + public Criteria andDiscountPackageNameLessThan(String value) { + addCriterion("discount_package_name <", value, "discountPackageName"); + return (Criteria) this; + } + + public Criteria andDiscountPackageNameLessThanOrEqualTo(String value) { + addCriterion("discount_package_name <=", value, "discountPackageName"); + return (Criteria) this; + } + + public Criteria andDiscountPackageNameLike(String value) { + addCriterion("discount_package_name like", value, "discountPackageName"); + return (Criteria) this; + } + + public Criteria andDiscountPackageNameNotLike(String value) { + addCriterion("discount_package_name not like", value, "discountPackageName"); + return (Criteria) this; + } + + public Criteria andDiscountPackageNameIn(List values) { + addCriterion("discount_package_name in", values, "discountPackageName"); + return (Criteria) this; + } + + public Criteria andDiscountPackageNameNotIn(List values) { + addCriterion("discount_package_name not in", values, "discountPackageName"); + return (Criteria) this; + } + + public Criteria andDiscountPackageNameBetween(String value1, String value2) { + addCriterion("discount_package_name between", value1, value2, "discountPackageName"); + return (Criteria) this; + } + + public Criteria andDiscountPackageNameNotBetween(String value1, String value2) { + addCriterion("discount_package_name not between", value1, value2, "discountPackageName"); + return (Criteria) this; + } + + public Criteria andAgentIdIsNull() { + addCriterion("agent_id is null"); + return (Criteria) this; + } + + public Criteria andAgentIdIsNotNull() { + addCriterion("agent_id is not null"); + return (Criteria) this; + } + + public Criteria andAgentIdEqualTo(Long value) { + addCriterion("agent_id =", value, "agentId"); + return (Criteria) this; + } + + public Criteria andAgentIdNotEqualTo(Long value) { + addCriterion("agent_id <>", value, "agentId"); + return (Criteria) this; + } + + public Criteria andAgentIdGreaterThan(Long value) { + addCriterion("agent_id >", value, "agentId"); + return (Criteria) this; + } + + public Criteria andAgentIdGreaterThanOrEqualTo(Long value) { + addCriterion("agent_id >=", value, "agentId"); + return (Criteria) this; + } + + public Criteria andAgentIdLessThan(Long value) { + addCriterion("agent_id <", value, "agentId"); + return (Criteria) this; + } + + public Criteria andAgentIdLessThanOrEqualTo(Long value) { + addCriterion("agent_id <=", value, "agentId"); + return (Criteria) this; + } + + public Criteria andAgentIdIn(List values) { + addCriterion("agent_id in", values, "agentId"); + return (Criteria) this; + } + + public Criteria andAgentIdNotIn(List values) { + addCriterion("agent_id not in", values, "agentId"); + return (Criteria) this; + } + + public Criteria andAgentIdBetween(Long value1, Long value2) { + addCriterion("agent_id between", value1, value2, "agentId"); + return (Criteria) this; + } + + public Criteria andAgentIdNotBetween(Long value1, Long value2) { + addCriterion("agent_id not between", value1, value2, "agentId"); + return (Criteria) this; + } + + public Criteria andAgentNameIsNull() { + addCriterion("agent_name is null"); + return (Criteria) this; + } + + public Criteria andAgentNameIsNotNull() { + addCriterion("agent_name is not null"); + return (Criteria) this; + } + + public Criteria andAgentNameEqualTo(String value) { + addCriterion("agent_name =", value, "agentName"); + return (Criteria) this; + } + + public Criteria andAgentNameNotEqualTo(String value) { + addCriterion("agent_name <>", value, "agentName"); + return (Criteria) this; + } + + public Criteria andAgentNameGreaterThan(String value) { + addCriterion("agent_name >", value, "agentName"); + return (Criteria) this; + } + + public Criteria andAgentNameGreaterThanOrEqualTo(String value) { + addCriterion("agent_name >=", value, "agentName"); + return (Criteria) this; + } + + public Criteria andAgentNameLessThan(String value) { + addCriterion("agent_name <", value, "agentName"); + return (Criteria) this; + } + + public Criteria andAgentNameLessThanOrEqualTo(String value) { + addCriterion("agent_name <=", value, "agentName"); + return (Criteria) this; + } + + public Criteria andAgentNameLike(String value) { + addCriterion("agent_name like", value, "agentName"); + return (Criteria) this; + } + + public Criteria andAgentNameNotLike(String value) { + addCriterion("agent_name not like", value, "agentName"); + return (Criteria) this; + } + + public Criteria andAgentNameIn(List values) { + addCriterion("agent_name in", values, "agentName"); + return (Criteria) this; + } + + public Criteria andAgentNameNotIn(List values) { + addCriterion("agent_name not in", values, "agentName"); + return (Criteria) this; + } + + public Criteria andAgentNameBetween(String value1, String value2) { + addCriterion("agent_name between", value1, value2, "agentName"); + return (Criteria) this; + } + + public Criteria andAgentNameNotBetween(String value1, String value2) { + addCriterion("agent_name not between", value1, value2, "agentName"); + return (Criteria) this; + } + + public Criteria andDiscountPackageActualIdIsNull() { + addCriterion("discount_package_actual_id is null"); + return (Criteria) this; + } + + public Criteria andDiscountPackageActualIdIsNotNull() { + addCriterion("discount_package_actual_id is not null"); + return (Criteria) this; + } + + public Criteria andDiscountPackageActualIdEqualTo(Long value) { + addCriterion("discount_package_actual_id =", value, "discountPackageActualId"); + return (Criteria) this; + } + + public Criteria andDiscountPackageActualIdNotEqualTo(Long value) { + addCriterion("discount_package_actual_id <>", value, "discountPackageActualId"); + return (Criteria) this; + } + + public Criteria andDiscountPackageActualIdGreaterThan(Long value) { + addCriterion("discount_package_actual_id >", value, "discountPackageActualId"); + return (Criteria) this; + } + + public Criteria andDiscountPackageActualIdGreaterThanOrEqualTo(Long value) { + addCriterion("discount_package_actual_id >=", value, "discountPackageActualId"); + return (Criteria) this; + } + + public Criteria andDiscountPackageActualIdLessThan(Long value) { + addCriterion("discount_package_actual_id <", value, "discountPackageActualId"); + return (Criteria) this; + } + + public Criteria andDiscountPackageActualIdLessThanOrEqualTo(Long value) { + addCriterion("discount_package_actual_id <=", value, "discountPackageActualId"); + return (Criteria) this; + } + + public Criteria andDiscountPackageActualIdIn(List values) { + addCriterion("discount_package_actual_id in", values, "discountPackageActualId"); + return (Criteria) this; + } + + public Criteria andDiscountPackageActualIdNotIn(List values) { + addCriterion("discount_package_actual_id not in", values, "discountPackageActualId"); + return (Criteria) this; + } + + public Criteria andDiscountPackageActualIdBetween(Long value1, Long value2) { + addCriterion("discount_package_actual_id between", value1, value2, "discountPackageActualId"); + return (Criteria) this; + } + + public Criteria andDiscountPackageActualIdNotBetween(Long value1, Long value2) { + addCriterion("discount_package_actual_id not between", value1, value2, "discountPackageActualId"); + return (Criteria) this; + } + + public Criteria andDiscountAgentBatchIdIsNull() { + addCriterion("discount_agent_batch_id is null"); + return (Criteria) this; + } + + public Criteria andDiscountAgentBatchIdIsNotNull() { + addCriterion("discount_agent_batch_id is not null"); + return (Criteria) this; + } + + public Criteria andDiscountAgentBatchIdEqualTo(Long value) { + addCriterion("discount_agent_batch_id =", value, "discountAgentBatchId"); + return (Criteria) this; + } + + public Criteria andDiscountAgentBatchIdNotEqualTo(Long value) { + addCriterion("discount_agent_batch_id <>", value, "discountAgentBatchId"); + return (Criteria) this; + } + + public Criteria andDiscountAgentBatchIdGreaterThan(Long value) { + addCriterion("discount_agent_batch_id >", value, "discountAgentBatchId"); + return (Criteria) this; + } + + public Criteria andDiscountAgentBatchIdGreaterThanOrEqualTo(Long value) { + addCriterion("discount_agent_batch_id >=", value, "discountAgentBatchId"); + return (Criteria) this; + } + + public Criteria andDiscountAgentBatchIdLessThan(Long value) { + addCriterion("discount_agent_batch_id <", value, "discountAgentBatchId"); + return (Criteria) this; + } + + public Criteria andDiscountAgentBatchIdLessThanOrEqualTo(Long value) { + addCriterion("discount_agent_batch_id <=", value, "discountAgentBatchId"); + return (Criteria) this; + } + + public Criteria andDiscountAgentBatchIdIn(List values) { + addCriterion("discount_agent_batch_id in", values, "discountAgentBatchId"); + return (Criteria) this; + } + + public Criteria andDiscountAgentBatchIdNotIn(List values) { + addCriterion("discount_agent_batch_id not in", values, "discountAgentBatchId"); + return (Criteria) this; + } + + public Criteria andDiscountAgentBatchIdBetween(Long value1, Long value2) { + addCriterion("discount_agent_batch_id between", value1, value2, "discountAgentBatchId"); + return (Criteria) this; + } + + public Criteria andDiscountAgentBatchIdNotBetween(Long value1, Long value2) { + addCriterion("discount_agent_batch_id not between", value1, value2, "discountAgentBatchId"); + return (Criteria) this; + } + + public Criteria andCodeIsNull() { + addCriterion("code is null"); + return (Criteria) this; + } + + public Criteria andCodeIsNotNull() { + addCriterion("code is not null"); + return (Criteria) this; + } + + public Criteria andCodeEqualTo(String value) { + addCriterion("code =", value, "code"); + return (Criteria) this; + } + + public Criteria andCodeNotEqualTo(String value) { + addCriterion("code <>", value, "code"); + return (Criteria) this; + } + + public Criteria andCodeGreaterThan(String value) { + addCriterion("code >", value, "code"); + return (Criteria) this; + } + + public Criteria andCodeGreaterThanOrEqualTo(String value) { + addCriterion("code >=", value, "code"); + return (Criteria) this; + } + + public Criteria andCodeLessThan(String value) { + addCriterion("code <", value, "code"); + return (Criteria) this; + } + + public Criteria andCodeLessThanOrEqualTo(String value) { + addCriterion("code <=", value, "code"); + return (Criteria) this; + } + + public Criteria andCodeLike(String value) { + addCriterion("code like", value, "code"); + return (Criteria) this; + } + + public Criteria andCodeNotLike(String value) { + addCriterion("code not like", value, "code"); + return (Criteria) this; + } + + public Criteria andCodeIn(List values) { + addCriterion("code in", values, "code"); + return (Criteria) this; + } + + public Criteria andCodeNotIn(List values) { + addCriterion("code not in", values, "code"); + return (Criteria) this; + } + + public Criteria andCodeBetween(String value1, String value2) { + addCriterion("code between", value1, value2, "code"); + return (Criteria) this; + } + + public Criteria andCodeNotBetween(String value1, String value2) { + addCriterion("code not between", value1, value2, "code"); + return (Criteria) this; + } + + public Criteria andQrCodeIsNull() { + addCriterion("qr_code is null"); + return (Criteria) this; + } + + public Criteria andQrCodeIsNotNull() { + addCriterion("qr_code is not null"); + return (Criteria) this; + } + + public Criteria andQrCodeEqualTo(String value) { + addCriterion("qr_code =", value, "qrCode"); + return (Criteria) this; + } + + public Criteria andQrCodeNotEqualTo(String value) { + addCriterion("qr_code <>", value, "qrCode"); + return (Criteria) this; + } + + public Criteria andQrCodeGreaterThan(String value) { + addCriterion("qr_code >", value, "qrCode"); + return (Criteria) this; + } + + public Criteria andQrCodeGreaterThanOrEqualTo(String value) { + addCriterion("qr_code >=", value, "qrCode"); + return (Criteria) this; + } + + public Criteria andQrCodeLessThan(String value) { + addCriterion("qr_code <", value, "qrCode"); + return (Criteria) this; + } + + public Criteria andQrCodeLessThanOrEqualTo(String value) { + addCriterion("qr_code <=", value, "qrCode"); + return (Criteria) this; + } + + public Criteria andQrCodeLike(String value) { + addCriterion("qr_code like", value, "qrCode"); + return (Criteria) this; + } + + public Criteria andQrCodeNotLike(String value) { + addCriterion("qr_code not like", value, "qrCode"); + return (Criteria) this; + } + + public Criteria andQrCodeIn(List values) { + addCriterion("qr_code in", values, "qrCode"); + return (Criteria) this; + } + + public Criteria andQrCodeNotIn(List values) { + addCriterion("qr_code not in", values, "qrCode"); + return (Criteria) this; + } + + public Criteria andQrCodeBetween(String value1, String value2) { + addCriterion("qr_code between", value1, value2, "qrCode"); + return (Criteria) this; + } + + public Criteria andQrCodeNotBetween(String value1, String value2) { + addCriterion("qr_code not between", value1, value2, "qrCode"); + return (Criteria) this; + } + + public Criteria andQrCodeUrlIsNull() { + addCriterion("qr_code_url is null"); + return (Criteria) this; + } + + public Criteria andQrCodeUrlIsNotNull() { + addCriterion("qr_code_url is not null"); + return (Criteria) this; + } + + public Criteria andQrCodeUrlEqualTo(String value) { + addCriterion("qr_code_url =", value, "qrCodeUrl"); + return (Criteria) this; + } + + public Criteria andQrCodeUrlNotEqualTo(String value) { + addCriterion("qr_code_url <>", value, "qrCodeUrl"); + return (Criteria) this; + } + + public Criteria andQrCodeUrlGreaterThan(String value) { + addCriterion("qr_code_url >", value, "qrCodeUrl"); + return (Criteria) this; + } + + public Criteria andQrCodeUrlGreaterThanOrEqualTo(String value) { + addCriterion("qr_code_url >=", value, "qrCodeUrl"); + return (Criteria) this; + } + + public Criteria andQrCodeUrlLessThan(String value) { + addCriterion("qr_code_url <", value, "qrCodeUrl"); + return (Criteria) this; + } + + public Criteria andQrCodeUrlLessThanOrEqualTo(String value) { + addCriterion("qr_code_url <=", value, "qrCodeUrl"); + return (Criteria) this; + } + + public Criteria andQrCodeUrlLike(String value) { + addCriterion("qr_code_url like", value, "qrCodeUrl"); + return (Criteria) this; + } + + public Criteria andQrCodeUrlNotLike(String value) { + addCriterion("qr_code_url not like", value, "qrCodeUrl"); + return (Criteria) this; + } + + public Criteria andQrCodeUrlIn(List values) { + addCriterion("qr_code_url in", values, "qrCodeUrl"); + return (Criteria) this; + } + + public Criteria andQrCodeUrlNotIn(List values) { + addCriterion("qr_code_url not in", values, "qrCodeUrl"); + return (Criteria) this; + } + + public Criteria andQrCodeUrlBetween(String value1, String value2) { + addCriterion("qr_code_url between", value1, value2, "qrCodeUrl"); + return (Criteria) this; + } + + public Criteria andQrCodeUrlNotBetween(String value1, String value2) { + addCriterion("qr_code_url not between", value1, value2, "qrCodeUrl"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNull() { + addCriterion("create_time is null"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNotNull() { + addCriterion("create_time is not null"); + return (Criteria) this; + } + + public Criteria andCreateTimeEqualTo(Date value) { + addCriterion("create_time =", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotEqualTo(Date value) { + addCriterion("create_time <>", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThan(Date value) { + addCriterion("create_time >", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) { + addCriterion("create_time >=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThan(Date value) { + addCriterion("create_time <", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThanOrEqualTo(Date value) { + addCriterion("create_time <=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeIn(List values) { + addCriterion("create_time in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotIn(List values) { + addCriterion("create_time not in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeBetween(Date value1, Date value2) { + addCriterion("create_time between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotBetween(Date value1, Date value2) { + addCriterion("create_time not between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNull() { + addCriterion("update_time is null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNotNull() { + addCriterion("update_time is not null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeEqualTo(Date value) { + addCriterion("update_time =", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotEqualTo(Date value) { + addCriterion("update_time <>", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThan(Date value) { + addCriterion("update_time >", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) { + addCriterion("update_time >=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThan(Date value) { + addCriterion("update_time <", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThanOrEqualTo(Date value) { + addCriterion("update_time <=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIn(List values) { + addCriterion("update_time in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotIn(List values) { + addCriterion("update_time not in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeBetween(Date value1, Date value2) { + addCriterion("update_time between", value1, value2, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotBetween(Date value1, Date value2) { + addCriterion("update_time not between", value1, value2, "updateTime"); + return (Criteria) this; + } + + public Criteria andStatusIsNull() { + addCriterion("`status` is null"); + return (Criteria) this; + } + + public Criteria andStatusIsNotNull() { + addCriterion("`status` is not null"); + return (Criteria) this; + } + + public Criteria andStatusEqualTo(Integer value) { + addCriterion("`status` =", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotEqualTo(Integer value) { + addCriterion("`status` <>", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusGreaterThan(Integer value) { + addCriterion("`status` >", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusGreaterThanOrEqualTo(Integer value) { + addCriterion("`status` >=", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLessThan(Integer value) { + addCriterion("`status` <", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLessThanOrEqualTo(Integer value) { + addCriterion("`status` <=", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusIn(List values) { + addCriterion("`status` in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotIn(List values) { + addCriterion("`status` not in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusBetween(Integer value1, Integer value2) { + addCriterion("`status` between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotBetween(Integer value1, Integer value2) { + addCriterion("`status` not between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria andOpIdIsNull() { + addCriterion("op_id is null"); + return (Criteria) this; + } + + public Criteria andOpIdIsNotNull() { + addCriterion("op_id is not null"); + return (Criteria) this; + } + + public Criteria andOpIdEqualTo(Long value) { + addCriterion("op_id =", value, "opId"); + return (Criteria) this; + } + + public Criteria andOpIdNotEqualTo(Long value) { + addCriterion("op_id <>", value, "opId"); + return (Criteria) this; + } + + public Criteria andOpIdGreaterThan(Long value) { + addCriterion("op_id >", value, "opId"); + return (Criteria) this; + } + + public Criteria andOpIdGreaterThanOrEqualTo(Long value) { + addCriterion("op_id >=", value, "opId"); + return (Criteria) this; + } + + public Criteria andOpIdLessThan(Long value) { + addCriterion("op_id <", value, "opId"); + return (Criteria) this; + } + + public Criteria andOpIdLessThanOrEqualTo(Long value) { + addCriterion("op_id <=", value, "opId"); + return (Criteria) this; + } + + public Criteria andOpIdIn(List values) { + addCriterion("op_id in", values, "opId"); + return (Criteria) this; + } + + public Criteria andOpIdNotIn(List values) { + addCriterion("op_id not in", values, "opId"); + return (Criteria) this; + } + + public Criteria andOpIdBetween(Long value1, Long value2) { + addCriterion("op_id between", value1, value2, "opId"); + return (Criteria) this; + } + + public Criteria andOpIdNotBetween(Long value1, Long value2) { + addCriterion("op_id not between", value1, value2, "opId"); + return (Criteria) this; + } + + public Criteria andOpNameIsNull() { + addCriterion("op_name is null"); + return (Criteria) this; + } + + public Criteria andOpNameIsNotNull() { + addCriterion("op_name is not null"); + return (Criteria) this; + } + + public Criteria andOpNameEqualTo(String value) { + addCriterion("op_name =", value, "opName"); + return (Criteria) this; + } + + public Criteria andOpNameNotEqualTo(String value) { + addCriterion("op_name <>", value, "opName"); + return (Criteria) this; + } + + public Criteria andOpNameGreaterThan(String value) { + addCriterion("op_name >", value, "opName"); + return (Criteria) this; + } + + public Criteria andOpNameGreaterThanOrEqualTo(String value) { + addCriterion("op_name >=", value, "opName"); + return (Criteria) this; + } + + public Criteria andOpNameLessThan(String value) { + addCriterion("op_name <", value, "opName"); + return (Criteria) this; + } + + public Criteria andOpNameLessThanOrEqualTo(String value) { + addCriterion("op_name <=", value, "opName"); + return (Criteria) this; + } + + public Criteria andOpNameLike(String value) { + addCriterion("op_name like", value, "opName"); + return (Criteria) this; + } + + public Criteria andOpNameNotLike(String value) { + addCriterion("op_name not like", value, "opName"); + return (Criteria) this; + } + + public Criteria andOpNameIn(List values) { + addCriterion("op_name in", values, "opName"); + return (Criteria) this; + } + + public Criteria andOpNameNotIn(List values) { + addCriterion("op_name not in", values, "opName"); + return (Criteria) this; + } + + public Criteria andOpNameBetween(String value1, String value2) { + addCriterion("op_name between", value1, value2, "opName"); + return (Criteria) this; + } + + public Criteria andOpNameNotBetween(String value1, String value2) { + addCriterion("op_name not between", value1, value2, "opName"); + return (Criteria) this; + } + + public Criteria andExt1IsNull() { + addCriterion("ext_1 is null"); + return (Criteria) this; + } + + public Criteria andExt1IsNotNull() { + addCriterion("ext_1 is not null"); + return (Criteria) this; + } + + public Criteria andExt1EqualTo(String value) { + addCriterion("ext_1 =", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1NotEqualTo(String value) { + addCriterion("ext_1 <>", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1GreaterThan(String value) { + addCriterion("ext_1 >", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1GreaterThanOrEqualTo(String value) { + addCriterion("ext_1 >=", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1LessThan(String value) { + addCriterion("ext_1 <", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1LessThanOrEqualTo(String value) { + addCriterion("ext_1 <=", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1Like(String value) { + addCriterion("ext_1 like", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1NotLike(String value) { + addCriterion("ext_1 not like", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1In(List values) { + addCriterion("ext_1 in", values, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1NotIn(List values) { + addCriterion("ext_1 not in", values, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1Between(String value1, String value2) { + addCriterion("ext_1 between", value1, value2, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1NotBetween(String value1, String value2) { + addCriterion("ext_1 not between", value1, value2, "ext1"); + return (Criteria) this; + } + + public Criteria andExt2IsNull() { + addCriterion("ext_2 is null"); + return (Criteria) this; + } + + public Criteria andExt2IsNotNull() { + addCriterion("ext_2 is not null"); + return (Criteria) this; + } + + public Criteria andExt2EqualTo(String value) { + addCriterion("ext_2 =", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2NotEqualTo(String value) { + addCriterion("ext_2 <>", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2GreaterThan(String value) { + addCriterion("ext_2 >", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2GreaterThanOrEqualTo(String value) { + addCriterion("ext_2 >=", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2LessThan(String value) { + addCriterion("ext_2 <", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2LessThanOrEqualTo(String value) { + addCriterion("ext_2 <=", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2Like(String value) { + addCriterion("ext_2 like", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2NotLike(String value) { + addCriterion("ext_2 not like", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2In(List values) { + addCriterion("ext_2 in", values, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2NotIn(List values) { + addCriterion("ext_2 not in", values, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2Between(String value1, String value2) { + addCriterion("ext_2 between", value1, value2, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2NotBetween(String value1, String value2) { + addCriterion("ext_2 not between", value1, value2, "ext2"); + return (Criteria) this; + } + + public Criteria andExt3IsNull() { + addCriterion("ext_3 is null"); + return (Criteria) this; + } + + public Criteria andExt3IsNotNull() { + addCriterion("ext_3 is not null"); + return (Criteria) this; + } + + public Criteria andExt3EqualTo(String value) { + addCriterion("ext_3 =", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3NotEqualTo(String value) { + addCriterion("ext_3 <>", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3GreaterThan(String value) { + addCriterion("ext_3 >", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3GreaterThanOrEqualTo(String value) { + addCriterion("ext_3 >=", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3LessThan(String value) { + addCriterion("ext_3 <", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3LessThanOrEqualTo(String value) { + addCriterion("ext_3 <=", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3Like(String value) { + addCriterion("ext_3 like", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3NotLike(String value) { + addCriterion("ext_3 not like", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3In(List values) { + addCriterion("ext_3 in", values, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3NotIn(List values) { + addCriterion("ext_3 not in", values, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3Between(String value1, String value2) { + addCriterion("ext_3 between", value1, value2, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3NotBetween(String value1, String value2) { + addCriterion("ext_3 not between", value1, value2, "ext3"); + return (Criteria) this; + } + } + + /** + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/entity/HighDiscountPackageAgentRecord.java b/hai-service/src/main/java/com/hai/entity/HighDiscountPackageAgentRecord.java index 2253010a..6d9bc4dd 100644 --- a/hai-service/src/main/java/com/hai/entity/HighDiscountPackageAgentRecord.java +++ b/hai-service/src/main/java/com/hai/entity/HighDiscountPackageAgentRecord.java @@ -18,6 +18,11 @@ public class HighDiscountPackageAgentRecord implements Serializable { */ private Long id; + /** + * 类型:1:分发 2:分配 + */ + private Integer type; + /** * 优惠券包名称 */ @@ -103,6 +108,14 @@ public class HighDiscountPackageAgentRecord implements Serializable { this.id = id; } + public Integer getType() { + return type; + } + + public void setType(Integer type) { + this.type = type; + } + public String getDiscountPackageTitle() { return discountPackageTitle; } @@ -236,6 +249,7 @@ public class HighDiscountPackageAgentRecord implements Serializable { } HighDiscountPackageAgentRecord other = (HighDiscountPackageAgentRecord) that; return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) + && (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType())) && (this.getDiscountPackageTitle() == null ? other.getDiscountPackageTitle() == null : this.getDiscountPackageTitle().equals(other.getDiscountPackageTitle())) && (this.getDiscountPackageId() == null ? other.getDiscountPackageId() == null : this.getDiscountPackageId().equals(other.getDiscountPackageId())) && (this.getAgentName() == null ? other.getAgentName() == null : this.getAgentName().equals(other.getAgentName())) @@ -258,6 +272,7 @@ public class HighDiscountPackageAgentRecord implements Serializable { final int prime = 31; int result = 1; result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); + result = prime * result + ((getType() == null) ? 0 : getType().hashCode()); result = prime * result + ((getDiscountPackageTitle() == null) ? 0 : getDiscountPackageTitle().hashCode()); result = prime * result + ((getDiscountPackageId() == null) ? 0 : getDiscountPackageId().hashCode()); result = prime * result + ((getAgentName() == null) ? 0 : getAgentName().hashCode()); @@ -283,6 +298,7 @@ public class HighDiscountPackageAgentRecord implements Serializable { sb.append(" ["); sb.append("Hash = ").append(hashCode()); sb.append(", id=").append(id); + sb.append(", type=").append(type); sb.append(", discountPackageTitle=").append(discountPackageTitle); sb.append(", discountPackageId=").append(discountPackageId); sb.append(", agentName=").append(agentName); diff --git a/hai-service/src/main/java/com/hai/entity/HighDiscountPackageAgentRecordExample.java b/hai-service/src/main/java/com/hai/entity/HighDiscountPackageAgentRecordExample.java index 6ed9897e..3274a479 100644 --- a/hai-service/src/main/java/com/hai/entity/HighDiscountPackageAgentRecordExample.java +++ b/hai-service/src/main/java/com/hai/entity/HighDiscountPackageAgentRecordExample.java @@ -185,6 +185,66 @@ public class HighDiscountPackageAgentRecordExample { return (Criteria) this; } + public Criteria andTypeIsNull() { + addCriterion("`type` is null"); + return (Criteria) this; + } + + public Criteria andTypeIsNotNull() { + addCriterion("`type` is not null"); + return (Criteria) this; + } + + public Criteria andTypeEqualTo(Integer value) { + addCriterion("`type` =", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotEqualTo(Integer value) { + addCriterion("`type` <>", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThan(Integer value) { + addCriterion("`type` >", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThanOrEqualTo(Integer value) { + addCriterion("`type` >=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThan(Integer value) { + addCriterion("`type` <", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThanOrEqualTo(Integer value) { + addCriterion("`type` <=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeIn(List values) { + addCriterion("`type` in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotIn(List values) { + addCriterion("`type` not in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeBetween(Integer value1, Integer value2) { + addCriterion("`type` between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotBetween(Integer value1, Integer value2) { + addCriterion("`type` not between", value1, value2, "type"); + return (Criteria) this; + } + public Criteria andDiscountPackageTitleIsNull() { addCriterion("discount_package_title is null"); return (Criteria) this; diff --git a/hai-service/src/main/java/com/hai/entity/HighDiscountPackageAgentRel.java b/hai-service/src/main/java/com/hai/entity/HighDiscountPackageAgentRel.java index a56abe45..5c7c6426 100644 --- a/hai-service/src/main/java/com/hai/entity/HighDiscountPackageAgentRel.java +++ b/hai-service/src/main/java/com/hai/entity/HighDiscountPackageAgentRel.java @@ -18,6 +18,11 @@ public class HighDiscountPackageAgentRel implements Serializable { */ private Long id; + /** + * 类型:1分发 2:分配 + */ + private Integer type; + /** * 优惠券包名称 */ @@ -98,6 +103,14 @@ public class HighDiscountPackageAgentRel implements Serializable { this.id = id; } + public Integer getType() { + return type; + } + + public void setType(Integer type) { + this.type = type; + } + public String getDiscountPackageTitle() { return discountPackageTitle; } @@ -223,6 +236,7 @@ public class HighDiscountPackageAgentRel implements Serializable { } HighDiscountPackageAgentRel other = (HighDiscountPackageAgentRel) that; return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) + && (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType())) && (this.getDiscountPackageTitle() == null ? other.getDiscountPackageTitle() == null : this.getDiscountPackageTitle().equals(other.getDiscountPackageTitle())) && (this.getDiscountPackageId() == null ? other.getDiscountPackageId() == null : this.getDiscountPackageId().equals(other.getDiscountPackageId())) && (this.getAgentName() == null ? other.getAgentName() == null : this.getAgentName().equals(other.getAgentName())) @@ -244,6 +258,7 @@ public class HighDiscountPackageAgentRel implements Serializable { final int prime = 31; int result = 1; result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); + result = prime * result + ((getType() == null) ? 0 : getType().hashCode()); result = prime * result + ((getDiscountPackageTitle() == null) ? 0 : getDiscountPackageTitle().hashCode()); result = prime * result + ((getDiscountPackageId() == null) ? 0 : getDiscountPackageId().hashCode()); result = prime * result + ((getAgentName() == null) ? 0 : getAgentName().hashCode()); @@ -268,6 +283,7 @@ public class HighDiscountPackageAgentRel implements Serializable { sb.append(" ["); sb.append("Hash = ").append(hashCode()); sb.append(", id=").append(id); + sb.append(", type=").append(type); sb.append(", discountPackageTitle=").append(discountPackageTitle); sb.append(", discountPackageId=").append(discountPackageId); sb.append(", agentName=").append(agentName); diff --git a/hai-service/src/main/java/com/hai/entity/HighDiscountPackageAgentRelExample.java b/hai-service/src/main/java/com/hai/entity/HighDiscountPackageAgentRelExample.java index 6f5e1b2d..37a478cd 100644 --- a/hai-service/src/main/java/com/hai/entity/HighDiscountPackageAgentRelExample.java +++ b/hai-service/src/main/java/com/hai/entity/HighDiscountPackageAgentRelExample.java @@ -185,6 +185,66 @@ public class HighDiscountPackageAgentRelExample { return (Criteria) this; } + public Criteria andTypeIsNull() { + addCriterion("`type` is null"); + return (Criteria) this; + } + + public Criteria andTypeIsNotNull() { + addCriterion("`type` is not null"); + return (Criteria) this; + } + + public Criteria andTypeEqualTo(Integer value) { + addCriterion("`type` =", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotEqualTo(Integer value) { + addCriterion("`type` <>", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThan(Integer value) { + addCriterion("`type` >", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThanOrEqualTo(Integer value) { + addCriterion("`type` >=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThan(Integer value) { + addCriterion("`type` <", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThanOrEqualTo(Integer value) { + addCriterion("`type` <=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeIn(List values) { + addCriterion("`type` in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotIn(List values) { + addCriterion("`type` not in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeBetween(Integer value1, Integer value2) { + addCriterion("`type` between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotBetween(Integer value1, Integer value2) { + addCriterion("`type` not between", value1, value2, "type"); + return (Criteria) this; + } + public Criteria andDiscountPackageTitleIsNull() { addCriterion("discount_package_title is null"); return (Criteria) this; diff --git a/hai-service/src/main/java/com/hai/entity/HighDiscountPackageExample.java b/hai-service/src/main/java/com/hai/entity/HighDiscountPackageExample.java index b8014001..8ea827a1 100644 --- a/hai-service/src/main/java/com/hai/entity/HighDiscountPackageExample.java +++ b/hai-service/src/main/java/com/hai/entity/HighDiscountPackageExample.java @@ -306,6 +306,76 @@ public class HighDiscountPackageExample { return (Criteria) this; } + public Criteria andShowLabelIsNull() { + addCriterion("show_label is null"); + return (Criteria) this; + } + + public Criteria andShowLabelIsNotNull() { + addCriterion("show_label is not null"); + return (Criteria) this; + } + + public Criteria andShowLabelEqualTo(String value) { + addCriterion("show_label =", value, "showLabel"); + return (Criteria) this; + } + + public Criteria andShowLabelNotEqualTo(String value) { + addCriterion("show_label <>", value, "showLabel"); + return (Criteria) this; + } + + public Criteria andShowLabelGreaterThan(String value) { + addCriterion("show_label >", value, "showLabel"); + return (Criteria) this; + } + + public Criteria andShowLabelGreaterThanOrEqualTo(String value) { + addCriterion("show_label >=", value, "showLabel"); + return (Criteria) this; + } + + public Criteria andShowLabelLessThan(String value) { + addCriterion("show_label <", value, "showLabel"); + return (Criteria) this; + } + + public Criteria andShowLabelLessThanOrEqualTo(String value) { + addCriterion("show_label <=", value, "showLabel"); + return (Criteria) this; + } + + public Criteria andShowLabelLike(String value) { + addCriterion("show_label like", value, "showLabel"); + return (Criteria) this; + } + + public Criteria andShowLabelNotLike(String value) { + addCriterion("show_label not like", value, "showLabel"); + return (Criteria) this; + } + + public Criteria andShowLabelIn(List values) { + addCriterion("show_label in", values, "showLabel"); + return (Criteria) this; + } + + public Criteria andShowLabelNotIn(List values) { + addCriterion("show_label not in", values, "showLabel"); + return (Criteria) this; + } + + public Criteria andShowLabelBetween(String value1, String value2) { + addCriterion("show_label between", value1, value2, "showLabel"); + return (Criteria) this; + } + + public Criteria andShowLabelNotBetween(String value1, String value2) { + addCriterion("show_label not between", value1, value2, "showLabel"); + return (Criteria) this; + } + public Criteria andTitleIsNull() { addCriterion("title is null"); return (Criteria) this; diff --git a/hai-service/src/main/java/com/hai/entity/HighDiscountPackageRecord.java b/hai-service/src/main/java/com/hai/entity/HighDiscountPackageRecord.java index b9579c79..0262f47e 100644 --- a/hai-service/src/main/java/com/hai/entity/HighDiscountPackageRecord.java +++ b/hai-service/src/main/java/com/hai/entity/HighDiscountPackageRecord.java @@ -30,7 +30,7 @@ public class HighDiscountPackageRecord implements Serializable { private Integer discountPackageId; /** - * 使用归属 + * 使用归属 3:分配优惠券包 */ private Integer usingAttribution; @@ -60,7 +60,7 @@ public class HighDiscountPackageRecord implements Serializable { private String recordNo; /** - * 销售类型 :1 售卖 2: 赠送 + * 销售类型 :1 售卖 2: 赠送 3:领取 */ private Integer salesType; diff --git a/hai-service/src/main/java/com/hai/enum_type/ApiProductTypeEnum.java b/hai-service/src/main/java/com/hai/enum_type/ApiProductTypeEnum.java index cb4b77b6..be63fecc 100644 --- a/hai-service/src/main/java/com/hai/enum_type/ApiProductTypeEnum.java +++ b/hai-service/src/main/java/com/hai/enum_type/ApiProductTypeEnum.java @@ -19,6 +19,7 @@ public enum ApiProductTypeEnum { type7(7, "优惠券包"), type8(8, "汇联通充值"), type10(10, "实物商品"), + type16(16, "个人油卡充值"), type17(17, "团购套餐") ; diff --git a/hai-service/src/main/java/com/hai/openApi/service/ApiCouponService.java b/hai-service/src/main/java/com/hai/openApi/service/ApiCouponService.java new file mode 100644 index 00000000..6587ee67 --- /dev/null +++ b/hai-service/src/main/java/com/hai/openApi/service/ApiCouponService.java @@ -0,0 +1,54 @@ +package com.hai.openApi.service; + +import com.alibaba.fastjson.JSONObject; +import com.hai.entity.ApiBlxCoupon; +import com.hai.entity.ApiCoupon; + +import java.util.List; +import java.util.Map; + +public interface ApiCouponService { + + /** + * @Author Sum1Dream + * @Name insertCoupon + * @Description // 新增卡券 + * @Date 10:05 2023/12/15 + * @Param apiCoupon + * @return void + */ + void insertCoupon(ApiCoupon apiCoupon); + + /** + * @Author Sum1Dream + * @Name editCoupon + * @Description // 修改卡券 + * @Date 10:06 2023/12/15 + * @Param apiCoupon + * @return void + */ + void editCoupon(ApiCoupon apiCoupon); + + /** + * @Author Sum1Dream + * @Name findCoupon + * @Description // 根据卡券编码查询券 + * @Date 10:06 2023/12/15 + * @Param code + * @return com.hai.entity.ApiCoupon + */ + ApiCoupon findCoupon(String code); + + /** + * @Author Sum1Dream + * @Name getCouponList + * @Description // 查询券列表 + * @Date 10:06 2023/12/15 + * @Param map + * @return java.util.List + */ + List getCouponList(Map map); + + + +} diff --git a/hai-service/src/main/java/com/hai/openApi/service/ApiOrderCreateHandleService.java b/hai-service/src/main/java/com/hai/openApi/service/ApiOrderCreateHandleService.java index 2ec0a95e..91e23710 100644 --- a/hai-service/src/main/java/com/hai/openApi/service/ApiOrderCreateHandleService.java +++ b/hai-service/src/main/java/com/hai/openApi/service/ApiOrderCreateHandleService.java @@ -88,4 +88,14 @@ public interface ApiOrderCreateHandleService { */ ApiOrder blxOrder(JSONObject object) throws Exception; + /** + * @Author Sum1Dream + * @Name petroCouponOrder + * @Description // 中石油卡券下单业务 + * @Date 14:49 2023/12/15 + * @Param object + * @return com.hai.entity.ApiOrder + */ + ApiOrder petroCouponOrder(JSONObject object) throws Exception; + } diff --git a/hai-service/src/main/java/com/hai/openApi/service/impl/ApiCouponServiceImpl.java b/hai-service/src/main/java/com/hai/openApi/service/impl/ApiCouponServiceImpl.java new file mode 100644 index 00000000..f18d674f --- /dev/null +++ b/hai-service/src/main/java/com/hai/openApi/service/impl/ApiCouponServiceImpl.java @@ -0,0 +1,61 @@ +package com.hai.openApi.service.impl; + +import com.alibaba.fastjson.JSONObject; +import com.hai.common.exception.ErrorCode; +import com.hai.common.exception.ErrorHelp; +import com.hai.common.exception.SysCode; +import com.hai.config.PetroConfig; +import com.hai.dao.ApiCouponMapper; +import com.hai.entity.ApiCoupon; +import com.hai.entity.ApiCouponExample; +import com.hai.entity.HighCouponCodeOther; +import com.hai.entity.HighUserCoupon; +import com.hai.openApi.service.ApiCouponService; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.Date; +import java.util.List; +import java.util.Map; + +@Service("apiCouponService") +public class ApiCouponServiceImpl implements ApiCouponService { + + @Resource + private ApiCouponMapper apiCouponMapper; + + @Override + public void insertCoupon(ApiCoupon apiCoupon) { + apiCouponMapper.insert(apiCoupon); + } + + @Override + public void editCoupon(ApiCoupon apiCoupon) { + apiCouponMapper.updateByPrimaryKeySelective(apiCoupon); + } + + @Override + public ApiCoupon findCoupon(String code) { + + ApiCouponExample example = new ApiCouponExample(); + example.createCriteria().andCodeEqualTo(code).andStatusEqualTo(1); + + List list = apiCouponMapper.selectByExample(example); + + if (list.size() > 0) { + return list.get(0); + } + + return null; + } + + @Override + public List getCouponList(Map map) { + + ApiCouponExample example = new ApiCouponExample(); + example.createCriteria().andStatusEqualTo(1); + + return apiCouponMapper.selectByExample(example); + } + +} diff --git a/hai-service/src/main/java/com/hai/openApi/service/impl/ApiOrderCreateHandleServiceImpl.java b/hai-service/src/main/java/com/hai/openApi/service/impl/ApiOrderCreateHandleServiceImpl.java index d59c6206..222ce52e 100644 --- a/hai-service/src/main/java/com/hai/openApi/service/impl/ApiOrderCreateHandleServiceImpl.java +++ b/hai-service/src/main/java/com/hai/openApi/service/impl/ApiOrderCreateHandleServiceImpl.java @@ -12,6 +12,7 @@ import com.hai.entity.*; import com.hai.openApi.config.BlxConfig; import com.hai.openApi.config.PriceComputeConfig; import com.hai.openApi.service.ApiBlxCouponService; +import com.hai.openApi.service.ApiCouponService; import com.hai.openApi.service.ApiMchProductService; import com.hai.openApi.service.ApiOrderCreateHandleService; import com.hai.openApi.type.OperatorTypeEnum; @@ -56,6 +57,9 @@ public class ApiOrderCreateHandleServiceImpl implements ApiOrderCreateHandleServ @Resource private BlxConfig blxConfig; + @Resource + private ApiCouponService apiCouponService; + @Override public ApiOrder oilHandle(JSONObject object) throws Exception { @@ -476,4 +480,56 @@ public class ApiOrderCreateHandleServiceImpl implements ApiOrderCreateHandleServ return apiOrder; } + + @Override + public ApiOrder petroCouponOrder(JSONObject object) throws Exception { + + // 获取下单内容 + JSONObject dataObject = JSONObject.parseObject(object.getString("content")); + + // 查询api商户 + ApiMerchants apiMerchants = apiMerchantsService.findByMchId(object.getString("merchId")); + + ApiCoupon apiCoupon = apiCouponService.findCoupon(dataObject.getString("code")); + + // 查询折扣比例 + Map mapProduct = new HashMap<>(); + mapProduct.put("mchId" , object.getString("merchId")); + mapProduct.put("productType" , OrderProductType.PRODUCT_TYPE18.getNumber()); + + ApiMchProduct mchProduct = apiMchProductService.findByMap(mapProduct); + + + // 计算成本价格 + BigDecimal price = priceComputeConfig.computationPriceCost(mchProduct.getDiscount() , new BigDecimal(apiCoupon.getPrice()/100)); + + // 判断金额是否充足 + if (apiMerchants.getAmounts().compareTo(price) < 0) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.INSUFFICIENT_BALANCE); + } + + // 组装内容 + JSONObject jsonObject = new JSONObject(); + jsonObject.put("name" ,apiCoupon.getName()); + jsonObject.put("couponCode" , apiCoupon.getCode()); + jsonObject.put("receiverPhone" , dataObject.getString("userMobile")); + + // 组装api订单 + ApiOrder apiOrder = new ApiOrder(); + apiOrder.setCreateTime(new Date()); + apiOrder.setTitle(apiMerchants.getMerchantName() + "|" + OrderProductType.PRODUCT_TYPE18.getName() + "|扣款" + price); + apiOrder.setFacePrice(new BigDecimal(apiCoupon.getPrice())); + apiOrder.setCostPrice(price); + apiOrder.setOrderPrice(price); + apiOrder.setMchId(object.getString("merchId")); + apiOrder.setMchName(apiMerchants.getMerchantName()); + apiOrder.setUpdateTime(new Date()); + apiOrder.setProductType(object.getInteger("productType")); + apiOrder.setMchOrderNo(object.getString("orderNo")); + apiOrder.setNotifyUrl(object.getString("notifyUrl")); + apiOrder.setContent(jsonObject.toJSONString()); + + return apiOrder; + } + } diff --git a/hai-service/src/main/java/com/hai/openApi/service/impl/ApiOrderServiceImpl.java b/hai-service/src/main/java/com/hai/openApi/service/impl/ApiOrderServiceImpl.java index 5afb8239..5dee7a25 100644 --- a/hai-service/src/main/java/com/hai/openApi/service/impl/ApiOrderServiceImpl.java +++ b/hai-service/src/main/java/com/hai/openApi/service/impl/ApiOrderServiceImpl.java @@ -200,40 +200,84 @@ public class ApiOrderServiceImpl implements ApiOrderService { createOrderModel.getChildOrderList().add(createOrderChildModel); orderService.createOrder(createOrderModel); } - - // 处理停车券订单 - if (OrderProductType.PRODUCT_TYPE13.getNumber().equals(object.getInteger("productType"))) { - - apiOrder = orderCreateHandleService.blxCouponHandle(object); - - // 组装子订单内容 - CreateOrderChildModel createOrderChildModel = new CreateOrderChildModel(); - createOrderChildModel.setMemName(apiMerchants.getMerchantName()); - createOrderChildModel.setMemPhone(apiMerchants.getPhone()); - createOrderChildModel.setCompanyId(2L); - createOrderChildModel.setGoodsType(OrderChildGoodsType.TYPE12.getNumber()); - createOrderChildModel.setPrice(apiOrder.getCostPrice()); - createOrderChildModel.setCouponCode(dataObject.getString("couponCode")); - createOrderChildModel.setSaleCount(dataObject.getInteger("receiverCount")); - createOrderChildModel.setIsTyAgent(false); - createOrderChildModel.setGoodsPrice(apiOrder.getOrderPrice()); - - // 组装订单 - createOrderModel.getChildOrderList().add(createOrderChildModel); - orderService.createOrder(createOrderModel); - - } +// +// // 处理停车券订单 +// if (OrderProductType.PRODUCT_TYPE13.getNumber().equals(object.getInteger("productType"))) { +// +// apiOrder = orderCreateHandleService.blxCouponHandle(object); +// +// // 组装子订单内容 +// CreateOrderChildModel createOrderChildModel = new CreateOrderChildModel(); +// createOrderChildModel.setMemName(apiMerchants.getMerchantName()); +// createOrderChildModel.setMemPhone(apiMerchants.getPhone()); +// createOrderChildModel.setUserMobile(dataObject.getString("userMobile")); +// createOrderChildModel.setCompanyId(2L); +// createOrderChildModel.setGoodsType(OrderChildGoodsType.TYPE12.getNumber()); +// createOrderChildModel.setPrice(apiOrder.getCostPrice()); +// createOrderChildModel.setCouponCode(dataObject.getString("couponCode")); +// createOrderChildModel.setSaleCount(dataObject.getInteger("receiverCount")); +// createOrderChildModel.setIsTyAgent(false); +// createOrderChildModel.setGoodsPrice(apiOrder.getOrderPrice()); +// +// // 组装订单 +// createOrderModel.getChildOrderList().add(createOrderChildModel); +// orderService.createOrder(createOrderModel); +// +// } +// // 处理停车订单 +// if (OrderProductType.PRODUCT_TYPE14.getNumber().equals(object.getInteger("productType"))) { +// +// apiOrder = orderCreateHandleService.blxOrder(object); +// +// // 组装子订单内容 +// CreateOrderChildModel createOrderChildModel = new CreateOrderChildModel(); +// createOrderChildModel.setMemName(apiMerchants.getMerchantName()); +// createOrderChildModel.setMemPhone(apiMerchants.getPhone()); +// createOrderChildModel.setUserMobile(dataObject.getString("userMobile")); +// createOrderChildModel.setCompanyId(2L); +// createOrderChildModel.setGoodsType(OrderChildGoodsType.TYPE13.getNumber()); +// createOrderChildModel.setSaleCount(1); +// createOrderChildModel.setIsTyAgent(false); +// createOrderChildModel.setGoodsPrice(apiOrder.getOrderPrice()); +// +// // 组装订单 +// createOrderModel.getChildOrderList().add(createOrderChildModel); +// orderService.createOrder(createOrderModel); +// +// } // 处理停车订单 - if (OrderProductType.PRODUCT_TYPE14.getNumber().equals(object.getInteger("productType"))) { - - apiOrder = orderCreateHandleService.blxOrder(object); +// if (OrderProductType.PRODUCT_TYPE14.getNumber().equals(object.getInteger("productType"))) { +// +// apiOrder = orderCreateHandleService.blxOrder(object); +// +// // 组装子订单内容 +// CreateOrderChildModel createOrderChildModel = new CreateOrderChildModel(); +// createOrderChildModel.setMemName(apiMerchants.getMerchantName()); +// createOrderChildModel.setMemPhone(dataObject.getString("userMobile")); +// createOrderChildModel.setCompanyId(2L); +// createOrderChildModel.setGoodsType(OrderChildGoodsType.TYPE18.getNumber()); +// createOrderChildModel.setSaleCount(1); +// createOrderChildModel.setIsTyAgent(false); +// createOrderChildModel.setGoodsPrice(apiOrder.getOrderPrice()); +// +// // 组装订单 +// createOrderModel.getChildOrderList().add(createOrderChildModel); +// orderService.createOrder(createOrderModel); +// +// } + + // 处理中石油卡券 + if (OrderProductType.PRODUCT_TYPE18.getNumber().equals(object.getInteger("productType"))) { + + apiOrder = orderCreateHandleService.petroCouponOrder(object); // 组装子订单内容 CreateOrderChildModel createOrderChildModel = new CreateOrderChildModel(); - createOrderChildModel.setMemName(apiMerchants.getMerchantName()); - createOrderChildModel.setMemPhone(apiMerchants.getPhone()); + createOrderChildModel.setMemName("接口用户"); + createOrderChildModel.setMemPhone(dataObject.getString("userMobile")); createOrderChildModel.setCompanyId(2L); - createOrderChildModel.setGoodsType(OrderChildGoodsType.TYPE13.getNumber()); + createOrderChildModel.setCouponCode(dataObject.getString("couponCode")); + createOrderChildModel.setGoodsType(OrderChildGoodsType.TYPE18.getNumber()); createOrderChildModel.setSaleCount(1); createOrderChildModel.setIsTyAgent(false); createOrderChildModel.setGoodsPrice(apiOrder.getOrderPrice()); @@ -294,6 +338,7 @@ public class ApiOrderServiceImpl implements ApiOrderService { if (!Objects.equals(highOrder.getOrderStatus(), OrderStatus.STATUS1.getNumber())) { apiOrder.setStatus(highOrder.getOrderStatus()); apiOrder.setUpdateTime(new Date()); + apiOrder.setExt3(highOrder.getHighChildOrderList().get(0).getExt6()); apiOrderMapper.updateByPrimaryKey(apiOrder); } diff --git a/hai-service/src/main/java/com/hai/order/model/CreateOrderChildModel.java b/hai-service/src/main/java/com/hai/order/model/CreateOrderChildModel.java index 5a0972be..a415c080 100644 --- a/hai-service/src/main/java/com/hai/order/model/CreateOrderChildModel.java +++ b/hai-service/src/main/java/com/hai/order/model/CreateOrderChildModel.java @@ -126,6 +126,8 @@ public class CreateOrderChildModel { /** ======================= 比邻星停车券 start ======================== **/ // 停车券编码 private String couponCode; + // 上送手机号 + private String userMobile; // 实际单价 private BigDecimal price; /** ======================= 比邻星停车券 end ======================== **/ diff --git a/hai-service/src/main/java/com/hai/order/service/OrderCreateHandleService.java b/hai-service/src/main/java/com/hai/order/service/OrderCreateHandleService.java index 818cf828..2dbd494c 100644 --- a/hai-service/src/main/java/com/hai/order/service/OrderCreateHandleService.java +++ b/hai-service/src/main/java/com/hai/order/service/OrderCreateHandleService.java @@ -137,4 +137,6 @@ public interface OrderCreateHandleService { */ HighChildOrder group(HighOrder order , CreateOrderChildModel createOrderChildModel) throws Exception; + HighChildOrder petroCoupon(HighOrder order , CreateOrderChildModel createOrderChildModel) throws Exception; + } diff --git a/hai-service/src/main/java/com/hai/order/service/impl/OrderCreateHandleServiceImpl.java b/hai-service/src/main/java/com/hai/order/service/impl/OrderCreateHandleServiceImpl.java index 93008776..e133e605 100644 --- a/hai-service/src/main/java/com/hai/order/service/impl/OrderCreateHandleServiceImpl.java +++ b/hai-service/src/main/java/com/hai/order/service/impl/OrderCreateHandleServiceImpl.java @@ -21,6 +21,7 @@ import com.hai.model.GasPayPriceModel; import com.hai.model.OutRechargePriceModel; import com.hai.openApi.config.BlxConfig; import com.hai.openApi.service.ApiBlxCouponService; +import com.hai.openApi.service.ApiCouponService; import com.hai.order.model.CreateOrderChildModel; import com.hai.order.model.CreateOrderModel; import com.hai.order.service.OrderCreateHandleService; @@ -164,6 +165,9 @@ public class OrderCreateHandleServiceImpl implements OrderCreateHandleService { @Resource private HighOilCardService oilCardService; + @Resource + private ApiCouponService apiCouponService; + @Override public List couponHandle(HighDiscountUserRel discountUserRel, CreateOrderChildModel createOrderChild) throws Exception { if (createOrderChild.getSaleCount() != 1) { @@ -1258,4 +1262,34 @@ public class OrderCreateHandleServiceImpl implements OrderCreateHandleService { childOrder.setExt1(givePrice.toString()); return childOrder; } + + @Override + public HighChildOrder petroCoupon(HighOrder order, CreateOrderChildModel createOrderChildModel) throws Exception { + + ApiCoupon apiCoupon = apiCouponService.findCoupon(createOrderChildModel.getCouponCode()); + + // 生成交易子订单 + HighChildOrder childOrder = new HighChildOrder(); + childOrder.setOrderNo(order.getOrderNo()); + childOrder.setMemId(order.getMemId()); + childOrder.setMemName(order.getMemName()); + childOrder.setMemPhone(order.getMemPhone()); + childOrder.setChildOrderNo(OrderUtil.generateChildOrderNo()); + childOrder.setGoodsType(OrderChildGoodsType.TYPE12.getNumber()); + childOrder.setGoodsId(apiCoupon.getId()); + childOrder.setGoodsName(apiCoupon.getName()); + childOrder.setGoodsSpecName(apiCoupon.getCode()); + childOrder.setGoodsPrice(new BigDecimal(apiCoupon.getPrice())); + childOrder.setGoodsActualPrice(createOrderChildModel.getPrice()); + childOrder.setSaleCount(createOrderChildModel.getSaleCount()); + childOrder.setGiveawayType(false); + childOrder.setChildOrderStatus(OrderChildStatus.STATUS1.getNumber()); + childOrder.setTotalPrice(childOrder.getGoodsPrice().multiply(new BigDecimal(childOrder.getSaleCount()))); + childOrder.setTotalActualPrice(childOrder.getGoodsActualPrice().multiply(new BigDecimal(childOrder.getSaleCount()))); + childOrder.setTotalDeductionPrice(childOrder.getTotalPrice().subtract(childOrder.getTotalActualPrice())); + childOrder.setPraiseStatus(0); + childOrder.setCreateTime(new Date()); + + return childOrder; + } } diff --git a/hai-service/src/main/java/com/hai/order/service/impl/OrderPaySuccessServiceImpl.java b/hai-service/src/main/java/com/hai/order/service/impl/OrderPaySuccessServiceImpl.java index 0edc2b3a..d25ec496 100644 --- a/hai-service/src/main/java/com/hai/order/service/impl/OrderPaySuccessServiceImpl.java +++ b/hai-service/src/main/java/com/hai/order/service/impl/OrderPaySuccessServiceImpl.java @@ -15,6 +15,7 @@ import com.hai.group.GroupCodeService; import com.hai.msg.entity.MsgTopic; import com.hai.openApi.config.BlxConfig; import com.hai.openApi.service.ApiBlxCouponService; +import com.hai.openApi.service.ApiCouponService; import com.hai.order.service.OrderPaySuccessService; import com.hai.order.service.OrderService; import com.hai.order.topic.OrderTopic; @@ -132,7 +133,7 @@ public class OrderPaySuccessServiceImpl implements OrderPaySuccessService { private GroupCodeService groupCodeService; @Resource - private SecConfigService secConfigService; + private ApiCouponService apiCouponService; @Override @@ -262,6 +263,8 @@ public class OrderPaySuccessServiceImpl implements OrderPaySuccessService { group(order); } else if (childOrder.getGoodsType().equals(OrderChildGoodsType.TYPE15.getNumber())) { oilCardHandle(childOrder.getGoodsSpecName(), order); + } else if (childOrder.getGoodsType().equals(OrderChildGoodsType.TYPE18.getNumber())) { + petroCoupon(order , childOrder); } } } @@ -677,4 +680,43 @@ public class OrderPaySuccessServiceImpl implements OrderPaySuccessService { } + private void petroCoupon(HighOrder order , HighChildOrder childOrder) throws Exception { + + // 派发停车券 + ApiCoupon apiCoupon = apiCouponService.findCoupon(childOrder.getGoodsSpecName()); + + + if (apiCoupon == null || apiCoupon.getStatus() != 1) { + throw ErrorHelp.genException(SysCode.System , ErrorCode.COMMON_ERROR , "当前卡券不可购买"); + } + + if (apiCoupon.getType().equals(1)) { + PetroConfig.init(1); + } else { + PetroConfig.init(2); + } + + // 发放卡券 + JSONObject jsonObject = PetroConfig.getCoupon(apiCoupon.getCode() , order.getMemPhone() , order.getOrderNo()); + + if (!jsonObject.getString("code").equals("1")) { + throw ErrorHelp.genException(SysCode.System , ErrorCode.COMMON_ERROR , "当前卡券不可购买"); + } + + String data = PetroConfig.decrypt(jsonObject.getString("biz_content")); + JSONObject object = JSONObject.parseObject(data); + Object ticketList = object.getJSONArray("ticket_list").get(0); + JSONObject ticketListObject = (JSONObject) ticketList;; + + + if (object.getInteger("code") == 1) { + order.setOrderStatus(OrderStatus.STATUS3.getNumber()); + order.setFinishTime(new Date()); + order.getHighChildOrderList().get(0).setExt5(object.getString("request_code")); + order.getHighChildOrderList().get(0).setExt6(ticketListObject.getString("ticket_num")); + orderService.updateOrderData(order); + } + + } + } diff --git a/hai-service/src/main/java/com/hai/order/service/impl/OrderServiceImpl.java b/hai-service/src/main/java/com/hai/order/service/impl/OrderServiceImpl.java index 6c3c184a..f20fdf6d 100644 --- a/hai-service/src/main/java/com/hai/order/service/impl/OrderServiceImpl.java +++ b/hai-service/src/main/java/com/hai/order/service/impl/OrderServiceImpl.java @@ -377,6 +377,18 @@ public class OrderServiceImpl implements OrderService { order.setProductType(OrderProductType.PRODUCT_TYPE17.getNumber()); order.setSecUserId(childOrder.getId()); order.setTitle("团购套餐"); + } else if (child.getGoodsType().equals(OrderChildGoodsType.TYPE17.getNumber())) { + HighChildOrder childOrder = orderCreateHandleService.group(order , child); + childOrderList.add(childOrder); + order.setProductType(OrderProductType.PRODUCT_TYPE17.getNumber()); + order.setSecUserId(childOrder.getId()); + order.setTitle("团购套餐"); + } else if (child.getGoodsType().equals(OrderChildGoodsType.TYPE18.getNumber())) { + HighChildOrder childOrder = orderCreateHandleService.petroCoupon(order , child); + childOrderList.add(childOrder); + order.setProductType(OrderProductType.PRODUCT_TYPE18.getNumber()); + order.setSecUserId(childOrder.getId()); + order.setTitle("中石油卡券"); } else { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知业务类型"); } diff --git a/hai-service/src/main/java/com/hai/order/type/OrderChildGoodsType.java b/hai-service/src/main/java/com/hai/order/type/OrderChildGoodsType.java index e4a67e88..3dd5be66 100644 --- a/hai-service/src/main/java/com/hai/order/type/OrderChildGoodsType.java +++ b/hai-service/src/main/java/com/hai/order/type/OrderChildGoodsType.java @@ -25,6 +25,7 @@ public enum OrderChildGoodsType { TYPE14(14, "升级会员"), TYPE15(15, "个人油卡充值"), TYPE17(17, "团购套餐"), + TYPE18(18, "中石油卡券"), ; private Integer number; diff --git a/hai-service/src/main/java/com/hai/order/type/OrderProductType.java b/hai-service/src/main/java/com/hai/order/type/OrderProductType.java index 5c43f6c4..a78e874d 100644 --- a/hai-service/src/main/java/com/hai/order/type/OrderProductType.java +++ b/hai-service/src/main/java/com/hai/order/type/OrderProductType.java @@ -28,6 +28,7 @@ public enum OrderProductType { PRODUCT_TYPE16(16, "个人油卡充值" , "orderLogo/coupon.png", ""), PRODUCT_TYPE17(17, "团购套餐" , "orderLogo/coupon.png", ""), + PRODUCT_TYPE18(18, "中石油卡券" , "orderLogo/coupon.png", "PETRO_COUPON"), PRODUCT_TYPE101(101, "惠支付" , "orderLogo/pay.png", "PAY"), PRODUCT_TYPE102(102, "门店活动" , "orderLogo/store_activity.png", "STORE_ACTIVITY"), ; diff --git a/hai-service/src/main/java/com/hai/service/HighCouponCodeService.java b/hai-service/src/main/java/com/hai/service/HighCouponCodeService.java index 6ac271a2..9bd670ee 100644 --- a/hai-service/src/main/java/com/hai/service/HighCouponCodeService.java +++ b/hai-service/src/main/java/com/hai/service/HighCouponCodeService.java @@ -151,4 +151,5 @@ public interface HighCouponCodeService { * @param coupon 卡券id */ void payCoupon(HighOrder order,HighChildOrder childOrder, HighCoupon coupon) throws Exception; + } diff --git a/hai-service/src/main/java/com/hai/service/HighDiscountPackageActualService.java b/hai-service/src/main/java/com/hai/service/HighDiscountPackageActualService.java index e0e56d79..c0030d42 100644 --- a/hai-service/src/main/java/com/hai/service/HighDiscountPackageActualService.java +++ b/hai-service/src/main/java/com/hai/service/HighDiscountPackageActualService.java @@ -61,6 +61,10 @@ public interface HighDiscountPackageActualService { */ HighDiscountPackageActual getDetailByChildOrderNo(String orderNo); + + HighDiscountPackageActual findById(Integer id); + + /** * 查询优惠券包列表 * @param packageId diff --git a/hai-service/src/main/java/com/hai/service/HighDiscountPackageAgentService.java b/hai-service/src/main/java/com/hai/service/HighDiscountPackageAgentService.java index 625a931d..8d5a6c90 100644 --- a/hai-service/src/main/java/com/hai/service/HighDiscountPackageAgentService.java +++ b/hai-service/src/main/java/com/hai/service/HighDiscountPackageAgentService.java @@ -1,9 +1,7 @@ package com.hai.service; -import com.hai.entity.HighActivityInfo; -import com.hai.entity.HighActivityPartakeRule; -import com.hai.entity.HighDiscountPackageAgentRecord; -import com.hai.entity.HighDiscountPackageAgentRel; +import com.alibaba.fastjson.JSONObject; +import com.hai.entity.*; import java.util.List; import java.util.Map; @@ -117,4 +115,38 @@ public interface HighDiscountPackageAgentService { */ List getListRecord(Map param); + void generateDiscountPackageAgentCode(JSONObject object) throws Exception; + + /** + * @Author Sum1Dream + * @Name insertDiscountPackageAgentCode + * @Description // 新增 + * @Date 14:51 2023/12/12 + * @Param discountPackageAgentCode + * @return void + */ + void insertDiscountPackageAgentCode(HighDiscountPackageAgentCode discountPackageAgentCode); + + /** + * @Author Sum1Dream + * @Name updateDiscountPackageAgentCode + * @Description // 更新 + * @Date 14:53 2023/12/12 + * @Param discountPackageAgentCode + * @return void + */ + void updateDiscountPackageAgentCode(HighDiscountPackageAgentCode discountPackageAgentCode); + + HighDiscountPackageAgentCode findDiscountPackageAgentCode(String code); + + /** + * @Author Sum1Dream + * @Name getDiscountPackageAgentCodeList + * @Description // 查询列表 + * @Date 14:55 2023/12/12 + * @Param map + * @return java.util.List + */ + List getDiscountPackageAgentCodeList(Map map); + } diff --git a/hai-service/src/main/java/com/hai/service/HighDiscountPackageService.java b/hai-service/src/main/java/com/hai/service/HighDiscountPackageService.java index 34d53200..84566d73 100644 --- a/hai-service/src/main/java/com/hai/service/HighDiscountPackageService.java +++ b/hai-service/src/main/java/com/hai/service/HighDiscountPackageService.java @@ -1,5 +1,6 @@ package com.hai.service; +import com.alibaba.fastjson.JSONObject; import com.hai.entity.HighDiscount; import com.hai.entity.HighDiscountPackage; import com.hai.entity.HighDiscountPackageActual; @@ -117,4 +118,14 @@ public interface HighDiscountPackageService { */ String giveAway(Long packageId, String phone , Integer sourceType , String sourceId) throws Exception; + /** + * @Author Sum1Dream + * @Name receivePackage + * @Description // 领取券包 + * @Date 18:23 2023/12/12 + * @Param object + * @return void + */ + void receivePackage(Integer discountPackageActualId , String code); + } diff --git a/hai-service/src/main/java/com/hai/service/impl/HighDiscountAgentRelServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighDiscountAgentRelServiceImpl.java index 22e76810..7bf6190e 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighDiscountAgentRelServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighDiscountAgentRelServiceImpl.java @@ -156,8 +156,6 @@ public class HighDiscountAgentRelServiceImpl implements HighDiscountAgentRelServ for (HighDiscountAgentRel rel : list) { rel.setHighDiscount(highDiscountService.getDiscountById(rel.getDiscountId())); rel.setHighAgent(highAgentService.findByAgentMsgId(rel.getAgentId())); - // rel.setTotalCount(highDiscountAgentCodeService.getTotalDiscount(rel.getId())); - // rel.setSalesCount(highDiscountAgentCodeService.getSalesDiscount(rel.getId())); } return list; } diff --git a/hai-service/src/main/java/com/hai/service/impl/HighDiscountPackageActualServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighDiscountPackageActualServiceImpl.java index bab81b33..695b5b10 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighDiscountPackageActualServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighDiscountPackageActualServiceImpl.java @@ -70,6 +70,11 @@ public class HighDiscountPackageActualServiceImpl implements HighDiscountPackage return null; } + @Override + public HighDiscountPackageActual findById(Integer id) { + return discountPackageActualMapper.selectByPrimaryKey(id); + } + @Override public List getListByPackageId(Integer packageId, Integer status) { HighDiscountPackageActualExample example = new HighDiscountPackageActualExample(); diff --git a/hai-service/src/main/java/com/hai/service/impl/HighDiscountPackageAgentServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighDiscountPackageAgentServiceImpl.java index 42c9f39f..98ee82d6 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighDiscountPackageAgentServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighDiscountPackageAgentServiceImpl.java @@ -1,13 +1,28 @@ package com.hai.service.impl; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.hai.common.Base64Util; +import com.hai.common.exception.ErrorCode; +import com.hai.common.exception.ErrorHelp; +import com.hai.common.exception.SysCode; +import com.hai.common.security.AESEncodeUtil; +import com.hai.common.utils.RedisUtil; +import com.hai.config.CommonSysConst; +import com.hai.dao.HighDiscountPackageAgentCodeMapper; import com.hai.dao.HighDiscountPackageAgentRecordMapper; import com.hai.dao.HighDiscountPackageAgentRelMapper; import com.hai.entity.*; +import com.hai.service.HighDiscountPackageActualService; import com.hai.service.HighDiscountPackageAgentService; import org.apache.commons.collections4.MapUtils; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; +import java.util.Date; +import java.util.HashMap; import java.util.List; import java.util.Map; @@ -20,6 +35,18 @@ public class HighDiscountPackageAgentServiceImpl implements HighDiscountPackageA @Resource private HighDiscountPackageAgentRelMapper discountPackageAgentRelMapper; + @Resource + private HighDiscountPackageAgentCodeMapper discountPackageAgentCodeMapper; + + @Resource + private HighDiscountPackageActualService discountPackageActualService; + + @Resource + private HighDiscountPackageAgentService discountPackageAgentService; + + @Resource + private RedisUtil redisUtil; + @Override public void insertDiscountPackageAgentRel(HighDiscountPackageAgentRel discountPackageAgentRel) { discountPackageAgentRelMapper.insert(discountPackageAgentRel); @@ -47,6 +74,9 @@ public class HighDiscountPackageAgentServiceImpl implements HighDiscountPackageA if (MapUtils.getLong(map, "discountPackageId") != null) { criteria.andDiscountPackageIdEqualTo(MapUtils.getLong(map, "discountPackageId")); } + if (MapUtils.getInteger(map, "type") != null) { + criteria.andTypeEqualTo(MapUtils.getInteger(map, "type")); + } List list = discountPackageAgentRelMapper.selectByExample(example); @@ -66,6 +96,9 @@ public class HighDiscountPackageAgentServiceImpl implements HighDiscountPackageA if (MapUtils.getLong(param, "agentId") != null) { criteria.andAgentIdEqualTo(MapUtils.getLong(param, "agentId")); } + if (MapUtils.getInteger(param, "type") != null) { + criteria.andTypeEqualTo(MapUtils.getInteger(param, "type")); + } return discountPackageAgentRelMapper.selectByExample(example); } @@ -102,7 +135,141 @@ public class HighDiscountPackageAgentServiceImpl implements HighDiscountPackageA if (MapUtils.getLong(param, "discountPackageId") != null) { criteria.andDiscountPackageIdEqualTo(MapUtils.getLong(param, "discountPackageId")); } + if (MapUtils.getInteger(param, "type") != null) { + criteria.andTypeEqualTo(MapUtils.getInteger(param, "type")); + } return discountPackageAgentRecordMapper.selectByExample(example); } + + @Override + @Transactional(propagation= Propagation.REQUIRED) + public void generateDiscountPackageAgentCode(JSONObject object) throws Exception{ + List discountPackageActualList = discountPackageActualService.getListByPackageId(object.getInteger("discountPackageId") , 1); + + if (object.getInteger("num") > discountPackageActualList.size()) { + throw ErrorHelp.genException(SysCode.System , ErrorCode.COMMON_ERROR , "优惠券包库存不足"); + } + Map mapCode = new HashMap<>(); + HighDiscountPackageAgentCode discountPackageAgentCode ; + mapCode.put("type" , "DISCOUNT_PACKAGE"); + int percent; + + for (int i = 1; i <= object.getInteger("num"); i++) { + + // 生成百分比 + percent = i*100/object.getInteger("num"); + redisUtil.set(object.getString("serialNumber") , percent , 3600); + + HighDiscountPackageActual discountPackageActual = discountPackageActualList.get(i); + discountPackageAgentCode = new HighDiscountPackageAgentCode(); + discountPackageAgentCode.setAgentId(object.getLong("agentId")); + discountPackageAgentCode.setAgentName(object.getString("agentName")); + discountPackageAgentCode.setDiscountPackageId(object.getLong("discountPackageId")); + discountPackageAgentCode.setDiscountPackageName(object.getString("discountPackageName")); + discountPackageAgentCode.setDiscountPackageActualId(discountPackageActual.getId().longValue()); + discountPackageAgentCode.setCreateTime(new Date()); + discountPackageAgentCode.setStatus(1); + insertDiscountPackageAgentCode(discountPackageAgentCode); + // 二维码参数 + mapCode.put("id", discountPackageActual.getId()); + String code = Base64Util.encode(AESEncodeUtil.aesEncrypt(JSON.toJSONString(mapCode))); + // 生成二维码 + String qrCodeUrl = CommonSysConst.getSysConfig().getHsgDomainName() + "/hsgH5?accountId=0000022&key=" + object.getLong("discountPackageId") + "&code=" + code; + discountPackageAgentCode.setQrCodeUrl(qrCodeUrl); + discountPackageAgentCode.setCode(code); + discountPackageAgentCode.setDiscountAgentBatchId(object.getLong("serialNumber")); + updateDiscountPackageAgentCode(discountPackageAgentCode); + discountPackageActual.setStatus(2); + discountPackageActual.setExt3(object.getString("serialNumber")); + discountPackageActualService.updateHighDiscountPackageActual(discountPackageActual); + } + + Map map = new HashMap<>(); + map.put("agentId" , object.getLong("agentId")); + map.put("discountPackageId" , object.getLong("discountPackageId")); + map.put("type" , 2); + HighDiscountPackageAgentRel discountPackageAgentRel = discountPackageAgentService.getDetailRelByMap(map); + HighDiscountPackageAgentRecord discountPackageAgentRecord = new HighDiscountPackageAgentRecord(); + + + if (discountPackageAgentRel == null) { + discountPackageAgentRel = new HighDiscountPackageAgentRel(); + discountPackageAgentRel.setStatus(1); + discountPackageAgentRel.setType(2); + discountPackageAgentRel.setAgentId(object.getLong("agentId")); + discountPackageAgentRel.setAgentName(object.getString("agentName")); + discountPackageAgentRel.setDiscountPackageId(object.getLong("discountPackageId")); + discountPackageAgentRel.setDiscountPackageTitle(object.getString("discountPackageName")); + discountPackageAgentRel.setSalesCount(0); + discountPackageAgentRel.setStockCount(0); + discountPackageAgentRel.setCreateTime(new Date()); + discountPackageAgentRel.setUpdateTime(new Date()); + } + discountPackageAgentRel.setStockCount(object.getInteger("num") + discountPackageAgentRel.getStockCount()); + + if (discountPackageAgentRel.getId() == null) { + discountPackageAgentService.insertDiscountPackageAgentRel(discountPackageAgentRel); + } else { + discountPackageAgentRel.setUpdateTime(new Date()); + discountPackageAgentRel.setType(2); + discountPackageAgentService.updateDiscountPackageAgentRel(discountPackageAgentRel); + } + + discountPackageAgentRecord.setAgentId(object.getLong("agentId")); + discountPackageAgentRecord.setAgentName(object.getString("agentName")); + discountPackageAgentRecord.setDiscountPackageId(object.getLong("discountPackageId")); + discountPackageAgentRecord.setDiscountPackageTitle(object.getString("discountPackageName")); + discountPackageAgentRecord.setCreateTime(new Date()); + discountPackageAgentRecord.setUpdateTime(new Date()); + discountPackageAgentRecord.setStatus(1); + discountPackageAgentRecord.setType(2); + discountPackageAgentRecord.setCount(object.getInteger("num")); + discountPackageAgentRecord.setAfterCount(discountPackageAgentRel.getStockCount()); + discountPackageAgentRecord.setFrontCount(discountPackageAgentRel.getStockCount() - object.getInteger("num")); + + discountPackageAgentService.insertDiscountPackageAgentRecord(discountPackageAgentRecord); + + } + + @Override + public void insertDiscountPackageAgentCode(HighDiscountPackageAgentCode discountPackageAgentCode) { + discountPackageAgentCodeMapper.insert(discountPackageAgentCode); + } + + @Override + public void updateDiscountPackageAgentCode(HighDiscountPackageAgentCode discountPackageAgentCode) { + discountPackageAgentCodeMapper.updateByPrimaryKey(discountPackageAgentCode); + } + + @Override + public HighDiscountPackageAgentCode findDiscountPackageAgentCode(String code) { + HighDiscountPackageAgentCodeExample example = new HighDiscountPackageAgentCodeExample(); + HighDiscountPackageAgentCodeExample.Criteria criteria = example.createCriteria(); + + criteria.andCodeEqualTo(code); + + List list = discountPackageAgentCodeMapper.selectByExample(example); + + if (list.size() > 0) { + return list.get(0); + } + + return null; + } + + @Override + public List getDiscountPackageAgentCodeList(Map map) { + HighDiscountPackageAgentCodeExample example = new HighDiscountPackageAgentCodeExample(); + HighDiscountPackageAgentCodeExample.Criteria criteria = example.createCriteria(); + + if (MapUtils.getLong(map, "agentId") != null) { + criteria.andAgentIdEqualTo(MapUtils.getLong(map, "agentId")); + } + if (MapUtils.getLong(map, "discountPackageId") != null) { + criteria.andDiscountPackageIdEqualTo(MapUtils.getLong(map, "discountPackageId")); + } + + return discountPackageAgentCodeMapper.selectByExample(example); + } } diff --git a/hai-service/src/main/java/com/hai/service/impl/HighDiscountPackageServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighDiscountPackageServiceImpl.java index 2b104064..b7ef226b 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighDiscountPackageServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighDiscountPackageServiceImpl.java @@ -1,7 +1,9 @@ package com.hai.service.impl; +import com.alibaba.fastjson.JSONObject; import com.github.pagehelper.PageHelper; import com.google.common.base.Stopwatch; +import com.hai.common.exception.BaseException; import com.hai.common.exception.ErrorCode; import com.hai.common.exception.ErrorHelp; import com.hai.common.exception.SysCode; @@ -12,12 +14,14 @@ import com.hai.common.utils.RedisUtil; import com.hai.dao.*; import com.hai.entity.*; import com.hai.enum_type.DiscountPlatform; +import com.hai.model.HighUserModel; import com.hai.model.UserInfoModel; import com.hai.service.*; import com.hai.service.HighDiscountPackageService; import io.lettuce.core.RedisURI; import org.apache.commons.collections4.MapUtils; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.redis.core.RedisTemplate; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Isolation; import org.springframework.transaction.annotation.Propagation; @@ -52,6 +56,10 @@ public class HighDiscountPackageServiceImpl implements HighDiscountPackageServic @Resource private HighDiscountAgentRelService highDiscountAgentRelService; + @Autowired + private RedisTemplate redisTemplate; + + @Resource private HighDiscountAgentCodeService highDiscountAgentCodeService; @@ -73,6 +81,10 @@ public class HighDiscountPackageServiceImpl implements HighDiscountPackageServic @Resource private HighDiscountPackageService highDiscountPackageService; + + @Resource + private HighDiscountPackageAgentService discountPackageAgentService; + @Resource private HighDiscountUserRelMapper highDiscountUserRelMapper; @@ -108,6 +120,9 @@ public class HighDiscountPackageServiceImpl implements HighDiscountPackageServic if (MapUtils.getString(map, "title") != null) { criteria.andTitleLike("%" + MapUtils.getString(map, "title") + "%"); } + if (MapUtils.getString(map, "showLabel") != null) { + criteria.andShowLabelLike("%" + MapUtils.getString(map, "showLabel") + "%"); + } if (MapUtils.getInteger(map, "salesType") != null) { criteria.andSalesTypeEqualTo(MapUtils.getInteger(map, "salesType")); @@ -276,7 +291,7 @@ public class HighDiscountPackageServiceImpl implements HighDiscountPackageServic HighDiscountPackageActual discountPackageActual = discountPackageActualService.getHighDiscountPackageActualList(highDiscountPackage.getId()).get(0); // 修改优惠券包实际库存为已使用 - discountPackageActual.setStatus(0); + discountPackageActual.setStatus(3); discountPackageActual.setUserId(MapUtils.getInteger(map , "userId")); discountPackageActual.setAllocationTime(new Date()); discountPackageActualService.updateHighDiscountPackageActual(discountPackageActual); @@ -314,7 +329,7 @@ public class HighDiscountPackageServiceImpl implements HighDiscountPackageServic userEndTime.set(Calendar.SECOND, 59); userEndTime.add(Calendar.DATE, discount.getEffectiveDay()); - if (userEndTime.getTime().compareTo(discount.getSalesEndTime()) == 1) { + if (userEndTime.getTime().compareTo(discount.getSalesEndTime()) > 0) { userRel.setUseEndTime(discount.getSalesEndTime()); } else { userRel.setUseEndTime(userEndTime.getTime()); @@ -541,4 +556,202 @@ public class HighDiscountPackageServiceImpl implements HighDiscountPackageServic return serialNum; } + + @Override + @Transactional(propagation= Propagation.REQUIRED) + public void receivePackage(Integer discountPackageActualId , String code) { + HighUserModel userInfoModel = userCenter.getSessionModel(HighUserModel.class); + + String key = "receivePackage_" + discountPackageActualId; + + try { + // 分布式锁占坑 + Boolean lock = redisTemplate.opsForValue().setIfAbsent(key, discountPackageActualId); + + if(Boolean.TRUE.equals(lock)) { + // 加锁成功,处理业务 + + + HighDiscountPackageAgentCode discountPackageAgentCode = discountPackageAgentService.findDiscountPackageAgentCode(code); + + if (discountPackageAgentCode == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "当前系统繁忙,请联系客服人员!"); + } + if (discountPackageAgentCode.getStatus() != 1) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "券包已领取!"); + } + + HighDiscountPackageActual discountPackageActual = discountPackageActualService.findById(discountPackageActualId); + if (discountPackageActual == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "没有找到券包信息"); + } + if (!discountPackageActual.getStatus().equals(2)) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "当前券包已领取"); + } + + + // 查询优惠券包 + HighDiscountPackage discountPackage = findDiscountPackageById(discountPackageActual.getDiscountPackageId()); + if (discountPackage == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "没有找到券包信息"); + } + if (!discountPackage.getStatus().equals(1)) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "券包状态错误"); + } + + discountPackageActual.setStatus(3); + discountPackageActual.setAllocationTime(new Date()); + discountPackageActualService.updateHighDiscountPackageActual(discountPackageActual); + + discountPackageAgentCode.setStatus(2); + discountPackageAgentCode.setUpdateTime(new Date()); + discountPackageAgentService.updateDiscountPackageAgentCode(discountPackageAgentCode); + + JSONObject object = new JSONObject(); + + object.put("discountPackageName" , discountPackage.getTitle()); + object.put("discountPackageId" , discountPackage.getId()); + object.put("userId" , userInfoModel.getHighUser().getId()); + object.put("userName" , userInfoModel.getHighUser().getName()); + object.put("userPhone" , userInfoModel.getHighUser().getPhone()); + object.put("companyId" , discountPackage.getCompanyId()); + object.put("discountPackageActualId" , discountPackageActualId); + object.put("usingAttribution" , 3); + object.put("type" , 3); + + discountPackageUser(object); + getDiscountPackageDeliver(object); + + Map map = new HashMap<>(); + map.put("agentId" , discountPackageAgentCode.getAgentId()); + map.put("discountPackageId" , discountPackageAgentCode.getDiscountPackageId()); + map.put("type" , 2); + HighDiscountPackageAgentRel discountPackageAgentRel = discountPackageAgentService.getDetailRelByMap(map); + + discountPackageAgentRel.setUpdateTime(new Date()); + discountPackageAgentRel.setStockCount(discountPackageAgentRel.getStockCount() - 1); + discountPackageAgentRel.setSalesCount(discountPackageAgentRel.getSalesCount() + 1); + + discountPackageAgentService.updateDiscountPackageAgentRel(discountPackageAgentRel); + + + } else { + // 加锁失败,重试 + Thread.sleep(100); + receivePackage(discountPackageActualId , code); + } + } catch (BaseException baseException) { + redisTemplate.delete(key); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, baseException.getErrorMsg()); + + } catch (Exception e) { + redisTemplate.delete(key); + System.out.println(e); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知错误"); + } finally { + // 删除key,释放锁 + redisTemplate.delete(key); + } + + + + } + + private void getDiscountPackageDeliver(JSONObject object) { + // 记录流水 + String serialNum = System.currentTimeMillis()+""; + + // 赠送记录流水 + + HighDiscountPackageDeliver discountPackageDeliver = new HighDiscountPackageDeliver(); + discountPackageDeliver.setPackageId(object.getLong("discountPackageId")); + discountPackageDeliver.setPackageName(object.getString("discountPackageName")); + discountPackageDeliver.setSerialNumber(serialNum); + discountPackageDeliver.setOpUserId(object.getLong("userId")); + discountPackageDeliver.setOpUserName(object.getString("userName")); + discountPackageDeliver.setStatus(2); + discountPackageDeliverService.insertDeliver(discountPackageDeliver); + + HighDiscountPackageDeliverUser deliverUser = new HighDiscountPackageDeliverUser(); + deliverUser.setPackageDeliverId(discountPackageDeliver.getId()); + deliverUser.setSerialNumber(System.currentTimeMillis()+""); + deliverUser.setPackageId(object.getLong("discountPackageId")); + deliverUser.setPackageName(object.getString("discountPackageName")); + deliverUser.setPackageActualId(object.getLong("discountPackageActualId")); + deliverUser.setUserId(object.getLong("userId")); + deliverUser.setUserPhone(object.getString("userPhone")); + deliverUser.setStatus(2); + discountPackageDeliverService.insertDeliverUser(deliverUser); + } + + private void discountPackageUser(JSONObject object) throws Exception { + + // 查询优惠券包实际库存中实际优惠券数量 + List discountPackageDiscountActual = discountPackageDiscountActualService.getHighDiscountPackageDiscountActualList(object.getInteger("discountPackageActualId")); + + // 循环赠送优惠券 + for (HighDiscountPackageDiscountActual actualList: discountPackageDiscountActual) { + HighDiscount discount = highDiscountService.getDiscountById(actualList.getDiscountId()); + if (discount == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "优惠券信息不存在"); + } + HighDiscountUserRel userRel = new HighDiscountUserRel(); + userRel.setDiscountPlatform(DiscountPlatform.getPlatformByCode(discount.getPlatform()).getNumber()); + userRel.setDiscountCompanyId(discount.getCompanyId()); + userRel.setDiscountId(discount.getId()); + userRel.setDiscountName(discount.getDiscountName()); + userRel.setDiscountImg(discount.getDiscountImg()); + userRel.setDiscountUseScope(discount.getUseScope()); + userRel.setDiscountUsingRange(discount.getUsingRange()); + userRel.setDiscountType(discount.getDiscountType()); + userRel.setDiscountCondition(discount.getDiscountCondition()); + userRel.setExt2("优惠券包"); + userRel.setDiscountPrice(discount.getDiscountPrice()); + userRel.setAgentId(actualList.getAgentId()); + userRel.setUserId(object.getLong("userId")); + userRel.setStatus(1); // 状态 0:已过期 1:未使用 2:已使用 + userRel.setCreateTime(new Date()); + userRel.setDiscountAgentCodeId(actualList.getAgentDiscountCodeId()); + // 计算使用有效期 + Calendar userEndTime = Calendar.getInstance(); + userEndTime.setTime(new Date()); + userEndTime.set(Calendar.HOUR_OF_DAY, 23); + userEndTime.set(Calendar.MINUTE, 59); + userEndTime.set(Calendar.SECOND, 59); + userEndTime.add(Calendar.DATE, discount.getEffectiveDay()); + + if (userEndTime.getTime().compareTo(discount.getSalesEndTime()) > 0) { + userRel.setUseEndTime(discount.getSalesEndTime()); + } else { + userRel.setUseEndTime(userEndTime.getTime()); + } + + HighDiscountAgentCode discountAgentCode = highDiscountAgentCodeService.getCodeById(actualList.getAgentDiscountCodeId()); + + // 修改优惠券二维码状态 + discountAgentCode.setStatus(2); + highDiscountAgentCodeService.updateCode(discountAgentCode); + + // 新增优惠券与用户的绑定关系 + highDiscountUserRelMapper.insert(userRel); + + // 修改优惠券包实际库存实际优惠券状态 + actualList.setStatus(0); + discountPackageDiscountActualService.updateHighDiscountPackageDiscountActual(actualList); + } + + // 增加记录 + HighDiscountPackageRecord discountPackageRecord = new HighDiscountPackageRecord(); + discountPackageRecord.setDiscountPackageId(object.getInteger("discountPackageId")); + discountPackageRecord.setDiscountPackageTitle(object.getString("discountPackageName")); + discountPackageRecord.setCompanyId(object.getInteger("companyId")); + discountPackageRecord.setStatus(1); + discountPackageRecord.setUsingAttribution(object.getInteger("usingAttribution")); + discountPackageRecord.setRecordNo("DP" + DateUtil.date2String(new Date(),"yyyyMMddHHmmss") + IDGenerator.nextId(5) ); + discountPackageRecord.setSalesType(object.getInteger("type")); + discountPackageRecord.setUserId(object.getInteger("userId")); + discountPackageRecord.setExt1(object.getString("userPhone")); + discountPackageRecord.setCreatedTime(new Date()); + highDiscountPackageRecordMapper.insert(discountPackageRecord); + } } diff --git a/hai-service/src/main/java/com/hai/service/impl/HighUserServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighUserServiceImpl.java index a0d44138..db67ff22 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighUserServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighUserServiceImpl.java @@ -136,6 +136,7 @@ public class HighUserServiceImpl implements HighUserService { distributionUserRelService.insertDistributionUserRel(user.getId(), popularizeUserId, region.getRegionId().toString()); } } + user.setOpenIdH5(MapUtils.getString(other, "openIdH5")); user.setOpenId(MapUtils.getString(other, "openId")); loginLog.setUserId(user.getId()); diff --git a/hai-service/src/main/java/com/hai/service/impl/HltUnionCardVipServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HltUnionCardVipServiceImpl.java index ca305b56..20c11f86 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HltUnionCardVipServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HltUnionCardVipServiceImpl.java @@ -134,7 +134,7 @@ public class HltUnionCardVipServiceImpl implements HltUnionCardVipService { HighDiscountPackageActual discountPackageActual = discountPackageActualService.getHighDiscountPackageActualList(highDiscountPackage.getId()).get(0); // 修改优惠券包实际库存状态 - discountPackageActual.setStatus(0); + discountPackageActual.setStatus(3); discountPackageActual.setUserId(highUser.getId().intValue()); discountPackageActual.setAllocationTime(new Date()); discountPackageActualService.updateHighDiscountPackageActual(discountPackageActual); diff --git a/hai-user/src/main/java/com/web/controller/LoginController.java b/hai-user/src/main/java/com/web/controller/LoginController.java index 099e5a99..65e63471 100644 --- a/hai-user/src/main/java/com/web/controller/LoginController.java +++ b/hai-user/src/main/java/com/web/controller/LoginController.java @@ -1 +1 @@ -package com.web.controller; import cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult; import cn.binarywang.wx.miniapp.bean.WxMaPhoneNumberInfo; import com.alibaba.fastjson.JSONObject; import com.hai.common.exception.ErrorCode; import com.hai.common.exception.ErrorHelp; import com.hai.common.exception.SysCode; import com.hai.common.security.UserCenter; import com.hai.common.utils.*; import com.hai.config.UnionUserConfig; import com.hai.config.WxMaConfiguration; import com.hai.entity.HighUser; import com.hai.enum_type.LoginPlatform; import com.hai.model.HighUserModel; import com.hai.model.ResponseData; import com.hai.service.HighUserService; import com.web.type.LoginType; import com.hai.enum_type.RedisFileFolder; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.util.HashMap; import java.util.List; import java.util.Map; /** * @Auther: 胡锐 * @Description: * @Date: 2021/3/26 23:08 */ @Controller @RequestMapping(value = "/login") @Api(value = "登录业务") public class LoginController { private static Logger log = LoggerFactory.getLogger(LoginController.class); @Resource private RedisUtil redisUtil; @Resource private HighUserService userService; @Resource private UserCenter userCenter; @Resource private WxMaConfiguration wxMaConfiguration; @Resource private UnionUserConfig unionUserConfig; @RequestMapping(value = "/phone", method = RequestMethod.POST) @ResponseBody @ApiOperation(value = "手机号登录") public ResponseData phone(@RequestBody JSONObject body, HttpServletRequest request, HttpServletResponse response) { try { if (body == null || StringUtils.isBlank(body.getString("platform")) || StringUtils.isBlank(body.getString("type")) || StringUtils.isBlank(body.getString("phone")) ) { log.error("LoginController --> phone() error!", "请求参数校验失败"); throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); } String phone = body.getString("phone"); // 客户端 LoginPlatform platform = LoginPlatform.getDataByType(body.getString("platform")); if (platform == null) { log.error("LoginController --> phone() error!", "未知客户端"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知客户端"); } // 校验手机号格式 if (MemberValidateUtil.validatePhone(phone) == false) { log.error("LoginController --> phone() error!", "请输入正确的手机号"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "请输入正确的手机号"); } // 登录类型 LoginType loginType = LoginType.getDataByType(body.getString("type")); if (loginType == null) { log.error("LoginController --> phone() error!", "未知登录类型;" + body.getString("type")); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知登录类型"); } if (body.getString("type").equals(LoginType.SMS.getCode())) { if (StringUtils.isBlank(body.getString("smsCode"))) { log.error("LoginController --> phone() error!", "请输入短信验证码"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "请输入短信验证码"); } // 手机号的验证码 Object phoneCodeObject = redisUtil.get(RedisFileFolder.SMS_CODE.getCode() + phone); if (phoneCodeObject == null) { log.error("LoginController --> phone() error!", "短信验证码错误"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "短信验证码错误"); } if (!body.getString("smsCode").equals(phoneCodeObject.toString())) { log.error("LoginController --> phone() error!", "短信验证码错误"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "短信验证码错误"); } redisUtil.del(RedisFileFolder.SMS_CODE.getCode() + phone); Map other = new HashMap<>(); other.put("openIdH5", body.getString("openIdH5")); other.put("storeId", body.getLong("storeId")); return ResponseMsgUtil.success(userService.loginAndRegister(platform, phone, body.getLong("popularizeUserId"), other, request, response)); } throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "登录失败"); } catch (Exception e) { log.error("LoginController --> phone() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/openId", method = RequestMethod.POST) @ResponseBody @ApiOperation(value = "openId登录") public ResponseData openId(@RequestBody JSONObject body,HttpServletRequest request, HttpServletResponse response) { try { if (body == null || StringUtils.isBlank(body.getString("platform")) || StringUtils.isBlank(body.getString("type")) || StringUtils.isBlank(body.getString("openId")) ) { log.error("LoginController --> phone() error!", "请求参数校验失败"); throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); } // 客户端 LoginPlatform platform = LoginPlatform.getDataByType(body.getString("platform")); if (platform == null) { log.error("LoginController --> phone() error!", "未知客户端"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知客户端"); } // 登录类型 LoginType loginType = LoginType.getDataByType(body.getString("type")); if (loginType == null) { log.error("LoginController --> phone() error!", "未知登录类型;" + body.getString("type")); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知登录类型"); } if (body.getString("type").equals(LoginType.WECHAT_MP_OPENID.getCode())) { Map param = new HashMap<>(); param.put("openId", body.getString("openId")); List userList = userService.getUserList(param); if (userList.size() > 0) { HighUser user = userList.get(0); if (StringUtils.isNotBlank(user.getPhone())){ return ResponseMsgUtil.success(userService.loginAndRegister(platform, user.getPhone(), body.getLong("popularizeUserId"), new HashMap<>(), request, response)); } } return ResponseMsgUtil.success(null); } else if (body.getString("type").equals(LoginType.WECHAT_MA_OPENID.getCode())) { Map param = new HashMap<>(); param.put("openIdH5", body.getString("openId")); List userList = userService.getUserList(param); if (userList.size() > 0) { HighUser user = userList.get(0); if (StringUtils.isNotBlank(user.getPhone())) { return ResponseMsgUtil.success(userService.loginAndRegister(platform, user.getPhone(), body.getLong("popularizeUserId"), new HashMap<>(), request, response)); } } return ResponseMsgUtil.success(null); } throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "登录失败"); } catch (Exception e) { log.error("LoginController --> phone() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/wxMiniHandleCode", method = RequestMethod.POST) @ResponseBody @ApiOperation(value = "微信小程序code解析") public ResponseData wxMiniHandleCode(@RequestBody JSONObject body) { try { if (body == null|| StringUtils.isBlank(body.getString("code"))) { log.error("LoginController --> phone() error!", "请求参数校验失败"); throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); } WxMaJscode2SessionResult session; if (body.getInteger("type") != null) { //请求微信api,获取用户session_key以及openId session = WxMaConfiguration.getMaService(body.getInteger("type")).jsCode2SessionInfo(body.getString("code")); } else { //请求微信api,获取用户session_key以及openId session = WxMaConfiguration.getMaService().jsCode2SessionInfo(body.getString("code")); } //保存小程序用户登录的openId及sessionKey信息 redisUtil.hset("WX_OPENID_SESSION_REDIS", session.getOpenid(), session); JSONObject jo = new JSONObject(); jo.put("openId", session.getOpenid()); return ResponseMsgUtil.success(jo); } catch (Exception e) { return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/wxMini", method = RequestMethod.POST) @ResponseBody @ApiOperation(value = "微信小程序") public ResponseData wxMini(@RequestBody JSONObject body,HttpServletRequest request, HttpServletResponse response) { try { if (body == null || StringUtils.isBlank(body.getString("encryptedData")) || StringUtils.isBlank(body.getString("iv")) || StringUtils.isBlank(body.getString("openId"))) { log.error("LoginController --> phone() error!", "请求参数校验失败"); throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); } System.out.println("============================" + body); String encryptedData = body.getString("encryptedData").replace(" ", "+"); String iv = body.getString("iv").replace(" ", "+"); //请求微信api,获取用户session_key以及openId Object skObject = redisUtil.hget("WX_OPENID_SESSION_REDIS", body.getString("openId")); if (skObject == null) { throw ErrorHelp.genException(SysCode.MiniProgram, ErrorCode.WECHAT_LOGIN_ERROR); } WxMaJscode2SessionResult session = (WxMaJscode2SessionResult) skObject; WxMaPhoneNumberInfo phoneNoInfo; if (body.getInteger("type") != null) { phoneNoInfo = WxMaConfiguration .getMaService(body.getInteger("type")) .getUserService() .getPhoneNoInfo(session.getSessionKey(), encryptedData, iv); } else { phoneNoInfo = WxMaConfiguration .getMaService() .getUserService() .getPhoneNoInfo(session.getSessionKey(), encryptedData, iv); } if (phoneNoInfo == null || StringUtils.isEmpty(phoneNoInfo.getPurePhoneNumber())) { log.error("LoginController --> wxMini() error!", "登录失败! 用户手机号解析失败"); throw ErrorHelp.genException(SysCode.MiniProgram, ErrorCode.WECHAT_DECRYPT_ERROR, "登录失败! 用户手机号解析失败"); } Map other = new HashMap<>(); other.put("openId", session.getOpenid()); other.put("storeId", body.getLong("storeId")); return ResponseMsgUtil.success(userService.loginAndRegister(LoginPlatform.WXAPPLETS, phoneNoInfo.getPurePhoneNumber(), body.getLong("popularizeUserId"), other, request, response)); } catch (Exception e) { log.error("LoginController --> wxMini() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/union", method = RequestMethod.POST) @ResponseBody @ApiOperation(value = "银联授权手机号登录接口") public ResponseData union(@RequestBody JSONObject body,HttpServletRequest request, HttpServletResponse response) { try { if (body == null || StringUtils.isBlank(body.getString("code"))) { log.error("LoginController --> phone() error!", "请求参数校验失败"); throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); } // 获取应用访问令牌 String backendToken = unionUserConfig.getBackendToken(); // 获取授权访问令牌 JSONObject token = unionUserConfig.getAccessToken(backendToken, body.getString("code")); if (token == null || !token.getString("resp").equals("00")) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, token.getString("msg")); } // 获取用户手机号 JSONObject userMobile = unionUserConfig.getUserMobile(backendToken, token.getJSONObject("params").getString("accessToken"), token.getJSONObject("params").getString("openId")); if (userMobile == null || !userMobile.getString("resp").equals("00")) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, userMobile.getString("msg")); } // 解密,获取手机号 String mobile = UnionUtils.getDecryptedValue(userMobile.getJSONObject("params").getString("mobile"), unionUserConfig.getRsaKey()); Map other = new HashMap<>(); other.put("unionId", token.getJSONObject("params").getString("openId")); other.put("unionUnionId", token.getJSONObject("params").getString("unionId")); return ResponseMsgUtil.success(userService.loginAndRegister(LoginPlatform.UNIONPAY, mobile, body.getLong("popularizeUserId"), other, request, response)); } catch (Exception e) { return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/out", method = RequestMethod.POST) @ResponseBody @ApiOperation(value = "退出登录") public ResponseData out(HttpServletRequest request, HttpServletResponse response) { try { HighUserModel userInfoModel = userCenter.getSessionModel(HighUserModel.class); if (userInfoModel == null) { log.error("CoresController --> outLogin() error!", "用户身份错误或已过期"); throw ErrorHelp.genException(SysCode.System, ErrorCode.SEC_USER_EXPIRED, ""); } userCenter.remove(request, response); return ResponseMsgUtil.success("退出登录成功"); } catch (Exception e) { log.error("CoresController --> outLogin() error!", e); return ResponseMsgUtil.exception(e); } } } \ No newline at end of file +package com.web.controller; import cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult; import cn.binarywang.wx.miniapp.bean.WxMaPhoneNumberInfo; import com.alibaba.fastjson.JSONObject; import com.hai.common.exception.ErrorCode; import com.hai.common.exception.ErrorHelp; import com.hai.common.exception.SysCode; import com.hai.common.security.UserCenter; import com.hai.common.utils.*; import com.hai.config.UnionUserConfig; import com.hai.config.WxMaConfiguration; import com.hai.entity.HighUser; import com.hai.enum_type.LoginPlatform; import com.hai.model.HighUserModel; import com.hai.model.ResponseData; import com.hai.order.type.PlatformType; import com.hai.service.HighUserService; import com.web.type.LoginType; import com.hai.enum_type.RedisFileFolder; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import javafx.application.Platform; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.util.HashMap; import java.util.List; import java.util.Map; /** * @Auther: 胡锐 * @Description: * @Date: 2021/3/26 23:08 */ @Controller @RequestMapping(value = "/login") @Api(value = "登录业务") public class LoginController { private static Logger log = LoggerFactory.getLogger(LoginController.class); @Resource private RedisUtil redisUtil; @Resource private HighUserService userService; @Resource private UserCenter userCenter; @Resource private WxMaConfiguration wxMaConfiguration; @Resource private UnionUserConfig unionUserConfig; @RequestMapping(value = "/phone", method = RequestMethod.POST) @ResponseBody @ApiOperation(value = "手机号登录") public ResponseData phone(@RequestBody JSONObject body, HttpServletRequest request, HttpServletResponse response) { try { if (body == null || StringUtils.isBlank(body.getString("platform")) || StringUtils.isBlank(body.getString("type")) || StringUtils.isBlank(body.getString("phone")) ) { log.error("LoginController --> phone() error!", "请求参数校验失败"); throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); } String phone = body.getString("phone"); // 客户端 LoginPlatform platform = LoginPlatform.getDataByType(body.getString("platform")); if (platform == null) { log.error("LoginController --> phone() error!", "未知客户端"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知客户端"); } // 校验手机号格式 if (MemberValidateUtil.validatePhone(phone) == false) { log.error("LoginController --> phone() error!", "请输入正确的手机号"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "请输入正确的手机号"); } // 登录类型 LoginType loginType = LoginType.getDataByType(body.getString("type")); if (loginType == null) { log.error("LoginController --> phone() error!", "未知登录类型;" + body.getString("type")); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知登录类型"); } if (body.getString("type").equals(LoginType.SMS.getCode())) { if (StringUtils.isBlank(body.getString("smsCode"))) { log.error("LoginController --> phone() error!", "请输入短信验证码"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "请输入短信验证码"); } // 手机号的验证码 Object phoneCodeObject = redisUtil.get(RedisFileFolder.SMS_CODE.getCode() + phone); if (phoneCodeObject == null) { log.error("LoginController --> phone() error!", "短信验证码错误"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "短信验证码错误"); } if (!body.getString("smsCode").equals(phoneCodeObject.toString())) { log.error("LoginController --> phone() error!", "短信验证码错误"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "短信验证码错误"); } redisUtil.del(RedisFileFolder.SMS_CODE.getCode() + phone); Map other = new HashMap<>(); other.put("storeId", body.getLong("storeId")); if (LoginPlatform.H5.getCode().equals(body.getString("platform"))) { other.put("openIdH5", body.getString("openId")); } if (LoginPlatform.WXAPPLETS.getCode().equals(body.getString("platform"))) { other.put("openId", body.getString("openId")); } return ResponseMsgUtil.success(userService.loginAndRegister(platform, phone, body.getLong("popularizeUserId"), other, request, response)); } throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "登录失败"); } catch (Exception e) { log.error("LoginController --> phone() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/openId", method = RequestMethod.POST) @ResponseBody @ApiOperation(value = "openId登录") public ResponseData openId(@RequestBody JSONObject body,HttpServletRequest request, HttpServletResponse response) { try { if (body == null || StringUtils.isBlank(body.getString("platform")) || StringUtils.isBlank(body.getString("type")) || StringUtils.isBlank(body.getString("openId")) ) { log.error("LoginController --> phone() error!", "请求参数校验失败"); throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); } // 客户端 LoginPlatform platform = LoginPlatform.getDataByType(body.getString("platform")); if (platform == null) { log.error("LoginController --> phone() error!", "未知客户端"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知客户端"); } // 登录类型 LoginType loginType = LoginType.getDataByType(body.getString("type")); if (loginType == null) { log.error("LoginController --> phone() error!", "未知登录类型;" + body.getString("type")); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知登录类型"); } if (body.getString("type").equals(LoginType.WECHAT_MA_OPENID.getCode())) { Map param = new HashMap<>(); param.put("openId", body.getString("openId")); List userList = userService.getUserList(param); if (userList.size() > 0) { HighUser user = userList.get(0); if (StringUtils.isNotBlank(user.getPhone())){ return ResponseMsgUtil.success(userService.loginAndRegister(platform, user.getPhone(), body.getLong("popularizeUserId"), new HashMap<>(), request, response)); } } return ResponseMsgUtil.success(null); } else if (body.getString("type").equals(LoginType.WECHAT_MP_OPENID.getCode())) { Map param = new HashMap<>(); param.put("openIdH5", body.getString("openId")); List userList = userService.getUserList(param); if (userList.size() > 0) { HighUser user = userList.get(0); if (StringUtils.isNotBlank(user.getPhone())) { return ResponseMsgUtil.success(userService.loginAndRegister(platform, user.getPhone(), body.getLong("popularizeUserId"), new HashMap<>(), request, response)); } } return ResponseMsgUtil.success(null); } throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "登录失败"); } catch (Exception e) { log.error("LoginController --> phone() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/wxMiniHandleCode", method = RequestMethod.POST) @ResponseBody @ApiOperation(value = "微信小程序code解析") public ResponseData wxMiniHandleCode(@RequestBody JSONObject body) { try { if (body == null|| StringUtils.isBlank(body.getString("code"))) { log.error("LoginController --> phone() error!", "请求参数校验失败"); throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); } WxMaJscode2SessionResult session; if (body.getInteger("type") != null) { //请求微信api,获取用户session_key以及openId session = WxMaConfiguration.getMaService(body.getInteger("type")).jsCode2SessionInfo(body.getString("code")); } else { //请求微信api,获取用户session_key以及openId session = WxMaConfiguration.getMaService().jsCode2SessionInfo(body.getString("code")); } //保存小程序用户登录的openId及sessionKey信息 redisUtil.hset("WX_OPENID_SESSION_REDIS", session.getOpenid(), session); JSONObject jo = new JSONObject(); jo.put("openId", session.getOpenid()); return ResponseMsgUtil.success(jo); } catch (Exception e) { return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/wxMini", method = RequestMethod.POST) @ResponseBody @ApiOperation(value = "微信小程序") public ResponseData wxMini(@RequestBody JSONObject body,HttpServletRequest request, HttpServletResponse response) { try { if (body == null || StringUtils.isBlank(body.getString("encryptedData")) || StringUtils.isBlank(body.getString("iv")) || StringUtils.isBlank(body.getString("openId"))) { log.error("LoginController --> phone() error!", "请求参数校验失败"); throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); } System.out.println("============================" + body); String encryptedData = body.getString("encryptedData").replace(" ", "+"); String iv = body.getString("iv").replace(" ", "+"); //请求微信api,获取用户session_key以及openId Object skObject = redisUtil.hget("WX_OPENID_SESSION_REDIS", body.getString("openId")); if (skObject == null) { throw ErrorHelp.genException(SysCode.MiniProgram, ErrorCode.WECHAT_LOGIN_ERROR); } WxMaJscode2SessionResult session = (WxMaJscode2SessionResult) skObject; WxMaPhoneNumberInfo phoneNoInfo; if (body.getInteger("type") != null) { phoneNoInfo = WxMaConfiguration .getMaService(body.getInteger("type")) .getUserService() .getPhoneNoInfo(session.getSessionKey(), encryptedData, iv); } else { phoneNoInfo = WxMaConfiguration .getMaService() .getUserService() .getPhoneNoInfo(session.getSessionKey(), encryptedData, iv); } if (phoneNoInfo == null || StringUtils.isEmpty(phoneNoInfo.getPurePhoneNumber())) { log.error("LoginController --> wxMini() error!", "登录失败! 用户手机号解析失败"); throw ErrorHelp.genException(SysCode.MiniProgram, ErrorCode.WECHAT_DECRYPT_ERROR, "登录失败! 用户手机号解析失败"); } Map other = new HashMap<>(); other.put("openId", session.getOpenid()); other.put("storeId", body.getLong("storeId")); return ResponseMsgUtil.success(userService.loginAndRegister(LoginPlatform.WXAPPLETS, phoneNoInfo.getPurePhoneNumber(), body.getLong("popularizeUserId"), other, request, response)); } catch (Exception e) { log.error("LoginController --> wxMini() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/union", method = RequestMethod.POST) @ResponseBody @ApiOperation(value = "银联授权手机号登录接口") public ResponseData union(@RequestBody JSONObject body,HttpServletRequest request, HttpServletResponse response) { try { if (body == null || StringUtils.isBlank(body.getString("code"))) { log.error("LoginController --> phone() error!", "请求参数校验失败"); throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); } // 获取应用访问令牌 String backendToken = unionUserConfig.getBackendToken(); // 获取授权访问令牌 JSONObject token = unionUserConfig.getAccessToken(backendToken, body.getString("code")); if (token == null || !token.getString("resp").equals("00")) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, token.getString("msg")); } // 获取用户手机号 JSONObject userMobile = unionUserConfig.getUserMobile(backendToken, token.getJSONObject("params").getString("accessToken"), token.getJSONObject("params").getString("openId")); if (userMobile == null || !userMobile.getString("resp").equals("00")) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, userMobile.getString("msg")); } // 解密,获取手机号 String mobile = UnionUtils.getDecryptedValue(userMobile.getJSONObject("params").getString("mobile"), unionUserConfig.getRsaKey()); Map other = new HashMap<>(); other.put("unionId", token.getJSONObject("params").getString("openId")); other.put("unionUnionId", token.getJSONObject("params").getString("unionId")); return ResponseMsgUtil.success(userService.loginAndRegister(LoginPlatform.UNIONPAY, mobile, body.getLong("popularizeUserId"), other, request, response)); } catch (Exception e) { return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/out", method = RequestMethod.POST) @ResponseBody @ApiOperation(value = "退出登录") public ResponseData out(HttpServletRequest request, HttpServletResponse response) { try { HighUserModel userInfoModel = userCenter.getSessionModel(HighUserModel.class); if (userInfoModel == null) { log.error("CoresController --> outLogin() error!", "用户身份错误或已过期"); throw ErrorHelp.genException(SysCode.System, ErrorCode.SEC_USER_EXPIRED, ""); } userCenter.remove(request, response); return ResponseMsgUtil.success("退出登录成功"); } catch (Exception e) { log.error("CoresController --> outLogin() error!", e); return ResponseMsgUtil.exception(e); } } } \ No newline at end of file diff --git a/v1/src/main/java/com/v1/controller/business/ApiCouponController.java b/v1/src/main/java/com/v1/controller/business/ApiCouponController.java new file mode 100644 index 00000000..a018988b --- /dev/null +++ b/v1/src/main/java/com/v1/controller/business/ApiCouponController.java @@ -0,0 +1,201 @@ +package com.v1.controller.business; + +import com.alibaba.fastjson.JSONObject; +import com.hai.common.exception.ErrorCode; +import com.hai.common.exception.ErrorHelp; +import com.hai.common.exception.SysCode; +import com.hai.common.utils.ResponseMsgUtil; +import com.hai.config.PetroConfig; +import com.hai.entity.ApiCoupon; +import com.hai.entity.ApiMerchants; +import com.hai.entity.ApiOrder; +import com.hai.model.ResponseData; +import com.hai.openApi.service.ApiCouponService; +import com.hai.openApi.service.ApiOrderService; +import com.hai.order.type.OrderProductType; +import com.hai.service.ApiIpAddressService; +import com.hai.service.ApiMerchantsService; +import com.hai.service.SecConfigService; +import com.v1.config.ToolConfig; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Controller; +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.ResponseBody; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.HashMap; +import java.util.Map; + +@Controller +@RequestMapping(value = "/apiCoupon") +@Api(value = "卡券业务") +public class ApiCouponController { + + private static Logger log = LoggerFactory.getLogger(ApiCouponController.class); + + @Resource + private ApiMerchantsService apiMerchantsService; + + @Resource + private ApiCouponService apiCouponService; + + @Resource + private SecConfigService secConfigService; + + @Resource + private ApiIpAddressService apiIpAddressService; + + @Resource + private ApiOrderService apiOrderService; + + @RequestMapping(value = "/getCouponList", method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "获取卡券列表") + public ResponseData getCouponList(@RequestBody JSONObject object , HttpServletRequest request ) { + try { + + String ip = ""; + // 有的user可能使用代理,为处理用户使用代理的情况,使用x-forwarded-for + if (request.getHeader("x-forwarded-for") == null) { + ip = request.getRemoteAddr(); + } else { + ip = request.getHeader("x-forwarded-for"); + } + + if (!apiIpAddressService.validationIpAddressLegal(object.getString("merchId") , ip)) { + log.error("getRechargeProduct error!", "非法ip地址,请联系管理人员!"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.IP_ERROR, "非法ip地址,请联系管理人员!"); + } + + if ( + StringUtils.isBlank(object.getString("merchId")) || + StringUtils.isBlank(object.getString("timetable")) || + StringUtils.isBlank(object.getString("sign")) + ) { + log.error("getRechargeProduct error!", "请求参数校验失败!"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR); + } + + ApiMerchants apiMerchants = apiMerchantsService.findByMchId(object.getString("merchId")); + + if (apiMerchants == null) { + log.error("getRechargeProduct error!", "帐户错误!"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.ACCOUNT_NOT_EXIST); + } + + if (!secConfigService.isConfig(OrderProductType.PRODUCT_TYPE18.getApiCode(), object.getString("merchId"))) { + log.error("getAllCities error!", "当前帐户无权限查询!"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.MERCHANT_NOT_AUTHORIZED, ""); + } + + if (!ToolConfig.timetableCheck(15L , object.getLong("timetable"))) { + log.error("getRechargeProduct error!", "请求时间超过15分钟!"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.TIME_OUT); + } + + Map map = new HashMap<>(); + map.put("apiKey" , apiMerchants.getApiKey()); + map.put("timetable" , object.getString("timetable")); + map.put("merchId" , object.getString("merchId")); + + if (!secConfigService.isSignVerify(map , object.getString("sign"))) { + log.error("getRechargeProduct error!", "签名校验失败!"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.SIGN_VERIFY); + } + + return ResponseMsgUtil.success(apiCouponService.getCouponList(new HashMap<>())); + + } catch (Exception e) { + log.error("HighOpenApiController --> getRechargeProduct() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + + @RequestMapping(value = "/couponDetail", method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "查询卡券详情") + public ResponseData couponDetail(@RequestBody JSONObject object , HttpServletRequest request) { + try { + + String ip; + // 有的user可能使用代理,为处理用户使用代理的情况,使用x-forwarded-for + if (request.getHeader("x-forwarded-for") == null) { + ip = request.getRemoteAddr(); + } else { + ip = request.getHeader("x-forwarded-for"); + } + + if (!apiIpAddressService.validationIpAddressLegal(object.getString("merchId") , ip)) { + log.error("getRechargeProduct error!", "非法ip地址,请联系管理人员!"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.IP_ERROR, "非法ip地址,请联系管理人员!"); + } + + if ( + StringUtils.isBlank(object.getString("mchOrderNo")) || + StringUtils.isBlank(object.getString("sign")) || + StringUtils.isBlank(object.getString("timetable")) || + StringUtils.isBlank(object.getString("merchId")) + ) { + log.error("createOrder error!", "请求参数校验失败!"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR); + } + + ApiMerchants apiMerchants = apiMerchantsService.findByMchId(object.getString("merchId")); + + if (apiMerchants == null) { + log.error("getRechargeProduct error!", "帐户错误!"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.ACCOUNT_NOT_EXIST); + } + + if (!secConfigService.isConfig(OrderProductType.PRODUCT_TYPE18.getApiCode(), object.getString("merchId"))) { + log.error("getAllCities error!", "当前帐户无权限查询!"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.MERCHANT_NOT_AUTHORIZED, ""); + } + + if (!ToolConfig.timetableCheck(15L , object.getLong("timetable"))) { + log.error("getRechargeProduct error!", "请求时间超过15分钟!"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.TIME_OUT); + } + + Map map = new HashMap<>(); + map.put("mchOrderNo" , object.getString("mchOrderNo")); + map.put("apiKey" , apiMerchants.getApiKey()); + map.put("timetable" , object.getString("timetable")); + map.put("merchId" , object.getString("merchId")); + + if (!secConfigService.isSignVerify(map, object.getString("sign"))) { + log.error("createOrder error!", "签名校验失败!"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.SIGN_VERIFY); + } + + ApiOrder apiOrder = apiOrderService.findByOrderNo(object.getString("mchOrderNo") , null); + + JSONObject jsonObject = PetroConfig.couponDetail(apiOrder.getExt3()); + + if (!jsonObject.getString("code").equals("1")) { + throw ErrorHelp.genException(SysCode.System , ErrorCode.COMMON_ERROR , "当前卡券不可购买"); + } + + String data = PetroConfig.decrypt(jsonObject.getString("biz_content")); + + JSONObject jsonData = JSONObject.parseObject(data); + jsonData.put("out_trade_no" , object.getString("mchOrderNo")); + + return ResponseMsgUtil.success(jsonData); + + } catch (Exception e) { + log.error("HighOpenApiController --> createOrder() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + +} diff --git a/v1/src/main/java/com/v1/controller/orderController.java b/v1/src/main/java/com/v1/controller/orderController.java index b27ac6f9..ac3bbb7a 100644 --- a/v1/src/main/java/com/v1/controller/orderController.java +++ b/v1/src/main/java/com/v1/controller/orderController.java @@ -128,8 +128,8 @@ public class orderController { throw ErrorHelp.genException(SysCode.System, ErrorCode.TIME_OUT); } + JSONObject dataObject = JSONObject.parseObject(object.getString("content")); if (object.getInteger("productType").equals(OrderProductType.PRODUCT_TYPE6.getNumber())) { - JSONObject dataObject = JSONObject.parseObject(object.getString("content")); if (dataObject.getBigDecimal("refuelPrice") == null || StringUtils.isBlank(dataObject.getString("gasOilNo")) || StringUtils.isBlank(dataObject.getString("gasGunNo")) @@ -139,7 +139,6 @@ public class orderController { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未填写加油信息;加油金额、油号、抢号"); } } - JSONObject dataObject = JSONObject.parseObject(object.getString("content")); if (object.getInteger("productType").equals(OrderProductType.PRODUCT_TYPE9.getNumber()) || object.getInteger("productType").equals(OrderProductType.PRODUCT_TYPE3.getNumber())) { if (StringUtils.isBlank(dataObject.getString("productId")) @@ -168,28 +167,36 @@ public class orderController { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未填写下单手机号,就餐方式,下单信息,门店编码"); } } - if (object.getInteger("productType").equals(OrderProductType.PRODUCT_TYPE13.getNumber())) { - if ( StringUtils.isBlank(dataObject.getString("couponCode")) - || StringUtils.isBlank(dataObject.getString("receiverPhone")) - || dataObject.getInteger("receiverCount") == null - ) { - log.error("OrderController -> create() error!",""); - throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未填写卡券编码,手机号,购买数量"); - } - } - if (object.getInteger("productType").equals(OrderProductType.PRODUCT_TYPE14.getNumber())) { +// if (object.getInteger("productType").equals(OrderProductType.PRODUCT_TYPE13.getNumber())) { +// if ( StringUtils.isBlank(dataObject.getString("couponCode")) +// || StringUtils.isBlank(dataObject.getString("userMobile")) +// || dataObject.getInteger("receiverCount") == null +// ) { +// log.error("OrderController -> create() error!",""); +// throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未填写卡券编码,手机号,购买数量"); +// } +// } +// if (object.getInteger("productType").equals(OrderProductType.PRODUCT_TYPE14.getNumber())) { +// if ( StringUtils.isBlank(dataObject.getString("userMobile")) +// || StringUtils.isBlank(dataObject.getString("userCouponCode")) +// || StringUtils.isBlank(dataObject.getString("parkOrderId")) +// || StringUtils.isBlank(dataObject.getString("parkName")) +// || dataObject.getInteger("orderType") == null +// || dataObject.getBigDecimal("prePrice") == null +// || dataObject.getBigDecimal("currentamt") == null +// || dataObject.getInteger("parkId") == null +// || dataObject.getInteger("parkTime") == null +// || dataObject.getString("inTime") == null +// || dataObject.getString("outTime") == null +// || dataObject.getString("carNo") == null +// ) { +// log.error("OrderController -> create() error!",""); +// throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未填写相关参数"); +// } +// } + if (object.getInteger("productType").equals(OrderProductType.PRODUCT_TYPE18.getNumber())) { if ( StringUtils.isBlank(dataObject.getString("userMobile")) - || StringUtils.isBlank(dataObject.getString("userCouponCode")) - || StringUtils.isBlank(dataObject.getString("parkOrderId")) - || StringUtils.isBlank(dataObject.getString("parkName")) - || dataObject.getInteger("orderType") == null - || dataObject.getBigDecimal("prePrice") == null - || dataObject.getBigDecimal("currentamt") == null - || dataObject.getInteger("parkId") == null - || dataObject.getInteger("parkTime") == null - || dataObject.getString("inTime") == null - || dataObject.getString("outTime") == null - || dataObject.getString("carNo") == null + || StringUtils.isBlank(dataObject.getString("couponCode")) ) { log.error("OrderController -> create() error!",""); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未填写相关参数");