diff --git a/pom.xml b/pom.xml index a52b723..d7d7ae4 100644 --- a/pom.xml +++ b/pom.xml @@ -6,6 +6,7 @@ com.ruoyi ruoyi + pom 3.6.0 ruoyi @@ -33,11 +34,78 @@ 4.1.2 1.7 0.9.1 + 4.8.10.ALL + + + + com.google.zxing + core + 3.4.0 + + + + com.alipay.sdk + alipay-sdk-java + ${alipay.version} + + + fastjson + com.alibaba + + + + + org.bouncycastle + bcprov-jdk16 + 1.46 + + + + dom4j + dom4j + 1.6.1 + + + + + com.github.qcloudsms + qcloudsms + 1.0.6 + + + com.aliyun + aliyun-java-sdk-core + 4.0.6 + + + + com.aliyun + aliyun-java-sdk-dysmsapi + 1.1.0 + + + + com.qcloud + cos_api + 5.6.8 + + + + com.aliyun.oss + aliyun-sdk-oss + 2.5.0 + + + + + + + @@ -231,7 +299,7 @@ ruoyi-generator ruoyi-common - pom + diff --git a/pom1.xml b/pom1.xml new file mode 100644 index 0000000..f5bc269 --- /dev/null +++ b/pom1.xml @@ -0,0 +1,320 @@ + + + 4.0.0 + + com.ruoyi + ruoyi + 3.0.0 + + ruoyi + http://www.ruoyi.vip + 魔金商城平台管理 + + + 3.0.0 + UTF-8 + UTF-8 + 1.8 + 1.3.2 + 1.1.14 + 1.19 + 2.9.2 + 1.2.5 + 1.2.70 + 3.9.1 + 2.5 + 1.3.3 + 3.17 + 1.7 + 0.9.0 + 4.8.10.ALL + + + + + + + + + com.google.zxing + core + 3.4.0 + + + + com.alipay.sdk + alipay-sdk-java + ${alipay.version} + + + fastjson + com.alibaba + + + + + org.bouncycastle + bcprov-jdk16 + 1.46 + + + + dom4j + dom4j + 1.6.1 + + + + com.github.qcloudsms + qcloudsms + 1.0.6 + + + com.aliyun + aliyun-java-sdk-core + 4.0.6 + + + + com.aliyun + aliyun-java-sdk-dysmsapi + 1.1.0 + + + + com.qcloud + cos_api + 5.6.8 + + + + com.aliyun.oss + aliyun-sdk-oss + 2.5.0 + + + + org.projectlombok + lombok + 1.18.12 + + + + io.springfox + springfox-swagger2 + 2.9.2 + + + io.springfox + springfox-swagger-ui + 2.9.2 + + + + org.springframework.boot + spring-boot-dependencies + 2.1.1.RELEASE + pom + import + + + + + com.alibaba + druid-spring-boot-starter + ${druid.version} + + + + + eu.bitwalker + UserAgentUtils + ${bitwalker.version} + + + + + com.github.pagehelper + pagehelper-spring-boot-starter + ${pagehelper.boot.version} + + + + + com.github.oshi + oshi-core + ${oshi.version} + + + + + io.springfox + springfox-swagger2 + ${swagger.version} + + + io.swagger + swagger-annotations + + + io.swagger + swagger-models + + + + + + + io.springfox + springfox-swagger-ui + ${swagger.version} + + + + + commons-io + commons-io + ${commons.io.version} + + + + + commons-fileupload + commons-fileupload + ${commons.fileupload.version} + + + + + org.apache.poi + poi-ooxml + ${poi.version} + + + + + org.apache.velocity + velocity + ${velocity.version} + + + + + com.alibaba + fastjson + ${fastjson.version} + + + + + io.jsonwebtoken + jjwt + ${jwt.version} + + + + + com.ruoyi + ruoyi-quartz + ${ruoyi.version} + + + + + com.ruoyi + ruoyi-generator + ${ruoyi.version} + + + + + com.ruoyi + ruoyi-framework + ${ruoyi.version} + + + + + com.ruoyi + ruoyi-system + ${ruoyi.version} + + + + com.ruoyi + ruoyi-mall + ${ruoyi.version} + + + + com.ruoyi + ruoyi-common + ${ruoyi.version} + + + + + + + ruoyi-store + + ruoyi-web + ruoyi-admin + ruoyi-framework + + ruoyi-system + ruoyi-mall + ruoyi-quartz + ruoyi-generator + ruoyi-common + + pom + + + + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + ${java.version} + ${java.version} + ${project.build.sourceEncoding} + + + + + + + + public + aliyun nexus + http://maven.aliyun.com/nexus/content/groups/public/ + + true + + + + + + + public + aliyun nexus + http://maven.aliyun.com/nexus/content/groups/public/ + + true + + + false + + + + + \ No newline at end of file diff --git a/ruoyi-admin/pom.xml b/ruoyi-admin/pom.xml index a0cb8a8..dce5ca0 100644 --- a/ruoyi-admin/pom.xml +++ b/ruoyi-admin/pom.xml @@ -6,6 +6,8 @@ ruoyi com.ruoyi 3.6.0 + ../pom.xml + 4.0.0 jar diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java b/ruoyi-admin/src/main/java/com/ruoyi/security/SecurityConfig.java similarity index 76% rename from ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java rename to ruoyi-admin/src/main/java/com/ruoyi/security/SecurityConfig.java index 6c5f594..f6592ef 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/security/SecurityConfig.java @@ -1,148 +1,131 @@ -package com.ruoyi.framework.config; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Bean; -import org.springframework.http.HttpMethod; -import org.springframework.security.authentication.AuthenticationManager; -import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; -import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity; -import org.springframework.security.config.annotation.web.builders.HttpSecurity; -import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; -import org.springframework.security.config.http.SessionCreationPolicy; -import org.springframework.security.core.userdetails.UserDetailsService; -import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; -import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter; -import org.springframework.security.web.authentication.logout.LogoutFilter; -import org.springframework.web.filter.CorsFilter; -import com.ruoyi.framework.security.filter.JwtAuthenticationTokenFilter; -import com.ruoyi.framework.security.handle.AuthenticationEntryPointImpl; -import com.ruoyi.framework.security.handle.LogoutSuccessHandlerImpl; - -/** - * spring security配置 - * - * @author ruoyi - */ -@EnableGlobalMethodSecurity(prePostEnabled = true, securedEnabled = true) -public class SecurityConfig extends WebSecurityConfigurerAdapter -{ - /** - * 自定义用户认证逻辑 - */ - @Autowired - private UserDetailsService userDetailsService; - - /** - * 认证失败处理类 - */ - @Autowired - private AuthenticationEntryPointImpl unauthorizedHandler; - - /** - * 退出处理类 - */ - @Autowired - private LogoutSuccessHandlerImpl logoutSuccessHandler; - - /** - * token认证过滤器 - */ - @Autowired - private JwtAuthenticationTokenFilter authenticationTokenFilter; - - /** - * 跨域过滤器 - */ - @Autowired - private CorsFilter corsFilter; - - /** - * 解决 无法直接注入 AuthenticationManager - * - * @return - * @throws Exception - */ - @Bean - @Override - public AuthenticationManager authenticationManagerBean() throws Exception - { - return super.authenticationManagerBean(); - } - - /** - * anyRequest | 匹配所有请求路径 - * access | SpringEl表达式结果为true时可以访问 - * anonymous | 匿名可以访问 - * denyAll | 用户不能访问 - * fullyAuthenticated | 用户完全认证可以访问(非remember-me下自动登录) - * hasAnyAuthority | 如果有参数,参数表示权限,则其中任何一个权限可以访问 - * hasAnyRole | 如果有参数,参数表示角色,则其中任何一个角色可以访问 - * hasAuthority | 如果有参数,参数表示权限,则其权限可以访问 - * hasIpAddress | 如果有参数,参数表示IP地址,如果用户IP和参数匹配,则可以访问 - * hasRole | 如果有参数,参数表示角色,则其角色可以访问 - * permitAll | 用户可以任意访问 - * rememberMe | 允许通过remember-me登录的用户访问 - * authenticated | 用户登录后可访问 - */ - @Override - protected void configure(HttpSecurity httpSecurity) throws Exception - { - httpSecurity - // CSRF禁用,因为不使用session - .csrf().disable() - // 认证失败处理类 - .exceptionHandling().authenticationEntryPoint(unauthorizedHandler).and() - // 基于token,所以不需要session - .sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS).and() - // 过滤请求 - .authorizeRequests() - // 对于登录login 注册register 验证码captchaImage 允许匿名访问 - .antMatchers("/login", "/register", "/captchaImage").anonymous() - .antMatchers( - HttpMethod.GET, - "/", - "/*.html", - "/**/*.html", - "/**/*.css", - "/**/*.js", - "/profile/**" - ).permitAll() - .antMatchers("/common/download**").anonymous() - .antMatchers("/common/download/resource**").anonymous() - .antMatchers("/swagger-ui.html").anonymous() - .antMatchers("/swagger-resources/**").anonymous() - .antMatchers("/webjars/**").anonymous() - .antMatchers("/*/api-docs").anonymous() - .antMatchers("/druid/**").anonymous() -// 临时放开对商城的前端访问 - .antMatchers("/default/**").anonymous() - // 除上面外的所有请求全部需要鉴权认证 - .anyRequest().authenticated() - .and() - .headers().frameOptions().disable(); - httpSecurity.logout().logoutUrl("/logout").logoutSuccessHandler(logoutSuccessHandler); - // 添加JWT filter - httpSecurity.addFilterBefore(authenticationTokenFilter, UsernamePasswordAuthenticationFilter.class); - // 添加CORS filter - httpSecurity.addFilterBefore(corsFilter, JwtAuthenticationTokenFilter.class); - httpSecurity.addFilterBefore(corsFilter, LogoutFilter.class); - } - - /** - * 强散列哈希加密实现 - */ - @Bean - public BCryptPasswordEncoder bCryptPasswordEncoder() - { - return new BCryptPasswordEncoder(); - } - - /** - * 身份认证接口 - */ - @Override - protected void configure(AuthenticationManagerBuilder auth) throws Exception - { - auth.userDetailsService(userDetailsService).passwordEncoder(bCryptPasswordEncoder()); - } -} +package com.ruoyi.security; + +import com.ruoyi.security.filter.JwtAuthenticationTokenFilter; +import com.ruoyi.security.handle.AuthenticationEntryPointImpl; +import com.ruoyi.security.handle.LogoutSuccessHandlerImpl; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Bean; +import org.springframework.http.HttpMethod; +import org.springframework.security.authentication.AuthenticationManager; +import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; +import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity; +import org.springframework.security.config.annotation.web.builders.HttpSecurity; +import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; +import org.springframework.security.config.http.SessionCreationPolicy; +import org.springframework.security.core.userdetails.UserDetailsService; +import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; +import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter; + +/** + * spring security配置 + * + * @author ruoyi + */ +@EnableGlobalMethodSecurity(prePostEnabled = true, securedEnabled = true) +public class SecurityConfig extends WebSecurityConfigurerAdapter { + /** + * 自定义用户认证逻辑 + */ + @Autowired + private UserDetailsService userDetailsService; + + /** + * 认证失败处理类 + */ + @Autowired + private AuthenticationEntryPointImpl unauthorizedHandler; + + /** + * 退出处理类 + */ + @Autowired + private LogoutSuccessHandlerImpl logoutSuccessHandler; + + /** + * token认证过滤器 + */ + @Autowired + private JwtAuthenticationTokenFilter authenticationTokenFilter; + + /** + * 解决 无法直接注入 AuthenticationManager + * + * @return + * @throws Exception + */ + @Bean + @Override + public AuthenticationManager authenticationManagerBean() throws Exception { + return super.authenticationManagerBean(); + } + + /** + * anyRequest | 匹配所有请求路径 + * access | SpringEl表达式结果为true时可以访问 + * anonymous | 匿名可以访问 + * denyAll | 用户不能访问 + * fullyAuthenticated | 用户完全认证可以访问(非remember-me下自动登录) + * hasAnyAuthority | 如果有参数,参数表示权限,则其中任何一个权限可以访问 + * hasAnyRole | 如果有参数,参数表示角色,则其中任何一个角色可以访问 + * + * @ss.hasPermi | 如果有参数,参数表示权限,则其权限可以访问 + * hasIpAddress | 如果有参数,参数表示IP地址,如果用户IP和参数匹配,则可以访问 + * hasRole | 如果有参数,参数表示角色,则其角色可以访问 + * permitAll | 用户可以任意访问 + * rememberMe | 允许通过remember-me登录的用户访问 + * authenticated | 用户登录后可访问 + */ + @Override + protected void configure(HttpSecurity httpSecurity) throws Exception { + httpSecurity + // CRSF禁用,因为不使用session + .csrf().disable() + // 认证失败处理类 + .exceptionHandling().authenticationEntryPoint(unauthorizedHandler).and() + // 基于token,所以不需要session + .sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS).and() + // 过滤请求 + .authorizeRequests() + // 对于登录login 验证码captchaImage 允许匿名访问 + .antMatchers("/login", "/captchaImage").anonymous() + .antMatchers( + HttpMethod.GET, + "/*.html", + "/**/*.html", + "/**/*.css", + "/**/*.js" + ).permitAll() + .antMatchers("/profile/**").anonymous() + .antMatchers("/common/download**").anonymous() + .antMatchers("/common/download/resource**").anonymous() + .antMatchers("/swagger-ui.html").anonymous() + .antMatchers("/swagger-resources/**").anonymous() + .antMatchers("/webjars/**").anonymous() + .antMatchers("/*/api-docs").anonymous() + .antMatchers("/druid/**").anonymous() + // 除上面外的所有请求全部需要鉴权认证 + .anyRequest().authenticated() + .and() + .headers().frameOptions().disable(); + httpSecurity.logout().logoutUrl("/logout").logoutSuccessHandler(logoutSuccessHandler); + // 添加JWT filter + httpSecurity.addFilterBefore(authenticationTokenFilter, UsernamePasswordAuthenticationFilter.class); + } + + + /** + * 强散列哈希加密实现 + */ + @Bean + public BCryptPasswordEncoder bCryptPasswordEncoder() { + return new BCryptPasswordEncoder(); + } + + /** + * 身份认证接口 + */ + @Override + protected void configure(AuthenticationManagerBuilder auth) throws Exception { + auth.userDetailsService(userDetailsService).passwordEncoder(bCryptPasswordEncoder()); + } +} diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/security/filter/JwtAuthenticationTokenFilter.java b/ruoyi-admin/src/main/java/com/ruoyi/security/filter/JwtAuthenticationTokenFilter.java similarity index 89% rename from ruoyi-framework/src/main/java/com/ruoyi/framework/security/filter/JwtAuthenticationTokenFilter.java rename to ruoyi-admin/src/main/java/com/ruoyi/security/filter/JwtAuthenticationTokenFilter.java index 75fd00d..6254c51 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/security/filter/JwtAuthenticationTokenFilter.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/security/filter/JwtAuthenticationTokenFilter.java @@ -1,44 +1,43 @@ -package com.ruoyi.framework.security.filter; - -import java.io.IOException; -import javax.servlet.FilterChain; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; -import org.springframework.security.core.context.SecurityContextHolder; -import org.springframework.security.web.authentication.WebAuthenticationDetailsSource; -import org.springframework.stereotype.Component; -import org.springframework.web.filter.OncePerRequestFilter; -import com.ruoyi.common.core.domain.model.LoginUser; -import com.ruoyi.common.utils.SecurityUtils; -import com.ruoyi.common.utils.StringUtils; -import com.ruoyi.framework.web.service.TokenService; - -/** - * token过滤器 验证token有效性 - * - * @author ruoyi - */ -@Component -public class JwtAuthenticationTokenFilter extends OncePerRequestFilter -{ - @Autowired - private TokenService tokenService; - - @Override - protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain chain) - throws ServletException, IOException - { - LoginUser loginUser = tokenService.getLoginUser(request); - if (StringUtils.isNotNull(loginUser) && StringUtils.isNull(SecurityUtils.getAuthentication())) - { - tokenService.verifyToken(loginUser); - UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(loginUser, null, loginUser.getAuthorities()); - authenticationToken.setDetails(new WebAuthenticationDetailsSource().buildDetails(request)); - SecurityContextHolder.getContext().setAuthentication(authenticationToken); - } - chain.doFilter(request, response); - } -} +package com.ruoyi.security.filter; + +import com.ruoyi.common.core.domain.model.LoginUser; +import com.ruoyi.common.utils.SecurityUtils; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.framework.web.service.TokenService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; +import org.springframework.security.core.context.SecurityContextHolder; +import org.springframework.security.web.authentication.WebAuthenticationDetailsSource; +import org.springframework.stereotype.Component; +import org.springframework.web.filter.OncePerRequestFilter; + +import javax.servlet.FilterChain; +import javax.servlet.ServletException; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; + +/** + * token过滤器 验证token有效性 + * + * @author ruoyi + */ +@Component +public class JwtAuthenticationTokenFilter extends OncePerRequestFilter { + @Autowired + private TokenService tokenService; + + @Override + protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain chain) + throws ServletException, IOException { + logger.debug(request.getRequestURI()); + LoginUser loginUser = tokenService.getLoginUser(request); + if (StringUtils.isNotNull(loginUser) && StringUtils.isNull(SecurityUtils.getAuthentication())) { + tokenService.verifyToken(loginUser); + UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(loginUser, null, loginUser.getAuthorities()); + authenticationToken.setDetails(new WebAuthenticationDetailsSource().buildDetails(request)); + SecurityContextHolder.getContext().setAuthentication(authenticationToken); + } + chain.doFilter(request, response); + } +} diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/security/handle/AuthenticationEntryPointImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/security/handle/AuthenticationEntryPointImpl.java similarity index 88% rename from ruoyi-framework/src/main/java/com/ruoyi/framework/security/handle/AuthenticationEntryPointImpl.java rename to ruoyi-admin/src/main/java/com/ruoyi/security/handle/AuthenticationEntryPointImpl.java index bf9965d..7112571 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/security/handle/AuthenticationEntryPointImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/security/handle/AuthenticationEntryPointImpl.java @@ -1,34 +1,33 @@ -package com.ruoyi.framework.security.handle; - -import java.io.IOException; -import java.io.Serializable; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import org.springframework.security.core.AuthenticationException; -import org.springframework.security.web.AuthenticationEntryPoint; -import org.springframework.stereotype.Component; -import com.alibaba.fastjson.JSON; -import com.ruoyi.common.constant.HttpStatus; -import com.ruoyi.common.core.domain.AjaxResult; -import com.ruoyi.common.utils.ServletUtils; -import com.ruoyi.common.utils.StringUtils; - -/** - * 认证失败处理类 返回未授权 - * - * @author ruoyi - */ -@Component -public class AuthenticationEntryPointImpl implements AuthenticationEntryPoint, Serializable -{ - private static final long serialVersionUID = -8970718410437077606L; - - @Override - public void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException e) - throws IOException - { - int code = HttpStatus.UNAUTHORIZED; - String msg = StringUtils.format("请求访问:{},认证失败,无法访问系统资源", request.getRequestURI()); - ServletUtils.renderString(response, JSON.toJSONString(AjaxResult.error(code, msg))); - } -} +package com.ruoyi.security.handle; + +import com.alibaba.fastjson.JSON; +import com.ruoyi.common.constant.HttpStatus; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.common.utils.StringUtils; +import org.springframework.security.core.AuthenticationException; +import org.springframework.security.web.AuthenticationEntryPoint; +import org.springframework.stereotype.Component; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.io.Serializable; + +/** + * 认证失败处理类 返回未授权 + * + * @author ruoyi + */ +@Component +public class AuthenticationEntryPointImpl implements AuthenticationEntryPoint, Serializable { + private static final long serialVersionUID = -8970718410437077606L; + + @Override + public void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException e) + throws IOException { + int code = HttpStatus.UNAUTHORIZED; + String msg = StringUtils.format("请求访问:{},认证失败,无法访问系统资源", request.getRequestURI()); + ServletUtils.renderString(response, JSON.toJSONString(AjaxResult.error(code, msg))); + } +} diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/security/handle/LogoutSuccessHandlerImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/security/handle/LogoutSuccessHandlerImpl.java similarity index 88% rename from ruoyi-framework/src/main/java/com/ruoyi/framework/security/handle/LogoutSuccessHandlerImpl.java rename to ruoyi-admin/src/main/java/com/ruoyi/security/handle/LogoutSuccessHandlerImpl.java index 1d5b1f9..95c16dd 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/security/handle/LogoutSuccessHandlerImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/security/handle/LogoutSuccessHandlerImpl.java @@ -1,53 +1,51 @@ -package com.ruoyi.framework.security.handle; - -import java.io.IOException; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Configuration; -import org.springframework.security.core.Authentication; -import org.springframework.security.web.authentication.logout.LogoutSuccessHandler; -import com.alibaba.fastjson.JSON; -import com.ruoyi.common.constant.Constants; -import com.ruoyi.common.constant.HttpStatus; -import com.ruoyi.common.core.domain.AjaxResult; -import com.ruoyi.common.core.domain.model.LoginUser; -import com.ruoyi.common.utils.ServletUtils; -import com.ruoyi.common.utils.StringUtils; -import com.ruoyi.framework.manager.AsyncManager; -import com.ruoyi.framework.manager.factory.AsyncFactory; -import com.ruoyi.framework.web.service.TokenService; - -/** - * 自定义退出处理类 返回成功 - * - * @author ruoyi - */ -@Configuration -public class LogoutSuccessHandlerImpl implements LogoutSuccessHandler -{ - @Autowired - private TokenService tokenService; - - /** - * 退出处理 - * - * @return - */ - @Override - public void onLogoutSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) - throws IOException, ServletException - { - LoginUser loginUser = tokenService.getLoginUser(request); - if (StringUtils.isNotNull(loginUser)) - { - String userName = loginUser.getUsername(); - // 删除用户缓存记录 - tokenService.delLoginUser(loginUser.getToken()); - // 记录用户退出日志 - AsyncManager.me().execute(AsyncFactory.recordLogininfor(userName, Constants.LOGOUT, "退出成功")); - } - ServletUtils.renderString(response, JSON.toJSONString(AjaxResult.error(HttpStatus.SUCCESS, "退出成功"))); - } -} +package com.ruoyi.security.handle; + +import com.alibaba.fastjson.JSON; +import com.ruoyi.common.constant.Constants; +import com.ruoyi.common.constant.HttpStatus; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.domain.model.LoginUser; +import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.framework.manager.AsyncManager; +import com.ruoyi.framework.manager.factory.AsyncFactory; +import com.ruoyi.framework.web.service.TokenService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Configuration; +import org.springframework.security.core.Authentication; +import org.springframework.security.web.authentication.logout.LogoutSuccessHandler; + +import javax.servlet.ServletException; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; + +/** + * 自定义退出处理类 返回成功 + * + * @author ruoyi + */ +@Configuration +public class LogoutSuccessHandlerImpl implements LogoutSuccessHandler { + @Autowired + private TokenService tokenService; + + /** + * 退出处理 + * + * @return + */ + @Override + public void onLogoutSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) + throws IOException, ServletException { + LoginUser loginUser = tokenService.getLoginUser(request); + if (StringUtils.isNotNull(loginUser)) { + String userName = loginUser.getUsername(); + // 删除用户缓存记录 + tokenService.delLoginUser(loginUser.getToken()); + // 记录用户退出日志 + AsyncManager.me().execute(AsyncFactory.recordLogininfor(userName, Constants.LOGOUT, "退出成功")); + } + ServletUtils.renderString(response, JSON.toJSONString(AjaxResult.error(HttpStatus.SUCCESS, "退出成功"))); + } +} diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/Server.java b/ruoyi-admin/src/main/java/com/ruoyi/security/web/domain/Server.java similarity index 75% rename from ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/Server.java rename to ruoyi-admin/src/main/java/com/ruoyi/security/web/domain/Server.java index 30a1957..db3c8ab 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/Server.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/security/web/domain/Server.java @@ -1,240 +1,211 @@ -package com.ruoyi.framework.web.domain; - -import java.net.UnknownHostException; -import java.util.LinkedList; -import java.util.List; -import java.util.Properties; -import com.ruoyi.common.utils.Arith; -import com.ruoyi.common.utils.ip.IpUtils; -import com.ruoyi.framework.web.domain.server.Cpu; -import com.ruoyi.framework.web.domain.server.Jvm; -import com.ruoyi.framework.web.domain.server.Mem; -import com.ruoyi.framework.web.domain.server.Sys; -import com.ruoyi.framework.web.domain.server.SysFile; -import oshi.SystemInfo; -import oshi.hardware.CentralProcessor; -import oshi.hardware.CentralProcessor.TickType; -import oshi.hardware.GlobalMemory; -import oshi.hardware.HardwareAbstractionLayer; -import oshi.software.os.FileSystem; -import oshi.software.os.OSFileStore; -import oshi.software.os.OperatingSystem; -import oshi.util.Util; - -/** - * 服务器相关信息 - * - * @author ruoyi - */ -public class Server -{ - private static final int OSHI_WAIT_SECOND = 1000; - - /** - * CPU相关信息 - */ - private Cpu cpu = new Cpu(); - - /** - * 內存相关信息 - */ - private Mem mem = new Mem(); - - /** - * JVM相关信息 - */ - private Jvm jvm = new Jvm(); - - /** - * 服务器相关信息 - */ - private Sys sys = new Sys(); - - /** - * 磁盘相关信息 - */ - private List sysFiles = new LinkedList(); - - public Cpu getCpu() - { - return cpu; - } - - public void setCpu(Cpu cpu) - { - this.cpu = cpu; - } - - public Mem getMem() - { - return mem; - } - - public void setMem(Mem mem) - { - this.mem = mem; - } - - public Jvm getJvm() - { - return jvm; - } - - public void setJvm(Jvm jvm) - { - this.jvm = jvm; - } - - public Sys getSys() - { - return sys; - } - - public void setSys(Sys sys) - { - this.sys = sys; - } - - public List getSysFiles() - { - return sysFiles; - } - - public void setSysFiles(List sysFiles) - { - this.sysFiles = sysFiles; - } - - public void copyTo() throws Exception - { - SystemInfo si = new SystemInfo(); - HardwareAbstractionLayer hal = si.getHardware(); - - setCpuInfo(hal.getProcessor()); - - setMemInfo(hal.getMemory()); - - setSysInfo(); - - setJvmInfo(); - - setSysFiles(si.getOperatingSystem()); - } - - /** - * 设置CPU信息 - */ - private void setCpuInfo(CentralProcessor processor) - { - // CPU信息 - long[] prevTicks = processor.getSystemCpuLoadTicks(); - Util.sleep(OSHI_WAIT_SECOND); - long[] ticks = processor.getSystemCpuLoadTicks(); - long nice = ticks[TickType.NICE.getIndex()] - prevTicks[TickType.NICE.getIndex()]; - long irq = ticks[TickType.IRQ.getIndex()] - prevTicks[TickType.IRQ.getIndex()]; - long softirq = ticks[TickType.SOFTIRQ.getIndex()] - prevTicks[TickType.SOFTIRQ.getIndex()]; - long steal = ticks[TickType.STEAL.getIndex()] - prevTicks[TickType.STEAL.getIndex()]; - long cSys = ticks[TickType.SYSTEM.getIndex()] - prevTicks[TickType.SYSTEM.getIndex()]; - long user = ticks[TickType.USER.getIndex()] - prevTicks[TickType.USER.getIndex()]; - long iowait = ticks[TickType.IOWAIT.getIndex()] - prevTicks[TickType.IOWAIT.getIndex()]; - long idle = ticks[TickType.IDLE.getIndex()] - prevTicks[TickType.IDLE.getIndex()]; - long totalCpu = user + nice + cSys + idle + iowait + irq + softirq + steal; - cpu.setCpuNum(processor.getLogicalProcessorCount()); - cpu.setTotal(totalCpu); - cpu.setSys(cSys); - cpu.setUsed(user); - cpu.setWait(iowait); - cpu.setFree(idle); - } - - /** - * 设置内存信息 - */ - private void setMemInfo(GlobalMemory memory) - { - mem.setTotal(memory.getTotal()); - mem.setUsed(memory.getTotal() - memory.getAvailable()); - mem.setFree(memory.getAvailable()); - } - - /** - * 设置服务器信息 - */ - private void setSysInfo() - { - Properties props = System.getProperties(); - sys.setComputerName(IpUtils.getHostName()); - sys.setComputerIp(IpUtils.getHostIp()); - sys.setOsName(props.getProperty("os.name")); - sys.setOsArch(props.getProperty("os.arch")); - sys.setUserDir(props.getProperty("user.dir")); - } - - /** - * 设置Java虚拟机 - */ - private void setJvmInfo() throws UnknownHostException - { - Properties props = System.getProperties(); - jvm.setTotal(Runtime.getRuntime().totalMemory()); - jvm.setMax(Runtime.getRuntime().maxMemory()); - jvm.setFree(Runtime.getRuntime().freeMemory()); - jvm.setVersion(props.getProperty("java.version")); - jvm.setHome(props.getProperty("java.home")); - } - - /** - * 设置磁盘信息 - */ - private void setSysFiles(OperatingSystem os) - { - FileSystem fileSystem = os.getFileSystem(); - List fsArray = fileSystem.getFileStores(); - for (OSFileStore fs : fsArray) - { - long free = fs.getUsableSpace(); - long total = fs.getTotalSpace(); - long used = total - free; - SysFile sysFile = new SysFile(); - sysFile.setDirName(fs.getMount()); - sysFile.setSysTypeName(fs.getType()); - sysFile.setTypeName(fs.getName()); - sysFile.setTotal(convertFileSize(total)); - sysFile.setFree(convertFileSize(free)); - sysFile.setUsed(convertFileSize(used)); - sysFile.setUsage(Arith.mul(Arith.div(used, total, 4), 100)); - sysFiles.add(sysFile); - } - } - - /** - * 字节转换 - * - * @param size 字节大小 - * @return 转换后值 - */ - public String convertFileSize(long size) - { - long kb = 1024; - long mb = kb * 1024; - long gb = mb * 1024; - if (size >= gb) - { - return String.format("%.1f GB", (float) size / gb); - } - else if (size >= mb) - { - float f = (float) size / mb; - return String.format(f > 100 ? "%.0f MB" : "%.1f MB", f); - } - else if (size >= kb) - { - float f = (float) size / kb; - return String.format(f > 100 ? "%.0f KB" : "%.1f KB", f); - } - else - { - return String.format("%d B", size); - } - } -} +package com.ruoyi.security.web.domain; + +import com.ruoyi.common.utils.Arith; +import com.ruoyi.common.utils.ip.IpUtils; +import com.ruoyi.security.web.domain.server.*; +import oshi.SystemInfo; +import oshi.hardware.CentralProcessor; +import oshi.hardware.CentralProcessor.TickType; +import oshi.hardware.GlobalMemory; +import oshi.hardware.HardwareAbstractionLayer; +import oshi.software.os.FileSystem; +import oshi.software.os.OSFileStore; +import oshi.software.os.OperatingSystem; +import oshi.util.Util; + +import java.net.UnknownHostException; +import java.util.LinkedList; +import java.util.List; +import java.util.Properties; + +/** + * 服务器相关信息 + * + * @author ruoyi + */ +public class Server { + private static final int OSHI_WAIT_SECOND = 1000; + + /** + * CPU相关信息 + */ + private Cpu cpu = new Cpu(); + + /** + * 內存相关信息 + */ + private Mem mem = new Mem(); + + /** + * JVM相关信息 + */ + private Jvm jvm = new Jvm(); + + /** + * 服务器相关信息 + */ + private Sys sys = new Sys(); + + /** + * 磁盘相关信息 + */ + private List sysFiles = new LinkedList(); + + public Cpu getCpu() { + return cpu; + } + + public void setCpu(Cpu cpu) { + this.cpu = cpu; + } + + public Mem getMem() { + return mem; + } + + public void setMem(Mem mem) { + this.mem = mem; + } + + public Jvm getJvm() { + return jvm; + } + + public void setJvm(Jvm jvm) { + this.jvm = jvm; + } + + public Sys getSys() { + return sys; + } + + public void setSys(Sys sys) { + this.sys = sys; + } + + public List getSysFiles() { + return sysFiles; + } + + public void setSysFiles(List sysFiles) { + this.sysFiles = sysFiles; + } + + /** + * 设置磁盘信息 + */ + private void setSysFiles(OperatingSystem os) { + FileSystem fileSystem = os.getFileSystem(); + OSFileStore[] fsArray = fileSystem.getFileStores().toArray(new OSFileStore[0]); + for (OSFileStore fs : fsArray) { + long free = fs.getUsableSpace(); + long total = fs.getTotalSpace(); + long used = total - free; + SysFile sysFile = new SysFile(); + sysFile.setDirName(fs.getMount()); + sysFile.setSysTypeName(fs.getType()); + sysFile.setTypeName(fs.getName()); + sysFile.setTotal(convertFileSize(total)); + sysFile.setFree(convertFileSize(free)); + sysFile.setUsed(convertFileSize(used)); + sysFile.setUsage(Arith.mul(Arith.div(used, total, 4), 100)); + sysFiles.add(sysFile); + } + } + + public void copyTo() throws Exception { + SystemInfo si = new SystemInfo(); + HardwareAbstractionLayer hal = si.getHardware(); + + setCpuInfo(hal.getProcessor()); + + setMemInfo(hal.getMemory()); + + setSysInfo(); + + setJvmInfo(); + + setSysFiles(si.getOperatingSystem()); + } + + /** + * 设置CPU信息 + */ + private void setCpuInfo(CentralProcessor processor) { + // CPU信息 + long[] prevTicks = processor.getSystemCpuLoadTicks(); + Util.sleep(OSHI_WAIT_SECOND); + long[] ticks = processor.getSystemCpuLoadTicks(); + long nice = ticks[TickType.NICE.getIndex()] - prevTicks[TickType.NICE.getIndex()]; + long irq = ticks[TickType.IRQ.getIndex()] - prevTicks[TickType.IRQ.getIndex()]; + long softirq = ticks[TickType.SOFTIRQ.getIndex()] - prevTicks[TickType.SOFTIRQ.getIndex()]; + long steal = ticks[TickType.STEAL.getIndex()] - prevTicks[TickType.STEAL.getIndex()]; + long cSys = ticks[TickType.SYSTEM.getIndex()] - prevTicks[TickType.SYSTEM.getIndex()]; + long user = ticks[TickType.USER.getIndex()] - prevTicks[TickType.USER.getIndex()]; + long iowait = ticks[TickType.IOWAIT.getIndex()] - prevTicks[TickType.IOWAIT.getIndex()]; + long idle = ticks[TickType.IDLE.getIndex()] - prevTicks[TickType.IDLE.getIndex()]; + long totalCpu = user + nice + cSys + idle + iowait + irq + softirq + steal; + cpu.setCpuNum(processor.getLogicalProcessorCount()); + cpu.setTotal(totalCpu); + cpu.setSys(cSys); + cpu.setUsed(user); + cpu.setWait(iowait); + cpu.setFree(idle); + } + + /** + * 设置内存信息 + */ + private void setMemInfo(GlobalMemory memory) { + mem.setTotal(memory.getTotal()); + mem.setUsed(memory.getTotal() - memory.getAvailable()); + mem.setFree(memory.getAvailable()); + } + + /** + * 设置服务器信息 + */ + private void setSysInfo() { + Properties props = System.getProperties(); + sys.setComputerName(IpUtils.getHostName()); + sys.setComputerIp(IpUtils.getHostIp()); + sys.setOsName(props.getProperty("os.name")); + sys.setOsArch(props.getProperty("os.arch")); + sys.setUserDir(props.getProperty("user.dir")); + } + + /** + * 设置Java虚拟机 + */ + private void setJvmInfo() throws UnknownHostException { + Properties props = System.getProperties(); + jvm.setTotal(Runtime.getRuntime().totalMemory()); + jvm.setMax(Runtime.getRuntime().maxMemory()); + jvm.setFree(Runtime.getRuntime().freeMemory()); + jvm.setVersion(props.getProperty("java.version")); + jvm.setHome(props.getProperty("java.home")); + } + + /** + * 字节转换 + * + * @param size 字节大小 + * @return 转换后值 + */ + public String convertFileSize(long size) { + long kb = 1024; + long mb = kb * 1024; + long gb = mb * 1024; + if (size >= gb) { + return String.format("%.1f GB", (float) size / gb); + } else if (size >= mb) { + float f = (float) size / mb; + return String.format(f > 100 ? "%.0f MB" : "%.1f MB", f); + } else if (size >= kb) { + float f = (float) size / kb; + return String.format(f > 100 ? "%.0f KB" : "%.1f KB", f); + } else { + return String.format("%d B", size); + } + } +} diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/server/Cpu.java b/ruoyi-admin/src/main/java/com/ruoyi/security/web/domain/server/Cpu.java similarity index 62% rename from ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/server/Cpu.java rename to ruoyi-admin/src/main/java/com/ruoyi/security/web/domain/server/Cpu.java index cf7b46e..37dcf3c 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/server/Cpu.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/security/web/domain/server/Cpu.java @@ -1,101 +1,88 @@ -package com.ruoyi.framework.web.domain.server; - -import com.ruoyi.common.utils.Arith; - -/** - * CPU相关信息 - * - * @author ruoyi - */ -public class Cpu -{ - /** - * 核心数 - */ - private int cpuNum; - - /** - * CPU总的使用率 - */ - private double total; - - /** - * CPU系统使用率 - */ - private double sys; - - /** - * CPU用户使用率 - */ - private double used; - - /** - * CPU当前等待率 - */ - private double wait; - - /** - * CPU当前空闲率 - */ - private double free; - - public int getCpuNum() - { - return cpuNum; - } - - public void setCpuNum(int cpuNum) - { - this.cpuNum = cpuNum; - } - - public double getTotal() - { - return Arith.round(Arith.mul(total, 100), 2); - } - - public void setTotal(double total) - { - this.total = total; - } - - public double getSys() - { - return Arith.round(Arith.mul(sys / total, 100), 2); - } - - public void setSys(double sys) - { - this.sys = sys; - } - - public double getUsed() - { - return Arith.round(Arith.mul(used / total, 100), 2); - } - - public void setUsed(double used) - { - this.used = used; - } - - public double getWait() - { - return Arith.round(Arith.mul(wait / total, 100), 2); - } - - public void setWait(double wait) - { - this.wait = wait; - } - - public double getFree() - { - return Arith.round(Arith.mul(free / total, 100), 2); - } - - public void setFree(double free) - { - this.free = free; - } -} +package com.ruoyi.security.web.domain.server; + +import com.ruoyi.common.utils.Arith; + +/** + * CPU相关信息 + * + * @author ruoyi + */ +public class Cpu { + /** + * 核心数 + */ + private int cpuNum; + + /** + * CPU总的使用率 + */ + private double total; + + /** + * CPU系统使用率 + */ + private double sys; + + /** + * CPU用户使用率 + */ + private double used; + + /** + * CPU当前等待率 + */ + private double wait; + + /** + * CPU当前空闲率 + */ + private double free; + + public int getCpuNum() { + return cpuNum; + } + + public void setCpuNum(int cpuNum) { + this.cpuNum = cpuNum; + } + + public double getTotal() { + return Arith.round(Arith.mul(total, 100), 2); + } + + public void setTotal(double total) { + this.total = total; + } + + public double getSys() { + return Arith.round(Arith.mul(sys / total, 100), 2); + } + + public void setSys(double sys) { + this.sys = sys; + } + + public double getUsed() { + return Arith.round(Arith.mul(used / total, 100), 2); + } + + public void setUsed(double used) { + this.used = used; + } + + public double getWait() { + return Arith.round(Arith.mul(wait / total, 100), 2); + } + + public void setWait(double wait) { + this.wait = wait; + } + + public double getFree() { + return Arith.round(Arith.mul(free / total, 100), 2); + } + + public void setFree(double free) { + this.free = free; + } +} diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/server/Jvm.java b/ruoyi-admin/src/main/java/com/ruoyi/security/web/domain/server/Jvm.java similarity index 65% rename from ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/server/Jvm.java rename to ruoyi-admin/src/main/java/com/ruoyi/security/web/domain/server/Jvm.java index f29d2cb..c44f437 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/server/Jvm.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/security/web/domain/server/Jvm.java @@ -1,122 +1,107 @@ -package com.ruoyi.framework.web.domain.server; - -import java.lang.management.ManagementFactory; -import com.ruoyi.common.utils.Arith; -import com.ruoyi.common.utils.DateUtils; - -/** - * JVM相关信息 - * - * @author ruoyi - */ -public class Jvm -{ - /** - * 当前JVM占用的内存总数(M) - */ - private double total; - - /** - * JVM最大可用内存总数(M) - */ - private double max; - - /** - * JVM空闲内存(M) - */ - private double free; - - /** - * JDK版本 - */ - private String version; - - /** - * JDK路径 - */ - private String home; - - public double getTotal() - { - return Arith.div(total, (1024 * 1024), 2); - } - - public void setTotal(double total) - { - this.total = total; - } - - public double getMax() - { - return Arith.div(max, (1024 * 1024), 2); - } - - public void setMax(double max) - { - this.max = max; - } - - public double getFree() - { - return Arith.div(free, (1024 * 1024), 2); - } - - public void setFree(double free) - { - this.free = free; - } - - public double getUsed() - { - return Arith.div(total - free, (1024 * 1024), 2); - } - - public double getUsage() - { - return Arith.mul(Arith.div(total - free, total, 4), 100); - } - - /** - * 获取JDK名称 - */ - public String getName() - { - return ManagementFactory.getRuntimeMXBean().getVmName(); - } - - public String getVersion() - { - return version; - } - - public void setVersion(String version) - { - this.version = version; - } - - public String getHome() - { - return home; - } - - public void setHome(String home) - { - this.home = home; - } - - /** - * JDK启动时间 - */ - public String getStartTime() - { - return DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, DateUtils.getServerStartDate()); - } - - /** - * JDK运行时间 - */ - public String getRunTime() - { - return DateUtils.getDatePoor(DateUtils.getNowDate(), DateUtils.getServerStartDate()); - } -} +package com.ruoyi.security.web.domain.server; + +import com.ruoyi.common.utils.Arith; +import com.ruoyi.common.utils.DateUtils; + +import java.lang.management.ManagementFactory; + +/** + * JVM相关信息 + * + * @author ruoyi + */ +public class Jvm { + /** + * 当前JVM占用的内存总数(M) + */ + private double total; + + /** + * JVM最大可用内存总数(M) + */ + private double max; + + /** + * JVM空闲内存(M) + */ + private double free; + + /** + * JDK版本 + */ + private String version; + + /** + * JDK路径 + */ + private String home; + + public double getTotal() { + return Arith.div(total, (1024 * 1024), 2); + } + + public void setTotal(double total) { + this.total = total; + } + + public double getMax() { + return Arith.div(max, (1024 * 1024), 2); + } + + public void setMax(double max) { + this.max = max; + } + + public double getFree() { + return Arith.div(free, (1024 * 1024), 2); + } + + public void setFree(double free) { + this.free = free; + } + + public double getUsed() { + return Arith.div(total - free, (1024 * 1024), 2); + } + + public double getUsage() { + return Arith.mul(Arith.div(total - free, total, 4), 100); + } + + /** + * 获取JDK名称 + */ + public String getName() { + return ManagementFactory.getRuntimeMXBean().getVmName(); + } + + public String getVersion() { + return version; + } + + public void setVersion(String version) { + this.version = version; + } + + public String getHome() { + return home; + } + + public void setHome(String home) { + this.home = home; + } + + /** + * JDK启动时间 + */ + public String getStartTime() { + return DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, DateUtils.getServerStartDate()); + } + + /** + * JDK运行时间 + */ + public String getRunTime() { + return DateUtils.getDatePoor(DateUtils.getNowDate(), DateUtils.getServerStartDate()); + } +} diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/server/Mem.java b/ruoyi-admin/src/main/java/com/ruoyi/security/web/domain/server/Mem.java similarity index 61% rename from ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/server/Mem.java rename to ruoyi-admin/src/main/java/com/ruoyi/security/web/domain/server/Mem.java index ac71504..d98a29e 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/server/Mem.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/security/web/domain/server/Mem.java @@ -1,61 +1,53 @@ -package com.ruoyi.framework.web.domain.server; - -import com.ruoyi.common.utils.Arith; - -/** - * 內存相关信息 - * - * @author ruoyi - */ -public class Mem -{ - /** - * 内存总量 - */ - private double total; - - /** - * 已用内存 - */ - private double used; - - /** - * 剩余内存 - */ - private double free; - - public double getTotal() - { - return Arith.div(total, (1024 * 1024 * 1024), 2); - } - - public void setTotal(long total) - { - this.total = total; - } - - public double getUsed() - { - return Arith.div(used, (1024 * 1024 * 1024), 2); - } - - public void setUsed(long used) - { - this.used = used; - } - - public double getFree() - { - return Arith.div(free, (1024 * 1024 * 1024), 2); - } - - public void setFree(long free) - { - this.free = free; - } - - public double getUsage() - { - return Arith.mul(Arith.div(used, total, 4), 100); - } -} +package com.ruoyi.security.web.domain.server; + +import com.ruoyi.common.utils.Arith; + +/** + * 內存相关信息 + * + * @author ruoyi + */ +public class Mem { + /** + * 内存总量 + */ + private double total; + + /** + * 已用内存 + */ + private double used; + + /** + * 剩余内存 + */ + private double free; + + public double getTotal() { + return Arith.div(total, (1024 * 1024 * 1024), 2); + } + + public void setTotal(long total) { + this.total = total; + } + + public double getUsed() { + return Arith.div(used, (1024 * 1024 * 1024), 2); + } + + public void setUsed(long used) { + this.used = used; + } + + public double getFree() { + return Arith.div(free, (1024 * 1024 * 1024), 2); + } + + public void setFree(long free) { + this.free = free; + } + + public double getUsage() { + return Arith.mul(Arith.div(used, total, 4), 100); + } +} diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/server/Sys.java b/ruoyi-admin/src/main/java/com/ruoyi/security/web/domain/server/Sys.java similarity index 55% rename from ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/server/Sys.java rename to ruoyi-admin/src/main/java/com/ruoyi/security/web/domain/server/Sys.java index a5f65e4..014a138 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/server/Sys.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/security/web/domain/server/Sys.java @@ -1,84 +1,73 @@ -package com.ruoyi.framework.web.domain.server; - -/** - * 系统相关信息 - * - * @author ruoyi - */ -public class Sys -{ - /** - * 服务器名称 - */ - private String computerName; - - /** - * 服务器Ip - */ - private String computerIp; - - /** - * 项目路径 - */ - private String userDir; - - /** - * 操作系统 - */ - private String osName; - - /** - * 系统架构 - */ - private String osArch; - - public String getComputerName() - { - return computerName; - } - - public void setComputerName(String computerName) - { - this.computerName = computerName; - } - - public String getComputerIp() - { - return computerIp; - } - - public void setComputerIp(String computerIp) - { - this.computerIp = computerIp; - } - - public String getUserDir() - { - return userDir; - } - - public void setUserDir(String userDir) - { - this.userDir = userDir; - } - - public String getOsName() - { - return osName; - } - - public void setOsName(String osName) - { - this.osName = osName; - } - - public String getOsArch() - { - return osArch; - } - - public void setOsArch(String osArch) - { - this.osArch = osArch; - } -} +package com.ruoyi.security.web.domain.server; + +/** + * 系统相关信息 + * + * @author ruoyi + */ +public class Sys { + /** + * 服务器名称 + */ + private String computerName; + + /** + * 服务器Ip + */ + private String computerIp; + + /** + * 项目路径 + */ + private String userDir; + + /** + * 操作系统 + */ + private String osName; + + /** + * 系统架构 + */ + private String osArch; + + public String getComputerName() { + return computerName; + } + + public void setComputerName(String computerName) { + this.computerName = computerName; + } + + public String getComputerIp() { + return computerIp; + } + + public void setComputerIp(String computerIp) { + this.computerIp = computerIp; + } + + public String getUserDir() { + return userDir; + } + + public void setUserDir(String userDir) { + this.userDir = userDir; + } + + public String getOsName() { + return osName; + } + + public void setOsName(String osName) { + this.osName = osName; + } + + public String getOsArch() { + return osArch; + } + + public void setOsArch(String osArch) { + this.osArch = osArch; + } +} diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/server/SysFile.java b/ruoyi-admin/src/main/java/com/ruoyi/security/web/domain/server/SysFile.java similarity index 55% rename from ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/server/SysFile.java rename to ruoyi-admin/src/main/java/com/ruoyi/security/web/domain/server/SysFile.java index 47ecf3f..9f7ddb1 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/server/SysFile.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/security/web/domain/server/SysFile.java @@ -1,114 +1,99 @@ -package com.ruoyi.framework.web.domain.server; - -/** - * 系统文件相关信息 - * - * @author ruoyi - */ -public class SysFile -{ - /** - * 盘符路径 - */ - private String dirName; - - /** - * 盘符类型 - */ - private String sysTypeName; - - /** - * 文件类型 - */ - private String typeName; - - /** - * 总大小 - */ - private String total; - - /** - * 剩余大小 - */ - private String free; - - /** - * 已经使用量 - */ - private String used; - - /** - * 资源的使用率 - */ - private double usage; - - public String getDirName() - { - return dirName; - } - - public void setDirName(String dirName) - { - this.dirName = dirName; - } - - public String getSysTypeName() - { - return sysTypeName; - } - - public void setSysTypeName(String sysTypeName) - { - this.sysTypeName = sysTypeName; - } - - public String getTypeName() - { - return typeName; - } - - public void setTypeName(String typeName) - { - this.typeName = typeName; - } - - public String getTotal() - { - return total; - } - - public void setTotal(String total) - { - this.total = total; - } - - public String getFree() - { - return free; - } - - public void setFree(String free) - { - this.free = free; - } - - public String getUsed() - { - return used; - } - - public void setUsed(String used) - { - this.used = used; - } - - public double getUsage() - { - return usage; - } - - public void setUsage(double usage) - { - this.usage = usage; - } -} +package com.ruoyi.security.web.domain.server; + +/** + * 系统文件相关信息 + * + * @author ruoyi + */ +public class SysFile { + /** + * 盘符路径 + */ + private String dirName; + + /** + * 盘符类型 + */ + private String sysTypeName; + + /** + * 文件类型 + */ + private String typeName; + + /** + * 总大小 + */ + private String total; + + /** + * 剩余大小 + */ + private String free; + + /** + * 已经使用量 + */ + private String used; + + /** + * 资源的使用率 + */ + private double usage; + + public String getDirName() { + return dirName; + } + + public void setDirName(String dirName) { + this.dirName = dirName; + } + + public String getSysTypeName() { + return sysTypeName; + } + + public void setSysTypeName(String sysTypeName) { + this.sysTypeName = sysTypeName; + } + + public String getTypeName() { + return typeName; + } + + public void setTypeName(String typeName) { + this.typeName = typeName; + } + + public String getTotal() { + return total; + } + + public void setTotal(String total) { + this.total = total; + } + + public String getFree() { + return free; + } + + public void setFree(String free) { + this.free = free; + } + + public String getUsed() { + return used; + } + + public void setUsed(String used) { + this.used = used; + } + + public double getUsage() { + return usage; + } + + public void setUsage(double usage) { + this.usage = usage; + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/security/web/exception/GlobalExceptionHandler.java b/ruoyi-admin/src/main/java/com/ruoyi/security/web/exception/GlobalExceptionHandler.java new file mode 100644 index 0000000..554ab27 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/security/web/exception/GlobalExceptionHandler.java @@ -0,0 +1,105 @@ +package com.ruoyi.security.web.exception; + +import com.ruoyi.common.constant.HttpStatus; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.exception.CustomException; +import com.ruoyi.common.exception.DemoModeException; +import com.ruoyi.common.exception.base.BaseException; +import com.ruoyi.common.utils.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.security.access.AccessDeniedException; +import org.springframework.security.authentication.AccountExpiredException; +import org.springframework.security.core.userdetails.UsernameNotFoundException; +import org.springframework.validation.BindException; +import org.springframework.web.bind.MethodArgumentNotValidException; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.RestControllerAdvice; +import org.springframework.web.servlet.NoHandlerFoundException; + +/** + * 全局异常处理器 + * + * @author ruoyi + */ +@RestControllerAdvice +public class GlobalExceptionHandler { + private static final Logger log = LoggerFactory.getLogger(GlobalExceptionHandler.class); + + /** + * 基础异常 + */ + @ExceptionHandler(BaseException.class) + public AjaxResult baseException(BaseException e) { + return AjaxResult.error(e.getMessage()); + } + + /** + * 业务异常 + */ + @ExceptionHandler(CustomException.class) + public AjaxResult businessException(CustomException e) { + if (StringUtils.isNull(e.getCode())) { + return AjaxResult.error(e.getMessage()); + } + return AjaxResult.error(e.getCode(), e.getMessage()); + } + + @ExceptionHandler(NoHandlerFoundException.class) + public AjaxResult handlerNoFoundException(Exception e) { + log.error(e.getMessage(), e); + return AjaxResult.error(HttpStatus.NOT_FOUND, "路径不存在,请检查路径是否正确"); + } + + @ExceptionHandler(AccessDeniedException.class) + public AjaxResult handleAuthorizationException(AccessDeniedException e) { + log.error(e.getMessage()); + return AjaxResult.error(HttpStatus.FORBIDDEN, "没有权限,请联系管理员授权"); + } + + @ExceptionHandler(AccountExpiredException.class) + public AjaxResult handleAccountExpiredException(AccountExpiredException e) { + log.error(e.getMessage(), e); + return AjaxResult.error(e.getMessage()); + } + + @ExceptionHandler(UsernameNotFoundException.class) + public AjaxResult handleUsernameNotFoundException(UsernameNotFoundException e) { + log.error(e.getMessage(), e); + return AjaxResult.error(e.getMessage()); + } + + @ExceptionHandler(Exception.class) + public AjaxResult handleException(Exception e) { + log.error(e.getMessage(), e); + return AjaxResult.error(e.getMessage()); + } + + /** + * 自定义验证异常 + */ + @ExceptionHandler(BindException.class) + public AjaxResult validatedBindException(BindException e) { + log.error(e.getMessage(), e); + String message = e.getAllErrors().get(0).getDefaultMessage(); + return AjaxResult.error(message); + } + + /** + * 自定义验证异常 + */ + @ExceptionHandler(MethodArgumentNotValidException.class) + public Object validExceptionHandler(MethodArgumentNotValidException e) { + log.error(e.getMessage(), e); + String message = e.getBindingResult().getFieldError().getDefaultMessage(); + return AjaxResult.error(message); + } + + /** + * 演示模式异常 + */ + @ExceptionHandler(DemoModeException.class) + public AjaxResult demoModeException(DemoModeException e) { + return AjaxResult.error("演示模式,不允许操作"); + } +} diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/PermissionService.java b/ruoyi-admin/src/main/java/com/ruoyi/security/web/service/PermissionService.java similarity index 64% rename from ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/PermissionService.java rename to ruoyi-admin/src/main/java/com/ruoyi/security/web/service/PermissionService.java index 3881053..6e1127b 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/PermissionService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/security/web/service/PermissionService.java @@ -1,165 +1,153 @@ -package com.ruoyi.framework.web.service; - -import java.util.Set; -import org.springframework.stereotype.Service; -import org.springframework.util.CollectionUtils; -import com.ruoyi.common.core.domain.entity.SysRole; -import com.ruoyi.common.core.domain.model.LoginUser; -import com.ruoyi.common.utils.SecurityUtils; -import com.ruoyi.common.utils.StringUtils; - -/** - * RuoYi首创 自定义权限实现,ss取自SpringSecurity首字母 - * - * @author ruoyi - */ -@Service("ss") -public class PermissionService -{ - /** 所有权限标识 */ - private static final String ALL_PERMISSION = "*:*:*"; - - /** 管理员角色权限标识 */ - private static final String SUPER_ADMIN = "admin"; - - private static final String ROLE_DELIMETER = ","; - - private static final String PERMISSION_DELIMETER = ","; - - /** - * 验证用户是否具备某权限 - * - * @param permission 权限字符串 - * @return 用户是否具备某权限 - */ - public boolean hasPermi(String permission) - { - if (StringUtils.isEmpty(permission)) - { - return false; - } - LoginUser loginUser = SecurityUtils.getLoginUser(); - if (StringUtils.isNull(loginUser) || CollectionUtils.isEmpty(loginUser.getPermissions())) - { - return false; - } - return hasPermissions(loginUser.getPermissions(), permission); - } - - /** - * 验证用户是否不具备某权限,与 hasPermi逻辑相反 - * - * @param permission 权限字符串 - * @return 用户是否不具备某权限 - */ - public boolean lacksPermi(String permission) - { - return hasPermi(permission) != true; - } - - /** - * 验证用户是否具有以下任意一个权限 - * - * @param permissions 以 PERMISSION_NAMES_DELIMETER 为分隔符的权限列表 - * @return 用户是否具有以下任意一个权限 - */ - public boolean hasAnyPermi(String permissions) - { - if (StringUtils.isEmpty(permissions)) - { - return false; - } - LoginUser loginUser = SecurityUtils.getLoginUser(); - if (StringUtils.isNull(loginUser) || CollectionUtils.isEmpty(loginUser.getPermissions())) - { - return false; - } - Set authorities = loginUser.getPermissions(); - for (String permission : permissions.split(PERMISSION_DELIMETER)) - { - if (permission != null && hasPermissions(authorities, permission)) - { - return true; - } - } - return false; - } - - /** - * 判断用户是否拥有某个角色 - * - * @param role 角色字符串 - * @return 用户是否具备某角色 - */ - public boolean hasRole(String role) - { - if (StringUtils.isEmpty(role)) - { - return false; - } - LoginUser loginUser = SecurityUtils.getLoginUser(); - if (StringUtils.isNull(loginUser) || CollectionUtils.isEmpty(loginUser.getUser().getRoles())) - { - return false; - } - for (SysRole sysRole : loginUser.getUser().getRoles()) - { - String roleKey = sysRole.getRoleKey(); - if (SUPER_ADMIN.equals(roleKey) || roleKey.equals(StringUtils.trim(role))) - { - return true; - } - } - return false; - } - - /** - * 验证用户是否不具备某角色,与 isRole逻辑相反。 - * - * @param role 角色名称 - * @return 用户是否不具备某角色 - */ - public boolean lacksRole(String role) - { - return hasRole(role) != true; - } - - /** - * 验证用户是否具有以下任意一个角色 - * - * @param roles 以 ROLE_NAMES_DELIMETER 为分隔符的角色列表 - * @return 用户是否具有以下任意一个角色 - */ - public boolean hasAnyRoles(String roles) - { - if (StringUtils.isEmpty(roles)) - { - return false; - } - LoginUser loginUser = SecurityUtils.getLoginUser(); - if (StringUtils.isNull(loginUser) || CollectionUtils.isEmpty(loginUser.getUser().getRoles())) - { - return false; - } - for (String role : roles.split(ROLE_DELIMETER)) - { - if (hasRole(role)) - { - return true; - } - } - return false; - } - - /** - * 判断是否包含权限 - * - * @param permissions 权限列表 - * @param permission 权限字符串 - * @return 用户是否具备某权限 - */ - private boolean hasPermissions(Set permissions, String permission) - { - return permissions.contains(ALL_PERMISSION) || permissions.contains(StringUtils.trim(permission)); - } -} +package com.ruoyi.security.web.service; + +import com.ruoyi.common.core.domain.entity.SysRole; +import com.ruoyi.common.core.domain.model.LoginUser; +import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.framework.web.service.TokenService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.util.Set; + +/** + * RuoYi首创 自定义权限实现,ss取自SpringSecurity首字母 + * + * @author ruoyi + */ +@Service("ss") +public class PermissionService { + /** + * 所有权限标识 + */ + private static final String ALL_PERMISSION = "*:*:*"; + + /** + * 管理员角色权限标识 + */ + private static final String SUPER_ADMIN = "admin"; + + private static final String ROLE_DELIMETER = ","; + + private static final String PERMISSION_DELIMETER = ","; + + @Autowired + private TokenService tokenService; + + /** + * 验证用户是否具备某权限 + * + * @param permission 权限字符串 + * @return 用户是否具备某权限 + */ + public boolean hasPermi(String permission) { + if (StringUtils.isEmpty(permission)) { + return false; + } + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + if (StringUtils.isNull(loginUser) || CollectionUtils.isEmpty(loginUser.getPermissions())) { + return false; + } + return hasPermissions(loginUser.getPermissions(), permission); + } + + /** + * 验证用户是否不具备某权限,与 hasPermi逻辑相反 + * + * @param permission 权限字符串 + * @return 用户是否不具备某权限 + */ + public boolean lacksPermi(String permission) { + return hasPermi(permission) != true; + } + + /** + * 验证用户是否具有以下任意一个权限 + * + * @param permissions 以 PERMISSION_NAMES_DELIMETER 为分隔符的权限列表 + * @return 用户是否具有以下任意一个权限 + */ + public boolean hasAnyPermi(String permissions) { + if (StringUtils.isEmpty(permissions)) { + return false; + } + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + if (StringUtils.isNull(loginUser) || CollectionUtils.isEmpty(loginUser.getPermissions())) { + return false; + } + Set authorities = loginUser.getPermissions(); + for (String permission : permissions.split(PERMISSION_DELIMETER)) { + if (permission != null && hasPermissions(authorities, permission)) { + return true; + } + } + return false; + } + + /** + * 判断用户是否拥有某个角色 + * + * @param role 角色字符串 + * @return 用户是否具备某角色 + */ + public boolean hasRole(String role) { + if (StringUtils.isEmpty(role)) { + return false; + } + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + if (StringUtils.isNull(loginUser) || CollectionUtils.isEmpty(loginUser.getUser().getRoles())) { + return false; + } + for (SysRole sysRole : loginUser.getUser().getRoles()) { + String roleKey = sysRole.getRoleKey(); + if (SUPER_ADMIN.contains(roleKey) || roleKey.contains(StringUtils.trim(role))) { + return true; + } + } + return false; + } + + /** + * 验证用户是否不具备某角色,与 isRole逻辑相反。 + * + * @param role 角色名称 + * @return 用户是否不具备某角色 + */ + public boolean lacksRole(String role) { + return hasRole(role) != true; + } + + /** + * 验证用户是否具有以下任意一个角色 + * + * @param roles 以 ROLE_NAMES_DELIMETER 为分隔符的角色列表 + * @return 用户是否具有以下任意一个角色 + */ + public boolean hasAnyRoles(String roles) { + if (StringUtils.isEmpty(roles)) { + return false; + } + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + if (StringUtils.isNull(loginUser) || CollectionUtils.isEmpty(loginUser.getUser().getRoles())) { + return false; + } + for (String role : roles.split(ROLE_DELIMETER)) { + if (hasRole(role)) { + return true; + } + } + return false; + } + + /** + * 判断是否包含权限 + * + * @param permissions 权限列表 + * @param permission 权限字符串 + * @return 用户是否具备某权限 + */ + private boolean hasPermissions(Set permissions, String permission) { + return permissions.contains(ALL_PERMISSION) || permissions.contains(StringUtils.trim(permission)); + } +} diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java b/ruoyi-admin/src/main/java/com/ruoyi/security/web/service/SysLoginService.java similarity index 60% rename from ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java rename to ruoyi-admin/src/main/java/com/ruoyi/security/web/service/SysLoginService.java index 07bb03c..bf586d0 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/security/web/service/SysLoginService.java @@ -1,129 +1,80 @@ -package com.ruoyi.framework.web.service; - -import javax.annotation.Resource; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.security.authentication.AuthenticationManager; -import org.springframework.security.authentication.BadCredentialsException; -import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; -import org.springframework.security.core.Authentication; -import org.springframework.stereotype.Component; -import com.ruoyi.common.constant.Constants; -import com.ruoyi.common.core.domain.entity.SysUser; -import com.ruoyi.common.core.domain.model.LoginUser; -import com.ruoyi.common.core.redis.RedisCache; -import com.ruoyi.common.exception.ServiceException; -import com.ruoyi.common.exception.user.CaptchaException; -import com.ruoyi.common.exception.user.CaptchaExpireException; -import com.ruoyi.common.exception.user.UserPasswordNotMatchException; -import com.ruoyi.common.utils.DateUtils; -import com.ruoyi.common.utils.MessageUtils; -import com.ruoyi.common.utils.ServletUtils; -import com.ruoyi.common.utils.ip.IpUtils; -import com.ruoyi.framework.manager.AsyncManager; -import com.ruoyi.framework.manager.factory.AsyncFactory; -import com.ruoyi.system.service.ISysConfigService; -import com.ruoyi.system.service.ISysUserService; - -/** - * 登录校验方法 - * - * @author ruoyi - */ -@Component -public class SysLoginService -{ - @Autowired - private TokenService tokenService; - - @Resource - private AuthenticationManager authenticationManager; - - @Autowired - private RedisCache redisCache; - - @Autowired - private ISysUserService userService; - - @Autowired - private ISysConfigService configService; - - /** - * 登录验证 - * - * @param username 用户名 - * @param password 密码 - * @param code 验证码 - * @param uuid 唯一标识 - * @return 结果 - */ - public String login(String username, String password, String code, String uuid) - { - boolean captchaOnOff = configService.selectCaptchaOnOff(); - // 验证码开关 - if (captchaOnOff) - { - validateCaptcha(username, code, uuid); - } - // 用户验证 - Authentication authentication = null; - try - { - // 该方法会去调用UserDetailsServiceImpl.loadUserByUsername - authentication = authenticationManager - .authenticate(new UsernamePasswordAuthenticationToken(username, password)); - } - catch (Exception e) - { - if (e instanceof BadCredentialsException) - { - AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.password.not.match"))); - throw new UserPasswordNotMatchException(); - } - else - { - AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, e.getMessage())); - throw new ServiceException(e.getMessage()); - } - } - AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_SUCCESS, MessageUtils.message("user.login.success"))); - LoginUser loginUser = (LoginUser) authentication.getPrincipal(); - recordLoginInfo(loginUser.getUser()); - // 生成token - return tokenService.createToken(loginUser); - } - - /** - * 校验验证码 - * - * @param username 用户名 - * @param code 验证码 - * @param uuid 唯一标识 - * @return 结果 - */ - public void validateCaptcha(String username, String code, String uuid) - { - String verifyKey = Constants.CAPTCHA_CODE_KEY + uuid; - String captcha = redisCache.getCacheObject(verifyKey); - redisCache.deleteObject(verifyKey); - if (captcha == null) - { - AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.expire"))); - throw new CaptchaExpireException(); - } - if (!code.equalsIgnoreCase(captcha)) - { - AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.error"))); - throw new CaptchaException(); - } - } - - /** - * 记录登录信息 - */ - public void recordLoginInfo(SysUser user) - { - user.setLoginIp(IpUtils.getIpAddr(ServletUtils.getRequest())); - user.setLoginDate(DateUtils.getNowDate()); - userService.updateUserProfile(user); - } -} +package com.ruoyi.security.web.service; + +import com.ruoyi.common.constant.Constants; +import com.ruoyi.common.core.domain.model.LoginUser; +import com.ruoyi.common.core.redis.RedisCache; +import com.ruoyi.common.exception.CustomException; +import com.ruoyi.common.exception.user.CaptchaException; +import com.ruoyi.common.exception.user.CaptchaExpireException; +import com.ruoyi.common.exception.user.UserPasswordNotMatchException; +import com.ruoyi.common.utils.MessageUtils; +import com.ruoyi.framework.manager.AsyncManager; +import com.ruoyi.framework.manager.factory.AsyncFactory; +import com.ruoyi.framework.web.service.TokenService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.authentication.AuthenticationManager; +import org.springframework.security.authentication.BadCredentialsException; +import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; +import org.springframework.security.core.Authentication; +import org.springframework.stereotype.Component; + +import javax.annotation.Resource; + +/** + * 登录校验方法 + * + * @author ruoyi + */ +@Component +public class SysLoginService { + @Autowired + private TokenService tokenService; + + @Resource + private AuthenticationManager authenticationManager; + + @Autowired + private RedisCache redisCache; + + /** + * 登录验证 + * + * @param username 用户名 + * @param password 密码 + * @param code 验证码 + * @param uuid 唯一标识 + * @return 结果 + */ + public String login(String username, String password, String code, String uuid) { + String verifyKey = Constants.CAPTCHA_CODE_KEY + uuid; + String captcha = redisCache.getCacheObject(verifyKey); + redisCache.deleteObject(verifyKey); + if (captcha == null) { + AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.expire"))); + throw new CaptchaExpireException(); + } + if (!code.equalsIgnoreCase(captcha)) { + AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.error"))); + throw new CaptchaException(); + } + // 用户验证 + Authentication authentication = null; + try { + // 该方法会去调用UserDetailsServiceImpl.loadUserByUsername + authentication = authenticationManager + .authenticate(new UsernamePasswordAuthenticationToken(username, password)); + } catch (Exception e) { + if (e instanceof BadCredentialsException) { + AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.password.not.match"))); + throw new UserPasswordNotMatchException(); + } else { + AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, e.getMessage())); + throw new CustomException(e.getMessage()); + } + } + AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_SUCCESS, MessageUtils.message("user.login.success"))); + LoginUser loginUser = (LoginUser) authentication.getPrincipal(); + // 生成token + return tokenService.createToken(loginUser); + } +} diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysPermissionService.java b/ruoyi-admin/src/main/java/com/ruoyi/security/web/service/SysPermissionService.java similarity index 73% rename from ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysPermissionService.java rename to ruoyi-admin/src/main/java/com/ruoyi/security/web/service/SysPermissionService.java index 19c4a51..468fdae 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysPermissionService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/security/web/service/SysPermissionService.java @@ -1,66 +1,58 @@ -package com.ruoyi.framework.web.service; - -import java.util.HashSet; -import java.util.Set; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; -import com.ruoyi.common.core.domain.entity.SysUser; -import com.ruoyi.system.service.ISysMenuService; -import com.ruoyi.system.service.ISysRoleService; - -/** - * 用户权限处理 - * - * @author ruoyi - */ -@Component -public class SysPermissionService -{ - @Autowired - private ISysRoleService roleService; - - @Autowired - private ISysMenuService menuService; - - /** - * 获取角色数据权限 - * - * @param user 用户信息 - * @return 角色权限信息 - */ - public Set getRolePermission(SysUser user) - { - Set roles = new HashSet(); - // 管理员拥有所有权限 - if (user.isAdmin()) - { - roles.add("admin"); - } - else - { - roles.addAll(roleService.selectRolePermissionByUserId(user.getUserId())); - } - return roles; - } - - /** - * 获取菜单数据权限 - * - * @param user 用户信息 - * @return 菜单权限信息 - */ - public Set getMenuPermission(SysUser user) - { - Set perms = new HashSet(); - // 管理员拥有所有权限 - if (user.isAdmin()) - { - perms.add("*:*:*"); - } - else - { - perms.addAll(menuService.selectMenuPermsByUserId(user.getUserId())); - } - return perms; - } -} +package com.ruoyi.security.web.service; + +import com.ruoyi.common.core.domain.entity.SysUser; +import com.ruoyi.system.service.ISysMenuService; +import com.ruoyi.system.service.ISysRoleService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.HashSet; +import java.util.Set; + +/** + * 用户权限处理 + * + * @author ruoyi + */ +@Component +public class SysPermissionService { + @Autowired + private ISysRoleService roleService; + + @Autowired + private ISysMenuService menuService; + + /** + * 获取角色数据权限 + * + * @param user 用户信息 + * @return 角色权限信息 + */ + public Set getRolePermission(SysUser user) { + Set roles = new HashSet(); + // 管理员拥有所有权限 + if (user.isAdmin()) { + roles.add("admin"); + } else { + roles.addAll(roleService.selectRolePermissionByUserId(user.getUserId())); + } + return roles; + } + + /** + * 获取菜单数据权限 + * + * @param user 用户信息 + * @return 菜单权限信息 + */ + public Set getMenuPermission(SysUser user) { + Set perms = new HashSet(); + // 管理员拥有所有权限 + if (user.isAdmin()) { + perms.add("*:*:*"); + } else { + perms.addAll(menuService.selectMenuPermsByUserId(user.getUserId())); + } + return perms; + } +} diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/UserDetailsServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/security/web/service/UserDetailsServiceImpl.java similarity index 60% rename from ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/UserDetailsServiceImpl.java rename to ruoyi-admin/src/main/java/com/ruoyi/security/web/service/UserDetailsServiceImpl.java index 575bd8d..db42920 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/UserDetailsServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/security/web/service/UserDetailsServiceImpl.java @@ -1,60 +1,52 @@ -package com.ruoyi.framework.web.service; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.security.core.userdetails.UserDetails; -import org.springframework.security.core.userdetails.UserDetailsService; -import org.springframework.security.core.userdetails.UsernameNotFoundException; -import org.springframework.stereotype.Service; -import com.ruoyi.common.core.domain.entity.SysUser; -import com.ruoyi.common.core.domain.model.LoginUser; -import com.ruoyi.common.enums.UserStatus; -import com.ruoyi.common.exception.ServiceException; -import com.ruoyi.common.utils.StringUtils; -import com.ruoyi.system.service.ISysUserService; - -/** - * 用户验证处理 - * - * @author ruoyi - */ -@Service -public class UserDetailsServiceImpl implements UserDetailsService -{ - private static final Logger log = LoggerFactory.getLogger(UserDetailsServiceImpl.class); - - @Autowired - private ISysUserService userService; - - @Autowired - private SysPermissionService permissionService; - - @Override - public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException - { - SysUser user = userService.selectUserByUserName(username); - if (StringUtils.isNull(user)) - { - log.info("登录用户:{} 不存在.", username); - throw new ServiceException("登录用户:" + username + " 不存在"); - } - else if (UserStatus.DELETED.getCode().equals(user.getDelFlag())) - { - log.info("登录用户:{} 已被删除.", username); - throw new ServiceException("对不起,您的账号:" + username + " 已被删除"); - } - else if (UserStatus.DISABLE.getCode().equals(user.getStatus())) - { - log.info("登录用户:{} 已被停用.", username); - throw new ServiceException("对不起,您的账号:" + username + " 已停用"); - } - - return createLoginUser(user); - } - - public UserDetails createLoginUser(SysUser user) - { - return new LoginUser(user.getUserId(), user.getDeptId(), user, permissionService.getMenuPermission(user)); - } -} +package com.ruoyi.security.web.service; + +import com.ruoyi.common.core.domain.entity.SysUser; +import com.ruoyi.common.core.domain.model.LoginUser; +import com.ruoyi.common.enums.UserStatus; +import com.ruoyi.common.exception.base.BaseException; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.system.service.ISysUserService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.core.userdetails.UserDetails; +import org.springframework.security.core.userdetails.UserDetailsService; +import org.springframework.security.core.userdetails.UsernameNotFoundException; +import org.springframework.stereotype.Service; + +/** + * 用户验证处理 + * + * @author ruoyi + */ +@Service +public class UserDetailsServiceImpl implements UserDetailsService { + private static final Logger log = LoggerFactory.getLogger(UserDetailsServiceImpl.class); + + @Autowired + private ISysUserService userService; + + @Autowired + private SysPermissionService permissionService; + + @Override + public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException { + SysUser user = userService.selectUserByUserName(username); + if (StringUtils.isNull(user)) { + log.info("登录用户:{} 不存在.", username); + throw new UsernameNotFoundException("登录用户:" + username + " 不存在"); + } else if (UserStatus.DELETED.getCode().equals(user.getDelFlag())) { + log.info("登录用户:{} 已被删除.", username); + throw new BaseException("对不起,您的账号:" + username + " 已被删除"); + } else if (UserStatus.DISABLE.getCode().equals(user.getStatus())) { + log.info("登录用户:{} 已被停用.", username); + throw new BaseException("对不起,您的账号:" + username + " 已停用"); + } + + return createLoginUser(user); + } + + public UserDetails createLoginUser(SysUser user) { + return new LoginUser(user, permissionService.getMenuPermission(user)); + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/ServerController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/ServerController.java index 082027b..9afb267 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/ServerController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/ServerController.java @@ -1,11 +1,11 @@ package com.ruoyi.web.controller.monitor; +import com.ruoyi.security.web.domain.Server; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import com.ruoyi.common.core.domain.AjaxResult; -import com.ruoyi.framework.web.domain.Server; /** * 服务器监控 diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/segchk/SegchkDefaultProviderController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/segchk/SegchkDefaultProviderController.java deleted file mode 100644 index f949d0b..0000000 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/segchk/SegchkDefaultProviderController.java +++ /dev/null @@ -1,113 +0,0 @@ -package com.ruoyi.web.controller.segchk; - -import com.ruoyi.common.annotation.Log; -import com.ruoyi.common.core.controller.BaseController; -import com.ruoyi.common.core.domain.AjaxResult; -import com.ruoyi.common.core.page.TableDataInfo; -import com.ruoyi.common.enums.BusinessType; -import com.ruoyi.segchk.domain.*; -import com.ruoyi.segchk.service.*; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.transaction.annotation.Propagation; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.bind.annotation.RestController; - -import java.util.List; - -import static com.ruoyi.common.core.domain.AjaxResult.*; - -/** - * seg首页推荐商户Controller - * - * @author yinzhiying - * @date 2021-08-23 - */ -@RestController -@RequestMapping("/default/provider") -@Api("运营商小程序接口") -public class SegchkDefaultProviderController extends BaseController -{ - @Autowired - private ISegchkStoreIndexService segchkStoreIndexService; - - @Autowired - private ISegchkUserIndexService segchkUserIndexService; - - @Autowired - private ISegchkProviderIndexService segchkProviderIndexService; - - /** - * 查询seg用户中心信息 尹志颖 - * { - * "userId": 240,//* - * "providerId": 4,//* - * "userLevel": 2//* 0运营商,1商户,2用户 - * } - * } - */ -// @PreAuthorize("@ss.hasPermi('segchk:provider_info:query')") - @PostMapping("/storeUserInfo") - @ResponseBody - @ApiOperation(value = "查询seg运营商中心信息", notes = "需要鉴权") - public AjaxResult storeUserInfo(SegchkUserWebReq segchkUserWebReq) - { -// startPage(); - AjaxResult ajax = new AjaxResult(); - - ajax.put("code", 200); - - SegchkUserWebResp segchkUserWebResp = segchkUserWebReq.getUserLevel() == 2 ? - segchkUserIndexService.selectSegchkUserWebInfo(segchkUserWebReq) - : (segchkUserWebReq.getUserLevel() == 1 ? - segchkStoreIndexService.selectSegchkStoreWebInfo(segchkUserWebReq) : segchkProviderIndexService.selectSegchkProviderWebInfo(segchkUserWebReq)); - ajax.put("value", segchkUserWebResp); - return ajax; - } - - - /** - * 根据运营商id,角色等级,返回运营商下所有核消统计或售卡统计 尹志颖 - * { - * "providerId": 4,//* - * "staticMonth": "10",,//测试 - * "srcFlag": 0//*0核消汇总1售卡汇总 - * } - */ -// @PreAuthorize("@ss.hasPermi('segchk:provider_service_sale:list')") - @PostMapping("/providerServiceAndSaleList") - @ResponseBody - @ApiOperation(value = "根据运营商id,角色等级,返回运营商下所有核消统计或售卡统计", notes = "需要鉴权") - public TableDataInfo providerServiceAndSaleList(SegchkServiceAndSaleWebReq segchkServiceAndSaleWebReq) - { - startPage(); - List segchkServiceAndSaleWebRespList = segchkProviderIndexService.selectProviderServiceAndSaleList(segchkServiceAndSaleWebReq); - return getDataTable(segchkServiceAndSaleWebRespList); - } - - /** - * 根据运营商id,角色等级,返回运营商下核消统计或售卡统计 尹志颖 - * { - * "providerId": 4,//* - * "staticMonth": "2021-06-01",//* - * "srcFlag": 0//*0核消详情1售卡详情 - * } - */ -// @PreAuthorize("@ss.hasPermi('segchk:provider_service_sale:query')") - @PostMapping("/providerServiceAndSaleDetails") - @ResponseBody - @ApiOperation(value = "根据运营商id,角色等级,返回运营商下核消统计或售卡统计", notes = "需要鉴权") - public TableDataInfo providerServiceAndSaleDetails(SegchkServiceAndSaleWebReq segchkServiceAndSaleWebReq) - { - startPage(); - List segchkServiceAndSaleDetailWebRespList = segchkProviderIndexService.selectProviderServiceAndSaleDetails(segchkServiceAndSaleWebReq); - return getDataTable(segchkServiceAndSaleDetailWebRespList); - } - - -} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/segchk/SegchkDefaultUserController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/segchk/SegchkDefaultUserController.java deleted file mode 100644 index 06a80cc..0000000 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/segchk/SegchkDefaultUserController.java +++ /dev/null @@ -1,498 +0,0 @@ -package com.ruoyi.web.controller.segchk; - -import com.ruoyi.common.annotation.Log; -import com.ruoyi.common.core.controller.BaseController; -import com.ruoyi.common.core.domain.AjaxResult; -import com.ruoyi.common.core.page.TableDataInfo; -import com.ruoyi.common.core.text.Convert; -import com.ruoyi.common.enums.BusinessType; -import com.ruoyi.segchk.domain.*; -import com.ruoyi.segchk.service.*; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.*; - -import java.math.BigDecimal; -import java.util.List; - -import static com.ruoyi.common.core.domain.AjaxResult.*; - -/** - * seg首页推荐商户Controller - * - * @author yinzhiying - * @date 2021-08-23 - */ -@RestController -@RequestMapping("/default/user") -@Api("用户小程序接口") -public class SegchkDefaultUserController extends BaseController -{ - @Autowired - private ISegchkStoreIndexService segchkStoreIndexService; - @Autowired - private ISegchkUserCollectService segchkUserCollectService; - - @Autowired - private ISegchkUserLikegoService segchkUserLikegoService; - - @Autowired - private ISegchkUserIndexService segchkUserIndexService; - - @Autowired - private ISegchkProviderIndexService segchkProviderIndexService; - - @Autowired - private ISegchkUserChargeService segchkUserChargeService; - /** - * 新增保存seg用户收藏记录 - * { - * "collectType": "1",//* - * "providerId": 0,//* - * "userId": 0,//* - * "storeId": 0,//* - * "modTime": "2021-08-16 13:43:43", - * "mgtState": 0//* - * } - */ -// @PreAuthorize("@ss.hasPermi('segchk:user_collect:add')") - @Log(title = "seg用户收藏记录", businessType = BusinessType.INSERT) - @PostMapping("/addUserCollect") - @ResponseBody - @ApiOperation(value = "添加seg用户收藏记录", notes = "需要鉴权") - public AjaxResult add_user_collect(SegchkUserCollect segchkUserCollect) - { - return toAjax(segchkUserCollectService.insertSegchkUserCollect(segchkUserCollect)); - } - - - /** - * 删除seg用户收藏记录 - */ -// @PreAuthorize("@ss.hasPermi('segchk:user_collect:remove')") - @Log(title = "seg用户收藏记录", businessType = BusinessType.DELETE) - @PostMapping( "/removeUserCollect") - @ResponseBody - @ApiOperation(value = "删除seg用户收藏记录", notes = "需要鉴权") - public AjaxResult removeUserCollect(String ids) - { - return toAjax(segchkUserCollectService.deleteSegchkUserCollectByIds(ids)); - } - - /** - * 新增保存seg用户想去记录 - */ -// @PreAuthorize("@ss.hasPermi('segchk:user_likego:add')") - @Log(title = "seg用户想去记录", businessType = BusinessType.INSERT) - @PostMapping("/addOrderUserLikego") - @ResponseBody - @ApiOperation(value = "添加seg用户想去记录", notes = "需要鉴权") - public AjaxResult add_order_user_likego(SegchkUserLikego segchkUserLikego) - { - return toAjax(segchkUserLikegoService.insertSegchkUserLikego(segchkUserLikego)); - } - - /** - * 查询seg用户中心信息 尹志颖 - * { - * "userId": 240,//* - * "providerId": 4,//* - * "userLevel": 2//* 0运营商,1商户,2用户 - * } - * } - */ -// @PreAuthorize("@ss.hasPermi('segchk:user_info:query')") - @PostMapping("/storeUserInfo") - @ResponseBody - @ApiOperation(value = "查询seg用户中心信息", notes = "需要鉴权") - public AjaxResult store_user_info(SegchkUserWebReq segchkUserWebReq) - { -// startPage(); - AjaxResult ajax = new AjaxResult(); - - ajax.put("code", 200); - - SegchkUserWebResp segchkUserWebResp = segchkUserWebReq.getUserLevel() == 2 ? - segchkUserIndexService.selectSegchkUserWebInfo(segchkUserWebReq) - : (segchkUserWebReq.getUserLevel() == 1 ? - segchkStoreIndexService.selectSegchkStoreWebInfo(segchkUserWebReq) : segchkProviderIndexService.selectSegchkProviderWebInfo(segchkUserWebReq)); - ajax.put("value", segchkUserWebResp); - return ajax; -// return getDataTable(segchkServiceCommentWebRespList); - } - - - /** - * 根据用户id,运营商id,查询seg用户核消列表 尹志颖 - * { - * "userId": 245,//* - * "providerId": 4//* - * } - */ -// @PreAuthorize("@ss.hasPermi('segchk:user_check:list')") - @PostMapping("/storeServiceCheckList") - @ResponseBody - @ApiOperation(value = "查询seg用户核消列表", notes = "需要鉴权") - public TableDataInfo store_service_check_list(SegchkUserWebReq segchkUserWebReq) - { - startPage(); - List segchkUserWebSCRespList = segchkUserIndexService.selectUserServiceCHKList(segchkUserWebReq); - return getDataTable(segchkUserWebSCRespList); - } - - /** - * 根据用户id,运营商id,查询seg用户可用会员卡列表或者优惠券列表 尹志颖 - */ -// @PreAuthorize("@ss.hasPermi('segchk:user_card:list')") - @PostMapping("/userCardList") - @ResponseBody - @ApiOperation(value = "查询seg用户可用会员卡列表或者优惠券列表", notes = "需要鉴权") - public TableDataInfo user_card_list(SegchkUserWebReq segchkUserWebReq) - { - startPage(); - List segchkUserWebSCRespList = segchkUserIndexService.selectUserCardList(segchkUserWebReq); - return getDataTable(segchkUserWebSCRespList); - } - - - /** - * 根据用户id,运营商id,查询seg用户收藏列表 尹志颖 - * { - * "userId": 439,//* - * "providerId": 4//* - * } - */ -// @PreAuthorize("@ss.hasPermi('segchk:user_collect:list')") - @PostMapping("/userCollectList") - @ResponseBody - @ApiOperation(value = "查询seg用户收藏列表", notes = "需要鉴权") - public TableDataInfo user_collect_list(SegchkUserWebReq segchkUserWebReq) - { - startPage(); - List segchkUserWebSCRespList = segchkUserIndexService.selectUserCollectList(segchkUserWebReq); - return getDataTable(segchkUserWebSCRespList); - } - - - /** - * 根据用户id,运营商id,查询seg用户预约单列表 尹志颖 - * { - * "userId": 234,//* - * "providerId": 4,//* - * "userLevel": 0//测试用 - * } - */ -// @PreAuthorize("@ss.hasPermi('segchk:user_likego:list')") - @PostMapping("/userLikeGOList") - @ResponseBody - @ApiOperation(value = "查询seg用户预约单列表", notes = "需要鉴权") - public TableDataInfo userLikeGOList(SegchkUserWebReq segchkUserWebReq) - { - startPage(); - List segchkUserWebSCRespList = segchkUserIndexService.selectUserLikGoList(segchkUserWebReq); - return getDataTable(segchkUserWebSCRespList); - } - - - /** - * 删除seg用户想去记录 - */ -// @PreAuthorize("@ss.hasPermi('segchk:user_likego:remove')") - @Log(title = "seg用户想去记录", businessType = BusinessType.DELETE) - @PostMapping( "/removeOrderUserLikego") - @ResponseBody - @ApiOperation(value = "删除seg用户想去记录", notes = "需要鉴权") - public AjaxResult removeOrderUserLikego(String ids) - { - return toAjax(segchkUserLikegoService.deleteSegchkUserLikegoByLikegoIds(Convert.toLongArray(ids))); - } - - /** - * seg服务评价查询 - * { - * "commentId": 3//* - * } - */ -// @PreAuthorize("@ss.hasPermi('segchk:user_comment:query')") - @Log(title = "seg服务评价查看", businessType = BusinessType.OTHER) - @PostMapping( "/getComment") - @ResponseBody - @ApiOperation(value = "seg服务评价查询", notes = "需要鉴权") - public AjaxResult get_comment(SegchkServiceCommentUserReq segchkServiceCommentUserReq) - { - AjaxResult ajax = new AjaxResult(); - SegchkServiceComment segchkServiceComment = segchkUserIndexService.selectSegchkServiceComment(segchkServiceCommentUserReq); - if(segchkServiceComment == null){ - ajax.put(CODE_TAG, "300"); - ajax.put(MSG_TAG, "未查到相关评价"); - } - else{ - ajax.put(CODE_TAG, "200"); - ajax.put(DATA_TAG, segchkServiceComment); - } - return ajax; - } - - - /** - * seg服务评价提交 - */ -// @PreAuthorize("@ss.hasPermi('segchk:user_comment:add')") - @Log(title = "seg服务评价提交", businessType = BusinessType.INSERT) - @PostMapping( "/addComment") - @ResponseBody - @ApiOperation(value = "seg服务评价提交", notes = "需要鉴权") - public AjaxResult addComment(SegchkServiceCommentUserReq segchkServiceCommentUserReq) - { - return toAjax(segchkUserIndexService.insertSegchkServiceComment(segchkServiceCommentUserReq)); - } - - - /** - * 根据用户id,运营商id,查询seg用户充值列表 尹志颖 - * { - * "userId": 34,//* - * "providerId": 2//* - * } - */ -// @PreAuthorize("@ss.hasPermi('segchk:user_charge:list')") - @PostMapping("/userChargeList") - @ResponseBody - @ApiOperation(value = "查询seg用户充值列表", notes = "需要鉴权") - public TableDataInfo userChargeList(SegchkUserWebReq segchkUserWebReq) - { - startPage(); - List segchkUserWebSCRespList = segchkUserIndexService.selectUserChargeList(segchkUserWebReq); - return getDataTable(segchkUserWebSCRespList); - } - - - /** - * 根据用户id,运营商id,查询seg用户提现列表 尹志颖 - */ -// @PreAuthorize("@ss.hasPermi('segchk:user_cash:list')") - @PostMapping("/userCashList") - @ResponseBody - @ApiOperation(value = "查询seg用户提现列表", notes = "需要鉴权") - public TableDataInfo userCashList(SegchkUserWebReq segchkUserWebReq) - { - startPage(); - List segchkUserWebSCRespList = segchkUserIndexService.selectUserCashList(segchkUserWebReq); - return getDataTable(segchkUserWebSCRespList); - } - - - /** - * 根据用户id,运营商id,角色等级查询seg用户消息列表 尹志颖 - * { - * "userId": 392,//* - * "providerId": 4,//* - * "userLevel": 2,//* - * "phoneNo": 1//测试 - * } - */ -// @PreAuthorize("@ss.hasPermi('segchk:user_msg:list')") - @PostMapping("/userMsgList") - @ResponseBody - @ApiOperation(value = "查询seg用户消息列表", notes = "需要鉴权") - public TableDataInfo userMsgList(SegchkUserWebReq segchkUserWebReq) - { - startPage(); - List segchkUserWebSCRespList = segchkUserIndexService.selectUserMsgList(segchkUserWebReq); - return getDataTable(segchkUserWebSCRespList); - } - - - /** - * 用户进入余额充值页面时,根据用户id,运营商id查询可充值 的卡 - * { - * "userId": 465, - * "providerId": 4 - * } - */ -// @PreAuthorize("@ss.hasPermi('segchk:user_charge:add')") - @PostMapping( "/userChargePre") - @ResponseBody - @ApiOperation(value = "查询seg用户可充值列表", notes = "需要鉴权") - public AjaxResult userChargePre(SegchkUserWebReq segchkUserWebReq) - { - List segchkUserChargeCards = segchkUserIndexService.SegchkUserChargePre(segchkUserWebReq); - AjaxResult ajax = new AjaxResult(); - - if(segchkUserChargeCards == null){ - ajax.put(CODE_TAG, "300"); - } - else{ - ajax.put(CODE_TAG, "200"); - ajax.put(DATA_TAG, segchkUserChargeCards); - } - return ajax; - } - - /** - * 用户进入余额充值页面时,根据用户id,运营商id查询可充值的卡,生成充值记录 - * { - * "userId": 465, - * "charge": 299.0, - * "accountUsed": 10.0, - * "cardTypeId": 1, - * "providerId": 4 - * } - */ -// @PreAuthorize("@ss.hasPermi('segchk:user_charge:pre')") - @PostMapping( "/userChargeReq") - @ResponseBody - @ApiOperation(value = "seg用户可充值", notes = "需要鉴权") - public AjaxResult userChargeReq(SegchkUserCharge segchkUserCharge) - { - AjaxResult ajax = new AjaxResult(); - System.out.println(segchkUserCharge.getAccountUsed()); - if(segchkUserCharge.getAccountUsed() != null && segchkUserCharge.getAccountUsed().compareTo(new BigDecimal(0.0)) == 1) { - BigDecimal user_account = segchkUserIndexService.getAccount(segchkUserCharge); - if(user_account == null || user_account.compareTo(segchkUserCharge.getAccountUsed()) == -1){ - ajax.put(CODE_TAG, "500"); - ajax.put(MSG_TAG, "余额不足!"); - return ajax; - } - } - int ret = segchkUserChargeService.insertSegchkUserCharge(segchkUserCharge); - if(ret < 1){ - ajax.put(CODE_TAG, "500"); - ajax.put(MSG_TAG, "充值失败!"); - } - else{ - ajax.put(CODE_TAG, "200"); - ajax.put(MSG_TAG, "充值成功!"); - ajax.put(DATA_TAG, segchkUserCharge.getChargeId()); - } - return ajax; - } - - /** - * 充值结果回调接口,接口微信的支付结果,更新充值结果, ret 0成功,其他失败 - * { - * "chargeId": "demoData",//* - * "ret": 0//*0成功,其他失败 - * } - */ - @Log(title = "seg用户充值结果回调", businessType = BusinessType.UPDATE) - @PostMapping( "/userChargeResult") - @ResponseBody - @ApiOperation(value = "seg用户充值结果回调", notes = "需要鉴权") - public void userChargeResult(String chargeId, int ret) - { - segchkUserIndexService.chargeRet(chargeId, ret); - } - - /** - * 用户点击提现时的反应 - * { - * "userId": 459, - * "cash": 5.6, - * "providerId": 4, - * "userLevel": 2 - * } - */ -// @PreAuthorize("@ss.hasPermi('segchk:user_cash:add')") - @PostMapping( "/userCashReq") - @ResponseBody - @ApiOperation(value = "seg用户提现请求", notes = "需要鉴权") - public AjaxResult userCashReq(SegchkUserCashOpsReq segchkUserCashOpsReq) - { - AjaxResult ajax = new AjaxResult(); - if(segchkUserCashOpsReq.getUserLevel() == 0){ - ajax.put(CODE_TAG, "300"); - ajax.put(MSG_TAG, "运营商无法线上提现"); - return ajax; - } -// segchkUserCashOpsReq.setUserLevel(2); - int ret = segchkUserIndexService.getAccountForCash(segchkUserCashOpsReq); - switch (ret){ - case -1: ajax.put(CODE_TAG, "400");ajax.put(MSG_TAG, "无余额信息");break; - case -2: ajax.put(CODE_TAG, "400");ajax.put(MSG_TAG, "无余额信息");break; - case -3: ajax.put(CODE_TAG, "400");ajax.put(MSG_TAG, "提现受限");break; - case -4: ajax.put(CODE_TAG, "400");ajax.put(MSG_TAG, "余额不足");break; - case 2: ajax.put(CODE_TAG, "200");ajax.put(MSG_TAG, "提现请求成功,请耐心等候");break; - default: ajax.put(CODE_TAG, "500");ajax.put(MSG_TAG, "未知错误");break; - } - return ajax; - } - - /** - * 提现结果回调接口,接口微信的支付结果,更新充值结果, ret 0成功,其他失败 - * { - * "userId": 43,//* - * "passwd": "sfsdfds",//* - * "providerId": 2,//* - * "userLevel": 2//* - * } - */ -// @PreAuthorize("@ss.hasPermi('segchk:user_set:add')") - @Log(title = "seg设置用户信息", businessType = BusinessType.UPDATE) - @PostMapping( "/SetInfo") - @ResponseBody - @ApiOperation(value = "seg设置用户信息", notes = "需要鉴权") - public AjaxResult SetInfo(SegchkUserSetInfoReq segchkUserSetInfoReq) - { - int ret = 0; - if(segchkUserSetInfoReq.getUserLevel() == 2) { - ret = segchkUserIndexService.updateUserInfo(segchkUserSetInfoReq); - } - else if(segchkUserSetInfoReq.getUserLevel() == 1){ - ret = segchkStoreIndexService.updateUserInfo(segchkUserSetInfoReq); - } - return toAjax(ret); - } - - - /** - * seg设置用户实名信息 - * { - * "userName": "demoData", - * "userId": 0, - * "providerId": 0, - * "IDcard": "demoData", - * "card1": "demoData", - * "card2": "demoData" - * } - */ -// @PreAuthorize("@ss.hasPermi('segchk:user_certicify:add')") - @Log(title = "seg设置用户实名信息", businessType = BusinessType.UPDATE) - @PostMapping( "/userCerticify") - @ResponseBody - @ApiOperation(value = "seg设置用户实名信息", notes = "需要鉴权") - public AjaxResult user_certicify(SegchkUserCertificationInfo segchkUserCertificationInfo) - { - int ret = 0; - - ret = segchkUserIndexService.userCerticify(segchkUserCertificationInfo); - return toAjax(ret); - } - - - /** - * 提现结果回调接口,接口微信的支付结果,更新充值结果, ret 0成功,其他失败 - * { - * "chargeId": "45435", - * "userLevel": "1/2/0", - * "ret": 1 - * } - */ - @Log(title = "seg提现结果回调", businessType = BusinessType.UPDATE) - @PostMapping( "/userCashResult") - @ResponseBody - @ApiOperation(value = "seg提现结果回调", notes = "需要鉴权") - public void userCashResult(String chargeId, int userLevel, int ret) - { - if(userLevel == 1) { - segchkStoreIndexService.cashRet(chargeId, ret); - } - else if(userLevel == 2){ - segchkUserIndexService.cashRet(chargeId, ret); - } - } - - -} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java index dab2bf8..69a23e4 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java @@ -2,6 +2,9 @@ package com.ruoyi.web.controller.system; import java.util.List; import java.util.Set; + +import com.ruoyi.security.web.service.SysLoginService; +import com.ruoyi.security.web.service.SysPermissionService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; @@ -13,8 +16,6 @@ import com.ruoyi.common.core.domain.entity.SysMenu; import com.ruoyi.common.core.domain.entity.SysUser; import com.ruoyi.common.core.domain.model.LoginBody; import com.ruoyi.common.utils.SecurityUtils; -import com.ruoyi.framework.web.service.SysLoginService; -import com.ruoyi.framework.web.service.SysPermissionService; import com.ruoyi.system.service.ISysMenuService; /** diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRoleController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRoleController.java index 2870f66..bcebdb1 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRoleController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRoleController.java @@ -1,6 +1,8 @@ package com.ruoyi.web.controller.system; import java.util.List; + +import com.ruoyi.security.web.service.SysPermissionService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; @@ -23,7 +25,6 @@ import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.enums.BusinessType; import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.poi.ExcelUtil; -import com.ruoyi.framework.web.service.SysPermissionService; import com.ruoyi.framework.web.service.TokenService; import com.ruoyi.system.domain.SysUserRole; import com.ruoyi.system.service.ISysRoleService; diff --git a/ruoyi-common/pom.xml b/ruoyi-common/pom.xml index 02be00c..a44ed57 100644 --- a/ruoyi-common/pom.xml +++ b/ruoyi-common/pom.xml @@ -6,6 +6,8 @@ ruoyi com.ruoyi 3.6.0 + ../pom.xml + 4.0.0 diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/annotation/UnAuth.java b/ruoyi-common/src/main/java/com/ruoyi/common/annotation/UnAuth.java new file mode 100644 index 0000000..e8f1c95 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/annotation/UnAuth.java @@ -0,0 +1,14 @@ +package com.ruoyi.common.annotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * 不需要拦截注解 + */ +@Target(ElementType.METHOD) +@Retention(RetentionPolicy.RUNTIME) +public @interface UnAuth { +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/exception/CustomException.java b/ruoyi-common/src/main/java/com/ruoyi/common/exception/CustomException.java new file mode 100644 index 0000000..b9ee3af --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/exception/CustomException.java @@ -0,0 +1,37 @@ +package com.ruoyi.common.exception; + +/** + * 自定义异常 + * + * @author ruoyi + */ +public class CustomException extends RuntimeException { + private static final long serialVersionUID = 1L; + + private Integer code; + + private String message; + + public CustomException(String message) { + this.message = message; + } + + public CustomException(String message, Integer code) { + this.message = message; + this.code = code; + } + + public CustomException(String message, Throwable e) { + super(message, e); + this.message = message; + } + + @Override + public String getMessage() { + return message; + } + + public Integer getCode() { + return code; + } +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/exception/ServiceException.java b/ruoyi-common/src/main/java/com/ruoyi/common/exception/ServiceException.java index 734e8fc..0a05ad6 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/exception/ServiceException.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/exception/ServiceException.java @@ -5,7 +5,7 @@ package com.ruoyi.common.exception; * * @author ruoyi */ -public final class ServiceException extends RuntimeException +public class ServiceException extends RuntimeException { private static final long serialVersionUID = 1L; @@ -70,4 +70,8 @@ public final class ServiceException extends RuntimeException this.detailMessage = detailMessage; return this; } + + public void setCode(Integer code) { + this.code = code; + } } \ No newline at end of file diff --git a/ruoyi-framework/pom.xml b/ruoyi-framework/pom.xml index eb58d18..f583b11 100644 --- a/ruoyi-framework/pom.xml +++ b/ruoyi-framework/pom.xml @@ -6,6 +6,8 @@ ruoyi com.ruoyi 3.6.0 + ../pom.xml + 4.0.0 diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/ResourcesConfig.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/ResourcesConfig.java index 9cd523e..eb2e0cd 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/ResourcesConfig.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/ResourcesConfig.java @@ -46,20 +46,20 @@ public class ResourcesConfig implements WebMvcConfigurer /** * 跨域配置 */ - @Bean - public CorsFilter corsFilter() - { - UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); - CorsConfiguration config = new CorsConfiguration(); - config.setAllowCredentials(true); - // 设置访问源地址 - config.addAllowedOrigin("*"); - // 设置访问源请求头 - config.addAllowedHeader("*"); - // 设置访问源请求方法 - config.addAllowedMethod("*"); - // 对接口配置跨域设置 - source.registerCorsConfiguration("/**", config); - return new CorsFilter(source); - } +// @Bean +// public CorsFilter corsFilter() +// { +// UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); +// CorsConfiguration config = new CorsConfiguration(); +// config.setAllowCredentials(true); +// // 设置访问源地址 +// config.addAllowedOrigin("*"); +// // 设置访问源请求头 +// config.addAllowedHeader("*"); +// // 设置访问源请求方法 +// config.addAllowedMethod("*"); +// // 对接口配置跨域设置 +// source.registerCorsConfiguration("/**", config); +// return new CorsFilter(source); +// } } \ No newline at end of file diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/exception/GlobalExceptionHandler.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/exception/GlobalExceptionHandler.java deleted file mode 100644 index bf0a7ed..0000000 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/exception/GlobalExceptionHandler.java +++ /dev/null @@ -1,114 +0,0 @@ -package com.ruoyi.framework.web.exception; - -import javax.servlet.http.HttpServletRequest; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.security.access.AccessDeniedException; -import org.springframework.validation.BindException; -import org.springframework.web.HttpRequestMethodNotSupportedException; -import org.springframework.web.bind.MethodArgumentNotValidException; -import org.springframework.web.bind.annotation.ExceptionHandler; -import org.springframework.web.bind.annotation.RestControllerAdvice; -import com.ruoyi.common.constant.HttpStatus; -import com.ruoyi.common.core.domain.AjaxResult; -import com.ruoyi.common.exception.DemoModeException; -import com.ruoyi.common.exception.ServiceException; -import com.ruoyi.common.utils.StringUtils; - -/** - * 全局异常处理器 - * - * @author ruoyi - */ -@RestControllerAdvice -public class GlobalExceptionHandler -{ - private static final Logger log = LoggerFactory.getLogger(GlobalExceptionHandler.class); - - /** - * 权限校验异常 - */ - @ExceptionHandler(AccessDeniedException.class) - public AjaxResult handleAccessDeniedException(AccessDeniedException e, HttpServletRequest request) - { - String requestURI = request.getRequestURI(); - log.error("请求地址'{}',权限校验失败'{}'", requestURI, e.getMessage()); - return AjaxResult.error(HttpStatus.FORBIDDEN, "没有权限,请联系管理员授权"); - } - - /** - * 请求方式不支持 - */ - @ExceptionHandler(HttpRequestMethodNotSupportedException.class) - public AjaxResult handleHttpRequestMethodNotSupported(HttpRequestMethodNotSupportedException e, - HttpServletRequest request) - { - String requestURI = request.getRequestURI(); - log.error("请求地址'{}',不支持'{}'请求", requestURI, e.getMethod()); - return AjaxResult.error(e.getMessage()); - } - - /** - * 业务异常 - */ - @ExceptionHandler(ServiceException.class) - public AjaxResult handleServiceException(ServiceException e, HttpServletRequest request) - { - log.error(e.getMessage(), e); - Integer code = e.getCode(); - return StringUtils.isNotNull(code) ? AjaxResult.error(code, e.getMessage()) : AjaxResult.error(e.getMessage()); - } - - /** - * 拦截未知的运行时异常 - */ - @ExceptionHandler(RuntimeException.class) - public AjaxResult handleRuntimeException(RuntimeException e, HttpServletRequest request) - { - String requestURI = request.getRequestURI(); - log.error("请求地址'{}',发生未知异常.", requestURI, e); - return AjaxResult.error(e.getMessage()); - } - - /** - * 系统异常 - */ - @ExceptionHandler(Exception.class) - public AjaxResult handleException(Exception e, HttpServletRequest request) - { - String requestURI = request.getRequestURI(); - log.error("请求地址'{}',发生系统异常.", requestURI, e); - return AjaxResult.error(e.getMessage()); - } - - /** - * 自定义验证异常 - */ - @ExceptionHandler(BindException.class) - public AjaxResult handleBindException(BindException e) - { - log.error(e.getMessage(), e); - String message = e.getAllErrors().get(0).getDefaultMessage(); - return AjaxResult.error(message); - } - - /** - * 自定义验证异常 - */ - @ExceptionHandler(MethodArgumentNotValidException.class) - public Object handleMethodArgumentNotValidException(MethodArgumentNotValidException e) - { - log.error(e.getMessage(), e); - String message = e.getBindingResult().getFieldError().getDefaultMessage(); - return AjaxResult.error(message); - } - - /** - * 演示模式异常 - */ - @ExceptionHandler(DemoModeException.class) - public AjaxResult handleDemoModeException(DemoModeException e) - { - return AjaxResult.error("演示模式,不允许操作"); - } -} diff --git a/ruoyi-generator/pom.xml b/ruoyi-generator/pom.xml index c87ee7c..7118265 100644 --- a/ruoyi-generator/pom.xml +++ b/ruoyi-generator/pom.xml @@ -6,6 +6,8 @@ ruoyi com.ruoyi 3.6.0 + ../pom.xml + 4.0.0 diff --git a/ruoyi-quartz/pom.xml b/ruoyi-quartz/pom.xml index 67b7abd..d9452c6 100644 --- a/ruoyi-quartz/pom.xml +++ b/ruoyi-quartz/pom.xml @@ -6,6 +6,8 @@ ruoyi com.ruoyi 3.6.0 + ../pom.xml + 4.0.0 diff --git a/ruoyi-segchk-web/pom.xml b/ruoyi-segchk-web/pom.xml new file mode 100644 index 0000000..c33423a --- /dev/null +++ b/ruoyi-segchk-web/pom.xml @@ -0,0 +1,139 @@ + + + + ruoyi + com.ruoyi + 3.6.0 + ../pom.xml + + 4.0.0 + jar + ruoyi-segchk-web + + + web服务入口 + + + + + + + org.springframework.boot + spring-boot-devtools + true + + + + + + + + + + + + + + + + io.springfox + springfox-boot-starter + + + + + io.swagger + swagger-models + 1.6.2 + + + + + mysql + mysql-connector-java + + + + + com.ruoyi + ruoyi-framework + + + + com.ruoyi + ruoyi-segchk + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + org.springframework.boot + spring-boot-maven-plugin + 2.1.1.RELEASE + + true + + + + + repackage + + + + + + org.apache.maven.plugins + maven-war-plugin + 3.0.0 + + false + ${project.artifactId} + + + + ${project.artifactId} + + + \ No newline at end of file diff --git a/ruoyi-segchk-web/src/main/docker/Dockerfile b/ruoyi-segchk-web/src/main/docker/Dockerfile new file mode 100644 index 0000000..184bcc2 --- /dev/null +++ b/ruoyi-segchk-web/src/main/docker/Dockerfile @@ -0,0 +1,4 @@ +FROM openjdk:8-jre +VOLUME /tmp +ADD lecshop_web_applets-3.0.0-SNAPSHOT.jar app.jar +ENTRYPOINT ["java","-Duser.timezone=GMT+08","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar","--spring.profiles.active=prod"] \ No newline at end of file diff --git a/ruoyi-segchk-web/src/main/java/com/ruoyi/AppletsAppApplication.java b/ruoyi-segchk-web/src/main/java/com/ruoyi/AppletsAppApplication.java new file mode 100644 index 0000000..a92a839 --- /dev/null +++ b/ruoyi-segchk-web/src/main/java/com/ruoyi/AppletsAppApplication.java @@ -0,0 +1,83 @@ +package com.ruoyi; + + +import com.ruoyi.util.QrCodeController; +import com.ruoyi.common.utils.SnowflakeIdWorker; +import com.ruoyi.util.RedisCacheErrorHandler; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; +import org.springframework.cache.interceptor.CacheErrorHandler; +import org.springframework.context.ConfigurableApplicationContext; +import org.springframework.context.annotation.Bean; +import org.springframework.core.env.Environment; +import org.springframework.transaction.annotation.EnableTransactionManagement; +import org.springframework.web.cors.CorsConfiguration; +import org.springframework.web.cors.UrlBasedCorsConfigurationSource; +import org.springframework.web.filter.CorsFilter; + +import java.net.InetAddress; +import java.net.UnknownHostException; + +/** + * Created by 魔金商城 on 2019/5/1. + * 小程序app后端启动类 + */ +@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class}) +@EnableTransactionManagement +public class AppletsAppApplication { + + public static void main(String[] args) throws UnknownHostException { + System.out.println("start-------------"); + // SpringApplication.run(MallPortalApplication.class, args); + ConfigurableApplicationContext application = SpringApplication.run(AppletsAppApplication.class, args); + Environment env = application.getEnvironment(); + String ip = InetAddress.getLocalHost().getHostAddress(); + String port = env.getProperty("server.port"); + + System.out.println("\n----------------------------------------------------------\n\t" + + "Application mallplus-Boot is running! Access URLs:\n\t" + + "Local: \t\thttp://localhost:" + port + "/\n\t" + + "External: \thttp://" + ip + ":" + port + "/\n\t" + + "swagger-ui: \thttp://" + ip + ":" + port + "/swagger-ui.html\n\t" + + "https://gitee.com/zscat/mallplus/wikis/pages/preview?sort_id=2168368&doc_id=326093"+ + "-----------------页面请部署 mallplus-admin-web-----------------------------------------"); + } + /** + * redis 异常处理 + */ + @Bean + public CacheErrorHandler errorHandler() { + return new RedisCacheErrorHandler(); + } + + /** + * 序列号生成器 + */ + @Bean + public SnowflakeIdWorker snowflakeIdWorker() { + SnowflakeIdWorker snowflakeIdWorker = new SnowflakeIdWorker(0, 1); + return snowflakeIdWorker; + } + + @Bean + public CorsFilter corsFilter() { + final UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); + final CorsConfiguration config = new CorsConfiguration(); + config.setAllowCredentials(true); // 允许cookies跨域 + config.addAllowedOrigin("*");// #允许向该服务器提交请求的URI,*表示全部允许,在SpringMVC中,如果设成*,会自动转成当前请求头中的Origin + config.addAllowedHeader("*");// #允许访问的头信息,*表示全部 + config.setMaxAge(18000L);// 预检请求的缓存时间(秒),即在这个时间段里,对于相同的跨域请求不会再预检了 + config.addAllowedMethod("OPTIONS");// 允许提交请求的方法,*表示全部允许 + config.addAllowedMethod("HEAD"); + config.addAllowedMethod("GET");// 允许Get的请求方法 + config.addAllowedMethod("PUT"); + config.addAllowedMethod("POST"); + config.addAllowedMethod("DELETE"); + config.addAllowedMethod("PATCH"); + source.registerCorsConfiguration("/**", config); + return new CorsFilter(source); + } + + +} diff --git a/ruoyi-segchk-web/src/main/java/com/ruoyi/appletsutil/AppletsLoginUtils.java b/ruoyi-segchk-web/src/main/java/com/ruoyi/appletsutil/AppletsLoginUtils.java new file mode 100644 index 0000000..4b2bbfd --- /dev/null +++ b/ruoyi-segchk-web/src/main/java/com/ruoyi/appletsutil/AppletsLoginUtils.java @@ -0,0 +1,97 @@ +package com.ruoyi.appletsutil; + +import com.alibaba.fastjson.JSONObject; +import com.ruoyi.common.core.redis.RedisCache; +import com.ruoyi.common.utils.spring.SpringUtils; +import com.ruoyi.interceptor.AuthorityInterceptor; +import com.ruoyi.util.Claims; +import org.slf4j.ILoggerFactory; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.util.ObjectUtils; +import org.springframework.util.StringUtils; + +import javax.servlet.http.HttpServletRequest; +import java.util.Objects; + +/** + * 小程序登录工具类 + * + * @author SK + * @since 2018/6/13 + */ +public class AppletsLoginUtils { + private static AppletsLoginUtils ourInstance = new AppletsLoginUtils(); + + private static final Logger log = LoggerFactory.getLogger(AppletsLoginUtils.class); + + private AppletsLoginUtils() { + } + + public static AppletsLoginUtils getInstance() { + return ourInstance; + } + + /** + * 获得用户id + * + * @return 返回用户id + */ + public long getCustomerId(HttpServletRequest request) { + long customerId = 0; + if (!ObjectUtils.isEmpty(getClaims(getToken(request)))) { + customerId = getClaims(getToken(request)).getUserId(); + } + return customerId; + } + /** + * 获取token + * + * @param request request + * @return token + */ + private String getToken(HttpServletRequest request) { + // 认证信息在header 中的key + final String authHeader = request.getHeader("Authorization"); + log.debug("request.header--->{}", request.getHeaderNames().toString()); + if (Objects.isNull(authHeader) || !authHeader.startsWith("Bearer")) { + throw new UnAuthorizedException(ResultCode.WX_NOT_AUTHORIZED); + } + return authHeader.length() >= 7 ? authHeader.substring(7) : authHeader.substring(6); + } + /** + * 获取openId + * + * @return 返回openId + */ + public String getOpenId(HttpServletRequest request) { + return ((Claims) request.getAttribute("claims")).getOpenId(); + } + /** + * 获取小程序凭证实体 + * + * @param token token + * @return 小程序凭证实体 + */ + private Claims getClaims(String token) { + String claims = SpringUtils.getBean(RedisCache.class).getCacheObject(token); + return StringUtils.isEmpty(claims) ? null : JSONObject.parseObject(claims, Claims.class); + } + /** + * 获取unionId + * + * @return 返回unionId + */ + public String getUnionId(HttpServletRequest request) { + return ((Claims) request.getAttribute("claims")).getUnionId(); + } + + /** + * 获取小程序凭证实体 + * + * @return 小程序凭证实体 + */ + public Claims getClaims(HttpServletRequest request) { + return ((Claims) request.getAttribute("claims")); + } +} diff --git a/ruoyi-segchk-web/src/main/java/com/ruoyi/appletsutil/BaseResponse.java b/ruoyi-segchk-web/src/main/java/com/ruoyi/appletsutil/BaseResponse.java new file mode 100644 index 0000000..1976a13 --- /dev/null +++ b/ruoyi-segchk-web/src/main/java/com/ruoyi/appletsutil/BaseResponse.java @@ -0,0 +1,56 @@ +package com.ruoyi.appletsutil; + + +import com.ruoyi.util.md5.MessageSourceUtil; + +import java.io.Serializable; + +/** + * 基础返回 + * Created by 魔金商城 on 17/7/10. + */ +public class BaseResponse implements Serializable { + + /** + * 结果码 + */ + private String code; + /** + * 消息内容 + */ + private String message; + + public BaseResponse(String code) { + this.code = code; + this.message = MessageSourceUtil.getMessage(code); + } + + public BaseResponse(String code, String message) { + this.code = code; + this.message = message; + } + + public static BaseResponse SUCCESSFUL() { + return new BaseResponse(ResultCode.SUCCESSFUL); + } + + public static BaseResponse FAILED() { + return new BaseResponse(ResultCode.FAILED); + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } +} diff --git a/ruoyi-segchk-web/src/main/java/com/ruoyi/appletsutil/ErrorController.java b/ruoyi-segchk-web/src/main/java/com/ruoyi/appletsutil/ErrorController.java new file mode 100644 index 0000000..fa84563 --- /dev/null +++ b/ruoyi-segchk-web/src/main/java/com/ruoyi/appletsutil/ErrorController.java @@ -0,0 +1,39 @@ +package com.ruoyi.appletsutil; + + +import com.ruoyi.common.annotation.UnAuth; +import org.springframework.boot.autoconfigure.web.servlet.error.AbstractErrorController; +import org.springframework.boot.web.servlet.error.ErrorAttributes; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.servlet.http.HttpServletRequest; +import java.util.Map; + +/** + * Created by 魔金商城 on 2019/5/25. + * 错误控制器 + */ +@RestController +public class ErrorController extends AbstractErrorController { + + /** + * 错误地址 + */ + private static final String ERROR_PATH = "/error"; + + public ErrorController(ErrorAttributes errorAttributes) { + super(errorAttributes); + } + + @Override + public String getErrorPath() { + return ERROR_PATH; + } + + @RequestMapping(ERROR_PATH) + @UnAuth + public Map handleError(HttpServletRequest request) { + return getErrorAttributes(request, true); + } +} diff --git a/ruoyi-segchk-web/src/main/java/com/ruoyi/appletsutil/GlobalWebExceptionHandler.java b/ruoyi-segchk-web/src/main/java/com/ruoyi/appletsutil/GlobalWebExceptionHandler.java new file mode 100644 index 0000000..723c041 --- /dev/null +++ b/ruoyi-segchk-web/src/main/java/com/ruoyi/appletsutil/GlobalWebExceptionHandler.java @@ -0,0 +1,59 @@ +package com.ruoyi.appletsutil; + +import com.ruoyi.common.exception.ServiceException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.core.annotation.AnnotationUtils; +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.ControllerAdvice; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.ResponseStatus; + +import javax.servlet.http.HttpServletRequest; + +/** + * Created by 魔金商城 on 17/7/10. + * 全局异常 + */ +@ControllerAdvice +public class GlobalWebExceptionHandler { + + /** + * 调试日志 + */ + private Logger logger = LoggerFactory.getLogger(GlobalWebExceptionHandler.class); + + /** + * 未认证异常(有可能是未关联用户 也有可能是微信未授权根据返回码判断) + */ + @ResponseStatus(HttpStatus.UNAUTHORIZED) + @ExceptionHandler(UnAuthorizedException.class) + @ResponseBody + public BaseResponse signatureExceptionHandler(HttpServletRequest request, UnAuthorizedException ex) { + logger.error("do [{}] on [{}] failed. exMsg:{}", request.getMethod(), request.getRequestURL(), + ex.getLocalizedMessage()); + logger.error("queryString:{}, parameterMap: {}", request.getQueryString(), request.getParameterMap(), ex); + + return new BaseResponse(ex.getErrorCode(), ex.getLocalizedMessage()); + } + + /** + * 业务异常 + */ + @ExceptionHandler(value = ServiceException.class) + @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR) + @ResponseBody + public BaseResponse serviceExceptionHandler(HttpServletRequest request, ServiceException ex) throws Exception { + if (AnnotationUtils.findAnnotation(ex.getClass(), ResponseStatus.class) != null) + throw ex; + + logger.error("do [{}] on [{}] failed. exMsg:{}", request.getMethod(), request.getRequestURL(), + ex.getLocalizedMessage()); + if (logger.isDebugEnabled()) { + logger.error("queryString:{}, parameterMap: {}", request.getQueryString(), request.getParameterMap(), ex); + } + + return new BaseResponse(ex.getMessage(), ex.getLocalizedMessage()); + } +} diff --git a/ruoyi-segchk-web/src/main/java/com/ruoyi/appletsutil/ResultCode.java b/ruoyi-segchk-web/src/main/java/com/ruoyi/appletsutil/ResultCode.java new file mode 100644 index 0000000..9855a31 --- /dev/null +++ b/ruoyi-segchk-web/src/main/java/com/ruoyi/appletsutil/ResultCode.java @@ -0,0 +1,34 @@ +package com.ruoyi.appletsutil; + +/** + * Created by 魔金商城 on 17/7/10. + * 结果返回吗 + */ +public interface ResultCode { + + /** + * 操作成功; + */ + String SUCCESSFUL = "R-00000"; + + /** + * 操作失败; + */ + String FAILED = "R-00001"; + + /** + * 微信未授权 + */ + String WX_NOT_AUTHORIZED = "R-00002"; + + /** + * 微信未关联用户 + */ + String WX_NOT_LINKD = "R-00003"; + + /** + * 小程序账号已绑定错误 + */ + String WX_ALREADY_BIND_ERROR = "R-00004"; + +} diff --git a/ruoyi-segchk-web/src/main/java/com/ruoyi/appletsutil/UnAuthorizedException.java b/ruoyi-segchk-web/src/main/java/com/ruoyi/appletsutil/UnAuthorizedException.java new file mode 100644 index 0000000..15b2018 --- /dev/null +++ b/ruoyi-segchk-web/src/main/java/com/ruoyi/appletsutil/UnAuthorizedException.java @@ -0,0 +1,33 @@ +package com.ruoyi.appletsutil; + +import com.ruoyi.common.exception.ServiceException; +import com.ruoyi.util.md5.MessageSourceUtil; + +/** + * Created by 魔金商城 on 2018/6/13. + * 微信小程序未授权异常 + */ +public class UnAuthorizedException extends ServiceException { + + /** + * 错误code + */ + private String errorCode; + + public UnAuthorizedException(String errorCode) { + this(errorCode, MessageSourceUtil.getMessage(errorCode)); + } + + public UnAuthorizedException(String errorCode, String message) { + super(message == null ? errorCode : message); + this.errorCode = errorCode; + } + + public String getErrorCode() { + return errorCode; + } + + public void setErrorCode(String errorCode) { + this.errorCode = errorCode; + } +} diff --git a/ruoyi-segchk-web/src/main/java/com/ruoyi/config/WebConfigurer.java b/ruoyi-segchk-web/src/main/java/com/ruoyi/config/WebConfigurer.java new file mode 100644 index 0000000..f85642c --- /dev/null +++ b/ruoyi-segchk-web/src/main/java/com/ruoyi/config/WebConfigurer.java @@ -0,0 +1,26 @@ +package com.ruoyi.config; + +import com.ruoyi.interceptor.AuthorityInterceptor; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.servlet.config.annotation.InterceptorRegistry; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; + +/** + * Created by 魔金商城 on 2019/5/13. + * 拦截器配置 + */ +@Configuration +public class WebConfigurer implements WebMvcConfigurer { + + /** + * 注入登录拦截器 + */ + @Autowired + private AuthorityInterceptor authorityInterceptor; + + @Override + public void addInterceptors(InterceptorRegistry registry) { + registry.addInterceptor(authorityInterceptor).excludePathPatterns("/**/**", "/v2/**", "/swagger-ui.html", "/webjars/**", "/swagger-resources/**"); + } +} diff --git a/ruoyi-segchk-web/src/main/java/com/ruoyi/interceptor/AuthorityInterceptor.java b/ruoyi-segchk-web/src/main/java/com/ruoyi/interceptor/AuthorityInterceptor.java new file mode 100644 index 0000000..ca4d164 --- /dev/null +++ b/ruoyi-segchk-web/src/main/java/com/ruoyi/interceptor/AuthorityInterceptor.java @@ -0,0 +1,170 @@ +package com.ruoyi.interceptor; + +import com.alibaba.fastjson.JSONObject; +import com.ruoyi.appletsutil.AppletsLoginUtils; +import com.ruoyi.util.Claims; +import com.ruoyi.appletsutil.ResultCode; +import com.ruoyi.appletsutil.UnAuthorizedException; +import com.ruoyi.common.annotation.UnAuth; +import com.ruoyi.common.core.redis.RedisCache; +import com.ruoyi.common.utils.ip.IpUtils; +import com.ruoyi.segchk.domain.WeChatCustomerLink; +import com.ruoyi.member.service.WeChatCustomerLinkService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Lazy; +import org.springframework.stereotype.Component; +import org.springframework.util.StringUtils; +import org.springframework.web.method.HandlerMethod; +import org.springframework.web.servlet.handler.HandlerInterceptorAdapter; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.Objects; + +/** + * Created by 魔金商城 on 2018/6/13. + * 访问拦截器 + */ +@Component +public class AuthorityInterceptor extends HandlerInterceptorAdapter { + + private static final Logger log = LoggerFactory.getLogger(AuthorityInterceptor.class); + /** + * 注入redis服务 + */ + @Autowired + private RedisCache redisService; + + /** + * 注入微信用户关联服务 + */ + @Autowired + @Lazy + private WeChatCustomerLinkService weChatCustomerLinkService; + + @Override + public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { + String requestType = ((HttpServletRequest) request).getMethod(); + String fullUrl = ((HttpServletRequest) request).getRequestURL().toString(); + log.debug("fullUrl--->{}", fullUrl); + int startIntercept = fullUrl.replace("//", "a").indexOf("/") + 1; + String interfaceName = fullUrl.substring(startIntercept, fullUrl.length()); + if (!"OPTIONS".equals(requestType) && !interfaceName.contains("webjars") + && !interfaceName.contains("api-docs")) { + log.info(formMapKey(AppletsLoginUtils.getInstance().getCustomerId(request), fullUrl, requestType, + IpUtils.getIpAddr((HttpServletRequest) request), null, null) + + ",\"cost\":\""); + } + + // 如果不需要拦截 则直接返回 + if (!isNeedFilter(handler)) { + log.debug("Donot need authority....."); + return true; + } + + // 认证信息在header 中的key + final String authHeader = request.getHeader("Authorization"); + + + if (Objects.isNull(authHeader) || !authHeader.startsWith("Bearer ")) { + log.info("AuthorityInterceptor preHandle fail...."); + throw new UnAuthorizedException(ResultCode.WX_NOT_AUTHORIZED); + } + + // 获得凭证 + Claims claims = getAppletsClaimsFromRedis(authHeader.substring(7)); + + // 没有凭证 直接返回 + if (Objects.isNull(claims)) { + log.info("AuthorityInterceptor preHandle fail...."); + throw new UnAuthorizedException(ResultCode.WX_NOT_AUTHORIZED); + } + + // 校验有没有uid 如果没有uid 则直接返回 + if (!claims.hasCustomerId()) { + log.error("applets has not authorized"); + throw new UnAuthorizedException(ResultCode.WX_NOT_AUTHORIZED); + } + + // 如果没有会员id 则从数据库查询 是否有会员id + /*if (!claims.hasCustomerId()) { + // 小程序没有关联用户则提示用户去关联用户 + WeChatCustomerLink weChatCustomerLink = queryWeChatCustomerLinkByUnionId(claims.getUnionId()); + if (Objects.isNull(weChatCustomerLink)) { + log.error("applets has not linked member...."); + throw new UnAuthorizedException(ResultCode.WX_NOT_LINKD); + } else { + log.info("applets has unionId and has member...."); + // 将凭证信息返回redis + putClaimsToRedis(weChatCustomerLink, claims, authHeader.substring(7)); + //如果没有小程序的openId,则更新关联信息 + if (!weChatCustomerLink.hasAppletOpenId()) { + weChatCustomerLink.setAppletOpenId(claims.getOpenId()); + weChatCustomerLinkService.updateWeChatCustomerLink(weChatCustomerLink); + } + } + }*/ + + request.setAttribute("claims", claims); + + return true; + } + + private String formMapKey(Object userId, String mothedName, String requestType, + String ip, String params, String token) { + return "\"time\"" + ":\"" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss SSS").format(new Date()) + + "\",\"name\"" + ":\"" + mothedName + "\",\"uid\":\"" + userId + + "\",\"type\":\"" + requestType + "\",\"ip\":\"" + ip + + "\",\"token\":\"" + token + "\",\"params\":\"" + params + "\""; + } + /** + * 将凭证放入redis + * + * @param weChatCustomerLink 会员和小程序的绑定关系 + * @param claims 凭证 + * @param token token + */ + /*private void putClaimsToRedis(WeChatCustomerLink weChatCustomerLink, Claims claims, String token) { + claims.setUserId(weChatCustomerLink.); + redisService.putToRedis(token, JSON.toJSONString(claims)); + }*/ + + /** + * 根据unionId查询会员和小程序的绑定关系 + * + * @param unionId 小程序唯一id + * @return 返回会员和小程序的绑定关系 + */ + private WeChatCustomerLink queryWeChatCustomerLinkByUnionId(String unionId) { + return weChatCustomerLinkService.queryWeChatCustomerLinkByUnionId(unionId); + } + + + /** + * 根据token从redis 获取uid和customerId + * + * @param token token + * @return 返回uid和customerId + */ + private Claims getAppletsClaimsFromRedis(String token) { + String claims = redisService.getCacheObject(token); + return StringUtils.isEmpty(claims) ? null : JSONObject.parseObject(redisService.getCacheObject(token), Claims.class); + } + + + /** + * 判断是否需要拦截 + */ + private boolean isNeedFilter(Object handler) { + if (handler instanceof HandlerMethod) { + HandlerMethod handlerMethod = (HandlerMethod) handler; + return handlerMethod.getMethod().getAnnotation(UnAuth.class) == null; + } + return false; + } + +} diff --git a/ruoyi-segchk-web/src/main/java/com/ruoyi/login/OssController.java b/ruoyi-segchk-web/src/main/java/com/ruoyi/login/OssController.java new file mode 100644 index 0000000..e3044a3 --- /dev/null +++ b/ruoyi-segchk-web/src/main/java/com/ruoyi/login/OssController.java @@ -0,0 +1,128 @@ +package com.ruoyi.login; + + +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.setting.bean.OssSetting; +import com.ruoyi.setting.bean.UploadData; +import com.ruoyi.setting.service.OssService; +import com.ruoyi.util.CommonConstant; +import io.swagger.annotations.*; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.util.StringUtils; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.multipart.MultipartHttpServletRequest; + +import javax.annotation.Resource; +import java.util.Arrays; +import java.util.Objects; + +/** + * Oss相关操作接口 + * https://github.com/shenzhuan/mallplus on 2018/4/26. + */ +@RestController +@Api(tags = "OssController", description = "Oss管理") +@RequestMapping("/aliyun/oss") +public class OssController { + @Resource + private OssService ossService; + + + /** + * 上传图片 + * + * @param name 上传文件的name 默认为image + * @param type 上传文件的类型 默认为图片 0 图片 1 视频 + * @return 返回图片在腾讯云的地址 + * @throws Exception + */ + @PostMapping("uploadToQqOSSYun") + @ApiOperation(value = "上传图片", notes = "上传图片(不需要认证)") + @ApiImplicitParams({ + @ApiImplicitParam(paramType = "form", dataType = "String", name = "name", value = "上传文件的name 默认为image"), + @ApiImplicitParam(paramType = "form", dataType = "String", name = "type", value = "上传文件的类型 默认为图片 0 图片 1 视频"), + }) + @ApiResponses({ + @ApiResponse(code = 200, message = "返回图片在腾讯云的地址", response = String.class) + }) + public AjaxResult uploadToQqOSSYun(@RequestParam("file") MultipartFile multipartFile,MultipartHttpServletRequest request, String name, String type) throws Exception { + if (StringUtils.isEmpty(name)) { + name = "image"; + } + + // 默认上传图片 + if (StringUtils.isEmpty(type)) { + type = CommonConstant.UPLOAD_PIC; + } + if (Objects.isNull(multipartFile)) { + return AjaxResult.error(); + } + return AjaxResult.success(ossService.uploadToQqOss(Arrays.asList(UploadData.build(multipartFile.getInputStream(), multipartFile.getBytes(), multipartFile.getOriginalFilename(), type, multipartFile))).stream().findFirst().orElse("")); + } + + /** + * 上传图片 + * + * @param name 上传文件的name 默认为image + * @param type 上传文件的类型 默认为图片 0 图片 1 视频 + * @return 返回图片在阿里云的地址 + * @throws Exception + */ + @PostMapping("uploadToAliOss") + @ApiOperation(value = "上传图片", notes = "上传图片(不需要认证)") + @ApiImplicitParams({ + @ApiImplicitParam(paramType = "form", dataType = "String", name = "name", value = "上传文件的name 默认为image"), + @ApiImplicitParam(paramType = "form", dataType = "String", name = "type", value = "上传文件的类型 默认为图片 0 图片 1 视频"), + }) + @ApiResponses({ + @ApiResponse(code = 200, message = "返回图片在阿里云的地址", response = String.class) + }) + public AjaxResult uploadToOSSYun(@RequestParam("file") MultipartFile multipartFile, String name, String type) throws Exception { + if (StringUtils.isEmpty(name)) { + name = "image"; + } + + // 默认上传图片 + if (StringUtils.isEmpty(type)) { + type = CommonConstant.UPLOAD_PIC; + } + + if (Objects.isNull(multipartFile)) { + return AjaxResult.error(); + } + return AjaxResult.success(ossService.uploadToOss(Arrays.asList(UploadData.build(multipartFile.getInputStream(), multipartFile.getBytes(), multipartFile.getOriginalFilename(), type, multipartFile))).stream().findFirst().orElse("")); + } + + + /** + * 查询云存储设置 + * + * @return 云存储设置信息 + */ + @GetMapping("/oss") + @PreAuthorize("@ss.hasPermi('setting:ossSetting:list')") + @ApiOperation(value = "查询阿里云存储设置", notes = "查询阿里云存储设置(需要认证)") + @ApiResponses({ + @ApiResponse(code = 200, message = "又拍云设置信息", response = OssSetting.class) + }) + public OssSetting queryUpYunSet() { + return ossService.queryOssSetting(); + } + + /** + * 修改又拍云设置 + * + * @param ossSetting 又拍云设置信息 + * @return 成功1 否则失败 + */ + @PutMapping("/oss") + @ApiOperation(value = "修改阿里云存储设置", notes = "修改阿里云存储设置(需要认证)") + @ApiResponses({ + @ApiResponse(code = 200, message = "成功1 否则失败", response = Integer.class) + }) + public int updateOss(@RequestBody OssSetting ossSetting) { + return ossService.updateOss(ossSetting); + } + +} diff --git a/ruoyi-segchk-web/src/main/java/com/ruoyi/login/SegChkLoginController.java b/ruoyi-segchk-web/src/main/java/com/ruoyi/login/SegChkLoginController.java new file mode 100644 index 0000000..fb1f364 --- /dev/null +++ b/ruoyi-segchk-web/src/main/java/com/ruoyi/login/SegChkLoginController.java @@ -0,0 +1,680 @@ +package com.ruoyi.login; + +import com.alibaba.fastjson.JSONObject; +import com.ruoyi.common.core.domain.BaseEntity; +import com.ruoyi.segchk.domain.SegchkUserWebReq; +import com.ruoyi.util.Claims; +import com.ruoyi.appletsutil.ResultCode; +import com.ruoyi.appletsutil.UnAuthorizedException; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.annotation.UnAuth; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.redis.RedisCache; +import com.ruoyi.common.utils.SnowflakeIdWorker; +import com.ruoyi.segchk.domain.SegchkUserWechat; +import com.ruoyi.util.WeChatAppletLoginResponse; +import com.ruoyi.util.WechatSetting; +import com.ruoyi.member.service.*; +import com.ruoyi.member.vo.BindParams; +import com.ruoyi.setting.bean.WechatPaySet; +import com.ruoyi.setting.service.ILsPaySettingService; +import com.ruoyi.util.CommonConstant; +import com.ruoyi.util.WeChatAppletUtils; +import io.swagger.annotations.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Controller; +import org.springframework.util.ObjectUtils; +import org.springframework.util.StringUtils; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.Objects; +import java.util.concurrent.TimeUnit; + +/** + * 登录控制器 + * + * @author SK + * @since 2018/6/13 + */ +@Controller +@Api(description = "登录接口") +//@RequestMapping("/default/login") +public class SegChkLoginController { + + private static final Logger logger = LoggerFactory.getLogger(SegChkLoginController.class); + /** + * 注入微信小程序登录服务 + */ +// @Autowired +// private WeChatAppletLoginService weChatAppletLoginService; + + /** + * 注入redis服务 + */ + @Autowired + private RedisCache redisService; + + /** + * jwt密钥 + */ + @Value("${token.secret}") + private String jwtSecretKey; + + + + /** + * 注入登录处理service + */ + @Resource(name = "loginService") + private LoginService loginService; + + /** + * 注入注册服务 + */ + @Autowired + private RegisterService registerService; + + /** + * 注入注册聚合服务 + */ + @Autowired + private RegisterServiceApi registerServiceApi; + + /** + * 注入微信用户关联服务 + */ + @Autowired + private WeChatCustomerLinkService weChatCustomerLinkService; + /** + * 注入随机数生成器 + */ + @Autowired + private SnowflakeIdWorker snowflakeIdWorker; + /** + * 注入支付设置服务 + */ + @Autowired + private ILsPaySettingService paySetService; + /** + * 会员登录 + * + * + * @return -1 用户名或密码错误 -2 账号冻结 -3 账号锁定 1 成功 -4 验证码错误 + */ + @PostMapping("/login") + @UnAuth + @ResponseBody + @ApiOperation(value = "会员登录", notes = "会员登录(不需要认证)") + public AjaxResult login(@RequestBody SegchkUserWebReq segchkUserWebReq, HttpServletRequest request) { + Long userId = 0L; + if(!ObjectUtils.isEmpty(segchkUserWebReq) && "999999".equals(segchkUserWebReq.getRemark())){ + return loginService.login(segchkUserWebReq); + } +// Object cacheObject = redisService.getCacheObject(String.format("%s", "eyJhbGciOiJIUzI1NiIsInppcCI6IkRFRiJ9.eNqqViouTVKyUipPTc5ILMnJT8")); +// logger.warn(ObjectUtils.nullSafeToString(cacheObject)); + try { + if (ObjectUtils.isEmpty(getClaims(getToken(request)))) { +// 如果用户未登录,则要求用户使用手机号登录注册 + userId = getClaims(getToken(request)).getUserId(); + return AjaxResult.error(300, "请先登录注册"); + } + } + catch (Exception e){ + return AjaxResult.error(300, "请先登录注册"); + } + + Claims claims = getClaims(getToken(request)); + SegchkUserWebReq segchkUserWebReq1 = new SegchkUserWebReq(); + segchkUserWebReq1.setUserId(claims.getUserId()); + segchkUserWebReq1.setProviderId(claims.getProviderId()); + segchkUserWebReq1.setUserLevel(claims.getUserLevel()); + + return loginService.login(segchkUserWebReq1); + } + + /** + * 发送短信验证码 + * r + * + * @param mobile 手机号码 + * @return 0 成功 1 失败 -1 手机号码已经存在 + */ + @UnAuth + @RequestMapping(value = "/sendmobilecode") + @ResponseBody + @ApiOperation(value = "发送短信验证码", notes = "发送短信验证码(不需要认证)", httpMethod = "POST") + @ApiImplicitParams({ + @ApiImplicitParam(paramType = "form", dataType = "string", name = "mobile", value = "手机号码"), + }) + @ApiResponses({ + @ApiResponse(code = 200, message = "0 成功 1 失败 -1 手机号码已经存在", response = Integer.class) + }) + public AjaxResult sendSmsCode(String mobile) { +// 发送短信验证码 + logger.debug("sendmobilecode ---> phone:{}", mobile); + int ret = registerService.sendRegisterSmsCode(mobile, code -> redisService.setCacheObject(String.format("%s_%s", CommonConstant.APPLET_REGISTER_CODE_KEY, mobile), code, 5, TimeUnit.MINUTES)); + + if(ret != 0 ){ + return AjaxResult.error("500", "验证码发送失败,请稍后重试"); + } + return AjaxResult.success("验证码发送成功"); + + } + + /** + * 用户注册 + * + * @return -1 手机验证码错误 -2 参数错误 0 失败 成功>0 -3 手机号码已存在 -10 推荐人不存在 + */ + @UnAuth + @RequestMapping("/register") + @ResponseBody + @ApiOperation(value = "用户注册", notes = "用户注册(不需要认证)", httpMethod = "POST") + + @ApiResponses({ + @ApiResponse(code = 200, message = "-1 手机验证码错误 -2 参数错误 0 失败 成功>0 -3 手机号码已存在 -10 推荐人不存在", response = Integer.class) + }) + public AjaxResult register(@RequestBody SegChkLoginController.RegisterData registerData) { + AjaxResult res = null; + try { + res = registerServiceApi.registerCustomer(registerData.getMobile(), registerData.getCode() + , redisService.getCacheObject(String.format("%s_%s", CommonConstant.APPLET_REGISTER_CODE_KEY, registerData.getMobile())), registerData.getRecommendId(), registerData.getRecommendLevel(), registerData.getProviderId(), registerData.getRemark()); + + } catch (Exception e) { + e.printStackTrace(); + return res; + } +// 如果返回结果中不存在token,说明没有进行微信绑定 + return res; + } + + @UnAuth + @ResponseBody + @RequestMapping("/bindaccount") + @ApiOperation(value = "小程序获取登录信息", notes = "小程序获取登录信息(不需要认证)", httpMethod = "POST") + @ApiImplicitParams({ + @ApiImplicitParam(paramType = "form", dataType = "string", name = "code", value = "用户登录凭证"), + }) + public AjaxResult bindaccount(@RequestBody BindParams bindParams , HttpServletRequest request) { + WechatPaySet wechatAppletPaySet = paySetService.queryPaySet().getWechatAppletPaySet(); + WechatSetting wechatSetting = new WechatSetting(); + if(!StringUtils.isEmpty(bindParams.getRemark())){ + wechatSetting.setType(999999); + } + wechatSetting.setAppId(wechatAppletPaySet.getAppId()); +// wechatSetting.setAppId(appId); + wechatSetting.setAppSecret(wechatAppletPaySet.getAppSecret()); +// wechatSetting.setAppSecret(appSecrt); + if (!wechatSetting.checkAppletOAuthParams()) { +// log.error("getLoginInfo fail:checkAppletOAuthParams fail"); + return AjaxResult.error("getLoginInfo fail:checkAppletOAuthParams fail"); + } + + WeChatAppletLoginResponse weChatAppletLoginResponse = WeChatAppletUtils.getLoginInfo(bindParams.getCode(), wechatSetting); + if (Objects.isNull(weChatAppletLoginResponse)) { +// log.error("getLoginInfo fail: getLoginInfo fail"); + return AjaxResult.error("getLoginInfo fail: getLoginInfo fail"); + } + + SegchkUserWechat segchkUserWechat = new SegchkUserWechat(); + segchkUserWechat.setUserId(Long.valueOf(bindParams.getUserId())); + segchkUserWechat.setOpenid(weChatAppletLoginResponse.getOpenid()); + segchkUserWechat.setUnionId(weChatAppletLoginResponse.getUnionid()); + segchkUserWechat.setProviderId(Long.valueOf(bindParams.getProviderId())); + segchkUserWechat.setNickName(""); +// 将用户与微信openid绑定 + int ret = weChatCustomerLinkService.addSegchkUserWechat(segchkUserWechat, bindParams.getUserLevel()); + if(ret < 1){ + return AjaxResult.error(500, "微信绑定失败!"); + } +// 产生token + String token = registerServiceApi.createToke(CommonConstant.APPLET_LOGIN_KEY, Long.valueOf(bindParams.getUserId()), Long.valueOf(bindParams.getProviderId()), Integer.valueOf(bindParams.getUserLevel())); +// String token = snowflakeIdWorker.nextId()+""; + Claims claims = new Claims(); + claims.setUserId(Long.valueOf(bindParams.getUserId())); + claims.setOpenId(weChatAppletLoginResponse.getOpenid()); + claims.setProviderId(Long.valueOf(bindParams.getProviderId())); + claims.setUserLevel(Integer.valueOf(bindParams.getUserLevel())); +// 将用户的token进行缓存 + redisService.setCacheObject(token, claims); + return AjaxResult.success("绑定成功", token); + } + + /** + * 用户注册实体 + */ + @ApiModel(description = "用户注册实体") + private static class RegisterData extends BaseEntity { + + /** + * 手机号码 + */ + @ApiModelProperty(value = "手机号码") + private String mobile; + + + /** + * 手机验证码 + */ + @ApiModelProperty(value = "手机验证码") + private String code; + + /** + * 推荐码 + */ + @ApiModelProperty(value = "推荐码") + private String recommendId; + + /** + * 推荐码 + */ + @ApiModelProperty(value = "推荐人角色") + private String recommendLevel; + + /** 运营商id,全局唯一 */ + @Excel(name = "运营商id,全局唯一") + private String providerId; + + /** + * 授权code + */ + @ApiModelProperty(value = "授权code") + private String wechatCode; + + public String getMobile() { + return mobile; + } + + public void setMobile(String mobile) { + this.mobile = mobile; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getRecommendId() { + return recommendId; + } + + public void setRecommendId(String recommendId) { + this.recommendId = recommendId; + } + + public String getRecommendLevel() { + return recommendLevel; + } + + public void setRecommendLevel(String recommendLevel) { + this.recommendLevel = recommendLevel; + } + + public String getProviderId() { + return providerId; + } + + public void setProviderId(String providerId) { + this.providerId = providerId; + } + + public String getWechatCode() { + return wechatCode; + } + + public void setWechatCode(String wechatCode) { + this.wechatCode = wechatCode; + } + + @Override + public String toString() { + return "RegisterData{" + + "mobile='" + mobile + '\'' + + ", code='" + code + '\'' + + ", recommendId='" + recommendId + '\'' + + ", recommendLevel='" + recommendLevel + '\'' + + ", providerId='" + providerId + '\'' + + ", wechatCode='" + wechatCode + '\'' + + '}'; + } + } + + /** + * 注册登录 + * + * @param loginParams 登录参数 + * @return -1 用户名或密码错误 -2 账号冻结 -3 账号锁定 1 成功 -4 验证码错误 + */ + /*@PostMapping("/logout") + @UnAuth + @ResponseBody + @ApiOperation(value = "会员登录", notes = "会员登录(不需要认证)") + @ApiResponses({ + @ApiResponse(code = 200, message = "result: -1 用户名或密码错误 -2 账号冻结 -3 账号锁定 1 成功 -4 验证码错误 token:放登录成功后的token", response = Map.class) + }) + public AjaxResult logout(@RequestBody LoginParams loginParams, HttpServletRequest request)*/ + + /** + * 会员登录 + * + * @param loginParams 登录参数 + * @return -1 用户名或密码错误 -2 账号冻结 -3 账号锁定 1 成功 -4 验证码错误 + */ + /*@PostMapping("/logout") + @UnAuth + @ResponseBody + @ApiOperation(value = "会员登录", notes = "会员登录(不需要认证)") + @ApiResponses({ + @ApiResponse(code = 200, message = "result: -1 用户名或密码错误 -2 账号冻结 -3 账号锁定 1 成功 -4 验证码错误 token:放登录成功后的token", response = Map.class) + }) + public AjaxResult logout(@RequestBody LoginParams loginParams, HttpServletRequest request) { + AppletLoginRedisParamResponse appletLoginRedisParamResponse = JSON.parseObject(redisService.getValue(getToken(request)),AppletLoginRedisParamResponse.class) ; + redisService.deleteObject(getToken(request)); + // redisService.deleteObject(appletLoginRedisParamResponse.); + return AjaxResult.success(); + }*/ + /** + * 小程序获取登录信息 + * + * @param 用户登录凭证(有效期五分钟)。开发者需要在开发者服务器后台调用 api,使用 code 换取 openid 和 session_key 等信息 + * @return 登录信息 + */ + /*@UnAuth + @ResponseBody + @RequestMapping("/getOpenId") + @ApiOperation(value = "小程序获取登录信息", notes = "小程序获取登录信息(不需要认证)", httpMethod = "POST") + @ApiImplicitParams({ + @ApiImplicitParam(paramType = "form", dataType = "string", name = "code", value = "用户登录凭证"), + }) + @ApiResponses({ + @ApiResponse(code = 200, message = "登录信息", response = AppletLoginInfo.class) + }) + public AjaxResult getOpenId(@RequestBody AppletLoginRedisParamResponse appletLoginRedisParamResponse , HttpServletRequest request) { + + WechatPaySet wechatAppletPaySet = paySetService.queryPaySet().getWechatAppletPaySet(); + WechatSetting wechatSetting = new WechatSetting(); + wechatSetting.setAppId(wechatAppletPaySet.getAppId()); + wechatSetting.setAppSecret(wechatAppletPaySet.getAppSecret()); + if (!wechatSetting.checkAppletOAuthParams()) { + log.error("getLoginInfo fail:checkAppletOAuthParams fail"); + return AjaxResult.error("getLoginInfo fail:checkAppletOAuthParams fail"); + } + WeChatAppletLoginResponse weChatAppletLoginResponse = WeChatAppletUtils.getLoginInfo(appletLoginRedisParamResponse.getCode(), wechatSetting); + if (Objects.isNull(weChatAppletLoginResponse)) { + log.error("getLoginInfo fail: getLoginInfo fail"); + return AjaxResult.error("getLoginInfo fail: getLoginInfo fail"); + } + UmsMember member = new UmsMember(); + member.setAppletOpenId(weChatAppletLoginResponse.getOpenid()); + long customerId = 0; + if (!ObjectUtils.isEmpty(getClaims(getToken(request)))) { + customerId = getClaims(getToken(request)).getCustomerId(); + } + member.setId(customerId); + return AjaxResult.success(memberService.updateUmsMember(member)); + }*/ + /** + * 小程序获取登录信息 + * + * @param 用户登录凭证(有效期五分钟)。开发者需要在开发者服务器后台调用 api,使用 code 换取 openid 和 session_key 等信息 + * @return 登录信息 + */ + /*@UnAuth + @ResponseBody + @RequestMapping("/mpWechatLogin") + @ApiOperation(value = "小程序获取登录信息", notes = "小程序获取登录信息(不需要认证)", httpMethod = "POST") + @ApiImplicitParams({ + @ApiImplicitParam(paramType = "form", dataType = "string", name = "code", value = "用户登录凭证"), + }) + @ApiResponses({ + @ApiResponse(code = 200, message = "登录信息", response = AppletLoginInfo.class) + }) + public AjaxResult mpWechatLogin(@RequestBody AppletLoginRedisParamResponse appletLoginRedisParamResponse , HttpServletRequest request) { + final StringBuilder sb = new StringBuilder(); + Map res = new HashMap<>(); + String token = snowflakeIdWorker.nextId() + ""; + appletLoginRedisParamResponse.setToken(token); + WechatPaySet wechatAppletPaySet = paySetService.queryPaySet().getWechatAppletPaySet(); + WechatSetting wechatSetting = new WechatSetting(); + wechatSetting.setAppId(wechatAppletPaySet.getAppId()); + wechatSetting.setAppSecret(wechatAppletPaySet.getAppSecret()); + if (!wechatSetting.checkAppletOAuthParams()) { + log.error("getLoginInfo fail:checkAppletOAuthParams fail"); + return AjaxResult.error("getLoginInfo fail:checkAppletOAuthParams fail"); + } + WeChatAppletLoginResponse weChatAppletLoginResponse = WeChatAppletUtils.getLoginInfo(appletLoginRedisParamResponse.getCode(), wechatSetting); + if (Objects.isNull(weChatAppletLoginResponse)) { + log.error("getLoginInfo fail: getLoginInfo fail"); + return AjaxResult.error("getLoginInfo fail: getLoginInfo fail"); + } + appletLoginRedisParamResponse.setSessionKey(weChatAppletLoginResponse.getSession_key()); + appletLoginRedisParamResponse.setOpenId(weChatAppletLoginResponse.getOpenid()); + UmsMember member =memberService.queryCustomerByappletOpenId(weChatAppletLoginResponse.getOpenid()); + if (member!=null){ + appletLoginRedisParamResponse.setCustomerId(member.getId()); + appletLoginRedisParamResponse.setToken(sb.toString()); + redisService.putToRedis(sb.toString(), JSON.toJSONString(appletLoginRedisParamResponse)); + // redisService.putToRedis(loginParams.getMobile(), sb.toString()); + res.put("access_token", sb.toString()); + res.put("refresh_token", sb.toString()); + res.put("member", member); + }else { + member = new UmsMember(); + member.setSource("5"); + member.setMobile("123456789"); + member.setAppletOpenId(weChatAppletLoginResponse.getOpenid()); + member.setPassword("123456"); + memberService.addCustomer(member); + redisService.putToRedis(sb.toString(), JSON.toJSONString(appletLoginRedisParamResponse)); + // redisService.putToRedis(loginParams.getMobile(), sb.toString()); + res.put("access_token", sb.toString()); + res.put("refresh_token", sb.toString()); + res.put("member", member); + } + return AjaxResult.success(res); + + }*/ + /** + * 小程序获取登录信息 + * + * @param code 用户登录凭证(有效期五分钟)。开发者需要在开发者服务器后台调用 api,使用 code 换取 openid 和 session_key 等信息 + * @return 登录信息 + */ + /*@UnAuth + @ResponseBody + @RequestMapping("/getlogininfo") + @ApiOperation(value = "小程序获取登录信息", notes = "小程序获取登录信息(不需要认证)", httpMethod = "POST") + @ApiImplicitParams({ + @ApiImplicitParam(paramType = "form", dataType = "string", name = "code", value = "用户登录凭证"), + }) + @ApiResponses({ + @ApiResponse(code = 200, message = "登录信息", response = AppletLoginInfo.class) + }) + public AppletLoginInfo getLoginInfo(String code, HttpServletRequest request) { + String unionId = null; + if (!StringUtils.isEmpty(getToken(request))) { + unionId = Objects.isNull(getClaims(getToken(request))) ? null : getClaims(getToken(request)).getUnionId(); + redisService.delValue(getToken(request)); + } + return weChatAppletLoginService.getLoginInfo(code, unionId, appletLoginRedisParamResponse -> { + redisService.putToRedis(appletLoginRedisParamResponse.getToken(), JSON.toJSONString(appletLoginRedisParamResponse)); + if (appletLoginRedisParamResponse.hasUnionId()) { + redisService.putToRedis(appletLoginRedisParamResponse.getUnionId(), appletLoginRedisParamResponse.getToken()); + } + }); + }*/ + + /** + * 处理用户信息 + * + * @param weChatAppletUserInfo 小程序用户信息实体 + * @return 登录信息 + */ + /*@UnAuth + @ResponseBody + @RequestMapping("/dealuserinfo") + @ApiOperation(value = "处理用户信息", notes = "处理用户信息(不需要认证)", httpMethod = "POST") + public AppletLoginInfo dealUserInfo(WeChatAppletUserInfo weChatAppletUserInfo, HttpServletRequest request) { + String token = getToken(request); + Claims claims = getClaims(token); + return weChatAppletLoginService.dealUserInfo(weChatAppletUserInfo, claims.getOpenId(), claims.getSessionKey(), appletLoginRedisParamResponse -> afterDealUserInfo(claims, appletLoginRedisParamResponse, token)); + }*/ + + /** + * 绑定账号 + * + * @param loginParams 登录参数 + */ + /*@RequestMapping("/bindaccount") + @ResponseBody + @UnAuth + @ApiOperation(value = "绑定账号", notes = "绑定账号(不需要认证)", httpMethod = "POST") + @ApiImplicitParams({ + @ApiImplicitParam(paramType = "form", dataType = "string", name = "username", value = "用户名"), + @ApiImplicitParam(paramType = "form", dataType = "string", name = "password", value = "密码"), + }) + @ApiResponses({ + @ApiResponse(code = 200, message = "返回码 -1 用户名或密码错误 -2 账号冻结 -3 账号锁定 1 成功 -4 验证码错误", response = Integer.class) + }) + public AjaxResult bindAccount(@ApiIgnore LoginParams loginParams, HttpServletRequest request) { + //回调 + loginParams.setConsumer(customer -> + alterLoginSuccess(customer.getId(), request) + ); + return AjaxResult.success(loginService.login(loginParams)); + }*/ + + + /** + * 解绑账号 + * + * @return 1成功 + */ + /*@RequestMapping("/unbindaccount") + @ResponseBody + @ApiOperation(value = "解绑账号", notes = "解绑账号(需要认证)", httpMethod = "POST") + @ApiResponses({ + @ApiResponse(code = 200, message = "1成功", response = Integer.class) + }) + public int unbindAccount(HttpServletRequest request) { + weChatAppletLoginService.unbindAccount(AppletsLoginUtils.getInstance().getCustomerId(request), AppletsLoginUtils.getInstance().getUnionId(request)); + Claims claims = AppletsLoginUtils.getInstance().getClaims(request); + claims.setCustomerId(CommonConstant.NO_CUSTOMER_ID); + redisService.putToRedis(getToken(request), JSONObject.toJSONString(claims)); + return 1; + }*/ + + + /** + * 获取token + * + * @param request request + * @return token + */ + private String getToken(HttpServletRequest request) { + // 认证信息在header 中的key + final String authHeader = request.getHeader("Authorization"); + + if (Objects.isNull(authHeader) || !authHeader.startsWith("Bearer")) { + logger.info("getClaims fail :Authorization fail "); + throw new UnAuthorizedException(ResultCode.WX_NOT_AUTHORIZED); + } + String token = authHeader.length() >= 7 ? authHeader.substring(7) : authHeader.substring(6); +// logger.warn("get toke info from {}---{}({})", authHeader, token, token.length()); + return token; + } + + /** + * 获取小程序凭证实体 + * + * @param token token + * @return 小程序凭证实体 + */ + private Claims getClaims(String token) { + + Object claims = redisService.getCacheObject(token); + logger.debug("getClaims---token:{} Claims:{}", token, claims); + return ObjectUtils.isEmpty(claims) ? null : (Claims) claims; + } + + /** + * 处理小程序凭证信息 + * + * @param claims 小程序凭证实体 + * @param appletLoginRedisParamResponse 小程序redis参数返回实体 + * @param token token + */ + /*private void afterDealUserInfo(Claims claims, AppletLoginRedisParamResponse appletLoginRedisParamResponse, String token) { + if (Objects.nonNull(appletLoginRedisParamResponse)) { + claims.setCustomerId(appletLoginRedisParamResponse.getCustomerId()); + claims.setUnionId(appletLoginRedisParamResponse.getUnionId()); + redisService.putToRedis(token, JSON.toJSONString(claims)); + if (appletLoginRedisParamResponse.hasUnionId()) { + redisService.putToRedis(appletLoginRedisParamResponse.getUnionId(), token); + } + } else { + log.error("afterDealUserInfo fail:appletLoginRedisParamResponse is null"); + } + }*/ + + /** + * 登录成功后处理的事 + * + * @param customerId 用户id + */ + /*private void alterLoginSuccess(long customerId, HttpServletRequest request) { + if (!ObjectUtils.isEmpty(customerId)) { + Claims claims = getClaims(getToken(request)); + // 校验有没有uid 如果没有uid 则直接返回 + if (!claims.hasUnionId()) { + log.error("applets has not authorized"); + throw new UnAuthorizedException(ResultCode.WX_NOT_AUTHORIZED); + } + //绑定账号 + try { + weChatAppletLoginService.bindAccount(claims.getOpenId(), claims.getUnionId(), customerId); + } catch (ServiceException e) { + throw e; + } catch (Exception e) { + //捕获异常,可能已经绑定过账号 + WeChatCustomerLink weChatCustomerLink = weChatCustomerLinkService.queryWeChatCustomerLinkByUnionId(claims.getUnionId()); + if (Objects.nonNull(weChatCustomerLink)) { + customerId = weChatCustomerLink.getCustomerId(); + } else { + customerId = CommonConstant.NO_CUSTOMER_ID; + } + } + if (customerId == CommonConstant.NO_CUSTOMER_ID) { + claims.setCustomerId(customerId); + redisService.putToRedis(getToken(request), JSONObject.toJSONString(claims)); + } + } + }*/ + + /** + * token测试方法 + * + * @param token token + */ + @UnAuth + @ResponseBody + @RequestMapping("/tokentest") + @ApiOperation(value = "处理用户信息", notes = "处理用户信息(不需要认证)", httpMethod = "GET") + public AjaxResult token_test(@RequestBody String token, HttpServletRequest request) { + Object cacheObject = redisService.getCacheObject(token); + logger.warn("get token: {} for value: {}", token, cacheObject); + logger.warn("tokentest get claim: {}", getClaims(token).toString()); + return AjaxResult.success(cacheObject); + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/segchk/SegchkDefaultIndexController.java b/ruoyi-segchk-web/src/main/java/com/ruoyi/segchk/SegchkDefaultIndexController.java similarity index 75% rename from ruoyi-admin/src/main/java/com/ruoyi/web/controller/segchk/SegchkDefaultIndexController.java rename to ruoyi-segchk-web/src/main/java/com/ruoyi/segchk/SegchkDefaultIndexController.java index ef48212..7c79d3d 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/segchk/SegchkDefaultIndexController.java +++ b/ruoyi-segchk-web/src/main/java/com/ruoyi/segchk/SegchkDefaultIndexController.java @@ -1,10 +1,11 @@ -package com.ruoyi.web.controller.segchk; +package com.ruoyi.segchk; +import com.ruoyi.common.annotation.UnAuth; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.common.utils.StringUtils; import com.ruoyi.segchk.domain.*; -import com.ruoyi.segchk.service.ISegchkRecommenderIndexService; import com.ruoyi.segchk.service.ISegchkStoreIndexService; import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; @@ -29,14 +30,13 @@ public class SegchkDefaultIndexController extends BaseController @Autowired private ISegchkStoreIndexService segchkStoreIndexService; - @Autowired - private ISegchkRecommenderIndexService segchkRecommenderIndexService; /** * 根据用户当前所在地市行政id,返回运营商id 尹志颖 * { * "adcode": 110000 * } */ + @UnAuth @GetMapping("/getProviderByadcode") @ApiOperation(value = "查询运营商id", notes = "根据用户当前位置所在行政区代码或用户选择的行政区代码") @ApiImplicitParams({ @@ -70,9 +70,11 @@ public class SegchkDefaultIndexController extends BaseController * } * } */ - @GetMapping("/StoreSearch") + @UnAuth + @RequestMapping(value = "/StoreSearch",method = RequestMethod.POST) @ResponseBody - public TableDataInfo store_search(SegchkStoreWebReq segchkStoreWebReq) + @ApiOperation(value = "搜索商户", notes = "搜索商户(不需要认证)", httpMethod = "POST") + public TableDataInfo store_search(@RequestBody SegchkStoreWebReq segchkStoreWebReq) { startPage(); List list = segchkStoreIndexService.selectSegchkStoreSearch(segchkStoreWebReq); @@ -85,6 +87,7 @@ public class SegchkDefaultIndexController extends BaseController * "providerId": 4 * } */ + @UnAuth @GetMapping("/lableListByProvider") @ResponseBody public TableDataInfo lable_list_by_provider(Long providerId) @@ -103,10 +106,11 @@ public class SegchkDefaultIndexController extends BaseController * "userLat": 43.123456 * } */ - @GetMapping("/listByProvider") + @UnAuth + @RequestMapping(value = "/listByProvider",method = RequestMethod.POST) @ResponseBody @ApiOperation(value = "根据运营商id查询seg首页推荐商户列表", notes = "不需要鉴权") - public TableDataInfo list_by_provider(SegchkRecommenderStoreWebReq segchkRecommenderStoreWebReq) + public TableDataInfo list_by_provider(@RequestBody SegchkRecommenderStoreWebReq segchkRecommenderStoreWebReq) { startPage(); List list = segchkStoreIndexService.selectSegchkRecommenderStoreListByProvider(segchkRecommenderStoreWebReq); @@ -126,10 +130,11 @@ public class SegchkDefaultIndexController extends BaseController * "userLat": 39.684333 * } */ - @GetMapping("/listByProviderwithLable") + @UnAuth + @PostMapping("/listByProviderwithLable") @ResponseBody @ApiOperation(value = "根据标签id,搜索商户列表", notes = "不需要鉴权") - public TableDataInfo list_by_providerwith_lable(SegchkStoreWebReq segchkStoreWebReq) + public TableDataInfo list_by_providerwith_lable(@RequestBody SegchkStoreWebReq segchkStoreWebReq) { startPage(); List list = segchkStoreIndexService.selectSegchkStoreList(segchkStoreWebReq); @@ -142,7 +147,8 @@ public class SegchkDefaultIndexController extends BaseController * "providerId": 3 * } */ - @GetMapping("/getBannersByProvider") + @UnAuth + @PostMapping("/getBannersByProvider") @ResponseBody @ApiOperation(value = "根据运营商id,返回轮播图列表", notes = "不需要鉴权") public TableDataInfo get_banners_by_provider(Long providerId) @@ -164,28 +170,34 @@ public class SegchkDefaultIndexController extends BaseController * "storeId": 124 * } */ - @GetMapping("/storeDetails") + @UnAuth + @PostMapping("/storeDetails") @ResponseBody @ApiOperation(value = "根据运营商,商户id,查询商户详情", notes = "不需要鉴权") - public AjaxResult store_details(SegchkStoreWebReq segchkStoreWebReq) + public AjaxResult store_details(@RequestBody SegchkStoreWebReq segchkStoreWebReq, String recommenderId, String recommenderLevel) { // startPage(); - AjaxResult ajax = new AjaxResult(); - - ajax.put("code", 200); - SegchkStoreBasicInfoWebResp segchkStoreBasicInfoWebResp = segchkStoreIndexService.selectSegchkStoreDetails(segchkStoreWebReq); - ajax.put("value", segchkStoreBasicInfoWebResp); + AjaxResult ajax = AjaxResult.success("获取成功", segchkStoreBasicInfoWebResp); + if(!StringUtils.isEmpty(recommenderId) && !StringUtils.isEmpty(recommenderLevel)){ + int ret = segchkStoreIndexService.recommenderIsExit(recommenderId, recommenderLevel, segchkStoreWebReq.getProviderId().toString()); + if(ret == 1){ + ajax.put("recommenderId", recommenderId); + ajax.put("recommenderLevel", recommenderLevel); + } + logger.warn("the recommender: {}{} is {}", recommenderId, recommenderLevel, ret < 1 ? "not exit" : "exit"); + } return ajax; } /** * 查询seg商户评价列表 尹志颖 */ - @GetMapping("/storeCommentList") + @UnAuth + @PostMapping("/storeCommentList") @ResponseBody @ApiOperation(value = "查询seg商户评价列表", notes = "不需要鉴权") - public TableDataInfo store_comment_list(SegchkStoreWebReq segchkStoreWebReq) + public TableDataInfo store_comment_list(@RequestBody SegchkStoreWebReq segchkStoreWebReq) { startPage(); List segchkServiceCommentWebRespList = segchkStoreIndexService.selectSegchkStoreComments(segchkStoreWebReq); diff --git a/ruoyi-segchk-web/src/main/java/com/ruoyi/segchk/SegchkDefaultProviderController.java b/ruoyi-segchk-web/src/main/java/com/ruoyi/segchk/SegchkDefaultProviderController.java new file mode 100644 index 0000000..978f843 --- /dev/null +++ b/ruoyi-segchk-web/src/main/java/com/ruoyi/segchk/SegchkDefaultProviderController.java @@ -0,0 +1,203 @@ +package com.ruoyi.segchk; + +import com.ruoyi.appletsutil.ResultCode; +import com.ruoyi.appletsutil.UnAuthorizedException; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.common.core.redis.RedisCache; +import com.ruoyi.login.SegChkLoginController; +import com.ruoyi.segchk.domain.*; +import com.ruoyi.segchk.service.*; +import com.ruoyi.util.Claims; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.ObjectUtils; +import org.springframework.util.StringUtils; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Objects; + +/** + * seg首页推荐商户Controller + * + * @author yinzhiying + * @date 2021-08-23 + */ +@RestController +@RequestMapping("/default/provider") +@Api("运营商小程序接口") +public class SegchkDefaultProviderController extends BaseController +{ + @Autowired + private ISegchkStoreIndexService segchkStoreIndexService; + + @Autowired + private ISegchkUserIndexService segchkUserIndexService; + + @Autowired + private ISegchkProviderIndexService segchkProviderIndexService; + @Autowired + private RedisCache redisService; + + /** + * 查询seg用户中心信息 尹志颖 + * { + * "userId": 240,//* + * "providerId": 4,//* + * "userLevel": 2//* 0运营商,1商户,2用户 + * } + * } + */ +// @PreAuthorize("@ss.hasPermi('segchk:provider_info:query')") + @PostMapping("/storeUserInfo") + @ResponseBody + @ApiOperation(value = "查询seg运营商中心信息", notes = "需要鉴权") + public AjaxResult storeUserInfo(SegchkUserWebReq segchkUserWebReq) + { +// startPage(); + AjaxResult ajax = new AjaxResult(); + + ajax.put("code", 200); + + SegchkUserWebResp segchkUserWebResp = segchkUserWebReq.getUserLevel() == 2 ? + segchkUserIndexService.selectSegchkUserWebInfo(segchkUserWebReq) + : (segchkUserWebReq.getUserLevel() == 1 ? + segchkStoreIndexService.selectSegchkStoreWebInfo(segchkUserWebReq) : segchkProviderIndexService.selectSegchkProviderWebInfo(segchkUserWebReq)); + ajax.put("value", segchkUserWebResp); + return ajax; + } + + + /** + * 根据运营商id,角色等级,返回运营商下所有核消统计或售卡统计 尹志颖 + * { + * "providerId": 4,//* + * "staticMonth": "10",,//测试 + * "srcFlag": 0//*0核消汇总1售卡汇总 + * } + */ +// @PreAuthorize("@ss.hasPermi('segchk:provider_service_sale:list')") + @PostMapping("/providerServiceAndSaleList") + @ResponseBody + @ApiOperation(value = "根据运营商id,角色等级,返回运营商下所有核消统计或售卡统计", notes = "需要鉴权") + public TableDataInfo providerServiceAndSaleList(@RequestBody SegchkServiceAndSaleWebReq segchkServiceAndSaleWebReq, HttpServletRequest request) + { + Long userId = -1L; + Claims claims = null; + try { + claims = getClaims(getToken(request)); + if (ObjectUtils.isEmpty(claims)) { +// 如果用户未登录,则要求用户使用手机号登录注册 + userId = claims.getUserId(); + TableDataInfo tableDataInfo = new TableDataInfo(); + tableDataInfo.setCode(300); + tableDataInfo.setMsg("请先登录注册"); + return tableDataInfo; + } + } + catch (Exception e){ + TableDataInfo tableDataInfo = new TableDataInfo(); + tableDataInfo.setCode(300); + tableDataInfo.setMsg("请先登录注册"); + return tableDataInfo; + } + if(!StringUtils.isEmpty(segchkServiceAndSaleWebReq.getRemark())){ + segchkServiceAndSaleWebReq.setStaticMonth(segchkServiceAndSaleWebReq.getRemark()); + } + else if(!segchkServiceAndSaleWebReq.getProviderId().equals(claims.getUserId())){ +// segchkServiceAndSaleWebReq.setProviderId(claims.getUserId()); + logger.warn("providerServiceAndSaleList --- from provider: {} with toke: {}", segchkServiceAndSaleWebReq.getProviderId(), claims); + TableDataInfo tableDataInfo = new TableDataInfo(); + tableDataInfo.setCode(301); + tableDataInfo.setMsg("用户信息异常"); + return tableDataInfo; + } + startPage(); + List segchkServiceAndSaleWebRespList = segchkProviderIndexService.selectProviderServiceAndSaleList(segchkServiceAndSaleWebReq); + return getDataTable(segchkServiceAndSaleWebRespList); + } + + /** + * 根据运营商id,角色等级,返回运营商下核消统计或售卡统计 尹志颖 + * { + * "providerId": 4,//* + * "staticMonth": "2021-06-01",//* + * "srcFlag": 0//*0核消详情1售卡详情 + * } + */ +// @PreAuthorize("@ss.hasPermi('segchk:provider_service_sale:query')") + @PostMapping("/providerServiceAndSaleDetails") + @ResponseBody + @ApiOperation(value = "根据运营商id,角色等级,返回运营商下核消统计或售卡统计", notes = "需要鉴权") + public TableDataInfo providerServiceAndSaleDetails(@RequestBody SegchkServiceAndSaleWebReq segchkServiceAndSaleWebReq, HttpServletRequest request) + { + Long userId = -1L; + Claims claims = null; + try { + claims = getClaims(getToken(request)); + if (ObjectUtils.isEmpty(claims)) { +// 如果用户未登录,则要求用户使用手机号登录注册 + TableDataInfo tableDataInfo = new TableDataInfo(); + tableDataInfo.setCode(300); + tableDataInfo.setMsg("请先登录注册"); + return tableDataInfo; + } + } + catch (Exception e){ + TableDataInfo tableDataInfo = new TableDataInfo(); + tableDataInfo.setCode(300); + tableDataInfo.setMsg("请先登录注册"); + return tableDataInfo; + } + if(!StringUtils.isEmpty(segchkServiceAndSaleWebReq.getRemark())){ + segchkServiceAndSaleWebReq.setStaticMonth(segchkServiceAndSaleWebReq.getRemark()); + } + else if(!segchkServiceAndSaleWebReq.getProviderId().equals(claims.getUserId())){ +// segchkServiceAndSaleWebReq.setProviderId(claims.getUserId()); + logger.warn("providerServiceAndSaleList --- from provider: {} with toke: {}", segchkServiceAndSaleWebReq.getProviderId(), claims); + TableDataInfo tableDataInfo = new TableDataInfo(); + tableDataInfo.setCode(301); + tableDataInfo.setMsg("用户信息异常"); + return tableDataInfo; + } + startPage(); + List segchkServiceAndSaleDetailWebRespList = segchkProviderIndexService.selectProviderServiceAndSaleDetails(segchkServiceAndSaleWebReq); + return getDataTable(segchkServiceAndSaleDetailWebRespList); + } + + /** + * 获取token + * + * @param request request + * @return token + */ + private String getToken(HttpServletRequest request) { + // 认证信息在header 中的key + final String authHeader = request.getHeader("Authorization"); + + if (Objects.isNull(authHeader) || !authHeader.startsWith("Bearer")) { + logger.info("getClaims fail :Authorization fail "); + throw new UnAuthorizedException(ResultCode.WX_NOT_AUTHORIZED); + } + String token = authHeader.length() >= 7 ? authHeader.substring(7) : authHeader.substring(6); +// logger.warn("get toke info from {}---{}({})", authHeader, token, token.length()); + return token; + } + + /** + * 获取小程序凭证实体 + * + * @param token token + * @return 小程序凭证实体 + */ + private Claims getClaims(String token) { + + Object claims = redisService.getCacheObject(token); + logger.debug("getClaims---token:{} Claims:{}", token, claims); + return ObjectUtils.isEmpty(claims) ? null : (Claims) claims; + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/segchk/SegchkDefaultStoreController.java b/ruoyi-segchk-web/src/main/java/com/ruoyi/segchk/SegchkDefaultStoreController.java similarity index 62% rename from ruoyi-admin/src/main/java/com/ruoyi/web/controller/segchk/SegchkDefaultStoreController.java rename to ruoyi-segchk-web/src/main/java/com/ruoyi/segchk/SegchkDefaultStoreController.java index 935bf02..c134504 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/segchk/SegchkDefaultStoreController.java +++ b/ruoyi-segchk-web/src/main/java/com/ruoyi/segchk/SegchkDefaultStoreController.java @@ -1,27 +1,28 @@ -package com.ruoyi.web.controller.segchk; +package com.ruoyi.segchk; +import com.ruoyi.appletsutil.ResultCode; +import com.ruoyi.appletsutil.UnAuthorizedException; import com.ruoyi.common.annotation.Log; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.page.TableDataInfo; -import com.ruoyi.common.core.text.Convert; +import com.ruoyi.common.core.redis.RedisCache; import com.ruoyi.common.enums.BusinessType; import com.ruoyi.segchk.domain.*; import com.ruoyi.segchk.service.*; +import com.ruoyi.util.Claims; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.bind.annotation.RestController; -import org.springframework.web.servlet.view.RedirectView; +import org.springframework.util.ObjectUtils; +import org.springframework.util.StringUtils; +import org.springframework.web.bind.annotation.*; -import java.math.BigDecimal; +import javax.servlet.http.HttpServletRequest; import java.util.List; +import java.util.Objects; import static com.ruoyi.common.core.domain.AjaxResult.*; @@ -45,6 +46,12 @@ public class SegchkDefaultStoreController extends BaseController @Autowired private ISegchkProviderIndexService segchkProviderIndexService; + + /** + * 注入redis服务 + */ + @Autowired + private RedisCache redisService; /** * 查询seg用户中心信息 尹志颖 * { @@ -90,8 +97,20 @@ public class SegchkDefaultStoreController extends BaseController @PostMapping("/storeServiceAndSaleList") @ResponseBody @ApiOperation(value = "根据商家id,运营商id,角色等级,返回核消统计或售卡统计", notes = "需要鉴权") - public TableDataInfo store_service_and_sale_list(SegchkServiceAndSaleWebReq segchkServiceAndSaleWebReq) + public TableDataInfo store_service_and_sale_list(@RequestBody SegchkServiceAndSaleWebReq segchkServiceAndSaleWebReq, HttpServletRequest request) { + Claims claims = getClaims(getToken(request)); + if (ObjectUtils.isEmpty(claims)) { +// 如果用户未登录,则要求用户使用手机号登录注册 + TableDataInfo tableDataInfo = new TableDataInfo(); + tableDataInfo.setCode(300); + tableDataInfo.setMsg("请先登录注册"); + return tableDataInfo; + } + if(StringUtils.isEmpty(segchkServiceAndSaleWebReq.getRemark())){ + segchkServiceAndSaleWebReq.setStoreId(claims.getUserId()); + segchkServiceAndSaleWebReq.setProviderId(claims.getProviderId()); + } startPage(); List segchkServiceAndSaleWebRespList = segchkStoreIndexService.selectStoreServiceAndSaleList(segchkServiceAndSaleWebReq); return getDataTable(segchkServiceAndSaleWebRespList); @@ -110,8 +129,20 @@ public class SegchkDefaultStoreController extends BaseController @PostMapping("/storeServiceAndSaleDetails") @ResponseBody @ApiOperation(value = "根据商家id,运营商id,角色等级,返回核消统计或售卡统计", notes = "需要鉴权") - public TableDataInfo store_service_and_sale_details(SegchkServiceAndSaleWebReq segchkServiceAndSaleWebReq) + public TableDataInfo store_service_and_sale_details(@RequestBody SegchkServiceAndSaleWebReq segchkServiceAndSaleWebReq, HttpServletRequest request) { + Claims claims = getClaims(getToken(request)); + if (ObjectUtils.isEmpty(claims)) { +// 如果用户未登录,则要求用户使用手机号登录注册 + TableDataInfo tableDataInfo = new TableDataInfo(); + tableDataInfo.setCode(300); + tableDataInfo.setMsg("请先登录注册"); + return tableDataInfo; + } + if(StringUtils.isEmpty(segchkServiceAndSaleWebReq.getRemark())){ + segchkServiceAndSaleWebReq.setStoreId(claims.getUserId()); + segchkServiceAndSaleWebReq.setProviderId(claims.getProviderId()); + } startPage(); List segchkServiceAndSaleDetailWebRespList = segchkStoreIndexService.selectStoreServiceAndSaleDetails(segchkServiceAndSaleWebReq); return getDataTable(segchkServiceAndSaleDetailWebRespList); @@ -130,8 +161,20 @@ public class SegchkDefaultStoreController extends BaseController @PostMapping("/storeUserLikeGoList") @ResponseBody @ApiOperation(value = "根据商家id,运营商id,返回针对该商家的预约列表", notes = "需要鉴权") - public TableDataInfo store_user_like_go_list(SegchkServiceAndSaleWebReq segchkServiceAndSaleWebReq) + public TableDataInfo store_user_like_go_list(@RequestBody SegchkServiceAndSaleWebReq segchkServiceAndSaleWebReq, HttpServletRequest request) { + Claims claims = getClaims(getToken(request)); + if (ObjectUtils.isEmpty(claims)) { +// 如果用户未登录,则要求用户使用手机号登录注册 + TableDataInfo tableDataInfo = new TableDataInfo(); + tableDataInfo.setCode(300); + tableDataInfo.setMsg("请先登录注册"); + return tableDataInfo; + } + if(StringUtils.isEmpty(segchkServiceAndSaleWebReq.getRemark())){ + segchkServiceAndSaleWebReq.setStoreId(claims.getUserId()); + segchkServiceAndSaleWebReq.setProviderId(claims.getProviderId()); + } startPage(); List segchkUserLikeGoWebRespList = segchkStoreIndexService.selectStoreUserLikeGoList(segchkServiceAndSaleWebReq); return getDataTable(segchkUserLikeGoWebRespList); @@ -150,8 +193,20 @@ public class SegchkDefaultStoreController extends BaseController @PostMapping("/storeCashList") @ResponseBody @ApiOperation(value = "根据用户id,运营商id,查询seg商户提现列表", notes = "需要鉴权") - public TableDataInfo store_cash_list(SegchkUserWebReq segchkUserWebReq) + public TableDataInfo store_cash_list(@RequestBody SegchkUserWebReq segchkUserWebReq, HttpServletRequest request) { + Claims claims = getClaims(getToken(request)); + if (ObjectUtils.isEmpty(claims)) { +// 如果用户未登录,则要求用户使用手机号登录注册 + TableDataInfo tableDataInfo = new TableDataInfo(); + tableDataInfo.setCode(300); + tableDataInfo.setMsg("请先登录注册"); + return tableDataInfo; + } + if(StringUtils.isEmpty(segchkUserWebReq.getRemark())){ + segchkUserWebReq.setUserId(claims.getUserId()); + segchkUserWebReq.setProviderId(claims.getProviderId()); + } startPage(); List segchkUserWebSCRespList = segchkStoreIndexService.selectStoreCashList(segchkUserWebReq); return getDataTable(segchkUserWebSCRespList); @@ -170,8 +225,19 @@ public class SegchkDefaultStoreController extends BaseController @PostMapping( "/ServiceCheckTest") @ResponseBody @Transactional(propagation = Propagation.REQUIRED) - public AjaxResult service_check_test(Long likegoId, String storeId) + public AjaxResult service_check_test(Long likegoId, String storeId, String remark, HttpServletRequest request) { + Claims claims = getClaims(getToken(request)); + if (ObjectUtils.isEmpty(claims)) { +// 如果用户未登录,则要求用户使用手机号登录注册 + return AjaxResult.error(300, "请先登录注册"); + } + if(StringUtils.isEmpty(remark)){ + if(!storeId.equals(claims.getUserId())){ + logger.warn("ServiceCheckTest---storeid: {} is not then token: {}", storeId, claims); + return AjaxResult.error(300, "请先登录注册"); + } + } AjaxResult ajax = new AjaxResult(); SegchkServiceOrderChkTestResp segchkServiceOrderChkTestResp = segchkUserIndexService.selectUserOrderPredInfo(likegoId); @@ -223,7 +289,7 @@ public class SegchkDefaultStoreController extends BaseController /** - * 提现结果回调接口,接口微信的支付结果,更新充值结果, ret 0成功,其他失败 + * 提现结果回调接口,接口微信的支付结果,更新充值结果, ret 0成功,其他失败 未测试 * { * "chargeId": "45435", * "userLevel": "1/2/0", @@ -243,4 +309,35 @@ public class SegchkDefaultStoreController extends BaseController segchkUserIndexService.cashRet(chargeId, ret); } } + + + /** + * 获取小程序凭证实体 + * + * @param token token + * @return 小程序凭证实体 + */ + private Claims getClaims(String token) { + + Object claims = redisService.getCacheObject(token); + logger.debug("getClaims---token:{} Claims:{}", token, claims); + return ObjectUtils.isEmpty(claims) ? null : (Claims) claims; + } + + /** + * 获取token + * + * @param request request + * @return token + */ + private String getToken(HttpServletRequest request) { + // 认证信息在header 中的key + final String authHeader = request.getHeader("Authorization"); + + if (Objects.isNull(authHeader) || !authHeader.startsWith("Bearer")) { + logger.info("getClaims fail :Authorization fail "); + throw new UnAuthorizedException(ResultCode.WX_NOT_AUTHORIZED); + } + return authHeader.length() >= 7 ? authHeader.substring(7) : authHeader.substring(6); + } } diff --git a/ruoyi-segchk-web/src/main/java/com/ruoyi/segchk/SegchkDefaultUserController.java b/ruoyi-segchk-web/src/main/java/com/ruoyi/segchk/SegchkDefaultUserController.java new file mode 100644 index 0000000..1f0a619 --- /dev/null +++ b/ruoyi-segchk-web/src/main/java/com/ruoyi/segchk/SegchkDefaultUserController.java @@ -0,0 +1,889 @@ +package com.ruoyi.segchk; + +import com.alibaba.fastjson.JSONObject; +import com.ruoyi.appletsutil.ResultCode; +import com.ruoyi.appletsutil.UnAuthorizedException; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.annotation.UnAuth; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.domain.BaseEntity; +import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.common.core.redis.RedisCache; +import com.ruoyi.common.core.text.Convert; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.segchk.domain.*; +import com.ruoyi.segchk.service.*; +import com.ruoyi.util.Claims; +import com.ruoyi.util.CommonResponse; +import com.ruoyi.util.WechatUtils; +import com.ruoyi.util.bean.PrepayResult; +import com.ruoyi.util.bean.WechatApletPrepayResult; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.ObjectUtils; +import org.springframework.util.StringUtils; +import org.springframework.web.bind.annotation.*; +import springfox.documentation.annotations.ApiIgnore; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.io.PrintWriter; +import java.math.BigDecimal; +import java.util.List; +import java.util.Objects; + +import static com.ruoyi.common.core.domain.AjaxResult.*; +import static com.ruoyi.common.utils.ip.IpUtils.getIpAddr; + +/** + * seg首页推荐商户Controller + * + * @author yinzhiying + * @date 2021-08-23 + */ +@RestController +@RequestMapping("/default/user") +@Api("用户小程序接口") +public class SegchkDefaultUserController extends BaseController +{ + @Autowired + private ISegchkStoreIndexService segchkStoreIndexService; + @Autowired + private ISegchkUserCollectService segchkUserCollectService; + + @Autowired + private ISegchkUserLikegoService segchkUserLikegoService; + + @Autowired + private ISegchkUserIndexService segchkUserIndexService; + + @Autowired + private ISegchkProviderIndexService segchkProviderIndexService; + + @Autowired + private ISegchkUserChargeService segchkUserChargeService; + + + /** + * 注入redis服务 + */ + @Autowired + private RedisCache redisService; + /** + * 新增保存seg用户收藏记录 + * { + * "collectType": "1",//* + * "providerId": 0,//* + * "userId": 0,//* + * "storeId": 0,//* + * "modTime": "2021-08-16 13:43:43", + * "mgtState": 0//* + * } + */ +// @PreAuthorize("@ss.hasPermi('segchk:user_collect:add')") + @UnAuth + @Log(title = "seg用户收藏记录", businessType = BusinessType.INSERT) + @PostMapping("/addUserCollect") + @ResponseBody + @ApiOperation(value = "添加seg用户收藏记录", notes = "需要鉴权") + public AjaxResult add_user_collect(@RequestBody SegchkUserCollect segchkUserCollect, HttpServletRequest request) + { + Long userId = 0L; + Claims claims = getClaims(getToken(request)); + if (ObjectUtils.isEmpty(claims)) { +// 如果用户未登录,则要求用户使用手机号登录注册 + userId = getClaims(getToken(request)).getUserId(); + return AjaxResult.error(300, "请先登录注册"); + } + if(StringUtils.isEmpty(segchkUserCollect.getRemark())){ + /*if(!segchkUserCollect.getUserId().equals(claims.getUserId())){ + return AjaxResult.error(301, "用户异常"); + }*/ + segchkUserCollect.setUserId(claims.getUserId()); + segchkUserCollect.setProviderId(claims.getProviderId()); + } + return toAjax(segchkUserCollectService.insertSegchkUserCollect(segchkUserCollect)); + } + + + /** + * 删除seg用户收藏记录 + */ +// @PreAuthorize("@ss.hasPermi('segchk:user_collect:remove')") + @UnAuth + @Log(title = "删除seg用户收藏记录", businessType = BusinessType.DELETE) + @PostMapping( "/removeUserCollect") + @ResponseBody + @ApiOperation(value = "删除seg用户收藏记录", notes = "需要鉴权") + public AjaxResult removeUserCollect(@RequestBody RemoveIds removeIds, HttpServletRequest request) + { + Long userId = 0L; + Claims claims = getClaims(getToken(request)); + if (ObjectUtils.isEmpty(claims)) { +// 如果用户未登录,则要求用户使用手机号登录注册 + userId = getClaims(getToken(request)).getUserId(); + return AjaxResult.error(300, "请先登录注册"); + } + return toAjax(segchkUserCollectService.deleteSegchkUserCollectByIds(removeIds.getIds())); + } + + /** + * 根据运营商id,用户id,商户id,查询该用户在该商户可使用的会员卡或优惠券 尹志颖 + * { + * "providerId": 4, + * "storeId": 128, + * "userId": 245 + * } + */ + @UnAuth + @Log(title = "查询该用户在该商户可使用的会员卡或优惠券", businessType = BusinessType.GENCODE) + @PostMapping("/userOrderPredList") + @ResponseBody + public TableDataInfo UserOrderPredList(@RequestBody SegchkServiceOrderWebReq segchkServiceOrderWebReq, HttpServletRequest request) + { + Claims claims = getClaims(getToken(request)); + if (ObjectUtils.isEmpty(claims)) { +// 如果用户未登录,则要求用户使用手机号登录注册 + TableDataInfo tableDataInfo = new TableDataInfo(); + tableDataInfo.setCode(300); + tableDataInfo.setMsg("请先登录注册"); + return tableDataInfo; + } + if(StringUtils.isEmpty(segchkServiceOrderWebReq.getRemark())){ + segchkServiceOrderWebReq.setUserId(claims.getUserId()); + } + startPage(); + List segchkServiceOrderWebReqList = segchkUserIndexService.selectUserOrderPredCardListWebInfo(segchkServiceOrderWebReq); + return getDataTable(segchkServiceOrderWebReqList); + } + + /** + * 新增保存seg用户想去记录 + * { + * "providerId": 4,//* + * "userId": 231,//* + * "storeId": 128,//* + * "cardId": 230,//* + * "cardType": 0 //* 0充值卡2优惠券1赠卡 + * } + */ +// @PreAuthorize("@ss.hasPermi('segchk:user_likego:add')") + @UnAuth + @Log(title = "seg用户想去记录", businessType = BusinessType.INSERT) + @PostMapping("/addOrderUserLikego") + @ResponseBody + @ApiOperation(value = "添加seg用户想去记录", notes = "需要鉴权") + public AjaxResult add_order_user_likego(@RequestBody SegchkUserLikego segchkUserLikego, HttpServletRequest request) + { + Long userId = 0L; + Claims claims = getClaims(getToken(request)); + if (ObjectUtils.isEmpty(claims)) { +// 如果用户未登录,则要求用户使用手机号登录注册 + userId = getClaims(getToken(request)).getUserId(); + return AjaxResult.error(300, "请先登录注册"); + } + if(StringUtils.isEmpty(segchkUserLikego.getRemark())){ + segchkUserLikego.setUserId(claims.getUserId()); + segchkUserLikego.setProviderId(claims.getProviderId()); + } + return toAjax(segchkUserLikegoService.insertSegchkUserLikego(segchkUserLikego)); + } + + /** + * 查询seg用户中心信息 尹志颖 + * { + * "userId": 240,//* + * "providerId": 4,//* + * "userLevel": 2//* 0运营商,1商户,2用户 + * } + * } + */ +// @PreAuthorize("@ss.hasPermi('segchk:user_info:query')") + @UnAuth + @PostMapping("/storeUserInfo") + @ResponseBody + @ApiOperation(value = "查询seg用户中心信息", notes = "需要鉴权") + public AjaxResult store_user_info(SegchkUserWebReq segchkUserWebReq) + { +// startPage(); + AjaxResult ajax = new AjaxResult(); + + ajax.put("code", 200); + + SegchkUserWebResp segchkUserWebResp = segchkUserWebReq.getUserLevel() == 2 ? + segchkUserIndexService.selectSegchkUserWebInfo(segchkUserWebReq) + : (segchkUserWebReq.getUserLevel() == 1 ? + segchkStoreIndexService.selectSegchkStoreWebInfo(segchkUserWebReq) : segchkProviderIndexService.selectSegchkProviderWebInfo(segchkUserWebReq)); + ajax.put("value", segchkUserWebResp); + return ajax; +// return getDataTable(segchkServiceCommentWebRespList); + } + + + /** + * 根据用户id,运营商id,查询seg用户核消列表 尹志颖 + * { + * "userId": 245,//* + * "providerId": 4//* + * } + */ +// @PreAuthorize("@ss.hasPermi('segchk:user_check:list')") + @UnAuth + @PostMapping("/storeServiceCheckList") + @ResponseBody + @ApiOperation(value = "查询seg用户核消列表", notes = "需要鉴权") + public TableDataInfo store_service_check_list(@RequestBody SegchkUserWebReq segchkUserWebReq, HttpServletRequest request) + { + Long userId = 0L; + Claims claims = getClaims(getToken(request)); + if (ObjectUtils.isEmpty(claims)) { +// 如果用户未登录,则要求用户使用手机号登录注册 + userId = getClaims(getToken(request)).getUserId(); + TableDataInfo tableDataInfo = new TableDataInfo(); + tableDataInfo.setCode(300); + tableDataInfo.setMsg("请先登录注册"); + return tableDataInfo; + } + if(StringUtils.isEmpty(segchkUserWebReq.getRemark())){ + segchkUserWebReq.setUserId(claims.getUserId()); + } + startPage(); + + List segchkUserWebSCRespList = segchkUserIndexService.selectUserServiceCHKList(segchkUserWebReq); + return getDataTable(segchkUserWebSCRespList); + } + + /** + * 根据用户id,运营商id,查询seg用户可用会员卡列表或者优惠券列表 尹志颖 + */ +// @PreAuthorize("@ss.hasPermi('segchk:user_card:list')") + @UnAuth + @PostMapping("/userCardList") + @ResponseBody + @ApiOperation(value = "查询seg用户可用会员卡列表或者优惠券列表", notes = "需要鉴权") + public TableDataInfo user_card_list(@RequestBody SegchkUserWebReq segchkUserWebReq, HttpServletRequest request) + { + Long userId = 0L; + Claims claims = getClaims(getToken(request)); + if (ObjectUtils.isEmpty(claims)) { +// 如果用户未登录,则要求用户使用手机号登录注册 + userId = getClaims(getToken(request)).getUserId(); + TableDataInfo tableDataInfo = new TableDataInfo(); + tableDataInfo.setCode(300); + tableDataInfo.setMsg("请先登录注册"); + return tableDataInfo; + } + if(StringUtils.isEmpty(segchkUserWebReq.getRemark())){ + segchkUserWebReq.setUserId(claims.getUserId()); + } + startPage(); + + List segchkUserWebSCRespList = segchkUserIndexService.selectUserCardList(segchkUserWebReq); + return getDataTable(segchkUserWebSCRespList); + } + + + /** + * 根据用户id,运营商id,查询seg用户收藏列表 尹志颖 + * { + * "userId": 439,//* + * "providerId": 4//* + * } + */ +// @PreAuthorize("@ss.hasPermi('segchk:user_collect:list')") + @UnAuth + @PostMapping("/userCollectList") + @ResponseBody + @ApiOperation(value = "查询seg用户收藏列表", notes = "需要鉴权") + public TableDataInfo user_collect_list(@RequestBody SegchkUserWebReq segchkUserWebReq, HttpServletRequest request) + { + Long userId = 0L; + Claims claims = getClaims(getToken(request)); + if (ObjectUtils.isEmpty(claims)) { +// 如果用户未登录,则要求用户使用手机号登录注册 + userId = getClaims(getToken(request)).getUserId(); + TableDataInfo tableDataInfo = new TableDataInfo(); + tableDataInfo.setCode(300); + tableDataInfo.setMsg("请先登录注册"); + return tableDataInfo; + } + if(StringUtils.isEmpty(segchkUserWebReq.getRemark())){ + segchkUserWebReq.setUserId(claims.getUserId()); + } + startPage(); + + List segchkUserWebSCRespList = segchkUserIndexService.selectUserCollectList(segchkUserWebReq); + return getDataTable(segchkUserWebSCRespList); + } + + + /** + * 根据用户id,运营商id,查询seg用户预约单列表 尹志颖 + * { + * "userId": 234,//* + * "providerId": 4,//* + * "userLevel": 0//测试用 + * } + */ +// @PreAuthorize("@ss.hasPermi('segchk:user_likego:list')") + @UnAuth + @PostMapping("/userLikeGOList") + @ResponseBody + @ApiOperation(value = "查询seg用户预约单列表", notes = "需要鉴权") + public TableDataInfo userLikeGOList(@RequestBody SegchkUserWebReq segchkUserWebReq, HttpServletRequest request) + { + Long userId = 0L; + Claims claims = getClaims(getToken(request)); + if (ObjectUtils.isEmpty(claims)) { +// 如果用户未登录,则要求用户使用手机号登录注册 + userId = getClaims(getToken(request)).getUserId(); + TableDataInfo tableDataInfo = new TableDataInfo(); + tableDataInfo.setCode(300); + tableDataInfo.setMsg("请先登录注册"); + return tableDataInfo; + } + if(StringUtils.isEmpty(segchkUserWebReq.getRemark())){ + segchkUserWebReq.setUserId(claims.getUserId()); + } + startPage(); + List segchkUserWebSCRespList = segchkUserIndexService.selectUserLikGoList(segchkUserWebReq); + return getDataTable(segchkUserWebSCRespList); + } + + + /** + * 删除seg用户想去记录 + */ +// @PreAuthorize("@ss.hasPermi('segchk:user_likego:remove')") + @Log(title = "seg用户想去记录", businessType = BusinessType.DELETE) + @PostMapping( "/removeOrderUserLikego") + @ResponseBody + @ApiOperation(value = "删除seg用户想去记录", notes = "需要鉴权") + public AjaxResult removeOrderUserLikego(@RequestBody RemoveIds removeIds, HttpServletRequest request) + { + Long userId = 0L; + Claims claims = getClaims(getToken(request)); + if (ObjectUtils.isEmpty(claims)) { +// 如果用户未登录,则要求用户使用手机号登录注册 + userId = getClaims(getToken(request)).getUserId(); + return AjaxResult.error(300, "请先登录注册"); + } + if(StringUtils.isEmpty(removeIds.getRemark())){ + removeIds.setUserId(claims.getUserId()); + } + return toAjax(segchkUserLikegoService.deleteSegchkUserLikegoByLikegoIds(Convert.toLongArray(removeIds.getIds()))); + } + + /** + * seg服务评价查询 + * { + * "commentId": 3//* + * } + */ +// @PreAuthorize("@ss.hasPermi('segchk:user_comment:query')") + @Log(title = "seg服务评价查看", businessType = BusinessType.OTHER) + @PostMapping( "/getComment") + @ResponseBody + @ApiOperation(value = "seg服务评价查询", notes = "需要鉴权") + public AjaxResult get_comment(@RequestBody SegchkServiceCommentUserReq segchkServiceCommentUserReq, HttpServletRequest request) + { + Long userId = 0L; + Claims claims = getClaims(getToken(request)); + if (ObjectUtils.isEmpty(claims)) { +// 如果用户未登录,则要求用户使用手机号登录注册 + userId = getClaims(getToken(request)).getUserId(); + return AjaxResult.error(300, "请先登录注册"); + } + AjaxResult ajax = new AjaxResult(); + SegchkServiceComment segchkServiceComment = segchkUserIndexService.selectSegchkServiceComment(segchkServiceCommentUserReq); + if(segchkServiceComment == null){ + ajax.put(CODE_TAG, "300"); + ajax.put(MSG_TAG, "未查到相关评价"); + } + else{ + ajax.put(CODE_TAG, "200"); + ajax.put(DATA_TAG, segchkServiceComment); + } + return ajax; + } + + + /** + * seg服务评价提交 + */ +// @PreAuthorize("@ss.hasPermi('segchk:user_comment:add')") + @Log(title = "seg服务评价提交", businessType = BusinessType.INSERT) + @PostMapping( "/addComment") + @ResponseBody + @ApiOperation(value = "seg服务评价提交", notes = "需要鉴权") + public AjaxResult addComment(@RequestBody SegchkServiceCommentUserReq segchkServiceCommentUserReq, HttpServletRequest request) + { + Long userId = 0L; + Claims claims = getClaims(getToken(request)); + if (ObjectUtils.isEmpty(claims)) { +// 如果用户未登录,则要求用户使用手机号登录注册 + userId = getClaims(getToken(request)).getUserId(); + return AjaxResult.error(300, "请先登录注册"); + } + return toAjax(segchkUserIndexService.insertSegchkServiceComment(segchkServiceCommentUserReq)); + } + + + /** + * 根据用户id,运营商id,查询seg用户充值列表 尹志颖 + * { + * "userId": 34,//* + * "providerId": 2//* + * } + */ +// @PreAuthorize("@ss.hasPermi('segchk:user_charge:list')") + @PostMapping("/userChargeList") + @ResponseBody + @ApiOperation(value = "查询seg用户充值列表", notes = "需要鉴权") + public TableDataInfo userChargeList(@RequestBody SegchkUserWebReq segchkUserWebReq, HttpServletRequest request) + { + Long userId = 0L; + Claims claims = getClaims(getToken(request)); + if (ObjectUtils.isEmpty(claims)) { +// 如果用户未登录,则要求用户使用手机号登录注册 + userId = getClaims(getToken(request)).getUserId(); + TableDataInfo tableDataInfo = new TableDataInfo(); + tableDataInfo.setCode(300); + tableDataInfo.setMsg("请先登录注册"); + return tableDataInfo; + } + if(StringUtils.isEmpty(segchkUserWebReq.getRemark())){ + segchkUserWebReq.setUserId(claims.getUserId()); + } + startPage(); + List segchkUserWebSCRespList = segchkUserIndexService.selectUserChargeList(segchkUserWebReq); + return getDataTable(segchkUserWebSCRespList); + } + + + /** + * 根据用户id,运营商id,查询seg用户提现列表 尹志颖 + */ +// @PreAuthorize("@ss.hasPermi('segchk:user_cash:list')") + @PostMapping("/userCashList") + @ResponseBody + @ApiOperation(value = "查询seg用户提现列表", notes = "需要鉴权") + public TableDataInfo userCashList(@RequestBody SegchkUserWebReq segchkUserWebReq, HttpServletRequest request) + { + Long userId = 0L; + Claims claims = getClaims(getToken(request)); + if (ObjectUtils.isEmpty(claims)) { +// 如果用户未登录,则要求用户使用手机号登录注册 + userId = getClaims(getToken(request)).getUserId(); + TableDataInfo tableDataInfo = new TableDataInfo(); + tableDataInfo.setCode(300); + tableDataInfo.setMsg("请先登录注册"); + return tableDataInfo; + } + if(StringUtils.isEmpty(segchkUserWebReq.getRemark())){ + segchkUserWebReq.setUserId(claims.getUserId()); + } + startPage(); + List segchkUserWebSCRespList = segchkUserIndexService.selectUserCashList(segchkUserWebReq); + return getDataTable(segchkUserWebSCRespList); + } + + + /** + * 根据用户id,运营商id,角色等级查询seg用户消息列表 尹志颖 + * { + * "userId": 392,//* + * "providerId": 4,//* + * "userLevel": 2,//* + * "phoneNo": 1//测试 + * } + */ +// @PreAuthorize("@ss.hasPermi('segchk:user_msg:list')") + @PostMapping("/userMsgList") + @ResponseBody + @ApiOperation(value = "查询seg用户消息列表", notes = "需要鉴权") + public TableDataInfo userMsgList(@RequestBody SegchkUserWebReq segchkUserWebReq, HttpServletRequest request) + { + Long userId = 0L; + Claims claims = getClaims(getToken(request)); + if (ObjectUtils.isEmpty(claims)) { +// 如果用户未登录,则要求用户使用手机号登录注册 + userId = getClaims(getToken(request)).getUserId(); + TableDataInfo tableDataInfo = new TableDataInfo(); + tableDataInfo.setCode(300); + tableDataInfo.setMsg("请先登录注册"); + return tableDataInfo; + } + if(StringUtils.isEmpty(segchkUserWebReq.getRemark())){ + segchkUserWebReq.setUserId(claims.getUserId()); + } + startPage(); + List segchkUserWebSCRespList = segchkUserIndexService.selectUserMsgList(segchkUserWebReq); + return getDataTable(segchkUserWebSCRespList); + } + + + /** + * 用户进入余额充值页面时,根据用户id,运营商id查询可充值 的卡 + * { + * "userId": 465, + * "providerId": 4 + * } + */ +// @PreAuthorize("@ss.hasPermi('segchk:user_charge:add')") + @PostMapping( "/userChargePre") + @ResponseBody + @ApiOperation(value = "查询seg用户可充值列表", notes = "需要鉴权") + public AjaxResult userChargePre(@RequestBody SegchkUserWebReq segchkUserWebReq, HttpServletRequest request) + { + Long userId = 0L; + Claims claims = getClaims(getToken(request)); + if (ObjectUtils.isEmpty(claims)) { +// 如果用户未登录,则要求用户使用手机号登录注册 +// userId = getClaims(getToken(request)).getUserId(); + return AjaxResult.error(300, "请先登录注册"); + } + if(StringUtils.isEmpty(segchkUserWebReq.getRemark())){ + segchkUserWebReq.setUserLevel(claims.getUserLevel()); + segchkUserWebReq.setUserId(claims.getUserId()); + segchkUserWebReq.setProviderId(claims.getProviderId()); + } + + + List segchkUserChargeCards = segchkUserIndexService.SegchkUserChargePre(segchkUserWebReq); + AjaxResult ajax = new AjaxResult(); + + if(segchkUserChargeCards == null){ + ajax.put(CODE_TAG, "300"); + } + else{ + ajax.put(CODE_TAG, "200"); + ajax.put(DATA_TAG, segchkUserChargeCards); + } + return ajax; + } + + /** + * 用户进入余额充值页面时,根据用户id,运营商id查询可充值的卡,生成充值记录 未测试 + * { + * "userId": 465, + * "charge": 299.0, + * "accountUsed": 10.0, + * "cardTypeId": 1, + * "providerId": 4 + * } + */ +// @PreAuthorize("@ss.hasPermi('segchk:user_charge:pre')") + @PostMapping( "/userChargeReq") + @ResponseBody + @ApiOperation(value = "seg用户可充值", notes = "需要鉴权") + public AjaxResult userChargeReq(@RequestBody SegchkUserCharge segchkUserCharge, HttpServletRequest request) + { + Long userId = 0L; + Claims claims = getClaims(getToken(request)); + if (ObjectUtils.isEmpty(claims)) { +// 如果用户未登录,则要求用户使用手机号登录注册 + userId = getClaims(getToken(request)).getUserId(); + return AjaxResult.error(300, "请先登录注册"); + } + if(StringUtils.isEmpty(segchkUserCharge.getRemark())){ + segchkUserCharge.setUserId(claims.getUserId()); + segchkUserCharge.setProviderId(claims.getProviderId()); + } + AjaxResult ajax = new AjaxResult(); +// logger.debug(segchkUserCharge.getAccountUsed()); + if(segchkUserCharge.getAccountUsed() != null && segchkUserCharge.getAccountUsed().compareTo(new BigDecimal(0.0)) == 1) { + BigDecimal user_account = segchkUserIndexService.getAccount(segchkUserCharge); + if(user_account == null || user_account.compareTo(segchkUserCharge.getAccountUsed()) == -1){ + ajax.put(CODE_TAG, "500"); + ajax.put(MSG_TAG, "余额不足!"); + return ajax; + } + } + int ret = segchkUserChargeService.insertSegchkUserCharge(segchkUserCharge); + if(ret < 1){ + ajax.put(CODE_TAG, "500"); + ajax.put(MSG_TAG, "充值失败!"); + } + else{ + CommonResponse prepayResultCommonResponse = segchkUserIndexService.wechatAppletPay( + segchkUserCharge.getChargeId().toString() + , segchkUserCharge.getUserId() + , segchkUserCharge.getProviderId() + , getIpAddr(request), 2); + switch (prepayResultCommonResponse.getFlag()){ + case -1: return AjaxResult.error(500, "用户不存在"); + case -5: return AjaxResult.error(500, "微信生成订单出错"); + case -7: return AjaxResult.error(500, "没有设置网站地址"); + case -8: return AjaxResult.error(500, "缺少配置"); + case -10: return AjaxResult.error(500, "没有绑定微信"); + case 1: { + /*WechatApletPrepayResult wechatApletPrepayResult = new WechatApletPrepayResult(); + wechatApletPrepayResult.setAppId(prepayResultCommonResponse.getData().getAppid()); + wechatApletPrepayResult.setPaySign(prepayResultCommonResponse.getData().getPay_sign()); + wechatApletPrepayResult.setPackage_(prepayResultCommonResponse.getData().getPackage_()); + wechatApletPrepayResult.setNonceStr(prepayResultCommonResponse.getData().getNonce_str()); + wechatApletPrepayResult.setTimeStamp(prepayResultCommonResponse.getData().getTime_stamp());*/ + + return AjaxResult.success("充值成功", prepayResultCommonResponse); + } + default: return AjaxResult.error(600, "未知错误"); + } +// ajax.put(CODE_TAG, "200"); +// ajax.put(MSG_TAG, "充值成功!"); +// ajax.put(DATA_TAG, prepayResultCommonResponse); + } + return ajax; + } + + /** + * 充值结果回调接口,接口微信的支付结果,更新充值结果, ret 0成功,其他失败 + * { + * "chargeId": "demoData",//* + * "ret": 0//*0成功,其他失败 + * } + */ + @Log(title = "seg用户充值结果回调", businessType = BusinessType.UPDATE) + @PostMapping( "/userChargeResult") + @ResponseBody + @ApiOperation(value = "seg用户充值结果回调", notes = "需要鉴权") + public void userChargeResult(String chargeId, int ret, HttpServletRequest request) + { + + segchkUserIndexService.chargeRet(chargeId, ret); + } + + /** + * 微信支付回调 + */ + @RequestMapping("/wechatnotify") + @UnAuth + @ApiIgnore + public void weChatNotify(HttpServletRequest request, HttpServletResponse response) throws IOException { + if (segchkUserIndexService.weChatAppletNotify(request.getInputStream()) > 0) { + sendMessage(response, WechatUtils.SUCCESS_RETURN); + } + } + + /** + * 用户点击提现时的反应 未测试 + * { + * "userId": 459, + * "cash": 5.6, + * "providerId": 4, + * "userLevel": 2 + * } + */ +// @PreAuthorize("@ss.hasPermi('segchk:user_cash:add')") + @PostMapping( "/userCashReq") + @ResponseBody + @ApiOperation(value = "seg用户提现请求", notes = "需要鉴权") + public AjaxResult userCashReq(@RequestBody SegchkUserCashOpsReq segchkUserCashOpsReq, HttpServletRequest request) + { + Long userId = 0L; + Claims claims = getClaims(getToken(request)); + if (ObjectUtils.isEmpty(claims)) { +// 如果用户未登录,则要求用户使用手机号登录注册 + userId = getClaims(getToken(request)).getUserId(); + return AjaxResult.error(300, "请先登录注册"); + } + if(StringUtils.isEmpty(segchkUserCashOpsReq.getRemark())){ + segchkUserCashOpsReq.setUserId(claims.getUserId()); + segchkUserCashOpsReq.setProviderId(claims.getProviderId()); + segchkUserCashOpsReq.setUserLevel(claims.getUserLevel()); + } + AjaxResult ajax = new AjaxResult(); + if(segchkUserCashOpsReq.getUserLevel() == 0){ + return AjaxResult.error(301, "运营商无法线上提现"); + } +// segchkUserCashOpsReq.setUserLevel(2); + int ret = segchkUserIndexService.getAccountForCash(segchkUserCashOpsReq, getIpAddr(request)); + switch (ret){ + case -1: return AjaxResult.error(401, "无余额信息"); + case -2: return AjaxResult.error(402, "无余额信息"); + case -3: return AjaxResult.error(403, "提现受限"); + case -4: return AjaxResult.error(404, "余额不足"); + case -5: + case -8: + case -11: + case -12: + case -9: return AjaxResult.error(405, "提现异常,请联系平台客服"); + case -10: return AjaxResult.error(410, "微信未绑定"); + case 1: { + return AjaxResult.error(200, "提现成功"); + } + default: ajax.put(CODE_TAG, "500");ajax.put(MSG_TAG, "未知错误");break; + } + return ajax; + } + + /** + * 设置用户信息 未测试 + * { + * "userId": 43,//* + * "passwd": "sfsdfds",//* + * "providerId": 2,//* + * "userLevel": 2//* + * } + */ +// @PreAuthorize("@ss.hasPermi('segchk:user_set:add')") + @Log(title = "seg设置用户信息", businessType = BusinessType.UPDATE) + @PostMapping( "/SetInfo") + @ResponseBody + @ApiOperation(value = "seg设置用户信息", notes = "需要鉴权") + public AjaxResult SetInfo(@RequestBody SegchkUserSetInfoReq segchkUserSetInfoReq, HttpServletRequest request) + { + Long userId = 0L; + Claims claims = getClaims(getToken(request)); + if (ObjectUtils.isEmpty(claims)) { +// 如果用户未登录,则要求用户使用手机号登录注册 + userId = getClaims(getToken(request)).getUserId(); + return AjaxResult.error(300, "请先登录注册"); + } + if(StringUtils.isEmpty(segchkUserSetInfoReq.getRemark())){ + segchkUserSetInfoReq.setUserId(claims.getUserId()); + segchkUserSetInfoReq.setProviderId(claims.getProviderId()); + segchkUserSetInfoReq.setUserLevel(claims.getUserLevel()); + } + int ret = 0; + if(segchkUserSetInfoReq.getUserLevel() == 2) { + ret = segchkUserIndexService.updateUserInfo(segchkUserSetInfoReq); + } + else if(segchkUserSetInfoReq.getUserLevel() == 1){ + ret = segchkStoreIndexService.updateUserInfo(segchkUserSetInfoReq); + } + return toAjax(ret); + } + + + /** + * seg设置用户实名信息 未测试 + * { + * "userName": "demoData", + * "userId": 0, + * "providerId": 0, + * "IDcard": "demoData", + * "card1": "demoData", + * "card2": "demoData" + * } + */ +// @PreAuthorize("@ss.hasPermi('segchk:user_certicify:add')") + @Log(title = "seg设置用户实名信息", businessType = BusinessType.UPDATE) + @PostMapping( "/userCerticify") + @ResponseBody + @ApiOperation(value = "seg设置用户实名信息", notes = "需要鉴权") + public AjaxResult user_certicify(@RequestBody SegchkUserCertificationInfo segchkUserCertificationInfo, HttpServletRequest request) + { + int ret = 0; + Long userId = 0L; + Claims claims = getClaims(getToken(request)); + if (ObjectUtils.isEmpty(claims)) { +// 如果用户未登录,则要求用户使用手机号登录注册 + userId = getClaims(getToken(request)).getUserId(); + return AjaxResult.error(300, "请先登录注册"); + } + if(StringUtils.isEmpty(segchkUserCertificationInfo.getRemark())){ + segchkUserCertificationInfo.setUserId(claims.getUserId()); + segchkUserCertificationInfo.setProviderId(claims.getProviderId()); +// segchkUserCertificationInfo.setUserLevel(claims.getUserLevel()); + } + ret = segchkUserIndexService.userCerticify(segchkUserCertificationInfo); + return toAjax(ret); + } + + + /** + * 提现结果回调接口,接口微信的支付结果,更新充值结果, ret 0成功,其他失败 + * { + * "chargeId": "45435", + * "userLevel": "1/2/0", + * "ret": 1 + * } + */ + @Log(title = "seg提现结果回调", businessType = BusinessType.UPDATE) + @PostMapping( "/userCashResult") + @ResponseBody + @ApiOperation(value = "seg提现结果回调", notes = "需要鉴权") + public void userCashResult(String chargeId, int userLevel, int ret, HttpServletRequest request) + { + if(userLevel == 1) { + segchkStoreIndexService.cashRet(chargeId, ret); + } + else if(userLevel == 2){ + segchkUserIndexService.cashRet(chargeId, ret); + } + } + + /** + * 获取小程序凭证实体 + * + * @param token token + * @return 小程序凭证实体 + */ + private Claims getClaims(String token) { + + Object claims = redisService.getCacheObject(token); + logger.debug("getClaims---token:{} Claims:{}", token, claims); + return ObjectUtils.isEmpty(claims) ? null : (Claims) claims; + } + + /** + * 获取token + * + * @param request request + * @return token + */ + private String getToken(HttpServletRequest request) { + // 认证信息在header 中的key + final String authHeader = request.getHeader("Authorization"); + + if (Objects.isNull(authHeader) || !authHeader.startsWith("Bearer")) { + logger.info("getClaims fail :Authorization fail "); + throw new UnAuthorizedException(ResultCode.WX_NOT_AUTHORIZED); + } + return authHeader.length() >= 7 ? authHeader.substring(7) : authHeader.substring(6); + } + + /** + * 回传信息 + * + * @param message 信息 + */ + private void sendMessage(HttpServletResponse response, String message) { + PrintWriter out = null; + try { + out = response.getWriter(); + out.println(message); + out.flush(); + } catch (IOException e) { + e.printStackTrace(); + } finally { + out.close(); + } + + } + + private static class RemoveIds extends BaseEntity { + private Long userId; + private String ids; + + public Long getUserId() { + return userId; + } + + public void setUserId(Long userId) { + this.userId = userId; + } + + public String getIds() { + return ids; + } + + public void setIds(String ids) { + this.ids = ids; + } + } +} diff --git a/ruoyi-segchk-web/src/main/java/com/ruoyi/util/BaseInfoSetController.java b/ruoyi-segchk-web/src/main/java/com/ruoyi/util/BaseInfoSetController.java new file mode 100644 index 0000000..6848e21 --- /dev/null +++ b/ruoyi-segchk-web/src/main/java/com/ruoyi/util/BaseInfoSetController.java @@ -0,0 +1,45 @@ +package com.ruoyi.util; + +import com.ruoyi.common.annotation.UnAuth; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.setting.bean.BaseInfoSet; +import com.ruoyi.setting.service.BaseInfoSetService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiResponse; +import io.swagger.annotations.ApiResponses; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; + + +/** + * 系统设置控制器 + */ +@Controller +@Api(description = "系统设置接口") +public class BaseInfoSetController { + + /** + * 注入系统设置服务 + */ + @Autowired + private BaseInfoSetService baseInfoSetService; + + /** + * 查询基本信息和高级信息设置 + * + * @return 基本信息和高级信息设置实体类 + */ + @RequestMapping("/querybaseinfoset") + @ResponseBody + @UnAuth + @ApiOperation(value = "查询基本信息和高级信息设置", notes = "查询基本信息和高级信息设置(不需要认证)", httpMethod = "POST") + @ApiResponses({ + @ApiResponse(code = 200, message = "基本信息和高级信息设置实体类", response = BaseInfoSet.class) + }) + public AjaxResult queryBaseInfoSet() { + return AjaxResult.success(baseInfoSetService.queryBaseInfoSet()); + } +} diff --git a/ruoyi-segchk-web/src/main/java/com/ruoyi/util/QrCodeController.java b/ruoyi-segchk-web/src/main/java/com/ruoyi/util/QrCodeController.java new file mode 100644 index 0000000..87cde31 --- /dev/null +++ b/ruoyi-segchk-web/src/main/java/com/ruoyi/util/QrCodeController.java @@ -0,0 +1,104 @@ +package com.ruoyi.util; + +import com.ruoyi.common.annotation.UnAuth; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; +import springfox.documentation.annotations.ApiIgnore; + +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.io.OutputStream; + +/** + * 二维码控制器 + * + * @author 魔金商城 created on 2020/6/23 + */ +@Controller +@Api(description = "二维码接口") +public class QrCodeController { + + + @Value("${segchk.qr_path}") + private String qrPath; + + @Value("${segchk.poster_path}") + private String posterPath; + + /** + * 创建二维码图片 + * + * @param url 地址 + * @param w 宽 + * @param h 高 + */ + @RequestMapping("/createqrcode") + @ResponseBody + @UnAuth + @ApiIgnore + @ApiImplicitParams({ + @ApiImplicitParam(paramType = "form", dataType = "String", name = "url", value = "地址"), + @ApiImplicitParam(paramType = "form", dataType = "Integer", name = "w", value = "宽"), + @ApiImplicitParam(paramType = "form", dataType = "Integer", name = "h", value = "高"), + }) + public void createQrCode(HttpServletResponse response, String url, Integer w, Integer h) { + createQRImg(response, url, w, h); + } + + + @PostMapping("qRCode") + public void qRCode(HttpServletResponse response, String storeId, Integer w, Integer h) { + + //获取生成海报的图片路径 +// qRCodeNew(storeId, response); + } + + /*private void qRCodeNew(String storeId, HttpServletResponse response) { + OutputStream outputStream = null; + try { + outputStream = response.getOutputStream(); + QRCodeUtils.qRCode(storeId, "jpg", qrPath, posterPath, outputStream); + outputStream.flush(); + } catch (Exception e) { + e.printStackTrace(); + } finally { + try { + outputStream.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + }*/ + + /** + * 创建二维码图片 + * + * @param url 链接地址 + * @param width 宽 + * @param height 高 + */ + private void createQRImg(HttpServletResponse response, String url, Integer width, Integer height) { + OutputStream outputStream = null; + try { + outputStream = response.getOutputStream(); + QRCodeUtils.createQrCode(url, width, height, "jpg", outputStream); + + outputStream.flush(); + } catch (Exception e) { + e.printStackTrace(); + } finally { + try { + outputStream.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + + } +} diff --git a/ruoyi-segchk-web/src/main/resources/application-dev.yml b/ruoyi-segchk-web/src/main/resources/application-dev.yml new file mode 100644 index 0000000..d0ef57a --- /dev/null +++ b/ruoyi-segchk-web/src/main/resources/application-dev.yml @@ -0,0 +1,65 @@ +# 数据源配置 +spring: + datasource: + type: com.alibaba.druid.pool.DruidDataSource + driverClassName: com.mysql.cj.jdbc.Driver + druid: + # 主库数据源 + master: + url: jdbc:mysql://127.0.0.1:8306/segchksaas?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 + username: segchksaas + password: 2wsx@WSX + # 从库数据源 + slave: + # 从数据源开关/默认关闭 + enabled: false + url: + username: + password: + # 初始连接数 + initialSize: 5 + # 最小连接池数量 + minIdle: 10 + # 最大连接池数量 + maxActive: 20 + # 配置获取连接等待超时的时间 + maxWait: 60000 + # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 + timeBetweenEvictionRunsMillis: 60000 + # 配置一个连接在池中最小生存的时间,单位是毫秒 + minEvictableIdleTimeMillis: 300000 + # 配置一个连接在池中最大生存的时间,单位是毫秒 + maxEvictableIdleTimeMillis: 900000 + # 配置检测连接是否有效 + validationQuery: SELECT 1 FROM DUAL + testWhileIdle: true + testOnBorrow: false + testOnReturn: false + webStatFilter: + enabled: true + statViewServlet: + enabled: true + # 设置白名单,不填则允许所有访问 + allow: + url-pattern: /druid/* + # 控制台管理用户名和密码 + login-username: + login-password: + filter: + stat: + enabled: true + # 慢SQL记录 + log-slow-sql: true + slow-sql-millis: 1000 + merge-sql: true + wall: + config: + multi-statement-allow: true + +yzytest: + login: + smstest: true + +segchk: + qr_path: uploadPath + poster_path: uploadPath diff --git a/ruoyi-segchk-web/src/main/resources/application-prod.yml b/ruoyi-segchk-web/src/main/resources/application-prod.yml new file mode 100644 index 0000000..11f448b --- /dev/null +++ b/ruoyi-segchk-web/src/main/resources/application-prod.yml @@ -0,0 +1,73 @@ +#配置数据源 +spring: + datasource: + druid: + master: + type: com.alibaba.druid.pool.DruidDataSource + driverClassName: com.mysql.jdbc.Driver + url: jdbc:mysql://172.16.11.13:3306/yzy_ruoyi_vue?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&zeroDateTimeBehavior=convertToNull + username: yzyuser + password: yzy123456 + # 初始化连接大小 + initial-size: 5 + # 最小空闲连接数 + min-idle: 5 + max-active: 20 + max-wait: 30000 + # 可关闭的空闲连接间隔时间 + time-between-eviction-runs-millis: 60000 + # 配置连接在池中的最小生存时间 + min-evictable-idle-time-millis: 300000 + validation-query: select '1' from dual + test-while-idle: true + test-on-borrow: false + test-on-return: false + # 打开PSCache,并且指定每个连接上PSCache的大小 + pool-prepared-statements: true + max-open-prepared-statements: 20 + max-pool-prepared-statement-per-connection-size: 20 + slave: + enabled: false + type: com.alibaba.druid.pool.DruidDataSource + driverClassName: com.mysql.jdbc.Driver + url: jdbc:mysql://172.16.11.13:3306/yzy_payshop?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&zeroDateTimeBehavior=convertToNull + username: yzyuser + password: yzy123456 + # 初始化连接大小 + initial-size: 5 + # 最小空闲连接数 + min-idle: 5 + max-active: 20 + max-wait: 30000 + # 可关闭的空闲连接间隔时间 + time-between-eviction-runs-millis: 60000 + # 配置连接在池中的最小生存时间 + min-evictable-idle-time-millis: 300000 + validation-query: select '1' from dual + test-while-idle: true + test-on-borrow: false + test-on-return: false + # 打开PSCache,并且指定每个连接上PSCache的大小 + pool-prepared-statements: true + max-open-prepared-statements: 20 + max-pool-prepared-statement-per-connection-size: 20 + redis: + cluster: + nodes: 172.16.11.10:63795 + timeout: 1000 + lettuce: + pool: + max-active: 8 + max-idle: 8 + min-idle: 2 + max-wait: 300 + password: retinabd@2020 + data: + elasticsearch: + cluster-name: elasticsearch + cluster-nodes: 10.1.192.113:29208,10.1.192.113:29209,10.1.192.113:29210 + messages: + basename: messages/messages + servlet: + multipart: + max-file-size: 15MB diff --git a/ruoyi-segchk-web/src/main/resources/application-test.yml b/ruoyi-segchk-web/src/main/resources/application-test.yml new file mode 100644 index 0000000..d245a9b --- /dev/null +++ b/ruoyi-segchk-web/src/main/resources/application-test.yml @@ -0,0 +1,71 @@ +#配置数据源 +spring: + datasource: + druid: + master: + type: com.alibaba.druid.pool.DruidDataSource + driverClassName: com.mysql.jdbc.Driver + url: jdbc:mysql://172.22.4.2:3306/yzy_ruoyi_vue?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&zeroDateTimeBehavior=convertToNull + username: root + password: oywkpjEi9MW4NL9mR88YTydj9wHE5E + # 初始化连接大小 + initial-size: 5 + # 最小空闲连接数 + min-idle: 5 + max-active: 20 + max-wait: 30000 + # 可关闭的空闲连接间隔时间 + time-between-eviction-runs-millis: 60000 + # 配置连接在池中的最小生存时间 + min-evictable-idle-time-millis: 300000 + validation-query: select '1' from dual + test-while-idle: true + test-on-borrow: false + test-on-return: false + # 打开PSCache,并且指定每个连接上PSCache的大小 + pool-prepared-statements: true + max-open-prepared-statements: 20 + max-pool-prepared-statement-per-connection-size: 20 + slave1: + type: com.alibaba.druid.pool.DruidDataSource + driverClassName: com.mysql.jdbc.Driver + url: jdbc:mysql://172.22.4.2:3306/wsfmall_test?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&zeroDateTimeBehavior=convertToNull + username: root + password: oywkpjEi9MW4NL9mR88YTydj9wHE5E + # 初始化连接大小 + initial-size: 5 + # 最小空闲连接数 + min-idle: 5 + max-active: 20 + max-wait: 30000 + # 可关闭的空闲连接间隔时间 + time-between-eviction-runs-millis: 60000 + # 配置连接在池中的最小生存时间 + min-evictable-idle-time-millis: 300000 + validation-query: select '1' from dual + test-while-idle: true + test-on-borrow: false + test-on-return: false + # 打开PSCache,并且指定每个连接上PSCache的大小 + pool-prepared-statements: true + max-open-prepared-statements: 20 + max-pool-prepared-statement-per-connection-size: 20 + redis: + host: 172.22.0.3 + port: 6379 + timeout: 100 + lettuce: + pool: + max-active: 8 + max-idle: 8 + min-idle: 2 + max-wait: 300 + password: sfakjfiju99jjf87LJSDDU8 + data: + elasticsearch: + cluster-nodes: 172.22.0.3:9300 + messages: + basename: messages/messages + servlet: + multipart: + max-file-size: 15MB \ No newline at end of file diff --git a/ruoyi-segchk-web/src/main/resources/application-uat.yml b/ruoyi-segchk-web/src/main/resources/application-uat.yml new file mode 100644 index 0000000..46af5b0 --- /dev/null +++ b/ruoyi-segchk-web/src/main/resources/application-uat.yml @@ -0,0 +1,71 @@ +#配置数据源 +spring: + datasource: + druid: + master: + type: com.alibaba.druid.pool.DruidDataSource + driverClassName: com.mysql.jdbc.Driver + url: jdbc:mysql://172.22.4.2:3306/wsfmall_uat?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&zeroDateTimeBehavior=convertToNull + username: root + password: oywkpjEi9MW4NL9mR88YTydj9wHE5E + # 初始化连接大小 + initial-size: 5 + # 最小空闲连接数 + min-idle: 5 + max-active: 20 + max-wait: 30000 + # 可关闭的空闲连接间隔时间 + time-between-eviction-runs-millis: 60000 + # 配置连接在池中的最小生存时间 + min-evictable-idle-time-millis: 300000 + validation-query: select '1' from dual + test-while-idle: true + test-on-borrow: false + test-on-return: false + # 打开PSCache,并且指定每个连接上PSCache的大小 + pool-prepared-statements: true + max-open-prepared-statements: 20 + max-pool-prepared-statement-per-connection-size: 20 + slave1: + type: com.alibaba.druid.pool.DruidDataSource + driverClassName: com.mysql.jdbc.Driver + url: jdbc:mysql://172.22.4.2:3306/wsfmall_uat?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&zeroDateTimeBehavior=convertToNull + username: root + password: oywkpjEi9MW4NL9mR88YTydj9wHE5E + # 初始化连接大小 + initial-size: 5 + # 最小空闲连接数 + min-idle: 5 + max-active: 20 + max-wait: 30000 + # 可关闭的空闲连接间隔时间 + time-between-eviction-runs-millis: 60000 + # 配置连接在池中的最小生存时间 + min-evictable-idle-time-millis: 300000 + validation-query: select '1' from dual + test-while-idle: true + test-on-borrow: false + test-on-return: false + # 打开PSCache,并且指定每个连接上PSCache的大小 + pool-prepared-statements: true + max-open-prepared-statements: 20 + max-pool-prepared-statement-per-connection-size: 20 + redis: + host: 172.22.0.4 + port: 6379 + timeout: 100 + lettuce: + pool: + max-active: 8 + max-idle: 8 + min-idle: 2 + max-wait: 300 + password: sfakjfiju99jjf87LJSDDU8 + data: + elasticsearch: + cluster-nodes: 172.22.0.4:9300 + messages: + basename: messages/messages + servlet: + multipart: + max-file-size: 15MB \ No newline at end of file diff --git a/ruoyi-segchk-web/src/main/resources/application.yml b/ruoyi-segchk-web/src/main/resources/application.yml new file mode 100644 index 0000000..58a8b00 --- /dev/null +++ b/ruoyi-segchk-web/src/main/resources/application.yml @@ -0,0 +1,120 @@ +# 项目相关配置 商城端 +ruoyi: + # 名称 + name: RuoYi + # 版本 + version: 3.0.0 + # 版权年份 + copyrightYear: 2019 + # 实例演示开关 + demoEnabled: true + # 文件路径 示例( Windows配置F:\ideaproj\RuoYi-Vue\uploadPath + #,Linux配置 /root/yzychk_vue/uploadPath) + profile: /root/yzychk_vue/uploadPath + # 获取ip地址开关 + addressEnabled: false + +# 开发环境配置 +server: + # 服务器的HTTP端口,默认为 8091 测试 9092 + port: 9092 + servlet: + # 应用的访问路径 + context-path: / + tomcat: + # tomcat的URI编码 + uri-encoding: UTF-8 + # tomcat最大线程数,默认为200 + max-threads: 800 + # Tomcat启动初始化的线程数,默认值25 + min-spare-threads: 30 + +# 日志配置 +logging: + level: + com.ruoyi: debug + org.springframework: warn + +# Spring配置 +spring: + # 资源信息 + messages: + # 国际化资源文件路径 + basename: i18n/messages + profiles: + active: dev + # 文件上传 + servlet: + multipart: + # 单个文件大小 + max-file-size: 10MB + # 设置总上传的文件大小 + max-request-size: 20MB + # 服务模块 + devtools: + restart: + # 热部署开关 + enabled: true + # redis 配置 + redis: + # 地址 + host: 127.0.0.1 + # 端口,默认为6379 + port: 63795 + # 数据库索引 + database: 3 + # 密码 + password: retinabd@2020 + # 连接超时时间 + timeout: 10s + lettuce: + pool: + # 连接池中的最小空闲连接 + min-idle: 0 + # 连接池中的最大空闲连接 + max-idle: 8 + # 连接池的最大数据库连接数 + max-active: 8 + # #连接池最大阻塞等待时间(使用负值表示没有限制) + max-wait: -1ms + +# token配置 +token: + # 令牌自定义标识 + header: Authorization + # 令牌密钥 + secret: abcdefghijklmnopqrstuvwxyz + # 令牌有效期(默认30分钟) + expireTime: 3000 + +# MyBatis配置 +mybatis: + # 搜索指定包别名 + typeAliasesPackage: com.ruoyi.**.domain + # 配置mapper的扫描,找到所有的mapper.xml映射文件 + mapperLocations: classpath*:mapper/**/*Mapper.xml + # 加载全局的配置文件 + configLocation: classpath:mybatis/mybatis-config.xml + +# PageHelper分页插件 +pagehelper: + helperDialect: mysql + reasonable: true + supportMethodsArguments: true + params: count=countSql + +# Swagger配置 +swagger: + # 是否开启swagger + enabled: true + # 请求前缀 + pathMapping: /dev-api + +# 防止XSS攻击 +xss: + # 过滤开关 + enabled: true + # 排除链接(多个用逗号分隔) + excludes: /system/notice/* + # 匹配链接 + urlPatterns: /system/*,/monitor/*,/tool/* diff --git a/ruoyi-segchk-web/src/main/resources/http-client.private.env.json b/ruoyi-segchk-web/src/main/resources/http-client.private.env.json new file mode 100644 index 0000000..de37099 --- /dev/null +++ b/ruoyi-segchk-web/src/main/resources/http-client.private.env.json @@ -0,0 +1,20 @@ +{ + "dev": { + "name": "value", + "bindtoken": "eyJhbGciOiJIUzI1NiIsInppcCI6IkRFRiJ9.eNqqViouTVKyUnIMCPBxDYn38Xf39Iv3do1U0lHKTCxRsjI0MzY0tDCwtLDQUSotTi3yTFGyMjUw1lEqKMovy0yBCBhB5HxSy1JzwLzUigKYVhNTC4taAAAAAP__.diChD7JjY3y8SBNTBE8ACoNWWIuz-r-mHESPfL73eZI", + "bindtoken1": "eyJhbGciOiJIUzI1NiIsInppcCI6IkRFRiJ9.eNqqViouTVKyUnIMCPBxDYn38Xf39Iv3do1U0lHKTCxRsjI0MzYyNDQwNDLVUSotTi3yTFGyMjUw1lEqKMovy0yBCBhB5HxSy1JzwLzUigKYVmNzI9NaAAAAAP__.Y5uJzL55q9baNor4ScWmVg9UZyfHkTxZ0Oz79guiXXg", +// "token2": "APPLET_LOGIN_KEY_885553054366171136abcdefghijklmnopqrstuvwxyz", + "token3": "eyJhbGciOiJIUzI1NiIsInppcCI6IkRFRiJ9.eNqqViouTVKyUipPTc5ILMnJT8_MU9JRykwsUbIyNDM2NDQ3sDAx0VEqLU4t8kxRsjLWUSooyi_LTIFwjSAyPqllqTlgXmpFAUyjCRDUAgAAAP__.5qRMCYs8YUoFJdSo_XSZiGlqJ13LGa20qJAT8GoiMHg", + "providertoken": "eyJhbGciOiJIUzI1NiIsInppcCI6IkRFRiJ9.eNqqViouTVKyUnIMCPBxDYn38Xf39Iv3do1U0lHKTCxRsjI0MzY0MjC1MDTWUSotTi3yTFGyMtJRKijKL8tMgXNBMj6pZak5SlYGOkqpFQUwjZYmhsa1AAAAAP__.DkyBrM5f7G0eLi7DnYpgAqGTYnLaWRrpD3xemTa1s3k", + "store_search": + { + "providerId": 2, + "sortType": 0, + "storeName": "99", + "lableName": "99", + "typeId": 1, + "userLon": 114.123456, + "userLat": 43.123456 + } + } +} \ No newline at end of file diff --git a/ruoyi-segchk-web/src/main/resources/logback-spring.xml b/ruoyi-segchk-web/src/main/resources/logback-spring.xml new file mode 100644 index 0000000..a3cd82a --- /dev/null +++ b/ruoyi-segchk-web/src/main/resources/logback-spring.xml @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + ${CONSOLE_LOG_PATTERN} + + + + + + + + + ${INFO_LOG_FILE_NAME_PATTERN} + + 14 + + 30GB + + + 50MB + + + + ${FILE_LOG_PATTERN} + + + + + + + + ${ERROR_LOG_FILE_NAME_PATTERN} + + 30 + + 1GB + + + 10MB + + + + ${FILE_LOG_PATTERN} + + + + error + ACCEPT + DENY + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ruoyi-segchk-web/src/main/resources/messages/messages.properties b/ruoyi-segchk-web/src/main/resources/messages/messages.properties new file mode 100644 index 0000000..e9a2292 --- /dev/null +++ b/ruoyi-segchk-web/src/main/resources/messages/messages.properties @@ -0,0 +1,6 @@ +#################################### +## \u7ED3\u679C\u7801\u4FE1\u606F\u5B9A\u4E49 ## +##################################### +R-00002=\u5C0F\u7A0B\u5E8F\u672A\u6388\u6743 +R-00003=\u5C0F\u7A0B\u5E8F\u672A\u548C\u7528\u6237\u7ED1\u5B9A +R-00004=\u7528\u6237\u7ED1\u5B9A\u5931\u8D25\uFF0C\u5DF2\u7ED1\u5B9A\u5176\u4ED6\u8D26\u6237 diff --git a/ruoyi-segchk-web/src/main/resources/messages/messages_en_US.properties b/ruoyi-segchk-web/src/main/resources/messages/messages_en_US.properties new file mode 100644 index 0000000..2d0dda9 --- /dev/null +++ b/ruoyi-segchk-web/src/main/resources/messages/messages_en_US.properties @@ -0,0 +1,5 @@ +#################################### +## \u7ED3\u679C\u7801\u4FE1\u606F\u5B9A\u4E49 ## +##################################### +R-00002=\u5C0F\u7A0B\u5E8F\u672A\u6388\u6743 +R-00003=\u5C0F\u7A0B\u5E8F\u672A\u548C\u7528\u6237\u7ED1\u5B9A diff --git a/ruoyi-segchk-web/src/main/resources/messages/messages_zh_CN.properties b/ruoyi-segchk-web/src/main/resources/messages/messages_zh_CN.properties new file mode 100644 index 0000000..2d0dda9 --- /dev/null +++ b/ruoyi-segchk-web/src/main/resources/messages/messages_zh_CN.properties @@ -0,0 +1,5 @@ +#################################### +## \u7ED3\u679C\u7801\u4FE1\u606F\u5B9A\u4E49 ## +##################################### +R-00002=\u5C0F\u7A0B\u5E8F\u672A\u6388\u6743 +R-00003=\u5C0F\u7A0B\u5E8F\u672A\u548C\u7528\u6237\u7ED1\u5B9A diff --git a/ruoyi-segchk-web/src/main/resources/mybatis/mybatis-config.xml b/ruoyi-segchk-web/src/main/resources/mybatis/mybatis-config.xml new file mode 100644 index 0000000..5500599 --- /dev/null +++ b/ruoyi-segchk-web/src/main/resources/mybatis/mybatis-config.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + diff --git a/ruoyi-segchk-web/src/main/resources/templates/posters/bg.jpg b/ruoyi-segchk-web/src/main/resources/templates/posters/bg.jpg new file mode 100644 index 0000000..ad7c1e6 Binary files /dev/null and b/ruoyi-segchk-web/src/main/resources/templates/posters/bg.jpg differ diff --git a/ruoyi-segchk-web/src/main/resources/test.http b/ruoyi-segchk-web/src/main/resources/test.http new file mode 100644 index 0000000..eadbed3 --- /dev/null +++ b/ruoyi-segchk-web/src/main/resources/test.http @@ -0,0 +1,876 @@ + + +### +GET https://api.weixin.qq.com/sns/jscode2session?appid=wx2ce4e2083b3a871a&secret=adc865e9ab24ab23b534f9ca5c0960b3&js_code=053okall2BHyK74GMcol2S8Exc0okaln&grant_type=authorization_code +Accept: */* + +### +GET http://localhost:8091//createqrcode?url="http://yxr8cu.natappfree.cc//tokentest?dfasdf=1+werwer=1231"&w=300&h=300 +Accept: */* +Cache-Control: no-cache +Content-Type: application/json + + +### +############### 商家接口测试 #################### + +### 商家核消操作 +POST http://localhost:8091//default/store/ServiceCheckTest?likegoId=16877&storeId=128&remark=999999 +Accept: */* +Cache-Control: no-cache +Content-Type: application/json +Authorization: Bearer {{bindtoken}} + + +### 根据用户id,运营商id,查询seg商户提现列表 +POST http://localhost:8091//default/store/storeCashList +Accept: */* +Cache-Control: no-cache +Content-Type: application/json +Authorization: Bearer {{bindtoken}} + +{ + "userId": 84, + "phoneNo": "demoData", + "providerId": 3, + "remark": "999999" +} + +### +POST http://localhost:8091//default/store/storeUserLikeGoList +Accept: */* +Cache-Control: no-cache +Content-Type: application/json +Authorization: Bearer {{bindtoken}} + +{ + "providerId": 4, + "storeId": 123, + "staticMonth": "60", + "remark": "999999" +} + +### +POST http://localhost:8091//default/store/storeServiceAndSaleDetails +Accept: */* +Cache-Control: no-cache +Content-Type: application/json +Authorization: Bearer {{bindtoken}} + +{ + "providerId": 4, + "storeId": 123, + "staticMonth": "2021-06-01", + "srcFlag": 0, + "remark": "999999" +} + +### 根据商家id,运营商id,角色等级,返回核消统计或售卡统计 +POST http://localhost:8091//default/store/storeServiceAndSaleList +Accept: */* +Cache-Control: no-cache +Content-Type: application/json +Authorization: Bearer {{bindtoken}} + +{ + "providerId": 4, + "storeId": 123, + "staticMonth": "6", + "srcFlag": 0, + "remark": "999999" +} +############### END #################### + + + +############### 用户接口测试 #################### +### +POST http://localhost:8091//default/user/userCashReq +Accept: */* +Cache-Control: no-cache +Content-Type: application/json +Authorization: Bearer {{bindtoken1}} + +{ + "userId": 503, + "cash": 5, + "providerId": 2, + "userLevel": 2 +} + +### 用户充值操作 +#返回结果 +#{ +# "msg": "充值成功", +# "code": 200, +# "data": { +# "flag": 1, +# "data": { +# "return_code": "SUCCESS", +# "return_msg": "OK", +# "appid": "wx2ce4e2083b3a871a", +# "mch_id": "1614166120", +# "nonce_str": "wknhqpLNvr4F6CLI", +# "sign": "2519A7C975E5F38B95D0EE453C1A11D2", +# "result_code": "SUCCESS", +# "err_code": null, +# "err_code_des": null, +# "trade_type": "JSAPI", +# "prepay_id": "wx201612191353691146536bf76294620000", +# "code_url": null, +# "mweb_url": null, +# "time_stamp": "1632125538", +# "package_": "prepay_id=wx201612191353691146536bf76294620000", +# "sign_type": "MD5", +# "pay_sign": "087F0D138F3970B5228A3456E1A5496E" +# } +# } +#} +POST http://localhost:8091//default/user/userChargeReq +Accept: */* +Cache-Control: no-cache +Content-Type: application/json +Authorization: Bearer {{bindtoken1}} + +{ + "userId": 503, + "charge": 9.9, + "accountUsed": 0, + "cardTypeId": 0, + "providerId": 2 +} + + +### 用户充值请求 +POST http://localhost:8091//default/user/userChargePre +Accept: */* +Cache-Control: no-cache +Content-Type: application/json +Authorization: Bearer {{bindtoken1}} + +{ + "userId": 465, + "providerId": 4, + "userLevel": 2 +} + +### 查询seg用户消息列表 +POST http://localhost:8091//default/user/userMsgList +Accept: */* +Cache-Control: no-cache +Content-Type: application/json +Authorization: Bearer {{bindtoken}} + +{ + "userId": 392, + "providerId": 4, + "userLevel": 2, + "remark": "999999", + "phoneNo": 1 +} + +### 查询seg用户提现列表 +POST http://localhost:8091//default/user/userCashList +Accept: */* +Cache-Control: no-cache +Content-Type: application/json +Authorization: Bearer {{bindtoken}} + +{ + "userId": 34, + "providerId": 2, + "remark": "999999" +} + +### 查询seg用户充值列表 +POST http://localhost:8091//default/user/userChargeList +Accept: */* +Cache-Control: no-cache +Content-Type: application/json +Authorization: Bearer {{bindtoken}} + +{ + "userId": 34, + "providerId": 2, + "remark": "999999" +} + +### seg服务评价提交 +POST http://localhost:8091//default/user/addComment +Accept: */* +Cache-Control: no-cache +Content-Type: application/json +Authorization: Bearer {{bindtoken}} + +{ + "starLevel": 4.5, + "contentText": "测试评价9343", + "chkServiceId": 9343 +} + +### seg服务评价查询 +POST http://localhost:8091//default/user/getComment +Accept: */* +Cache-Control: no-cache +Content-Type: application/json +Authorization: Bearer {{bindtoken}} + +{ + "commentId": 3 +} + +### 删除seg用户想去记录 +POST http://localhost:8091//default/user/removeOrderUserLikego +Accept: */* +Cache-Control: no-cache +Content-Type: application/json +Authorization: Bearer {{bindtoken}} + +{ + "userId": 245, + "ids": "16733" +} + +### 查询seg用户收藏列表 +POST http://localhost:8091//default/user/userLikeGOList +Accept: */* +Cache-Control: no-cache +Content-Type: application/json +Authorization: Bearer {{bindtoken}} + +{ + "userId": 245, + "providerId": 4, + "remark": "999999" +} + +### 查询seg用户收藏列表 "remark": "999999"测试标识 +#{ +# "total": 48,//用户收藏列表数量 +# "rows": [ +# { +# "collectId": 2002,//收藏id +# "providerId": 4,//运营商id +# "storeId": 134,//商家id,跳转商家详情使用 +# "storeName": "4商家名称018",//商家名称,展示使用 +# "storeIcon": "http://10.1.192.113:60902/profile/upload/2021/07/02/706f0a58-6031-4523-abbd-dc5dd823278c.jpg",//图标,展示使用 +# "serviceState": 0,//在线送达 +# "storeLon": 116.4980500000,//商家位置,导航时使用 +# "storeLat": 39.8831020000,//商家位置,导航时使用 +# "chkCount": 280,//核消数量 +# "starAvg": 2.71,//综合评价,展示使用 +# "modTime": "2021-07-16",//收藏时间,展示使用 +# "segchkRecommenderStoreLableWebList": [//商家标签列表 +# { +# "lableId": 0,//标签id +# "lableTypeId": 0,//一级标签id +# "lableName": "99",//标签名称,展示使用 +# }, +# { +# "lableId": 0, +# "lableTypeId": 1, +# "lableName": "美食", +# }, +# ... +# ] +# }, +# ... +# ], +# "code": 200, +# "msg": "查询成功" +#} +POST http://localhost:8091//default/user/userCollectList +Accept: */* +Cache-Control: no-cache +Content-Type: application/json +Authorization: Bearer {{bindtoken}} + +{ + "userId": 439, + "providerId": 4, + "remark": "999999" +} + +### +### 查询seg用户可用会员卡列表或者优惠券列表 "userLevel": 0(查会员卡),1(查优惠券),"remark": "999999"测试标识 +#结果说明 +#{ +# "total": 3,//优惠券数量 +# "rows": [ +# { +# "cardName": "赠卡",//优惠券名称,展示使用 +# "storeName": "4商家名称028",//归属商家名称,展示使用 +# "leftCount": 49,//剩余次数,展示使用 +# "effectiveTime": "2021-07-13",//有效期,展示使用 +# "typeFlag": 1,// +# "cardStatus": "过期"//状态 +# }, +# ... +# ], +# "code": 200, +# "msg": "查询成功" +#} +# +#{ +# "total": 1,//卡包数量 +# "rows": [ +# { +# "cardName": "299",//会员卡名称,展示使用 +# "storeName": null,//商家名称,展示使用,查询优惠券时有效 +# "useCount": 31,//已使用权益次数,展示使用 +# "leftCount": 69,//剩余权益次数,展示使用 +# "effectiveTime": "2021-09-15",//有效期,展示使用 +# "typeFlag": 0,//卡券标识,0会员卡,1券(或赠卡) +# "cardStatus": "可用"//会员卡状态。是否可用,展示使用 +# } +# ], +# "code": 200, +# "msg": "查询成功" +#} +POST http://localhost:8091//default/user/userCardList +Accept: */* +Cache-Control: no-cache +Content-Type: application/json +Authorization: Bearer {{bindtoken}} + +{ + "userId": 241, + "providerId": 4, + "userLevel": 0, + "remark": "999999" +} + +### +### 查询seg用户核消列表 +#结果说明 +#{ +# "total": 38,//用户核消列表数量 +# "rows": [//用户核消列表 +# { +# "providerId": 4,//运营商id +# "cardId": 244,//卡号或券号 +# "storeId": 119,//商家id +# "cardTypeId": 0,// +# "userId": 245,//用户id +# "modTime": "2021-07-12",//核消时间,展示使用 +# "chkServiceId": 11168,//核消id +# "commentId": 0,//评价id,0表示未评价,其他表示已评,展示使用 +# "cardTypeName": "99",//卡券名称,展示使用 +# "storeName": "4商家名称003",//商家名称,展示使用 +# "chkSource": 0// +# }, +# ... +# ], +# "code": 200, +# "msg": "查询成功" +#} +POST http://localhost:8091//default/user/storeServiceCheckList +Accept: */* +Cache-Control: no-cache +Content-Type: application/json +Authorization: Bearer {{bindtoken}} + +{ + "userId": 245, + "providerId": 4, + "remark": "999999" +} + +### +### 添加seg用户想去记录 +POST http://localhost:8091//default/user/addOrderUserLikego +Accept: */* +Cache-Control: no-cache +Content-Type: application/json +Authorization: Bearer {{bindtoken}} + +{ + "providerId": 4, + "userId": 245, + "storeId": 128, + "cardId": 244, + "cardType": 0, + "remark": "999999" +} + +### +### 查询该用户在该商户可使用的会员卡或优惠券,remark为测试标识 +#返回结果 +#{ +# "total": 3,//可用卡券列表数量 +# "rows": [//可用卡券列表 +# { +# "providerId": 4,//运营商id +# "storeId": 128,//商家id +# "userId": 245,//用户id +# "cardId": 244,//卡号或券号 +# "lableId": 0,//子标签id +# "typeId": 0,//一级标签id +# "cardName": "99会员卡"//预约下拉中展示使用 +# }, +# ... +# ], +# "code": 200, +# "msg": "查询成功" +#} +POST http://localhost:8091//default/user/userOrderPredList +Accept: */* +Cache-Control: no-cache +Content-Type: application/json +Authorization: Bearer {{bindtoken}} + +{ + "providerId": 4, + "storeId": 128, + "userId": 245, + "remark": "999999" +} + +### + +### 根据收藏id,删除收藏列表 ids:要删除的收藏列表id,删除多个时,使用逗号拼接 +POST http://localhost:8091//default/user/removeUserCollect +Accept: */* +Cache-Control: no-cache +Content-Type: application/json +Authorization: Bearer {{bindtoken}} + +{ + "userId": 0, + "ids": "23432,456" +} + +### +### seg用户收藏记录 +POST http://localhost:8091//default/user/addUserCollect +Accept: */* +Cache-Control: no-cache +Content-Type: application/json +Authorization: Bearer {{bindtoken}} + +{ + "collectType": "1", + "providerId": 2, + "userId": 8, + "storeId": 12, + "mgtState": 0, + "remark": "999999" +} + +############### END #################### + + + +############### 运营商接口测试 #################### + +### 根据运营商id,返回运营商下核消统计或售卡统计详情 +#无token时返回 +#{ +# "total": 0, +# "rows": null, +# "code": 300, +# "msg": "请先登录注册" +#} +#token用户信息不一致返回 +#{ +# "total": 0, +# "rows": null, +# "code": 301, +# "msg": "用户信息异常" +#} +#{ +# "total": 106,//该月份的统计 +# "rows": [ +# { +# "cardName": "99",//卡券名称,展示使用 +# "storeName": "2商家名称001",//商家名称,展示使用 +# "staticCount": 24//统计值 +# }, +# ... +# ], +# "code": 200, +# "msg": "查询成功" +#} +POST http://localhost:8091//default/provider/providerServiceAndSaleDetails +Accept: */* +Cache-Control: no-cache +Content-Type: application/json +Authorization: Bearer {{providertoken}} + +{ + "providerId": 2, + "staticMonth": "2021-06-01", + "srcFlag": 0 +} + +### +### 根据运营商id,返回运营商下所有核消统计或售卡统计 +#返回结果说明 +#{//无token时 +# "total": 0, +# "rows": null, +# "code": 300, +# "msg": "请先登录注册" +#} +#{//token与用户标识不一致时 +# "total": 0, +# "rows": null, +# "code": 301, +# "msg": "用户信息异常" +#} +#查询成功 +#{ +# "total": 7,//统计月数 +# "rows": [ +# { +# "staticMonth": "202107",//具体月份,展示使用 +# "queryMon": "2021-07-01",//具体月份,详情查询时使用 +# "staticCount": 1062//统计值,展示使用 +# }, +# ... +# ], +# "code": 200, +# "msg": "查询成功" +#} +POST http://localhost:8091//default/provider/providerServiceAndSaleList +Accept: */* +Cache-Control: no-cache +Content-Type: application/json +Authorization: Bearer {{providertoken}} + +{ + "providerId": 3, + "staticMonth": "10", + "srcFlag": 1 +} + +### +GET http://localhost:8091/register +Accept: application/json +Content-Type: application/json + +{ + "mobile": "13000000001", + "code": "1234", + "providerId": "2" +} + +### 无token登录 Authorization: Bearer {{providertoken}}使用token登录 +POST http://localhost:8091/login +Accept: */* +Cache-Control: no-cache +Content-Type: application/json +Authorization: Bearer {{providertoken}} + +{ + "userId": 3, + "providerId": 2, + "userLevel": 2, + "cardID": "11111" +} + +### 商家评价列表 +#返回结果说明 +#"{ +# ""total"": 151,//该商家的评价列表 +# ""rows"": [ +# { +# ""storeId"": 130,//商家id +# ""starLevel"": 4,//星级评价,展示使用 +# ""contentText"": ""content004542"",//评价内容 +# ""modTime"": ""2021-07-05"",//评价时间,展示使用 +# ""cardName"": ""299"",//卡券名称,展示使用 +# ""userName"": ""nick_name40221""//用户名称,展示使用 +# }, +# ... +# ], +# ""code"": 200, +# ""msg"": ""查询成功"" +#}" +POST http://localhost:8091//default/index/storeCommentList +Accept: */* +Cache-Control: no-cache +Content-Type: application/json + +{ + "providerId": 4, + "storeId": 130 +} + + + +############### END #################### + + +############### 小程序展示接口测试 #################### + + +### +### 根据运营商,商户id,查询商户详情 增加后拼接参数意味着是二维码分享?recommenderId=124&recommenderLevel=1 +#返回结果说明 +#{ +# "msg": "获取成功",// +# "recommenderId": "124",//推荐人id,只在在url后面带有该参数时才会返回该值 +# "code": 200, +# "data": { +# "providerId": 4,//运营商id +# "storeId": 124,//商家id +# "storeName": "4商家名称008",//商家名称,展示使用 +# "storePhone": "13000004008",//商家电话,展示联系时使用 +# "serviceState": "0",//商家在线状态 +# "salerId": 1,//对应销售id +# "storeAddr": "4商家名称008商家地址'",//商家地址,展示导航时使用 +# "storeLon": 116.6160200000,//商家位置,导航时使用 +# "storeLat": 39.8341900000,//商家位置,导航时使用 +# "onService": "2商家名称001商家地址",//商家营业信息,展示使用 +# "detail": "

详情1

dsfasdfsadfasdf

fsadfsadfdsafsd

adsfsadfsaf

详情2

sdafasdfsd



",//商家详情内容,展示使用 +# "storeCarousel1": "http://10.1.192.113:60902/profile/upload/2021/07/02/fefc46d3-dc55-4c45-af07-f21377386ba9.jpg",//商家轮播图,展示使用 +# "storeCarousel2": "http://10.1.192.113:60902/profile/upload/2021/07/02/ccc51e2e-036b-4d13-9028-adbe7bbfe176.jpg",//商家轮播图,展示使用 +# "storeCarousel3": "http://10.1.192.113:60902/profile/upload/2021/07/02/648f3997-bebf-4e27-8264-b6a2795c6b89.jpg",//商家轮播图,展示使用 +# "storeCarousel4": "http://10.1.192.113:60902/profile/upload/2021/07/02/61127f59-dd36-43ff-827b-baae7a0ea883.jpg",//商家轮播图,展示使用 +# "storeCarousel5": "http://10.1.192.113:60902/profile/upload/2021/07/02/cea01831-ab52-46ec-b8ce-dc9d64bdec6c.jpg",//商家轮播图,展示使用 +# "storeCarousel6": "http://10.1.192.113:60902/profile/upload/2021/07/02/09216bac-25fa-4112-a122-ccf140158b2d.jpg",//商家轮播图,展示使用 +# "chkCount": 262,//商家核消记录数 +# "starAvg": 2.90,//商家综合评价,展示使用 +# "segchkRecommenderStoreLableWebList": [//商家标签 +# { +# "lableSortId": 2,//标签id +# "lableTypeId": 2,//一级标签id +# "lableName": "团购",//标签名称,展示使用 +# }, +# ... +# ] +# }, +# "recommenderLevel": "1"//推荐人角色,只在在url后面带有该参数时才会返回该值 +#} +POST http://localhost:8091//default/index/storeDetails?recommenderId=124&recommenderLevel=1 +Accept: */* +Cache-Control: no-cache +Content-Type: application/json + +{ + "providerId": 4, + "storeId": 124 +} + +### +### 根据运营商id,返回轮播图列表 +#返回结果 +#{ +# "total": 6,//该运营商轮播图数量 +# "rows": [ +# { +# "providerId": 2,//运营商id,跳转商家详情使用 +# "storeId": 3,//商家id,跳转商家详情使用 +# "storeCarousel": "http://10.1.192.113:60902/profile/upload/2021/07/05/606861e9-02d2-4c66-8e44-31a20ba4112d.jpg",//商家首页轮播图,展示使用 +# "sortId": 0,//轮播图顺序 +# }, +# ... +# ], +# "code": 200, +# "msg": "查询成功" +#} +POST http://localhost:8091//default/index/getBannersByProvider +Accept: */* +Cache-Control: no-cache +Content-Type: application/json + +{ + "providerId": 3 +} + +### +### 根据标签id,会员卡类型id,搜索商户列表 +POST http://localhost:8091//default/index/listByProviderwithLable +Accept: */* +Cache-Control: no-cache +Content-Type: application/json + +{ + "providerId": 2, + "sortType": 1, + "lableId": 2, + "typeId": 2, + "userLon": 116.25849, + "userLat": 39.684333 +} + +### +### 根据运营商id查询seg首页推荐商户列表 +POST http://localhost:8091//default/index/listByProvider +Accept: */* +Cache-Control: no-cache +Content-Type: application/json + +{ + "providerId": 2, + "sortType": 3, + "userLon": 116.25849, + "userLat": 39.684333 +} + +### +### 搜索商户名称,根据名称,标签,充值卡等 +#请求参数 +#{ +# "providerId": 2, //*运营商id +# "sortType": 0, // 排序方式 0,默认排序,1热度,2评价,3距离 +# "storeName": "99", //*商家名称(即搜索内容) +# "lableName": "99", //*标签名称(即搜索内容) +# "userLon": 114.123456, //用户位置 +# "userLat": 43.123456 //用户位置 +#} +#返回结果 +#{ +# "total": 51,搜索的商家数量 +# "rows": [ +# { +# "providerId": 2,运营商id +# "storeId": 3,商家id,用于进行商家详情查询使用 +# "storeName": "2商家名称001", 商家名称,展示使用 +# "serviceState": "0",服务状态,在线 +# "storeSort": 3,商家展示顺序 +# "storeIcon": "http://10.1.192.113:60902/profile/upload/2021/07/02/706f0a58-6031-4523-abbd-dc5dd823278c.jpg", 商家小图片,列表模式时使用 +# "storeGificon": "http://10.1.192.113:60902/profile/upload/2021/07/02/e4c00b15-84f7-491d-bb34-bf5253f7f6b7.jpg", 商家大图片,大图模式时使用 +# "storeLon": 116.2667540000, 商家位置 +# "storeLat": 39.6789740000, +# "userDist": 0, 用户距离,展示使用 +# "chkCount": 89, 热度,展示使用 +# "starAvg": 3.16, 综合评价,展示使用 +# "salerId": 3, 销售id +# "lables": [ 商家支持的标签列表 +# { +# "lableId": 0, 标签id +# "lableTypeId": 2, 一级标签id +# "lableName": "团购", 标签名称,展示使用 +# }, +# ... +# ] +# }, +# ... +# ], +# "code": 200, +# "msg": "查询成功" +#} +POST http://localhost:8091//default/index/StoreSearch +Accept: */* +Cache-Control: no-cache +Content-Type: application/json + +{ + "providerId": 2, + "sortType": 0, + "storeName": "99", + "lableName": "99", + "userLon": 114.123456, + "userLat": 43.123456 +} + +###查询seg标签列表 +###返回值说明 +#"{ +# ""total"": 7,首页标签区域运营商的标签列表,超过8个时最后一个标签为更多 +# ""rows"": [ +# { +# ""lableId"": 0, 子标签id,查询使用 +# ""lableSortId"": 0, 标签显示顺序,一级标签下的显示顺序 +# ""lableTypeId"": 0, 一级标签id,查询使用 +# ""lableName"": ""9块9"", 标签名称,展示使用 +# ""lablePic"": ""http://10.1.192.113:60902/profile/upload/2021/07/05/4f8fb474-97d9-4547-afca-47a2ca1d5180.jpg"" 标签图标,展示使用 +# }, +# ... +# ], +# ""code"": 200, +# ""msg"": ""查询成功"" +#}" +GET http://localhost:8091//default/index/lableListByProvider?providerId=2 +Accept: */* +Cache-Control: no-cache +Content-Type: application/json + + +### +### 根据用户当前所在地市行政id,返回运营商id 尹志颖 +### 返回值说明 { +# "code": 200, +# "data": 2//该值用于在小程序内部留存,在后续接口请求时都会用到 +#} +GET http://localhost:8091//default/index/getProviderByadcode +Accept: */* +Cache-Control: no-cache +Content-Type: application/json + +130502 + +### +### 测试微信账号绑定 +GET http://localhost:8091//bindaccount +Accept: */* +Cache-Control: no-cache +Content-Type: application/json +Authorization: Bearer {{token1}} + +{ + "userId": "503", + "providerId": "2", + "userLevel": "2", + "code": "001kiv000uUEsM11G5000vLWKN2kiv0m" +} + +### 测试token取值 +GET http://localhost:8091/tokentest +Accept: application/json +Content-Type: application/json + +{{bindtoken1}} + +### 用户利用token进行登录 +POST http://yxr8cu.natappfree.cc/login +Accept: */* +Cache-Control: no-cache +Content-Type: application/json +Authorization: Bearer {{bindtoken}} + +{ + "userId": 3, + "providerId": 2, + "userLevel": 2, + "cardID": "11111" +} + +### 已有用户的登录注册标识 +GET http://localhost:8091/register +Accept: application/json +Content-Type: application/json + +{ + "mobile": "13000020002", + "code": "1234", + "providerId": "2", + "remark": "999999" +} + +> {% client.global.set("token2", response.body.data.token); %} + +### 进行新用户注册 remark测试标识 +GET http://localhost:8091/register +Accept: application/json +Content-Type: application/json + +{ + "mobile": "99999999999", + "code": "1234", + "recommendId": "5", + "recommendLevel": "1", + "providerId": "2", + "remark": "999999" +} + +> {% client.global.set("token1", response.body.data.token); %} + +### 发送短信验证码 +POST http://localhost:8091/sendmobilecode?mobile=99999999999 +Accept: */* +Cache-Control: no-cache +Content-Type: application/json + diff --git a/ruoyi-segchk/pom.xml b/ruoyi-segchk/pom.xml new file mode 100644 index 0000000..a224734 --- /dev/null +++ b/ruoyi-segchk/pom.xml @@ -0,0 +1,121 @@ + + + + ruoyi + com.ruoyi + 3.6.0 + ../pom.xml + + 4.0.0 + + ruoyi-segchk + + + 4.8.10.ALL + + + system系统模块 + + + + + + + + com.google.zxing + core + 3.4.0 + + + + com.alipay.sdk + alipay-sdk-java + ${alipay.version} + + + fastjson + com.alibaba + + + + + org.bouncycastle + bcprov-jdk16 + 1.46 + + + + dom4j + dom4j + 1.6.1 + + + + + com.github.qcloudsms + qcloudsms + 1.0.6 + + + com.aliyun + aliyun-java-sdk-core + 4.0.6 + + + + com.aliyun + aliyun-java-sdk-dysmsapi + 1.1.0 + + + + com.qcloud + cos_api + 5.6.8 + + + + com.aliyun.oss + aliyun-sdk-oss + 2.5.0 + + + + + + + + + com.ruoyi + ruoyi-system + + + io.swagger + swagger-models + 1.6.2 + + + + org.apache.httpcomponents + httpclient + 4.5.6 + + + + org.apache.httpcomponents + httpcore + 4.4.12 + + + + org.apache.httpcomponents + httpmime + 4.5.6 + + + + + + \ No newline at end of file diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/member/domain/UmsMember.java b/ruoyi-segchk/src/main/java/com/ruoyi/member/domain/UmsMember.java new file mode 100644 index 0000000..ea6ef55 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/member/domain/UmsMember.java @@ -0,0 +1,891 @@ +package com.ruoyi.member.domain; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; +import com.ruoyi.util.ShareCodeUtils; +import io.swagger.annotations.ApiModelProperty; +import org.springframework.util.StringUtils; + +import java.math.BigDecimal; +import java.time.LocalDateTime; +import java.util.Date; +import java.util.Objects; + +/** + * 会员对象 ums_member + * + * @author 魔金商城 + * @date 2020-07-25 + */ +public class UmsMember extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * 主键id + */ + private Long id; + + /** + * 用户名 + */ + @Excel(name = "用户名") + private String username; + + /** + * 用户密码 + */ + @Excel(name = "用户密码") + private String password; + + /** + * 昵称 + */ + @Excel(name = "昵称") + private String nickname; + + /** + * 头像地址 + */ + @Excel(name = "头像地址") + private String image; + + /** + * 真实姓名 + */ + @Excel(name = "真实姓名") + private String relename; + + /** + * 身份证 + */ + @Excel(name = "身份证") + private String cardid; + + /** + * 性别 0 保密 1男 2女 默认0 + */ + @Excel(name = "性别 0 保密 1男 2女 默认0") + private String gender; + + /** + * 生日 + */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "生日", width = 30, dateFormat = "yyyy-MM-dd") + private Date birthday; + + /** + * 月收入 0 无收入 1 2000以下 2 2000-3999 3 4000-59994 6000-7999 5 8000以上 + */ + @Excel(name = "月收入 0 无收入 1 2000以下 2 2000-3999 3 4000-5999 4 6000-7999 5 8000以上") + private String monthlyIncome; + + /** + * 婚姻状况 0 保密 1未婚 2 已婚 默认0 保姆 + */ + @Excel(name = "婚姻状况 0 保密 1未婚 2 已婚 默认0 保姆") + private String marriageStatus; + + /** + * 手机号码 + */ + @Excel(name = "手机号码") + private String mobile; + + /** + * 邮箱地址 + */ + @Excel(name = "邮箱地址") + private String email; + + /** + * 更改中的邮箱(绑定新邮箱使用) + */ + @Excel(name = "更改中的邮箱", readConverterExp = "绑=定新邮箱使用") + private String modifiedEmail; + + /** + * 校验码(绑定新邮箱时使用) + */ + @Excel(name = "校验码", readConverterExp = "绑=定新邮箱时使用") + private String checkCode; + + /** + * 省 + */ + @Excel(name = "省") + private Long province; + + /** + * 市 + */ + @Excel(name = "市") + private Long city; + + /** + * 区 + */ + @Excel(name = "区") + private Long county; + + /** + * 详细地址 + */ + @Excel(name = "详细地址") + private String detailaddress; + + /** + * 兴趣爱好 + */ + @Excel(name = "兴趣爱好") + private String interest; + + /** + * 店铺id 平台的为0 默认为平台 + */ + @Excel(name = "店铺id 平台的为0 默认为平台") + private Long storeId; + + /** + * 1 普通用户 2 商家店铺用户 3 店铺员工 + */ + @Excel(name = "1 普通用户 2 商家店铺用户 3 店铺员工") + private String type; + + private String appletOpenId; + + private String appOpenId; + + private String h5OpenId; + /** + * 总的消费金额 + */ + @Excel(name = "总的消费金额") + private BigDecimal consumptionAmount; + + /** + * 预存款支付密码 + */ + @Excel(name = "预存款支付密码") + private String paypassword; + + /** + * 用户注册来源 1 pc 2app 3 手机h5 4 管理员后台新增 5applet + */ + @Excel(name = "用户注册来源 1 pc 2app 3 手机h5 4 管理员后台新增 ") + private String source; + + /** + * 用户状态 1 正常 2 冻结 3 未启用 默认1 + */ + @Excel(name = "用户状态 1 正常 2 冻结 3 未启用 默认1 ") + private String status; + + /** + * 会员签到次数 + */ + @Excel(name = "会员签到次数") + private int signNum; + + /** + * 手机是否验证 0 否 1 验证 默认0 + */ + @Excel(name = "手机是否验证 0 否 1 验证 默认0 ") + private String isMobileVerification; + + /** + * 邮箱是否验证 0 否 1 验证 默认0 + */ + @Excel(name = "邮箱是否验证 0 否 1 验证 默认0 ") + private String isEmailVerification; + + /** + * 错误登录的次数 + */ + @Excel(name = "错误登录的次数") + private int loginErrorCount; + + /** + * 删除标记 0 未删除 1删除 默认0 + */ + private int delFlag; + + /** + * 修改时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "修改时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date modifyTime; + + /** + * 删除时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "删除时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date delTime; + + /** + * 锁定时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "锁定时间", width = 30, dateFormat = "yyyy-MM-dd") + private LocalDateTime lockTime; + + /** + * 最近登陆时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "最近登陆时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date lastLoginTime; + + /** + * 推荐人的会员id 如果没有 则为-1 默认为-1 + */ + @Excel(name = "推荐人的会员id 如果没有 则为-1 默认为-1") + private Long recommended = -1L; + + /** + * 二级推荐人的会员id (上级的上级) 如果没有 则为-1 默认为-1 + */ + @Excel(name = "二级推荐人的会员id ", readConverterExp = "上=级的上级") + private Long sRecommended = -1L; + + /** + * 会员自己的推荐码 + */ + @Excel(name = "会员自己的推荐码") + private String selfRecommendCode; + + /** + * 会员的佣金 + */ + @Excel(name = "会员的佣金") + private BigDecimal commission; + + /** + * 会员所属的店铺id + */ + @Excel(name = "会员所属的店铺id") + private Long beloneStoreId; + /** + * 用户积分 + */ + @ApiModelProperty(value = "用户积分") + private int customerPoint; + private int subSpreadCustomerCount; + /** + * 推荐人code 如果为空 则说明没有推荐人 + */ + private String recommondCode; + /** + * 自动注册渠道类型 + */ + @ApiModelProperty(value = "自动注册渠道类型") + private String channelType; + private UmsMemberLevel customerLevel; + + private BigDecimal allPredeposit; + + /** + * 构造app用户注册对象 + * + * @param mobile 手机号码 + * @param password 密码 + * @param recommondCode 推荐吗 + * @return 返回app用户注册对象 + */ + public static UmsMember buildAppRegisterCustomer(String mobile, String password, String recommondCode) { + UmsMember customer = new UmsMember(); + customer.username = mobile; + customer.password = password; + customer.mobile = mobile; + customer.type = "1"; + customer.source = "2"; + customer.isMobileVerification = "1"; + + customer.recommondCode = recommondCode; + return customer; + } + + /** + * 构造h5用户注册对象 + * + * @param mobile 手机号码 + * @param recommondCode 推荐吗 + * @return 返回app用户注册对象 + */ + public static UmsMember buildH5RegisterCustomer(String mobile, String recommondCode) { + UmsMember customer = new UmsMember(); + customer.username = mobile; + customer.password = "123456"; + customer.mobile = mobile; + customer.type = "1"; + customer.source = "3"; + customer.isMobileVerification = "1"; + + customer.recommondCode = recommondCode; + return customer; + } + + /** + * 构造代客下单自动注册对象 + * + * @param mobile 手机号码 + * @return 返回代客下单自动注册对象 + */ + public static UmsMember buildStoreShoppingRegisterCustomer(String mobile, long beloneStoreId) { + UmsMember customer = new UmsMember(); + customer.username = mobile; + customer.password = "123456"; + customer.mobile = mobile; + customer.type = "1"; + customer.source = "4"; + customer.status = "1"; + customer.storeId = 0L; + customer.isMobileVerification = "1"; + customer.beloneStoreId = beloneStoreId; + return customer; + + } + + public int getSubSpreadCustomerCount() { + return subSpreadCustomerCount; + } + + public void setSubSpreadCustomerCount(int subSpreadCustomerCount) { + this.subSpreadCustomerCount = subSpreadCustomerCount; + } + + public String getRecommondCode() { + return recommondCode; + } + + public void setRecommondCode(String recommondCode) { + this.recommondCode = recommondCode; + } + + public UmsMemberLevel getCustomerLevel() { + return customerLevel; + } + + public void setCustomerLevel(UmsMemberLevel customerLevel) { + this.customerLevel = customerLevel; + } + + /** + * 设置下级分销会员数量 + * + * @param subSpreadCustomerCount 下级分销会员数量 + * @return 返回当前对象 + */ + public UmsMember addSubSpreadCustomerCount(int subSpreadCustomerCount) { + this.subSpreadCustomerCount = subSpreadCustomerCount; + return this; + } + + /** + * 设置自己的推荐吗 + * + * @return 返回当前对象 + */ + public UmsMember addSelfRecommondCode() { + this.selfRecommendCode = ShareCodeUtils.toSerialCode(Long.parseLong(this.mobile)); + return this; + } + + /** + * 判断是否有推荐人 有返回true 没有返回false + * + * @return 有返回true 没有返回false + */ + @JsonIgnore + public boolean hasRecommonded() { + return !StringUtils.isEmpty(this.recommondCode) || this.recommended != -1; + } + + /** + * 后端添加用户设置默认值 + * + * @return 返回用户信息 + */ + public UmsMember setDefaultValuesForAdminAdd() { + this.storeId = 0L; + this.type = "1"; + this.source = "4"; + this.status = "1"; + this.isMobileVerification = "1"; + if (!StringUtils.isEmpty(this.email)) { + this.isEmailVerification = "1"; + } + + this.beloneStoreId = 0L; + return this; + } + + /** + * 设置归属门店id + * + * @param beloneStoreId 归属门店id + * @return 返回用户信息 + */ + public UmsMember setBelongStoreIdForStore(long beloneStoreId) { + this.beloneStoreId = beloneStoreId; + return this; + } + + /** + * 清除用户密码 + */ + public UmsMember clearPassword() { + this.password = "**********"; + if (!StringUtils.isEmpty(this.paypassword)) { + this.paypassword = "**********"; + } + return this; + } + + /** + * 获取会员对象 + * + * @param customerId 会员id + * @return 会员对象 + */ + public UmsMember setCustomerId(long customerId) { + this.id = customerId; + return this; + } + + /** + * 获得会员的会员等级id + * + * @return 返回会员的会员等级id + */ + @JsonIgnore + public long getCustomerLevelId() { + return Objects.isNull(this.customerLevel) ? -1 : this.customerLevel.getId(); + } + + /** + * 获得会员等级名称 + * + * @return 返回会员等级名称 + */ + @JsonIgnore + public String getCustomerLevelName() { + return Objects.isNull(this.customerLevel) ? "" : this.customerLevel.getName(); + } + + /** + * 检查更改金额 + * + * @param money 更改金额 + * @return true 可以更改 false 更改后总金额小于0,不可以更改 + */ + public boolean checkConsumptionAmount(BigDecimal money) { + if (money.intValue() >= 0) { + return true; + } + if (money.abs().compareTo(this.consumptionAmount) > 0) { + return false; + } + return true; + } + + /** + * 检查更改佣金金额 + * + * @param money 更改佣金金额 + * @return true 可以更改 false 更改后总金额小于0,不可以更改 + */ + public boolean checkCommission(BigDecimal money) { + if (money.intValue() >= 0) { + return true; + } + if (money.abs().compareTo(this.commission) > 0) { + return false; + } + return true; + } + + + /** + * 为用户添加用户名 + * + * @param username + * @return + */ + public UmsMember addUsername(String username) { + this.username = username; + return this; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public String getNickname() { + return nickname; + } + + public void setNickname(String nickname) { + this.nickname = nickname; + } + + public String getImage() { + return image; + } + + public void setImage(String image) { + this.image = image; + } + + public String getRelename() { + return relename; + } + + public void setRelename(String relename) { + this.relename = relename; + } + + public String getCardid() { + return cardid; + } + + public void setCardid(String cardid) { + this.cardid = cardid; + } + + public String getGender() { + return gender; + } + + public void setGender(String gender) { + this.gender = gender; + } + + public Date getBirthday() { + return birthday; + } + + public void setBirthday(Date birthday) { + this.birthday = birthday; + } + + public String getMonthlyIncome() { + return monthlyIncome; + } + + public void setMonthlyIncome(String monthlyIncome) { + this.monthlyIncome = monthlyIncome; + } + + public String getMarriageStatus() { + return marriageStatus; + } + + public void setMarriageStatus(String marriageStatus) { + this.marriageStatus = marriageStatus; + } + + public String getMobile() { + return mobile; + } + + public void setMobile(String mobile) { + this.mobile = mobile; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public String getModifiedEmail() { + return modifiedEmail; + } + + public void setModifiedEmail(String modifiedEmail) { + this.modifiedEmail = modifiedEmail; + } + + public String getCheckCode() { + return checkCode; + } + + public void setCheckCode(String checkCode) { + this.checkCode = checkCode; + } + + public Long getProvince() { + return province; + } + + public void setProvince(Long province) { + this.province = province; + } + + public Long getCity() { + return city; + } + + public void setCity(Long city) { + this.city = city; + } + + public Long getCounty() { + return county; + } + + public void setCounty(Long county) { + this.county = county; + } + + public String getDetailaddress() { + return detailaddress; + } + + public void setDetailaddress(String detailaddress) { + this.detailaddress = detailaddress; + } + + public String getInterest() { + return interest; + } + + public void setInterest(String interest) { + this.interest = interest; + } + + public Long getStoreId() { + return storeId; + } + + public void setStoreId(Long storeId) { + this.storeId = storeId; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getAppletOpenId() { + return appletOpenId; + } + + public void setAppletOpenId(String appletOpenId) { + this.appletOpenId = appletOpenId; + } + + public String getAppOpenId() { + return appOpenId; + } + + public void setAppOpenId(String appOpenId) { + this.appOpenId = appOpenId; + } + + public String getH5OpenId() { + return h5OpenId; + } + + public void setH5OpenId(String h5OpenId) { + this.h5OpenId = h5OpenId; + } + + public BigDecimal getConsumptionAmount() { + return consumptionAmount; + } + + public void setConsumptionAmount(BigDecimal consumptionAmount) { + this.consumptionAmount = consumptionAmount; + } + + public String getPaypassword() { + return paypassword; + } + + public void setPaypassword(String paypassword) { + this.paypassword = paypassword; + } + + public String getSource() { + return source; + } + + public void setSource(String source) { + this.source = source; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public int getSignNum() { + return signNum; + } + + public void setSignNum(int signNum) { + this.signNum = signNum; + } + + public String getIsMobileVerification() { + return isMobileVerification; + } + + public void setIsMobileVerification(String isMobileVerification) { + this.isMobileVerification = isMobileVerification; + } + + public String getIsEmailVerification() { + return isEmailVerification; + } + + public void setIsEmailVerification(String isEmailVerification) { + this.isEmailVerification = isEmailVerification; + } + + public int getLoginErrorCount() { + return loginErrorCount; + } + + public void setLoginErrorCount(int loginErrorCount) { + this.loginErrorCount = loginErrorCount; + } + + public int getDelFlag() { + return delFlag; + } + + public void setDelFlag(int delFlag) { + this.delFlag = delFlag; + } + + public Date getModifyTime() { + return modifyTime; + } + + public void setModifyTime(Date modifyTime) { + this.modifyTime = modifyTime; + } + + public Date getDelTime() { + return delTime; + } + + public void setDelTime(Date delTime) { + this.delTime = delTime; + } + + public LocalDateTime getLockTime() { + return lockTime; + } + + public void setLockTime(LocalDateTime lockTime) { + this.lockTime = lockTime; + } + + public Date getLastLoginTime() { + return lastLoginTime; + } + + public void setLastLoginTime(Date lastLoginTime) { + this.lastLoginTime = lastLoginTime; + } + + public Long getRecommended() { + return recommended; + } + + public void setRecommended(Long recommended) { + this.recommended = recommended; + } + + public Long getsRecommended() { + return sRecommended; + } + + public void setsRecommended(Long sRecommended) { + this.sRecommended = sRecommended; + } + + public String getSelfRecommendCode() { + return selfRecommendCode; + } + + public void setSelfRecommendCode(String selfRecommendCode) { + this.selfRecommendCode = selfRecommendCode; + } + + public BigDecimal getCommission() { + return commission; + } + + public void setCommission(BigDecimal commission) { + this.commission = commission; + } + + public Long getBeloneStoreId() { + return beloneStoreId; + } + + public void setBeloneStoreId(Long beloneStoreId) { + this.beloneStoreId = beloneStoreId; + } + + public int getCustomerPoint() { + return customerPoint; + } + + public void setCustomerPoint(int customerPoint) { + this.customerPoint = customerPoint; + } + + public String getChannelType() { + return channelType; + } + + public void setChannelType(String channelType) { + this.channelType = channelType; + } + + public BigDecimal getAllPredeposit() { + return allPredeposit; + } + + public void setAllPredeposit(BigDecimal allPredeposit) { + this.allPredeposit = allPredeposit; + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/member/domain/UmsMemberLevel.java b/ruoyi-segchk/src/main/java/com/ruoyi/member/domain/UmsMemberLevel.java new file mode 100644 index 0000000..3af9e36 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/member/domain/UmsMemberLevel.java @@ -0,0 +1,206 @@ +package com.ruoyi.member.domain; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +import java.math.BigDecimal; +import java.util.Date; +import java.util.Objects; + +/** + * 会员等级对象 ums_member_level + * + * @author 魔金商城 + * @date 2020-07-25 + */ +public class UmsMemberLevel extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * 主键id + */ + private Long id; + + /** + * 会员等级名称 + */ + @Excel(name = "会员等级名称") + private String name; + + /** + * 消费小值(包含该值) + */ + @Excel(name = "消费小值", readConverterExp = "包=含该值") + private Long minMoney; + + /** + * 消费金额最大值 不包含该值 + */ + @Excel(name = "消费金额最大值 不包含该值") + private Long maxMoney; + + /** + * 会员折扣 + */ + @Excel(name = "会员折扣") + private BigDecimal discount; + + /** + * 删除标记 0 未删除 1删除 默认0 + */ + private int delFlag; + + /** + * 修改时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "修改时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date modifyTime; + + /** + * 删除时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "删除时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date delTime; + + /** + * 构造未知等级实体 + * + * @return 返回未知等级实体 + */ + public static UmsMemberLevel buildNoLevel() { + UmsMemberLevel customerLevel = new UmsMemberLevel(); + customerLevel.name = "非会员"; + return customerLevel; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Long getMinMoney() { + return minMoney; + } + + public void setMinMoney(Long minMoney) { + this.minMoney = minMoney; + } + + public Long getMaxMoney() { + return maxMoney; + } + + public void setMaxMoney(Long maxMoney) { + this.maxMoney = maxMoney; + } + + public BigDecimal getDiscount() { + return discount; + } + + public void setDiscount(BigDecimal discount) { + this.discount = discount; + } + + public int getDelFlag() { + return delFlag; + } + + public void setDelFlag(int delFlag) { + this.delFlag = delFlag; + } + + public Date getModifyTime() { + return modifyTime; + } + + public void setModifyTime(Date modifyTime) { + this.modifyTime = modifyTime; + } + + public Date getDelTime() { + return delTime; + } + + public void setDelTime(Date delTime) { + this.delTime = delTime; + } + + /** + * 根据传入的金额判断 是否是当前等级 + * + * @param money 传入金金额 + * @return 判断规则 [0,100) 前闭后开 包含0 不包含100 + */ + public boolean isCurrentLevl(BigDecimal money) { + if (Objects.isNull(money)) { + return false; + } + return money.intValue() >= this.minMoney && money.intValue() < this.maxMoney; + } + + /** + * 判断传入的会员等级消费金额和当前的会员等级消费金额是否有交集 + * + * @param customerLevel 会员等级 + * @return 有返回true 没有返回false 传入的值为空 返回false + */ + public boolean hasIntersection(UmsMemberLevel customerLevel) { + if (Objects.isNull(customerLevel)) { + return false; + } + + // 如果传入的最小值比当前的最大值要大于等于 则肯定没有交集 + if (customerLevel.minMoney >= this.maxMoney) { + return false; + } + if (customerLevel.minMoney >= customerLevel.maxMoney) { + return true; + } + // 如果传入的最小值在当前会员等级最大值和最小值之间(不包含最大值 包含最小值) 则肯定会有交集 + if (customerLevel.minMoney >= this.minMoney && customerLevel.minMoney < this.maxMoney) { + return true; + } + + // 如果传入的最小值在比当前的最小值还小 则看传入的最大值 + if (customerLevel.minMoney < this.minMoney) { + if (customerLevel.maxMoney <= this.minMoney) { + return false; + } else { + return true; + } + } + return true; + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("name", getName()) + .append("minMoney", getMinMoney()) + .append("maxMoney", getMaxMoney()) + .append("discount", getDiscount()) + .append("delFlag", getDelFlag()) + .append("createTime", getCreateTime()) + .append("modifyTime", getModifyTime()) + .append("delTime", getDelTime()) + .toString(); + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/member/mapper/WeChatCustomerLinkMapper.java b/ruoyi-segchk/src/main/java/com/ruoyi/member/mapper/WeChatCustomerLinkMapper.java new file mode 100644 index 0000000..b8b8090 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/member/mapper/WeChatCustomerLinkMapper.java @@ -0,0 +1,65 @@ +package com.ruoyi.member.mapper; + + +import com.ruoyi.segchk.domain.WeChatCustomerLink; +import org.springframework.stereotype.Repository; + +/** + * 微信用户关联数据库接口 + */ +@Repository +public interface WeChatCustomerLinkMapper { + + /** + * 根据openId查询关联实体 + * + * @param openId 微信用户唯一标识 + */ + + WeChatCustomerLink queryWeChatCustomerLinkByOpenId(String openId); + + + /** + * 根据customerId查询关联实体 + * + * @param customerId 用户id + */ + + WeChatCustomerLink queryWeChatCustomerLinkByCustomerId(long customerId); + + /** + * 根据unionId查询关联实体 + * + * @param unionId 微信联合登录id + */ + + WeChatCustomerLink queryWeChatCustomerLinkByUnionId(String unionId); + + /** + * 增加关联 + * + * @param weChatCustomerLink 关联实体 + * @return 1:成功 + */ + + int addWeChatCustomerLink(WeChatCustomerLink weChatCustomerLink); + + /** + * 删除关联 + * + * @param customerId 用户id + * @return 1:成功 + */ + + int deleteWeChatCustomerLink(long customerId); + + /** + * 更新微信用户关联 + * + * @param weChatCustomerLink 微信用户关联实体 + * @return 1成功 否则失败 + */ + + int updateWeChatCustomerLink(WeChatCustomerLink weChatCustomerLink); +} + diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/member/service/LoginService.java b/ruoyi-segchk/src/main/java/com/ruoyi/member/service/LoginService.java new file mode 100644 index 0000000..8b51282 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/member/service/LoginService.java @@ -0,0 +1,23 @@ +package com.ruoyi.member.service; + + +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.segchk.domain.SegchkUserWebReq; + +import java.util.function.Consumer; + +/** + * Created by 魔金商城 on 17/7/17. + * 登录接口 + */ +public interface LoginService { + + + /** + * segchk前端登录 (app,pc,mobile) + * + * @param segchkUserWebReq 登入参数 + * @return 返回码 -1 用户名或密码错误 -2 账号冻结 -3 账号锁定 1 成功 -4 验证码错误 + */ + AjaxResult login(SegchkUserWebReq segchkUserWebReq); +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/member/service/RechargeService.java b/ruoyi-segchk/src/main/java/com/ruoyi/member/service/RechargeService.java new file mode 100644 index 0000000..36f5547 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/member/service/RechargeService.java @@ -0,0 +1,36 @@ +package com.ruoyi.member.service; + + +import com.ruoyi.common.core.domain.AjaxResult; + +import java.math.BigDecimal; + +/** + * 充值服务 + */ +public interface RechargeService { + + /** + * 支付宝pc支付 + * + * @param money 充值金额 + * @param customerId 用户id + * @param type 支付类型 1:订单支付 2:预存款充值 + * @return 返回码和支付宝支付的html 返回码说明 -1:用户不存在 -2:生成充值记录出错 -5:支付宝生成订单出错 -7 没有设置网站地址 -8 缺少配置 -9 没有启用 1 成功 + */ + AjaxResult aliPagePay(String transCode, BigDecimal money, int payType, long customerId, int type); + + /** + * 微信扫码支付 + * + * @param money 充值金额 + * @param customerId 用户id + * @param ip 请求真实ip + * @param type 支付类型 1:订单支付 2:预存款充值 + * @return 返回码和支付宝支付的html 返回码说明 -1:用户不存在 -2:生成充值记录出错 -5:微信生成订单出错 -7 没有设置网站地址 -8 缺少配置 -9 没有启用 1 成功 + */ + AjaxResult wechatQRPay(String transCode, BigDecimal money, int payType, long customerId, String ip, int type); + + + +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/member/service/RegisterService.java b/ruoyi-segchk/src/main/java/com/ruoyi/member/service/RegisterService.java new file mode 100644 index 0000000..7d0257a --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/member/service/RegisterService.java @@ -0,0 +1,60 @@ +package com.ruoyi.member.service; + +import java.util.function.Consumer; + +/** + * Created by 魔金商城 on 17/11/18. + * 注册服务接口 + */ +public interface RegisterService { + + /** + * 发送注册短信验证码 + * + * @param mobile 手机号码 + * @param consumer 回调接口 + * @return 0 成功 1 失败 -1 手机号码已经存在 + */ + int sendRegisterSmsCode(String mobile, Consumer consumer); + + /** + * 发送注册短信验证码(PC端用,带有图片验证码) + * + * @param mobile 手机号码 + * @param kaptcha 用户输入的图片验证码 + * @param oldKaptcha redis中的图片验证码 + * @param consumer 回调接口 + * @return 0 成功 1 失败 -4 手机号码已经存在 -1 图片验证码失效或不存在 -2 图片验证码为空 -3 图片证码不正确 + */ + int sendRegisterSmsCodeForPc(String mobile, String kaptcha, String oldKaptcha, Consumer consumer); + + /** + * 用户注册 + * + * @param mobile 手机号码 + * @param password 密码 + * @param code 用户输入的手机验证码 + * @param originCode 生成的手机验证码 + * @param recommondCode 推荐吗 + * @return -1 手机验证码错误 -2 参数错误 0 失败 成功>0 -3 手机号码已存在 -10 推荐人不存在 + */ + int registerCustomer(String mobile, String password, String code, String originCode, String recommondCode); + + /** + * 免密用户自动注册 + * + * @param phoneNo 手机号码 + * @return -1 手机验证码错误 -2 参数错误 0 失败 成功>0 -3 手机号码已存在 -10 推荐人不存在 + */ + Long unAuthRegister(String phoneNo, String channelType); + + /** + * 校验验证码 + * + * @param kaptcha 验证码 + * @param kaptchaInSession session中的验证码 + * @return -1 验证码失效或不存在 -2 验证码为空 -3验证码不正确 1 成功 + */ + int checkKaptcha(String kaptcha, String kaptchaInSession); + +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/member/service/RegisterServiceApi.java b/ruoyi-segchk/src/main/java/com/ruoyi/member/service/RegisterServiceApi.java new file mode 100644 index 0000000..47da24f --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/member/service/RegisterServiceApi.java @@ -0,0 +1,38 @@ +package com.ruoyi.member.service; + +import com.ruoyi.common.core.domain.AjaxResult; + +/** + * 注册服务聚合接口 + */ +public interface RegisterServiceApi { + + /** + * 用户注册 + * + * @param mobile 手机号码 + * @param password 密码 + * @param code 用户输入的手机验证码 + * @param originCode 生成的手机验证码 + * @param recommondCode 推荐吗 + * @return -1 手机验证码错误 -2 参数错误 0 失败 成功>0 -3 手机号码已存在 -10 推荐人不存在 + */ +// int registerCustomer(String mobile, String password, String code, String originCode, String recommondCode); + + + /** + * 用户注册 + * + * @param mobile 手机号码 + * @param code 用户输入的手机验证码 + * @param originCode 生成的手机验证码 + * @param recommondId 推荐吗 + * @param recommondLevel 推荐角色 + * @param providerId + * @param remark + * @return -1 手机验证码错误 -2 参数错误 0 失败 成功>0 -3 手机号码已存在 -10 推荐人不存在 + */ + AjaxResult registerCustomer(String mobile, String code, String originCode, String recommondId, String recommondLevel, String providerId, String remark); + + String createToke(String subject, Long userId, Long providerId, Integer userLevel); +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/member/service/SmsService.java b/ruoyi-segchk/src/main/java/com/ruoyi/member/service/SmsService.java new file mode 100644 index 0000000..cae1b2e --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/member/service/SmsService.java @@ -0,0 +1,71 @@ +package com.ruoyi.member.service; + +import java.math.BigDecimal; + +/** + * Created by 魔金商城 on 17/11/18. + * 短信验证码服务接口 + */ +public interface SmsService { + + /** + * 发送短信 + * + * @param phone 手机号码 + * @param content 发送内容 + * @return 成功返回0 失败返回1 + */ + int sendSms(String phone, String content); + + /** + * 发送核销码短信 + * + * @param phone 手机号码 + * @param code 订单号 + * @param writeOffCode 核销码 + * @param storeName 店铺名称 + * @return 成功返回0 失败返回1 + */ + int sendWiteOffCodeSms(String phone, String code, String writeOffCode, String storeName); + + /** + * 发送虚拟商品订单核销码短信 + * + * @param phone 手机号码 + * @param code 订单号 + * @param writeOffCode 核销码 + * @param storeName 店铺名称 + * @return 成功返回0 失败返回1 + */ + int sendVirtualOrderWiteOffCodeSms(String phone, String code, String writeOffCode, String storeName); + + + /** + * 发送社区团购审核结果通知短信 + * + * @param phone 手机号码 + * @param submittime 通过时间 + * @return 成功返回0 失败返回1 + */ + int sendAuditTemplateOffCodeSms(String phone, String submittime); + + /** + * 发送社区团购结算短信 + * + * @param communityName 社区团购名称 + * @param price 佣金 + * @param phone 手机号码 + * @return 成功发挥0 失败返回1 + */ + int sendCommunityBuySettlementSms(String phone, String communityName, BigDecimal price); + + /** + * 社区团购提现申请打款通知 + * + * @param phone 手机号码 + * @param submittime 打款时间 + * @param price 金额 + * @return 成功返回0 失败返回1 + */ + int sendCommunityBuyWitudrawSms(String phone, String submittime, BigDecimal price); +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/member/service/WeChatAppletLoginService.java b/ruoyi-segchk/src/main/java/com/ruoyi/member/service/WeChatAppletLoginService.java new file mode 100644 index 0000000..f7307e7 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/member/service/WeChatAppletLoginService.java @@ -0,0 +1,66 @@ +package com.ruoyi.member.service; + + +import com.ruoyi.member.vo.AppletLoginInfo; +import com.ruoyi.member.vo.AppletLoginRedisParamResponse; +import com.ruoyi.util.WeChatAppletUserInfo; + +import java.util.function.Consumer; + +/** + * 微信小程序登录服务 + * + * @author SK + * @since 2018/6/13 + */ +public interface WeChatAppletLoginService { + + /** + * 小程序获取登录信息 + * + * @param code 用户登录凭证(有效期五分钟)。开发者需要在开发者服务器后台调用 api,使用 code 换取 openid 和 session_key 等信息 + * @param unionId 联合登录id + * @param claimsConsumer 回调 + * @return 登录信息 + */ + AppletLoginInfo getLoginInfo(String code, String unionId, Consumer claimsConsumer); + + /** + * 处理小程序用户信息 + * + * @param weChatAppletUserInfo 小程序用户信息实体 + * @param openId 微信用户标识 + * @param sessionKey 小程序sessionKey + * @param claimsConsumer 回调 + * @return 登录信息 + */ + AppletLoginInfo dealUserInfo(WeChatAppletUserInfo weChatAppletUserInfo, String openId, String sessionKey, Consumer claimsConsumer); + + + /** + * 检验用户是否已绑定 + * + * @param userName 用户名 + * @return -9已经绑定过 1:没有绑定 + */ + int checkCustomerBind(String userName); + + /** + * 绑定账号 + * + * @param openId 微信用户唯一标识 + * @param unionId 微信联合登录id + * @param customerId 用户id + * @return 1:成功 + */ + int bindAccount(String openId, String unionId, long customerId); + + /** + * 解绑账号 + * + * @param customerId 用户id + * @param unionId 联合登录id,用于redis缓存 + * @return 1:成功 + */ + int unbindAccount(long customerId, String unionId); +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/member/service/WeChatCustomerLinkService.java b/ruoyi-segchk/src/main/java/com/ruoyi/member/service/WeChatCustomerLinkService.java new file mode 100644 index 0000000..1227ac1 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/member/service/WeChatCustomerLinkService.java @@ -0,0 +1,79 @@ +package com.ruoyi.member.service; + + +import com.ruoyi.segchk.domain.SegchkUserWechat; +import com.ruoyi.segchk.domain.WeChatCustomerLink; +import org.springframework.stereotype.Repository; + +/** + * 微信用户关联服务接口 + */ +@Repository +public interface WeChatCustomerLinkService { + + /** + * 增加关联 + * + * @param weChatCustomerLink 关联实体 + * @return 1:成功 + */ + int addWeChatCustomerLink(WeChatCustomerLink weChatCustomerLink); + + /** + * 根据openId查询关联实体 + * + * @param openId 微信用户唯一标识 + */ + WeChatCustomerLink queryWeChatCustomerLinkByOpenId(String openId); + + + /** + * 根据用户id查询关联实体 + * + * @param customerId 用户id + */ + WeChatCustomerLink queryWeChatCustomerLinkByCustomerId(long customerId); + + /** + * 根据用户名查询关联实体 + * + * @param userName 用户名 + */ + WeChatCustomerLink queryWeChatCustomerLinkByUserName(String userName); + + /** + * 根据unionId查询关联实体 + * + * @param unionId 微信联合登录id + */ + WeChatCustomerLink queryWeChatCustomerLinkByUnionId(String unionId); + + + /** + * 解绑账号 + * + * @param customerId 用户id + * @param unionId 联合登录id,redis缓存使用 + * @return 1:成功 + */ + int unbindWeChatCustomerLink(long customerId, String unionId); + + + /** + * 更新微信用户关联 + * + * @param weChatCustomerLink 微信用户关联实体 + * @return 1成功 否则失败 + */ + int updateWeChatCustomerLink(WeChatCustomerLink weChatCustomerLink); + + /** + * 更新微信用户关联 + * + * @param segchkUserWechat 微信用户关联实体 + * @param userLevel + * @return 1成功 否则失败 + */ + int addSegchkUserWechat(SegchkUserWechat segchkUserWechat, String userLevel); +} + diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/member/service/impl/BindNewEmailServiceImpl.java b/ruoyi-segchk/src/main/java/com/ruoyi/member/service/impl/BindNewEmailServiceImpl.java new file mode 100644 index 0000000..e69de29 diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/member/service/impl/LoginServiceImpl.java b/ruoyi-segchk/src/main/java/com/ruoyi/member/service/impl/LoginServiceImpl.java new file mode 100644 index 0000000..d7f1bd4 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/member/service/impl/LoginServiceImpl.java @@ -0,0 +1,187 @@ +package com.ruoyi.member.service.impl; + + +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.redis.RedisCache; +import com.ruoyi.member.service.LoginService; +import com.ruoyi.member.service.RegisterService; +import com.ruoyi.segchk.domain.SegchkUserWebReq; +import com.ruoyi.segchk.service.ISegchkProviderIndexService; +import com.ruoyi.segchk.service.ISegchkStoreIndexService; +import com.ruoyi.segchk.service.ISegchkUserIndexService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.security.crypto.password.PasswordEncoder; +import org.springframework.stereotype.Service; + +/** + * Created by 魔金商城 on 17/7/17. + * 登录服务接口 + */ +@Service("loginService") +public class LoginServiceImpl implements LoginService { + + /** + * 请求时间戳过期时间5分钟 + */ + private static final int REQUEST_TIME_OUT = 1000 * 60 * 5; + /** + * 注入会员服务接口 + */ +// @Autowired +// private IUmsMemberService customerService; + /** + * 注册接口 + */ + @Autowired + private RegisterService registerService; + + @Autowired + private ISegchkUserIndexService segchkUserIndexService; + + @Autowired + private ISegchkStoreIndexService segchkStoreIndexService; + + @Autowired + private ISegchkProviderIndexService segchkProviderIndexService; + /** + * 注入redis服务 + */ + @Autowired + private RedisCache redisService; + + /** + * jwt密钥 + */ + @Value("${token.secret}") + private String jwtSecretKey; +// @Autowired +// private ITStoreInfoService storeInfoService; + /** + * 密码工具类 + */ + @Autowired + private PasswordEncoder passwordEncoder; + @Value("${auth.salt:wsfmall}") + private String salt; + +// @Override + /*public AjaxResult login(LoginParams loginParams) { + log.debug("login and loginParams:{}", loginParams); + + if (Objects.isNull(loginParams)) { + log.info("login fail due to loginParams is null...."); + return AjaxResult.error(-6,"loginParams is null"); + } + + // 验证验证码 + if (!loginParams.validateCode()) { + log.info("login fail due to validateCode fail...."); + return AjaxResult.error(-6,"validateCode fail"); + } + + + // 根据用户名查询出用户信息 + UmsMember customer = customerService.queryCustomerByName(loginParams.getMobile()); + + log.debug("login member:{}", customer); + + // 用户不存在直接返回失败 + if (Objects.isNull(customer)) { + log.info("login fail due to member is not exist...."); + return AjaxResult.error(-4,"member is not exist"); + } + + // 登录次数 + int errorCount = customer.getLoginErrorCount(); + + // 判断用户账号是否正常 + if (!"1".equals(customer.getStatus())) { + log.info("login fail due to member status is error ...."); + return AjaxResult.error(-2,"账号冻结"); + } + + //判断用户的账号是否被锁定 + if (Objects.nonNull(customer.getLockTime())) { + if (LocalDateTime.now().isBefore(customer.getLockTime().plus(30, ChronoUnit.MINUTES))) { + // 账户被锁定或禁用 + log.info("login fail due to member is locked ...."); + return AjaxResult.error(-3,"账号锁定"); + } else { + // 30分钟后解锁用户 + customerService.unlockUser(customer.getId()); + errorCount = 0; + } + } +// -1 用户名或密码错误 -2 账号冻结 -3 账号锁定 1 成功 -4 验证码错误 + + // 判断用户密码是否正确 + if (!passwordEncoder.matches(loginParams.getPassword(), customer.getPassword())) { + log.info("login fail due to password is wrong...."); + + //增加登录失败的次数 + customerService.updateLoginErrorCount(customer.getId()); + + // 如果登录失败次数>= 6次 则锁定帐户 30分钟内不能登录 + if (errorCount + 1 >= 6) { + customerService.lockUser(customer.getId()); + return null; + } else { + return AjaxResult.error(-1,"用户名或密码错误"); + } + } + // 清除密码 + customer.clearPassword(); + + // 更新登录时间 + customerService.updateLoginTime(customer.getId()); + + //清除登录错误次数 + customerService.unlockUser(customer.getId()); + Map res = new HashMap<>(); + final StringBuilder sb = new StringBuilder(); + sb.append(Jwts.builder().setSubject(customer.getUsername()) + .compressWith(CompressionCodecs.DEFLATE) + .signWith(SignatureAlgorithm.HS256, jwtSecretKey) + .setIssuedAt(new Date()) + .claim("userName", customer.getUsername()) + .claim("nickName", customer.getNickname()) + .claim("releName", customer.getRelename()) + .claim("id", customer.getId()) + .setExpiration(Date.from(Instant.now().plus(1, ChronoUnit.HOURS))) // 有效期1小时 + .compact()); + if (customer != null) { + AppletLoginRedisParamResponse appletLoginRedisParamResponse = new AppletLoginRedisParamResponse(); + appletLoginRedisParamResponse.setCustomerId(customer.getId()); + appletLoginRedisParamResponse.setToken(sb.toString()); + redisService.putToRedis(sb.toString(), JSON.toJSONString(appletLoginRedisParamResponse),1, TimeUnit.DAYS); + redisService.putToRedis(loginParams.getMobile(), sb.toString()); + res.put("access_token", sb.toString()); + res.put("refresh_token", sb.toString()); + res.put("member", customer); + } + + log.debug("ok...login success....."); + + return AjaxResult.success(res); + }*/ + + + /** + * segchk前端登录 (app,pc,mobile) + * + * @param segchkUserWebReq 登入参数 + * @return 返回码 -1 用户名或密码错误 -2 账号冻结 -3 账号锁定 1 成功 -4 验证码错误 + */ + @Override + public AjaxResult login(SegchkUserWebReq segchkUserWebReq) { + AjaxResult ajaxResult = null; + switch (segchkUserWebReq.getUserLevel()){ + case 0: ajaxResult = AjaxResult.success(segchkProviderIndexService.selectSegchkProviderWebInfo(segchkUserWebReq));break; + case 1: ajaxResult = AjaxResult.success(segchkStoreIndexService.selectSegchkStoreWebInfo(segchkUserWebReq));break; + case 2: ajaxResult = AjaxResult.success(segchkUserIndexService.selectSegchkUserWebInfo(segchkUserWebReq));break; + default: ajaxResult = AjaxResult.error("301", "用户身份异常"); + } + return ajaxResult; + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/member/service/impl/RegisterServiceApiImpl.java b/ruoyi-segchk/src/main/java/com/ruoyi/member/service/impl/RegisterServiceApiImpl.java new file mode 100644 index 0000000..a461d3f --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/member/service/impl/RegisterServiceApiImpl.java @@ -0,0 +1,211 @@ +package com.ruoyi.member.service.impl; + + +//import com.alibaba.fastjson.JSONObject; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.redis.RedisCache; +import com.ruoyi.common.utils.SnowflakeIdWorker; +import com.ruoyi.member.service.RegisterService; +import com.ruoyi.member.service.RegisterServiceApi; +import com.ruoyi.segchk.domain.SegchkUserBasicInfo; +import com.ruoyi.segchk.domain.SegchkUserExtInfo; +import com.ruoyi.segchk.domain.SegchkUserLevelInfo; +import com.ruoyi.segchk.service.*; +import com.ruoyi.util.Claims; +import com.ruoyi.util.CommonConstant; +import io.jsonwebtoken.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.ObjectUtils; +import org.springframework.util.StringUtils; + +import java.time.Instant; +import java.time.temporal.ChronoUnit; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; + +/** + * 注册服务聚合接口实现 + */ +@Service +public class RegisterServiceApiImpl implements RegisterServiceApi { + + + /** + * 日志 + */ + private Logger logger = LoggerFactory.getLogger(RegisterServiceApiImpl.class); + + + /** + * jwt密钥 + */ + @Value("${token.secret}") + private String jwtSecretKey; + + /** + * 注入注册服务 + */ + @Autowired + private RegisterService registerService; + + @Autowired + private ISegchkUserIndexService segchkUserIndexService; + + @Autowired + private ISegchkStoreIndexService segchkStoreIndexService; + + @Autowired + private ISegchkProviderIndexService segchkProviderIndexService; + + /** + * 注入redis服务 + */ + @Autowired + private RedisCache redisService; + + @Autowired + private SnowflakeIdWorker snowflakeIdWorker; + + /** + * 用户注册 + * + * @param mobile 手机号码 + * @param code 用户输入的手机验证码 + * @param originCode 生成的手机验证码 + * @param recommondId 推荐吗 + * @param recommondLevel 推荐角色 + * @param providerId + * @param remark + * @return -1 手机验证码错误 -2 参数错误 0 失败 成功>0 -3 手机号码已存在 -10 推荐人不存在 + */ + @Override + @Transactional + public AjaxResult registerCustomer(String mobile, String code, String originCode, String recommondId, String recommondLevel, String providerId, String remark) { + if(StringUtils.isEmpty(code)){ + logger.error("registerCustomer fail due to code is empty..."); + return AjaxResult.error(500, "验证码为空!"); + } + if(StringUtils.isEmpty(mobile)){ + logger.error("registerCustomer fail due to mobile is empty..."); + return AjaxResult.error(500, "手机号码为空!"); + } + + // 校验验证码是否正确TODO + if (!code.equals(originCode)) { + logger.error("registerCustomer fail due to code is error with originCode..."); + return AjaxResult.error(500, "验证码错误!"); + } + + SegchkUserLevelInfo segchkUserLevelInfo = segchkUserIndexService.selectUserLevelByMobile(mobile); + SegchkUserExtInfo segchkUserExtInfo = new SegchkUserExtInfo(); + + if(ObjectUtils.isEmpty(segchkUserLevelInfo)){ + segchkUserLevelInfo = new SegchkUserLevelInfo(); +// 如果用户信息空,则添加新的用户 + if(!StringUtils.isEmpty(recommondId) && !StringUtils.isEmpty(recommondLevel)){ +// 如果推荐人,推荐人角色都非空。要检查推荐人是否存在。否则推荐人设置为运营商 + Map parmMap = new HashMap<>(); + parmMap.put("userId", recommondId); + parmMap.put("userLevel", recommondLevel); + parmMap.put("providerId", providerId); + int ret = segchkUserIndexService.recommenderIsExit(parmMap); + if(ret == 0){ +// 推荐人异常 + logger.error("registerCustomer fail due to recommender is wrong..."); + + return AjaxResult.error(500, "推荐人不存在或不在同一地区!"); + } + +// 添加推荐人绑定 + segchkUserExtInfo.setProviderId(Long.valueOf(providerId)); + segchkUserExtInfo.setRecommendersLevel(recommondLevel); + segchkUserExtInfo.setUserRecommenders(Long.valueOf(recommondId)); + } +// 添加新用户信息 + SegchkUserBasicInfo segchkUserBasicInfo = new SegchkUserBasicInfo(); + segchkUserBasicInfo.setPhoneNo(mobile); + segchkUserBasicInfo.setCardTypeId(-1L); + segchkUserBasicInfo.setHasWechat("0"); + segchkUserBasicInfo.setProviderId(Long.valueOf(providerId)); + segchkUserBasicInfo.setUserIcon(""); + int ret = segchkUserIndexService.addUserBasicInfo(segchkUserBasicInfo); + if(ret != 1){ + logger.error("registerCustomer fail due to register is wrong..."); + return AjaxResult.error(500, "注册异常,请联系客服!"); + } + + segchkUserExtInfo.setProviderId(Long.valueOf(providerId)); + segchkUserExtInfo.setRecommendersLevel("0"); + segchkUserExtInfo.setUserRecommenders(0L); + segchkUserExtInfo.setUserId(segchkUserBasicInfo.getUserId()); + ret = segchkUserIndexService.insertUserExtInfo(segchkUserExtInfo); + if(ret < 1){ + logger.error("registerCustomer fail due to recommender binding is wrong..."); + return AjaxResult.error(500, "推荐人绑定异常,请联系客服!"); + } + segchkUserLevelInfo.setProviderId(Long.valueOf(providerId)); + segchkUserLevelInfo.setUserId(segchkUserBasicInfo.getUserId()); + segchkUserLevelInfo.setUserLevel(2L); + } +// 如果是已经注册的用户。则直接返回用户信息 + + String openId = segchkUserIndexService.getWeChatInfoByUserId(segchkUserLevelInfo); + if("999999".equals(remark)){ + openId = code; + } + if(openId == null){ +// 说明用户之前没有绑定微信 + segchkUserLevelInfo.setToken(null); + } + else { + String token = createToken(CommonConstant.APPLET_LOGIN_KEY, segchkUserLevelInfo.getUserId(), segchkUserLevelInfo.getProviderId(), segchkUserLevelInfo.getUserLevel().intValue()); + segchkUserLevelInfo.setToken(token); + Claims claims = new Claims(); + claims.setUserId(segchkUserLevelInfo.getUserId()); + claims.setOpenId(openId); + claims.setProviderId(segchkUserLevelInfo.getProviderId()); + claims.setUserLevel(segchkUserLevelInfo.getUserLevel().intValue()); +// 将用户的token进行缓存 + redisService.setCacheObject(token, claims); + } + + return AjaxResult.success("注册成功", segchkUserLevelInfo); + } + + @Override + public String createToke(String subject, Long userId, Long providerId, Integer userLevel) { + String token = createToken(subject, userId, providerId, userLevel); + return token; + } + +// @Override +// @Transactional +// public int registerCustomer(String mobile, String password, String code, String originCode, String recommondCode) { +// logger.debug("registerCustomer and mobile :{} \r\n code:{} \r\n: originCode{} \r\n recommondCode:{}", mobile, code, originCode, recommondCode); +// if() +//// 根据手机号查询是否存在用户。可能是用户,商家,运营商。 +// segchkUserIndexService.getUserLoginInfo(); +// return res; +// } + + private String createToken(String subject, Long userId, Long providerId, int userLevel){ + final StringBuilder sb = new StringBuilder(); + sb.append(Jwts.builder().setSubject(subject) + .compressWith(CompressionCodecs.DEFLATE) + .signWith(SignatureAlgorithm.HS256, jwtSecretKey) + .setIssuedAt(new Date()) + .claim("userId", userId) + .claim("providerId", providerId) + .claim("userLevel", userLevel) + .setExpiration(Date.from(Instant.now().plus(1, ChronoUnit.HOURS))) // 有效期1小时 + .compact()); +// sb.append(CommonConstant.APPLET_LOGIN_KEY).append("_").append(snowflakeIdWorker.nextId()).append(jwtSecretKey); + return sb.toString(); + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/member/service/impl/RegisterServiceImpl.java b/ruoyi-segchk/src/main/java/com/ruoyi/member/service/impl/RegisterServiceImpl.java new file mode 100644 index 0000000..3133a9f --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/member/service/impl/RegisterServiceImpl.java @@ -0,0 +1,177 @@ +package com.ruoyi.member.service.impl; + + +import com.ruoyi.member.service.RegisterService; +import com.ruoyi.member.service.SmsService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.StringUtils; + +import java.util.Objects; +import java.util.function.Consumer; + +/** + * Created by 魔金商城 on 17/11/18. + * 注册接口 + */ +@Service +public class RegisterServiceImpl implements RegisterService { + + /** + * 调试日志 + */ + private Logger logger = LoggerFactory.getLogger(RegisterServiceImpl.class); + + + /** + * 注入短信接口 + */ + @Autowired + private SmsService smsService; + + /** + * 注入会员服务接口 + */ +// @Autowired +// private IUmsMemberService customerService; + + + @Override + public int sendRegisterSmsCode(String mobile, Consumer consumer) { + + logger.debug("sendRegisterSmsCode and mobile:{}"); + // 如果要注册的手机号码存在 则直接返回 + /*if (customerService.isMobileExist(mobile) != 0) { + logger.error("sendRegisterSmsCode fail due to mobile :{} is exist...", mobile); + return -1; + }*/ + + // 生成的6位数数字 + String code = String.format("%06d", (int) (Math.random() * 1000000)); + + + if(true){ + code = "1234"; + } + else if (smsService.sendSms(mobile, code) == 1) { + // 短信验证码发送失败 + logger.error("send sms fail...."); + return 1; + } + // 发送成功后回调 + if (Objects.nonNull(consumer)) { + consumer.accept(code); + } + + return 0; + } + + @Override + public int sendRegisterSmsCodeForPc(String mobile, String kaptcha, String oldKaptcha, Consumer consumer) { + + logger.debug("sendRegisterSmsCode and mobile:{}"); + + + // 如果要注册的手机号码存在 则直接返回 + /*if (customerService.isMobileExist(mobile) != 0) { + logger.error("sendRegisterSmsCode fail due to mobile :{} is exist...", mobile); + return -4; + }*/ + + int checkKaptchaRes = checkKaptcha(kaptcha, oldKaptcha); + if (checkKaptchaRes != 1) { + logger.error("sendRegisterSmsCode fail due to kaptcha is error..."); + return checkKaptchaRes; + } + + // 生成的6位数数字 + String code = String.format("%06d", (int) (Math.random() * 1000000)); + + // 短信验证码发送失败 + if (smsService.sendSms(mobile, code) == 1) { + logger.error("send sms fail...."); + return 1; + } + + // 发送成功后回调 + if (Objects.nonNull(consumer)) { + consumer.accept(code); + } + + return 0; + } + + @Override + public int registerCustomer(String mobile, String password, String code, String originCode, String recommondCode) { + logger.debug("registerCustomer and mobile :{} \r\n code:{} \r\n: originCode:{} \r\n recommondCode:{}", mobile, code, originCode, recommondCode); + + if (StringUtils.isEmpty(code)) { + logger.error("registerCustomer fail due to code is empty..."); + return -1; + } + + if (StringUtils.isEmpty(mobile) || StringUtils.isEmpty(password)) { + logger.error("registerCustomer fail due to mobile or password is empty..."); + return -2; + } + + // 判断手机号码是否存在 + /*if (customerService.isMobileExist(mobile) != 0) { + logger.error("registerCustomer fail due to mobile is exist"); + return -3; + }*/ + + // 校验验证码是否正确TODO + if (!code.equals(originCode)) { + logger.error("registerCustomer fail due to code is error with originCode..."); + return -1; + } + + // 进行会员注册 +// return customerService.(UmsMember.buildAppRegisterCustomer(mobile, password, recommondCode)); + return 1; + } + + /** + * 免密用户自动注册 + * + * @param phoneNo 手机号码 + * @param channelType 渠道类型 + * @return -1 手机验证码错误 -2 参数错误 0 失败 成功>0 -3 手机号码已存在 -10 推荐人不存在 + */ + @Override + public Long unAuthRegister(String phoneNo, String channelType) { + logger.debug("registerCustomer and mobile :{}", phoneNo); + + // 判断手机号码是否存在 + /*if (customerService.isMobileExist(phoneNo) != 0) { + logger.error("registerCustomer fail due to mobile is exist"); + return -3L; + }*/ +// UmsMember customer = UmsMember.buildH5RegisterCustomer(phoneNo, null); +// customer.setChannelType(channelType); + // 进行会员注册 +// return customerService.autoAddCustomer(customer); + return 1L; + } + + @Override + public int checkKaptcha(String kaptcha, String kaptchaInSession) { + logger.debug("register checkKaptcha and kaptcha:{}\r\n kaptchaInSession:{}", kaptcha, kaptchaInSession); + if (StringUtils.isEmpty(kaptchaInSession)) { + logger.error("register checkKaptcha fail:kaptchaInSession is not exist "); + return -1; + } + if (StringUtils.isEmpty(kaptcha)) { + logger.error("register checkKaptcha fail:kaptcha is not exist "); + return -2; + } + if (!kaptcha.equals(kaptchaInSession)) { + logger.error("register checkKaptcha fail:kaptchaInSession is not equal to kaptcha "); + return -3; + } + return 1; + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/member/service/impl/SendTencentSms.java b/ruoyi-segchk/src/main/java/com/ruoyi/member/service/impl/SendTencentSms.java new file mode 100644 index 0000000..9663b74 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/member/service/impl/SendTencentSms.java @@ -0,0 +1,45 @@ +package com.ruoyi.member.service.impl; + +import com.github.qcloudsms.SmsMultiSender; +import com.github.qcloudsms.SmsResultBase; +import com.github.qcloudsms.SmsSingleSender; +import com.ruoyi.setting.domain.LsSmsSetting; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Tencent Cloud Sms Sendsms + * https://cloud.tencent.com/document/product/382/38778 + */ +public class SendTencentSms { + private static final Logger log = LoggerFactory.getLogger(SendTencentSms.class); + /** + * 按模板发送短信 支持单发和群发 + * + * @param smsSet 短信配置 + */ + public static int sendMessage(LsSmsSetting smsSet, String[] params, String phones) { + + String regex = ";"; + String[] phoneNumbers = phones.split(regex); + SmsResultBase result = null; + + try { + log.debug("url:{},phones:{},templateId:{},params:{}", smsSet.getUrl(), phones, smsSet.getTemplateId(), params); + // 是否单发 + if (phoneNumbers.length == 1) { + //APPID getInterfaceUrl + SmsSingleSender ssender = new SmsSingleSender(Integer.parseInt(smsSet.getUrl()), smsSet.getKey()); + result = ssender.sendWithParam("86", phoneNumbers[0], Integer.parseInt(smsSet.getTemplateId()), params, smsSet.getSign(), "", ""); + } else { + SmsMultiSender msender = new SmsMultiSender(Integer.parseInt(smsSet.getUrl()), smsSet.getKey()); + result = msender.sendWithParam("86", phoneNumbers, Integer.parseInt(smsSet.getTemplateId()), params, smsSet.getSign(), "", ""); + } + return 0; + } catch (Exception e) { + log.error("腾讯云短信发送失败,phoneNumbers={},smsSet={}", phoneNumbers, smsSet, e); + return 1; + } + } + +} \ No newline at end of file diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/member/service/impl/SmsServiceImpl.java b/ruoyi-segchk/src/main/java/com/ruoyi/member/service/impl/SmsServiceImpl.java new file mode 100644 index 0000000..57bcda0 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/member/service/impl/SmsServiceImpl.java @@ -0,0 +1,220 @@ +package com.ruoyi.member.service.impl; + + +import com.ruoyi.member.service.SmsService; +import com.ruoyi.setting.domain.LsSmsSetting; +import com.ruoyi.setting.service.ILsSmsSettingService; +import com.ruoyi.util.SmsUtil; +import com.ruoyi.util.bean.RequestParam; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.math.BigDecimal; +import java.util.List; +import java.util.Objects; + +/** + * Created by 魔金商城 on 17/11/18. + * 发送短信接口实现 + */ +@Service +public class SmsServiceImpl implements SmsService { + + /** + * 团长审批状态 + */ + private static final String STATUS = "通过"; + /** + * 调试日志 + */ + private Logger logger = LoggerFactory.getLogger(SmsServiceImpl.class); + /** + * 注入短信设置服务接口 + */ + @Autowired + private ILsSmsSettingService smsSetService; + + @Override + public int sendSms(String phone, String content) { + int result = 1; + logger.debug("sendSms and phone:{} \r\n content:{}", phone, content); + + // SmsSet smsSet = smsSetService.querySmsSet().get(0); + List smsSetList = smsSetService.selectLsSmsSettingList(null); + if (Objects.isNull(smsSetList)) { + logger.error("sendSms fail due to smsSet is null..."); + return result; + } + for (LsSmsSetting smsSet : smsSetList) { + // 阿里云短信 + if (smsSet.getId() == 1 && smsSet.getStatus()) { + RequestParam requestParam = convert(phone, smsSet); + requestParam.setTemplateCode(smsSet.getTemplateId()); + requestParam.setTemplateParam("{\"code\":\"" + content + "\"}"); + result = SmsUtil.newSendSms(requestParam); + } else if (smsSet.getId() == 2 && smsSet.getStatus()) { // 腾讯云短信 + String[] params = new String[1]; + params[0] = content; + result = SendTencentSms.sendMessage(smsSet, params, phone); + } + } + return result; + } + + @Override + public int sendWiteOffCodeSms(String phone, String code, String writeOffCode, String storeName) { + logger.debug("sendWiteOffCodeSms and phone:{} \r\n code:{} \r\n writeOffCode:{} \r\n storeName:{}", phone, code, writeOffCode, storeName); + + List smsSetList = smsSetService.selectLsSmsSettingList(null); + + if (Objects.isNull(smsSetList)) { + logger.error("sendWiteOffCodeSms fail due to smsSet is null..."); + return 0; + } + for (LsSmsSetting smsSet : smsSetList) { + if (smsSet.getId() == 1 && smsSet.getStatus()) { + RequestParam requestParam = convert(phone, smsSet); + requestParam.setTemplateCode(smsSet.getWriteoffTemplateId()); + requestParam.setSmsParamString("{\"code\":\"" + code + "\",\"product\":\"\",\"storename\":\"" + storeName + "\",\"writeoffcode\":\"" + writeOffCode + "\"}"); + SmsUtil.newSendSms(requestParam); + } else if (smsSet.getId() == 2 && smsSet.getStatus()) { // 腾讯云短信 + String[] params = new String[3]; + params[0] = storeName; + params[1] = code; + params[2] = writeOffCode; + SendTencentSms.sendMessage(smsSet, params, phone); + } + } + + return 0; + } + + @Override + public int sendVirtualOrderWiteOffCodeSms(String phone, String code, String writeOffCode, String storeName) { + logger.debug("sendVirtualOrderWiteOffCodeSms and phone :{} \r\n code:{} \r\n writeOffCode:{} \r\n storeName:{}", phone, code, writeOffCode, storeName); + + List smsSetList = smsSetService.selectLsSmsSettingList(null); + + if (Objects.isNull(smsSetList)) { + logger.error("sendVirtualOrderWiteOffCodeSms fail due to smsSet is null..."); + return 0; + } + for (LsSmsSetting smsSet : smsSetList) { + //阿里云短信 + if (smsSet.getId() == 1 && smsSet.getStatus()) { + RequestParam requestParam = convert(phone, smsSet); + requestParam.setTemplateCode(smsSet.getVirtualOrderTemplateId()); + requestParam.setSmsParamString("{\"code\":\"" + code + "\",\"product\":\"\",\"storename\":\"" + storeName + "\",\"writeoffcode\":\"" + writeOffCode + "\"}"); + SmsUtil.newSendSmsCommon(requestParam); + } else if (smsSet.getId() == 2 && smsSet.getStatus()) { // 腾讯云短信 + String[] params = new String[3]; + params[0] = storeName; + params[1] = code; + params[2] = writeOffCode; + SendTencentSms.sendMessage(smsSet, params, phone); + } + } + return 0; + } + + /** + * 发送社区团购审核结果通知短信 + * + * @param phone 手机号码 + * @param submittime 通过时间 + * @return 成功返回0 失败返回1 + */ + @Override + public int sendAuditTemplateOffCodeSms(String phone, String submittime) { + logger.debug("sendAuditTemplateOffCodeSms and phone :{} \r\n submittime:{}", phone, submittime); + List smsSetList = smsSetService.selectLsSmsSettingList(null); + if (Objects.isNull(smsSetList)) { + logger.error("sendAuditTemplateOffCodeSms fail due to smsSet is null..."); + return 0; + } + for (LsSmsSetting smsSet : smsSetList) { + //阿里云短信 + if (smsSet.getId() == 1 && smsSet.getStatus()) { + RequestParam requestParam = convert(phone, smsSet); + requestParam.setTemplateCode(smsSet.getAuditTemplateId()); + requestParam.setSmsParamString("{\"submittime\":\"" + submittime + "\",\"product\":\"\",\"status\":\"" + STATUS + "\"}"); + SmsUtil.newSendSmsCommon(requestParam); + } else if (smsSet.getId() == 2 && smsSet.getStatus()) { // 腾讯云短信 + String[] params = new String[1]; + params[0] = submittime; + SendTencentSms.sendMessage(smsSet, params, phone); + } + } + return 0; + } + + @Override + public int sendCommunityBuySettlementSms(String phone, String communityName, BigDecimal price) { + + logger.debug("sendCommunityBuySettlementSms and communityName :{} \r\n price:{} \r\n phone:{}", communityName, price, phone); + + List smsSetList = smsSetService.selectLsSmsSettingList(null); + + if (Objects.isNull(smsSetList)) { + logger.error("sendCommunityBuySettlementSms fail due to smsSet is null..."); + return 0; + } + for (LsSmsSetting smsSet : smsSetList) { + //阿里云短信 + if (smsSet.getId() == 1 && smsSet.getStatus()) { + RequestParam requestParam = convert(phone, smsSet); + requestParam.setTemplateCode(smsSet.getSettlementTemplateId()); + requestParam.setSmsParamString("{\"communityname\":\"" + communityName + "\",\"product\":\"\",\"price\":\"" + price + "\"}"); + SmsUtil.newSendSmsCommon(requestParam); + } else if (smsSet.getId() == 2 && smsSet.getStatus()) { // 腾讯云短信 + String[] params = new String[2]; + params[0] = communityName; + params[1] = String.valueOf(price); + SendTencentSms.sendMessage(smsSet, params, phone); + } + } + return 0; + } + + @Override + public int sendCommunityBuyWitudrawSms(String phone, String submittime, BigDecimal price) { + + + logger.debug("sendCommunityBuyWitudrawSms and phone :{} \r\n submittime:{} \r\n price:{}", phone, submittime, price); + + List smsSetList = smsSetService.selectLsSmsSettingList(null); + + if (Objects.isNull(smsSetList)) { + logger.error("sendCommunityBuyWitudrawSms fail due to smsSet is null..."); + return 0; + } + for (LsSmsSetting smsSet : smsSetList) { + //阿里云短信 + if (smsSet.getId() == 1 && smsSet.getStatus()) { + RequestParam requestParam = convert(phone, smsSet); + requestParam.setTemplateCode(smsSet.getWithdrawTemplateId()); + requestParam.setSmsParamString("{\"submittime\":\"" + submittime + "\",\"product\":\"\",\"price\":\"" + price + "\"}"); + SmsUtil.newSendSmsCommon(requestParam); + } else if (smsSet.getId() == 2 && smsSet.getStatus()) { // 腾讯云短信 + String[] params = new String[2]; + params[0] = submittime; + params[1] = price.toString(); + SendTencentSms.sendMessage(smsSet, params, phone); + } + } + return 0; + } + + private RequestParam convert(String phone, LsSmsSetting smsSet) { + RequestParam requestParam = new RequestParam(); + requestParam.setPhoneNumbers(phone); + requestParam.setSignName(smsSet.getSign()); + requestParam.setInterfaceUrl(smsSet.getUrl()); + requestParam.setAccessKeyId(smsSet.getKey()); + requestParam.setAccessKeySecret(smsSet.getSecret()); + return requestParam; + } + +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/member/service/impl/WeChatAppletLoginServiceImpl.java b/ruoyi-segchk/src/main/java/com/ruoyi/member/service/impl/WeChatAppletLoginServiceImpl.java new file mode 100644 index 0000000..a04561e --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/member/service/impl/WeChatAppletLoginServiceImpl.java @@ -0,0 +1,179 @@ +package com.ruoyi.member.service.impl; + +import com.ruoyi.common.exception.ServiceException; +import com.ruoyi.common.utils.SnowflakeIdWorker; +import com.ruoyi.segchk.domain.WeChatCustomerLink; +import com.ruoyi.util.*; +import com.ruoyi.member.service.WeChatAppletLoginService; +import com.ruoyi.member.service.WeChatCustomerLinkService; +import com.ruoyi.member.vo.AppletLoginInfo; +import com.ruoyi.member.vo.AppletLoginRedisParamResponse; +import com.ruoyi.setting.bean.WechatPaySet; +import com.ruoyi.setting.service.ILsPaySettingService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.ObjectUtils; +import org.springframework.util.StringUtils; + +import java.util.Objects; +import java.util.function.Consumer; + +/** + * 微信小程序登录服务实现类 + * + * @author SK + * @since 2018/6/13 + */ +@Service +public class WeChatAppletLoginServiceImpl implements WeChatAppletLoginService { + /** + * 日志 + */ + private Logger log = LoggerFactory.getLogger(WeChatAppletLoginServiceImpl.class); + /** + * 注入微信用户关联服务 + */ + @Autowired + private WeChatCustomerLinkService weChatCustomerLinkService; + + /** + * 注入随机数生成器 + */ + @Autowired + private SnowflakeIdWorker snowflakeIdWorker; + + /** + * 注入支付设置服务 + */ + @Autowired + private ILsPaySettingService paySetService; + + + @Override + public AppletLoginInfo getLoginInfo(String code, String unionId, Consumer claimsConsumer) { + log.debug("getLoginInfo and code:{} \r\n unionId:{}", code, unionId); + AppletLoginRedisParamResponse appletLoginRedisParamResponse = new AppletLoginRedisParamResponse(); + String token = snowflakeIdWorker.nextId() + ""; + appletLoginRedisParamResponse.setToken(token); + WechatPaySet wechatAppletPaySet = paySetService.queryPaySet().getWechatAppletPaySet(); + WechatSetting wechatSetting = new WechatSetting(); + wechatSetting.setAppId(wechatAppletPaySet.getAppId()); + wechatSetting.setAppSecret(wechatAppletPaySet.getAppSecret()); + if (!wechatSetting.checkAppletOAuthParams()) { + log.error("getLoginInfo fail:checkAppletOAuthParams fail"); + return buildNotLinked(claimsConsumer, appletLoginRedisParamResponse, token, null); + } + WeChatAppletLoginResponse weChatAppletLoginResponse = WeChatAppletUtils.getLoginInfo(code, wechatSetting); + if (Objects.isNull(weChatAppletLoginResponse)) { + log.error("getLoginInfo fail: getLoginInfo fail"); + return buildNotLinked(claimsConsumer, appletLoginRedisParamResponse, token, null); + } + appletLoginRedisParamResponse.setSessionKey(weChatAppletLoginResponse.getSession_key()); + appletLoginRedisParamResponse.setOpenId(weChatAppletLoginResponse.getOpenid()); + if (!weChatAppletLoginResponse.hasUnionId()) { + weChatAppletLoginResponse.setUnionid(unionId); + } + if (!weChatAppletLoginResponse.hasUnionId()) { + log.info("getLoginInfo: no unionId"); + return buildNotLinked(claimsConsumer, appletLoginRedisParamResponse, token, null); + } + appletLoginRedisParamResponse.setUnionId(weChatAppletLoginResponse.getUnionid()); + WeChatCustomerLink weChatCustomerLink = weChatCustomerLinkService.queryWeChatCustomerLinkByUnionId(weChatAppletLoginResponse.getUnionid()); + if (Objects.isNull(weChatCustomerLink)) { + log.info("getLoginInfo: not linked"); + return buildNotLinked(claimsConsumer, appletLoginRedisParamResponse, token, weChatAppletLoginResponse.getUnionid()); + } + log.info("getLoginInfo: linked"); + //如果没有小程序的openId,则更新关联信息 + if (!weChatCustomerLink.hasAppletOpenId()) { + weChatCustomerLink.setAppletOpenId(weChatAppletLoginResponse.getOpenid()); + weChatCustomerLinkService.updateWeChatCustomerLink(weChatCustomerLink); + } + appletLoginRedisParamResponse.setCustomerId(weChatCustomerLink.getUserId()); + claimsConsumer.accept(appletLoginRedisParamResponse); + return AppletLoginInfo.buildLinked(token); + } + + + @Override + public AppletLoginInfo dealUserInfo(WeChatAppletUserInfo weChatAppletUserInfo, String openId, String sessionKey, Consumer claimsConsumer) { + log.debug("dealUserInfo and weChatAppletUserInfo:{} \r\n sessionKey:{} \r\n openId:{}", weChatAppletUserInfo, sessionKey, openId); + String unionId = WeChatAppletUtils.getUnionIdFromUserInfo(sessionKey, weChatAppletUserInfo); + if (StringUtils.isEmpty(unionId)) { + log.error("dealUserInfo fail : getUnionIdFromUserInfo fail"); + claimsConsumer.accept(null); + return AppletLoginInfo.buildNotLinked(); + } + AppletLoginRedisParamResponse appletLoginRedisParamResponse = new AppletLoginRedisParamResponse(); + appletLoginRedisParamResponse.setUnionId(unionId); + WeChatCustomerLink weChatCustomerLink = weChatCustomerLinkService.queryWeChatCustomerLinkByUnionId(unionId); + if (Objects.isNull(weChatCustomerLink)) { + log.info("dealUserInfo: not linked"); + claimsConsumer.accept(appletLoginRedisParamResponse); + return AppletLoginInfo.buildNotLinked().addUnionId(unionId); + } + log.info("dealUserInfo: linked"); + //如果没有小程序的openId,则更新关联信息 + if (!weChatCustomerLink.hasAppletOpenId()) { + weChatCustomerLink.setAppletOpenId(openId); + weChatCustomerLinkService.updateWeChatCustomerLink(weChatCustomerLink); + } + appletLoginRedisParamResponse.setCustomerId(weChatCustomerLink.getUserId()); + claimsConsumer.accept(appletLoginRedisParamResponse); + return AppletLoginInfo.buildLinked(); + } + + @Override + public int checkCustomerBind(String userName) { + log.debug("checkCustomerBind and userName:{} ", userName); + WeChatCustomerLink weChatCustomerLink = weChatCustomerLinkService.queryWeChatCustomerLinkByUserName(userName); + if (!ObjectUtils.isEmpty(weChatCustomerLink) && !StringUtils.isEmpty(weChatCustomerLink.getAppletOpenId())) { + log.error("checkCustomerBind fail : bind already"); + return -9; + } + return 1; + } + + @Override + public int bindAccount(String openId, String unionId, long customerId) { + log.debug("bindAccount and openId:{} \r\n unionId:{} \r\n customerId:{}", openId, unionId, customerId); + WeChatCustomerLink weChatCustomerLink = weChatCustomerLinkService.queryWeChatCustomerLinkByCustomerId(customerId); + if (!ObjectUtils.isEmpty(weChatCustomerLink) && !weChatCustomerLink.getUnionId().equals(unionId)) { + log.error("checkCustomerBind fail : bind already"); + throw new ServiceException("R-00004"); + } + if (Objects.isNull(weChatCustomerLink)) { + weChatCustomerLink = new WeChatCustomerLink(); + } + weChatCustomerLink.setUnionId(unionId); + weChatCustomerLink.setAppletOpenId(openId); + weChatCustomerLink.setUserId(customerId); + //如果数据库中有记录就更新记录 + if (-1 != weChatCustomerLink.getUserId()) { + return weChatCustomerLinkService.updateWeChatCustomerLink(weChatCustomerLink); + } + //否则新增 + return weChatCustomerLinkService.addWeChatCustomerLink(weChatCustomerLink); + } + + @Override + public int unbindAccount(long customerId, String unionId) { + log.debug("unbindAccount and customerId:{} \r\n unionId:{}", customerId, unionId); + return weChatCustomerLinkService.unbindWeChatCustomerLink(customerId, unionId); + } + + /** + * 构建未关联返回 + * + * @param claimsConsumer 回调 + * @param appletLoginRedisParamResponse 小程序redis参数返回实体类 + * @param token token + * @return 小程序登录信息 + */ + private AppletLoginInfo buildNotLinked(Consumer claimsConsumer, AppletLoginRedisParamResponse appletLoginRedisParamResponse, String token, String unionId) { + claimsConsumer.accept(appletLoginRedisParamResponse); + return AppletLoginInfo.buildNotLinked(token).addUnionId(unionId); + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/member/service/impl/WeChatCustomerLinkServiceImpl.java b/ruoyi-segchk/src/main/java/com/ruoyi/member/service/impl/WeChatCustomerLinkServiceImpl.java new file mode 100644 index 0000000..f6f5b1b --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/member/service/impl/WeChatCustomerLinkServiceImpl.java @@ -0,0 +1,110 @@ +package com.ruoyi.member.service.impl; + + +import com.ruoyi.segchk.domain.SegchkUserWechat; +import com.ruoyi.segchk.service.ISegchkUserIndexService; +import com.ruoyi.segchk.domain.WeChatCustomerLink; +import com.ruoyi.member.mapper.WeChatCustomerLinkMapper; +import com.ruoyi.member.service.WeChatCustomerLinkService; +import com.ruoyi.util.RedisCahceKey; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.cache.annotation.CacheEvict; +import org.springframework.cache.annotation.Cacheable; +import org.springframework.stereotype.Service; + +/** + * 微信用户关联服务实现类 + */ +@Service +public class WeChatCustomerLinkServiceImpl implements WeChatCustomerLinkService { + + /** + * 日志 + */ + private Logger logger = LoggerFactory.getLogger(WeChatCustomerLinkServiceImpl.class); + /** + * 注入微信用户数据库服务 + */ + @Autowired + private WeChatCustomerLinkMapper weChatCustomerLinkMapper; + /** + * 用户数据库服务 + */ + @Autowired + private ISegchkUserIndexService segchkUserIndexService; + + + /** + * 注入用户服务 + */ +// @Autowired +// private IUmsMemberService customerService; + + + @CacheEvict(value = RedisCahceKey.WE_CHAT_CUSTOMER_LINK, key = "'WE_CHAT_CUSTOMER_LINK'+#weChatCustomerLink.unionId") + @Override + public int addWeChatCustomerLink(WeChatCustomerLink weChatCustomerLink) { + logger.debug("addWeChatCustomerLink and weChatCustomerLink:{}", weChatCustomerLink); + return weChatCustomerLinkMapper.addWeChatCustomerLink(weChatCustomerLink); + } + + @Override + public WeChatCustomerLink queryWeChatCustomerLinkByOpenId(String openId) { + logger.debug("queryWeChatCustomerLinkByOpenId and openId:{}", openId); + return weChatCustomerLinkMapper.queryWeChatCustomerLinkByOpenId(openId); + } + + @Override + public WeChatCustomerLink queryWeChatCustomerLinkByCustomerId(long customerId) { + logger.debug("queryWeChatCustomerLinkByCustomerId and customerId:{}", customerId); + return weChatCustomerLinkMapper.queryWeChatCustomerLinkByCustomerId(customerId); + } + + @Override + public WeChatCustomerLink queryWeChatCustomerLinkByUserName(String userName) { + logger.debug("queryWeChatCustomerLinkByUserName and userName:{}", userName); +// UmsMember customer = null; +// UmsMember customer = customerService.queryCustomerByNameInWriteDataSource(userName); + /*if (ObjectUtils.isEmpty(customer)) { + logger.error("queryWeChatCustomerLinkByUserName fail: member is null"); + return null; + }*/ + return null; +// return weChatCustomerLinkMapper.queryWeChatCustomerLinkByCustomerId(customer.getCustomerLevelId()); + } + + @Cacheable(value = RedisCahceKey.WE_CHAT_CUSTOMER_LINK, key = "'WE_CHAT_CUSTOMER_LINK'+#unionId") + @Override + public WeChatCustomerLink queryWeChatCustomerLinkByUnionId(String unionId) { + logger.debug("queryWeChatCustomerLinkByUnionId and unionId:{}", unionId); + return weChatCustomerLinkMapper.queryWeChatCustomerLinkByUnionId(unionId); + } + + @CacheEvict(value = RedisCahceKey.WE_CHAT_CUSTOMER_LINK, key = "'WE_CHAT_CUSTOMER_LINK'+#unionId") + @Override + public int unbindWeChatCustomerLink(long customerId, String unionId) { + logger.debug("unbindWeChatCustomerLink and customerId:{} \r\n unionId:{}", customerId, unionId); + return weChatCustomerLinkMapper.deleteWeChatCustomerLink(customerId); + } + + @CacheEvict(value = RedisCahceKey.WE_CHAT_CUSTOMER_LINK, key = "'WE_CHAT_CUSTOMER_LINK'+#weChatCustomerLink.unionId") + @Override + public int updateWeChatCustomerLink(WeChatCustomerLink weChatCustomerLink) { + logger.debug("updateWeChatCustomerLink andweChatCustomerLink:{}", weChatCustomerLink); + return weChatCustomerLinkMapper.updateWeChatCustomerLink(weChatCustomerLink); + } + + /** + * 更新微信用户关联 + * + * @param segchkUserWechat 微信用户关联实体 + * @param userLevel + * @return 1成功 否则失败 + */ + @Override + public int addSegchkUserWechat(SegchkUserWechat segchkUserWechat, String userLevel) { + return segchkUserIndexService.updateWeChatInfoByUserId(segchkUserWechat, userLevel); + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/member/vo/AppletLoginInfo.java b/ruoyi-segchk/src/main/java/com/ruoyi/member/vo/AppletLoginInfo.java new file mode 100644 index 0000000..f1d795a --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/member/vo/AppletLoginInfo.java @@ -0,0 +1,129 @@ +package com.ruoyi.member.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.springframework.util.StringUtils; + +/** + * 小程序登录信息 + * + * @author SK + * @since 2018/6/13 + */ +@ApiModel(description = "小程序登录信息") +public class AppletLoginInfo { + + /** + * token + */ + @ApiModelProperty(value = "token") + private String token; + + /** + * 是否关联用户 + */ + @ApiModelProperty(value = "是否关联用户") + private boolean isLink; + + /** + * 是否有unionId + */ + @ApiModelProperty(value = "是否有unionId") + private boolean hasUnionId; + + + /** + * 构建已关联用户实体 + * + * @param token token + * @return 小程序登录信息实体 + */ + public static AppletLoginInfo buildLinked(String token) { + AppletLoginInfo appletLoginInfo = new AppletLoginInfo(); + appletLoginInfo.isLink = true; + appletLoginInfo.token = token; + appletLoginInfo.hasUnionId = true; + return appletLoginInfo; + } + + /** + * 构建为关联用户实体 + * + * @param token token + * @return 小程序登录信息实体 + */ + public static AppletLoginInfo buildNotLinked(String token) { + AppletLoginInfo appletLoginInfo = new AppletLoginInfo(); + appletLoginInfo.isLink = false; + appletLoginInfo.token = token; + return appletLoginInfo; + } + + + /** + * 构建已关联用户实体 + * + * @return 小程序登录信息实体 + */ + public static AppletLoginInfo buildLinked() { + AppletLoginInfo appletLoginInfo = new AppletLoginInfo(); + appletLoginInfo.isLink = true; + appletLoginInfo.hasUnionId = true; + return appletLoginInfo; + } + + /** + * 构建为关联用户实体 + * + * @return 小程序登录信息实体 + */ + public static AppletLoginInfo buildNotLinked() { + AppletLoginInfo appletLoginInfo = new AppletLoginInfo(); + appletLoginInfo.isLink = false; + return appletLoginInfo; + } + + /** + * 添加unionId + * + * @param unionId 联合登录id + * @return 当前实体 + */ + public AppletLoginInfo addUnionId(String unionId) { + hasUnionId = !StringUtils.isEmpty(unionId); + return this; + } + + public String getToken() { + return token; + } + + public void setToken(String token) { + this.token = token; + } + + public boolean isLink() { + return isLink; + } + + public void setLink(boolean link) { + isLink = link; + } + + public boolean isHasUnionId() { + return hasUnionId; + } + + public void setHasUnionId(boolean hasUnionId) { + this.hasUnionId = hasUnionId; + } + + @Override + public String toString() { + return "AppletLoginInfo{" + + "token='" + token + '\'' + + ", isLink=" + isLink + + ", hasUnionId=" + hasUnionId + + '}'; + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/member/vo/AppletLoginRedisParamResponse.java b/ruoyi-segchk/src/main/java/com/ruoyi/member/vo/AppletLoginRedisParamResponse.java new file mode 100644 index 0000000..98f5ac5 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/member/vo/AppletLoginRedisParamResponse.java @@ -0,0 +1,96 @@ +package com.ruoyi.member.vo; + +import org.springframework.util.StringUtils; + +/** + * 小程序redis参数返回实体类 + * + * @author SK + * @since 2018/6/13 + */ +public class AppletLoginRedisParamResponse { + + /** + * 小程序sessionKey + */ + private String sessionKey; + + /** + * token + */ + private String token; + + /** + * 联合登录id + */ + private String unionId; + + /** + * 用户id + */ + private long customerId = -1; + + /** + * 微信用户标识 + */ + private String openId; + + private String code; + + /** + * 判断是否有unionId + * + * @return 有返回true, 否则返回false + */ + public boolean hasUnionId() { + return !StringUtils.isEmpty(unionId); + } + + public String getSessionKey() { + return sessionKey; + } + + public void setSessionKey(String sessionKey) { + this.sessionKey = sessionKey; + } + + public String getToken() { + return token; + } + + public void setToken(String token) { + this.token = token; + } + + public String getUnionId() { + return unionId; + } + + public void setUnionId(String unionId) { + this.unionId = unionId; + } + + public long getCustomerId() { + return customerId; + } + + public void setCustomerId(long customerId) { + this.customerId = customerId; + } + + public String getOpenId() { + return openId; + } + + public void setOpenId(String openId) { + this.openId = openId; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/member/vo/BindNewEmailRequest.java b/ruoyi-segchk/src/main/java/com/ruoyi/member/vo/BindNewEmailRequest.java new file mode 100644 index 0000000..430348b --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/member/vo/BindNewEmailRequest.java @@ -0,0 +1,133 @@ +package com.ruoyi.member.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.springframework.util.StringUtils; + +/** + * 绑定新邮箱实体 + */ +@ApiModel(description = "绑定新邮箱实体") +public class BindNewEmailRequest { + + /** + * 用户id + */ + @ApiModelProperty(value = "用户id") + private long customerId; + + /** + * 用户手机 + */ + @ApiModelProperty(value = "用户手机") + private String mobile; + + /** + * 新邮箱 + */ + @ApiModelProperty(value = "新邮箱") + private String email; + + /** + * 是否有凭证 + */ + @ApiModelProperty(value = "是否有凭证") + private String hasCert; + + /** + * 校验码 + */ + @ApiModelProperty(value = "校验码") + private String checkCode; + + /** + * 用户输入的图片验证码 + */ + @ApiModelProperty(value = "用户输入的图片验证码") + private String kaptcha; + + /** + * 存在redis中的图片验证码 + */ + @ApiModelProperty(value = "存在redis中的图片验证码") + private String oldKaptcha; + + /** + * 随机数 + */ + @ApiModelProperty(value = "随机数") + private String uuid; + + /** + * 判断是否有凭证 + * + * @return 有返回true + */ + public boolean hasOwnCert() { + return !StringUtils.isEmpty(this.hasCert); + } + + public long getCustomerId() { + return customerId; + } + + public void setCustomerId(long customerId) { + this.customerId = customerId; + } + + public String getMobile() { + return mobile; + } + + public void setMobile(String mobile) { + this.mobile = mobile; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public String getHasCert() { + return hasCert; + } + + public void setHasCert(String hasCert) { + this.hasCert = hasCert; + } + + public String getCheckCode() { + return checkCode; + } + + public void setCheckCode(String checkCode) { + this.checkCode = checkCode; + } + + public String getKaptcha() { + return kaptcha; + } + + public void setKaptcha(String kaptcha) { + this.kaptcha = kaptcha; + } + + public String getOldKaptcha() { + return oldKaptcha; + } + + public void setOldKaptcha(String oldKaptcha) { + this.oldKaptcha = oldKaptcha; + } + + public String getUuid() { + return uuid; + } + + public void setUuid(String uuid) { + this.uuid = uuid; + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/member/vo/BindNewMobileRequest.java b/ruoyi-segchk/src/main/java/com/ruoyi/member/vo/BindNewMobileRequest.java new file mode 100644 index 0000000..7d4e57f --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/member/vo/BindNewMobileRequest.java @@ -0,0 +1,105 @@ +package com.ruoyi.member.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.springframework.util.StringUtils; + +/** + * Created by 魔金商城 on 17/11/21. + * 重新绑定手机号码实体 + */ +@ApiModel(description = "重新绑定手机号码实体") +public class BindNewMobileRequest { + + /** + * 用户id + */ + @ApiModelProperty(value = "用户id") + private long customerId; + + /** + * 重新绑定的手机号码 + */ + @ApiModelProperty(value = "重新绑定的手机号码") + private String mobile; + + /** + * 用户输入的验证码 + */ + @ApiModelProperty(value = "用户输入的验证码") + private String code; + + /** + * 发送给手机的验证码 + */ + @ApiModelProperty(value = "发送给手机的验证码") + private String originCode; + + /** + * 是否有凭证 + */ + @ApiModelProperty(value = "是否有凭证") + private String hasCert; + + /** + * 判断是否有凭证 + * + * @return 有返回true + */ + public boolean hasOwnCert() { + return !StringUtils.isEmpty(this.hasCert); + } + + /** + * 判断验证码是否正确 + * + * @return 正确返回0 + */ + public boolean validateCode() { + if (StringUtils.isEmpty(this.code)) { + return false; + } + + return this.code.equals(this.originCode); + } + + public long getCustomerId() { + return customerId; + } + + public void setCustomerId(long customerId) { + this.customerId = customerId; + } + + public String getMobile() { + return mobile; + } + + public void setMobile(String mobile) { + this.mobile = mobile; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getOriginCode() { + return originCode; + } + + public void setOriginCode(String originCode) { + this.originCode = originCode; + } + + public String getHasCert() { + return hasCert; + } + + public void setHasCert(String hasCert) { + this.hasCert = hasCert; + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/member/vo/BindParams.java b/ruoyi-segchk/src/main/java/com/ruoyi/member/vo/BindParams.java new file mode 100644 index 0000000..c57952d --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/member/vo/BindParams.java @@ -0,0 +1,94 @@ +package com.ruoyi.member.vo; + +import com.ruoyi.common.core.domain.BaseEntity; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import java.util.function.Consumer; + + +/** + * 登入参数实体 + */ +@ApiModel(description = "登入参数实体") +public class BindParams extends BaseEntity { + + /** + * 用户id + */ + @ApiModelProperty(value = "用户id") + private String userId; + + /** + * 运营商id + */ + @ApiModelProperty(value = "运营商id") + private String providerId; + + /** + * 用户角色 + */ + @ApiModelProperty(value = "用户角色") + private String userLevel; + + + /** + * 授权code + */ + @ApiModelProperty(value = "授权code") + private String code; + + + /** + * 验证验证码 是否正确 (目前都不需要验证码) + * + * @return 正确返回true 否则返回false + */ + public boolean validateCode() { + + // 目前都不需要验证码 + return true; + } + + public String getUserId() { + return userId; + } + + public void setUserId(String userId) { + this.userId = userId; + } + + public String getProviderId() { + return providerId; + } + + public void setProviderId(String providerId) { + this.providerId = providerId; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getUserLevel() { + return userLevel; + } + + public void setUserLevel(String userLevel) { + this.userLevel = userLevel; + } + + @Override + public String toString() { + return "BindParams{" + + "userId='" + userId + '\'' + + ", providerId='" + providerId + '\'' + + ", userLevel='" + userLevel + '\'' + + ", code='" + code + '\'' + + '}'; + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/member/vo/CustomerSearchCondition.java b/ruoyi-segchk/src/main/java/com/ruoyi/member/vo/CustomerSearchCondition.java new file mode 100644 index 0000000..b862df8 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/member/vo/CustomerSearchCondition.java @@ -0,0 +1,178 @@ +package com.ruoyi.member.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import java.util.HashMap; +import java.util.Map; + +/** + * Created by 魔金商城 on 17/5/19. + * 会员搜索条件 + */ +@ApiModel(description = "会员搜索条件") +public class CustomerSearchCondition { + + /** + * 用户名 + */ + @ApiModelProperty(value = "用户名") + private String userName; + + /** + * 用户的真实姓名 + */ + @ApiModelProperty(value = "用户的真实姓名") + private String releName; + + + /** + * 手机号码 + */ + @ApiModelProperty(value = "手机号码") + private String mobile; + + /** + * 邮箱 + */ + @ApiModelProperty(value = "邮箱") + private String email; + + /** + * 手机是否验证 0 否 1 验证 默认0 + */ + @ApiModelProperty(value = "手机是否验证 0 否 1 验证 默认0") + private String isMobileVerification; + + /** + * 邮箱是否验证 0 否 1 验证 默认0 + */ + @ApiModelProperty(value = "邮箱是否验证 0 否 1 验证 默认0") + private String isEmailVerification; + + /** + * 用户状态 1 正常 2 冻结 默认1 + */ + @ApiModelProperty(value = "用户状态 1 正常 2 冻结 默认1") + private String status; + + + /** + * 1 普通用户 2 商家店铺用户 + */ + @ApiModelProperty(value = "1 普通用户 2 商家店铺用户") + private String type; + + /** + * 创建时间 + */ + @ApiModelProperty(value = "创建时间") + private String createTime; + + /** + * 归属门店id + */ + @ApiModelProperty(value = "归属门店id") + private long beloneStoreId; + + + /** + * 获得搜索条件 + * + * @return 返回搜索套件 + */ + public Map getSearchParams() { + Map params = new HashMap<>(); + params.put("userName", userName); + params.put("releName", releName); + params.put("mobile", mobile); + params.put("email", email); + params.put("isMobileVerification", isMobileVerification); + params.put("isEmailVerification", isEmailVerification); + params.put("status", status); + params.put("type", type); + params.put("createTime", createTime); + params.put("beloneStoreId", beloneStoreId); + return params; + } + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public String getReleName() { + return releName; + } + + public void setReleName(String releName) { + this.releName = releName; + } + + public String getMobile() { + return mobile; + } + + public void setMobile(String mobile) { + this.mobile = mobile; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public String getIsMobileVerification() { + return isMobileVerification; + } + + public void setIsMobileVerification(String isMobileVerification) { + this.isMobileVerification = isMobileVerification; + } + + public String getIsEmailVerification() { + return isEmailVerification; + } + + public void setIsEmailVerification(String isEmailVerification) { + this.isEmailVerification = isEmailVerification; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getCreateTime() { + return createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public long getBeloneStoreId() { + return beloneStoreId; + } + + public void setBeloneStoreId(long beloneStoreId) { + this.beloneStoreId = beloneStoreId; + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/member/vo/ForgetPwdRequest.java b/ruoyi-segchk/src/main/java/com/ruoyi/member/vo/ForgetPwdRequest.java new file mode 100644 index 0000000..2be9550 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/member/vo/ForgetPwdRequest.java @@ -0,0 +1,174 @@ +package com.ruoyi.member.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.springframework.util.StringUtils; + +/** + * Created by 魔金商城 on 17/11/22. + * 忘记密码请求 + */ +@ApiModel(description = "忘记密码请求") +public class ForgetPwdRequest { + + /** + * 手机号码 + */ + @ApiModelProperty(value = "手机号码") + private String mobile; + + /** + * 验证码 + */ + @ApiModelProperty(value = "验证码") + private String code; + + /** + * 发送给手机的验证码 + */ + @ApiModelProperty(value = "发送给手机的验证码") + private String originCode; + + /** + * 凭证 + */ + @ApiModelProperty(value = "凭证") + private String certificate; + + /** + * 密码 + */ + @ApiModelProperty(value = "密码") + private String password; + + /** + * 随机数 + */ + @ApiModelProperty(value = "随机数") + private String uuid; + + /** + * 请求来自 1:pc + */ + @ApiModelProperty(value = "请求来自 1:pc") + private String requestFrom; + + /** + * 用户输入的图片验证码 + */ + @ApiModelProperty(value = "用户输入的图片验证码") + private String kaptcha; + + /** + * 存在redis中的图片验证码 + */ + @ApiModelProperty(value = "存在redis中的图片验证码") + private String oldKaptcha; + + /** + * 随机数(pc端图片验证码用) + */ + @ApiModelProperty(value = "随机数(pc端图片验证码用)") + private String uuidForPcKaptcha; + + /** + * 是否有凭证 + * + * @return 有返回true + */ + public boolean hasCertificate() { + return !StringUtils.isEmpty(certificate); + } + + /** + * 判断验证码是否正确 + * + * @return 正确返回true + */ + public boolean validateCode() { + if (StringUtils.isEmpty(this.code)) { + return false; + } + return this.code.equals(this.originCode); + } + + public String getMobile() { + return mobile; + } + + public void setMobile(String mobile) { + this.mobile = mobile; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getOriginCode() { + return originCode; + } + + public void setOriginCode(String originCode) { + this.originCode = originCode; + } + + public String getCertificate() { + return certificate; + } + + public void setCertificate(String certificate) { + this.certificate = certificate; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public String getUuid() { + return uuid; + } + + public void setUuid(String uuid) { + this.uuid = uuid; + } + + public String getRequestFrom() { + return requestFrom; + } + + public void setRequestFrom(String requestFrom) { + this.requestFrom = requestFrom; + } + + public String getKaptcha() { + return kaptcha; + } + + public void setKaptcha(String kaptcha) { + this.kaptcha = kaptcha; + } + + public String getOldKaptcha() { + return oldKaptcha; + } + + public void setOldKaptcha(String oldKaptcha) { + this.oldKaptcha = oldKaptcha; + } + + public String getUuidForPcKaptcha() { + return uuidForPcKaptcha; + } + + public void setUuidForPcKaptcha(String uuidForPcKaptcha) { + this.uuidForPcKaptcha = uuidForPcKaptcha; + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/member/vo/LoginParams.java b/ruoyi-segchk/src/main/java/com/ruoyi/member/vo/LoginParams.java new file mode 100644 index 0000000..48a9065 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/member/vo/LoginParams.java @@ -0,0 +1,113 @@ +package com.ruoyi.member.vo; + +import com.ruoyi.segchk.domain.SegchkUserBasicInfo; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import java.util.function.Consumer; + + +/** + * 登入参数实体 + */ +@ApiModel(description = "登入参数实体") +public class LoginParams { + + /** + * 用户名 + */ + @ApiModelProperty(value = "用户名") + private String mobile; + + /** + * 密码 + */ + @ApiModelProperty(value = "密码") + private String password; + + /** + * 回调函数 + */ + @ApiModelProperty(value = "回调函数") + private Consumer consumer; + + /** + * 用户输入的验证码 + */ + @ApiModelProperty(value = "用户输入的验证码") + private String code; + + /** + * session中的验证码 + */ + @ApiModelProperty(value = "session中的验证码") + private String codeInSession; + + /** + * 登录来源 0 pc 1 app 2 mobile + */ + private int source; + + public void setFromApp() { + this.source = 1; + } + + /** + * 验证验证码 是否正确 (目前都不需要验证码) + * + * @return 正确返回true 否则返回false + */ + public boolean validateCode() { + + // 目前都不需要验证码 + return true; + } + + public String getMobile() { + return mobile; + } + + public void setMobile(String mobile) { + this.mobile = mobile; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public Consumer getConsumer() { + return consumer; + } + + public void setConsumer(Consumer consumer) { + this.consumer = consumer; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCodeInSession() { + return codeInSession; + } + + public void setCodeInSession(String codeInSession) { + this.codeInSession = codeInSession; + } + + public int getSource() { + return source; + } + + public void setSource(int source) { + this.source = source; + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/member/vo/QueryCriteria.java b/ruoyi-segchk/src/main/java/com/ruoyi/member/vo/QueryCriteria.java new file mode 100644 index 0000000..370e0d7 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/member/vo/QueryCriteria.java @@ -0,0 +1,125 @@ +package com.ruoyi.member.vo; + + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import java.util.HashMap; +import java.util.Map; + +/** + * 会员预存款查询条件 + */ +@ApiModel(description = "会员预存款查询条件") +public class QueryCriteria { + + /** + * 会员id + */ + @ApiModelProperty(value = "会员id") + private long customerId; + + private int pageNum =0; + /** + * 会员名称 + */ + @ApiModelProperty(value = "会员名称") + private String userName; + + /** + * 交易单号 + */ + @ApiModelProperty(value = "交易单号") + private String transCode; + + /** + * 创建时间 + */ + @ApiModelProperty(value = "创建时间") + private String startTime; + + /** + * 结束时间 + */ + @ApiModelProperty(value = "结束时间") + private String endTime; + + /** + * 查询类型 1全部 2 收入 3支出 默认全部 + */ + @ApiModelProperty(value = "查询类型 1全部 2 收入 3支出 默认全部") + private String filterType = "1"; + + /** + * 获得查询条件 + * + * @return 返回查询条件 + */ + public Map getQueryMap() { + Map params = new HashMap<>(); + params.put("customerId", customerId); + params.put("userName", userName); + params.put("transCode", transCode); + params.put("startTime", startTime); + params.put("endTime", endTime); + params.put("filterType", filterType); + params.put("pageNum", pageNum); + return params; + } + + public long getCustomerId() { + return customerId; + } + + public void setCustomerId(long customerId) { + this.customerId = customerId; + } + + public int getPageNum() { + return pageNum; + } + + public void setPageNum(int pageNum) { + this.pageNum = pageNum; + } + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public String getTransCode() { + return transCode; + } + + public void setTransCode(String transCode) { + this.transCode = transCode; + } + + public String getStartTime() { + return startTime; + } + + public void setStartTime(String startTime) { + this.startTime = startTime; + } + + public String getEndTime() { + return endTime; + } + + public void setEndTime(String endTime) { + this.endTime = endTime; + } + + public String getFilterType() { + return filterType; + } + + public void setFilterType(String filterType) { + this.filterType = filterType; + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/member/vo/UnAuthLoginParams.java b/ruoyi-segchk/src/main/java/com/ruoyi/member/vo/UnAuthLoginParams.java new file mode 100644 index 0000000..3eadbdc --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/member/vo/UnAuthLoginParams.java @@ -0,0 +1,79 @@ +package com.ruoyi.member.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import java.util.function.Consumer; + +/** + * 免密登入参数实体 + */ +@ApiModel(description = "免密登入参数实体") +public class UnAuthLoginParams { + + /** + * 手机号 + */ + @ApiModelProperty(value = "手机号") + private String phoneNo; + /** + * 时间戳 + */ + @ApiModelProperty(value = "时间戳") + private Long timeStamp; + /** + * 请求签名 + */ + @ApiModelProperty(value = "请求签名") + private String sign; + + /** + * 渠道类型 + */ + @ApiModelProperty(value = "渠道类型") + private String channelType; + /** + * 回调函数 + */ + private Consumer consumer; + + public String getPhoneNo() { + return phoneNo; + } + + public void setPhoneNo(String phoneNo) { + this.phoneNo = phoneNo; + } + + public Long getTimeStamp() { + return timeStamp; + } + + public void setTimeStamp(Long timeStamp) { + this.timeStamp = timeStamp; + } + + public String getSign() { + return sign; + } + + public void setSign(String sign) { + this.sign = sign; + } + + public String getChannelType() { + return channelType; + } + + public void setChannelType(String channelType) { + this.channelType = channelType; + } + + public Consumer getConsumer() { + return consumer; + } + + public void setConsumer(Consumer consumer) { + this.consumer = consumer; + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/member/vo/UpdatePayPwdBean.java b/ruoyi-segchk/src/main/java/com/ruoyi/member/vo/UpdatePayPwdBean.java new file mode 100644 index 0000000..a995915 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/member/vo/UpdatePayPwdBean.java @@ -0,0 +1,173 @@ +package com.ruoyi.member.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.springframework.util.StringUtils; + +/** + * Created by 魔金商城 on 17/11/20. + * 修改支付密码实体 + */ +@ApiModel(description = "修改支付密码实体") +public class UpdatePayPwdBean { + + /** + * 会员id + */ + @ApiModelProperty(value = "会员id") + private long customerId; + + /** + * 用户输入的手机验证码 + */ + @ApiModelProperty(value = "用户输入的手机验证码") + private String code; + + /** + * 存起来的手机验证码 + */ + @ApiModelProperty(value = "存起来的手机验证码") + private String originCode; + + /** + * 密码 + */ + @ApiModelProperty(value = "密码") + private String password; + + /** + * 手机号码 + */ + @ApiModelProperty(value = "手机号码") + private String mobile; + + + /** + * 凭证 + */ + @ApiModelProperty(value = "凭证") + private String certificate; + + /** + * 请求来自 1:pc + */ + @ApiModelProperty(value = "请求来自 1:pc") + private String requestFrom; + + /** + * 用户输入的图片验证码 + */ + @ApiModelProperty(value = "用户输入的图片验证码") + private String kaptcha; + + /** + * 存在redis中的图片验证码 + */ + @ApiModelProperty(value = "存在redis中的图片验证码") + private String oldKaptcha; + + /** + * 随机数 + */ + @ApiModelProperty(value = "随机数") + private String uuid; + + + /** + * 是否有凭证 + * + * @return 有返回true + */ + public boolean hasCertificate() { + return !StringUtils.isEmpty(certificate); + } + + /** + * 校验用户输入的验证码是否正确 + * + * @return 正确返回true + */ + public boolean validateCode() { + return StringUtils.isEmpty(this.code) ? false : this.code.equals(this.originCode); + } + + public long getCustomerId() { + return customerId; + } + + public void setCustomerId(long customerId) { + this.customerId = customerId; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getOriginCode() { + return originCode; + } + + public void setOriginCode(String originCode) { + this.originCode = originCode; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public String getMobile() { + return mobile; + } + + public void setMobile(String mobile) { + this.mobile = mobile; + } + + public String getCertificate() { + return certificate; + } + + public void setCertificate(String certificate) { + this.certificate = certificate; + } + + public String getRequestFrom() { + return requestFrom; + } + + public void setRequestFrom(String requestFrom) { + this.requestFrom = requestFrom; + } + + public String getKaptcha() { + return kaptcha; + } + + public void setKaptcha(String kaptcha) { + this.kaptcha = kaptcha; + } + + public String getOldKaptcha() { + return oldKaptcha; + } + + public void setOldKaptcha(String oldKaptcha) { + this.oldKaptcha = oldKaptcha; + } + + public String getUuid() { + return uuid; + } + + public void setUuid(String uuid) { + this.uuid = uuid; + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/member/vo/UpdatePwdBean.java b/ruoyi-segchk/src/main/java/com/ruoyi/member/vo/UpdatePwdBean.java new file mode 100644 index 0000000..1d71b98 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/member/vo/UpdatePwdBean.java @@ -0,0 +1,172 @@ +package com.ruoyi.member.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.springframework.util.StringUtils; + +/** + * Created by 魔金商城 on 17/11/20. + * 修改密码实体 + */ +@ApiModel(description = "修改密码实体") +public class UpdatePwdBean { + + /** + * 会员id + */ + @ApiModelProperty(value = "会员id") + private long customerId; + + /** + * 用户输入的手机验证码 + */ + @ApiModelProperty(value = "用户输入的手机验证码") + private String code; + + /** + * 存起来的手机验证码 + */ + @ApiModelProperty(value = "存起来的手机验证码") + private String originCode; + + /** + * 密码 + */ + @ApiModelProperty(value = "密码") + private String password; + + /** + * 手机号码 + */ + @ApiModelProperty(value = "手机号码") + private String mobile; + + /** + * 凭证 + */ + @ApiModelProperty(value = "凭证") + private String certificate; + + /** + * 请求来自 1:pc + */ + @ApiModelProperty(value = "请求来自 1:pc") + private String requestFrom; + + /** + * 用户输入的图片验证码 + */ + @ApiModelProperty(value = "用户输入的图片验证码") + private String kaptcha; + + /** + * 存在redis中的图片验证码 + */ + @ApiModelProperty(value = "存在redis中的图片验证码") + private String oldKaptcha; + + /** + * 随机数 + */ + @ApiModelProperty(value = "随机数") + private String uuid; + + + /** + * 是否有凭证 + * + * @return 有返回true + */ + public boolean hasCertificate() { + return !StringUtils.isEmpty(certificate); + } + + /** + * 校验用户输入的验证码是否正确 + * + * @return 正确返回true + */ + public boolean validateCode() { + return StringUtils.isEmpty(this.code) ? false : this.code.equals(this.originCode); + } + + public long getCustomerId() { + return customerId; + } + + public void setCustomerId(long customerId) { + this.customerId = customerId; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getOriginCode() { + return originCode; + } + + public void setOriginCode(String originCode) { + this.originCode = originCode; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public String getMobile() { + return mobile; + } + + public void setMobile(String mobile) { + this.mobile = mobile; + } + + public String getCertificate() { + return certificate; + } + + public void setCertificate(String certificate) { + this.certificate = certificate; + } + + public String getRequestFrom() { + return requestFrom; + } + + public void setRequestFrom(String requestFrom) { + this.requestFrom = requestFrom; + } + + public String getKaptcha() { + return kaptcha; + } + + public void setKaptcha(String kaptcha) { + this.kaptcha = kaptcha; + } + + public String getOldKaptcha() { + return oldKaptcha; + } + + public void setOldKaptcha(String oldKaptcha) { + this.oldKaptcha = oldKaptcha; + } + + public String getUuid() { + return uuid; + } + + public void setUuid(String uuid) { + this.uuid = uuid; + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/order/service/impl/PaySupplier.java b/ruoyi-segchk/src/main/java/com/ruoyi/order/service/impl/PaySupplier.java new file mode 100644 index 0000000..f29d612 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/order/service/impl/PaySupplier.java @@ -0,0 +1,16 @@ +package com.ruoyi.order.service.impl; + +/** + * Created by 魔金商城 on 17/12/22. + * 支付接口 + */ +@FunctionalInterface +public interface PaySupplier { + + /** + * 获得支付返回的参数结果 + * + * @return 返回支付参数结果 + */ + D getPayParams(T t, U u); +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/order/vo/OrderItem.java b/ruoyi-segchk/src/main/java/com/ruoyi/order/vo/OrderItem.java new file mode 100644 index 0000000..4ea62d4 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/order/vo/OrderItem.java @@ -0,0 +1,9 @@ +package com.ruoyi.order.vo; + +/** + * Created by 魔金商城 on 17/11/13. + * 订单枚举 + */ +public enum OrderItem { + LOG, ATTR, SKUS, CANREFUND, CANRETRUN, EXPRESSURL, STORE_INFO, BACK_PROGRESS, CUSTOMER, COMMUNITYHEAD +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkCarouseMgt.java b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkCarouseMgt.java new file mode 100644 index 0000000..e633c23 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkCarouseMgt.java @@ -0,0 +1,126 @@ +package com.ruoyi.segchk.domain; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +import java.util.Date; + +/** + * seg首页轮播图管理对象 segchk_carouse_mgt + * + * @author yinzhiying + * @date 2021-08-23 + */ +public class SegchkCarouseMgt extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 轮播图id */ + @Excel(name = "轮播图id") + private Long carouseId; + + /** 运营商id,全局唯一 */ + @Excel(name = "运营商id,全局唯一") + private Long providerId; + + /** 商家id,全局唯一 */ + @Excel(name = "商家id,全局唯一") + private Long storeId; + + /** 商家轮播图1路径,默认用于首页推荐轮播图 */ + @Excel(name = "商家轮播图1路径,默认用于首页推荐轮播图") + private String storeCarousel; + + /** 管理状态,0有效,-1失效 */ + @Excel(name = "管理状态,0有效,-1失效") + private Integer mgtState; + + /** 排序id */ + @Excel(name = "排序id") + private Integer sortId; + + /** 修改时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "修改时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date modTime; + + public void setCarouseId(Long carouseId) + { + this.carouseId = carouseId; + } + + public Long getCarouseId() + { + return carouseId; + } + public void setProviderId(Long providerId) + { + this.providerId = providerId; + } + + public Long getProviderId() + { + return providerId; + } + public void setStoreId(Long storeId) + { + this.storeId = storeId; + } + + public Long getStoreId() + { + return storeId; + } + public void setStoreCarousel(String storeCarousel) + { + this.storeCarousel = storeCarousel; + } + + public String getStoreCarousel() + { + return storeCarousel; + } + public void setMgtState(Integer mgtState) + { + this.mgtState = mgtState; + } + + public Integer getMgtState() + { + return mgtState; + } + public void setSortId(Integer sortId) + { + this.sortId = sortId; + } + + public Integer getSortId() + { + return sortId; + } + public void setModTime(Date modTime) + { + this.modTime = modTime; + } + + public Date getModTime() + { + return modTime; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("carouseId", getCarouseId()) + .append("providerId", getProviderId()) + .append("storeId", getStoreId()) + .append("storeCarousel", getStoreCarousel()) + .append("mgtState", getMgtState()) + .append("sortId", getSortId()) + .append("modTime", getModTime()) + .toString(); + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkChargeCard.java b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkChargeCard.java new file mode 100644 index 0000000..4253f8b --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkChargeCard.java @@ -0,0 +1,124 @@ +package com.ruoyi.segchk.domain; + +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +import java.math.BigDecimal; + +/** + * seg充值卡管理对象 segchk_charge_card + * + * @author yinzhiying + * @date 2021-08-23 + */ +public class SegchkChargeCard extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 运营商id,全局唯一 */ + @Excel(name = "运营商id,全局唯一") + private Long providerId; + + /** 卡类型id */ + @Excel(name = "卡类型id") + private Long cardTypeId; + + /** 卡类型名称(9.9,99,199,299) */ + @Excel(name = "卡类型名称(9.9,99,199,299)") + private String cardTypeName; + + /** 卡面额 */ + @Excel(name = "卡面额") + private BigDecimal cardTypeValue; + + /** 有效期时长 */ + @Excel(name = "有效期时长") + private Integer effectiveTime; + + /** 可购买次数 */ + @Excel(name = "可购买次数") + private Integer buyCount; + + /** 卡类型总核消次数 */ + @Excel(name = "卡类型总核消次数") + private Integer cardTypeChkcount; + + public void setProviderId(Long providerId) + { + this.providerId = providerId; + } + + public Long getProviderId() + { + return providerId; + } + public void setCardTypeId(Long cardTypeId) + { + this.cardTypeId = cardTypeId; + } + + public Long getCardTypeId() + { + return cardTypeId; + } + public void setCardTypeName(String cardTypeName) + { + this.cardTypeName = cardTypeName; + } + + public String getCardTypeName() + { + return cardTypeName; + } + public void setCardTypeValue(BigDecimal cardTypeValue) + { + this.cardTypeValue = cardTypeValue; + } + + public BigDecimal getCardTypeValue() + { + return cardTypeValue; + } + public void setEffectiveTime(Integer effectiveTime) + { + this.effectiveTime = effectiveTime; + } + + public Integer getEffectiveTime() + { + return effectiveTime; + } + public void setBuyCount(Integer buyCount) + { + this.buyCount = buyCount; + } + + public Integer getBuyCount() + { + return buyCount; + } + public void setCardTypeChkcount(Integer cardTypeChkcount) + { + this.cardTypeChkcount = cardTypeChkcount; + } + + public Integer getCardTypeChkcount() + { + return cardTypeChkcount; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("providerId", getProviderId()) + .append("cardTypeId", getCardTypeId()) + .append("cardTypeName", getCardTypeName()) + .append("cardTypeValue", getCardTypeValue()) + .append("effectiveTime", getEffectiveTime()) + .append("buyCount", getBuyCount()) + .append("cardTypeChkcount", getCardTypeChkcount()) + .toString(); + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkChargeRet.java b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkChargeRet.java new file mode 100644 index 0000000..0b221a0 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkChargeRet.java @@ -0,0 +1,47 @@ +package com.ruoyi.segchk.domain; + +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * seg充值卡管理对象 segchk_charge_card + * + * @author yinzhiying + * @date 2021-07-01 + */ +public class SegchkChargeRet extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 充值id */ + @Excel(name = "充值id") + private Long chargeId; + + /** 卡id */ + @Excel(name = "卡id") + private Long cardId; + + public Long getChargeId() { + return chargeId; + } + + public void setChargeId(Long chargeId) { + this.chargeId = chargeId; + } + + public Long getCardId() { + return cardId; + } + + public void setCardId(Long cardId) { + this.cardId = cardId; + } + + @Override + public String toString() { + return "SegchkChargeRet{" + + "chargeId=" + chargeId + + ", cardId=" + cardId + + '}'; + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkCommentAcc.java b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkCommentAcc.java new file mode 100644 index 0000000..de7175b --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkCommentAcc.java @@ -0,0 +1,112 @@ +package com.ruoyi.segchk.domain; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +import java.util.Date; + +/** + * seg商家累积评价对象 segchk_comment_acc + * + * @author yinzhiying + * @date 2021-08-23 + */ +public class SegchkCommentAcc extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 更新id,全表唯一 */ + @Excel(name = "更新id,全表唯一") + private Long updateId; + + /** 评价次数 */ + @Excel(name = "评价次数") + private Long starCount; + + /** 评价总分 */ + @Excel(name = "评价总分") + private Long starLevel; + + /** 商家id,全局唯一 */ + @Excel(name = "商家id,全局唯一") + private Long storeId; + + /** 运营商id,全局唯一 */ + @Excel(name = "运营商id,全局唯一") + private Long providerId; + + /** 创建或修改时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "创建或修改时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date modTime; + + public void setUpdateId(Long updateId) + { + this.updateId = updateId; + } + + public Long getUpdateId() + { + return updateId; + } + public void setStarCount(Long starCount) + { + this.starCount = starCount; + } + + public Long getStarCount() + { + return starCount; + } + public void setStarLevel(Long starLevel) + { + this.starLevel = starLevel; + } + + public Long getStarLevel() + { + return starLevel; + } + public void setStoreId(Long storeId) + { + this.storeId = storeId; + } + + public Long getStoreId() + { + return storeId; + } + public void setProviderId(Long providerId) + { + this.providerId = providerId; + } + + public Long getProviderId() + { + return providerId; + } + public void setModTime(Date modTime) + { + this.modTime = modTime; + } + + public Date getModTime() + { + return modTime; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("updateId", getUpdateId()) + .append("starCount", getStarCount()) + .append("starLevel", getStarLevel()) + .append("storeId", getStoreId()) + .append("providerId", getProviderId()) + .append("modTime", getModTime()) + .toString(); + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkDistrictInfo.java b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkDistrictInfo.java new file mode 100644 index 0000000..78e35ee --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkDistrictInfo.java @@ -0,0 +1,80 @@ +package com.ruoyi.segchk.domain; + +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +/** + * seg行政区域代码对象 segchk_district_info + * + * @author yinzhiying + * @date 2021-08-23 + */ +public class SegchkDistrictInfo extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 行政区代码 */ + @Excel(name = "行政区代码") + private Integer districtId; + + /** 行政区名称 */ + @Excel(name = "行政区名称") + private String districtName; + + /** 归属行政区代码 */ + @Excel(name = "归属行政区代码") + private Integer districtParent; + + /** 行政区等级,0省直辖市,1地市,2县区 */ + @Excel(name = "行政区等级,0省直辖市,1地市,2县区") + private Integer districtLevel; + + public void setDistrictId(Integer districtId) + { + this.districtId = districtId; + } + + public Integer getDistrictId() + { + return districtId; + } + public void setDistrictName(String districtName) + { + this.districtName = districtName; + } + + public String getDistrictName() + { + return districtName; + } + public void setDistrictParent(Integer districtParent) + { + this.districtParent = districtParent; + } + + public Integer getDistrictParent() + { + return districtParent; + } + public void setDistrictLevel(Integer districtLevel) + { + this.districtLevel = districtLevel; + } + + public Integer getDistrictLevel() + { + return districtLevel; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("districtId", getDistrictId()) + .append("districtName", getDistrictName()) + .append("districtParent", getDistrictParent()) + .append("districtLevel", getDistrictLevel()) + .toString(); + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkKeywordLable.java b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkKeywordLable.java new file mode 100644 index 0000000..64a643a --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkKeywordLable.java @@ -0,0 +1,98 @@ +package com.ruoyi.segchk.domain; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +import java.util.Date; + +/** + * seg关键字管理对象 segchk_keyword_lable + * + * @author yinzhiying + * @date 2021-08-23 + */ +public class SegchkKeywordLable extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 运营商id,全局唯一 */ + @Excel(name = "运营商id,全局唯一") + private Long providerId; + + /** 关键字id */ + @Excel(name = "关键字id") + private Long keywordId; + + /** 卡类型名称(如:餐饮,美容美发,洗车等) */ + @Excel(name = "卡类型名称(如:餐饮,美容美发,洗车等)") + private String keywordName; + + /** 创建或修改时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "创建或修改时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date modTime; + + /** 关键字图片地址 */ + @Excel(name = "关键字图片地址") + private String keywordUrl; + + public void setProviderId(Long providerId) + { + this.providerId = providerId; + } + + public Long getProviderId() + { + return providerId; + } + public void setKeywordId(Long keywordId) + { + this.keywordId = keywordId; + } + + public Long getKeywordId() + { + return keywordId; + } + public void setKeywordName(String keywordName) + { + this.keywordName = keywordName; + } + + public String getKeywordName() + { + return keywordName; + } + public void setModTime(Date modTime) + { + this.modTime = modTime; + } + + public Date getModTime() + { + return modTime; + } + public void setKeywordUrl(String keywordUrl) + { + this.keywordUrl = keywordUrl; + } + + public String getKeywordUrl() + { + return keywordUrl; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("providerId", getProviderId()) + .append("keywordId", getKeywordId()) + .append("keywordName", getKeywordName()) + .append("modTime", getModTime()) + .append("keywordUrl", getKeywordUrl()) + .toString(); + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkLableMgt.java b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkLableMgt.java new file mode 100644 index 0000000..a0c5e79 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkLableMgt.java @@ -0,0 +1,137 @@ +package com.ruoyi.segchk.domain; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +import java.util.Date; + +/** + * seg首页标签管理对象 segchk_lable_mgt + * + * @author yinzhiying + * @date 2021-08-23 + */ +public class SegchkLableMgt extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 运营商id,全局唯一 */ + private Long providerId; + + /** 卡类型id */ + private Long cardTypeId; + + /** 卡类型名称(9.9,99,199,299) */ + @Excel(name = "卡类型名称(9.9,99,199,299)") + private String cardTypeName; + + /** 管理状态,0有效,-1失效 */ + @Excel(name = "管理状态,0有效,-1失效") + private Integer mgtState; + + /** 修改时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "修改时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date modTime; + + /** 展示序号(首页根据此id进行顺序展示) */ + @Excel(name = "展示序号", readConverterExp = "首=页根据此id进行顺序展示") + private Integer sortId; + + /** 标签标识 0来自类型卡,1来自商家关键字 */ + private Integer lableFlag; + + /** 标签图标路径 */ + @Excel(name = "标签图标路径") + private String iconUrl; + + public void setProviderId(Long providerId) + { + this.providerId = providerId; + } + + public Long getProviderId() + { + return providerId; + } + public void setCardTypeId(Long cardTypeId) + { + this.cardTypeId = cardTypeId; + } + + public Long getCardTypeId() + { + return cardTypeId; + } + public void setCardTypeName(String cardTypeName) + { + this.cardTypeName = cardTypeName; + } + + public String getCardTypeName() + { + return cardTypeName; + } + public void setMgtState(Integer mgtState) + { + this.mgtState = mgtState; + } + + public Integer getMgtState() + { + return mgtState; + } + public void setModTime(Date modTime) + { + this.modTime = modTime; + } + + public Date getModTime() + { + return modTime; + } + public void setSortId(Integer sortId) + { + this.sortId = sortId; + } + + public Integer getSortId() + { + return sortId; + } + public void setLableFlag(Integer lableFlag) + { + this.lableFlag = lableFlag; + } + + public Integer getLableFlag() + { + return lableFlag; + } + public void setIconUrl(String iconUrl) + { + this.iconUrl = iconUrl; + } + + public String getIconUrl() + { + return iconUrl; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("providerId", getProviderId()) + .append("cardTypeId", getCardTypeId()) + .append("cardTypeName", getCardTypeName()) + .append("mgtState", getMgtState()) + .append("modTime", getModTime()) + .append("sortId", getSortId()) + .append("lableFlag", getLableFlag()) + .append("iconUrl", getIconUrl()) + .toString(); + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkLogionDetail.java b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkLogionDetail.java new file mode 100644 index 0000000..022e3be --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkLogionDetail.java @@ -0,0 +1,98 @@ +package com.ruoyi.segchk.domain; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +import java.util.Date; + +/** + * seg登录记录对象 segchk_logion_detail + * + * @author yinzhiying + * @date 2021-08-23 + */ +public class SegchkLogionDetail extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 用户id,全局唯一 */ + @Excel(name = "用户id,全局唯一") + private Long userId; + + /** 登录时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "登录时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date logionTime; + + /** 用户等级,0运营商,1商家,2vip会员,3普通会员 */ + @Excel(name = "用户等级,0运营商,1商家,2vip会员,3普通会员") + private String userLevel; + + /** 登录id */ + @Excel(name = "登录id") + private Long loginId; + + /** 运营商id,全局唯一 */ + @Excel(name = "运营商id,全局唯一") + private Long providerId; + + public void setUserId(Long userId) + { + this.userId = userId; + } + + public Long getUserId() + { + return userId; + } + public void setLogionTime(Date logionTime) + { + this.logionTime = logionTime; + } + + public Date getLogionTime() + { + return logionTime; + } + public void setUserLevel(String userLevel) + { + this.userLevel = userLevel; + } + + public String getUserLevel() + { + return userLevel; + } + public void setLoginId(Long loginId) + { + this.loginId = loginId; + } + + public Long getLoginId() + { + return loginId; + } + public void setProviderId(Long providerId) + { + this.providerId = providerId; + } + + public Long getProviderId() + { + return providerId; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("userId", getUserId()) + .append("logionTime", getLogionTime()) + .append("userLevel", getUserLevel()) + .append("loginId", getLoginId()) + .append("providerId", getProviderId()) + .toString(); + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkMsgDetail.java b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkMsgDetail.java new file mode 100644 index 0000000..e0eedf8 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkMsgDetail.java @@ -0,0 +1,182 @@ +package com.ruoyi.segchk.domain; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +import java.util.Date; + +/** + * seg消息记录对象 segchk_msg_detail + * + * @author yinzhiying + * @date 2021-08-23 + */ +public class SegchkMsgDetail extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 源id */ + @Excel(name = "源id") + private Long fromId; + + /** 目标id */ + @Excel(name = "目标id") + private Long toId; + + /** 消息类型,0系统消息,1交易消息,2提醒消息,3评价消息,4核消消息 */ + @Excel(name = "消息类型,0系统消息,1交易消息,2提醒消息,3评价消息,4核消消息") + private String msgType; + + /** 消息内容 */ + @Excel(name = "消息内容") + private String msgContent; + + /** 消息标题 */ + @Excel(name = "消息标题") + private String msgTitle; + + /** 发送时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "发送时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date fromTime; + + /** 接收时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "接收时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date getTime; + + /** 消息id */ + private Long msgId; + + /** 消息状态,0未发送,1,未读,2已读,3删除 */ + @Excel(name = "消息状态,0未发送,1,未读,2已读,3删除") + private String msgFlag; + + /** 运营商id,全局唯一 */ + @Excel(name = "运营商id,全局唯一") + private Long providerId; + + /** 接收人等级,0运营商,1商家,2会员 */ + @Excel(name = "接收人等级,0运营商,1商家,2会员") + private String recvLevel; + + public void setFromId(Long fromId) + { + this.fromId = fromId; + } + + public Long getFromId() + { + return fromId; + } + public void setToId(Long toId) + { + this.toId = toId; + } + + public Long getToId() + { + return toId; + } + public void setMsgType(String msgType) + { + this.msgType = msgType; + } + + public String getMsgType() + { + return msgType; + } + public void setMsgContent(String msgContent) + { + this.msgContent = msgContent; + } + + public String getMsgContent() + { + return msgContent; + } + public void setMsgTitle(String msgTitle) + { + this.msgTitle = msgTitle; + } + + public String getMsgTitle() + { + return msgTitle; + } + public void setFromTime(Date fromTime) + { + this.fromTime = fromTime; + } + + public Date getFromTime() + { + return fromTime; + } + public void setGetTime(Date getTime) + { + this.getTime = getTime; + } + + public Date getGetTime() + { + return getTime; + } + public void setMsgId(Long msgId) + { + this.msgId = msgId; + } + + public Long getMsgId() + { + return msgId; + } + public void setMsgFlag(String msgFlag) + { + this.msgFlag = msgFlag; + } + + public String getMsgFlag() + { + return msgFlag; + } + public void setProviderId(Long providerId) + { + this.providerId = providerId; + } + + public Long getProviderId() + { + return providerId; + } + public void setRecvLevel(String recvLevel) + { + this.recvLevel = recvLevel; + } + + public String getRecvLevel() + { + return recvLevel; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("fromId", getFromId()) + .append("toId", getToId()) + .append("msgType", getMsgType()) + .append("msgContent", getMsgContent()) + .append("msgTitle", getMsgTitle()) + .append("fromTime", getFromTime()) + .append("getTime", getGetTime()) + .append("msgId", getMsgId()) + .append("msgFlag", getMsgFlag()) + .append("providerId", getProviderId()) + .append("recvLevel", getRecvLevel()) + .toString(); + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkMsgWebResp.java b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkMsgWebResp.java new file mode 100644 index 0000000..d477638 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkMsgWebResp.java @@ -0,0 +1,91 @@ +package com.ruoyi.segchk.domain; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +import java.util.Date; + +/** + * seg用户奖励对象 segchk_user_reward + * + * @author yinzhiying + * @date 2021-07-01 + */ +public class SegchkMsgWebResp extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 消息类型,0系统消息,1交易消息,2提醒消息,3评价消息,4核消消息 */ + @Excel(name = "消息类型,0系统消息,1交易消息,2提醒消息,3评价消息,4核消消息") + private String msgType; + + /** 消息内容 */ + @Excel(name = "消息内容") + private String msgContent; + + /** 消息标题 */ + @Excel(name = "消息标题") + private String msgTitle; + + + /** 消息状态,0未发送,1,未读,2已读,3删除 */ + @Excel(name = "消息状态,0未发送,1,未读,2已读,3删除") + private String msgFlag; + + /** 接收时间 */ + @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss") + @Excel(name = "接收时间", width = 30, dateFormat = "yyyy-MM-dd hh:mm:ss") + private Date fromTime; + + public String getMsgType() { + return msgType; + } + + public void setMsgType(String msgType) { + this.msgType = msgType; + } + + public String getMsgContent() { + return msgContent; + } + + public void setMsgContent(String msgContent) { + this.msgContent = msgContent; + } + + public String getMsgTitle() { + return msgTitle; + } + + public void setMsgTitle(String msgTitle) { + this.msgTitle = msgTitle; + } + + public String getMsgFlag() { + return msgFlag; + } + + public void setMsgFlag(String msgFlag) { + this.msgFlag = msgFlag; + } + + public Date getFromTime() { + return fromTime; + } + + public void setFromTime(Date fromTime) { + this.fromTime = fromTime; + } + + @Override + public String toString() { + return "SegchkMsgWebResp{" + + "msgType='" + msgType + '\'' + + ", msgContent='" + msgContent + '\'' + + ", msgTitle='" + msgTitle + '\'' + + ", msgFlag='" + msgFlag + '\'' + + ", fromTime=" + fromTime + + '}'; + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkPreferenceLable.java b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkPreferenceLable.java new file mode 100644 index 0000000..cc8994d --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkPreferenceLable.java @@ -0,0 +1,98 @@ +package com.ruoyi.segchk.domain; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +import java.util.Date; + +/** + * seg优惠管理对象 segchk_preference_lable + * + * @author yinzhiying + * @date 2021-08-23 + */ +public class SegchkPreferenceLable extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 运营商id,全局唯一 */ + @Excel(name = "运营商id,全局唯一") + private Long providerId; + + /** 优惠id */ + @Excel(name = "优惠id") + private Long preferenceId; + + /** 优惠名称(团购,打折等) */ + @Excel(name = "优惠名称(团购,打折等)") + private String preferenceName; + + /** 创建或修改时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "创建或修改时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date modTime; + + /** 优惠图片地址 */ + @Excel(name = "优惠图片地址") + private String preferenceUrl; + + public void setProviderId(Long providerId) + { + this.providerId = providerId; + } + + public Long getProviderId() + { + return providerId; + } + public void setPreferenceId(Long preferenceId) + { + this.preferenceId = preferenceId; + } + + public Long getPreferenceId() + { + return preferenceId; + } + public void setPreferenceName(String preferenceName) + { + this.preferenceName = preferenceName; + } + + public String getPreferenceName() + { + return preferenceName; + } + public void setModTime(Date modTime) + { + this.modTime = modTime; + } + + public Date getModTime() + { + return modTime; + } + public void setPreferenceUrl(String preferenceUrl) + { + this.preferenceUrl = preferenceUrl; + } + + public String getPreferenceUrl() + { + return preferenceUrl; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("providerId", getProviderId()) + .append("preferenceId", getPreferenceId()) + .append("preferenceName", getPreferenceName()) + .append("modTime", getModTime()) + .append("preferenceUrl", getPreferenceUrl()) + .toString(); + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkProviderMgt.java b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkProviderMgt.java new file mode 100644 index 0000000..dee30b0 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkProviderMgt.java @@ -0,0 +1,171 @@ +package com.ruoyi.segchk.domain; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +import java.util.Date; +import java.util.List; + +/** + * seg运营商管理对象 segchk_provider_mgt + * + * @author yinzhiying + * @date 2021-08-23 + */ +public class SegchkProviderMgt extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 小程序的openid */ + @Excel(name = "小程序的openid") + private String openid; + + /** 微信的联合登录id */ + @Excel(name = "微信的联合登录id") + private String unionId; + + /** 运营商id */ + @Excel(name = "运营商id") + private Long providerId; + + /** 昵称 */ + @Excel(name = "昵称") + private String nickName; + + /** 头像地址 */ + @Excel(name = "头像地址") + private String iconUrl; + + /** 手机号码 */ + @Excel(name = "手机号码") + private String phoneNo; + + /** 状态,0正常,1失效,2删除 */ + @Excel(name = "状态,0正常,1失效,2删除") + private Integer flagId; + + /** 区县行政代码 */ + @Excel(name = "区县行政代码") + private Integer districtId; + + /** 删除时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "删除时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date delTime; + + /** seg首页标签管理信息 */ + private List segchkLableMgtList; + + public void setOpenid(String openid) + { + this.openid = openid; + } + + public String getOpenid() + { + return openid; + } + public void setUnionId(String unionId) + { + this.unionId = unionId; + } + + public String getUnionId() + { + return unionId; + } + public void setProviderId(Long providerId) + { + this.providerId = providerId; + } + + public Long getProviderId() + { + return providerId; + } + public void setNickName(String nickName) + { + this.nickName = nickName; + } + + public String getNickName() + { + return nickName; + } + public void setIconUrl(String iconUrl) + { + this.iconUrl = iconUrl; + } + + public String getIconUrl() + { + return iconUrl; + } + public void setPhoneNo(String phoneNo) + { + this.phoneNo = phoneNo; + } + + public String getPhoneNo() + { + return phoneNo; + } + public void setFlagId(Integer flagId) + { + this.flagId = flagId; + } + + public Integer getFlagId() + { + return flagId; + } + public void setDistrictId(Integer districtId) + { + this.districtId = districtId; + } + + public Integer getDistrictId() + { + return districtId; + } + public void setDelTime(Date delTime) + { + this.delTime = delTime; + } + + public Date getDelTime() + { + return delTime; + } + + public List getSegchkLableMgtList() + { + return segchkLableMgtList; + } + + public void setSegchkLableMgtList(List segchkLableMgtList) + { + this.segchkLableMgtList = segchkLableMgtList; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("openid", getOpenid()) + .append("unionId", getUnionId()) + .append("providerId", getProviderId()) + .append("nickName", getNickName()) + .append("iconUrl", getIconUrl()) + .append("phoneNo", getPhoneNo()) + .append("flagId", getFlagId()) + .append("districtId", getDistrictId()) + .append("createTime", getCreateTime()) + .append("delTime", getDelTime()) + .append("updateTime", getUpdateTime()) + .append("segchkLableMgtList", getSegchkLableMgtList()) + .toString(); + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkRecommenderStore.java b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkRecommenderStore.java new file mode 100644 index 0000000..9b28282 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkRecommenderStore.java @@ -0,0 +1,112 @@ +package com.ruoyi.segchk.domain; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +import java.util.Date; + +/** + * seg首页推荐商户对象 segchk_recommender_store + * + * @author yinzhiying + * @date 2021-08-23 + */ +public class SegchkRecommenderStore extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 运营商id,全局唯一 */ + @Excel(name = "运营商id,全局唯一") + private Long providerId; + + /** 商家id,全局唯一 */ + @Excel(name = "商家id,全局唯一") + private Long storeId; + + /** 管理状态,0有效,-1失效 */ + @Excel(name = "管理状态,0有效,-1失效") + private Integer mgtState; + + /** 修改时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "修改时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date modTime; + + /** 展示序号(首页根据此id进行顺序展示) */ + @Excel(name = "展示序号", readConverterExp = "首=页根据此id进行顺序展示") + private Integer sortId; + + /** id,全表唯一 */ + @Excel(name = "id,全表唯一") + private Long recommenderId; + + public void setProviderId(Long providerId) + { + this.providerId = providerId; + } + + public Long getProviderId() + { + return providerId; + } + public void setStoreId(Long storeId) + { + this.storeId = storeId; + } + + public Long getStoreId() + { + return storeId; + } + public void setMgtState(Integer mgtState) + { + this.mgtState = mgtState; + } + + public Integer getMgtState() + { + return mgtState; + } + public void setModTime(Date modTime) + { + this.modTime = modTime; + } + + public Date getModTime() + { + return modTime; + } + public void setSortId(Integer sortId) + { + this.sortId = sortId; + } + + public Integer getSortId() + { + return sortId; + } + public void setRecommenderId(Long recommenderId) + { + this.recommenderId = recommenderId; + } + + public Long getRecommenderId() + { + return recommenderId; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("providerId", getProviderId()) + .append("storeId", getStoreId()) + .append("mgtState", getMgtState()) + .append("modTime", getModTime()) + .append("sortId", getSortId()) + .append("recommenderId", getRecommenderId()) + .toString(); + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkRecommenderStoreLableWeb.java b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkRecommenderStoreLableWeb.java new file mode 100644 index 0000000..fbf8282 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkRecommenderStoreLableWeb.java @@ -0,0 +1,88 @@ +package com.ruoyi.segchk.domain; + +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * seg返回首页推荐商户对象 segchk_recommender_storeweb + * + * @author yinzhiying + * @date 2021-07-01 + */ +public class SegchkRecommenderStoreLableWeb extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + + /** 商户标签id */ + @Excel(name = "商户标签id") + private Integer lableId; + + /** 商户标签显示顺序id */ + @Excel(name = "商户标签显示顺序id") + private Integer lableSortId; + + /** 商户标签类型id */ + @Excel(name = "商户标签类型id") + private Integer lableTypeId; + + /** 商户标签名称 */ + @Excel(name = "商户标签名称") + private String lableName; + + /** 标签图片 */ + @Excel(name = "标签图片") + private String lablePic; + + + public Integer getLableId() { + return lableId; + } + + public void setLableId(Integer lableId) { + this.lableId = lableId; + } + + public Integer getLableSortId() { + return lableSortId; + } + + public void setLableSortId(Integer lableSortId) { + this.lableSortId = lableSortId; + } + + public Integer getLableTypeId() { + return lableTypeId; + } + + public void setLableTypeId(Integer lableTypeId) { + this.lableTypeId = lableTypeId; + } + + public String getLableName() { + return lableName; + } + + public void setLableName(String lableName) { + this.lableName = lableName; + } + + public String getLablePic() { + return lablePic; + } + + public void setLablePic(String lablePic) { + this.lablePic = lablePic; + } + + @Override + public String toString() { + return "SegchkRecommenderStoreLableWeb{" + + "lableId=" + lableId + + ", lableSortId=" + lableSortId + + ", lableTypeId=" + lableTypeId + + ", lableName='" + lableName + '\'' + + ", lablePic='" + lablePic + '\'' + + '}'; + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkRecommenderStoreWebReq.java b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkRecommenderStoreWebReq.java new file mode 100644 index 0000000..59d3525 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkRecommenderStoreWebReq.java @@ -0,0 +1,76 @@ +package com.ruoyi.segchk.domain; + +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +import java.math.BigDecimal; + +/** + * seg返回首页推荐商户对象 segchk_recommender_storeweb + * + * @author yinzhiying + * @date 2021-07-01 + */ +public class SegchkRecommenderStoreWebReq extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 运营商id,全局唯一 */ + @Excel(name = "运营商id,全局唯一") + private Long providerId; + + /** 排序类型 */ + @Excel(name = "排序类型") + private Integer sortType; + + + /** 用户经度 */ + @Excel(name = "用户经度") + private BigDecimal userLon; + + /** 用户纬度 */ + @Excel(name = "用户纬度") + private BigDecimal userLat; + + public Long getProviderId() { + return providerId; + } + + public void setProviderId(Long providerId) { + this.providerId = providerId; + } + + public Integer getSortType() { + return sortType; + } + + public void setSortType(Integer sortType) { + this.sortType = sortType; + } + + public BigDecimal getUserLon() { + return userLon; + } + + public void setUserLon(BigDecimal userLon) { + this.userLon = userLon; + } + + public BigDecimal getUserLat() { + return userLat; + } + + public void setUserLat(BigDecimal userLat) { + this.userLat = userLat; + } + + @Override + public String toString() { + return "SegchkRecommenderStoreWebReq{" + + "providerId=" + providerId + + ", sortType=" + sortType + + ", userLon=" + userLon + + ", userLat=" + userLat + + '}'; + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkRecommenderStoreWebResp.java b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkRecommenderStoreWebResp.java new file mode 100644 index 0000000..85d54ab --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkRecommenderStoreWebResp.java @@ -0,0 +1,182 @@ +package com.ruoyi.segchk.domain; + +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +import javax.validation.Valid; +import java.math.BigDecimal; +import java.util.List; + +/** + * seg返回首页推荐商户对象 segchk_recommender_storeweb + * + * @author yinzhiying + * @date 2021-07-01 + */ +public class SegchkRecommenderStoreWebResp extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 运营商id,全局唯一 */ + @Excel(name = "运营商id,全局唯一") + private Long providerId; + + /** 商家id,全局唯一 */ + @Excel(name = "商家id,全局唯一") + private Long storeId; + + /** 商家名称 */ + @Excel(name = "商家名称") + private String storeName; + + /** 商户显示序号 */ + @Excel(name = "商户显示序号") + private Integer storeSort; + + /** 商户列表模式时的图标 */ + @Excel(name = "商户列表模式时的图标") + private String storeIcon; + + /** 商户的大图标 */ + @Excel(name = "商户的大图标") + private String storeGificon; + + /** 商户经度 */ + @Excel(name = "商户经度") + private BigDecimal storeLon; + + /** 商户纬度 */ + @Excel(name = "商户纬度") + private BigDecimal storeLat; + + /** 商户累积核消次数 */ + @Excel(name = "商户累积核消次数") + private Integer chkCount; + + /** 商户平均星评 */ + @Excel(name = "商户平均星评") + private BigDecimal starAvg; + + /** 用户距离 */ + @Excel(name = "用户距离") + private BigDecimal userDist; + + + /** 商户标签列表 */ + @Valid + private List lables; + + public Long getProviderId() { + return providerId; + } + + public void setProviderId(Long providerId) { + this.providerId = providerId; + } + + public Long getStoreId() { + return storeId; + } + + public void setStoreId(Long storeId) { + this.storeId = storeId; + } + + public Integer getStoreSort() { + return storeSort; + } + + public void setStoreSort(Integer storeSort) { + this.storeSort = storeSort; + } + + public String getStoreIcon() { + return storeIcon; + } + + public void setStoreIcon(String storeIcon) { + this.storeIcon = storeIcon; + } + + public String getStoreGificon() { + return storeGificon; + } + + public void setStoreGificon(String storeGificon) { + this.storeGificon = storeGificon; + } + + public BigDecimal getStoreLon() { + return storeLon; + } + + public void setStoreLon(BigDecimal storeLon) { + this.storeLon = storeLon; + } + + public BigDecimal getStoreLat() { + return storeLat; + } + + public void setStoreLat(BigDecimal storeLat) { + this.storeLat = storeLat; + } + + public Integer getChkCount() { + return chkCount; + } + + public void setChkCount(Integer chkCount) { + this.chkCount = chkCount; + } + + public BigDecimal getStarAvg() { + return starAvg; + } + + public void setStarAvg(BigDecimal starAvg) { + this.starAvg = starAvg; + } + + public List getLables() { + return lables; + } + + public void setLables(List lables) { + this.lables = lables; + } + + public String getStoreName() { + return storeName; + } + + public void setStoreName(String storeName) { + this.storeName = storeName; + } + + @Override + public String toString() { + return "SegchkRecommenderStoreWebResp{" + + "providerId=" + providerId + + ", storeId=" + storeId + + ", storeName=" + storeName + + ", storeSort=" + storeSort + + ", storeIcon='" + storeIcon + '\'' + + ", storeGificon='" + storeGificon + '\'' + + ", storeLon=" + storeLon + + ", storeLat=" + storeLat + + ", chkCount=" + chkCount + + ", starAvg=" + starAvg + + ", lables=" + lables + + ", userDist=" + userDist + + '}'; + } + + public BigDecimal getUserDist() { + return userDist; + } + + public void setUserDist(BigDecimal userDist) { + this.userDist = userDist; + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkSalerInfo.java b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkSalerInfo.java new file mode 100644 index 0000000..9317e3a --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkSalerInfo.java @@ -0,0 +1,126 @@ +package com.ruoyi.segchk.domain; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +import java.util.Date; + +/** + * seg销售人员信息对象 segchk_saler_info + * + * @author yinzhiying + * @date 2021-08-23 + */ +public class SegchkSalerInfo extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 运营商id,全局唯一 */ + @Excel(name = "运营商id,全局唯一") + private Long providerId; + + /** 创建或修改时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "创建或修改时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date modTime; + + /** 销售人员id */ + @Excel(name = "销售人员id") + private Integer salerId; + + /** 销售人员姓名 */ + @Excel(name = "销售人员姓名") + private String salerName; + + /** 销售人员电话 */ + @Excel(name = "销售人员电话") + private String salerPhone; + + /** 销售人员身份证号 */ + @Excel(name = "销售人员身份证号") + private String salerCard; + + /** 销售人员状态,0工作,1非工作状态,2删除 */ + @Excel(name = "销售人员状态,0工作,1非工作状态,2删除") + private Integer salerState; + + public void setProviderId(Long providerId) + { + this.providerId = providerId; + } + + public Long getProviderId() + { + return providerId; + } + public void setModTime(Date modTime) + { + this.modTime = modTime; + } + + public Date getModTime() + { + return modTime; + } + public void setSalerId(Integer salerId) + { + this.salerId = salerId; + } + + public Integer getSalerId() + { + return salerId; + } + public void setSalerName(String salerName) + { + this.salerName = salerName; + } + + public String getSalerName() + { + return salerName; + } + public void setSalerPhone(String salerPhone) + { + this.salerPhone = salerPhone; + } + + public String getSalerPhone() + { + return salerPhone; + } + public void setSalerCard(String salerCard) + { + this.salerCard = salerCard; + } + + public String getSalerCard() + { + return salerCard; + } + public void setSalerState(Integer salerState) + { + this.salerState = salerState; + } + + public Integer getSalerState() + { + return salerState; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("providerId", getProviderId()) + .append("modTime", getModTime()) + .append("salerId", getSalerId()) + .append("salerName", getSalerName()) + .append("salerPhone", getSalerPhone()) + .append("salerCard", getSalerCard()) + .append("salerState", getSalerState()) + .toString(); + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkSelfServiceChk.java b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkSelfServiceChk.java new file mode 100644 index 0000000..8228a3b --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkSelfServiceChk.java @@ -0,0 +1,112 @@ +package com.ruoyi.segchk.domain; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +import java.util.Date; + +/** + * seg自定义卡核消记录对象 segchk_self_service_chk + * + * @author yinzhiying + * @date 2021-08-23 + */ +public class SegchkSelfServiceChk extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 运营商id,全局唯一 */ + @Excel(name = "运营商id,全局唯一") + private Long providerId; + + /** 会员卡号id,全局惟一 */ + @Excel(name = "会员卡号id,全局惟一") + private Long cardId; + + /** 商家id,全局唯一 */ + @Excel(name = "商家id,全局唯一") + private Long storeId; + + /** 用户id,全局唯一 */ + @Excel(name = "用户id,全局唯一") + private Long userId; + + /** 创建或修改时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "创建或修改时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date modTime; + + /** 核消id,全表唯一 */ + @Excel(name = "核消id,全表唯一") + private Long chkServiceId; + + public void setProviderId(Long providerId) + { + this.providerId = providerId; + } + + public Long getProviderId() + { + return providerId; + } + public void setCardId(Long cardId) + { + this.cardId = cardId; + } + + public Long getCardId() + { + return cardId; + } + public void setStoreId(Long storeId) + { + this.storeId = storeId; + } + + public Long getStoreId() + { + return storeId; + } + public void setUserId(Long userId) + { + this.userId = userId; + } + + public Long getUserId() + { + return userId; + } + public void setModTime(Date modTime) + { + this.modTime = modTime; + } + + public Date getModTime() + { + return modTime; + } + public void setChkServiceId(Long chkServiceId) + { + this.chkServiceId = chkServiceId; + } + + public Long getChkServiceId() + { + return chkServiceId; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("providerId", getProviderId()) + .append("cardId", getCardId()) + .append("storeId", getStoreId()) + .append("userId", getUserId()) + .append("modTime", getModTime()) + .append("chkServiceId", getChkServiceId()) + .toString(); + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkServiceAndSaleDetailWebResp.java b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkServiceAndSaleDetailWebResp.java new file mode 100644 index 0000000..4cfe77a --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkServiceAndSaleDetailWebResp.java @@ -0,0 +1,90 @@ +package com.ruoyi.segchk.domain; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +import java.util.Date; + +/** + * seg用户基本信息对象 segchk_user_basic_info + * + * @author yinzhiying + * @date 2021-07-01 + */ +public class SegchkServiceAndSaleDetailWebResp extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 创建或修改时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "创建或修改时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date modTime; + + /** 会员卡号 */ + @Excel(name = "会员卡号") + private Long cardId; + + /** 卡类型名称 */ + @Excel(name = "卡类型名称") + private String cardName; + + /** 商家名称 */ + @Excel(name = "商家名称") + private String storeName; + + /** 统计结果 */ + @Excel(name = "统计结果") + private Long staticCount; + + public Date getModTime() { + return modTime; + } + + public void setModTime(Date modTime) { + this.modTime = modTime; + } + + public Long getCardId() { + return cardId; + } + + public void setCardId(Long cardId) { + this.cardId = cardId; + } + + public String getCardName() { + return cardName; + } + + public void setCardName(String cardName) { + this.cardName = cardName; + } + + public String getStoreName() { + return storeName; + } + + public void setStoreName(String storeName) { + this.storeName = storeName; + } + + public Long getStaticCount() { + return staticCount; + } + + public void setStaticCount(Long staticCount) { + this.staticCount = staticCount; + } + + @Override + public String toString() { + return "SegchkServiceAndSaleDetailWebResp{" + + "modTime=" + modTime + + ", cardId=" + cardId + + ", cardName='" + cardName + '\'' + + ", storeName='" + storeName + '\'' + + ", staticCount=" + staticCount + + '}'; + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkServiceAndSaleWebReq.java b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkServiceAndSaleWebReq.java new file mode 100644 index 0000000..a1ebce6 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkServiceAndSaleWebReq.java @@ -0,0 +1,98 @@ +package com.ruoyi.segchk.domain; + +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * seg用户基本信息对象 segchk_user_basic_info + * + * @author yinzhiying + * @date 2021-07-01 + */ +public class SegchkServiceAndSaleWebReq extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 运营商id,全局唯一 */ + @Excel(name = "运营商id,全局唯一") + private Long providerId; + + /** 商户id */ + @Excel(name = "商户id") + private Long storeId; + + /** 统计等级,0按月统计,1按月查询统计 */ + @Excel(name = "统计等级") + private Integer staticLevel; + + /** 统计月份,只在staticLevel为1时有效,0时为统计的月数 */ + @Excel(name = "统计月份") + private String staticMonth; + + /** 用户身份,0运营商,1商家 */ + @Excel(name = "用户身份") + private Integer userLevel; + + /** 数据源选择,0核消,1售卡 */ + @Excel(name = "数据源选择") + private Integer srcFlag; + + public Long getProviderId() { + return providerId; + } + + public void setProviderId(Long providerId) { + this.providerId = providerId; + } + + public Long getStoreId() { + return storeId; + } + + public void setStoreId(Long storeId) { + this.storeId = storeId; + } + + public Integer getStaticLevel() { + return staticLevel; + } + + public void setStaticLevel(Integer staticLevel) { + this.staticLevel = staticLevel; + } + + public String getStaticMonth() { + return staticMonth; + } + + public void setStaticMonth(String staticMonth) { + this.staticMonth = staticMonth; + } + + public Integer getUserLevel() { + return userLevel; + } + + public void setUserLevel(Integer userLevel) { + this.userLevel = userLevel; + } + + @Override + public String toString() { + return "SegchkServiceAndSaleWebReq{" + + "providerId=" + providerId + + ", storeId=" + storeId + + ", staticLevel='" + staticLevel + '\'' + + ", staticMonth='" + staticMonth + '\'' + + ", userLevel=" + userLevel + + '}'; + } + + public Integer getSrcFlag() { + return srcFlag; + } + + public void setSrcFlag(Integer srcFlag) { + this.srcFlag = srcFlag; + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkServiceAndSaleWebResp.java b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkServiceAndSaleWebResp.java new file mode 100644 index 0000000..245db7b --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkServiceAndSaleWebResp.java @@ -0,0 +1,61 @@ +package com.ruoyi.segchk.domain; + +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * seg用户基本信息对象 segchk_user_basic_info + * + * @author yinzhiying + * @date 2021-07-01 + */ +public class SegchkServiceAndSaleWebResp extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + + /** 统计月份,只在staticLevel为1时有效 */ + @Excel(name = "统计月份") + private String staticMonth; + + /** staticMonth与staticMonth同义,只是为yyyy-mm-01使用查询具备详单时使用 */ + @Excel(name = "统计月份") + private String queryMon; + + /** 统计结果 */ + @Excel(name = "统计结果") + private Long staticCount; + + public String getStaticMonth() { + return staticMonth; + } + + public void setStaticMonth(String staticMonth) { + this.staticMonth = staticMonth; + } + + public Long getStaticCount() { + return staticCount; + } + + public void setStaticCount(Long staticCount) { + this.staticCount = staticCount; + } + + public String getQueryMon() { + return queryMon; + } + + public void setQueryMon(String queryMon) { + this.queryMon = queryMon; + } + + @Override + public String toString() { + return "SegchkServiceAndSaleWebResp{" + + "staticMonth='" + staticMonth + '\'' + + ", queryMon='" + queryMon + '\'' + + ", staticCount=" + staticCount + + '}'; + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkServiceChk.java b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkServiceChk.java new file mode 100644 index 0000000..50f69eb --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkServiceChk.java @@ -0,0 +1,140 @@ +package com.ruoyi.segchk.domain; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +import java.util.Date; + +/** + * seg核消记录对象 segchk_service_chk + * + * @author yinzhiying + * @date 2021-08-23 + */ +public class SegchkServiceChk extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 运营商id,全局唯一 */ + @Excel(name = "运营商id,全局唯一") + private Long providerId; + + /** 会员卡号id,全局惟一 */ + @Excel(name = "会员卡号id,全局惟一") + private Long cardId; + + /** 商家id,全局唯一 */ + @Excel(name = "商家id,全局唯一") + private Long storeId; + + /** 会员卡类型,0--9块9,1---99 */ + @Excel(name = "会员卡类型,0--9块9,1---99") + private Long cardTypeId; + + /** 用户id,全局唯一 */ + @Excel(name = "用户id,全局唯一") + private Long userId; + + /** 创建或修改时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "创建或修改时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date modTime; + + /** 核消id,全表唯一 */ + @Excel(name = "核消id,全表唯一") + private Long chkServiceId; + + /** 评价id */ + @Excel(name = "评价id") + private Long commentId; + + public void setProviderId(Long providerId) + { + this.providerId = providerId; + } + + public Long getProviderId() + { + return providerId; + } + public void setCardId(Long cardId) + { + this.cardId = cardId; + } + + public Long getCardId() + { + return cardId; + } + public void setStoreId(Long storeId) + { + this.storeId = storeId; + } + + public Long getStoreId() + { + return storeId; + } + public void setCardTypeId(Long cardTypeId) + { + this.cardTypeId = cardTypeId; + } + + public Long getCardTypeId() + { + return cardTypeId; + } + public void setUserId(Long userId) + { + this.userId = userId; + } + + public Long getUserId() + { + return userId; + } + public void setModTime(Date modTime) + { + this.modTime = modTime; + } + + public Date getModTime() + { + return modTime; + } + public void setChkServiceId(Long chkServiceId) + { + this.chkServiceId = chkServiceId; + } + + public Long getChkServiceId() + { + return chkServiceId; + } + public void setCommentId(Long commentId) + { + this.commentId = commentId; + } + + public Long getCommentId() + { + return commentId; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("providerId", getProviderId()) + .append("cardId", getCardId()) + .append("storeId", getStoreId()) + .append("cardTypeId", getCardTypeId()) + .append("userId", getUserId()) + .append("modTime", getModTime()) + .append("chkServiceId", getChkServiceId()) + .append("commentId", getCommentId()) + .toString(); + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkServiceComment.java b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkServiceComment.java new file mode 100644 index 0000000..4e495ac --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkServiceComment.java @@ -0,0 +1,112 @@ +package com.ruoyi.segchk.domain; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +import java.util.Date; + +/** + * seg评价记录对象 segchk_service_comment + * + * @author yinzhiying + * @date 2021-08-23 + */ +public class SegchkServiceComment extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 评价id */ + @Excel(name = "评价id") + private Long commentId; + + /** 星级评价 */ + @Excel(name = "星级评价") + private Integer starLevel; + + /** 评价内容 */ + @Excel(name = "评价内容") + private String contentText; + + /** 创建或修改时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "创建或修改时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date modTime; + + /** 运营商id,全局唯一 */ + @Excel(name = "运营商id,全局唯一") + private Long providerId; + + /** 商家id,全局唯一 */ + @Excel(name = "商家id,全局唯一") + private Long storeId; + + public void setCommentId(Long commentId) + { + this.commentId = commentId; + } + + public Long getCommentId() + { + return commentId; + } + public void setStarLevel(Integer starLevel) + { + this.starLevel = starLevel; + } + + public Integer getStarLevel() + { + return starLevel; + } + public void setContentText(String contentText) + { + this.contentText = contentText; + } + + public String getContentText() + { + return contentText; + } + public void setModTime(Date modTime) + { + this.modTime = modTime; + } + + public Date getModTime() + { + return modTime; + } + public void setProviderId(Long providerId) + { + this.providerId = providerId; + } + + public Long getProviderId() + { + return providerId; + } + public void setStoreId(Long storeId) + { + this.storeId = storeId; + } + + public Long getStoreId() + { + return storeId; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("commentId", getCommentId()) + .append("starLevel", getStarLevel()) + .append("contentText", getContentText()) + .append("modTime", getModTime()) + .append("providerId", getProviderId()) + .append("storeId", getStoreId()) + .toString(); + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkServiceCommentUserReq.java b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkServiceCommentUserReq.java new file mode 100644 index 0000000..e3b70a2 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkServiceCommentUserReq.java @@ -0,0 +1,89 @@ +package com.ruoyi.segchk.domain; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +import java.util.Date; + +/** + * seg评价记录对象 SegchkServiceCommentUserReq + * + * @author yinzhiying + * @date 2021-07-30 + */ +public class SegchkServiceCommentUserReq extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 评价id */ + private Long commentId; + + /** 星级评价 */ + @Excel(name = "星级评价") + private Integer starLevel; + + /** 评价内容 */ + @Excel(name = "评价内容") + private String contentText; + + /** 创建或修改时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "创建或修改时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date modTime; + + /** 核消id,全表唯一 */ + @Excel(name = "核消id,全表唯一") + private Long chkServiceId; + + public Long getCommentId() { + return commentId; + } + + public void setCommentId(Long commentId) { + this.commentId = commentId; + } + + public Integer getStarLevel() { + return starLevel; + } + + public void setStarLevel(Integer starLevel) { + this.starLevel = starLevel; + } + + public String getContentText() { + return contentText; + } + + public void setContentText(String contentText) { + this.contentText = contentText; + } + + public Date getModTime() { + return modTime; + } + + public void setModTime(Date modTime) { + this.modTime = modTime; + } + + public Long getChkServiceId() { + return chkServiceId; + } + + public void setChkServiceId(Long chkServiceId) { + this.chkServiceId = chkServiceId; + } + + @Override + public String toString() { + return "SegchkServiceCommentUserReq{" + + "commentId=" + commentId + + ", starLevel=" + starLevel + + ", contentText='" + contentText + '\'' + + ", modTime=" + modTime + + ", chkServiceId=" + chkServiceId + + '}'; + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkServiceCommentWebResp.java b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkServiceCommentWebResp.java new file mode 100644 index 0000000..6efaa49 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkServiceCommentWebResp.java @@ -0,0 +1,116 @@ +package com.ruoyi.segchk.domain; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +import java.util.Date; + +/** + * seg评价记录对象 segchk_service_comment + * + * @author yinzhiying + * @date 2021-07-01 + */ +public class SegchkServiceCommentWebResp extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 商家id,全局唯一 */ + @Excel(name = "商家id,全局唯一") + private Long storeId; + + /** 星级评价 */ + @Excel(name = "星级评价") + private Integer starLevel; + + /** 评价内容 */ + @Excel(name = "评价内容") + private String contentText; + + /** 创建或修改时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "创建或修改时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date modTime; + + /** 运营商id,全局唯一 */ + @Excel(name = "运营商id,全局唯一") + private Long providerId; + + /** 充值卡id */ + @Excel(name = "充值卡名称") + private String cardName; + + /** 用户id,全局唯一 */ + @Excel(name = "用户id,全局唯一") + private String userName; + + public Long getStoreId() { + return storeId; + } + + public void setStoreId(Long storeId) { + this.storeId = storeId; + } + + public Integer getStarLevel() { + return starLevel; + } + + public void setStarLevel(Integer starLevel) { + this.starLevel = starLevel; + } + + public String getContentText() { + return contentText; + } + + public void setContentText(String contentText) { + this.contentText = contentText; + } + + public Date getModTime() { + return modTime; + } + + public void setModTime(Date modTime) { + this.modTime = modTime; + } + + public Long getProviderId() { + return providerId; + } + + public void setProviderId(Long providerId) { + this.providerId = providerId; + } + + public String getCardName() { + return cardName; + } + + public void setCardName(String cardName) { + this.cardName = cardName; + } + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + @Override + public String toString() { + return "SegchkServiceCommentWebResp{" + + "storeId=" + storeId + + ", starLevel=" + starLevel + + ", contentText='" + contentText + '\'' + + ", modTime=" + modTime + + ", providerId=" + providerId + + ", cardName='" + cardName + '\'' + + ", userName='" + userName + '\'' + + '}'; + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkServiceOrderChkResp.java b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkServiceOrderChkResp.java new file mode 100644 index 0000000..a33f110 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkServiceOrderChkResp.java @@ -0,0 +1,138 @@ +package com.ruoyi.segchk.domain; + +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * seg用户基本信息对象 segchk_user_basic_info + * + * @author yinzhiying + * @date 2021-07-01 + */ +public class SegchkServiceOrderChkResp extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 运营商id */ + @Excel(name = "运营商id") + private Long providerId; + + /** 商户id */ + @Excel(name = "商户id") + private Long storeId; + + /** 用户id */ + @Excel(name = "用户id") + private Long userId; + + /** 卡id */ + @Excel(name = "卡id") + private Long cardId; + + /** 会员卡或优惠券下的标签id */ + @Excel(name = "会员卡或优惠券下的标签id") + private Integer lableId; + + /** 卡类型 0 会员卡,1赠卡,2优惠券 */ + @Excel(name = "卡类型") + private Integer typeId; + + /** 卡名称 */ + @Excel(name = "卡名称") + private String cardName; + + /** 剩余次数 */ + @Excel(name = "卡名称") + private Integer leftCount; + + /** 是否支持 */ + @Excel(name = "是否支持") + private Integer isSupported; + + public Long getProviderId() { + return providerId; + } + + public void setProviderId(Long providerId) { + this.providerId = providerId; + } + + public Long getStoreId() { + return storeId; + } + + public void setStoreId(Long storeId) { + this.storeId = storeId; + } + + public Long getUserId() { + return userId; + } + + public void setUserId(Long userId) { + this.userId = userId; + } + + public Long getCardId() { + return cardId; + } + + public void setCardId(Long cardId) { + this.cardId = cardId; + } + + public Integer getLableId() { + return lableId; + } + + public void setLableId(Integer lableId) { + this.lableId = lableId; + } + + public Integer getTypeId() { + return typeId; + } + + public void setTypeId(Integer typeId) { + this.typeId = typeId; + } + + public String getCardName() { + return cardName; + } + + public void setCardName(String cardName) { + this.cardName = cardName; + } + + public Integer getLeftCount() { + return leftCount; + } + + public void setLeftCount(Integer leftCount) { + this.leftCount = leftCount; + } + + public Integer getIsSupported() { + return isSupported; + } + + public void setIsSupported(Integer isSupported) { + this.isSupported = isSupported; + } + + @Override + public String toString() { + return "SegchkServiceOrderChkResp{" + + "providerId=" + providerId + + ", storeId=" + storeId + + ", userId=" + userId + + ", cardId=" + cardId + + ", lableId=" + lableId + + ", typeId=" + typeId + + ", cardName='" + cardName + '\'' + + ", leftCount=" + leftCount + + ", isSupported=" + isSupported + + '}'; + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkServiceOrderChkTestResp.java b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkServiceOrderChkTestResp.java new file mode 100644 index 0000000..d8396d0 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkServiceOrderChkTestResp.java @@ -0,0 +1,209 @@ +package com.ruoyi.segchk.domain; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +import javax.validation.Valid; +import java.util.Date; +import java.util.List; + +/** + * seg用户核消确认信息对象 SegchkServiceOrderChkTestResp + * + * @author yinzhiying + * @date 2021-07-01 + */ +public class SegchkServiceOrderChkTestResp extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 运营商id */ + @Excel(name = "运营商id") + private Long providerId; + + /** 商户id */ + @Excel(name = "商户id") + private Long storeId; + + /** 用户id */ + @Excel(name = "用户id") + private Long userId; + + /** 我想去订单核消卡id */ + @Excel(name = "我想去订单核消卡id") + private Long cardId; + + /** 我想去订单核消卡类型id,0会员卡,1自定义卡,2赠卡 */ + @Excel(name = "我想去订单核消卡类型id") + private Integer cardType; + + /** 我想去订单状态 */ + @Excel(name = "我想去订单状态") + private Integer mgtState; + + /** 我想去订单核消卡名称 */ + @Excel(name = "我想去订单核消卡名称") + private String cardName; + + /** 我想去订单核消卡可使用次数 */ + @Excel(name = "我想去订单核消卡可使用次数") + private Integer totalCount; + + /** 我想去订单核消卡剩余次数 */ + @Excel(name = "我想去订单核消卡剩余次数") + private Integer hasLeftCount; + + /** 我想去订单核消卡状态 */ + @Excel(name = "我想去订单核消卡状态") + private Integer cardStatus; + + /** 是否可赠送卡0可赠,1已有 */ + @Excel(name = "卡id") + private Integer canFree; + + /** 是否过期 0未过期,1过期 */ + @Excel(name = "是否过期") + private Integer isExpire; + + /** 有效期时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "创建或修改时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date modTime; + + /** 商户可赠优惠券标签列表 */ + @Valid + private List segchkRecommenderStoreLableWebList; + + public Long getProviderId() { + return providerId; + } + + public void setProviderId(Long providerId) { + this.providerId = providerId; + } + + public Long getStoreId() { + return storeId; + } + + public void setStoreId(Long storeId) { + this.storeId = storeId; + } + + public Long getUserId() { + return userId; + } + + public void setUserId(Long userId) { + this.userId = userId; + } + + public Long getCardId() { + return cardId; + } + + public void setCardId(Long cardId) { + this.cardId = cardId; + } + + public Integer getCardType() { + return cardType; + } + + public void setCardType(Integer cardType) { + this.cardType = cardType; + } + + public Integer getMgtState() { + return mgtState; + } + + public void setMgtState(Integer mgtState) { + this.mgtState = mgtState; + } + + public String getCardName() { + return cardName; + } + + public void setCardName(String cardName) { + this.cardName = cardName; + } + + public Integer getTotalCount() { + return totalCount; + } + + public void setTotalCount(Integer totalCount) { + this.totalCount = totalCount; + } + + public Integer getHasLeftCount() { + return hasLeftCount; + } + + public void setHasLeftCount(Integer hasLeftCount) { + this.hasLeftCount = hasLeftCount; + } + + public Integer getCardStatus() { + return cardStatus; + } + + public void setCardStatus(Integer cardStatus) { + this.cardStatus = cardStatus; + } + + public Integer getCanFree() { + return canFree; + } + + public void setCanFree(Integer canFree) { + this.canFree = canFree; + } + + public Integer getIsExpire() { + return isExpire; + } + + public void setIsExpire(Integer isExpire) { + this.isExpire = isExpire; + } + + public Date getModTime() { + return modTime; + } + + public void setModTime(Date modTime) { + this.modTime = modTime; + } + + public List getSegchkRecommenderStoreLableWebList() { + return segchkRecommenderStoreLableWebList; + } + + public void setSegchkRecommenderStoreLableWebList(List segchkRecommenderStoreLableWebList) { + this.segchkRecommenderStoreLableWebList = segchkRecommenderStoreLableWebList; + } + + @Override + public String toString() { + return "SegchkServiceOrderChkTestResp{" + + "providerId=" + providerId + + ", storeId=" + storeId + + ", userId=" + userId + + ", cardId=" + cardId + + ", cardType=" + cardType + + ", mgtState=" + mgtState + + ", cardName='" + cardName + '\'' + + ", totalCount=" + totalCount + + ", hasLeftCount=" + hasLeftCount + + ", cardStatus=" + cardStatus + + ", canFree=" + canFree + + ", isExpire=" + isExpire + + ", modTime=" + modTime + + ", segchkRecommenderStoreLableWebList=" + segchkRecommenderStoreLableWebList + + '}'; + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkServiceOrderWebReq.java b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkServiceOrderWebReq.java new file mode 100644 index 0000000..f12f38b --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkServiceOrderWebReq.java @@ -0,0 +1,112 @@ +package com.ruoyi.segchk.domain; + +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * seg用户基本信息对象 segchk_user_basic_info + * + * @author yinzhiying + * @date 2021-07-01 + */ +public class SegchkServiceOrderWebReq extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 运营商id */ + @Excel(name = "运营商id") + private Long providerId; + + /** 商户id */ + @Excel(name = "商户id") + private Long storeId; + + /** 用户id */ + @Excel(name = "用户id") + private Long userId; + + /** 卡id */ + @Excel(name = "卡id") + private Long cardId; + + /** 会员卡或优惠券下的标签id */ + @Excel(name = "会员卡或优惠券下的标签id") + private Integer lableId; + + /** 卡类型 0 会员卡,1赠卡,2优惠券 */ + @Excel(name = "卡类型") + private Integer typeId; + + /** 卡名称 */ + @Excel(name = "卡名称") + private String cardName; + + public Long getProviderId() { + return providerId; + } + + public void setProviderId(Long providerId) { + this.providerId = providerId; + } + + public Long getStoreId() { + return storeId; + } + + public void setStoreId(Long storeId) { + this.storeId = storeId; + } + + public Long getUserId() { + return userId; + } + + public void setUserId(Long userId) { + this.userId = userId; + } + + public Long getCardId() { + return cardId; + } + + public void setCardId(Long cardId) { + this.cardId = cardId; + } + + public Integer getLableId() { + return lableId; + } + + public void setLableId(Integer lableId) { + this.lableId = lableId; + } + + public Integer getTypeId() { + return typeId; + } + + public void setTypeId(Integer typeId) { + this.typeId = typeId; + } + + public String getCardName() { + return cardName; + } + + public void setCardName(String cardName) { + this.cardName = cardName; + } + + @Override + public String toString() { + return "SegchkServiceOrderWebReq{" + + "providerId=" + providerId + + ", storeId=" + storeId + + ", userId=" + userId + + ", cardId=" + cardId + + ", lableId=" + lableId + + ", typeId=" + typeId + + ", cardName='" + cardName + '\'' + + '}'; + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkSmsDetail.java b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkSmsDetail.java new file mode 100644 index 0000000..e3b2f16 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkSmsDetail.java @@ -0,0 +1,95 @@ +package com.ruoyi.segchk.domain; + +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +/** + * seg短信记录对象 segchk_sms_detail + * + * @author yinzhiying + * @date 2021-08-23 + */ +public class SegchkSmsDetail extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 手机号 */ + @Excel(name = "手机号") + private String phoneNo; + + /** 验证码 */ + @Excel(name = "验证码") + private String validateCode; + + /** 标识,0已发送,1已验证 */ + @Excel(name = "标识,0已发送,1已验证") + private String flag; + + /** 短信码id */ + @Excel(name = "短信码id") + private Long shortMsgId; + + /** 运营商id,全局唯一 */ + @Excel(name = "运营商id,全局唯一") + private Long providerId; + + public void setPhoneNo(String phoneNo) + { + this.phoneNo = phoneNo; + } + + public String getPhoneNo() + { + return phoneNo; + } + public void setValidateCode(String validateCode) + { + this.validateCode = validateCode; + } + + public String getValidateCode() + { + return validateCode; + } + public void setFlag(String flag) + { + this.flag = flag; + } + + public String getFlag() + { + return flag; + } + public void setShortMsgId(Long shortMsgId) + { + this.shortMsgId = shortMsgId; + } + + public Long getShortMsgId() + { + return shortMsgId; + } + public void setProviderId(Long providerId) + { + this.providerId = providerId; + } + + public Long getProviderId() + { + return providerId; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("phoneNo", getPhoneNo()) + .append("createTime", getCreateTime()) + .append("validateCode", getValidateCode()) + .append("flag", getFlag()) + .append("shortMsgId", getShortMsgId()) + .append("providerId", getProviderId()) + .toString(); + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkStoreAccount.java b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkStoreAccount.java new file mode 100644 index 0000000..60adbf2 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkStoreAccount.java @@ -0,0 +1,155 @@ +package com.ruoyi.segchk.domain; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * seg商户余额信息对象 segchk_store_account + * + * @author yinzhiying + * @date 2021-08-23 + */ +public class SegchkStoreAccount extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 商家id,全局唯一 */ + @Excel(name = "商家id,全局唯一") + private Long storeId; + + /** 余额 */ + @Excel(name = "余额") + private BigDecimal account; + + /** 余额类型 */ + @Excel(name = "余额类型") + private String accountType; + + /** 余额id */ + @Excel(name = "余额id") + private Long accountId; + + /** 奖励id */ + @Excel(name = "奖励id") + private Long rewardId; + + /** 充值id */ + @Excel(name = "充值id") + private Long chargeId; + + /** 充值id */ + @Excel(name = "充值id") + private Long cashId; + + /** 创建或修改时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "创建或修改时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date modTime; + + /** 运营商id,全局唯一 */ + @Excel(name = "运营商id,全局唯一") + private Long providerId; + + public void setStoreId(Long storeId) + { + this.storeId = storeId; + } + + public Long getStoreId() + { + return storeId; + } + public void setAccount(BigDecimal account) + { + this.account = account; + } + + public BigDecimal getAccount() + { + return account; + } + public void setAccountType(String accountType) + { + this.accountType = accountType; + } + + public String getAccountType() + { + return accountType; + } + public void setAccountId(Long accountId) + { + this.accountId = accountId; + } + + public Long getAccountId() + { + return accountId; + } + public void setRewardId(Long rewardId) + { + this.rewardId = rewardId; + } + + public Long getRewardId() + { + return rewardId; + } + public void setChargeId(Long chargeId) + { + this.chargeId = chargeId; + } + + public Long getChargeId() + { + return chargeId; + } + public void setCashId(Long cashId) + { + this.cashId = cashId; + } + + public Long getCashId() + { + return cashId; + } + public void setModTime(Date modTime) + { + this.modTime = modTime; + } + + public Date getModTime() + { + return modTime; + } + public void setProviderId(Long providerId) + { + this.providerId = providerId; + } + + public Long getProviderId() + { + return providerId; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("storeId", getStoreId()) + .append("account", getAccount()) + .append("accountType", getAccountType()) + .append("accountId", getAccountId()) + .append("rewardId", getRewardId()) + .append("chargeId", getChargeId()) + .append("cashId", getCashId()) + .append("modTime", getModTime()) + .append("providerId", getProviderId()) + .toString(); + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkStoreBasicInfo.java b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkStoreBasicInfo.java new file mode 100644 index 0000000..1fdada2 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkStoreBasicInfo.java @@ -0,0 +1,413 @@ +package com.ruoyi.segchk.domain; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; + +/** + * seg商家基础信息对象 segchk_store_basic_info + * + * @author yinzhiying + * @date 2021-08-23 + */ +public class SegchkStoreBasicInfo extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 运营商id,全局唯一 */ + @Excel(name = "运营商id,全局唯一") + private Long providerId; + + /** 商家id,全局唯一 */ + private Long storeId; + + /** 商家名称 */ + @Excel(name = "商家名称") + private String storeName; + + /** 商家电话 */ + @Excel(name = "商家电话") + private String storePhone; + + /** 微信唯一识别号,用于转账等 */ + @Excel(name = "微信唯一识别号,用于转账等") + private String openid; + + /** 微信的联合登录id */ + @Excel(name = "微信的联合登录id") + private String unionId; + + /** 商家微信昵称 */ + @Excel(name = "商家微信昵称") + private String nickName; + + /** 商家微信头像 */ + @Excel(name = "商家微信头像") + private String iconUrl; + + /** 服务状态,0在线,1下线 */ + @Excel(name = "服务状态,0在线,1下线") + private String serviceState; + + /** 销售id */ + @Excel(name = "销售id") + private Integer salerId; + + /** 合同日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "合同日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date effectiveDate; + + /** 商家执照编号 */ + @Excel(name = "商家执照编号") + private String storeCorporation; + + /** 商家地址 */ + @Excel(name = "商家地址") + private String storeAddr; + + /** 商家法人身份证 */ + @Excel(name = "商家法人身份证") + private String storeCard; + + /** 是否发送通知消息,0发送,1不发送 */ + @Excel(name = "是否发送通知消息,0发送,1不发送") + private String withMsg; + + /** 提现额门限 */ + @Excel(name = "提现额门限") + private BigDecimal cashThreshold; + + /** 提现到账日期,0当天到账,n--N个工作日后到账 */ + @Excel(name = "提现到账日期,0当天到账,n--N个工作日后到账") + private Integer cashDay; + + /** 下线平均星评门限 */ + @Excel(name = "下线平均星评门限") + private BigDecimal serviceDownThreshold; + + /** 是否人工干预,0自动,1人工 */ + @Excel(name = "是否人工干预,0自动,1人工") + private String stateFlag; + + /** 商家经度 */ + @Excel(name = "商家经度") + private BigDecimal storeLon; + + /** 商家纬度 */ + @Excel(name = "商家纬度") + private BigDecimal storeLat; + + /** 商家运营时间 */ + @Excel(name = "商家运营时间") + private String onService; + + /** 商家描述详情 */ + @Excel(name = "商家描述详情") + private String detail; + + /** 创建或修改时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "创建或修改时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date modTime; + + /** seg商家图片信息信息 */ + private List segchkStoreImageList; + + /** seg商家核消卡管理信息 */ + private List segchkStoreChkMgtList; + + /** seg商家标签管理信息 */ + private List segchkStoreLableMgtList; + + /** seg商家密码管理信息 */ + private List segchkStoreSecurityList; + + public void setProviderId(Long providerId) + { + this.providerId = providerId; + } + + public Long getProviderId() + { + return providerId; + } + public void setStoreId(Long storeId) + { + this.storeId = storeId; + } + + public Long getStoreId() + { + return storeId; + } + public void setStoreName(String storeName) + { + this.storeName = storeName; + } + + public String getStoreName() + { + return storeName; + } + public void setStorePhone(String storePhone) + { + this.storePhone = storePhone; + } + + public String getStorePhone() + { + return storePhone; + } + public void setOpenid(String openid) + { + this.openid = openid; + } + + public String getOpenid() + { + return openid; + } + public void setNickName(String nickName) + { + this.nickName = nickName; + } + + public String getNickName() + { + return nickName; + } + public void setIconUrl(String iconUrl) + { + this.iconUrl = iconUrl; + } + + public String getIconUrl() + { + return iconUrl; + } + public void setServiceState(String serviceState) + { + this.serviceState = serviceState; + } + + public String getServiceState() + { + return serviceState; + } + public void setSalerId(Integer salerId) + { + this.salerId = salerId; + } + + public Integer getSalerId() + { + return salerId; + } + public void setEffectiveDate(Date effectiveDate) + { + this.effectiveDate = effectiveDate; + } + + public Date getEffectiveDate() + { + return effectiveDate; + } + public void setStoreCorporation(String storeCorporation) + { + this.storeCorporation = storeCorporation; + } + + public String getStoreCorporation() + { + return storeCorporation; + } + public void setStoreAddr(String storeAddr) + { + this.storeAddr = storeAddr; + } + + public String getStoreAddr() + { + return storeAddr; + } + public void setStoreCard(String storeCard) + { + this.storeCard = storeCard; + } + + public String getStoreCard() + { + return storeCard; + } + public void setWithMsg(String withMsg) + { + this.withMsg = withMsg; + } + + public String getWithMsg() + { + return withMsg; + } + public void setCashThreshold(BigDecimal cashThreshold) + { + this.cashThreshold = cashThreshold; + } + + public BigDecimal getCashThreshold() + { + return cashThreshold; + } + public void setCashDay(Integer cashDay) + { + this.cashDay = cashDay; + } + + public Integer getCashDay() + { + return cashDay; + } + public void setServiceDownThreshold(BigDecimal serviceDownThreshold) + { + this.serviceDownThreshold = serviceDownThreshold; + } + + public BigDecimal getServiceDownThreshold() + { + return serviceDownThreshold; + } + public void setStateFlag(String stateFlag) + { + this.stateFlag = stateFlag; + } + + public String getStateFlag() + { + return stateFlag; + } + public void setStoreLon(BigDecimal storeLon) + { + this.storeLon = storeLon; + } + + public BigDecimal getStoreLon() + { + return storeLon; + } + public void setStoreLat(BigDecimal storeLat) + { + this.storeLat = storeLat; + } + + public BigDecimal getStoreLat() + { + return storeLat; + } + public void setOnService(String onService) + { + this.onService = onService; + } + + public String getOnService() + { + return onService; + } + public void setDetail(String detail) + { + this.detail = detail; + } + + public String getDetail() + { + return detail; + } + public void setModTime(Date modTime) + { + this.modTime = modTime; + } + + public Date getModTime() + { + return modTime; + } + + public List getSegchkStoreImageList() + { + return segchkStoreImageList; + } + + public void setSegchkStoreImageList(List segchkStoreImageList) + { + this.segchkStoreImageList = segchkStoreImageList; + } + + public List getSegchkStoreChkMgtList() { + return segchkStoreChkMgtList; + } + + public void setSegchkStoreChkMgtList(List segchkStoreChkMgtList) { + this.segchkStoreChkMgtList = segchkStoreChkMgtList; + } + + public List getSegchkStoreLableMgtList() { + return segchkStoreLableMgtList; + } + + public void setSegchkStoreLableMgtList(List segchkStoreLableMgtList) { + this.segchkStoreLableMgtList = segchkStoreLableMgtList; + } + + public List getSegchkStoreSecurityList() { + return segchkStoreSecurityList; + } + + public void setSegchkStoreSecurityList(List segchkStoreSecurityList) { + this.segchkStoreSecurityList = segchkStoreSecurityList; + } + + public String getUnionId() { + return unionId; + } + + public void setUnionId(String unionId) { + this.unionId = unionId; + } + + @Override + public String toString() { + return "SegchkStoreBasicInfo{" + + "providerId=" + providerId + + ", storeId=" + storeId + + ", storeName='" + storeName + '\'' + + ", storePhone='" + storePhone + '\'' + + ", openid='" + openid + '\'' + + ", unionId='" + unionId + '\'' + + ", nickName='" + nickName + '\'' + + ", iconUrl='" + iconUrl + '\'' + + ", serviceState='" + serviceState + '\'' + + ", salerId=" + salerId + + ", effectiveDate=" + effectiveDate + + ", storeCorporation='" + storeCorporation + '\'' + + ", storeAddr='" + storeAddr + '\'' + + ", storeCard='" + storeCard + '\'' + + ", withMsg='" + withMsg + '\'' + + ", cashThreshold=" + cashThreshold + + ", cashDay=" + cashDay + + ", serviceDownThreshold=" + serviceDownThreshold + + ", stateFlag='" + stateFlag + '\'' + + ", storeLon=" + storeLon + + ", storeLat=" + storeLat + + ", onService='" + onService + '\'' + + ", detail='" + detail + '\'' + + ", modTime=" + modTime + + ", segchkStoreImageList=" + segchkStoreImageList + + ", segchkStoreChkMgtList=" + segchkStoreChkMgtList + + ", segchkStoreLableMgtList=" + segchkStoreLableMgtList + + ", segchkStoreSecurityList=" + segchkStoreSecurityList + + '}'; + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkStoreBasicInfoWebResp.java b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkStoreBasicInfoWebResp.java new file mode 100644 index 0000000..1a01d1b --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkStoreBasicInfoWebResp.java @@ -0,0 +1,298 @@ +package com.ruoyi.segchk.domain; + +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +import javax.validation.Valid; +import java.math.BigDecimal; +import java.util.List; + +/** + * seg商家详情页对象 SegchkStoreBasicInfoWebResp + * + * @author yinzhiying + * @date 2021-07-12 + */ +public class SegchkStoreBasicInfoWebResp extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 运营商id,全局唯一 */ + @Excel(name = "运营商id,全局唯一") + private Long providerId; + + /** 商家id,全局唯一 */ + @Excel(name = "商家id,全局唯一") + private Long storeId; + + /** 商家名称 */ + @Excel(name = "商家名称") + private String storeName; + + /** 商家电话 */ + @Excel(name = "商家电话") + private String storePhone; + + /** 服务状态,0在线,1下线 */ + @Excel(name = "服务状态,0在线,1下线") + private String serviceState; + + /** 销售id */ + @Excel(name = "销售id") + private Integer salerId; + + /** 商家地址 */ + @Excel(name = "商家地址") + private String storeAddr; + + /** 商家经度 */ + @Excel(name = "商家经度") + private BigDecimal storeLon; + + /** 商家纬度 */ + @Excel(name = "商家纬度") + private BigDecimal storeLat; + + /** 商家运营时间 */ + @Excel(name = "商家运营时间") + private String onService; + + /** 商家描述详情 */ + @Excel(name = "商家描述详情") + private String detail; + + /** 商家轮播图1路径,默认用于首页推荐轮播图 */ + @Excel(name = "商家轮播图1路径,默认用于首页推荐轮播图") + private String storeCarousel1; + + /** 商家轮播图2路径 */ + @Excel(name = "商家轮播图2路径") + private String storeCarousel2; + + /** 商家轮播图3路径 */ + @Excel(name = "商家轮播图3路径") + private String storeCarousel3; + + /** 商家轮播图4路径 */ + @Excel(name = "商家轮播图4路径") + private String storeCarousel4; + + /** 商家轮播图5路径 */ + @Excel(name = "商家轮播图5路径") + private String storeCarousel5; + + /** 商家轮播图6路径 */ + @Excel(name = "商家轮播图6路径") + private String storeCarousel6; + + /** 商户累积核消次数 */ + @Excel(name = "商户累积核消次数") + private Integer chkCount; + + /** 商户平均星评 */ + @Excel(name = "商户平均星评") + private BigDecimal starAvg; + + /** 商户标签列表 */ + @Valid + private List segchkRecommenderStoreLableWebList; + + public void setProviderId(Long providerId) + { + this.providerId = providerId; + } + + public Long getProviderId() + { + return providerId; + } + public void setStoreId(Long storeId) + { + this.storeId = storeId; + } + + public Long getStoreId() + { + return storeId; + } + public void setStoreName(String storeName) + { + this.storeName = storeName; + } + + public String getStoreName() + { + return storeName; + } + public void setStorePhone(String storePhone) + { + this.storePhone = storePhone; + } + + public void setServiceState(String serviceState) + { + this.serviceState = serviceState; + } + + public String getServiceState() + { + return serviceState; + } + public void setSalerId(Integer salerId) + { + this.salerId = salerId; + } + + public Integer getSalerId() + { + return salerId; + } + + public void setStoreAddr(String storeAddr) + { + this.storeAddr = storeAddr; + } + + public String getStoreAddr() + { + return storeAddr; + } + public void setStoreLon(BigDecimal storeLon) + { + this.storeLon = storeLon; + } + + public BigDecimal getStoreLon() + { + return storeLon; + } + public void setStoreLat(BigDecimal storeLat) + { + this.storeLat = storeLat; + } + + public BigDecimal getStoreLat() + { + return storeLat; + } + public void setOnService(String onService) + { + this.onService = onService; + } + + public String getOnService() + { + return onService; + } + public void setDetail(String detail) + { + this.detail = detail; + } + + public String getDetail() + { + return detail; + } + + public String getStorePhone() { + return storePhone; + } + + public String getStoreCarousel1() { + return storeCarousel1; + } + + public void setStoreCarousel1(String storeCarousel1) { + this.storeCarousel1 = storeCarousel1; + } + + public String getStoreCarousel2() { + return storeCarousel2; + } + + public void setStoreCarousel2(String storeCarousel2) { + this.storeCarousel2 = storeCarousel2; + } + + public String getStoreCarousel3() { + return storeCarousel3; + } + + public void setStoreCarousel3(String storeCarousel3) { + this.storeCarousel3 = storeCarousel3; + } + + public String getStoreCarousel4() { + return storeCarousel4; + } + + public void setStoreCarousel4(String storeCarousel4) { + this.storeCarousel4 = storeCarousel4; + } + + public String getStoreCarousel5() { + return storeCarousel5; + } + + public void setStoreCarousel5(String storeCarousel5) { + this.storeCarousel5 = storeCarousel5; + } + + public String getStoreCarousel6() { + return storeCarousel6; + } + + public void setStoreCarousel6(String storeCarousel6) { + this.storeCarousel6 = storeCarousel6; + } + + public List getSegchkRecommenderStoreLableWebList() { + return segchkRecommenderStoreLableWebList; + } + + public void setSegchkRecommenderStoreLableWebList(List segchkRecommenderStoreLableWebList) { + this.segchkRecommenderStoreLableWebList = segchkRecommenderStoreLableWebList; + } + + public Integer getChkCount() { + return chkCount; + } + + public void setChkCount(Integer chkCount) { + this.chkCount = chkCount; + } + + public BigDecimal getStarAvg() { + return starAvg; + } + + public void setStarAvg(BigDecimal starAvg) { + this.starAvg = starAvg; + } + + @Override + public String toString() { + return "SegchkStoreBasicInfoWebResp{" + + "providerId=" + providerId + + ", storeId=" + storeId + + ", storeName='" + storeName + '\'' + + ", storePhone='" + storePhone + '\'' + + ", serviceState='" + serviceState + '\'' + + ", salerId=" + salerId + + ", storeAddr='" + storeAddr + '\'' + + ", storeLon=" + storeLon + + ", storeLat=" + storeLat + + ", onService='" + onService + '\'' + + ", detail='" + detail + '\'' + + ", storeCarousel1='" + storeCarousel1 + '\'' + + ", storeCarousel2='" + storeCarousel2 + '\'' + + ", storeCarousel3='" + storeCarousel3 + '\'' + + ", storeCarousel4='" + storeCarousel4 + '\'' + + ", storeCarousel5='" + storeCarousel5 + '\'' + + ", storeCarousel6='" + storeCarousel6 + '\'' + + ", chkCount=" + chkCount + + ", starAvg=" + starAvg + + ", segchkRecommenderStoreLableWebList=" + segchkRecommenderStoreLableWebList + + '}'; + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkStoreCash.java b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkStoreCash.java new file mode 100644 index 0000000..0ee58fa --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkStoreCash.java @@ -0,0 +1,127 @@ +package com.ruoyi.segchk.domain; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * seg商户户提现记录对象 segchk_store_cash + * + * @author yinzhiying + * @date 2021-08-23 + */ +public class SegchkStoreCash extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 商家id,全局唯一 */ + @Excel(name = "商家id,全局唯一") + private Long storeId; + + /** 提现额 */ + @Excel(name = "提现额") + private BigDecimal cash; + + /** 提现类型 */ + @Excel(name = "提现类型") + private String cashType; + + /** 提现id,全表唯一 */ + @Excel(name = "提现id,全表唯一") + private Long cashId; + + /** 运营商id,全局唯一 */ + @Excel(name = "运营商id,全局唯一") + private Long providerId; + + /** 创建或修改时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "创建或修改时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date modTime; + + /** 提现结果,0未完成,1成功,2失败 */ + @Excel(name = "提现结果,0未完成,1成功,2失败") + private String retFlag; + + public void setStoreId(Long storeId) + { + this.storeId = storeId; + } + + public Long getStoreId() + { + return storeId; + } + public void setCash(BigDecimal cash) + { + this.cash = cash; + } + + public BigDecimal getCash() + { + return cash; + } + public void setCashType(String cashType) + { + this.cashType = cashType; + } + + public String getCashType() + { + return cashType; + } + public void setCashId(Long cashId) + { + this.cashId = cashId; + } + + public Long getCashId() + { + return cashId; + } + public void setProviderId(Long providerId) + { + this.providerId = providerId; + } + + public Long getProviderId() + { + return providerId; + } + public void setModTime(Date modTime) + { + this.modTime = modTime; + } + + public Date getModTime() + { + return modTime; + } + public void setRetFlag(String retFlag) + { + this.retFlag = retFlag; + } + + public String getRetFlag() + { + return retFlag; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("storeId", getStoreId()) + .append("cash", getCash()) + .append("cashType", getCashType()) + .append("cashId", getCashId()) + .append("providerId", getProviderId()) + .append("modTime", getModTime()) + .append("retFlag", getRetFlag()) + .toString(); + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkStoreCharge.java b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkStoreCharge.java new file mode 100644 index 0000000..fff9a9e --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkStoreCharge.java @@ -0,0 +1,127 @@ +package com.ruoyi.segchk.domain; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * seg商户充值记录对象 segchk_store_charge + * + * @author yinzhiying + * @date 2021-08-23 + */ +public class SegchkStoreCharge extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 商家id,全局唯一 */ + @Excel(name = "商家id,全局唯一") + private Long storeId; + + /** 充值额 */ + @Excel(name = "充值额") + private BigDecimal charge; + + /** 充值类型 */ + @Excel(name = "充值类型") + private String chargeType; + + /** 充值id,全表唯一 */ + @Excel(name = "充值id,全表唯一") + private Long chargeId; + + /** 运营商id,全局唯一 */ + @Excel(name = "运营商id,全局唯一") + private Long providerId; + + /** 创建或修改时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "创建或修改时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date modTime; + + /** 结果,0未完成,1成功,2失败 */ + @Excel(name = "结果,0未完成,1成功,2失败") + private String retFlag; + + public void setStoreId(Long storeId) + { + this.storeId = storeId; + } + + public Long getStoreId() + { + return storeId; + } + public void setCharge(BigDecimal charge) + { + this.charge = charge; + } + + public BigDecimal getCharge() + { + return charge; + } + public void setChargeType(String chargeType) + { + this.chargeType = chargeType; + } + + public String getChargeType() + { + return chargeType; + } + public void setChargeId(Long chargeId) + { + this.chargeId = chargeId; + } + + public Long getChargeId() + { + return chargeId; + } + public void setProviderId(Long providerId) + { + this.providerId = providerId; + } + + public Long getProviderId() + { + return providerId; + } + public void setModTime(Date modTime) + { + this.modTime = modTime; + } + + public Date getModTime() + { + return modTime; + } + public void setRetFlag(String retFlag) + { + this.retFlag = retFlag; + } + + public String getRetFlag() + { + return retFlag; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("storeId", getStoreId()) + .append("charge", getCharge()) + .append("chargeType", getChargeType()) + .append("chargeId", getChargeId()) + .append("providerId", getProviderId()) + .append("modTime", getModTime()) + .append("retFlag", getRetFlag()) + .toString(); + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkStoreChkMgt.java b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkStoreChkMgt.java new file mode 100644 index 0000000..34da58e --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkStoreChkMgt.java @@ -0,0 +1,138 @@ +package com.ruoyi.segchk.domain; + +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +import java.math.BigDecimal; + +/** + * seg商家核消卡管理对象 segchk_store_chk_mgt + * + * @author yinzhiying + * @date 2021-08-23 + */ +public class SegchkStoreChkMgt extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 运营商id,全局唯一 */ + @Excel(name = "运营商id,全局唯一") + private Long providerId; + + /** 商家id,全局唯一 */ + @Excel(name = "商家id,全局唯一") + private Long storeId; + + /** 卡类型id */ + @Excel(name = "卡类型id") + private Long cardTypeId; + + /** 该商家针对该类型卡可核消次数 */ + @Excel(name = "该商家针对该类型卡可核消次数") + private Integer chkCount; + + /** 该商家针对该类型卡每月可售卡量 */ + @Excel(name = "该商家针对该类型卡每月可售卡量") + private Integer saleCount; + + /** 售卡奖励 */ + @Excel(name = "售卡奖励") + private BigDecimal cardCommission; + + /** 对应销售人员奖励 */ + @Excel(name = "对应销售人员奖励") + private BigDecimal salerCommission; + + /** 商家核消信息管理id */ + @Excel(name = "商家核消信息管理id") + private Integer mgtId; + + public void setProviderId(Long providerId) + { + this.providerId = providerId; + } + + public Long getProviderId() + { + return providerId; + } + public void setStoreId(Long storeId) + { + this.storeId = storeId; + } + + public Long getStoreId() + { + return storeId; + } + public void setCardTypeId(Long cardTypeId) + { + this.cardTypeId = cardTypeId; + } + + public Long getCardTypeId() + { + return cardTypeId; + } + public void setChkCount(Integer chkCount) + { + this.chkCount = chkCount; + } + + public Integer getChkCount() + { + return chkCount; + } + public void setSaleCount(Integer saleCount) + { + this.saleCount = saleCount; + } + + public Integer getSaleCount() + { + return saleCount; + } + public void setCardCommission(BigDecimal cardCommission) + { + this.cardCommission = cardCommission; + } + + public BigDecimal getCardCommission() + { + return cardCommission; + } + public void setSalerCommission(BigDecimal salerCommission) + { + this.salerCommission = salerCommission; + } + + public BigDecimal getSalerCommission() + { + return salerCommission; + } + public void setMgtId(Integer mgtId) + { + this.mgtId = mgtId; + } + + public Integer getMgtId() + { + return mgtId; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("providerId", getProviderId()) + .append("storeId", getStoreId()) + .append("cardTypeId", getCardTypeId()) + .append("chkCount", getChkCount()) + .append("saleCount", getSaleCount()) + .append("cardCommission", getCardCommission()) + .append("salerCommission", getSalerCommission()) + .append("mgtId", getMgtId()) + .toString(); + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkStoreImage.java b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkStoreImage.java new file mode 100644 index 0000000..38b2db7 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkStoreImage.java @@ -0,0 +1,266 @@ +package com.ruoyi.segchk.domain; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +import java.util.Date; + +/** + * seg商家图片信息对象 segchk_store_image + * + * @author yinzhiying + * @date 2021-08-23 + */ +public class SegchkStoreImage extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 运营商id,全局唯一 */ + @Excel(name = "运营商id,全局唯一") + private Long providerId; + + /** 商家id,全局唯一 */ + @Excel(name = "商家id,全局唯一") + private Long storeId; + + /** 商家营业执照图1路径 */ + @Excel(name = "商家营业执照图1路径") + private String storeCertificate1; + + /** 商家营业执照图2路径 */ + @Excel(name = "商家营业执照图2路径") + private String storeCertificate2; + + /** 商家图标路径,用于在商家列表中显示 */ + @Excel(name = "商家图标路径,用于在商家列表中显示") + private String storeIcon; + + /** 商家大图标路径,用于在商家列表中显示 */ + @Excel(name = "商家大图标路径,用于在商家列表中显示") + private String storeGificon; + + /** 商家轮播图1路径,默认用于首页推荐轮播图 */ + @Excel(name = "商家轮播图1路径,默认用于首页推荐轮播图") + private String storeCarousel1; + + /** 商家轮播图2路径 */ + @Excel(name = "商家轮播图2路径") + private String storeCarousel2; + + /** 商家轮播图3路径 */ + @Excel(name = "商家轮播图3路径") + private String storeCarousel3; + + /** 商家轮播图4路径 */ + @Excel(name = "商家轮播图4路径") + private String storeCarousel4; + + /** 商家轮播图5路径 */ + @Excel(name = "商家轮播图5路径") + private String storeCarousel5; + + /** 商家轮播图6路径 */ + @Excel(name = "商家轮播图6路径") + private String storeCarousel6; + + /** 商家环境图1 */ + @Excel(name = "商家环境图1") + private String storeEnv1; + + /** 商家环境图2 */ + @Excel(name = "商家环境图2") + private String storeEnv2; + + /** 商家环境图3 */ + @Excel(name = "商家环境图3") + private String storeEnv3; + + /** 商家环境图4 */ + @Excel(name = "商家环境图4") + private String storeEnv4; + + /** 创建或修改时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "创建或修改时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date modTime; + + public void setProviderId(Long providerId) + { + this.providerId = providerId; + } + + public Long getProviderId() + { + return providerId; + } + public void setStoreId(Long storeId) + { + this.storeId = storeId; + } + + public Long getStoreId() + { + return storeId; + } + public void setStoreCertificate1(String storeCertificate1) + { + this.storeCertificate1 = storeCertificate1; + } + + public String getStoreCertificate1() + { + return storeCertificate1; + } + public void setStoreCertificate2(String storeCertificate2) + { + this.storeCertificate2 = storeCertificate2; + } + + public String getStoreCertificate2() + { + return storeCertificate2; + } + public void setStoreIcon(String storeIcon) + { + this.storeIcon = storeIcon; + } + + public String getStoreIcon() + { + return storeIcon; + } + public void setStoreGificon(String storeGificon) + { + this.storeGificon = storeGificon; + } + + public String getStoreGificon() + { + return storeGificon; + } + public void setStoreCarousel1(String storeCarousel1) + { + this.storeCarousel1 = storeCarousel1; + } + + public String getStoreCarousel1() + { + return storeCarousel1; + } + public void setStoreCarousel2(String storeCarousel2) + { + this.storeCarousel2 = storeCarousel2; + } + + public String getStoreCarousel2() + { + return storeCarousel2; + } + public void setStoreCarousel3(String storeCarousel3) + { + this.storeCarousel3 = storeCarousel3; + } + + public String getStoreCarousel3() + { + return storeCarousel3; + } + public void setStoreCarousel4(String storeCarousel4) + { + this.storeCarousel4 = storeCarousel4; + } + + public String getStoreCarousel4() + { + return storeCarousel4; + } + public void setStoreCarousel5(String storeCarousel5) + { + this.storeCarousel5 = storeCarousel5; + } + + public String getStoreCarousel5() + { + return storeCarousel5; + } + public void setStoreCarousel6(String storeCarousel6) + { + this.storeCarousel6 = storeCarousel6; + } + + public String getStoreCarousel6() + { + return storeCarousel6; + } + public void setStoreEnv1(String storeEnv1) + { + this.storeEnv1 = storeEnv1; + } + + public String getStoreEnv1() + { + return storeEnv1; + } + public void setStoreEnv2(String storeEnv2) + { + this.storeEnv2 = storeEnv2; + } + + public String getStoreEnv2() + { + return storeEnv2; + } + public void setStoreEnv3(String storeEnv3) + { + this.storeEnv3 = storeEnv3; + } + + public String getStoreEnv3() + { + return storeEnv3; + } + public void setStoreEnv4(String storeEnv4) + { + this.storeEnv4 = storeEnv4; + } + + public String getStoreEnv4() + { + return storeEnv4; + } + public void setModTime(Date modTime) + { + this.modTime = modTime; + } + + public Date getModTime() + { + return modTime; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("providerId", getProviderId()) + .append("storeId", getStoreId()) + .append("storeCertificate1", getStoreCertificate1()) + .append("storeCertificate2", getStoreCertificate2()) + .append("storeIcon", getStoreIcon()) + .append("storeGificon", getStoreGificon()) + .append("storeCarousel1", getStoreCarousel1()) + .append("storeCarousel2", getStoreCarousel2()) + .append("storeCarousel3", getStoreCarousel3()) + .append("storeCarousel4", getStoreCarousel4()) + .append("storeCarousel5", getStoreCarousel5()) + .append("storeCarousel6", getStoreCarousel6()) + .append("storeEnv1", getStoreEnv1()) + .append("storeEnv2", getStoreEnv2()) + .append("storeEnv3", getStoreEnv3()) + .append("storeEnv4", getStoreEnv4()) + .append("modTime", getModTime()) + .toString(); + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkStoreIndexWebResp.java b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkStoreIndexWebResp.java new file mode 100644 index 0000000..8dd6873 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkStoreIndexWebResp.java @@ -0,0 +1,209 @@ +package com.ruoyi.segchk.domain; + +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +import javax.validation.Valid; +import java.math.BigDecimal; +import java.util.List; + +/** + * seg返回首页推荐商户对象 segchk_recommender_storeweb + * + * @author yinzhiying + * @date 2021-07-01 + */ +public class SegchkStoreIndexWebResp extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 运营商id,全局唯一 */ + @Excel(name = "运营商id,全局唯一") + private Long providerId; + + /** 商家id,全局唯一 */ + @Excel(name = "商家id,全局唯一") + private Long storeId; + + /** 商家名称 */ + @Excel(name = "商家名称") + private String storeName; + + /** 商家状态 */ + @Excel(name = "商家状态") + private String serviceState; + + /** 商户显示序号 */ + @Excel(name = "商户显示序号") + private Integer storeSort; + + /** 商户列表模式时的图标 */ + @Excel(name = "商户列表模式时的图标") + private String storeIcon; + + /** 商户的大图标 */ + @Excel(name = "商户的大图标") + private String storeGificon; + + /** 商户经度 */ + @Excel(name = "商户经度") + private BigDecimal storeLon; + + /** 商户纬度 */ + @Excel(name = "商户纬度") + private BigDecimal storeLat; + + /** 用户距离 */ + @Excel(name = "用户距离") + private BigDecimal userDist; + + /** 商户累积核消次数 */ + @Excel(name = "商户累积核消次数") + private Integer chkCount; + + /** 商户平均星评 */ + @Excel(name = "商户平均星评") + private BigDecimal starAvg; + + /** 在线状态 */ + @Excel(name = "对应的销售id") + private Integer salerId; + + + /** 商户标签列表 */ + @Valid + private List lables; + + public Long getProviderId() { + return providerId; + } + + public void setProviderId(Long providerId) { + this.providerId = providerId; + } + + public Long getStoreId() { + return storeId; + } + + public void setStoreId(Long storeId) { + this.storeId = storeId; + } + + public Integer getStoreSort() { + return storeSort; + } + + public void setStoreSort(Integer storeSort) { + this.storeSort = storeSort; + } + + public String getStoreIcon() { + return storeIcon; + } + + public void setStoreIcon(String storeIcon) { + this.storeIcon = storeIcon; + } + + public String getStoreGificon() { + return storeGificon; + } + + public void setStoreGificon(String storeGificon) { + this.storeGificon = storeGificon; + } + + public BigDecimal getStoreLon() { + return storeLon; + } + + public void setStoreLon(BigDecimal storeLon) { + this.storeLon = storeLon; + } + + public BigDecimal getStoreLat() { + return storeLat; + } + + public void setStoreLat(BigDecimal storeLat) { + this.storeLat = storeLat; + } + + public Integer getChkCount() { + return chkCount; + } + + public void setChkCount(Integer chkCount) { + this.chkCount = chkCount; + } + + public BigDecimal getStarAvg() { + return starAvg; + } + + public void setStarAvg(BigDecimal starAvg) { + this.starAvg = starAvg; + } + + public List getLables() { + return lables; + } + + public void setLables(List lables) { + this.lables = lables; + } + + public String getStoreName() { + return storeName; + } + + public void setStoreName(String storeName) { + this.storeName = storeName; + } + + + public String getServiceState() { + return serviceState; + } + + public void setServiceState(String serviceState) { + this.serviceState = serviceState; + } + + public Integer getSalerId() { + return salerId; + } + + public void setSalerId(Integer salerId) { + this.salerId = salerId; + } + + @Override + public String toString() { + return "SegchkStoreIndexWebResp{" + + "providerId=" + providerId + + ", storeId=" + storeId + + ", storeName='" + storeName + '\'' + + ", serviceState='" + serviceState + '\'' + + ", storeSort=" + storeSort + + ", storeIcon='" + storeIcon + '\'' + + ", storeGificon='" + storeGificon + '\'' + + ", storeLon=" + storeLon + + ", storeLat=" + storeLat + + ", chkCount=" + chkCount + + ", starAvg=" + starAvg + + ", salerId=" + salerId + + ", lables=" + lables + + ", userDist=" + userDist + + '}'; + } + + public BigDecimal getUserDist() { + return userDist; + } + + public void setUserDist(BigDecimal userDist) { + this.userDist = userDist; + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkStoreLableMgt.java b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkStoreLableMgt.java new file mode 100644 index 0000000..3bec41b --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkStoreLableMgt.java @@ -0,0 +1,140 @@ +package com.ruoyi.segchk.domain; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +import java.util.Date; + +/** + * seg商家标签管理对象 segchk_store_lable_mgt + * + * @author yinzhiying + * @date 2021-08-23 + */ +public class SegchkStoreLableMgt extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 商家id,全局唯一 */ + @Excel(name = "商家id,全局唯一") + private Long storeId; + + /** 运营商id,全局唯一 */ + @Excel(name = "运营商id,全局唯一") + private Long providerId; + + /** 标签id */ + @Excel(name = "标签id") + private Long lableId; + + /** 显示顺序id */ + @Excel(name = "显示顺序id") + private Integer sortId; + + /** 标签来源id,0关键字,1优惠标签 */ + @Excel(name = "标签来源id,0关键字,1优惠标签") + private Integer typeId; + + /** 管理状态,0有效,-1失效 */ + @Excel(name = "管理状态,0有效,-1失效") + private Integer mgtState; + + /** 创建或修改时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "创建或修改时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date modTime; + + /** 商家核消信息管理id */ + @Excel(name = "商家核消信息管理id") + private Integer mgtId; + + public void setStoreId(Long storeId) + { + this.storeId = storeId; + } + + public Long getStoreId() + { + return storeId; + } + public void setProviderId(Long providerId) + { + this.providerId = providerId; + } + + public Long getProviderId() + { + return providerId; + } + public void setLableId(Long lableId) + { + this.lableId = lableId; + } + + public Long getLableId() + { + return lableId; + } + public void setSortId(Integer sortId) + { + this.sortId = sortId; + } + + public Integer getSortId() + { + return sortId; + } + public void setTypeId(Integer typeId) + { + this.typeId = typeId; + } + + public Integer getTypeId() + { + return typeId; + } + public void setMgtState(Integer mgtState) + { + this.mgtState = mgtState; + } + + public Integer getMgtState() + { + return mgtState; + } + public void setModTime(Date modTime) + { + this.modTime = modTime; + } + + public Date getModTime() + { + return modTime; + } + public void setMgtId(Integer mgtId) + { + this.mgtId = mgtId; + } + + public Integer getMgtId() + { + return mgtId; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("storeId", getStoreId()) + .append("providerId", getProviderId()) + .append("lableId", getLableId()) + .append("sortId", getSortId()) + .append("typeId", getTypeId()) + .append("mgtState", getMgtState()) + .append("modTime", getModTime()) + .append("mgtId", getMgtId()) + .toString(); + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkStoreReward.java b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkStoreReward.java new file mode 100644 index 0000000..4eb1155 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkStoreReward.java @@ -0,0 +1,141 @@ +package com.ruoyi.segchk.domain; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * seg商户奖励对象 segchk_store_reward + * + * @author yinzhiying + * @date 2021-08-23 + */ +public class SegchkStoreReward extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 商家id,全局唯一 */ + @Excel(name = "商家id,全局唯一") + private Long storeId; + + /** 奖励额 */ + @Excel(name = "奖励额") + private BigDecimal reward; + + /** 奖励类型 */ + @Excel(name = "奖励类型") + private String rewardType; + + /** 奖励卡号 */ + @Excel(name = "奖励卡号") + private Long rewardCardId; + + /** 奖励卡类型,0--9块9卡,1--99卡 */ + @Excel(name = "奖励卡类型,0--9块9卡,1--99卡") + private Long rewardCardTypeId; + + /** 创建或修改时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "创建或修改时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date modTime; + + /** 奖励id号,全表唯一 */ + @Excel(name = "奖励id号,全表唯一") + private Long rewardId; + + /** 运营商id,全局唯一 */ + @Excel(name = "运营商id,全局唯一") + private Long providerId; + + public void setStoreId(Long storeId) + { + this.storeId = storeId; + } + + public Long getStoreId() + { + return storeId; + } + public void setReward(BigDecimal reward) + { + this.reward = reward; + } + + public BigDecimal getReward() + { + return reward; + } + public void setRewardType(String rewardType) + { + this.rewardType = rewardType; + } + + public String getRewardType() + { + return rewardType; + } + public void setRewardCardId(Long rewardCardId) + { + this.rewardCardId = rewardCardId; + } + + public Long getRewardCardId() + { + return rewardCardId; + } + public void setRewardCardTypeId(Long rewardCardTypeId) + { + this.rewardCardTypeId = rewardCardTypeId; + } + + public Long getRewardCardTypeId() + { + return rewardCardTypeId; + } + public void setModTime(Date modTime) + { + this.modTime = modTime; + } + + public Date getModTime() + { + return modTime; + } + public void setRewardId(Long rewardId) + { + this.rewardId = rewardId; + } + + public Long getRewardId() + { + return rewardId; + } + public void setProviderId(Long providerId) + { + this.providerId = providerId; + } + + public Long getProviderId() + { + return providerId; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("storeId", getStoreId()) + .append("reward", getReward()) + .append("rewardType", getRewardType()) + .append("rewardCardId", getRewardCardId()) + .append("rewardCardTypeId", getRewardCardTypeId()) + .append("modTime", getModTime()) + .append("rewardId", getRewardId()) + .append("providerId", getProviderId()) + .toString(); + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkStoreSecurity.java b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkStoreSecurity.java new file mode 100644 index 0000000..1a1065f --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkStoreSecurity.java @@ -0,0 +1,98 @@ +package com.ruoyi.segchk.domain; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +import java.util.Date; + +/** + * seg商户密码对象 segchk_store_security + * + * @author yinzhiying + * @date 2021-08-23 + */ +public class SegchkStoreSecurity extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 商家id,全局唯一 */ + @Excel(name = "商家id,全局唯一") + private Long storeId; + + /** 密码 */ + @Excel(name = "密码") + private String passwd; + + /** 创建或修改时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "创建或修改时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date modTime; + + /** 密码id,全表唯一 */ + @Excel(name = "密码id,全表唯一") + private Long pwdId; + + /** 运营商id,全局唯一 */ + @Excel(name = "运营商id,全局唯一") + private Long providerId; + + public void setStoreId(Long storeId) + { + this.storeId = storeId; + } + + public Long getStoreId() + { + return storeId; + } + public void setPasswd(String passwd) + { + this.passwd = passwd; + } + + public String getPasswd() + { + return passwd; + } + public void setModTime(Date modTime) + { + this.modTime = modTime; + } + + public Date getModTime() + { + return modTime; + } + public void setPwdId(Long pwdId) + { + this.pwdId = pwdId; + } + + public Long getPwdId() + { + return pwdId; + } + public void setProviderId(Long providerId) + { + this.providerId = providerId; + } + + public Long getProviderId() + { + return providerId; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("storeId", getStoreId()) + .append("passwd", getPasswd()) + .append("modTime", getModTime()) + .append("pwdId", getPwdId()) + .append("providerId", getProviderId()) + .toString(); + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkStoreSelfMgt.java b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkStoreSelfMgt.java new file mode 100644 index 0000000..97243c4 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkStoreSelfMgt.java @@ -0,0 +1,210 @@ +package com.ruoyi.segchk.domain; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +import java.util.Date; + +/** + * seg商家自定义卡管理对象 segchk_store_self_mgt + * + * @author yinzhiying + * @date 2021-08-23 + */ +public class SegchkStoreSelfMgt extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 赠卡id */ + @Excel(name = "赠卡id") + private Long freeCardId; + + /** 创建或修改时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "创建或修改时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date modTime; + + /** 商家id,全局唯一 */ + @Excel(name = "商家id,全局唯一") + private Long storeId; + + /** 运营商id,全局唯一 */ + @Excel(name = "运营商id,全局唯一") + private Long providerId; + + /** 用户id,全局唯一 */ + @Excel(name = "用户id,全局唯一") + private Long userId; + + /** 会员卡号id,全局惟一 */ + @Excel(name = "会员卡号id,全局惟一") + private Long cardId; + + /** 标签id,只在优惠标签时有效 */ + @Excel(name = "标签id,只在优惠标签时有效") + private Long lableId; + + /** 标签来源id,0自定义卡,2优惠标签 */ + @Excel(name = "标签来源id,0自定义卡,2优惠标签") + private Integer typeId; + + /** 权益次数 */ + @Excel(name = "权益次数") + private Integer freeCount; + + /** 权益卡名称 */ + @Excel(name = "权益卡名称") + private String freeName; + + /** 权益内容 */ + @Excel(name = "权益内容") + private String freeContent; + + /** 剩余权益次数 */ + @Excel(name = "剩余权益次数") + private Integer leftCount; + + /** 状态,0正常,1过期 */ + @Excel(name = "状态,0正常,1过期") + private String status; + + public void setFreeCardId(Long freeCardId) + { + this.freeCardId = freeCardId; + } + + public Long getFreeCardId() + { + return freeCardId; + } + public void setModTime(Date modTime) + { + this.modTime = modTime; + } + + public Date getModTime() + { + return modTime; + } + public void setStoreId(Long storeId) + { + this.storeId = storeId; + } + + public Long getStoreId() + { + return storeId; + } + public void setProviderId(Long providerId) + { + this.providerId = providerId; + } + + public Long getProviderId() + { + return providerId; + } + public void setUserId(Long userId) + { + this.userId = userId; + } + + public Long getUserId() + { + return userId; + } + public void setCardId(Long cardId) + { + this.cardId = cardId; + } + + public Long getCardId() + { + return cardId; + } + public void setLableId(Long lableId) + { + this.lableId = lableId; + } + + public Long getLableId() + { + return lableId; + } + public void setTypeId(Integer typeId) + { + this.typeId = typeId; + } + + public Integer getTypeId() + { + return typeId; + } + public void setFreeCount(Integer freeCount) + { + this.freeCount = freeCount; + } + + public Integer getFreeCount() + { + return freeCount; + } + public void setFreeName(String freeName) + { + this.freeName = freeName; + } + + public String getFreeName() + { + return freeName; + } + public void setFreeContent(String freeContent) + { + this.freeContent = freeContent; + } + + public String getFreeContent() + { + return freeContent; + } + public void setLeftCount(Integer leftCount) + { + this.leftCount = leftCount; + } + + public Integer getLeftCount() + { + return leftCount; + } + public void setStatus(String status) + { + this.status = status; + } + + public String getStatus() + { + return status; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("freeCardId", getFreeCardId()) + .append("modTime", getModTime()) + .append("storeId", getStoreId()) + .append("providerId", getProviderId()) + .append("userId", getUserId()) + .append("cardId", getCardId()) + .append("lableId", getLableId()) + .append("typeId", getTypeId()) + .append("freeCount", getFreeCount()) + .append("freeName", getFreeName()) + .append("freeContent", getFreeContent()) + .append("leftCount", getLeftCount()) + .append("status", getStatus()) + .toString(); + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkStoreWebReq.java b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkStoreWebReq.java new file mode 100644 index 0000000..69c6b80 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkStoreWebReq.java @@ -0,0 +1,166 @@ +package com.ruoyi.segchk.domain; + +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +import java.math.BigDecimal; + +/** + * seg返回首页推荐商户对象 segchk_recommender_storeweb + * + * @author yinzhiying + * @date 2021-07-01 + */ +public class SegchkStoreWebReq extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 运营商id,全局唯一 */ + @Excel(name = "运营商id,全局唯一") + private Long providerId; + + /** 排序类型 */ + @Excel(name = "排序类型") + private Integer sortType; + + /** 商户id */ + @Excel(name = "商户id") + private Integer storeId; + + /** 商户名称 */ + @Excel(name = "商户名称") + private String storeName; + + /** 标签id */ + @Excel(name = "标签id") + private Integer lableId; + + /** 标签名称 */ + @Excel(name = "标签名称") + private String lableName; + + /** 标签类型id */ + @Excel(name = "标签类型id") + private Integer typeId; + + /** 充值卡id */ + @Excel(name = "充值卡id") + private Integer cardId; + + /** 充值卡名称 */ + @Excel(name = "充值卡名称") + private String cardName; + + /** 用户经度 */ + @Excel(name = "用户经度") + private BigDecimal userLon; + + /** 用户纬度 */ + @Excel(name = "用户纬度") + private BigDecimal userLat; + + public Long getProviderId() { + return providerId; + } + + public void setProviderId(Long providerId) { + this.providerId = providerId; + } + + public Integer getSortType() { + return sortType; + } + + public void setSortType(Integer sortType) { + this.sortType = sortType; + } + + public Integer getStoreId() { + return storeId; + } + + public void setStoreId(Integer storeId) { + this.storeId = storeId; + } + + public String getStoreName() { + return storeName; + } + + public void setStoreName(String storeName) { + this.storeName = storeName; + } + + public Integer getLableId() { + return lableId; + } + + public void setLableId(Integer lableId) { + this.lableId = lableId; + } + + public String getLableName() { + return lableName; + } + + public void setLableName(String lableName) { + this.lableName = lableName; + } + + public Integer getTypeId() { + return typeId; + } + + public void setTypeId(Integer typeId) { + this.typeId = typeId; + } + + public Integer getCardId() { + return cardId; + } + + public void setCardId(Integer cardId) { + this.cardId = cardId; + } + + public String getCardName() { + return cardName; + } + + public void setCardName(String cardName) { + this.cardName = cardName; + } + + public BigDecimal getUserLon() { + return userLon; + } + + public void setUserLon(BigDecimal userLon) { + this.userLon = userLon; + } + + public BigDecimal getUserLat() { + return userLat; + } + + public void setUserLat(BigDecimal userLat) { + this.userLat = userLat; + } + + @Override + public String toString() { + return "SegchkStoreWebReq{" + + "providerId=" + providerId + + ", sortType=" + sortType + + ", storeId=" + storeId + + ", storeName='" + storeName + '\'' + + ", lableId=" + lableId + + ", lableName='" + lableName + '\'' + + ", typeId=" + typeId + + ", cardId=" + cardId + + ", cardName='" + cardName + '\'' + + ", userLon=" + userLon + + ", userLat=" + userLat + + '}'; + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkUserAccount.java b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkUserAccount.java new file mode 100644 index 0000000..1bccb6d --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkUserAccount.java @@ -0,0 +1,138 @@ +package com.ruoyi.segchk.domain; + +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +import java.math.BigDecimal; + +/** + * seg用户余额信息对象 segchk_user_account + * + * @author yinzhiying + * @date 2021-08-23 + */ +public class SegchkUserAccount extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 用户id,全局唯一 */ + @Excel(name = "用户id,全局唯一") + private Long userId; + + /** 余额 */ + @Excel(name = "余额") + private BigDecimal account; + + /** 余额类型 */ + @Excel(name = "余额类型") + private String accountType; + + /** 运营商id,全局唯一 */ + @Excel(name = "运营商id,全局唯一") + private Long providerId; + + /** 余额id */ + @Excel(name = "余额id") + private Long accountId; + + /** 奖励id号 */ + @Excel(name = "奖励id号") + private Long rewardId; + + /** 充值id */ + @Excel(name = "充值id") + private Long chargeId; + + /** 提现id */ + @Excel(name = "提现id") + private Long cashId; + + public void setUserId(Long userId) + { + this.userId = userId; + } + + public Long getUserId() + { + return userId; + } + public void setAccount(BigDecimal account) + { + this.account = account; + } + + public BigDecimal getAccount() + { + return account; + } + public void setAccountType(String accountType) + { + this.accountType = accountType; + } + + public String getAccountType() + { + return accountType; + } + public void setProviderId(Long providerId) + { + this.providerId = providerId; + } + + public Long getProviderId() + { + return providerId; + } + public void setAccountId(Long accountId) + { + this.accountId = accountId; + } + + public Long getAccountId() + { + return accountId; + } + public void setRewardId(Long rewardId) + { + this.rewardId = rewardId; + } + + public Long getRewardId() + { + return rewardId; + } + public void setChargeId(Long chargeId) + { + this.chargeId = chargeId; + } + + public Long getChargeId() + { + return chargeId; + } + public void setCashId(Long cashId) + { + this.cashId = cashId; + } + + public Long getCashId() + { + return cashId; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("userId", getUserId()) + .append("account", getAccount()) + .append("accountType", getAccountType()) + .append("providerId", getProviderId()) + .append("accountId", getAccountId()) + .append("rewardId", getRewardId()) + .append("chargeId", getChargeId()) + .append("cashId", getCashId()) + .toString(); + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkUserAccountCheck.java b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkUserAccountCheck.java new file mode 100644 index 0000000..b2c4024 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkUserAccountCheck.java @@ -0,0 +1,76 @@ +package com.ruoyi.segchk.domain; + +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +import java.math.BigDecimal; + +/** + * seg用户余额信息对象 segchk_user_account + * + * @author yinzhiying + * @date 2021-07-01 + */ +public class SegchkUserAccountCheck extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 用户id,全局唯一 */ + @Excel(name = "用户id,全局唯一") + private Long userId; + + /** 余额 */ + @Excel(name = "余额") + private BigDecimal account; + + /** 运营商id,全局唯一 */ + @Excel(name = "运营商id,全局唯一") + private Long providerId; + + /** 余额id */ + @Excel(name = "余额id") + private Long accountId; + + + public Long getUserId() { + return userId; + } + + public void setUserId(Long userId) { + this.userId = userId; + } + + public BigDecimal getAccount() { + return account; + } + + public void setAccount(BigDecimal account) { + this.account = account; + } + + public Long getProviderId() { + return providerId; + } + + public void setProviderId(Long providerId) { + this.providerId = providerId; + } + + public Long getAccountId() { + return accountId; + } + + public void setAccountId(Long accountId) { + this.accountId = accountId; + } + + @Override + public String toString() { + return "SegchkUserAccountCheck{" + + "userId=" + userId + + ", account=" + account + + ", providerId=" + providerId + + ", accountId=" + accountId + + '}'; + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkUserBasicInfo.java b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkUserBasicInfo.java new file mode 100644 index 0000000..eb5e49d --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkUserBasicInfo.java @@ -0,0 +1,124 @@ +package com.ruoyi.segchk.domain; + +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +import java.util.List; + +/** + * seg用户基本信息对象 segchk_user_basic_info + * + * @author yinzhiying + * @date 2021-08-23 + */ +public class SegchkUserBasicInfo extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 用户id,全局唯一 */ + @Excel(name = "用户id,全局唯一") + private Long userId; + + /** 用户手机号 */ + @Excel(name = "用户手机号") + private String phoneNo; + + /** 用户头像,与微信头像一致 */ + @Excel(name = "用户头像,与微信头像一致") + private String userIcon; + + /** 是否绑定微信 */ + @Excel(name = "是否绑定微信") + private String hasWechat; + + /** 卡类型id,NULL普通用户,其他,不同vip卡 */ + @Excel(name = "卡类型id,NULL普通用户,其他,不同vip卡") + private Long cardTypeId; + + /** 运营商id,全局唯一 */ + @Excel(name = "运营商id,全局唯一") + private Long providerId; + + /** seg用户实名认证信息信息 */ + private List segchkUserCertificationInfoList; + + public void setUserId(Long userId) + { + this.userId = userId; + } + + public Long getUserId() + { + return userId; + } + public void setPhoneNo(String phoneNo) + { + this.phoneNo = phoneNo; + } + + public String getPhoneNo() + { + return phoneNo; + } + public void setUserIcon(String userIcon) + { + this.userIcon = userIcon; + } + + public String getUserIcon() + { + return userIcon; + } + public void setHasWechat(String hasWechat) + { + this.hasWechat = hasWechat; + } + + public String getHasWechat() + { + return hasWechat; + } + public void setCardTypeId(Long cardTypeId) + { + this.cardTypeId = cardTypeId; + } + + public Long getCardTypeId() + { + return cardTypeId; + } + public void setProviderId(Long providerId) + { + this.providerId = providerId; + } + + public Long getProviderId() + { + return providerId; + } + + public List getSegchkUserCertificationInfoList() + { + return segchkUserCertificationInfoList; + } + + public void setSegchkUserCertificationInfoList(List segchkUserCertificationInfoList) + { + this.segchkUserCertificationInfoList = segchkUserCertificationInfoList; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("userId", getUserId()) + .append("phoneNo", getPhoneNo()) + .append("userIcon", getUserIcon()) + .append("hasWechat", getHasWechat()) + .append("cardTypeId", getCardTypeId()) + .append("providerId", getProviderId()) + .append("segchkUserCertificationInfoList", getSegchkUserCertificationInfoList()) + .toString(); + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkUserCash.java b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkUserCash.java new file mode 100644 index 0000000..6f3383b --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkUserCash.java @@ -0,0 +1,127 @@ +package com.ruoyi.segchk.domain; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * seg用户提现记录对象 segchk_user_cash + * + * @author yinzhiying + * @date 2021-08-23 + */ +public class SegchkUserCash extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 用户id,全局唯一 */ + @Excel(name = "用户id,全局唯一") + private Long userId; + + /** 提现额 */ + @Excel(name = "提现额") + private BigDecimal cash; + + /** 提现类型 */ + @Excel(name = "提现类型") + private String cashType; + + /** 提现id,全表唯一 */ + @Excel(name = "提现id,全表唯一") + private Long cashId; + + /** 运营商id,全局唯一 */ + @Excel(name = "运营商id,全局唯一") + private Long providerId; + + /** 创建或修改时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "创建或修改时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date modTime; + + /** 结果,0未完成,1成功,2失败 */ + @Excel(name = "结果,0未完成,1成功,2失败") + private Integer retFlag; + + public void setUserId(Long userId) + { + this.userId = userId; + } + + public Long getUserId() + { + return userId; + } + public void setCash(BigDecimal cash) + { + this.cash = cash; + } + + public BigDecimal getCash() + { + return cash; + } + public void setCashType(String cashType) + { + this.cashType = cashType; + } + + public String getCashType() + { + return cashType; + } + public void setCashId(Long cashId) + { + this.cashId = cashId; + } + + public Long getCashId() + { + return cashId; + } + public void setProviderId(Long providerId) + { + this.providerId = providerId; + } + + public Long getProviderId() + { + return providerId; + } + public void setModTime(Date modTime) + { + this.modTime = modTime; + } + + public Date getModTime() + { + return modTime; + } + public void setRetFlag(Integer retFlag) + { + this.retFlag = retFlag; + } + + public Integer getRetFlag() + { + return retFlag; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("userId", getUserId()) + .append("cash", getCash()) + .append("cashType", getCashType()) + .append("cashId", getCashId()) + .append("providerId", getProviderId()) + .append("modTime", getModTime()) + .append("retFlag", getRetFlag()) + .toString(); + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkUserCashOpsReq.java b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkUserCashOpsReq.java new file mode 100644 index 0000000..692216c --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkUserCashOpsReq.java @@ -0,0 +1,123 @@ +package com.ruoyi.segchk.domain; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * seg用户提现记录对象 segchk_user_cash + * + * @author yinzhiying + * @date 2021-07-01 + */ +public class SegchkUserCashOpsReq extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 用户id,全局唯一 */ + @Excel(name = "用户id,全局唯一") + private Long userId; + + /** 提现额 */ + @Excel(name = "提现额") + private BigDecimal cash; + + /** 提现id,全表唯一 */ + @Excel(name = "提现id,全表唯一") + private Long cashId; + + /** 运营商id,全局唯一 */ + @Excel(name = "运营商id,全局唯一") + private Long providerId; + + /** 用户身份,0运营商,1商家,2用户 */ + @Excel(name = "用户身份") + private int userLevel; + + /** 创建或修改时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "创建或修改时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date modTime; + + /** 结果,0未完成,1成功,2失败 */ + @Excel(name = "结果,0未完成,1成功,2失败") + private Integer retFlag; + + public void setUserId(Long userId) + { + this.userId = userId; + } + + public Long getUserId() + { + return userId; + } + public void setCash(BigDecimal cash) + { + this.cash = cash; + } + + public Long getCashId() + { + return cashId; + } + public void setProviderId(Long providerId) + { + this.providerId = providerId; + } + + public Long getProviderId() + { + return providerId; + } + public void setModTime(Date modTime) + { + this.modTime = modTime; + } + + public Date getModTime() + { + return modTime; + } + public void setRetFlag(Integer retFlag) + { + this.retFlag = retFlag; + } + + public Integer getRetFlag() + { + return retFlag; + } + + public BigDecimal getCash() { + return cash; + } + + public void setCashId(Long cashId) { + this.cashId = cashId; + } + + public int getUserLevel() { + return userLevel; + } + + public void setUserLevel(int userLevel) { + this.userLevel = userLevel; + } + + @Override + public String toString() { + return "SegchkUserCashOpsReq{" + + "userId=" + userId + + ", cash=" + cash + + ", cashId=" + cashId + + ", providerId=" + providerId + + ", userLevel=" + userLevel + + ", modTime=" + modTime + + ", retFlag=" + retFlag + + '}'; + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkUserCashOpsResp.java b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkUserCashOpsResp.java new file mode 100644 index 0000000..76f541d --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkUserCashOpsResp.java @@ -0,0 +1,49 @@ +package com.ruoyi.segchk.domain; + +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +import java.math.BigDecimal; + +/** + * seg用户提现记录对象 segchk_user_cash + * + * @author yinzhiying + * @date 2021-07-01 + */ +public class SegchkUserCashOpsResp extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 提现额 */ + @Excel(name = "提现额") + private BigDecimal account; + + /** 提现id,全表唯一 */ + @Excel(name = "提现id,全表唯一") + private Long cashId; + + public BigDecimal getAccount() { + return account; + } + + public void setAccount(BigDecimal account) { + this.account = account; + } + + public Long getCashId() { + return cashId; + } + + public void setCashId(Long cashId) { + this.cashId = cashId; + } + + @Override + public String toString() { + return "SegchkUserCashOpsResp{" + + "account=" + account + + ", cashId=" + cashId + + '}'; + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkUserCashWebResp.java b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkUserCashWebResp.java new file mode 100644 index 0000000..2390fee --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkUserCashWebResp.java @@ -0,0 +1,66 @@ +package com.ruoyi.segchk.domain; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * seg用户奖励对象 segchk_user_reward + * + * @author yinzhiying + * @date 2021-07-01 + */ +public class SegchkUserCashWebResp extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 用户id,全局唯一 */ + @Excel(name = "用户id,全局唯一") + private BigDecimal cash; + + /** 奖励卡号 */ + @Excel(name = "奖励卡号") + private String retFlag; + + /** 创建或修改时间 */ + @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss") + @Excel(name = "创建或修改时间", width = 30, dateFormat = "yyyy-MM-dd hh:mm:ss") + private Date modTime; + + + public BigDecimal getCash() { + return cash; + } + + public void setCash(BigDecimal cash) { + this.cash = cash; + } + + public String getRetFlag() { + return retFlag; + } + + public void setRetFlag(String retFlag) { + this.retFlag = retFlag; + } + + public Date getModTime() { + return modTime; + } + + public void setModTime(Date modTime) { + this.modTime = modTime; + } + + @Override + public String toString() { + return "SegchkUserCashWebResp{" + + "cash=" + cash + + ", retFlag='" + retFlag + '\'' + + ", modTime=" + modTime + + '}'; + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkUserCertificationInfo.java b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkUserCertificationInfo.java new file mode 100644 index 0000000..5fee77c --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkUserCertificationInfo.java @@ -0,0 +1,140 @@ +package com.ruoyi.segchk.domain; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +import java.util.Date; + +/** + * seg用户实名认证信息对象 segchk_user_certification_info + * + * @author yinzhiying + * @date 2021-08-23 + */ +public class SegchkUserCertificationInfo extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 身份证信息id,全表唯一 */ + @Excel(name = "身份证信息id,全表唯一") + private Long usercardId; + + /** 用户真实姓名 */ + @Excel(name = "用户真实姓名") + private String userName; + + /** 用户id,全局唯一 */ + @Excel(name = "用户id,全局唯一") + private Long userId; + + /** 运营商id,全局唯一 */ + @Excel(name = "运营商id,全局唯一") + private Long providerId; + + /** 身份证号 */ + @Excel(name = "身份证号") + private String idcard; + + /** 身份证正面照片路径 */ + @Excel(name = "身份证正面照片路径") + private String card1; + + /** 身份证反面照片路径 */ + @Excel(name = "身份证反面照片路径") + private String card2; + + /** 创建或修改时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "创建或修改时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date modTime; + + public void setUsercardId(Long usercardId) + { + this.usercardId = usercardId; + } + + public Long getUsercardId() + { + return usercardId; + } + public void setUserName(String userName) + { + this.userName = userName; + } + + public String getUserName() + { + return userName; + } + public void setUserId(Long userId) + { + this.userId = userId; + } + + public Long getUserId() + { + return userId; + } + public void setProviderId(Long providerId) + { + this.providerId = providerId; + } + + public Long getProviderId() + { + return providerId; + } + public void setIdcard(String idcard) + { + this.idcard = idcard; + } + + public String getIdcard() + { + return idcard; + } + public void setCard1(String card1) + { + this.card1 = card1; + } + + public String getCard1() + { + return card1; + } + public void setCard2(String card2) + { + this.card2 = card2; + } + + public String getCard2() + { + return card2; + } + public void setModTime(Date modTime) + { + this.modTime = modTime; + } + + public Date getModTime() + { + return modTime; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("usercardId", getUsercardId()) + .append("userName", getUserName()) + .append("userId", getUserId()) + .append("providerId", getProviderId()) + .append("idcard", getIdcard()) + .append("card1", getCard1()) + .append("card2", getCard2()) + .append("modTime", getModTime()) + .toString(); + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkUserCharge.java b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkUserCharge.java new file mode 100644 index 0000000..5c6144a --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkUserCharge.java @@ -0,0 +1,183 @@ +package com.ruoyi.segchk.domain; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * seg用户充值记录对象 segchk_user_charge + * + * @author yinzhiying + * @date 2021-08-23 + */ +public class SegchkUserCharge extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 用户id,全局唯一 */ + @Excel(name = "用户id,全局唯一") + private Long userId; + + /** 商家id,全局唯一 */ + @Excel(name = "商家id,全局唯一") + private Long storeId; + + /** 充值额 */ + @Excel(name = "充值额") + private BigDecimal charge; + + /** 使用的余额部分 */ + @Excel(name = "使用的余额部分") + private BigDecimal accountUsed; + + /** 会员卡号id,全局惟一 */ + @Excel(name = "会员卡号id,全局惟一") + private Long cardId; + + /** 会员卡类型,0--9块9,1---99 */ + @Excel(name = "会员卡类型,0--9块9,1---99") + private Long cardTypeId; + + /** 充值类型 */ + @Excel(name = "充值类型") + private String chargeType; + + /** 充值id,全表唯一 */ + @Excel(name = "充值id,全表唯一") + private Long chargeId; + + /** 运营商id,全局唯一 */ + @Excel(name = "运营商id,全局唯一") + private Long providerId; + + /** 创建或修改时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "创建或修改时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date modTime; + + /** 结果,0未完成,1成功,2失败 */ + @Excel(name = "结果,0未完成,1成功,2失败") + private Integer retFlag; + + public void setUserId(Long userId) + { + this.userId = userId; + } + + public Long getUserId() + { + return userId; + } + public void setStoreId(Long storeId) + { + this.storeId = storeId; + } + + public Long getStoreId() + { + return storeId; + } + public void setCharge(BigDecimal charge) + { + this.charge = charge; + } + + public BigDecimal getCharge() + { + return charge; + } + public void setAccountUsed(BigDecimal accountUsed) + { + this.accountUsed = accountUsed; + } + + public BigDecimal getAccountUsed() + { + return accountUsed; + } + public void setCardId(Long cardId) + { + this.cardId = cardId; + } + + public Long getCardId() + { + return cardId; + } + public void setCardTypeId(Long cardTypeId) + { + this.cardTypeId = cardTypeId; + } + + public Long getCardTypeId() + { + return cardTypeId; + } + public void setChargeType(String chargeType) + { + this.chargeType = chargeType; + } + + public String getChargeType() + { + return chargeType; + } + public void setChargeId(Long chargeId) + { + this.chargeId = chargeId; + } + + public Long getChargeId() + { + return chargeId; + } + public void setProviderId(Long providerId) + { + this.providerId = providerId; + } + + public Long getProviderId() + { + return providerId; + } + public void setModTime(Date modTime) + { + this.modTime = modTime; + } + + public Date getModTime() + { + return modTime; + } + public void setRetFlag(Integer retFlag) + { + this.retFlag = retFlag; + } + + public Integer getRetFlag() + { + return retFlag; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("userId", getUserId()) + .append("storeId", getStoreId()) + .append("charge", getCharge()) + .append("accountUsed", getAccountUsed()) + .append("cardId", getCardId()) + .append("cardTypeId", getCardTypeId()) + .append("chargeType", getChargeType()) + .append("chargeId", getChargeId()) + .append("providerId", getProviderId()) + .append("modTime", getModTime()) + .append("retFlag", getRetFlag()) + .toString(); + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkUserChargeCard.java b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkUserChargeCard.java new file mode 100644 index 0000000..b27b0eb --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkUserChargeCard.java @@ -0,0 +1,153 @@ +package com.ruoyi.segchk.domain; + +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +import java.math.BigDecimal; + +/** + * seg用户充值可选卡对象 SegchkUserChargeCard + * + * @author yinzhiying + * @date 2021-07-30 + */ +public class SegchkUserChargeCard extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 运营商id */ + @Excel(name = "运营商id") + private Long providerId; + + /** 卡类型id */ + @Excel(name = "卡类型id") + private Long cardTypeId; + + /** 会员卡id */ + @Excel(name = "会员卡id") + private Long cardId; + + /** 会员卡名称 */ + @Excel(name = "会员卡名称") + private String cardTypeName; + + /** 已购买次数 */ + @Excel(name = "已购买次数") + private Integer hadBuy; + + /** 可购买次数 */ + @Excel(name = "可购买次数") + private Integer buyCount; + + /** 会员卡面值 */ + @Excel(name = "会员卡面值") + private BigDecimal cardTypeValue; + + /** 是否可以购买,0可,1有卡正在使用,2购买次数超限 */ + @Excel(name = "是否可以购买") + private Integer canBuy; + + /** 会员卡权益次数 */ + @Excel(name = "会员卡权益次数") + private Integer cardTypeChkcount; + + /** 会员卡有效天数 */ + @Excel(name = "会员卡有效天数") + private Integer effectiveTime; + + public Long getProviderId() { + return providerId; + } + + public void setProviderId(Long providerId) { + this.providerId = providerId; + } + + public Long getCardTypeId() { + return cardTypeId; + } + + public void setCardTypeId(Long cardTypeId) { + this.cardTypeId = cardTypeId; + } + + public Long getCardId() { + return cardId; + } + + public void setCardId(Long cardId) { + this.cardId = cardId; + } + + public String getCardTypeName() { + return cardTypeName; + } + + public void setCardTypeName(String cardTypeName) { + this.cardTypeName = cardTypeName; + } + + public Integer getHadBuy() { + return hadBuy; + } + + public void setHadBuy(Integer hadBuy) { + this.hadBuy = hadBuy; + } + + public Integer getBuyCount() { + return buyCount; + } + + public void setBuyCount(Integer buyCount) { + this.buyCount = buyCount; + } + + public BigDecimal getCardTypeValue() { + return cardTypeValue; + } + + public void setCardTypeValue(BigDecimal cardTypeValue) { + this.cardTypeValue = cardTypeValue; + } + + public Integer getCanBuy() { + return canBuy; + } + + public void setCanBuy(Integer canBuy) { + this.canBuy = canBuy; + } + + public Integer getCardTypeChkcount() { + return cardTypeChkcount; + } + + public void setCardTypeChkcount(Integer cardTypeChkcount) { + this.cardTypeChkcount = cardTypeChkcount; + } + + public Integer getEffectiveTime() { + return effectiveTime; + } + + public void setEffectiveTime(Integer effectiveTime) { + this.effectiveTime = effectiveTime; + } + + @Override + public String toString() { + return "SegchkUserChargeCard{" + + "providerId=" + providerId + + ", cardTypeId=" + cardTypeId + + ", cardId=" + cardId + + ", cardTypeName='" + cardTypeName + '\'' + + ", hadBuy=" + hadBuy + + ", buyCount=" + buyCount + + ", cardTypeValue=" + cardTypeValue + + ", canBuy=" + canBuy + + ", cardTypeChkcount=" + cardTypeChkcount + + ", effectiveTime=" + effectiveTime + + '}'; + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkUserChargeWebResp.java b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkUserChargeWebResp.java new file mode 100644 index 0000000..201c238 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkUserChargeWebResp.java @@ -0,0 +1,78 @@ +package com.ruoyi.segchk.domain; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * seg用户奖励对象 segchk_user_reward + * + * @author yinzhiying + * @date 2021-07-01 + */ +public class SegchkUserChargeWebResp extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 用户id,全局唯一 */ + @Excel(name = "用户id,全局唯一") + private BigDecimal charge; + + /** 奖励类型 */ + @Excel(name = "奖励类型") + private String cardName; + + /** 奖励卡号 */ + @Excel(name = "奖励卡号") + private String retFlag; + + /** 创建或修改时间 */ + @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss") + @Excel(name = "创建或修改时间", width = 30, dateFormat = "yyyy-MM-dd hh:mm:ss") + private Date modTime; + + public BigDecimal getCharge() { + return charge; + } + + public void setCharge(BigDecimal charge) { + this.charge = charge; + } + + public String getCardName() { + return cardName; + } + + public void setCardName(String cardName) { + this.cardName = cardName; + } + + public String getRetFlag() { + return retFlag; + } + + public void setRetFlag(String retFlag) { + this.retFlag = retFlag; + } + + public Date getModTime() { + return modTime; + } + + public void setModTime(Date modTime) { + this.modTime = modTime; + } + + @Override + public String toString() { + return "SegchkUserChargeWebResp{" + + "charge=" + charge + + ", cardName='" + cardName + '\'' + + ", retFlag=" + retFlag + + ", modTime=" + modTime + + '}'; + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkUserCollect.java b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkUserCollect.java new file mode 100644 index 0000000..bbfc8e9 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkUserCollect.java @@ -0,0 +1,126 @@ +package com.ruoyi.segchk.domain; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +import java.util.Date; + +/** + * seg用户收藏记录对象 segchk_user_collect + * + * @author yinzhiying + * @date 2021-08-23 + */ +public class SegchkUserCollect extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 收藏id */ + @Excel(name = "收藏id") + private Long collectId; + + /** 收藏类型,0商家,1商品 */ + @Excel(name = "收藏类型,0商家,1商品") + private String collectType; + + /** 运营商id,全局唯一 */ + @Excel(name = "运营商id,全局唯一") + private Long providerId; + + /** 用户id,全局唯一 */ + @Excel(name = "用户id,全局唯一") + private Long userId; + + /** 商家id,全局唯一 */ + @Excel(name = "商家id,全局唯一") + private Long storeId; + + /** 创建或修改时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "创建或修改时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date modTime; + + /** 管理状态,0有效,1失效 */ + @Excel(name = "管理状态,0有效,1失效") + private Integer mgtState; + + public void setCollectId(Long collectId) + { + this.collectId = collectId; + } + + public Long getCollectId() + { + return collectId; + } + public void setCollectType(String collectType) + { + this.collectType = collectType; + } + + public String getCollectType() + { + return collectType; + } + public void setProviderId(Long providerId) + { + this.providerId = providerId; + } + + public Long getProviderId() + { + return providerId; + } + public void setUserId(Long userId) + { + this.userId = userId; + } + + public Long getUserId() + { + return userId; + } + public void setStoreId(Long storeId) + { + this.storeId = storeId; + } + + public Long getStoreId() + { + return storeId; + } + public void setModTime(Date modTime) + { + this.modTime = modTime; + } + + public Date getModTime() + { + return modTime; + } + public void setMgtState(Integer mgtState) + { + this.mgtState = mgtState; + } + + public Integer getMgtState() + { + return mgtState; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("collectId", getCollectId()) + .append("collectType", getCollectType()) + .append("providerId", getProviderId()) + .append("userId", getUserId()) + .append("storeId", getStoreId()) + .append("modTime", getModTime()) + .append("mgtState", getMgtState()) + .toString(); + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkUserCollectWebResp.java b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkUserCollectWebResp.java new file mode 100644 index 0000000..259ca96 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkUserCollectWebResp.java @@ -0,0 +1,185 @@ +package com.ruoyi.segchk.domain; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +import javax.validation.Valid; +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; + +/** + * seg会员卡对象 segchk_user_vip + * + * @author yinzhiying + * @date 2021-07-01 + */ +public class SegchkUserCollectWebResp extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 收藏id */ + @Excel(name = "收藏id") + private Long collectId; + + /** 运营商id,全局唯一 */ + @Excel(name = "运营商id,全局唯一") + private Long providerId; + + /** 商家id */ + @Excel(name = "商家id,全局惟一") + private Long storeId; + + /** 商家名称 */ + @Excel(name = "商家名称") + private String storeName; + + /** 商家图标 */ + @Excel(name = "会员卡类型,0--9块9,1---99") + private String storeIcon; + + /** 用户id,全局唯一 */ + @Excel(name = "用户id,全局唯一") + private Long serviceState; + + /** 用户id,全局唯一 */ + @Excel(name = "用户id,全局唯一") + private BigDecimal storeLon; + + /** 用户id,全局唯一 */ + @Excel(name = "用户id,全局唯一") + private BigDecimal storeLat; + + /** 用户id,全局唯一 */ + @Excel(name = "用户id,全局唯一") + private Long chkCount; + + /** 用户id,全局唯一 */ + @Excel(name = "用户id,全局唯一") + private BigDecimal starAvg; + + + /** 创建或修改时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "创建或修改时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date modTime; + + /** 商户标签列表 */ + @Valid + private List segchkRecommenderStoreLableWebList; + + public Long getCollectId() { + return collectId; + } + + public void setCollectId(Long collectId) { + this.collectId = collectId; + } + + public Long getProviderId() { + return providerId; + } + + public void setProviderId(Long providerId) { + this.providerId = providerId; + } + + public Long getStoreId() { + return storeId; + } + + public void setStoreId(Long storeId) { + this.storeId = storeId; + } + + public String getStoreName() { + return storeName; + } + + public void setStoreName(String storeName) { + this.storeName = storeName; + } + + public String getStoreIcon() { + return storeIcon; + } + + public void setStoreIcon(String storeIcon) { + this.storeIcon = storeIcon; + } + + public Long getServiceState() { + return serviceState; + } + + public void setServiceState(Long serviceState) { + this.serviceState = serviceState; + } + + public BigDecimal getStoreLon() { + return storeLon; + } + + public void setStoreLon(BigDecimal storeLon) { + this.storeLon = storeLon; + } + + public BigDecimal getStoreLat() { + return storeLat; + } + + public void setStoreLat(BigDecimal storeLat) { + this.storeLat = storeLat; + } + + public Long getChkCount() { + return chkCount; + } + + public void setChkCount(Long chkCount) { + this.chkCount = chkCount; + } + + public BigDecimal getStarAvg() { + return starAvg; + } + + public void setStarAvg(BigDecimal starAvg) { + this.starAvg = starAvg; + } + + public Date getModTime() { + return modTime; + } + + public void setModTime(Date modTime) { + this.modTime = modTime; + } + + public List getSegchkRecommenderStoreLableWebList() { + return segchkRecommenderStoreLableWebList; + } + + public void setSegchkRecommenderStoreLableWebList(List segchkRecommenderStoreLableWebList) { + this.segchkRecommenderStoreLableWebList = segchkRecommenderStoreLableWebList; + } + + @Override + public String toString() { + return "SegchkUserCollectWebResp{" + + "collectId=" + collectId + + ", providerId=" + providerId + + ", storeId=" + storeId + + ", storeName='" + storeName + '\'' + + ", storeIcon='" + storeIcon + '\'' + + ", serviceState=" + serviceState + + ", storeLon=" + storeLon + + ", storeLat=" + storeLat + + ", chkCount=" + chkCount + + ", starAvg=" + starAvg + + ", modTime=" + modTime + + ", segchkRecommenderStoreLableWebList=" + segchkRecommenderStoreLableWebList + + '}'; + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkUserExtInfo.java b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkUserExtInfo.java new file mode 100644 index 0000000..b0f9eda --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkUserExtInfo.java @@ -0,0 +1,98 @@ +package com.ruoyi.segchk.domain; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +import java.util.Date; + +/** + * seg用户扩展信息对象 segchk_user_ext_info + * + * @author yinzhiying + * @date 2021-08-23 + */ +public class SegchkUserExtInfo extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 用户id,全局唯一 */ + @Excel(name = "用户id,全局唯一") + private Long userId; + + /** 推荐人id(用户id或商家id或运营商id) */ + @Excel(name = "推荐人id", readConverterExp = "用=户id或商家id或运营商id") + private Long userRecommenders; + + /** 推荐人等级,0运营商,1商家,2vip会员,3普通会员 */ + @Excel(name = "推荐人等级,0运营商,1商家,2vip会员,3普通会员") + private String recommendersLevel; + + /** 运营商id,全局唯一 */ + @Excel(name = "运营商id,全局唯一") + private Long providerId; + + /** 创建或修改时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "创建或修改时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date modTime; + + public void setUserId(Long userId) + { + this.userId = userId; + } + + public Long getUserId() + { + return userId; + } + public void setUserRecommenders(Long userRecommenders) + { + this.userRecommenders = userRecommenders; + } + + public Long getUserRecommenders() + { + return userRecommenders; + } + public void setRecommendersLevel(String recommendersLevel) + { + this.recommendersLevel = recommendersLevel; + } + + public String getRecommendersLevel() + { + return recommendersLevel; + } + public void setProviderId(Long providerId) + { + this.providerId = providerId; + } + + public Long getProviderId() + { + return providerId; + } + public void setModTime(Date modTime) + { + this.modTime = modTime; + } + + public Date getModTime() + { + return modTime; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("userId", getUserId()) + .append("userRecommenders", getUserRecommenders()) + .append("recommendersLevel", getRecommendersLevel()) + .append("providerId", getProviderId()) + .append("modTime", getModTime()) + .toString(); + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkUserLevelInfo.java b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkUserLevelInfo.java new file mode 100644 index 0000000..29babdf --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkUserLevelInfo.java @@ -0,0 +1,73 @@ +package com.ruoyi.segchk.domain; + +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * seg用户角色信息对象 SegchkUserLevelInfo + * + * @author yinzhiying + * @date 2021-08-23 + */ +public class SegchkUserLevelInfo extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 用户id,全局唯一 */ + @Excel(name = "用户id,全局唯一") + private Long userId; + + /** 用户角色 */ + @Excel(name = "用户角色") + private Long userLevel; + + /** 运营商id,全局唯一 */ + @Excel(name = "运营商id,全局唯一") + private Long providerId; + + /** token */ + @Excel(name = "token") + private String token; + + public Long getUserId() { + return userId; + } + + public void setUserId(Long userId) { + this.userId = userId; + } + + public Long getUserLevel() { + return userLevel; + } + + public void setUserLevel(Long userLevel) { + this.userLevel = userLevel; + } + + public Long getProviderId() { + return providerId; + } + + public void setProviderId(Long providerId) { + this.providerId = providerId; + } + + public String getToken() { + return token; + } + + public void setToken(String token) { + this.token = token; + } + + @Override + public String toString() { + return "SegchkUserLevelInfo{" + + "userId=" + userId + + ", userLevel=" + userLevel + + ", providerId=" + providerId + + ", token='" + token + '\'' + + '}'; + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkUserLikeGoWebResp.java b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkUserLikeGoWebResp.java new file mode 100644 index 0000000..c2fde46 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkUserLikeGoWebResp.java @@ -0,0 +1,237 @@ +package com.ruoyi.segchk.domain; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +import javax.validation.Valid; +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; + +/** + * seg会员卡对象 segchk_user_vip + * + * @author yinzhiying + * @date 2021-07-01 + */ +public class SegchkUserLikeGoWebResp extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 想去id */ + @Excel(name = "想去id") + private Long likegoId; + + /** 运营商id,全局唯一 */ + @Excel(name = "运营商id,全局唯一") + private Long providerId; + + /** 商家id */ + @Excel(name = "商家id,全局惟一") + private Long storeId; + + /** 会员卡id */ + @Excel(name = "会员卡id,充值卡或自定义卡") + private Long cardId; + + /** 用户id */ + @Excel(name = "用户id,全局惟一") + private Long userId; + + /** 商家名称 */ + @Excel(name = "商家名称") + private String storeName; + + /** 卡名称 */ + @Excel(name = "卡名称") + private String cardName; + + /** 二维码 */ + @Excel(name = "二维码") + private String qrCode; + + /** 商家小图标 */ + @Excel(name = "商家小图标") + private String storeIcon; + + /** 商家服务状态,是否在线 */ + @Excel(name = "商家服务状态") + private Long serviceState; + + /** 商家经度 */ + @Excel(name = "商家经度") + private BigDecimal storeLon; + + /** 商家纬度 */ + @Excel(name = "商家纬度") + private BigDecimal storeLat; + + /** 商家累积核次数 */ + @Excel(name = "商家累积核次数") + private Long chkCount; + + /** 用户id,全局唯一 */ + @Excel(name = "用户id,全局唯一") + private BigDecimal starAvg; + + + /** 预约时间 */ + @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss") + @Excel(name = "预约时间", width = 30, dateFormat = "yyyy-MM-dd hh:mm:ss") + private Date modTime; + + /** 商户标签列表 */ + @Valid + private List segchkRecommenderStoreLableWebList; + + public Long getLikegoId() { + return likegoId; + } + + public void setLikegoId(Long likegoId) { + this.likegoId = likegoId; + } + + public Long getProviderId() { + return providerId; + } + + public void setProviderId(Long providerId) { + this.providerId = providerId; + } + + public Long getStoreId() { + return storeId; + } + + public void setStoreId(Long storeId) { + this.storeId = storeId; + } + + public Long getCardId() { + return cardId; + } + + public void setCardId(Long cardId) { + this.cardId = cardId; + } + + public Long getUserId() { + return userId; + } + + public void setUserId(Long userId) { + this.userId = userId; + } + + public String getStoreName() { + return storeName; + } + + public void setStoreName(String storeName) { + this.storeName = storeName; + } + + public String getCardName() { + return cardName; + } + + public void setCardName(String cardName) { + this.cardName = cardName; + } + + public String getQrCode() { + return qrCode; + } + + public void setQrCode(String qrCode) { + this.qrCode = qrCode; + } + + public String getStoreIcon() { + return storeIcon; + } + + public void setStoreIcon(String storeIcon) { + this.storeIcon = storeIcon; + } + + public Long getServiceState() { + return serviceState; + } + + public void setServiceState(Long serviceState) { + this.serviceState = serviceState; + } + + public BigDecimal getStoreLon() { + return storeLon; + } + + public void setStoreLon(BigDecimal storeLon) { + this.storeLon = storeLon; + } + + public BigDecimal getStoreLat() { + return storeLat; + } + + public void setStoreLat(BigDecimal storeLat) { + this.storeLat = storeLat; + } + + public Long getChkCount() { + return chkCount; + } + + public void setChkCount(Long chkCount) { + this.chkCount = chkCount; + } + + public BigDecimal getStarAvg() { + return starAvg; + } + + public void setStarAvg(BigDecimal starAvg) { + this.starAvg = starAvg; + } + + public Date getModTime() { + return modTime; + } + + public void setModTime(Date modTime) { + this.modTime = modTime; + } + + public List getSegchkRecommenderStoreLableWebList() { + return segchkRecommenderStoreLableWebList; + } + + public void setSegchkRecommenderStoreLableWebList(List segchkRecommenderStoreLableWebList) { + this.segchkRecommenderStoreLableWebList = segchkRecommenderStoreLableWebList; + } + + @Override + public String toString() { + return "SegchkUserLikeGoWebResp{" + + "likegoId=" + likegoId + + ", providerId=" + providerId + + ", storeId=" + storeId + + ", cardId=" + cardId + + ", userId=" + userId + + ", storeName='" + storeName + '\'' + + ", cardName='" + cardName + '\'' + + ", qrCode='" + qrCode + '\'' + + ", storeIcon='" + storeIcon + '\'' + + ", serviceState=" + serviceState + + ", storeLon=" + storeLon + + ", storeLat=" + storeLat + + ", chkCount=" + chkCount + + ", starAvg=" + starAvg + + ", modTime=" + modTime + + ", segchkRecommenderStoreLableWebList=" + segchkRecommenderStoreLableWebList + + '}'; + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkUserLikego.java b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkUserLikego.java new file mode 100644 index 0000000..d4f26d1 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkUserLikego.java @@ -0,0 +1,154 @@ +package com.ruoyi.segchk.domain; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +import java.util.Date; + +/** + * seg用户想去记录对象 segchk_user_likego + * + * @author yinzhiying + * @date 2021-08-23 + */ +public class SegchkUserLikego extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 想去id */ + @Excel(name = "想去id") + private Long likegoId; + + /** 运营商id,全局唯一 */ + @Excel(name = "运营商id,全局唯一") + private Long providerId; + + /** 用户id,全局唯一 */ + @Excel(name = "用户id,全局唯一") + private Long userId; + + /** 商家id,全局唯一 */ + @Excel(name = "商家id,全局唯一") + private Long storeId; + + /** 用户计划使用的卡号 */ + @Excel(name = "用户计划使用的卡号") + private Long cardId; + + /** 卡类型id,0充值卡,1商家赠卡,2优惠券卡 */ + @Excel(name = "卡类型id,0充值卡,1商家赠卡,2优惠券卡") + private Integer cardType; + + /** 预约二维码 */ + @Excel(name = "预约二维码") + private String qrCode; + + /** 创建或修改时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "创建或修改时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date modTime; + + /** 管理状态,0有效,1失效,2已使用 */ + @Excel(name = "管理状态,0有效,1失效,2已使用") + private Integer mgtState; + + public void setLikegoId(Long likegoId) + { + this.likegoId = likegoId; + } + + public Long getLikegoId() + { + return likegoId; + } + public void setProviderId(Long providerId) + { + this.providerId = providerId; + } + + public Long getProviderId() + { + return providerId; + } + public void setUserId(Long userId) + { + this.userId = userId; + } + + public Long getUserId() + { + return userId; + } + public void setStoreId(Long storeId) + { + this.storeId = storeId; + } + + public Long getStoreId() + { + return storeId; + } + public void setCardId(Long cardId) + { + this.cardId = cardId; + } + + public Long getCardId() + { + return cardId; + } + public void setCardType(Integer cardType) + { + this.cardType = cardType; + } + + public Integer getCardType() + { + return cardType; + } + public void setQrCode(String qrCode) + { + this.qrCode = qrCode; + } + + public String getQrCode() + { + return qrCode; + } + public void setModTime(Date modTime) + { + this.modTime = modTime; + } + + public Date getModTime() + { + return modTime; + } + public void setMgtState(Integer mgtState) + { + this.mgtState = mgtState; + } + + public Integer getMgtState() + { + return mgtState; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("likegoId", getLikegoId()) + .append("providerId", getProviderId()) + .append("userId", getUserId()) + .append("storeId", getStoreId()) + .append("cardId", getCardId()) + .append("cardType", getCardType()) + .append("qrCode", getQrCode()) + .append("modTime", getModTime()) + .append("mgtState", getMgtState()) + .toString(); + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkUserReward.java b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkUserReward.java new file mode 100644 index 0000000..987d3c1 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkUserReward.java @@ -0,0 +1,141 @@ +package com.ruoyi.segchk.domain; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * seg用户奖励对象 segchk_user_reward + * + * @author yinzhiying + * @date 2021-08-23 + */ +public class SegchkUserReward extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 用户id,全局唯一 */ + @Excel(name = "用户id,全局唯一") + private Long userId; + + /** 奖励额 */ + @Excel(name = "奖励额") + private BigDecimal reward; + + /** 奖励类型 */ + @Excel(name = "奖励类型") + private String rewardType; + + /** 奖励卡号 */ + @Excel(name = "奖励卡号") + private Long rewardCardId; + + /** 奖励卡类型id */ + @Excel(name = "奖励卡类型id") + private Long rewardCardTypeId; + + /** 创建或修改时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "创建或修改时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date modTime; + + /** 奖励id号,全表唯一 */ + @Excel(name = "奖励id号,全表唯一") + private Long rewardId; + + /** 运营商id,全局唯一 */ + @Excel(name = "运营商id,全局唯一") + private Long providerId; + + public void setUserId(Long userId) + { + this.userId = userId; + } + + public Long getUserId() + { + return userId; + } + public void setReward(BigDecimal reward) + { + this.reward = reward; + } + + public BigDecimal getReward() + { + return reward; + } + public void setRewardType(String rewardType) + { + this.rewardType = rewardType; + } + + public String getRewardType() + { + return rewardType; + } + public void setRewardCardId(Long rewardCardId) + { + this.rewardCardId = rewardCardId; + } + + public Long getRewardCardId() + { + return rewardCardId; + } + public void setRewardCardTypeId(Long rewardCardTypeId) + { + this.rewardCardTypeId = rewardCardTypeId; + } + + public Long getRewardCardTypeId() + { + return rewardCardTypeId; + } + public void setModTime(Date modTime) + { + this.modTime = modTime; + } + + public Date getModTime() + { + return modTime; + } + public void setRewardId(Long rewardId) + { + this.rewardId = rewardId; + } + + public Long getRewardId() + { + return rewardId; + } + public void setProviderId(Long providerId) + { + this.providerId = providerId; + } + + public Long getProviderId() + { + return providerId; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("userId", getUserId()) + .append("reward", getReward()) + .append("rewardType", getRewardType()) + .append("rewardCardId", getRewardCardId()) + .append("rewardCardTypeId", getRewardCardTypeId()) + .append("modTime", getModTime()) + .append("rewardId", getRewardId()) + .append("providerId", getProviderId()) + .toString(); + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkUserRewardCtl.java b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkUserRewardCtl.java new file mode 100644 index 0000000..935e2f1 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkUserRewardCtl.java @@ -0,0 +1,113 @@ +package com.ruoyi.segchk.domain; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * seg会员推荐控制对象 segchk_user_reward_ctl + * + * @author yinzhiying + * @date 2021-08-23 + */ +public class SegchkUserRewardCtl extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 控制id */ + @Excel(name = "控制id") + private Integer rewardCtlId; + + /** 运营商id */ + @Excel(name = "运营商id") + private Long providerId; + + /** 卡类型id,-1,普通用户,其他会员卡类型id */ + @Excel(name = "卡类型id,-1,普通用户,其他会员卡类型id") + private Long fromId; + + /** 奖励额 */ + @Excel(name = "奖励额") + private BigDecimal reward; + + /** 卡类型id */ + @Excel(name = "卡类型id") + private Long toId; + + /** 修改时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "修改时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date modTime; + + public void setRewardCtlId(Integer rewardCtlId) + { + this.rewardCtlId = rewardCtlId; + } + + public Integer getRewardCtlId() + { + return rewardCtlId; + } + public void setProviderId(Long providerId) + { + this.providerId = providerId; + } + + public Long getProviderId() + { + return providerId; + } + public void setFromId(Long fromId) + { + this.fromId = fromId; + } + + public Long getFromId() + { + return fromId; + } + public void setReward(BigDecimal reward) + { + this.reward = reward; + } + + public BigDecimal getReward() + { + return reward; + } + public void setToId(Long toId) + { + this.toId = toId; + } + + public Long getToId() + { + return toId; + } + public void setModTime(Date modTime) + { + this.modTime = modTime; + } + + public Date getModTime() + { + return modTime; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("rewardCtlId", getRewardCtlId()) + .append("providerId", getProviderId()) + .append("fromId", getFromId()) + .append("reward", getReward()) + .append("toId", getToId()) + .append("modTime", getModTime()) + .toString(); + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkUserSecurity.java b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkUserSecurity.java new file mode 100644 index 0000000..e25956b --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkUserSecurity.java @@ -0,0 +1,98 @@ +package com.ruoyi.segchk.domain; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +import java.util.Date; + +/** + * seg用户密码对象 segchk_user_security + * + * @author yinzhiying + * @date 2021-08-23 + */ +public class SegchkUserSecurity extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 用户id,全局唯一 */ + @Excel(name = "用户id,全局唯一") + private Long userId; + + /** 密码 */ + @Excel(name = "密码") + private String passwd; + + /** 创建或修改时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "创建或修改时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date modTime; + + /** 密码id,全表唯一 */ + @Excel(name = "密码id,全表唯一") + private Long pwdId; + + /** 运营商id,全局唯一 */ + @Excel(name = "运营商id,全局唯一") + private Long providerId; + + public void setUserId(Long userId) + { + this.userId = userId; + } + + public Long getUserId() + { + return userId; + } + public void setPasswd(String passwd) + { + this.passwd = passwd; + } + + public String getPasswd() + { + return passwd; + } + public void setModTime(Date modTime) + { + this.modTime = modTime; + } + + public Date getModTime() + { + return modTime; + } + public void setPwdId(Long pwdId) + { + this.pwdId = pwdId; + } + + public Long getPwdId() + { + return pwdId; + } + public void setProviderId(Long providerId) + { + this.providerId = providerId; + } + + public Long getProviderId() + { + return providerId; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("userId", getUserId()) + .append("passwd", getPasswd()) + .append("modTime", getModTime()) + .append("pwdId", getPwdId()) + .append("providerId", getProviderId()) + .toString(); + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkUserSetInfoReq.java b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkUserSetInfoReq.java new file mode 100644 index 0000000..60658e6 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkUserSetInfoReq.java @@ -0,0 +1,104 @@ +package com.ruoyi.segchk.domain; + +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * seg用户修改信息对象 SegchkUserSetInfoReq + * + * @author yinzhiying + * @date 2021-07-01 + */ +public class SegchkUserSetInfoReq extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 用户id,全局唯一 */ + @Excel(name = "用户id,全局唯一") + private Long userId; + + /** 密码 */ + @Excel(name = "密码") + private String passwd; + + /** 密码id,全表唯一 */ + @Excel(name = "密码id,全表唯一") + private Long pwdId; + + /** 运营商id,全局唯一 */ + @Excel(name = "运营商id,全局唯一") + private Long providerId; + + /** 用户手机号 */ + @Excel(name = "用户手机号") + private String phoneNo; + + /** 用户等级 */ + @Excel(name = "用户等级") + private Integer userLevel; + + public void setUserId(Long userId) + { + this.userId = userId; + } + + public Long getUserId() + { + return userId; + } + public void setPasswd(String passwd) + { + this.passwd = passwd; + } + + public void setPwdId(Long pwdId) + { + this.pwdId = pwdId; + } + + public Long getPwdId() + { + return pwdId; + } + public void setProviderId(Long providerId) + { + this.providerId = providerId; + } + + public Long getProviderId() + { + return providerId; + } + + public String getPasswd() { + return passwd; + } + + public String getPhoneNo() { + return phoneNo; + } + + public void setPhoneNo(String phoneNo) { + this.phoneNo = phoneNo; + } + + public Integer getUserLevel() { + return userLevel; + } + + public void setUserLevel(Integer userLevel) { + this.userLevel = userLevel; + } + + @Override + public String toString() { + return "SegchkUserSetInfoReq{" + + "userId=" + userId + + ", passwd='" + passwd + '\'' + + ", pwdId=" + pwdId + + ", providerId=" + providerId + + ", phoneNo='" + phoneNo + '\'' + + ", userLevel=" + userLevel + + '}'; + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkUserVip.java b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkUserVip.java new file mode 100644 index 0000000..3e90788 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkUserVip.java @@ -0,0 +1,155 @@ +package com.ruoyi.segchk.domain; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +import java.util.Date; + +/** + * seg会员卡对象 segchk_user_vip + * + * @author yinzhiying + * @date 2021-08-23 + */ +public class SegchkUserVip extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 会员卡号id,全局惟一 */ + @Excel(name = "会员卡号id,全局惟一") + private Long cardId; + + /** 会员卡类型,0--9块9,1---99 */ + @Excel(name = "会员卡类型,0--9块9,1---99") + private Long cardTypeId; + + /** 用户id,全局唯一 */ + @Excel(name = "用户id,全局唯一") + private Long userId; + + /** 运营商id,全局唯一 */ + @Excel(name = "运营商id,全局唯一") + private Long providerId; + + /** 创建或修改时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "创建或修改时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date modTime; + + /** 有效期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "有效期", width = 30, dateFormat = "yyyy-MM-dd") + private Date effectiveTime; + + /** 使用次数 */ + @Excel(name = "使用次数") + private Integer useCount; + + /** 剩余次数 */ + @Excel(name = "剩余次数") + private Integer leftCount; + + /** 状态,0正常,1过期 */ + @Excel(name = "状态,0正常,1过期") + private String status; + + public void setCardId(Long cardId) + { + this.cardId = cardId; + } + + public Long getCardId() + { + return cardId; + } + public void setCardTypeId(Long cardTypeId) + { + this.cardTypeId = cardTypeId; + } + + public Long getCardTypeId() + { + return cardTypeId; + } + public void setUserId(Long userId) + { + this.userId = userId; + } + + public Long getUserId() + { + return userId; + } + public void setProviderId(Long providerId) + { + this.providerId = providerId; + } + + public Long getProviderId() + { + return providerId; + } + public void setModTime(Date modTime) + { + this.modTime = modTime; + } + + public Date getModTime() + { + return modTime; + } + public void setEffectiveTime(Date effectiveTime) + { + this.effectiveTime = effectiveTime; + } + + public Date getEffectiveTime() + { + return effectiveTime; + } + public void setUseCount(Integer useCount) + { + this.useCount = useCount; + } + + public Integer getUseCount() + { + return useCount; + } + public void setLeftCount(Integer leftCount) + { + this.leftCount = leftCount; + } + + public Integer getLeftCount() + { + return leftCount; + } + public void setStatus(String status) + { + this.status = status; + } + + public String getStatus() + { + return status; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("cardId", getCardId()) + .append("cardTypeId", getCardTypeId()) + .append("userId", getUserId()) + .append("providerId", getProviderId()) + .append("modTime", getModTime()) + .append("effectiveTime", getEffectiveTime()) + .append("useCount", getUseCount()) + .append("leftCount", getLeftCount()) + .append("status", getStatus()) + .toString(); + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkUserWebCardResp.java b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkUserWebCardResp.java new file mode 100644 index 0000000..992f582 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkUserWebCardResp.java @@ -0,0 +1,118 @@ +package com.ruoyi.segchk.domain; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +import java.util.Date; + +/** + * seg用户基本信息对象 segchk_user_basic_info + * + * @author yinzhiying + * @date 2021-07-01 + */ +public class SegchkUserWebCardResp extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + + /** 卡名称 */ + @Excel(name = "卡名称") + private String cardName; + + /** 卡提供商(商家名称) */ + @Excel(name = "卡提供商") + private String storeName; + + + /** 使用次数 */ + @Excel(name = "使用次数") + private Integer useCount; + + /** 剩余次数 */ + @Excel(name = "剩余次数") + private Integer leftCount; + + /** 有效期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "有效期", width = 30, dateFormat = "yyyy-MM-dd") + private Date effectiveTime; + + /** 卡券标识,0会员卡,1券(或赠卡) */ + @Excel(name = "卡券标识") + private Integer typeFlag; + + /** 卡券状态 */ + @Excel(name = "卡券状态") + private String cardStatus; + + public String getCardName() { + return cardName; + } + + public void setCardName(String cardName) { + this.cardName = cardName; + } + + public String getStoreName() { + return storeName; + } + + public void setStoreName(String storeName) { + this.storeName = storeName; + } + + public Integer getUseCount() { + return useCount; + } + + public void setUseCount(Integer useCount) { + this.useCount = useCount; + } + + public Integer getLeftCount() { + return leftCount; + } + + public void setLeftCount(Integer leftCount) { + this.leftCount = leftCount; + } + + public Date getEffectiveTime() { + return effectiveTime; + } + + public void setEffectiveTime(Date effectiveTime) { + this.effectiveTime = effectiveTime; + } + + public Integer getTypeFlag() { + return typeFlag; + } + + public void setTypeFlag(Integer typeFlag) { + this.typeFlag = typeFlag; + } + + public String getCardStatus() { + return cardStatus; + } + + public void setCardStatus(String cardStatus) { + this.cardStatus = cardStatus; + } + + @Override + public String toString() { + return "SegchkUserWebCardResp{" + + "cardName='" + cardName + '\'' + + ", storeName='" + storeName + '\'' + + ", useCount=" + useCount + + ", leftCount=" + leftCount + + ", effectiveTime=" + effectiveTime + + ", typeFlag=" + typeFlag + + ", cardStatus=" + cardStatus + + '}'; + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkUserWebReq.java b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkUserWebReq.java new file mode 100644 index 0000000..2faa725 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkUserWebReq.java @@ -0,0 +1,99 @@ +package com.ruoyi.segchk.domain; + +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * seg用户基本信息对象 segchk_user_basic_info + * + * @author yinzhiying + * @date 2021-07-01 + */ +public class SegchkUserWebReq extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 用户id,全局唯一 */ + @Excel(name = "用户id,全局唯一") + private Long userId; + + /** 用户手机号 */ + @Excel(name = "用户手机号") + private String phoneNo; + + /** 微信唯一识别号 */ + @Excel(name = "微信唯一识别号") + private String openid; + + /** 运营商id,全局唯一 */ + @Excel(name = "运营商id,全局唯一") + private Long providerId; + + /** 用户身份,0运营商,1商家,2用户 */ + @Excel(name = "用户身份") + private Integer userLevel; + + /** 身份证号码 */ + @Excel(name = "身份证号码") + private String cardID; + + public Long getUserId() { + return userId; + } + + public void setUserId(Long userId) { + this.userId = userId; + } + + public String getPhoneNo() { + return phoneNo; + } + + public void setPhoneNo(String phoneNo) { + this.phoneNo = phoneNo; + } + + public String getOpenid() { + return openid; + } + + public void setOpenid(String openid) { + this.openid = openid; + } + + public Long getProviderId() { + return providerId; + } + + public void setProviderId(Long providerId) { + this.providerId = providerId; + } + + public String getCardID() { + return cardID; + } + + public void setCardID(String cardID) { + this.cardID = cardID; + } + + public Integer getUserLevel() { + return userLevel; + } + + public void setUserLevel(Integer userLevel) { + this.userLevel = userLevel; + } + + @Override + public String toString() { + return "SegchkUserWebReq{" + + "userId=" + userId + + ", phoneNo='" + phoneNo + '\'' + + ", openid='" + openid + '\'' + + ", providerId=" + providerId + + ", userLevel=" + userLevel + + ", cardID='" + cardID + '\'' + + '}'; + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkUserWebResp.java b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkUserWebResp.java new file mode 100644 index 0000000..3cc751d --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkUserWebResp.java @@ -0,0 +1,242 @@ +package com.ruoyi.segchk.domain; + +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +import java.math.BigDecimal; + +/** + * seg用户基本信息对象 segchk_user_basic_info + * + * @author yinzhiying + * @date 2021-07-01 + */ +public class SegchkUserWebResp extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + + /** 运营商id,全局唯一 */ + @Excel(name = "运营商id,全局唯一") + private Long providerId; + + + /** 用户id,全局唯一 */ + @Excel(name = "用户id,全局唯一") + private Long userId; + + /** 用户手机号 */ + @Excel(name = "用户手机号") + private String phoneNo; + + /** 用户名称 */ + @Excel(name = "用户名称") + private String userName; + + /** 微信唯一识别号 */ + @Excel(name = "微信唯一识别号") + private String openid; + + /** 用户头像 */ + @Excel(name = "用户头像") + private String userIcon; + + /** 是否实名认证 */ + @Excel(name = "是否实名认证") + private Integer iscertified; + + /** 账号余额 */ + @Excel(name = "账号余额") + private BigDecimal account; + + /** 核消次数 */ + @Excel(name = "核消次数") + private Long chkCount; + + /** 充值次数 */ + @Excel(name = "充值次数") + private Long chargeCount; + + /** 提现次数 */ + @Excel(name = "提现次数") + private Long cashCount; + + /** 未读消息数量 */ + @Excel(name = "未读消息数量") + private Long msgCount; + + /** 可用卡数量 */ + @Excel(name = "可用卡数量") + private Long cardCount; + + /** 优惠券数量 */ + @Excel(name = "优惠券数量") + private Long storeCardCount; + + /** 商家数量 */ + @Excel(name = "商家数量") + private Long storeCount; + + /** 有效预约单数量 */ + @Excel(name = "预约单数量") + private Long likegoCount; + + + public Long getUserId() { + return userId; + } + + public void setUserId(Long userId) { + this.userId = userId; + } + + public String getPhoneNo() { + return phoneNo; + } + + public void setPhoneNo(String phoneNo) { + this.phoneNo = phoneNo; + } + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public String getOpenid() { + return openid; + } + + public void setOpenid(String openid) { + this.openid = openid; + } + + public String getUserIcon() { + return userIcon; + } + + public void setUserIcon(String userIcon) { + this.userIcon = userIcon; + } + + public Integer getIscertified() { + return iscertified; + } + + public void setIscertified(Integer iscertified) { + this.iscertified = iscertified; + } + + public BigDecimal getAccount() { + return account; + } + + public void setAccount(BigDecimal account) { + this.account = account; + } + + public Long getChkCount() { + return chkCount; + } + + public void setChkCount(Long chkCount) { + this.chkCount = chkCount; + } + + public Long getChargeCount() { + return chargeCount; + } + + public void setChargeCount(Long chargeCount) { + this.chargeCount = chargeCount; + } + + public Long getCashCount() { + return cashCount; + } + + public void setCashCount(Long cashCount) { + this.cashCount = cashCount; + } + + public Long getMsgCount() { + return msgCount; + } + + public void setMsgCount(Long msgCount) { + this.msgCount = msgCount; + } + + public Long getCardCount() { + return cardCount; + } + + public void setCardCount(Long cardCount) { + this.cardCount = cardCount; + } + + public Long getStorecardCount() { + return storeCardCount; + } + + public void setStorecardCount(Long storecardCount) { + this.storeCardCount = storecardCount; + } + + public Long getProviderId() { + return providerId; + } + + public void setProviderId(Long providerId) { + this.providerId = providerId; + } + + @Override + public String toString() { + return "SegchkUserWebResp{" + + "providerId=" + providerId + + ", userId=" + userId + + ", phoneNo='" + phoneNo + '\'' + + ", userName='" + userName + '\'' + + ", openid='" + openid + '\'' + + ", userIcon='" + userIcon + '\'' + + ", iscertified=" + iscertified + + ", account=" + account + + ", chkCount=" + chkCount + + ", chargeCount=" + chargeCount + + ", cashCount=" + cashCount + + ", msgCount=" + msgCount + + ", cardCount=" + cardCount + + ", storecardCount=" + storeCardCount + + ", storeCount=" + storeCount + + ", likegoCount=" + likegoCount + + '}'; + } + + public Long getStoreCardCount() { + return storeCardCount; + } + + public void setStoreCardCount(Long storeCardCount) { + this.storeCardCount = storeCardCount; + } + + public Long getStoreCount() { + return storeCount; + } + + public void setStoreCount(Long storeCount) { + this.storeCount = storeCount; + } + + public Long getLikegoCount() { + return likegoCount; + } + + public void setLikegoCount(Long likegoCount) { + this.likegoCount = likegoCount; + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkUserWebSCResp.java b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkUserWebSCResp.java new file mode 100644 index 0000000..e62bcea --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkUserWebSCResp.java @@ -0,0 +1,170 @@ +package com.ruoyi.segchk.domain; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +import java.util.Date; + +/** + * seg用户核消列表对象 SegchkUserWebSCResp + * + * @author yinzhiying + * @date 2021-07-01 + */ +public class SegchkUserWebSCResp extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + + /** 运营商id,全局唯一 */ + @Excel(name = "运营商id,全局唯一") + private Long providerId; + + + /** 卡号id */ + @Excel(name = "卡号id") + private Long cardId; + + /** 商家id */ + @Excel(name = "商家id") + private Long storeId; + + /** 卡类型id */ + @Excel(name = "卡类型id") + private Long cardTypeId; + + /** 用户id */ + @Excel(name = "用户id") + private Long userId; + + /** 创建或修改时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "创建或修改时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date modTime; + + /** 核消id */ + @Excel(name = "核消id") + private Long chkServiceId; + + /** 评论id */ + @Excel(name = "评论id") + private Long commentId; + + /** 卡类型名称 */ + @Excel(name = "卡类型名称") + private String cardTypeName; + + /** 商家名称 */ + @Excel(name = "商家名称") + private String storeName; + + /** 卡来源,0充值卡,1优惠券,2商家自定义卡 */ + @Excel(name = "卡来源") + private Integer chkSource; + + public Long getProviderId() { + return providerId; + } + + public void setProviderId(Long providerId) { + this.providerId = providerId; + } + + public Long getCardId() { + return cardId; + } + + public void setCardId(Long cardId) { + this.cardId = cardId; + } + + public Long getStoreId() { + return storeId; + } + + public void setStoreId(Long storeId) { + this.storeId = storeId; + } + + public Long getCardTypeId() { + return cardTypeId; + } + + public void setCardTypeId(Long cardTypeId) { + this.cardTypeId = cardTypeId; + } + + public Long getUserId() { + return userId; + } + + public void setUserId(Long userId) { + this.userId = userId; + } + + public Date getModTime() { + return modTime; + } + + public void setModTime(Date modTime) { + this.modTime = modTime; + } + + public Long getChkServiceId() { + return chkServiceId; + } + + public void setChkServiceId(Long chkServiceId) { + this.chkServiceId = chkServiceId; + } + + public Long getCommentId() { + return commentId; + } + + public void setCommentId(Long commentId) { + this.commentId = commentId; + } + + public String getCardTypeName() { + return cardTypeName; + } + + public void setCardTypeName(String cardTypeName) { + this.cardTypeName = cardTypeName; + } + + public String getStoreName() { + return storeName; + } + + public void setStoreName(String storeName) { + this.storeName = storeName; + } + + public Integer getChkSource() { + return chkSource; + } + + public void setChkSource(Integer chkSource) { + this.chkSource = chkSource; + } + + @Override + public String toString() { + return "SegchkUserWebSCResp{" + + "providerId=" + providerId + + ", cardId=" + cardId + + ", storeId=" + storeId + + ", cardTypeId=" + cardTypeId + + ", userId=" + userId + + ", modTime=" + modTime + + ", chkServiceId=" + chkServiceId + + ", commentId=" + commentId + + ", cardTypeName='" + cardTypeName + '\'' + + ", storeName='" + storeName + '\'' + + ", chkSource=" + chkSource + + '}'; + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkUserWechat.java b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkUserWechat.java new file mode 100644 index 0000000..6dcbf5f --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkUserWechat.java @@ -0,0 +1,123 @@ +package com.ruoyi.segchk.domain; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +import java.util.Date; + +/** + * seg用户微信信息对象 segchk_user_wechat + * + * @author yinzhiying + * @date 2021-08-23 + */ +public class SegchkUserWechat extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 运营商id,全局唯一 */ + @Excel(name = "运营商id,全局唯一") + private Long providerId; + + /** 用户id,全局唯一 */ + @Excel(name = "用户id,全局唯一") + private Long userId; + + /** 微信唯一识别号,用于转账等 */ + @Excel(name = "微信唯一识别号,用于转账等") + private String openid; + + /** 微信的联合登录id */ + @Excel(name = "微信的联合登录id") + private String unionId; + + /** 微信昵称 */ + @Excel(name = "微信昵称") + private String nickName; + + /** 微信头像 */ + @Excel(name = "微信头像") + private String iconUrl; + + /** 创建或修改时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "创建或修改时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date modTime; + + public void setProviderId(Long providerId) + { + this.providerId = providerId; + } + + public Long getProviderId() + { + return providerId; + } + public void setUserId(Long userId) + { + this.userId = userId; + } + + public Long getUserId() + { + return userId; + } + public void setOpenid(String openid) + { + this.openid = openid; + } + + public String getOpenid() + { + return openid; + } + public void setNickName(String nickName) + { + this.nickName = nickName; + } + + public String getNickName() + { + return nickName; + } + public void setIconUrl(String iconUrl) + { + this.iconUrl = iconUrl; + } + + public String getIconUrl() + { + return iconUrl; + } + public void setModTime(Date modTime) + { + this.modTime = modTime; + } + + public Date getModTime() + { + return modTime; + } + + public String getUnionId() { + return unionId; + } + + public void setUnionId(String unionId) { + this.unionId = unionId; + } + + @Override + public String toString() { + return "SegchkUserWechat{" + + "providerId=" + providerId + + ", userId=" + userId + + ", openid='" + openid + '\'' + + ", unionId='" + unionId + '\'' + + ", nickName='" + nickName + '\'' + + ", iconUrl='" + iconUrl + '\'' + + ", modTime=" + modTime + + '}'; + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkVipSetInfo.java b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkVipSetInfo.java new file mode 100644 index 0000000..df76090 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/SegchkVipSetInfo.java @@ -0,0 +1,141 @@ +package com.ruoyi.segchk.domain; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * seg会员卡设置对象 segchk_vip_set_info + * + * @author yinzhiying + * @date 2021-08-23 + */ +public class SegchkVipSetInfo extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 运营商id,全局唯一 */ + @Excel(name = "运营商id,全局唯一") + private Long providerId; + + /** 创建或修改时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "创建或修改时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date modTime; + + /** 提现额门限 */ + @Excel(name = "提现额门限") + private BigDecimal cashThrehold; + + /** 提现到账日期,0当天到账,n--N个工作日后到账 */ + @Excel(name = "提现到账日期,0当天到账,n--N个工作日后到账") + private Integer cashDay; + + /** 是否允许自助续费,0允许,1禁止 */ + @Excel(name = "是否允许自助续费,0允许,1禁止") + private String selfCharge; + + /** 有效期提醒时间,天 */ + @Excel(name = "有效期提醒时间,天") + private Integer effectiveRemind; + + /** 模板id,全表唯一 */ + @Excel(name = "模板id,全表唯一") + private Integer modeId; + + /** 激活标识,0激活,1去激活,根据每个运营商一个模板id为激活状态 */ + @Excel(name = "激活标识,0激活,1去激活,根据每个运营商一个模板id为激活状态") + private String activeFlag; + + public void setProviderId(Long providerId) + { + this.providerId = providerId; + } + + public Long getProviderId() + { + return providerId; + } + public void setModTime(Date modTime) + { + this.modTime = modTime; + } + + public Date getModTime() + { + return modTime; + } + public void setCashThrehold(BigDecimal cashThrehold) + { + this.cashThrehold = cashThrehold; + } + + public BigDecimal getCashThrehold() + { + return cashThrehold; + } + public void setCashDay(Integer cashDay) + { + this.cashDay = cashDay; + } + + public Integer getCashDay() + { + return cashDay; + } + public void setSelfCharge(String selfCharge) + { + this.selfCharge = selfCharge; + } + + public String getSelfCharge() + { + return selfCharge; + } + public void setEffectiveRemind(Integer effectiveRemind) + { + this.effectiveRemind = effectiveRemind; + } + + public Integer getEffectiveRemind() + { + return effectiveRemind; + } + public void setModeId(Integer modeId) + { + this.modeId = modeId; + } + + public Integer getModeId() + { + return modeId; + } + public void setActiveFlag(String activeFlag) + { + this.activeFlag = activeFlag; + } + + public String getActiveFlag() + { + return activeFlag; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("providerId", getProviderId()) + .append("modTime", getModTime()) + .append("cashThrehold", getCashThrehold()) + .append("cashDay", getCashDay()) + .append("selfCharge", getSelfCharge()) + .append("effectiveRemind", getEffectiveRemind()) + .append("modeId", getModeId()) + .append("activeFlag", getActiveFlag()) + .toString(); + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/WeChatCustomerLink.java b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/WeChatCustomerLink.java new file mode 100644 index 0000000..47d5d29 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/domain/WeChatCustomerLink.java @@ -0,0 +1,116 @@ +package com.ruoyi.segchk.domain; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.ruoyi.util.CommonConstant; +import org.springframework.util.StringUtils; + +import java.io.Serializable; + +/** + * 微信用户关联实体类 + */ +public class WeChatCustomerLink implements Serializable { + /** + * 主键 + */ + private long id = -1; + /** + * 联合登录id + */ + private String unionId; + /** + * 微信用户唯一标识 + */ + private String openId; + /** + * 小程序openId + */ + private String appletOpenId; + /** + * providerId + */ + private String providerId; + /** + * 用户id + */ + private Long userId = CommonConstant.NO_CUSTOMER_ID; + + public WeChatCustomerLink() { + } + + public WeChatCustomerLink(String openId, String unionId) { + this.openId = openId; + this.unionId = unionId; + } + + /** + * 是否绑定 绑定返回true + */ + @JsonIgnore + public boolean isBind() { + return this.userId != CommonConstant.NO_CUSTOMER_ID; + } + + /** + * 判断是否有openId + * + * @return 有返回true, 否则返回false + */ + public boolean hasOpenId() { + return !StringUtils.isEmpty(openId); + } + + /** + * 判断是否有小程序openId + * + * @return 有返回true, 否则返回false + */ + public boolean hasAppletOpenId() { + return !StringUtils.isEmpty(appletOpenId); + } + + public String getUnionId() { + return unionId; + } + + public void setUnionId(String unionId) { + this.unionId = unionId; + } + + public String getOpenId() { + return openId; + } + + public void setOpenId(String openId) { + this.openId = openId; + } + + public String getAppletOpenId() { + return appletOpenId; + } + + public void setAppletOpenId(String appletOpenId) { + this.appletOpenId = appletOpenId; + } + + public long getUserId() { + return userId; + } + + public void setUserId(long userId) { + this.userId = userId; + } + + public String getProviderId() { + return providerId; + } + + public void setProviderId(String providerId) { + this.providerId = providerId; + } + + public void setUserId(Long userId) { + this.userId = userId; + } +} + diff --git a/ruoyi-system/src/main/java/com/ruoyi/segchk/mapper/SegchkProviderIndexMapper.java b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/mapper/SegchkProviderIndexMapper.java similarity index 90% rename from ruoyi-system/src/main/java/com/ruoyi/segchk/mapper/SegchkProviderIndexMapper.java rename to ruoyi-segchk/src/main/java/com/ruoyi/segchk/mapper/SegchkProviderIndexMapper.java index 103689c..d2007da 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/segchk/mapper/SegchkProviderIndexMapper.java +++ b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/mapper/SegchkProviderIndexMapper.java @@ -53,4 +53,12 @@ public interface SegchkProviderIndexMapper * @return seg首页轮播图管理 */ public List selectSegchkStoreSaleDetails(SegchkServiceAndSaleWebReq segchkServiceAndSaleWebReq); + + /** + * 返回运营商openid + * + * @param providerId 运营商id + * @return 结果 + */ + public String selectProviderOpenIdById(Long providerId); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/segchk/mapper/SegchkStoreIndexMapper.java b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/mapper/SegchkStoreIndexMapper.java similarity index 94% rename from ruoyi-system/src/main/java/com/ruoyi/segchk/mapper/SegchkStoreIndexMapper.java rename to ruoyi-segchk/src/main/java/com/ruoyi/segchk/mapper/SegchkStoreIndexMapper.java index 3dd27c8..b67d5bf 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/segchk/mapper/SegchkStoreIndexMapper.java +++ b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/mapper/SegchkStoreIndexMapper.java @@ -1,6 +1,7 @@ package com.ruoyi.segchk.mapper; import com.ruoyi.segchk.domain.*; +import com.ruoyi.segchk.domain.WeChatCustomerLink; import java.util.List; @@ -106,4 +107,13 @@ public interface SegchkStoreIndexMapper { * @return 结果 */ public List selectSegchkRecommenderStoreListWeb(SegchkRecommenderStoreWebReq segchkRecommenderStoreWebReq); + + + /** + * 返回商户openid + * + * @param storeId 商户id + * @return 结果 + */ + public WeChatCustomerLink selectStoreOpenIdById(Long storeId); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/segchk/mapper/SegchkUserIndexMapper.java b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/mapper/SegchkUserIndexMapper.java similarity index 84% rename from ruoyi-system/src/main/java/com/ruoyi/segchk/mapper/SegchkUserIndexMapper.java rename to ruoyi-segchk/src/main/java/com/ruoyi/segchk/mapper/SegchkUserIndexMapper.java index 0260852..a8d8e1c 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/segchk/mapper/SegchkUserIndexMapper.java +++ b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/mapper/SegchkUserIndexMapper.java @@ -1,8 +1,10 @@ package com.ruoyi.segchk.mapper; import com.ruoyi.segchk.domain.*; +import com.ruoyi.segchk.domain.WeChatCustomerLink; import java.util.List; +import java.util.Map; public interface SegchkUserIndexMapper { /** @@ -104,4 +106,19 @@ public interface SegchkUserIndexMapper { * @return seg用户扩展信息 */ public List selectSegchkUserChargePre(SegchkUserWebReq segchkUserWebReq); + + public SegchkUserLevelInfo selectUserLevelByMobile(String phoneno); + + public int userIsExit(Map parmMap); + + public int providerIsExit(Map parmMap); + public int storeIsExit(Map parmMap); + + int updateSegchkProviderWechat(SegchkUserWechat segchkUserWechat); + + int updateSegchkStoreWechat(SegchkUserWechat segchkUserWechat); + + int updateSegchkUserWechat(SegchkUserWechat segchkUserWechat); + + WeChatCustomerLink getUserWechatOpenId(Long userId); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/segchk/service/ISegchkProviderIndexService.java b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/service/ISegchkProviderIndexService.java similarity index 86% rename from ruoyi-system/src/main/java/com/ruoyi/segchk/service/ISegchkProviderIndexService.java rename to ruoyi-segchk/src/main/java/com/ruoyi/segchk/service/ISegchkProviderIndexService.java index 5a34b6d..b698437 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/segchk/service/ISegchkProviderIndexService.java +++ b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/service/ISegchkProviderIndexService.java @@ -2,7 +2,6 @@ package com.ruoyi.segchk.service; import com.ruoyi.segchk.domain.*; -import java.math.BigDecimal; import java.util.List; /** @@ -37,4 +36,12 @@ public interface ISegchkProviderIndexService * @return 结果 */ public List selectProviderServiceAndSaleDetails(SegchkServiceAndSaleWebReq segchkServiceAndSaleWebReq); + + /** + * 返回运营商openid + * + * @param userId 运营商id + * @return 结果 + */ + public String selectWeChatInfoByProviderId(Long userId); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/segchk/service/ISegchkStoreIndexService.java b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/service/ISegchkStoreIndexService.java similarity index 89% rename from ruoyi-system/src/main/java/com/ruoyi/segchk/service/ISegchkStoreIndexService.java rename to ruoyi-segchk/src/main/java/com/ruoyi/segchk/service/ISegchkStoreIndexService.java index 6ecf9fe..3897e91 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/segchk/service/ISegchkStoreIndexService.java +++ b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/service/ISegchkStoreIndexService.java @@ -1,7 +1,7 @@ package com.ruoyi.segchk.service; import com.ruoyi.segchk.domain.*; -import com.ruoyi.segchk.domain.*; +import com.ruoyi.segchk.domain.WeChatCustomerLink; import java.util.List; @@ -137,4 +137,22 @@ public interface ISegchkStoreIndexService * @return 结果 */ public List selectSegchkRecommenderStoreListByProvider(SegchkRecommenderStoreWebReq segchkRecommenderStoreWebReq); + + /** + * 返回商户openid + * + * @param userId 商户id + * @return 结果 + */ + public WeChatCustomerLink selectWeChatInfoByStoreId(Long userId); + + + /** + * 验证推荐人是否存在 + * + * @param recommenderId 推荐人id + * @param recommenderLevel 推荐人角色 + * @return 结果 + */ + int recommenderIsExit(String recommenderId, String recommenderLevel, String providerId); } diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/segchk/service/ISegchkUserCashService.java b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/service/ISegchkUserCashService.java new file mode 100644 index 0000000..f5667d6 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/service/ISegchkUserCashService.java @@ -0,0 +1,63 @@ +package com.ruoyi.segchk.service; + +import com.ruoyi.segchk.domain.SegchkUserCash; + +import java.util.List; + +/** + * seg用户提现记录Service接口 + * + * @author yinzhiying + * @date 2021-08-23 + */ +public interface ISegchkUserCashService +{ + /** + * 查询seg用户提现记录 + * + * @param cashId seg用户提现记录主键 + * @return seg用户提现记录 + */ + public SegchkUserCash selectSegchkUserCashByCashId(Long cashId); + + /** + * 查询seg用户提现记录列表 + * + * @param segchkUserCash seg用户提现记录 + * @return seg用户提现记录集合 + */ + public List selectSegchkUserCashList(SegchkUserCash segchkUserCash); + + /** + * 新增seg用户提现记录 + * + * @param segchkUserCash seg用户提现记录 + * @return 结果 + */ + public int insertSegchkUserCash(SegchkUserCash segchkUserCash); + + /** + * 修改seg用户提现记录 + * + * @param segchkUserCash seg用户提现记录 + * @return 结果 + */ + public int updateSegchkUserCash(SegchkUserCash segchkUserCash); + + /** + * 批量删除seg用户提现记录 + * + * @param cashIds 需要删除的seg用户提现记录主键集合 + * @return 结果 + */ + public int deleteSegchkUserCashByCashIds(Long[] cashIds); + + /** + * 删除seg用户提现记录信息 + * + * @param cashId seg用户提现记录主键 + * @return 结果 + */ + public int deleteSegchkUserCashByCashId(Long cashId); + +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/segchk/service/ISegchkUserChargeService.java b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/service/ISegchkUserChargeService.java new file mode 100644 index 0000000..078a3a3 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/service/ISegchkUserChargeService.java @@ -0,0 +1,62 @@ +package com.ruoyi.segchk.service; + +import com.ruoyi.segchk.domain.SegchkUserCharge; + +import java.util.List; + +/** + * seg用户充值记录Service接口 + * + * @author yinzhiying + * @date 2021-08-23 + */ +public interface ISegchkUserChargeService +{ + /** + * 查询seg用户充值记录 + * + * @param chargeId seg用户充值记录主键 + * @return seg用户充值记录 + */ + public SegchkUserCharge selectSegchkUserChargeByChargeId(Long chargeId); + + /** + * 查询seg用户充值记录列表 + * + * @param segchkUserCharge seg用户充值记录 + * @return seg用户充值记录集合 + */ + public List selectSegchkUserChargeList(SegchkUserCharge segchkUserCharge); + + /** + * 新增seg用户充值记录 + * + * @param segchkUserCharge seg用户充值记录 + * @return 结果 + */ + public int insertSegchkUserCharge(SegchkUserCharge segchkUserCharge); + + /** + * 修改seg用户充值记录 + * + * @param segchkUserCharge seg用户充值记录 + * @return 结果 + */ + public int updateSegchkUserCharge(SegchkUserCharge segchkUserCharge); + + /** + * 批量删除seg用户充值记录 + * + * @param chargeIds 需要删除的seg用户充值记录主键集合 + * @return 结果 + */ + public int deleteSegchkUserChargeByChargeIds(Long[] chargeIds); + + /** + * 删除seg用户充值记录信息 + * + * @param chargeId seg用户充值记录主键 + * @return 结果 + */ + public int deleteSegchkUserChargeByChargeId(Long chargeId); +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/segchk/service/ISegchkUserCollectService.java b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/service/ISegchkUserCollectService.java new file mode 100644 index 0000000..d3ddda2 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/service/ISegchkUserCollectService.java @@ -0,0 +1,70 @@ +package com.ruoyi.segchk.service; + +import com.ruoyi.segchk.domain.SegchkUserCollect; + +import java.util.List; + +/** + * seg用户收藏记录Service接口 + * + * @author yinzhiying + * @date 2021-08-23 + */ +public interface ISegchkUserCollectService +{ + /** + * 查询seg用户收藏记录 + * + * @param collectId seg用户收藏记录主键 + * @return seg用户收藏记录 + */ + public SegchkUserCollect selectSegchkUserCollectByCollectId(Long collectId); + + /** + * 查询seg用户收藏记录列表 + * + * @param segchkUserCollect seg用户收藏记录 + * @return seg用户收藏记录集合 + */ + public List selectSegchkUserCollectList(SegchkUserCollect segchkUserCollect); + + /** + * 新增seg用户收藏记录 + * + * @param segchkUserCollect seg用户收藏记录 + * @return 结果 + */ + public int insertSegchkUserCollect(SegchkUserCollect segchkUserCollect); + + /** + * 修改seg用户收藏记录 + * + * @param segchkUserCollect seg用户收藏记录 + * @return 结果 + */ + public int updateSegchkUserCollect(SegchkUserCollect segchkUserCollect); + + /** + * 批量删除seg用户收藏记录 + * + * @param collectIds 需要删除的seg用户收藏记录主键集合 + * @return 结果 + */ + public int deleteSegchkUserCollectByCollectIds(Long[] collectIds); + + /** + * 删除seg用户收藏记录信息 + * + * @param collectId seg用户收藏记录主键 + * @return 结果 + */ + public int deleteSegchkUserCollectByCollectId(Long collectId); + + /** + * 批量删除seg用户收藏记录 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteSegchkUserCollectByIds(String ids); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/segchk/service/ISegchkUserIndexService.java b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/service/ISegchkUserIndexService.java similarity index 66% rename from ruoyi-system/src/main/java/com/ruoyi/segchk/service/ISegchkUserIndexService.java rename to ruoyi-segchk/src/main/java/com/ruoyi/segchk/service/ISegchkUserIndexService.java index c160629..862950f 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/segchk/service/ISegchkUserIndexService.java +++ b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/service/ISegchkUserIndexService.java @@ -1,9 +1,14 @@ package com.ruoyi.segchk.service; import com.ruoyi.segchk.domain.*; +import com.ruoyi.util.CommonResponse; +import com.ruoyi.util.bean.PrepayResult; +import com.ruoyi.util.bean.WxTransferResult; +import java.io.InputStream; import java.math.BigDecimal; import java.util.List; +import java.util.Map; /** * seg用户基本信息Service接口 @@ -137,9 +142,10 @@ public interface ISegchkUserIndexService * 根据用户id(或者商户id),运营商id,用户身份查询用户余额 * * @param segchkUserCashOpsReq 用户请示信息体 + * @param ip * @return 结果 */ - public int getAccountForCash(SegchkUserCashOpsReq segchkUserCashOpsReq); + public int getAccountForCash(SegchkUserCashOpsReq segchkUserCashOpsReq, String ip); /** * 根据提现id,进行提现结果保存,及余额更新 @@ -188,5 +194,79 @@ public interface ISegchkUserIndexService * @param phoneno 用户信息 * @return 更新结果 */ - public int selectUserLevel(String phoneno); + public SegchkUserLevelInfo selectUserLevelByMobile(String phoneno); + + /** + * 根据用户信息注册用户基本信息表 + * + * @param segchkUserBasicInfo 用户信息 + * @return 插入结果 + */ + public int addUserBasicInfo(SegchkUserBasicInfo segchkUserBasicInfo); + + /** + * 根据推荐人信息,检查推荐人是否存在 + * + * @param parmMap 推荐人信息 + * @return 查询记录数 + */ + public int recommenderIsExit(Map parmMap); + + /** + * 根据推荐人信息,更新用户扩展信息表 + * + * @param segchkUserExtInfo 推荐人信息 + * @return 查询记录数 + */ + public int insertUserExtInfo(SegchkUserExtInfo segchkUserExtInfo); + + + /** + * 根据用户基本信息查找用户微信信息 + * + * @param segchkUserLevelInfo 用户基本信息 + * @return 查询记录数 + */ + public String getWeChatInfoByUserId(SegchkUserLevelInfo segchkUserLevelInfo); + + /** + * 根据用户信息,更新用户微信信息表 + * + * @param segchkUserWechat 用户基本信息 + * @param userLevel + * @return 查询记录数 + */ + public int updateWeChatInfoByUserId(SegchkUserWechat segchkUserWechat, String userLevel); + + /** + * 微信小程序支付 + * + * @param orderCode 订单code + * @param userId 用户id + * @param ip 请求真实ip + * @param type 支付类型 1:订单支付 2:预存款充值 ---> 1用户支付,2商户支付 + * @return 返回码和支付宝支付的html 返回码说明 -1:用户不存在 -3:没有待支付的订单 -5:微信生成订单出错 -7 没有设置网站地址 -8 缺少配置 -9 没有启用 1 成功 + */ + CommonResponse wechatAppletPay(String orderCode, Long userId, Long providerId, String ip, int type); + + /** + * 微信小程序提现 + * + * @param orderCode 订单code + * @param userId 用户id + * @param providerId 用户id + * @param ip 请求真实ip + * @param type 支付类型 1:订单支付 2:预存款充值 ---> 1用户支付,2商户支付 + * @return 返回码和支付宝支付的html 返回码说明 -1:用户不存在 -3:没有待支付的订单 -5:微信生成订单出错 -7 没有设置网站地址 -8 缺少配置 -9 没有启用 1 成功 + */ + CommonResponse wechatAppletTransfers(String orderCode, Long userId, Long providerId, String ip, int type); + + /** + * 微信回调(小程序) 回调 + * + * @param inputStream 微信回调参数 + * @return 返回码 1:成功 -1:没有订单 + */ + int weChatAppletNotify(InputStream inputStream); + } diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/segchk/service/ISegchkUserLikegoService.java b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/service/ISegchkUserLikegoService.java new file mode 100644 index 0000000..087870e --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/service/ISegchkUserLikegoService.java @@ -0,0 +1,62 @@ +package com.ruoyi.segchk.service; + +import com.ruoyi.segchk.domain.SegchkUserLikego; + +import java.util.List; + +/** + * seg用户想去记录Service接口 + * + * @author yinzhiying + * @date 2021-08-23 + */ +public interface ISegchkUserLikegoService +{ + /** + * 查询seg用户想去记录 + * + * @param likegoId seg用户想去记录主键 + * @return seg用户想去记录 + */ + public SegchkUserLikego selectSegchkUserLikegoByLikegoId(Long likegoId); + + /** + * 查询seg用户想去记录列表 + * + * @param segchkUserLikego seg用户想去记录 + * @return seg用户想去记录集合 + */ + public List selectSegchkUserLikegoList(SegchkUserLikego segchkUserLikego); + + /** + * 新增seg用户想去记录 + * + * @param segchkUserLikego seg用户想去记录 + * @return 结果 + */ + public int insertSegchkUserLikego(SegchkUserLikego segchkUserLikego); + + /** + * 修改seg用户想去记录 + * + * @param segchkUserLikego seg用户想去记录 + * @return 结果 + */ + public int updateSegchkUserLikego(SegchkUserLikego segchkUserLikego); + + /** + * 批量删除seg用户想去记录 + * + * @param likegoIds 需要删除的seg用户想去记录主键集合 + * @return 结果 + */ + public int deleteSegchkUserLikegoByLikegoIds(Long[] likegoIds); + + /** + * 删除seg用户想去记录信息 + * + * @param likegoId seg用户想去记录主键 + * @return 结果 + */ + public int deleteSegchkUserLikegoByLikegoId(Long likegoId); +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/segchk/service/ISegchkUserWechatService.java b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/service/ISegchkUserWechatService.java new file mode 100644 index 0000000..b1ec5f0 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/service/ISegchkUserWechatService.java @@ -0,0 +1,62 @@ +package com.ruoyi.segchk.service; + +import com.ruoyi.segchk.domain.SegchkUserWechat; + +import java.util.List; + +/** + * seg用户微信信息Service接口 + * + * @author yinzhiying + * @date 2021-08-23 + */ +public interface ISegchkUserWechatService +{ + /** + * 查询seg用户微信信息 + * + * @param userId seg用户微信信息主键 + * @return seg用户微信信息 + */ + public SegchkUserWechat selectSegchkUserWechatByUserId(Long userId); + + /** + * 查询seg用户微信信息列表 + * + * @param segchkUserWechat seg用户微信信息 + * @return seg用户微信信息集合 + */ + public List selectSegchkUserWechatList(SegchkUserWechat segchkUserWechat); + + /** + * 新增seg用户微信信息 + * + * @param segchkUserWechat seg用户微信信息 + * @return 结果 + */ + public int insertSegchkUserWechat(SegchkUserWechat segchkUserWechat); + + /** + * 修改seg用户微信信息 + * + * @param segchkUserWechat seg用户微信信息 + * @return 结果 + */ + public int updateSegchkUserWechat(SegchkUserWechat segchkUserWechat); + + /** + * 批量删除seg用户微信信息 + * + * @param userIds 需要删除的seg用户微信信息主键集合 + * @return 结果 + */ + public int deleteSegchkUserWechatByUserIds(Long[] userIds); + + /** + * 删除seg用户微信信息信息 + * + * @param userId seg用户微信信息主键 + * @return 结果 + */ + public int deleteSegchkUserWechatByUserId(Long userId); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/segchk/service/impl/ISegchkStoreIndexServiceImpl.java b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/service/impl/ISegchkStoreIndexServiceImpl.java similarity index 85% rename from ruoyi-system/src/main/java/com/ruoyi/segchk/service/impl/ISegchkStoreIndexServiceImpl.java rename to ruoyi-segchk/src/main/java/com/ruoyi/segchk/service/impl/ISegchkStoreIndexServiceImpl.java index 7c70733..c3394e0 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/segchk/service/impl/ISegchkStoreIndexServiceImpl.java +++ b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/service/impl/ISegchkStoreIndexServiceImpl.java @@ -1,12 +1,19 @@ package com.ruoyi.segchk.service.impl; import com.ruoyi.segchk.domain.*; -import com.ruoyi.segchk.mapper.*; +import com.ruoyi.segchk.mapper.SegchkIndexStoreAccountMapper; +import com.ruoyi.segchk.mapper.SegchkStoreCashMapper; +import com.ruoyi.segchk.mapper.SegchkStoreIndexMapper; +import com.ruoyi.segchk.mapper.SegchkStoreSecurityMapper; import com.ruoyi.segchk.service.ISegchkStoreIndexService; +import com.ruoyi.segchk.domain.WeChatCustomerLink; +import com.ruoyi.segchk.service.ISegchkUserIndexService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.HashMap; import java.util.List; +import java.util.Map; @Service public class ISegchkStoreIndexServiceImpl implements ISegchkStoreIndexService { @@ -22,6 +29,9 @@ public class ISegchkStoreIndexServiceImpl implements ISegchkStoreIndexService { @Autowired private SegchkStoreSecurityMapper segchkStoreSecurityMapper; + + @Autowired + private ISegchkUserIndexService segchkUserIndexService; /** * 根据标签id,商户列表 * @@ -223,4 +233,31 @@ public class ISegchkStoreIndexServiceImpl implements ISegchkStoreIndexService { public List selectSegchkRecommenderStoreListByProvider(SegchkRecommenderStoreWebReq segchkRecommenderStoreWebReq) { return segchkStoreIndexMapper.selectSegchkRecommenderStoreListWeb(segchkRecommenderStoreWebReq); } + + /** + * 返回商户openid + * + * @param storeId 商户id + * @return 结果 + */ + @Override + public WeChatCustomerLink selectWeChatInfoByStoreId(Long storeId) { + return segchkStoreIndexMapper.selectStoreOpenIdById(storeId); + } + + /** + * 验证推荐人是否存在 + * + * @param recommenderId 推荐人id + * @param recommenderLevel 推荐人角色 + * @return 结果 + */ + @Override + public int recommenderIsExit(String recommenderId, String recommenderLevel, String providerId) { + Map parmMap = new HashMap<>(); + parmMap.put("userId", recommenderId); + parmMap.put("userLevel", recommenderLevel); + parmMap.put("providerId", providerId); + return segchkUserIndexService.recommenderIsExit(parmMap); + } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/segchk/service/impl/SegchkProviderIndexServiceImpl.java b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/service/impl/SegchkProviderIndexServiceImpl.java similarity index 88% rename from ruoyi-system/src/main/java/com/ruoyi/segchk/service/impl/SegchkProviderIndexServiceImpl.java rename to ruoyi-segchk/src/main/java/com/ruoyi/segchk/service/impl/SegchkProviderIndexServiceImpl.java index 745710d..d6c0349 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/segchk/service/impl/SegchkProviderIndexServiceImpl.java +++ b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/service/impl/SegchkProviderIndexServiceImpl.java @@ -59,4 +59,15 @@ public class SegchkProviderIndexServiceImpl implements ISegchkProviderIndexServi else return segchkProviderIndexMapper.selectSegchkStoreSaleDetails(segchkServiceAndSaleWebReq); } + + /** + * 返回运营商openid + * + * @param providerId 运营商id + * @return 结果 + */ + @Override + public String selectWeChatInfoByProviderId(Long providerId) { + return segchkProviderIndexMapper.selectProviderOpenIdById(providerId); + } } diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/segchk/service/impl/SegchkUserCashServiceImpl.java b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/service/impl/SegchkUserCashServiceImpl.java new file mode 100644 index 0000000..376359b --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/service/impl/SegchkUserCashServiceImpl.java @@ -0,0 +1,100 @@ +package com.ruoyi.segchk.service.impl; + +import com.ruoyi.segchk.domain.SegchkUserCash; +import com.ruoyi.segchk.mapper.SegchkUserCashMapper; +import com.ruoyi.segchk.service.ISegchkUserCashService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * seg用户提现记录Service业务层处理 + * + * @author yinzhiying + * @date 2021-08-23 + */ +@Service +public class SegchkUserCashServiceImpl implements ISegchkUserCashService +{ + + private static final Logger logger = LoggerFactory.getLogger(SegchkUserCashServiceImpl.class); + + @Autowired + private SegchkUserCashMapper segchkUserCashMapper; + + /** + * 查询seg用户提现记录 + * + * @param cashId seg用户提现记录主键 + * @return seg用户提现记录 + */ + @Override + public SegchkUserCash selectSegchkUserCashByCashId(Long cashId) + { + return segchkUserCashMapper.selectSegchkUserCashByCashId(cashId); + } + + /** + * 查询seg用户提现记录列表 + * + * @param segchkUserCash seg用户提现记录 + * @return seg用户提现记录 + */ + @Override + public List selectSegchkUserCashList(SegchkUserCash segchkUserCash) + { + return segchkUserCashMapper.selectSegchkUserCashList(segchkUserCash); + } + + /** + * 新增seg用户提现记录 + * + * @param segchkUserCash seg用户提现记录 + * @return 结果 + */ + @Override + public int insertSegchkUserCash(SegchkUserCash segchkUserCash) + { + return segchkUserCashMapper.insertSegchkUserCash(segchkUserCash); + } + + /** + * 修改seg用户提现记录 + * + * @param segchkUserCash seg用户提现记录 + * @return 结果 + */ + @Override + public int updateSegchkUserCash(SegchkUserCash segchkUserCash) + { + return segchkUserCashMapper.updateSegchkUserCash(segchkUserCash); + } + + /** + * 批量删除seg用户提现记录 + * + * @param cashIds 需要删除的seg用户提现记录主键 + * @return 结果 + */ + @Override + public int deleteSegchkUserCashByCashIds(Long[] cashIds) + { + return segchkUserCashMapper.deleteSegchkUserCashByCashIds(cashIds); + } + + /** + * 删除seg用户提现记录信息 + * + * @param cashId seg用户提现记录主键 + * @return 结果 + */ + @Override + public int deleteSegchkUserCashByCashId(Long cashId) + { + return segchkUserCashMapper.deleteSegchkUserCashByCashId(cashId); + } + +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/segchk/service/impl/SegchkUserChargeServiceImpl.java b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/service/impl/SegchkUserChargeServiceImpl.java new file mode 100644 index 0000000..d1dfd68 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/service/impl/SegchkUserChargeServiceImpl.java @@ -0,0 +1,94 @@ +package com.ruoyi.segchk.service.impl; + +import com.ruoyi.segchk.domain.SegchkUserCharge; +import com.ruoyi.segchk.mapper.SegchkUserChargeMapper; +import com.ruoyi.segchk.service.ISegchkUserChargeService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * seg用户充值记录Service业务层处理 + * + * @author yinzhiying + * @date 2021-08-23 + */ +@Service +public class SegchkUserChargeServiceImpl implements ISegchkUserChargeService +{ + @Autowired + private SegchkUserChargeMapper segchkUserChargeMapper; + + /** + * 查询seg用户充值记录 + * + * @param chargeId seg用户充值记录主键 + * @return seg用户充值记录 + */ + @Override + public SegchkUserCharge selectSegchkUserChargeByChargeId(Long chargeId) + { + return segchkUserChargeMapper.selectSegchkUserChargeByChargeId(chargeId); + } + + /** + * 查询seg用户充值记录列表 + * + * @param segchkUserCharge seg用户充值记录 + * @return seg用户充值记录 + */ + @Override + public List selectSegchkUserChargeList(SegchkUserCharge segchkUserCharge) + { + return segchkUserChargeMapper.selectSegchkUserChargeList(segchkUserCharge); + } + + /** + * 新增seg用户充值记录 + * + * @param segchkUserCharge seg用户充值记录 + * @return 结果 + */ + @Override + public int insertSegchkUserCharge(SegchkUserCharge segchkUserCharge) + { + return segchkUserChargeMapper.insertSegchkUserCharge(segchkUserCharge); + } + + /** + * 修改seg用户充值记录 + * + * @param segchkUserCharge seg用户充值记录 + * @return 结果 + */ + @Override + public int updateSegchkUserCharge(SegchkUserCharge segchkUserCharge) + { + return segchkUserChargeMapper.updateSegchkUserCharge(segchkUserCharge); + } + + /** + * 批量删除seg用户充值记录 + * + * @param chargeIds 需要删除的seg用户充值记录主键 + * @return 结果 + */ + @Override + public int deleteSegchkUserChargeByChargeIds(Long[] chargeIds) + { + return segchkUserChargeMapper.deleteSegchkUserChargeByChargeIds(chargeIds); + } + + /** + * 删除seg用户充值记录信息 + * + * @param chargeId seg用户充值记录主键 + * @return 结果 + */ + @Override + public int deleteSegchkUserChargeByChargeId(Long chargeId) + { + return segchkUserChargeMapper.deleteSegchkUserChargeByChargeId(chargeId); + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/segchk/service/impl/SegchkUserCollectServiceImpl.java b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/service/impl/SegchkUserCollectServiceImpl.java new file mode 100644 index 0000000..ea6e280 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/service/impl/SegchkUserCollectServiceImpl.java @@ -0,0 +1,107 @@ +package com.ruoyi.segchk.service.impl; + +import com.ruoyi.common.core.text.Convert; +import com.ruoyi.segchk.domain.SegchkUserCollect; +import com.ruoyi.segchk.mapper.SegchkUserCollectMapper; +import com.ruoyi.segchk.service.ISegchkUserCollectService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * seg用户收藏记录Service业务层处理 + * + * @author yinzhiying + * @date 2021-08-23 + */ +@Service +public class SegchkUserCollectServiceImpl implements ISegchkUserCollectService +{ + @Autowired + private SegchkUserCollectMapper segchkUserCollectMapper; + + /** + * 查询seg用户收藏记录 + * + * @param collectId seg用户收藏记录主键 + * @return seg用户收藏记录 + */ + @Override + public SegchkUserCollect selectSegchkUserCollectByCollectId(Long collectId) + { + return segchkUserCollectMapper.selectSegchkUserCollectByCollectId(collectId); + } + + /** + * 查询seg用户收藏记录列表 + * + * @param segchkUserCollect seg用户收藏记录 + * @return seg用户收藏记录 + */ + @Override + public List selectSegchkUserCollectList(SegchkUserCollect segchkUserCollect) + { + return segchkUserCollectMapper.selectSegchkUserCollectList(segchkUserCollect); + } + + /** + * 新增seg用户收藏记录 + * + * @param segchkUserCollect seg用户收藏记录 + * @return 结果 + */ + @Override + public int insertSegchkUserCollect(SegchkUserCollect segchkUserCollect) + { + return segchkUserCollectMapper.insertSegchkUserCollect(segchkUserCollect); + } + + /** + * 修改seg用户收藏记录 + * + * @param segchkUserCollect seg用户收藏记录 + * @return 结果 + */ + @Override + public int updateSegchkUserCollect(SegchkUserCollect segchkUserCollect) + { + return segchkUserCollectMapper.updateSegchkUserCollect(segchkUserCollect); + } + + /** + * 批量删除seg用户收藏记录 + * + * @param collectIds 需要删除的seg用户收藏记录主键 + * @return 结果 + */ + @Override + public int deleteSegchkUserCollectByCollectIds(Long[] collectIds) + { + return segchkUserCollectMapper.deleteSegchkUserCollectByCollectIds(collectIds); + } + + /** + * 删除seg用户收藏记录信息 + * + * @param collectId seg用户收藏记录主键 + * @return 结果 + */ + @Override + public int deleteSegchkUserCollectByCollectId(Long collectId) + { + return segchkUserCollectMapper.deleteSegchkUserCollectByCollectId(collectId); + } + + /** + * 删除seg用户收藏记录对象 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + @Override + public int deleteSegchkUserCollectByIds(String ids) + { + return segchkUserCollectMapper.deleteSegchkUserCollectByCollectIds(Convert.toLongArray(ids)); + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/segchk/service/impl/SegchkUserIndexServiceImpl.java b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/service/impl/SegchkUserIndexServiceImpl.java new file mode 100644 index 0000000..b1538ef --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/service/impl/SegchkUserIndexServiceImpl.java @@ -0,0 +1,1015 @@ +package com.ruoyi.segchk.service.impl; + +import com.ruoyi.order.service.impl.PaySupplier; +//import com.ruoyi.order.service.impl.WechatWithdrawSupplier; +import com.ruoyi.segchk.domain.*; +import com.ruoyi.segchk.mapper.*; +import com.ruoyi.segchk.service.ISegchkStoreIndexService; +import com.ruoyi.segchk.service.ISegchkUserCashService; +import com.ruoyi.segchk.service.ISegchkUserIndexService; +import com.ruoyi.setting.bean.BaseInfoSet; +import com.ruoyi.setting.bean.WechatPaySet; +import com.ruoyi.setting.service.BaseInfoSetService; +import com.ruoyi.setting.service.ILsPaySettingService; +import com.ruoyi.util.*; +import com.ruoyi.util.bean.OrderInfoAfterPay; +import com.ruoyi.util.bean.OrderInfoForPay; +import com.ruoyi.util.bean.PrepayResult; +import com.ruoyi.util.bean.WxTransferResult; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.ObjectUtils; +import org.springframework.util.StringUtils; + +import java.io.InputStream; +import java.math.BigDecimal; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.stream.Collectors; + +/** + * seg用户基本信息Service业务层处理 + * + * @author yinzhiying + * @date 2021-07-01 + */ +@Service +public class SegchkUserIndexServiceImpl implements ISegchkUserIndexService +{ + private static final Logger logger = LoggerFactory.getLogger(SegchkUserIndexServiceImpl.class); + + @Autowired + private SegchkUserIndexMapper segchkUserIndexMapper; + + @Autowired + private SegchkIndexUserVipMapper segchkIndexUserVipMapper; + + @Autowired + private SegchkServiceChkMapper segchkServiceChkMapper; + + @Autowired + private SegchkStoreSelfMgtMapper segchkStoreSelfMgtMapper; + + @Autowired + private SegchkSelfServiceChkMapper segchkSelfServiceChkMapper; + + @Autowired + private SegchkUserLikegoMapper segchkUserLikegoMapper; + + @Autowired + private SegchkUserChargeMapper segchkUserChargeMapper; + + @Autowired + private SegchkIndexUserAccountMapper segchkIndexUserAccountMapper; + + @Autowired + private SegchkIndexStoreAccountMapper segchkIndexStoreAccountMapper; + + @Autowired + private SegchkUserSecurityMapper segchkUserSecurityMapper; + + @Autowired + private SegchkUserCertificationInfoMapper segchkUserCertificationInfoMapper; + + @Autowired + private SegchkStoreCashMapper segchkStoreCashMapper; + + @Autowired + private SegchkUserCashMapper segchkUserCashMapper; + + + @Autowired + private SegchkServiceCommentMapper segchkServiceCommentMapper; + + @Autowired + private SegchkUserBasicInfoMapper segchkUserBasicInfoMapper; + + @Autowired + private SegchkUserExtInfoMapper segchkUserExtInfoMapper; + + @Autowired + private SegchkUserWechatMapper segchkUserWechatMapper; + + @Autowired + private ISegchkStoreIndexService segchkStoreIndexService; + + @Autowired + private SegchkProviderIndexServiceImpl segchkProviderIndexService; + + @Autowired + private BaseInfoSetService baseInfoSetService; + + @Autowired + private ISegchkUserCashService segchkUserCashService; + + /** + * 注入支付设置服务 + */ + @Autowired + private ILsPaySettingService paySetService; + + + + /** + * 查询seg用户中心信息 + * + * @param segchkUserWebReq@return seg用户扩展信息 + */ + @Override + public SegchkUserWebResp selectSegchkUserWebInfo(SegchkUserWebReq segchkUserWebReq) { + return segchkUserIndexMapper.selectSegchkUserWebInfo(segchkUserWebReq); + } + + /** + * 查询seg用户核消列表 + * + * @param segchkUserWebReq + * @return seg用户扩展信息 + */ + @Override + public List selectUserServiceCHKList(SegchkUserWebReq segchkUserWebReq) { + return segchkUserIndexMapper.selectUserServiceCHKList(segchkUserWebReq); + } + + /** + * 查询seg用户会员卡列表或赠卡优惠券列表 + * + * @param segchkUserWebReq + * @return seg用户扩展信息 + */ + @Override + public List selectUserCardList(SegchkUserWebReq segchkUserWebReq) { + if(segchkUserWebReq.getUserLevel() == 0 || segchkUserWebReq.getUserLevel() == null) { + return segchkUserIndexMapper.selectUserCardList(segchkUserWebReq); + } + else { + return segchkUserIndexMapper.selectUserPerformanceList(segchkUserWebReq); + } + } + + /** + * 查询seg用户收藏列表 + * + * @param segchkUserWebReq + * @return seg用户扩展信息 + */ + @Override + public List selectUserCollectList(SegchkUserWebReq segchkUserWebReq) { + return segchkUserIndexMapper.selectUserCollectList(segchkUserWebReq); + } + + /** + * 查询seg用户预约列表 + * + * @param segchkUserWebReq@return seg用户扩展信息 + */ + @Override + public List selectUserLikGoList(SegchkUserWebReq segchkUserWebReq) { + return segchkUserIndexMapper.selectUserLikGoList(segchkUserWebReq); + } + + /** + * 查询seg用户充值列表 + * + * @param segchkUserWebReq@return seg用户扩展信息 + */ + @Override + public List selectUserChargeList(SegchkUserWebReq segchkUserWebReq) { + return segchkUserIndexMapper.selectUserChargeList(segchkUserWebReq); + } + + /** + * 查询seg用户提现列表 + * + * @param segchkUserWebReq@return seg用户扩展信息 + */ + @Override + public List selectUserCashList(SegchkUserWebReq segchkUserWebReq) { + return segchkUserIndexMapper.selectUserCashList(segchkUserWebReq); + } + + /** + * 查询seg用户消息列表 + * + * @param segchkUserWebReq@return seg用户扩展信息 + */ + @Override + public List selectUserMsgList(SegchkUserWebReq segchkUserWebReq) { + return segchkUserIndexMapper.selectUserMsgList(segchkUserWebReq); + } + + /** + * 查询seg用户预约可用卡券列表 + * + * @param segchkServiceOrderWebReq seg用户中心请求实体 + * @return seg用户扩展信息 + */ + @Override + public List selectUserOrderPredCardListWebInfo(SegchkServiceOrderWebReq segchkServiceOrderWebReq) { + return segchkUserIndexMapper.selectUserOrderPredCardListWebInfo(segchkServiceOrderWebReq); + } + + /** + * 根据用户核消二维码提取出来相应的信息进行核消,1、检查核卡是否可以核消(防止该卡已经在该商家不能再次核消),2、检查该预约id,是否已经使用(防止多次预约核消使用) + * + * @param segchkUserLikego seg用户想去记录实体 + * @return 结果 + */ + @Override + public void CheckUserServiceChk(SegchkUserLikego segchkUserLikego) { + SegchkServiceOrderWebReq segchkServiceOrderWebReq = new SegchkServiceOrderWebReq(); + segchkServiceOrderWebReq.setProviderId(segchkUserLikego.getProviderId()); + segchkServiceOrderWebReq.setUserId(segchkUserLikego.getUserId()); + segchkServiceOrderWebReq.setStoreId(segchkUserLikego.getStoreId()); + List segchkServiceOrderWebReqList = segchkUserIndexMapper.selectUserOrderPredCardListWebInfo(segchkServiceOrderWebReq); + if(segchkServiceOrderWebReqList == null || segchkServiceOrderWebReqList.isEmpty()){ +// 说明该用户已经没有可使用的卡了 + } + else { + final List collect = segchkServiceOrderWebReqList.stream().filter(v -> v.getProviderId() == segchkUserLikego.getProviderId() && v.getUserId() == segchkUserLikego.getUserId() && v.getStoreId() == segchkUserLikego.getStoreId() && v.getCardId() == segchkUserLikego.getCardId() && v.getTypeId() == segchkUserLikego.getCardType()).collect(Collectors.toList()); + } + + } + + @Override + public SegchkServiceOrderChkTestResp selectUserOrderPredInfo(Long likegoId) { + return segchkUserIndexMapper.selectUserOrderPredInfo(likegoId); + } + + /** + * 根据核查结果进行核消。说明已经满足核消条件 + * + * @param segchkServiceOrderChkTestResp + * @param likegoId + * @return 结果 + */ + @Override + @Transactional + public int OrderCheckTransaction(SegchkServiceOrderChkTestResp segchkServiceOrderChkTestResp, Long likegoId) { + int ret = 0; + if(segchkServiceOrderChkTestResp.getCardType() == 0){ +// 说明是会员卡,则先更新会员卡次数。然后插入核消记录,最后更新预约订单状态 +// SegchkUserVip segchkUserVip = new SegchkUserVip(); + ret += segchkIndexUserVipMapper.updateSegchkUserVipCheck(segchkServiceOrderChkTestResp.getCardId()); + System.out.println(ret); + SegchkServiceChk segchkServiceChk = new SegchkServiceChk(); segchkServiceChk.setCardId(segchkServiceOrderChkTestResp.getCardId()); + segchkServiceChk.setCardTypeId(0L); + segchkServiceChk.setProviderId(segchkServiceOrderChkTestResp.getProviderId()); + segchkServiceChk.setStoreId(segchkServiceOrderChkTestResp.getStoreId()); + segchkServiceChk.setUserId(segchkServiceOrderChkTestResp.getUserId()); + + ret += segchkServiceChkMapper.insertSegchkServiceChk(segchkServiceChk); + System.out.println(ret); + } + else { +// 说明是优惠券或赠卡则先更新赠卡次数。然后插入核消记录,最后更新预约订单状态 + ret += segchkStoreSelfMgtMapper.updateSegchkUserVipCheck(segchkServiceOrderChkTestResp.getCardId()); + System.out.println(ret); + SegchkSelfServiceChk segchkSelfServiceChk = new SegchkSelfServiceChk(); + segchkSelfServiceChk.setCardId(segchkServiceOrderChkTestResp.getCardId()); + segchkSelfServiceChk.setProviderId(segchkServiceOrderChkTestResp.getProviderId()); + segchkSelfServiceChk.setStoreId(segchkServiceOrderChkTestResp.getStoreId()); + segchkSelfServiceChk.setUserId(segchkServiceOrderChkTestResp.getUserId()); + ret += segchkSelfServiceChkMapper.insertSegchkSelfServiceChk(segchkSelfServiceChk); + System.out.println(ret); + } + SegchkUserLikego segchkUserLikego = new SegchkUserLikego(); + segchkUserLikego.setLikegoId(likegoId); + segchkUserLikego.setMgtState(2); + ret += segchkUserLikegoMapper.updateSegchkUserLikego(segchkUserLikego); + System.out.println(ret); + return ret; + } + + /** + * 根据支付回调结果,进行相应的更新 + * + * @param chargeId 核消检查信息 + * @param ret 预约单id + * @return 结果 + */ + @Override + @Transactional + public void chargeRet(String chargeId, int ret) { +// 根据回调结果。如果成功,则插入生成会员卡,并获取会员卡号,否则不产生新的会员卡号 + if(ret == 0){ +// 支付成功,生成新的会员卡信息 + SegchkChargeRet segchkChargeRet = new SegchkChargeRet(); + segchkChargeRet.setChargeId(Long.valueOf(chargeId)); + int insert_ret = segchkIndexUserVipMapper.insertSegchkUserVipByCharge(segchkChargeRet); + if(insert_ret == 0){ + System.out.format("生成新的会员卡失败--->{0}\n", segchkChargeRet.getChargeId()); + } + else{ + System.out.format("生成新的会员卡成功--->{0}:{1}\n", chargeId, segchkChargeRet.getCardId()); + } +// 根据新生成的会员卡号,充值id,更新相应的充值记录表,商家赠卡表等 + SegchkUserCharge segchkUserCharge = new SegchkUserCharge(); + segchkUserCharge.setChargeId(segchkChargeRet.getChargeId()); + segchkUserCharge.setCardId(segchkChargeRet.getCardId()); + segchkUserCharge.setRetFlag(1); + int updaterest = segchkUserChargeMapper.updateSegchkUserChargeByRet(segchkUserCharge); + System.out.println(updaterest); + } + else{ + SegchkUserCharge segchkUserCharge = new SegchkUserCharge(); + segchkUserCharge.setChargeId(Long.parseLong(chargeId)); + segchkUserCharge.setRetFlag(2); + int updaterest = segchkUserChargeMapper.updateSegchkUserCharge(segchkUserCharge); + int deleterest = segchkIndexUserAccountMapper.deleteSegchkUserAccountByCharge(segchkUserCharge); + System.out.println(updaterest); + } + } + + /** + * 根据支用户id,运营商id,查询该用户可购买的卡 + * + * @param segchkUserWebReq 用户请示信息体 + * @return 结果 + */ + @Override + public List SegchkUserChargePre(SegchkUserWebReq segchkUserWebReq) { + List segchkUserChargeCards = segchkUserIndexMapper.selectSegchkUserChargePre(segchkUserWebReq); + +// 说明该用户购买过正式会员卡 +// boolean b = segchkUserChargeCards.parallelStream().anyMatch(v -> v.getHadBuy() != 0 && v.getCardTypeValue().compareTo(new BigDecimal(20.0)) = -1); + if(segchkUserChargeCards.parallelStream().anyMatch(v -> v.getCanBuy() == 1 || v.getCanBuy() == 3)){ +// 如果有一张卡,为正在使用中1,则不可以再充值购买 + return null; + } + else{ + List segchkUserChargeCards1 = segchkUserChargeCards.parallelStream().filter(v -> { +// 通过过滤出可购买的卡(间接过滤到为超限不能再买的卡) + return v.getCanBuy() == 0; + }).collect(Collectors.toList()); + return segchkUserChargeCards1.size() == 0 || segchkUserChargeCards1.isEmpty() ? null : segchkUserChargeCards1; + } + } + + /** + * 根据支用户id,运营商id,用户充值时可用余额 + * + * @param segchkUserCharge 用户请示信息体 + * @return 结果 + */ + @Override + public BigDecimal getAccount(SegchkUserCharge segchkUserCharge) { + SegchkUserAccountCheck segchkUserAccountCheck = new SegchkUserAccountCheck(); + segchkUserAccountCheck.setAccount(segchkUserCharge.getAccountUsed()); + segchkUserAccountCheck.setProviderId(segchkUserCharge.getProviderId()); + segchkUserAccountCheck.setUserId(segchkUserCharge.getUserId()); + BigDecimal ret = segchkIndexUserAccountMapper.checkSegchkUserAccount(segchkUserAccountCheck); + return ret; + } + + /** + * 根据用户id(或者商户id),运营商id,用户身份查询用户余额 + * + * @param segchkUserCashOpsReq 用户请示信息体 + * @param ip + * @return 结果 + */ + @Override + public int getAccountForCash(SegchkUserCashOpsReq segchkUserCashOpsReq, String ip) { + SegchkUserCashOpsResp segchkUserCashOpsResp = segchkIndexUserAccountMapper.selectSegchkUserAccountForCash(segchkUserCashOpsReq); + if(segchkUserCashOpsResp == null){ +// 说明用户没有任何余额信息 + return -1; + } + + if(segchkUserCashOpsReq.getUserLevel() != 1 && segchkUserCashOpsReq.getUserLevel() != 2){ +// 非正常用户 + return -2; + } + BigDecimal baseline = segchkUserCashOpsReq.getUserLevel() == 1 ? new BigDecimal(3000.0) : new BigDecimal(0.0); + BigDecimal baseline1 = segchkUserCashOpsReq.getUserLevel() == 1 ? new BigDecimal(5000.0) : new BigDecimal(100.0); + if(segchkUserCashOpsReq.getCash().compareTo(segchkUserCashOpsReq.getCashId() == null ? baseline : baseline1) != 1){ +// 首次提现余额受限 + return -3; + } + if(segchkUserCashOpsReq.getCash().compareTo(segchkUserCashOpsResp.getAccount()) == 1){ +// 提现金额超过余额 + return -4; + } + +// 1、创建提现记录 +// 2 新增余额记录 +// ret = 2 成功 + int ret = makeCashOps(segchkUserCashOpsReq, ip); + + return ret; + } + + /** + * 根据提现id,进行提现结果保存,及余额更新 + * + * @param chargeId 行政区代码 + * @param ret 行政区代码 + * @return seg首页轮播图管理 + */ + @Override + @Transactional + public void cashRet(String chargeId, int ret) { + int opsRet = 0; + SegchkUserCash segchkUserCash = new SegchkUserCash(); + segchkUserCash.setCashId(Long.valueOf(chargeId)); + segchkUserCash.setRetFlag(ret == 0 ? 1 : 2); + opsRet = segchkUserCashMapper.updateSegchkUserCash(segchkUserCash); + if(ret != 0){ + opsRet = segchkIndexUserAccountMapper.deleteSegchkUserAccountByCash(segchkUserCash); + } + } + + /** + * 新增用户评价 + * + * @param segchkServiceCommentUserReq 用户评价提交实体 + * @return seg首页轮播图管理 + */ + @Override + @Transactional + public int insertSegchkServiceComment(SegchkServiceCommentUserReq segchkServiceCommentUserReq) { + int ret = segchkServiceCommentMapper.insertSegchkServiceCommentByChk(segchkServiceCommentUserReq); + SegchkServiceChk segchkServiceChk = new SegchkServiceChk(); + segchkServiceChk.setCommentId(segchkServiceCommentUserReq.getCommentId()); + segchkServiceChk.setChkServiceId(segchkServiceCommentUserReq.getChkServiceId()); + ret += segchkServiceChkMapper.updateSegchkServiceChk(segchkServiceChk); + return ret; + } + + /** + * 根据评价id,查询用户评价 + * + * @param segchkServiceCommentUserReq 用户评价提交实体 + * @return seg首页轮播图管理 + */ + @Override + public SegchkServiceComment selectSegchkServiceComment(SegchkServiceCommentUserReq segchkServiceCommentUserReq) { + return segchkServiceCommentMapper.selectSegchkServiceCommentByCommentId(segchkServiceCommentUserReq.getCommentId()); + } + + /** + * 根据用户提交信息进行修改 + * + * @param segchkUserSetInfoReq 用户评价提交实体 + * @return 更新结果 + */ + @Override + public int updateUserInfo(SegchkUserSetInfoReq segchkUserSetInfoReq) { + SegchkUserSecurity segchkUserSecurity = new SegchkUserSecurity(); + segchkUserSecurity.setPasswd(segchkUserSetInfoReq.getPasswd()); + segchkUserSecurity.setUserId(segchkUserSetInfoReq.getUserId()); + segchkUserSecurity.setProviderId(segchkUserSetInfoReq.getProviderId()); + return segchkUserSecurityMapper.insertSegchkUserSecurity(segchkUserSecurity); + } + + /** + * 根据用户提交信息实名设置 + * + * @param segchkUserCertificationInfo 用户提交实体 + * @return 更新结果 + */ + @Override + public int userCerticify(SegchkUserCertificationInfo segchkUserCertificationInfo) { + SegchkUserCertificationInfo tmp = new SegchkUserCertificationInfo(); + tmp.setUserId(segchkUserCertificationInfo.getUserId()); + tmp.setProviderId(segchkUserCertificationInfo.getProviderId()); + List infos = segchkUserCertificationInfoMapper.selectSegchkUserCertificationInfoList(tmp); + if(infos == null || infos.isEmpty()){ + return segchkUserCertificationInfoMapper.insertSegchkUserCertificationInfo(segchkUserCertificationInfo); + } + else{ + segchkUserCertificationInfo.setUsercardId(infos.get(0).getUsercardId()); + return segchkUserCertificationInfoMapper.updateSegchkUserCertificationInfo(segchkUserCertificationInfo); + } + } + + /** + * 根据用户信息返回用户身份 + * + * @param phoneno 用户信息 + * @return 更新结果 + */ + @Override + public SegchkUserLevelInfo selectUserLevelByMobile(String phoneno) { + return segchkUserIndexMapper.selectUserLevelByMobile(phoneno); + } + + /** + * 根据用户信息注册用户基本信息表 + * + * @param segchkUserBasicInfo 用户信息 + * @return 插入结果 + */ + @Override + public int addUserBasicInfo(SegchkUserBasicInfo segchkUserBasicInfo) { + return segchkUserBasicInfoMapper.insertSegchkUserBasicInfo(segchkUserBasicInfo); + } + + /** + * 根据推荐人信息,检查推荐人是否存在 + * + * @param parmMap 推荐人信息 + * @return 查询记录数 + */ + @Override + public int recommenderIsExit(Map parmMap) { + String userLevel = parmMap.get("userLevel").toString(); + switch (userLevel){ + case "0": return segchkUserIndexMapper.providerIsExit(parmMap); + case "1": return segchkUserIndexMapper.storeIsExit(parmMap); + case "2": return segchkUserIndexMapper.userIsExit(parmMap); + default: return -1; + } + } + + /** + * 根据推荐人信息,更新用户扩展信息表 + * + * @param segchkUserExtInfo 推荐人信息 + * @return 查询记录数 + */ + @Override + public int insertUserExtInfo(SegchkUserExtInfo segchkUserExtInfo) { + return segchkUserExtInfoMapper.insertSegchkUserExtInfo(segchkUserExtInfo); + } + + /** + * 根据用户基本信息查找用户微信信息 + * + * @param segchkUserLevelInfo 用户基本信息 + * @return 查询记录数 + */ + @Override + public String getWeChatInfoByUserId(SegchkUserLevelInfo segchkUserLevelInfo) { + if(segchkUserLevelInfo.getUserLevel() == 2) { + SegchkUserWechat segchkUserWechat = segchkUserWechatMapper.selectSegchkUserWechatByUserId(segchkUserLevelInfo.getUserId()); + if(ObjectUtils.isEmpty(segchkUserWechat) + || StringUtils.isEmpty(segchkUserWechat.getOpenid())){ + return null; + } + return segchkUserWechat.getOpenid(); + } + else if(segchkUserLevelInfo.getUserLevel() == 1){ + return segchkStoreIndexService.selectWeChatInfoByStoreId(segchkUserLevelInfo.getUserId()).getOpenId(); + } + else if(segchkUserLevelInfo.getUserLevel() == 0){ + return segchkProviderIndexService.selectWeChatInfoByProviderId(segchkUserLevelInfo.getUserId()); + } + else return null; + } + + /** + * 根据用户信息,更新用户微信信息表 + * + * @param segchkUserWechat 用户基本信息 + * @param userLevel + * @return 查询记录数 + */ + @Override + public int updateWeChatInfoByUserId(SegchkUserWechat segchkUserWechat, String userLevel) { + switch (userLevel){ + case "0": return segchkUserIndexMapper.updateSegchkProviderWechat(segchkUserWechat); + case "1": return segchkUserIndexMapper.updateSegchkStoreWechat(segchkUserWechat); + case "2": return segchkUserIndexMapper.updateSegchkUserWechat(segchkUserWechat); + default: return -1; + } + } + + + @Transactional + public int makeCashOps(SegchkUserCashOpsReq segchkUserCashOpsReq, String ip) { + int ret = 0; + int type = segchkUserCashOpsReq.getUserLevel(); + String cashId = null; + if(type == 1){ + SegchkStoreCash segchkStoreCash = new SegchkStoreCash(); + segchkStoreCash.setCash(segchkUserCashOpsReq.getCash()); + segchkStoreCash.setCashType("0"); + segchkStoreCash.setProviderId(segchkUserCashOpsReq.getProviderId()); + segchkStoreCash.setStoreId(segchkUserCashOpsReq.getUserId()); + segchkStoreCash.setRetFlag("0"); +// 增加提现记录 + ret = segchkStoreCashMapper.insertSegchkStoreCash(segchkStoreCash); +// 根据提现计算商户全额 + ret += segchkIndexStoreAccountMapper.insertSegchkStoreAccountByCash(segchkStoreCash); + type = 1; + cashId = segchkStoreCash.getCashId().toString(); + } + else if(type == 2){ + SegchkUserCash segchkUserCash = new SegchkUserCash(); + segchkUserCash.setCash(segchkUserCashOpsReq.getCash()); + segchkUserCash.setCashType("0"); + segchkUserCash.setProviderId(segchkUserCashOpsReq.getProviderId()); + segchkUserCash.setUserId(segchkUserCashOpsReq.getUserId()); + segchkUserCash.setRetFlag(0); +// 增加提现记录 + ret = segchkUserCashMapper.insertSegchkUserCash(segchkUserCash); +// 根据提现计算最新的余额 + ret += segchkIndexUserAccountMapper.insertSegchkStoreAccountByCash(segchkUserCash); + type = 2; + cashId = segchkUserCash.getCashId().toString(); + + } + if(ret != 2 || StringUtils.isEmpty(cashId)){ + logger.error("makeCashOps fail due to create cash order createcnt{}---return{}---cashId{}....", ret, -12, cashId); + return -12; + } + return wechatAppletTransfers(cashId, segchkUserCashOpsReq.getUserId(), segchkUserCashOpsReq.getProviderId(), ip, type).getFlag(); + } + + /** + * 微信小程序支付 + * + * @param orderCode 订单code + * @param userId 用户id + * @param providerId 用户id + * @param ip 请求真实ip + * @param type 支付类型 1:订单支付 2:预存款充值 ---> 1用户支付,2商户支付 + * @return 返回码和支付宝支付的html 返回码说明 -1:用户不存在 -3:没有待支付的订单 -5:微信生成订单出错 -7 没有设置网站地址 -8 缺少配置 -9 没有启用 1 成功 + */ + @Override + public CommonResponse wechatAppletPay(String orderCode, Long userId, Long providerId, String ip, int type) { + logger.debug("wechatAppletPay and orderCode:{} \r\n userId:{} \r\n ip:{} \r\n:type:{}", orderCode, userId, ip, type); + + /* WeChatCustomerLink weChatCustomerLink = weChatCustomerLinkService.queryWeChatCustomerLinkByCustomerId(customerId); + if (ObjectUtils.isEmpty(weChatCustomerLink) || StringUtils.isEmpty(weChatCustomerLink.getAppletOpenId())) { + logger.error("wechatAppletPay fail due to no weChatCustomerLink or appletOpenId is null...."); + return CommonResponse.build(null, -10); + }*/ + WeChatCustomerLink weChatCustomerLink = segchkUserIndexMapper.getUserWechatOpenId(userId); + if (weChatCustomerLink!=null && ObjectUtils.isEmpty(weChatCustomerLink.getOpenId())){ + logger.error("wechatAppletPay fail due to wechat error not auth...."); + return CommonResponse.build(null, -10); + } + return weChatCommonPay( + orderCode + , providerId + , userId + , type + , WechatSetting.build(ip, WechatUtils.APPLET_PAY, "/default/user/wechatnotify").addOpenId(weChatCustomerLink.getOpenId()), (setting, orderInfo) -> { + //获取预支付信息 + PrepayResult prepayResult = WechatUtils.getPrepay(setting, orderInfo); + //微信生成预支付信息错误 + if (ObjectUtils.isEmpty(prepayResult)) { + logger.error("wechatAppletPay fail due to wechat error...."); + return CommonResponse.build(null, -5); + } + return CommonResponse.build(prepayResult, 1); + }); + } + + + /** + * 微信小程序提现 + * + * @param orderCode 订单code + * @param userId 用户id + * @param providerId 用户id + * @param ip 请求真实ip + * @param type 支付类型 1:订单支付 2:预存款充值 ---> 2用户支付,1商户支付 + * @return 返回码和支付宝支付的html 返回码说明 -1:用户不存在 -3:没有待支付的订单 -5:微信生成订单出错 -7 没有设置网站地址 -8 缺少配置 -9 没有启用 1 成功 + */ + @Override + public CommonResponse wechatAppletTransfers(String orderCode, Long userId, Long providerId, String ip, int type) { + logger.debug("wechatAppletTransfers and orderCode:{} \r\n userId:{} \r\n ip:{} \r\n:type:{}", orderCode, userId, ip, type); + + /* WeChatCustomerLink weChatCustomerLink = weChatCustomerLinkService.queryWeChatCustomerLinkByCustomerId(customerId); + if (ObjectUtils.isEmpty(weChatCustomerLink) || StringUtils.isEmpty(weChatCustomerLink.getAppletOpenId())) { + logger.error("wechatAppletPay fail due to no weChatCustomerLink or appletOpenId is null...."); + return CommonResponse.build(null, -10); + }*/ + WeChatCustomerLink weChatCustomerLink = type == 2 ? segchkUserIndexMapper.getUserWechatOpenId(userId) : + segchkStoreIndexService.selectWeChatInfoByStoreId(userId); + if (weChatCustomerLink!=null && ObjectUtils.isEmpty(weChatCustomerLink.getOpenId())){ + logger.error("wechatAppletTransfers fail due to wechat error not auth...."); + return CommonResponse.build(null, -10); + } + return weChatCommonTransfer( + orderCode + , providerId + , userId + , type + , WechatSetting.build(ip, WechatUtils.APPLET_PAY, "").addOpenId(weChatCustomerLink.getOpenId()), (setting, orderInfo) -> { + //获取预支付信息 + WxTransferResult wxTransferResult = WechatUtils.getTransfers(setting, orderInfo); + //微信生成预支付信息错误 + if (ObjectUtils.isEmpty(wxTransferResult)) { + logger.error("wechatAppletTransfers fail due to wechat error...."); + return CommonResponse.build(null, -5); + } + return CommonResponse.build(wxTransferResult, 1); + }); + } + + /** + * 构建预支付订单信息 + * + * @param transCode 交易号 + * @param money 订单金额 + * @param type 类型 1:订单支付 2:预存款充值 + */ + private OrderInfoForPay buildOrderInfoForPay(String transCode, BigDecimal money, int type) { + OrderInfoForPay orderInfoForPay = new OrderInfoForPay(); + //商品名 + orderInfoForPay.setGoodsName("用户支付"); + //订单号 + orderInfoForPay.setOrderCode(transCode); + //订单金额 + orderInfoForPay.setPrice(money); + //支付类型 + orderInfoForPay.setType(type); + return orderInfoForPay; + } + + /** + * 构建预支付订单信息 + * + * @param transCode 交易号 + * @param money 订单金额 + * @param type 类型 1:订单支付 2:预存款充值 + */ + private OrderInfoForPay buildOrderInfoForTrans(String transCode, BigDecimal money, int type) { + OrderInfoForPay orderInfoForPay = new OrderInfoForPay(); + //商品名 + orderInfoForPay.setGoodsName("用户奖励"); + //订单号 + orderInfoForPay.setOrderCode(transCode + type); + //订单金额 + orderInfoForPay.setPrice(money); + //支付类型 + orderInfoForPay.setType(type); + return orderInfoForPay; + } + + /** + * 获得付款的实体 + * + * @param chargeId 订单code + * @param userId 会员id + * @param type 类型 1 订单 2 预存款 3 门店订单 + * @return 返回付款实体 + */ + private OrderInfoForPay getOrderInfoForPay(String chargeId, Long userId, int type) { + + SegchkUserCharge segchkUserCharge = segchkUserChargeMapper.selectSegchkUserChargeByChargeId(Long.valueOf(chargeId)); + if(ObjectUtils.isEmpty(segchkUserCharge)) { + return null; + } + return buildOrderInfoForPay(chargeId, segchkUserCharge.getCharge(), type); + } + + /** + * 获得付款的实体 + * + * @param cashId 订单code + * @param userId 会员id + * @param type 类型 1 商户 2 用户 3 门店订单 + * @return 返回付款实体 + */ + private OrderInfoForPay getTransfersInfoForPay(String cashId, Long userId, int type) { + + SegchkUserCash segchkUserCash = segchkUserCashMapper.selectSegchkUserCashByCashId(Long.valueOf(cashId)); + if(ObjectUtils.isEmpty(segchkUserCash)) { + return null; + } + return buildOrderInfoForTrans(cashId, segchkUserCash.getCash(), type); + } + + /** + * 微信支付公共方法 + * + * @param orderCode 订单号 + * @param userId 用户id + * @param providerId 用户id + * @param type 支付类型 1 订单支付 2 预存充值 1商户,2用户 + * @param wechatSetting 微信设置 + * @param supplier 回调 + * @return -8 没有设置微信支付信息 -9 微信支付没启动 -7 没有配置站点信息 -1 用户不存在 -3 没有待支付订单 -5 微信生存支付信息失败 1 成功 + */ + private CommonResponse weChatCommonPay(String orderCode, Long providerId, Long userId, int type, WechatSetting wechatSetting, PaySupplier> supplier) { + + logger.debug("weChatCommonPay and orderCode:{} \r\n customerId:{} \r\n:type:{}", orderCode, userId, type); + + //微信支付设置(数据库) + WechatPaySet wechatPaySet = new WechatPaySet(); + + // 微信app、小程序支付和其他微信支付配置的信息不一样所以这边分开获取微信支付信息 +// wechatPaySet.setAppSecret(appSecrt); +// wechatPaySet.setAppId(appId); +// wechatPaySet.setIsUse("1"); + if (wechatSetting.isAppPay()) { + wechatPaySet = paySetService.queryPaySet().getWechatAppPaySet(); + } else if (wechatSetting.isAppletPay()) { + wechatPaySet = paySetService.queryPaySet().getWechatAppletPaySet(); + } else { + wechatPaySet = paySetService.queryPaySet().getWechatPaySet(); + } + + // 没设置微信支付信息 + if (ObjectUtils.isEmpty(wechatPaySet)) { + logger.error("wechatQRPay fail due to no wechatPaySet is empty...."); + return CommonResponse.build(null, -8); + } + + // 微信支付没启用 + if (!wechatPaySet.checkIsUse()) { + logger.error("wechatQRPay fail due to not used...."); + return CommonResponse.build(null, -9); + } + + // 网站基本信息 + BaseInfoSet baseInfoSet = baseInfoSetService.queryBaseInfoSet(); + + if (ObjectUtils.isEmpty(baseInfoSet) || StringUtils.isEmpty(baseInfoSet.getSiteUrlWithBias()) || StringUtils.isEmpty(baseInfoSet.getSiteName())) { + logger.error("wechatH5Pay fail due to no baseinfoset...."); + return CommonResponse.build(null, -7); + } + + // 设置网站名称和网站地址 + wechatSetting.addSiteName(baseInfoSet.getSiteName()).addSiteUrl(baseInfoSet.getSiteUrlWithBias()); + + // 设置微信支付成功后回调地址 + wechatSetting.setPayCallback(baseInfoSet.getSiteUrlWithBias() + wechatSetting.getPayCallback()); + + BeanUtils.copyProperties(wechatPaySet, wechatSetting); + logger.info("wechatSetting="+wechatSetting); + + // 检查参数 + if (!wechatSetting.checkPayParams()) { + logger.error("wechatQRPay fail due to no checkPayParams fail...."); + return CommonResponse.build(null, -8); + } + + // 查询用户信息 + Map parmMap = new HashMap<>(); + parmMap.put("userId", userId); + parmMap.put("providerId", providerId); + int usercount = segchkUserIndexMapper.userIsExit(parmMap); + + // 用户信息为空 则直接返回 + if (Objects.isNull(usercount)) { + logger.error("weChatCommonPay fail due to member is not "); + return CommonResponse.build(null, -1); + } + + // 待支付订单 + OrderInfoForPay orderInfoForPay = getOrderInfoForPay(orderCode, userId, type); + + // 没有待支付订单直接返回 + if (Objects.isNull(orderInfoForPay)) { + logger.error("weChatCommonPay fail due to no order...."); + return CommonResponse.build(null, -3); + } + + return supplier.getPayParams(wechatSetting, orderInfoForPay); + } + + /** + * 微信提现公共方法 + * + * @param cashCode 订单号 + * @param userId 用户id + * @param providerId 用户id + * @param type 支付类型 1 订单支付 2 预存充值 1商户,2用户 + * @param wechatSetting 微信设置 + * @param supplier 回调 + * @return -8 没有设置微信支付信息 -9 微信支付没启动 -7 没有配置站点信息 -1 用户不存在 -3 没有待支付订单 -5 微信生存支付信息失败 1 成功 + */ + private CommonResponse weChatCommonTransfer(String cashCode, Long providerId, Long userId, int type, WechatSetting wechatSetting, PaySupplier> supplier) { + + logger.debug("weChatCommonTransfer and orderCode:{} \r\n customerId:{} \r\n:type:{}", cashCode, userId, type); + + //微信支付设置(数据库) + WechatPaySet wechatPaySet = new WechatPaySet(); + + // 微信app、小程序支付和其他微信支付配置的信息不一样所以这边分开获取微信支付信息 +// wechatPaySet.setAppSecret(appSecrt); +// wechatPaySet.setAppId(appId); +// wechatPaySet.setIsUse("1"); + if (wechatSetting.isAppPay()) { + wechatPaySet = paySetService.queryPaySet().getWechatAppPaySet(); + } else if (wechatSetting.isAppletPay()) { + wechatPaySet = paySetService.queryPaySet().getWechatAppletPaySet(); + } else { + wechatPaySet = paySetService.queryPaySet().getWechatPaySet(); + } + + // 没设置微信支付信息 + if (ObjectUtils.isEmpty(wechatPaySet)) { + logger.error("weChatCommonTransfer fail due to no wechatPaySet is empty...."); + return CommonResponse.build(null, -8); + } + + // 微信支付没启用 + if (!wechatPaySet.checkIsUse()) { + logger.error("weChatCommonTransfer fail due to not used...."); + return CommonResponse.build(null, -9); + } + + BeanUtils.copyProperties(wechatPaySet, wechatSetting); + logger.info("wechatSetting="+wechatSetting); + + // 检查参数 + if (!wechatSetting.checkPayParams()) { + logger.error("weChatCommonTransfer fail due to no checkPayParams fail...."); + return CommonResponse.build(null, -8); + } + + // 待支付订单 + OrderInfoForPay orderInfoForPay = getTransfersInfoForPay(cashCode, userId, type); + + // 没有待支付订单直接返回 + if (Objects.isNull(orderInfoForPay)) { + logger.error("weChatCommonTransfer fail due to no order...."); + return CommonResponse.build(null, -11); + } + + return supplier.getPayParams(wechatSetting, orderInfoForPay); + } + + @Override + public int weChatAppletNotify(InputStream inputStream) { + logger.debug("weChatAppletNotify...... "); + return weChatCommonNotify(inputStream, paySetService.queryPaySet().getWechatAppletPaySet()); + } + + + + /** + * 微信支付回调 + * + * @param inputStream 微信输入流 + * @param wechatPaySet 微信设置 + * @return 返回 0失败,大于0成功 + */ + private int weChatCommonNotify(InputStream inputStream, WechatPaySet wechatPaySet) { + logger.debug("weChatCommonNotifya and wechatPaySet:{}", wechatPaySet); + WechatSetting wechatSetting = new WechatSetting(); + BeanUtils.copyProperties(wechatPaySet, wechatSetting); + if (StringUtils.isEmpty(wechatPaySet.getAppId()) || StringUtils.isEmpty(wechatPaySet.getMerchantNum())) { + logger.error("weChatNotify fail due to no checkPayParams fail...."); + return -2; + } + OrderInfoAfterPay orderInfoAfterPay = WechatUtils.afterPayInfo(inputStream, wechatSetting); +// String chargeId = orderInfoAfterPay.getTransCode().substring(0, orderInfoAfterPay.getTransCode().length() - 1); + if (!orderInfoAfterPay.isSuccess()) { + logger.error("weChatNotify fail due to notify fail...."); + + chargeRet(orderInfoAfterPay.getOrderCode(), 1); + return -3; + } + chargeRet(orderInfoAfterPay.getOrderCode(), 0); + return 0; +// return paySuccess(orderInfoAfterPay.getOrderCode(), CommonConstant.QUERY_WITH_NO_CUSTOMER, orderInfoAfterPay.getType(), CommonConstant.WECHAT_PAY, orderInfoAfterPay.getTransCode()); + } + + /** + * 支付成功后的操作 + * + * @param orderCode 订单code + * @param customerId 用户id + * @param type 1:订单支付 2 预存款充值 + * @param channel 支付方式,预存款充值使用 + * @param transCode 交易流水号 + * @return 0失败,大于0成功 + */ + /*private int paySuccess(String orderCode, long customerId, int type, String channel, String transCode) { + logger.debug("paySuccess and orderCode:{} \r\n customerId:{} \r\n type:{} \r\n transCode:{}", orderCode, customerId, type, transCode); + //订单支付 + if (CommonConstant.ORDER_PAY == type) { + // 根据订单编号和用户id查询待付款的订单信息 + List orders = orderService.queryOrderByOrderCode(orderCode, customerId); + // 没有待支付的订单 则直接返回 + if (CollectionUtils.isEmpty(orders)) { + logger.error("paySuccess fail due to no order...."); + return -1; + } + // 修改订单状态 + return orderServiceApi.confirmOrderPayed(ConfirmOrderParams.buildCustomerSource(customerId, 0, orders.stream().map(OmsOrder::getOrderCode).collect(Collectors.toList()), transCode, channel)); + } else if (CommonConstant.RECHARGE_PAY == type) { + //预存款充值 + return predepositRecordServiceApi.updateStatusSuccessByTransCode(orderCode, CommonConstant.QUERY_WITH_NO_CUSTOMER, channel, transCode); + } else { + // 根据订单编号和用户id查询待付款的门店订单信息 + List storeOrders = storeOrderService.queryOrderByOrderCode(orderCode, customerId); + + if (CollectionUtils.isEmpty(storeOrders)) { + logger.error("paySuccess fail due to no order...."); + return -1; + } + + return storeOrderServiceApi.confirmOrderPayed(customerId, storeOrders.stream().map(TStoreOrder::getOrderCode).collect(Collectors.toList()), "0", transCode, channel); + } + + }*/ + + +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/segchk/service/impl/SegchkUserLikegoServiceImpl.java b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/service/impl/SegchkUserLikegoServiceImpl.java new file mode 100644 index 0000000..5c78c47 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/service/impl/SegchkUserLikegoServiceImpl.java @@ -0,0 +1,96 @@ +package com.ruoyi.segchk.service.impl; + +import com.ruoyi.segchk.domain.SegchkUserLikego; +import com.ruoyi.segchk.mapper.SegchkUserLikegoMapper; +import com.ruoyi.segchk.service.ISegchkUserLikegoService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * seg用户想去记录Service业务层处理 + * + * @author yinzhiying + * @date 2021-08-23 + */ +@Service +public class SegchkUserLikegoServiceImpl implements ISegchkUserLikegoService +{ + @Autowired + private SegchkUserLikegoMapper segchkUserLikegoMapper; + + /** + * 查询seg用户想去记录 + * + * @param likegoId seg用户想去记录主键 + * @return seg用户想去记录 + */ + @Override + public SegchkUserLikego selectSegchkUserLikegoByLikegoId(Long likegoId) + { + return segchkUserLikegoMapper.selectSegchkUserLikegoByLikegoId(likegoId); + } + + /** + * 查询seg用户想去记录列表 + * + * @param segchkUserLikego seg用户想去记录 + * @return seg用户想去记录 + */ + @Override + public List selectSegchkUserLikegoList(SegchkUserLikego segchkUserLikego) + { + return segchkUserLikegoMapper.selectSegchkUserLikegoList(segchkUserLikego); + } + + /** + * 新增seg用户想去记录 + * + * @param segchkUserLikego seg用户想去记录 + * @return 结果 + */ + @Override + public int insertSegchkUserLikego(SegchkUserLikego segchkUserLikego) + { + // 此处根据用户id,卡id,卡类型,卡标签,商户id,及运营商id,生成预约二维码 + segchkUserLikego.setQrCode(String.format("qrcode-%s-%s-%s-%s-%s", segchkUserLikego.getProviderId(), segchkUserLikego.getStoreId(), segchkUserLikego.getUserId(), segchkUserLikego.getCardId(), segchkUserLikego.getCardType())); + return segchkUserLikegoMapper.insertSegchkUserLikego(segchkUserLikego); + } + + /** + * 修改seg用户想去记录 + * + * @param segchkUserLikego seg用户想去记录 + * @return 结果 + */ + @Override + public int updateSegchkUserLikego(SegchkUserLikego segchkUserLikego) + { + return segchkUserLikegoMapper.updateSegchkUserLikego(segchkUserLikego); + } + + /** + * 批量删除seg用户想去记录 + * + * @param likegoIds 需要删除的seg用户想去记录主键 + * @return 结果 + */ + @Override + public int deleteSegchkUserLikegoByLikegoIds(Long[] likegoIds) + { + return segchkUserLikegoMapper.deleteSegchkUserLikegoByLikegoIds(likegoIds); + } + + /** + * 删除seg用户想去记录信息 + * + * @param likegoId seg用户想去记录主键 + * @return 结果 + */ + @Override + public int deleteSegchkUserLikegoByLikegoId(Long likegoId) + { + return segchkUserLikegoMapper.deleteSegchkUserLikegoByLikegoId(likegoId); + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/segchk/service/impl/SegchkUserWechatServiceImpl.java b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/service/impl/SegchkUserWechatServiceImpl.java new file mode 100644 index 0000000..25eaa10 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/segchk/service/impl/SegchkUserWechatServiceImpl.java @@ -0,0 +1,94 @@ +package com.ruoyi.segchk.service.impl; + +import com.ruoyi.segchk.domain.SegchkUserWechat; +import com.ruoyi.segchk.mapper.SegchkUserWechatMapper; +import com.ruoyi.segchk.service.ISegchkUserWechatService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * seg用户微信信息Service业务层处理 + * + * @author yinzhiying + * @date 2021-08-23 + */ +@Service +public class SegchkUserWechatServiceImpl implements ISegchkUserWechatService +{ + @Autowired + private SegchkUserWechatMapper segchkUserWechatMapper; + + /** + * 查询seg用户微信信息 + * + * @param userId seg用户微信信息主键 + * @return seg用户微信信息 + */ + @Override + public SegchkUserWechat selectSegchkUserWechatByUserId(Long userId) + { + return segchkUserWechatMapper.selectSegchkUserWechatByUserId(userId); + } + + /** + * 查询seg用户微信信息列表 + * + * @param segchkUserWechat seg用户微信信息 + * @return seg用户微信信息 + */ + @Override + public List selectSegchkUserWechatList(SegchkUserWechat segchkUserWechat) + { + return segchkUserWechatMapper.selectSegchkUserWechatList(segchkUserWechat); + } + + /** + * 新增seg用户微信信息 + * + * @param segchkUserWechat seg用户微信信息 + * @return 结果 + */ + @Override + public int insertSegchkUserWechat(SegchkUserWechat segchkUserWechat) + { + return segchkUserWechatMapper.insertSegchkUserWechat(segchkUserWechat); + } + + /** + * 修改seg用户微信信息 + * + * @param segchkUserWechat seg用户微信信息 + * @return 结果 + */ + @Override + public int updateSegchkUserWechat(SegchkUserWechat segchkUserWechat) + { + return segchkUserWechatMapper.updateSegchkUserWechat(segchkUserWechat); + } + + /** + * 批量删除seg用户微信信息 + * + * @param userIds 需要删除的seg用户微信信息主键 + * @return 结果 + */ + @Override + public int deleteSegchkUserWechatByUserIds(Long[] userIds) + { + return segchkUserWechatMapper.deleteSegchkUserWechatByUserIds(userIds); + } + + /** + * 删除seg用户微信信息信息 + * + * @param userId seg用户微信信息主键 + * @return 结果 + */ + @Override + public int deleteSegchkUserWechatByUserId(Long userId) + { + return segchkUserWechatMapper.deleteSegchkUserWechatByUserId(userId); + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/setting/bean/AliPaySet.java b/ruoyi-segchk/src/main/java/com/ruoyi/setting/bean/AliPaySet.java new file mode 100644 index 0000000..246ca7a --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/setting/bean/AliPaySet.java @@ -0,0 +1,83 @@ +package com.ruoyi.setting.bean; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.springframework.util.StringUtils; + +/** + * 支付设置接口-支付宝支付接口设置实体类 + * + * @author 魔金商城 on 2017/5/17. + */ + +public class AliPaySet { + /** + * appid + */ + + private String appId; + /** + * 开发者私钥,由开发者自己生成 + */ + + private String appPrivateKey; + /** + * 支付宝公钥,由支付宝生成 + */ + + private String alipayPublicKey; + /** + * 是否启用 1启用 0不启用 + */ + + private String isUse; + + /** + * 清理敏感信息 + */ + public void clearSensitiveInfo() { + this.appId = ""; + this.appPrivateKey = ""; + this.alipayPublicKey = ""; + } + + + public String getAppId() { + return appId; + } + + public void setAppId(String appId) { + this.appId = appId; + } + + public String getAppPrivateKey() { + return appPrivateKey; + } + + public void setAppPrivateKey(String appPrivateKey) { + this.appPrivateKey = appPrivateKey; + } + + public String getAlipayPublicKey() { + return alipayPublicKey; + } + + public void setAlipayPublicKey(String alipayPublicKey) { + this.alipayPublicKey = alipayPublicKey; + } + + public String getIsUse() { + return isUse; + } + + public void setIsUse(String isUse) { + this.isUse = isUse; + } + + /** + * 检测是否启用 true 启用,反之不启用 + */ + @JsonIgnore + public boolean checkIsUse() { + return StringUtils.isEmpty(isUse) || "1".equals(isUse); + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/setting/bean/BaseInfoSet.java b/ruoyi-segchk/src/main/java/com/ruoyi/setting/bean/BaseInfoSet.java new file mode 100644 index 0000000..a40be1c --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/setting/bean/BaseInfoSet.java @@ -0,0 +1,327 @@ +package com.ruoyi.setting.bean; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.springframework.util.StringUtils; + +import java.io.Serializable; + +/** + * 基本信息设置实体类 + * + * @author 魔金商城 on 2017/5/17. + */ + +public class BaseInfoSet implements Serializable { + + /** + * 序列化id + */ + private static final long serialVersionUID = 1L; + /** + * 主键id + */ + private long id; + /** + * 前端地址 + */ + private String siteUrl; + /** + * 网站名称 + */ + private String siteName; + /** + * 网站LOGO(前端搜索页旁边和店铺登陆页) + */ + private String logo; + /** + * pc端,admin端,store端标签图片 + */ + private String labelLog; + /** + * pc端登录背景图片 + */ + private String siteLoginPic; + /** + * pc端注册背景图片 + */ + private String siteRegisterPic; + /** + * 店铺端登录图片 + */ + private String storeLoginPic; + /** + * 店铺端注册图片 + */ + private String storeRegisterPic; + /** + * 后台版权信息(admin和store底部) + */ + private String copyrightInfo; + /** + * 注册协议(pc端) + */ + private String siteRegisterProtocol; + /** + * 店铺端注册协议 + */ + private String storeRegisterProtocol; + /** + * 开店协议 + */ + private String storeOpenProtocol; + /** + * 联系电话 + */ + private String phone; + /** + * admin端登录logo + */ + private String adminLogo; + /** + * admin端首页logo + */ + private String adminIndexLogo; + /** + * 是否开启验证码 0 开启 1 不开启 默认0 + */ + private String captchaOpen; + /** + * 店铺商品审核开关 0 需要审核 1 不需要 默认0 + */ + private String storeSpuAudit; + /** + * 会员等级启用状态 0 启用 1 不启用 默认0 + */ + private String memberPriceStatus; + /** + * 众筹协议 + */ + private String crowdFundingProtocol; + /** + * h5域名 + */ + private String h5CallBackDomain; + /** + * 前端地址 + */ + private String pcCallBackDomain; + + public BaseInfoSet() { + } + + /** + * 判断会员价是否启用 + * + * @return 启用返回true, 否则返回false + */ + @JsonIgnore + public boolean isMemberPriceOpen() { + return "0".equals(this.memberPriceStatus); + } + + /** + * 判断店铺商品是否需要审核 + * + * @return 需要返回true 不需要返回false + */ + @JsonIgnore + public boolean isSpuNeedAudit() { + return "0".equals(this.storeSpuAudit); + } + + /** + * 处理图片地址 + */ + public void dealPicUrl() { + if (!StringUtils.isEmpty(labelLog) && labelLog.contains(":")) { + labelLog = labelLog.substring(labelLog.indexOf(":") + 1); + } + } + + /** + * 返回网站地址,末端加 "/" + */ + public String getSiteUrlWithBias() { + if (StringUtils.isEmpty(this.siteUrl)) { + return null; + } + return this.siteUrl.endsWith("/") ? this.siteUrl : this.siteUrl + "/"; + } + + + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + public String getSiteUrl() { + return siteUrl; + } + + public void setSiteUrl(String siteUrl) { + this.siteUrl = siteUrl; + } + + public String getSiteName() { + return siteName; + } + + public void setSiteName(String siteName) { + this.siteName = siteName; + } + + public String getLogo() { + return logo; + } + + public void setLogo(String logo) { + this.logo = logo; + } + + public String getLabelLog() { + return labelLog; + } + + public void setLabelLog(String labelLog) { + this.labelLog = labelLog; + } + + public String getSiteLoginPic() { + return siteLoginPic; + } + + public void setSiteLoginPic(String siteLoginPic) { + this.siteLoginPic = siteLoginPic; + } + + public String getSiteRegisterPic() { + return siteRegisterPic; + } + + public void setSiteRegisterPic(String siteRegisterPic) { + this.siteRegisterPic = siteRegisterPic; + } + + public String getStoreLoginPic() { + return storeLoginPic; + } + + public void setStoreLoginPic(String storeLoginPic) { + this.storeLoginPic = storeLoginPic; + } + + public String getStoreRegisterPic() { + return storeRegisterPic; + } + + public void setStoreRegisterPic(String storeRegisterPic) { + this.storeRegisterPic = storeRegisterPic; + } + + public String getCopyrightInfo() { + return copyrightInfo; + } + + public void setCopyrightInfo(String copyrightInfo) { + this.copyrightInfo = copyrightInfo; + } + + public String getSiteRegisterProtocol() { + return siteRegisterProtocol; + } + + public void setSiteRegisterProtocol(String siteRegisterProtocol) { + this.siteRegisterProtocol = siteRegisterProtocol; + } + + public String getStoreRegisterProtocol() { + return storeRegisterProtocol; + } + + public void setStoreRegisterProtocol(String storeRegisterProtocol) { + this.storeRegisterProtocol = storeRegisterProtocol; + } + + public String getStoreOpenProtocol() { + return storeOpenProtocol; + } + + public void setStoreOpenProtocol(String storeOpenProtocol) { + this.storeOpenProtocol = storeOpenProtocol; + } + + public String getPhone() { + return phone; + } + + public void setPhone(String phone) { + this.phone = phone; + } + + public String getAdminLogo() { + return adminLogo; + } + + public void setAdminLogo(String adminLogo) { + this.adminLogo = adminLogo; + } + + public String getAdminIndexLogo() { + return adminIndexLogo; + } + + public void setAdminIndexLogo(String adminIndexLogo) { + this.adminIndexLogo = adminIndexLogo; + } + + public String getCaptchaOpen() { + return captchaOpen; + } + + public void setCaptchaOpen(String captchaOpen) { + this.captchaOpen = captchaOpen; + } + + public String getStoreSpuAudit() { + return storeSpuAudit; + } + + public void setStoreSpuAudit(String storeSpuAudit) { + this.storeSpuAudit = storeSpuAudit; + } + + public String getMemberPriceStatus() { + return memberPriceStatus; + } + + public void setMemberPriceStatus(String memberPriceStatus) { + this.memberPriceStatus = memberPriceStatus; + } + + public String getCrowdFundingProtocol() { + return crowdFundingProtocol; + } + + public void setCrowdFundingProtocol(String crowdFundingProtocol) { + this.crowdFundingProtocol = crowdFundingProtocol; + } + + public String getH5CallBackDomain() { + return h5CallBackDomain; + } + + public void setH5CallBackDomain(String h5CallBackDomain) { + this.h5CallBackDomain = h5CallBackDomain; + } + + public String getPcCallBackDomain() { + return pcCallBackDomain; + } + + public void setPcCallBackDomain(String pcCallBackDomain) { + this.pcCallBackDomain = pcCallBackDomain; + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/setting/bean/OssSetting.java b/ruoyi-segchk/src/main/java/com/ruoyi/setting/bean/OssSetting.java new file mode 100644 index 0000000..225a16a --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/setting/bean/OssSetting.java @@ -0,0 +1,136 @@ +package com.ruoyi.setting.bean; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.ruoyi.util.bean.OssYunConf; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + * Created by luozhuo on 20/7/7. + * 云存储配置类 + */ +@ApiModel(description = "云存储配置实体") +public class OssSetting { + + /** + * 主键id + */ + @ApiModelProperty(value = "主键id") + private Long id; + + /** + * 域名 + */ + @ApiModelProperty(value = "域名") + private String address; + + /** + * 授权ID + */ + @ApiModelProperty(value = "授权ID") + private String accessKeyId; + + /** + * 授权密钥 + */ + @ApiModelProperty(value = "授权密钥") + private String accessKeySecret; + + /** + * 桶名 + */ + @ApiModelProperty(value = "桶名") + private String bucketName; + + /** + * 节点名 + */ + @ApiModelProperty(value = "节点名") + private String endPoint; + + /** + * 样式 + */ + @ApiModelProperty(value = "样式") + private String styleName; + + /** + * 前缀 + */ + @ApiModelProperty(value = "前缀") + private String prefix; + + /** + * 获得阿里云的配置 + * + * @return 返回阿里云配置 + */ + @JsonIgnore + public OssYunConf getUpYunConf() { + return OssYunConf.buildOssYunConf(this.accessKeyId, this.accessKeySecret, this.bucketName, this.endPoint, this.styleName, this.prefix, this.address); + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address; + } + + public String getAccessKeyId() { + return accessKeyId; + } + + public void setAccessKeyId(String accessKeyId) { + this.accessKeyId = accessKeyId; + } + + public String getAccessKeySecret() { + return accessKeySecret; + } + + public void setAccessKeySecret(String accessKeySecret) { + this.accessKeySecret = accessKeySecret; + } + + public String getBucketName() { + return bucketName; + } + + public void setBucketName(String bucketName) { + this.bucketName = bucketName; + } + + public String getEndPoint() { + return endPoint; + } + + public void setEndPoint(String endPoint) { + this.endPoint = endPoint; + } + + public String getStyleName() { + return styleName; + } + + public void setStyleName(String styleName) { + this.styleName = styleName; + } + + public String getPrefix() { + return prefix; + } + + public void setPrefix(String prefix) { + this.prefix = prefix; + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/setting/bean/PaySet.java b/ruoyi-segchk/src/main/java/com/ruoyi/setting/bean/PaySet.java new file mode 100644 index 0000000..bbfa9b8 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/setting/bean/PaySet.java @@ -0,0 +1,75 @@ +package com.ruoyi.setting.bean; + + +/** + * 支付接口设置数据库映射类 + * + * @author 魔金商城 on 2017/5/17. + */ + +public class PaySet { + /** + * 主键id + */ + private long id; + /** + * 支付方式 1:支付宝 2:微信 3:银联 4:预存款 5:微信APP支付 6:微信小程序支付 + */ + private String codeType; + /** + * 字段名称 + */ + private String columnName; + /** + * 字段值 + */ + private String columnValue; + + /** + * 组装数据-用于向数据库插入数据 + * + * @param paySet 数据库映射对象 + * @param codeType 支付设置类型 1:支付宝 2:微信 3:银联 4:预存款 5:微信APP支付 6:微信小程序支付 + * @param columnValue 字段的值 + * @param columnName 字段名称 + * @return paySet对象 + */ + public static PaySet getPaySet(PaySet paySet, String codeType, String columnValue, String columnName) { + paySet.setCodeType(codeType); + paySet.setColumnName(columnName); + paySet.setColumnValue(columnValue); + return paySet; + } + + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + public String getCodeType() { + return codeType; + } + + public void setCodeType(String codeType) { + this.codeType = codeType; + } + + public String getColumnName() { + return columnName; + } + + public void setColumnName(String columnName) { + this.columnName = columnName; + } + + public String getColumnValue() { + return columnValue; + } + + public void setColumnValue(String columnValue) { + this.columnValue = columnValue; + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/setting/bean/PaySetCommon.java b/ruoyi-segchk/src/main/java/com/ruoyi/setting/bean/PaySetCommon.java new file mode 100644 index 0000000..7e5db7e --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/setting/bean/PaySetCommon.java @@ -0,0 +1,229 @@ +package com.ruoyi.setting.bean; + + +import java.util.List; +import java.util.Objects; + +/** + * 支付设置统一类 + * + * @author 魔金商城 on 2017/5/17. + */ + +public class PaySetCommon { + + /** + * 阿里支付 + */ + private AliPaySet aliPaySet = new AliPaySet(); + /** + * 微信支付(公众号、扫码、H5) + */ + + private WechatPaySet wechatPaySet = new WechatPaySet(); + /** + * 微信支付(app) + */ + + private WechatPaySet wechatAppPaySet = new WechatPaySet(); + + /** + * 微信支付(小程序支付) + */ + + private WechatPaySet wechatAppletPaySet = new WechatPaySet(); + + /** + * 银联支付 + */ + private UnionPaySet unionPaySet = new UnionPaySet(); + + /** + * 预存款支付 + */ + private PrePaySet prePaySet = new PrePaySet(); + + /** + * 用于组装支付设置对象在前端显示 + * + * @param paySetCommon 支付设置对象 + * @param paySets 数据库映射对象 + * @return 支付设置对象 + */ + public static PaySetCommon getPaySetCommon(PaySetCommon paySetCommon, List paySets) { + paySets.forEach(paySet -> { + String value = paySet.getColumnValue(); + //支付宝 + if ("1".equals(paySet.getCodeType())) { + if ("appId".equals(paySet.getColumnName())) { + paySetCommon.aliPaySet.setAppId(value); + } + if ("alipayPublicKey".equals(paySet.getColumnName())) { + paySetCommon.aliPaySet.setAlipayPublicKey(value); + } + if ("appPrivateKey".equals(paySet.getColumnName())) { + paySetCommon.aliPaySet.setAppPrivateKey(value); + } + if ("isUse".equals(paySet.getColumnName())) { + paySetCommon.aliPaySet.setIsUse(value); + } + } + //微信(公众号、扫码、H5) + if ("2".equals(paySet.getCodeType())) { + if ("appId".equals(paySet.getColumnName())) { + paySetCommon.wechatPaySet.setAppId(value); + } + if ("appSecret".equals(paySet.getColumnName())) { + paySetCommon.wechatPaySet.setAppSecret(value); + } + if ("merchantNum".equals(paySet.getColumnName())) { + paySetCommon.wechatPaySet.setMerchantNum(value); + } + if ("apiKey".equals(paySet.getColumnName())) { + paySetCommon.wechatPaySet.setApiKey(value); + } + if ("loginNotice".equals(paySet.getColumnName())) { + paySetCommon.wechatPaySet.setLoginNotice(value); + } + if ("isUse".equals(paySet.getColumnName())) { + paySetCommon.wechatPaySet.setIsUse(value); + } + } + //银联 + if ("3".equals(paySet.getCodeType())) { + if ("merchantNum".equals(paySet.getColumnName())) { + paySetCommon.unionPaySet.setMerchantNum(value); + } + if ("apiKey".equals(paySet.getColumnName())) { + paySetCommon.unionPaySet.setApiKey(value); + } + + if ("isUse".equals(paySet.getColumnName())) { + paySetCommon.unionPaySet.setIsUse(value); + } + } + //预存款 + if ("4".equals(paySet.getCodeType())) { + if ("isUse".equals(paySet.getColumnName())) { + paySetCommon.prePaySet.setIsUse(value); + } + } + //微信支付(app) + if ("5".equals(paySet.getCodeType())) { + if ("appId".equals(paySet.getColumnName())) { + paySetCommon.wechatAppPaySet.setAppId(value); + } + if ("appSecret".equals(paySet.getColumnName())) { + paySetCommon.wechatAppPaySet.setAppSecret(value); + } + if ("merchantNum".equals(paySet.getColumnName())) { + paySetCommon.wechatAppPaySet.setMerchantNum(value); + } + if ("apiKey".equals(paySet.getColumnName())) { + paySetCommon.wechatAppPaySet.setApiKey(value); + } + if ("isUse".equals(paySet.getColumnName())) { + paySetCommon.wechatAppPaySet.setIsUse(value); + } + } + + //微信支付(小程序) + if ("6".equals(paySet.getCodeType())) { + if ("appId".equals(paySet.getColumnName())) { + paySetCommon.wechatAppletPaySet.setAppId(value); + } + if ("appSecret".equals(paySet.getColumnName())) { + paySetCommon.wechatAppletPaySet.setAppSecret(value); + } + if ("merchantNum".equals(paySet.getColumnName())) { + paySetCommon.wechatAppletPaySet.setMerchantNum(value); + } + if ("apiKey".equals(paySet.getColumnName())) { + paySetCommon.wechatAppletPaySet.setApiKey(value); + } + if ("isUse".equals(paySet.getColumnName())) { + paySetCommon.wechatAppletPaySet.setIsUse(value); + } + } + }); + return paySetCommon; + } + + /** + * 清除敏感 信息 + * + * @return 返回当前对象 + */ + public PaySetCommon clearSensitiveInfo() { + + if (Objects.nonNull(this.wechatPaySet)) { + wechatPaySet.clearSensitiveInfo(); + } + + if (Objects.nonNull(this.wechatAppPaySet)) { + wechatAppPaySet.clearSensitiveInfo(); + } + + if (Objects.nonNull(this.wechatAppletPaySet)) { + wechatAppletPaySet.clearSensitiveInfo(); + } + + if (Objects.nonNull(this.aliPaySet)) { + aliPaySet.clearSensitiveInfo(); + } + + + if (Objects.nonNull(this.unionPaySet)) { + unionPaySet.clearSensitiveInfo(); + } + return this; + } + + public AliPaySet getAliPaySet() { + return aliPaySet; + } + + public void setAliPaySet(AliPaySet aliPaySet) { + this.aliPaySet = aliPaySet; + } + + public WechatPaySet getWechatPaySet() { + return wechatPaySet; + } + + public void setWechatPaySet(WechatPaySet wechatPaySet) { + this.wechatPaySet = wechatPaySet; + } + + public WechatPaySet getWechatAppPaySet() { + return wechatAppPaySet; + } + + public void setWechatAppPaySet(WechatPaySet wechatAppPaySet) { + this.wechatAppPaySet = wechatAppPaySet; + } + + public WechatPaySet getWechatAppletPaySet() { + return wechatAppletPaySet; + } + + public void setWechatAppletPaySet(WechatPaySet wechatAppletPaySet) { + this.wechatAppletPaySet = wechatAppletPaySet; + } + + public UnionPaySet getUnionPaySet() { + return unionPaySet; + } + + public void setUnionPaySet(UnionPaySet unionPaySet) { + this.unionPaySet = unionPaySet; + } + + public PrePaySet getPrePaySet() { + return prePaySet; + } + + public void setPrePaySet(PrePaySet prePaySet) { + this.prePaySet = prePaySet; + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/setting/bean/PrePaySet.java b/ruoyi-segchk/src/main/java/com/ruoyi/setting/bean/PrePaySet.java new file mode 100644 index 0000000..50d868b --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/setting/bean/PrePaySet.java @@ -0,0 +1,33 @@ +package com.ruoyi.setting.bean; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.springframework.util.StringUtils; + +/** + * 预支付设置 + */ + +public class PrePaySet { + + /** + * 是否启用 1启用 0不启用 + */ + + private String isUse; + + public String getIsUse() { + return isUse; + } + + public void setIsUse(String isUse) { + this.isUse = isUse; + } + + /** + * 检测是否启用 true 启用,反之不启用 + */ + @JsonIgnore + public boolean checkIsUse() { + return StringUtils.isEmpty(isUse) || "1".equals(isUse); + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/setting/bean/UnionPaySet.java b/ruoyi-segchk/src/main/java/com/ruoyi/setting/bean/UnionPaySet.java new file mode 100644 index 0000000..896558b --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/setting/bean/UnionPaySet.java @@ -0,0 +1,68 @@ +package com.ruoyi.setting.bean; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.springframework.util.StringUtils; + +/** + * 支付设置接口-银联支付接口设置实体类 + * + * @author 魔金商城 on 2017/5/17. + */ + +public class UnionPaySet { + /** + * 商户号 + */ + private String merchantNum; + /** + * API-KEY + */ + private String apiKey; + /** + * 是否启用 1启用 0不启用 + */ + + private String isUse; + + public String getMerchantNum() { + return merchantNum; + } + + public void setMerchantNum(String merchantNum) { + this.merchantNum = merchantNum; + } + + public String getApiKey() { + return apiKey; + } + + public void setApiKey(String apiKey) { + this.apiKey = apiKey; + } + + public String getIsUse() { + return isUse; + } + + public void setIsUse(String isUse) { + this.isUse = isUse; + } + + /** + * 清理敏感信息 + */ + public void clearSensitiveInfo() { + this.merchantNum = ""; + this.apiKey = ""; + } + + + /** + * 检测是否启用 true 启用,反之不启用 + */ + @JsonIgnore + public boolean checkIsUse() { + return StringUtils.isEmpty(isUse) || "1".equals(isUse); + } + +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/setting/bean/UploadData.java b/ruoyi-segchk/src/main/java/com/ruoyi/setting/bean/UploadData.java new file mode 100644 index 0000000..cb46369 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/setting/bean/UploadData.java @@ -0,0 +1,91 @@ +package com.ruoyi.setting.bean; + +import org.springframework.web.multipart.MultipartFile; + +import java.io.InputStream; + +/** + * 上传对象实体类 + */ +public class UploadData { + + MultipartFile multipartFile; + /** + * 输入流 + */ + private InputStream inputStream; + + /** + * 数据 + */ + private byte[] datas; + + + /** + * 用户上传的文件名 + */ + private String fileOriginName; + + /** + * 上传的类型 0 图片 1 视频 + */ + private String type; + + + /** + * 构造上传对象 + * + * @param inputStream 输入流 + * @param datas 数据 + * @return 返回上传对象 + */ + public static UploadData build(InputStream inputStream, byte[] datas, String fileOriginName, String type, MultipartFile multipartFile) { + UploadData uploadData = new UploadData(); + uploadData.inputStream = inputStream; + uploadData.datas = datas; + uploadData.fileOriginName = fileOriginName; + uploadData.type = type; + uploadData.multipartFile = multipartFile; + return uploadData; + } + + public MultipartFile getMultipartFile() { + return multipartFile; + } + + public void setMultipartFile(MultipartFile multipartFile) { + this.multipartFile = multipartFile; + } + + public InputStream getInputStream() { + return inputStream; + } + + public void setInputStream(InputStream inputStream) { + this.inputStream = inputStream; + } + + public byte[] getDatas() { + return datas; + } + + public void setDatas(byte[] datas) { + this.datas = datas; + } + + public String getFileOriginName() { + return fileOriginName; + } + + public void setFileOriginName(String fileOriginName) { + this.fileOriginName = fileOriginName; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/setting/bean/WechatPaySet.java b/ruoyi-segchk/src/main/java/com/ruoyi/setting/bean/WechatPaySet.java new file mode 100644 index 0000000..056cbdd --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/setting/bean/WechatPaySet.java @@ -0,0 +1,111 @@ +package com.ruoyi.setting.bean; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.springframework.util.StringUtils; + +/** + * 支付设置接口-微信支付接口设置实体类 + * + * @author 魔金商城 on 2017/5/17. + */ + +public class WechatPaySet { + /** + * 公众号appId + */ + + private String appId; + /** + * AppSecret + */ + + private String appSecret; + /** + * 商户号 + */ + + private String merchantNum; + + /** + * API密钥 + */ + + private String apiKey; + + /** + * 微信公众号 登录回调地址 + */ + private String loginNotice; + + /** + * 是否启用 1启用 0不启用 + */ + + private String isUse; + + /** + * 清理敏感信息 + */ + public void clearSensitiveInfo() { + this.appId = ""; + this.appSecret = ""; + this.merchantNum = ""; + this.apiKey = ""; + } + + public String getLoginNotice() { + return loginNotice; + } + + public void setLoginNotice(String loginNotice) { + this.loginNotice = loginNotice; + } + + public String getAppId() { + return appId; + } + + public void setAppId(String appId) { + this.appId = appId; + } + + public String getAppSecret() { + return appSecret; + } + + public void setAppSecret(String appSecret) { + this.appSecret = appSecret; + } + + public String getMerchantNum() { + return merchantNum; + } + + public void setMerchantNum(String merchantNum) { + this.merchantNum = merchantNum; + } + + public String getApiKey() { + return apiKey; + } + + public void setApiKey(String apiKey) { + this.apiKey = apiKey; + } + + public String getIsUse() { + return isUse; + } + + public void setIsUse(String isUse) { + this.isUse = isUse; + } + + /** + * 检测是否启用 true 启用,反之不启用 + */ + @JsonIgnore + public boolean checkIsUse() { + return StringUtils.isEmpty(isUse) || "1".equals(isUse); + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/setting/domain/LsCity.java b/ruoyi-segchk/src/main/java/com/ruoyi/setting/domain/LsCity.java new file mode 100644 index 0000000..5144aca --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/setting/domain/LsCity.java @@ -0,0 +1,158 @@ +package com.ruoyi.setting.domain; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; +import io.swagger.annotations.ApiModelProperty; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +import java.util.Date; +import java.util.List; + +/** + * 区域市对象 ls_city + * + * @author 魔金商城 + * @date 2020-07-29 + */ +public class LsCity extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * 主键id + */ + private Long id; + + /** + * 市的名称 + */ + @Excel(name = "市的名称") + private String name; + + /** + * 该市所属的省份id 对应ls_province 中的id + */ + @Excel(name = "该市所属的省份id 对应ls_province 中的id") + private Long provinceId; + + /** + * 排序 数值越小 排序越前 + */ + @Excel(name = "排序 数值越小 排序越前") + private Long sort; + + /** + * 删除标记 0未删除 1删除 默认0 + */ + private int delFlag; + + /** + * 修改时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "修改时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date modifyTime; + + /** + * 删除时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "删除时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date delTime; + + /** + * 市下面的区 + */ + @ApiModelProperty(value = "市下面的区") + private List child; + + + /** + * 设置添加市的默认 + * + * @return 返回市 + */ + public LsCity setDefaultValuesForAdd() { + this.delFlag = 0; + return this; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Long getProvinceId() { + return provinceId; + } + + public void setProvinceId(Long provinceId) { + this.provinceId = provinceId; + } + + public Long getSort() { + return sort; + } + + public void setSort(Long sort) { + this.sort = sort; + } + + public int getDelFlag() { + return delFlag; + } + + public void setDelFlag(int delFlag) { + this.delFlag = delFlag; + } + + public Date getModifyTime() { + return modifyTime; + } + + public void setModifyTime(Date modifyTime) { + this.modifyTime = modifyTime; + } + + public Date getDelTime() { + return delTime; + } + + public void setDelTime(Date delTime) { + this.delTime = delTime; + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("name", getName()) + .append("provinceId", getProvinceId()) + .append("sort", getSort()) + .append("delFlag", getDelFlag()) + .append("createTime", getCreateTime()) + .append("modifyTime", getModifyTime()) + .append("delTime", getDelTime()) + .toString(); + } + + public List getChild() { + return child; + } + + public void setChild(List child) { + this.child = child; + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/setting/domain/LsDistrict.java b/ruoyi-segchk/src/main/java/com/ruoyi/setting/domain/LsDistrict.java new file mode 100644 index 0000000..84f2aac --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/setting/domain/LsDistrict.java @@ -0,0 +1,131 @@ +package com.ruoyi.setting.domain; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +import java.util.Date; + +/** + * 区域区对象 ls_district + * + * @author 魔金商城 + * @date 2020-07-29 + */ +public class LsDistrict extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * 主键id + */ + private Long id; + + /** + * 区名称 + */ + @Excel(name = "区名称") + private String name; + + /** + * 对应ls_city表中的id + */ + @Excel(name = "对应ls_city表中的id") + private Long cityId; + + /** + * 排序 数值越小 越前 + */ + @Excel(name = "排序 数值越小 越前") + private Long sort; + + /** + * 删除标记 0 未删除 1删除 默认0 + */ + private int delFlag; + + /** + * 修改时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "修改时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date modifyTime; + + /** + * 删除时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "删除时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date delTime; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Long getCityId() { + return cityId; + } + + public void setCityId(Long cityId) { + this.cityId = cityId; + } + + public Long getSort() { + return sort; + } + + public void setSort(Long sort) { + this.sort = sort; + } + + public int getDelFlag() { + return delFlag; + } + + public void setDelFlag(int delFlag) { + this.delFlag = delFlag; + } + + public Date getModifyTime() { + return modifyTime; + } + + public void setModifyTime(Date modifyTime) { + this.modifyTime = modifyTime; + } + + public Date getDelTime() { + return delTime; + } + + public void setDelTime(Date delTime) { + this.delTime = delTime; + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("name", getName()) + .append("cityId", getCityId()) + .append("sort", getSort()) + .append("delFlag", getDelFlag()) + .append("createTime", getCreateTime()) + .append("modifyTime", getModifyTime()) + .append("delTime", getDelTime()) + .toString(); + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/setting/domain/LsEmailSetting.java b/ruoyi-segchk/src/main/java/com/ruoyi/setting/domain/LsEmailSetting.java new file mode 100644 index 0000000..353c094 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/setting/domain/LsEmailSetting.java @@ -0,0 +1,126 @@ +package com.ruoyi.setting.domain; + +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +/** + * 邮箱设置对象 ls_email_setting + * + * @author 魔金商城 + * @date 2020-07-28 + */ +public class LsEmailSetting extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * 主键id + */ + private Long id; + + /** + * 发信邮箱 + */ + @Excel(name = "发信邮箱") + private String senderMail; + + /** + * 发信人 + */ + @Excel(name = "发信人") + private String senderName; + + /** + * SMTP的服务器地址 + */ + @Excel(name = "SMTP的服务器地址") + private String smtpServer; + + /** + * SMTP 的端口 + */ + @Excel(name = "SMTP 的端口") + private Long smtpPort; + + /** + * 邮箱帐号 + */ + @Excel(name = "邮箱帐号") + private String username; + + /** + * 邮箱密码 + */ + @Excel(name = "邮箱密码") + private String password; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getSenderMail() { + return senderMail; + } + + public void setSenderMail(String senderMail) { + this.senderMail = senderMail; + } + + public String getSenderName() { + return senderName; + } + + public void setSenderName(String senderName) { + this.senderName = senderName; + } + + public String getSmtpServer() { + return smtpServer; + } + + public void setSmtpServer(String smtpServer) { + this.smtpServer = smtpServer; + } + + public Long getSmtpPort() { + return smtpPort; + } + + public void setSmtpPort(Long smtpPort) { + this.smtpPort = smtpPort; + } + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("senderMail", getSenderMail()) + .append("senderName", getSenderName()) + .append("smtpServer", getSmtpServer()) + .append("smtpPort", getSmtpPort()) + .append("username", getUsername()) + .append("password", getPassword()) + .toString(); + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/setting/domain/LsProvince.java b/ruoyi-segchk/src/main/java/com/ruoyi/setting/domain/LsProvince.java new file mode 100644 index 0000000..becc46f --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/setting/domain/LsProvince.java @@ -0,0 +1,141 @@ +package com.ruoyi.setting.domain; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; +import io.swagger.annotations.ApiModelProperty; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +import java.util.Date; +import java.util.List; + +/** + * 区域省对象 ls_province + * + * @author 魔金商城 + * @date 2020-07-29 + */ +public class LsProvince extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * 主键id + */ + private Long id; + + /** + * 省份的名称 + */ + @Excel(name = "省份的名称") + private String name; + + /** + * 排序 + */ + @Excel(name = "排序") + private Long sort; + + /** + * 删除标记 0 未删除 1删除 + */ + private int delFlag; + + /** + * 修改时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "修改时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date modifyTime; + + /** + * 删除时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "删除时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date delTime; + /** + * 省下面的市 + */ + @ApiModelProperty(value = "省下面的市") + private List child; + + /** + * 设置添加省份的默认 + * + * @return 返回省份 + */ + public LsProvince setDefaultValuesForAdd() { + this.delFlag = 0; + return this; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Long getSort() { + return sort; + } + + public void setSort(Long sort) { + this.sort = sort; + } + + public int getDelFlag() { + return delFlag; + } + + public void setDelFlag(int delFlag) { + this.delFlag = delFlag; + } + + public Date getModifyTime() { + return modifyTime; + } + + public void setModifyTime(Date modifyTime) { + this.modifyTime = modifyTime; + } + + public Date getDelTime() { + return delTime; + } + + public void setDelTime(Date delTime) { + this.delTime = delTime; + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("name", getName()) + .append("sort", getSort()) + .append("delFlag", getDelFlag()) + .append("createTime", getCreateTime()) + .append("modifyTime", getModifyTime()) + .append("delTime", getDelTime()) + .toString(); + } + + public List getChild() { + return child; + } + + public void setChild(List child) { + this.child = child; + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/setting/domain/LsSmsSetting.java b/ruoyi-segchk/src/main/java/com/ruoyi/setting/domain/LsSmsSetting.java new file mode 100644 index 0000000..abd3da4 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/setting/domain/LsSmsSetting.java @@ -0,0 +1,197 @@ +package com.ruoyi.setting.domain; + +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; +import io.swagger.annotations.ApiModelProperty; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +/** + * 短信接口设置对象 ls_sms_setting + * + * @author 魔金商城 + * @date 2020-07-28 + */ +public class LsSmsSetting extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * 主键id + */ + private Long id; + + /** + * AppSecret + */ + @Excel(name = "AppSecret") + private String secret; + + /** + * 短信接口地址 + */ + @Excel(name = "短信接口地址") + private String url; + + /** + * 短信签名 + */ + @Excel(name = "短信签名") + private String sign; + + /** + * 模板id + */ + @Excel(name = "模板id") + private String templateId; + + /** + * 核销门店订单的模版id + */ + @Excel(name = "核销门店订单的模版id") + private String writeoffTemplateId; + + /** + * 虚拟订单核销的模版id + */ + @Excel(name = "虚拟订单核销的模版id") + private String virtualOrderTemplateId; + + /** + * AppKey + */ + @Excel(name = "AppKey") + private String key; + + /** + * 社区团购审核结果通知模版id + */ + @Excel(name = "社区团购审核结果通知模版id") + private String auditTemplateId; + + /** + * 社区团购佣金结算模版id + */ + @Excel(name = "社区团购佣金结算模版id") + private String settlementTemplateId; + + /** + * 社区团购提现打款模版id + */ + @Excel(name = "社区团购提现打款模版id") + private String withdrawTemplateId; + @ApiModelProperty("启用状态") + private Boolean status; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getSecret() { + return secret; + } + + public void setSecret(String secret) { + this.secret = secret; + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + public String getSign() { + return sign; + } + + public void setSign(String sign) { + this.sign = sign; + } + + public String getTemplateId() { + return templateId; + } + + public void setTemplateId(String templateId) { + this.templateId = templateId; + } + + public String getWriteoffTemplateId() { + return writeoffTemplateId; + } + + public void setWriteoffTemplateId(String writeoffTemplateId) { + this.writeoffTemplateId = writeoffTemplateId; + } + + public String getVirtualOrderTemplateId() { + return virtualOrderTemplateId; + } + + public void setVirtualOrderTemplateId(String virtualOrderTemplateId) { + this.virtualOrderTemplateId = virtualOrderTemplateId; + } + + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public String getAuditTemplateId() { + return auditTemplateId; + } + + public void setAuditTemplateId(String auditTemplateId) { + this.auditTemplateId = auditTemplateId; + } + + public String getSettlementTemplateId() { + return settlementTemplateId; + } + + public void setSettlementTemplateId(String settlementTemplateId) { + this.settlementTemplateId = settlementTemplateId; + } + + public String getWithdrawTemplateId() { + return withdrawTemplateId; + } + + public void setWithdrawTemplateId(String withdrawTemplateId) { + this.withdrawTemplateId = withdrawTemplateId; + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("secret", getSecret()) + .append("url", getUrl()) + .append("sign", getSign()) + .append("templateId", getTemplateId()) + .append("writeoffTemplateId", getWriteoffTemplateId()) + .append("virtualOrderTemplateId", getVirtualOrderTemplateId()) + .append("key", getKey()) + .append("auditTemplateId", getAuditTemplateId()) + .append("settlementTemplateId", getSettlementTemplateId()) + .append("withdrawTemplateId", getWithdrawTemplateId()) + .toString(); + } + + public Boolean getStatus() { + return status; + } + + public void setStatus(Boolean status) { + this.status = status; + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/setting/domain/LsStationLetter.java b/ruoyi-segchk/src/main/java/com/ruoyi/setting/domain/LsStationLetter.java new file mode 100644 index 0000000..6fd2656 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/setting/domain/LsStationLetter.java @@ -0,0 +1,111 @@ +package com.ruoyi.setting.domain; + +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +/** + * 站内信对象 ls_station_letter + * + * @author 魔金商城 + * @date 2020-07-29 + */ +public class LsStationLetter extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * 主键id + */ + private Long id; + + /** + * 会员id + */ + @Excel(name = "会员id") + private Long customerId; + + /** + * 站内信标题 + */ + @Excel(name = "站内信标题") + private String title; + + /** + * 站内信内容 + */ + @Excel(name = "站内信内容") + private String content; + + /** + * 是否已读 0 未读 1 已读 默认0 + */ + @Excel(name = "是否已读 0 未读 1 已读 默认0 ") + private String isRead; + + /** + * 删除标记 0 未删除 1 删除 默认0 + */ + private int delFlag; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getCustomerId() { + return customerId; + } + + public void setCustomerId(Long customerId) { + this.customerId = customerId; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content; + } + + public String getIsRead() { + return isRead; + } + + public void setIsRead(String isRead) { + this.isRead = isRead; + } + + public int getDelFlag() { + return delFlag; + } + + public void setDelFlag(int delFlag) { + this.delFlag = delFlag; + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("customerId", getCustomerId()) + .append("title", getTitle()) + .append("content", getContent()) + .append("isRead", getIsRead()) + .append("delFlag", getDelFlag()) + .append("createTime", getCreateTime()) + .toString(); + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/setting/domain/LsSystemSeo.java b/ruoyi-segchk/src/main/java/com/ruoyi/setting/domain/LsSystemSeo.java new file mode 100644 index 0000000..36e822a --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/setting/domain/LsSystemSeo.java @@ -0,0 +1,96 @@ +package com.ruoyi.setting.domain; + +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +/** + * 系统seo设置对象 ls_system_seo + * + * @author 魔金商城 + * @date 2020-07-29 + */ +public class LsSystemSeo extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * 主键id + */ + private Long id; + + /** + * seo标题 + */ + @Excel(name = "seo标题") + private String title; + + /** + * seo关键字 + */ + @Excel(name = "seo关键字") + private String keyWord; + + /** + * seo描述 + */ + @Excel(name = "seo描述") + private String seoDesc; + + /** + * 是否开启 0 未开启 1 开启 + */ + @Excel(name = "是否开启 0 未开启 1 开启 ") + private String isOpen; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getKeyWord() { + return keyWord; + } + + public void setKeyWord(String keyWord) { + this.keyWord = keyWord; + } + + public String getSeoDesc() { + return seoDesc; + } + + public void setSeoDesc(String seoDesc) { + this.seoDesc = seoDesc; + } + + public String getIsOpen() { + return isOpen; + } + + public void setIsOpen(String isOpen) { + this.isOpen = isOpen; + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("title", getTitle()) + .append("keyWord", getKeyWord()) + .append("seoDesc", getSeoDesc()) + .append("isOpen", getIsOpen()) + .toString(); + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/setting/domain/LsWxCustomerLink.java b/ruoyi-segchk/src/main/java/com/ruoyi/setting/domain/LsWxCustomerLink.java new file mode 100644 index 0000000..6046d70 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/setting/domain/LsWxCustomerLink.java @@ -0,0 +1,96 @@ +package com.ruoyi.setting.domain; + +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +/** + * 微信登录和商城用户的关联对象 ls_wx_customer_link + * + * @author 魔金商城 + * @date 2020-07-29 + */ +public class LsWxCustomerLink extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * 主键id + */ + private Long id; + + /** + * 微信的联合登录id + */ + @Excel(name = "微信的联合登录id") + private String wxUnionId; + + /** + * 用户id + */ + @Excel(name = "用户id") + private Long customerId; + + /** + * 微信的openid + */ + @Excel(name = "微信的openid") + private String wxOpenId; + + /** + * 小程序的openid + */ + @Excel(name = "小程序的openid") + private String wxAppletOpenId; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getWxUnionId() { + return wxUnionId; + } + + public void setWxUnionId(String wxUnionId) { + this.wxUnionId = wxUnionId; + } + + public Long getCustomerId() { + return customerId; + } + + public void setCustomerId(Long customerId) { + this.customerId = customerId; + } + + public String getWxOpenId() { + return wxOpenId; + } + + public void setWxOpenId(String wxOpenId) { + this.wxOpenId = wxOpenId; + } + + public String getWxAppletOpenId() { + return wxAppletOpenId; + } + + public void setWxAppletOpenId(String wxAppletOpenId) { + this.wxAppletOpenId = wxAppletOpenId; + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("wxUnionId", getWxUnionId()) + .append("customerId", getCustomerId()) + .append("wxOpenId", getWxOpenId()) + .append("wxAppletOpenId", getWxAppletOpenId()) + .toString(); + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/setting/domain/SCommunityBuySetting.java b/ruoyi-segchk/src/main/java/com/ruoyi/setting/domain/SCommunityBuySetting.java new file mode 100644 index 0000000..f132c71 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/setting/domain/SCommunityBuySetting.java @@ -0,0 +1,111 @@ +package com.ruoyi.setting.domain; + +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +/** + * 社区团购设置对象 s_community_buy_setting + * + * @author 魔金商城 + * @date 2020-07-28 + */ +public class SCommunityBuySetting extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * $column.columnComment + */ + private Long id; + + /** + * 团长名称 + */ + @Excel(name = "团长名称") + private String name; + + /** + * 是否开启审核 0 开启 1 关闭 默认0 + */ + @Excel(name = "是否开启审核 0 开启 1 关闭 默认0") + private String audit; + + /** + * 审核结果通知 0 通知 1 不通知 默认0 + */ + @Excel(name = "审核结果通知 0 通知 1 不通知 默认0 ") + private String smsAuditNotice; + + /** + * 打款通知 0 通知 1 不通知默认0 + */ + @Excel(name = "打款通知 0 通知 1 不通知默认0 ") + private String smsPayNotice; + + /** + * 佣金结算通知 0 通知 1 不通知默认0 + */ + @Excel(name = "佣金结算通知 0 通知 1 不通知默认0 ") + private String smsCommissionNotice; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getAudit() { + return audit; + } + + public void setAudit(String audit) { + this.audit = audit; + } + + public String getSmsAuditNotice() { + return smsAuditNotice; + } + + public void setSmsAuditNotice(String smsAuditNotice) { + this.smsAuditNotice = smsAuditNotice; + } + + public String getSmsPayNotice() { + return smsPayNotice; + } + + public void setSmsPayNotice(String smsPayNotice) { + this.smsPayNotice = smsPayNotice; + } + + public String getSmsCommissionNotice() { + return smsCommissionNotice; + } + + public void setSmsCommissionNotice(String smsCommissionNotice) { + this.smsCommissionNotice = smsCommissionNotice; + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("name", getName()) + .append("audit", getAudit()) + .append("smsAuditNotice", getSmsAuditNotice()) + .append("smsPayNotice", getSmsPayNotice()) + .append("smsCommissionNotice", getSmsCommissionNotice()) + .toString(); + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/setting/domain/SegchkPaySetting.java b/ruoyi-segchk/src/main/java/com/ruoyi/setting/domain/SegchkPaySetting.java new file mode 100644 index 0000000..e086ec0 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/setting/domain/SegchkPaySetting.java @@ -0,0 +1,81 @@ +package com.ruoyi.setting.domain; + +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +/** + * 支付设置对象 ls_pay_setting + * + * @author 魔金商城 + * @date 2020-07-28 + */ +public class SegchkPaySetting extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * 主键id + */ + private Long id; + + /** + * 支付方式 1:支付宝 2:微信 3:银联 4:预存款 5:微信APP支付 6:微信小程序支付 + */ + @Excel(name = "支付方式 1:支付宝 2:微信 3:银联 4:预存款 5:微信APP支付 6:微信小程序支付") + private String codetype; + + /** + * 字段名称 + */ + @Excel(name = "字段名称") + private String columnName; + + /** + * 字段值 + */ + @Excel(name = "字段值") + private String columnValue; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getCodetype() { + return codetype; + } + + public void setCodetype(String codetype) { + this.codetype = codetype; + } + + public String getColumnName() { + return columnName; + } + + public void setColumnName(String columnName) { + this.columnName = columnName; + } + + public String getColumnValue() { + return columnValue; + } + + public void setColumnValue(String columnValue) { + this.columnValue = columnValue; + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("codetype", getCodetype()) + .append("columnName", getColumnName()) + .append("columnValue", getColumnValue()) + .toString(); + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/setting/mapper/AreaMapper.java b/ruoyi-segchk/src/main/java/com/ruoyi/setting/mapper/AreaMapper.java new file mode 100644 index 0000000..4827c80 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/setting/mapper/AreaMapper.java @@ -0,0 +1,160 @@ +package com.ruoyi.setting.mapper; + + +import com.ruoyi.setting.domain.LsCity; +import com.ruoyi.setting.domain.LsDistrict; +import com.ruoyi.setting.domain.LsProvince; + +import java.util.List; + +/** + * Created by 魔金商城 on 17/5/15. + * 地区数据库接口 + */ +public interface AreaMapper { + + /** + * 查询所有省份 + * + * @return 返回所有省份 + */ + + List queryAllProvinces(); + + /** + * 根据省份id查询该省下面的市 + * + * @param provinceId 省id + * @return 返回省下面的市 + */ + + List queryCityByProvinceId(long provinceId); + + + /** + * 根据市id查询下面的区 + * + * @param cityId 市id + * @return 返回该市下面的区 + */ + + List queryDistrictByCityId(long cityId); + + /** + * 添加省份 + * + * @param province 省份信息 + * @return 成功返回1 失败返回0 + */ + + int addProvince(LsProvince province); + + /** + * 添加市 + * + * @param city 市信息 + * @return 成功返回1 失败返回0 + */ + + int addCity(LsCity city); + + /** + * 添加区 + * + * @param district 区信息 + * @return 成功返回1 失败返回0 + */ + + int addDistrict(LsDistrict district); + + + /** + * 根据省份id删除省份信息 + * + * @param provinceId 省份id + * @return 成功返回1 失败返回0 + */ + + int deleteProvinceById(long provinceId); + + /** + * 根据市id删除市信息 + * + * @param cityId 市id + * @return 成功返回1 失败返回0 + */ + + int deleteCityById(long cityId); + + /** + * 根据区id删除区信息 + * + * @param districtId 区id + * @return 成功返回1 失败返回0 + */ + + int deleteDistrictById(long districtId); + + /** + * 根据省id查询省份信息 + * + * @param id 省id + * @return 返回省份信息 + */ + + LsProvince queryProvinceById(long id); + + /** + * 根据市id查询市信息 + * + * @param id 市id + * @return 返回市信息 + */ + + LsCity queryCityById(long id); + + /** + * 根据区id查询区信息 + * + * @param id 区id + * @return 返回区信息 + */ + + LsDistrict queryDistrictById(long id); + + /** + * 修改省份信息 + * + * @param province 修改省份 + * @return 成功返回1 失败返回0 + */ + + int updateProvince(LsProvince province); + + /** + * 修改市信息 + * + * @param city 市信息 + * @return 成功返回1 失败返回0 + */ + + int updateCity(LsCity city); + + /** + * 修改区信息 + * + * @param district 区信息 + * @return 成功返回1 失败返回0 + */ + + int updateDistrict(LsDistrict district); + + /** + * 根据名称查询市id + * + * @param cityName 市名称 + * @return 市id + */ + + Long queryCityIdByName(String cityName); +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/setting/mapper/BaseInfoSetMapper.java b/ruoyi-segchk/src/main/java/com/ruoyi/setting/mapper/BaseInfoSetMapper.java new file mode 100644 index 0000000..9d993c9 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/setting/mapper/BaseInfoSetMapper.java @@ -0,0 +1,56 @@ +package com.ruoyi.setting.mapper; + +import com.ruoyi.setting.bean.BaseInfoSet; +import org.springframework.stereotype.Repository; + +/** + * 基本信息设置mapper层 + * + * @author 魔金商城 on 2017/5/17. + */ +@Repository +public interface BaseInfoSetMapper { + /** + * 查询基本信息设置 + * + * @return 基本信息设置实体类 + */ + + BaseInfoSet queryBaseInfoSet(); + + /** + * 编辑基本信息 + * + * @param baseInfoSet 信息实体类 + * @return 编辑返回码 + */ + + int editBaseInfoSetA(BaseInfoSet baseInfoSet); + + /** + * 编辑高级信息 + * + * @param baseInfoSet 信息实体类 + * @return 编辑返回码 + */ + + int editBaseInfoSetB(BaseInfoSet baseInfoSet); + + /** + * 设置审核开关 + * + * @param storeSpuAudit 店铺商品审核开关 0 需要审核 1 不需要 默认0 + * @return 成功返回1,失败返回0 + */ + + int setAuditSwitch(String storeSpuAudit); + + /** + * 设置审核开关 + * + * @param memberPriceStatus 会员等级启用状态 0 启用 1 不启用 默认0 + * @return 成功返回1,失败返回0 + */ + + int setMemberPriceStatus(String memberPriceStatus); +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/setting/mapper/LsCityMapper.java b/ruoyi-segchk/src/main/java/com/ruoyi/setting/mapper/LsCityMapper.java new file mode 100644 index 0000000..b501955 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/setting/mapper/LsCityMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.setting.mapper; + +import com.ruoyi.setting.domain.LsCity; + +import java.util.List; + +/** + * 区域市Mapper接口 + * + * @author 魔金商城 + * @date 2020-07-29 + */ +public interface LsCityMapper { + /** + * 查询区域市 + * + * @param id 区域市ID + * @return 区域市 + */ + public LsCity selectLsCityById(Long id); + + /** + * 查询区域市列表 + * + * @param lsCity 区域市 + * @return 区域市集合 + */ + public List selectLsCityList(LsCity lsCity); + + /** + * 新增区域市 + * + * @param lsCity 区域市 + * @return 结果 + */ + public int insertLsCity(LsCity lsCity); + + /** + * 修改区域市 + * + * @param lsCity 区域市 + * @return 结果 + */ + public int updateLsCity(LsCity lsCity); + + /** + * 删除区域市 + * + * @param id 区域市ID + * @return 结果 + */ + public int deleteLsCityById(Long id); + + /** + * 批量删除区域市 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteLsCityByIds(Long[] ids); +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/setting/mapper/LsDistrictMapper.java b/ruoyi-segchk/src/main/java/com/ruoyi/setting/mapper/LsDistrictMapper.java new file mode 100644 index 0000000..47d9c14 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/setting/mapper/LsDistrictMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.setting.mapper; + +import com.ruoyi.setting.domain.LsDistrict; + +import java.util.List; + +/** + * 区域区Mapper接口 + * + * @author 魔金商城 + * @date 2020-07-29 + */ +public interface LsDistrictMapper { + /** + * 查询区域区 + * + * @param id 区域区ID + * @return 区域区 + */ + public LsDistrict selectLsDistrictById(Long id); + + /** + * 查询区域区列表 + * + * @param lsDistrict 区域区 + * @return 区域区集合 + */ + public List selectLsDistrictList(LsDistrict lsDistrict); + + /** + * 新增区域区 + * + * @param lsDistrict 区域区 + * @return 结果 + */ + public int insertLsDistrict(LsDistrict lsDistrict); + + /** + * 修改区域区 + * + * @param lsDistrict 区域区 + * @return 结果 + */ + public int updateLsDistrict(LsDistrict lsDistrict); + + /** + * 删除区域区 + * + * @param id 区域区ID + * @return 结果 + */ + public int deleteLsDistrictById(Long id); + + /** + * 批量删除区域区 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteLsDistrictByIds(Long[] ids); +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/setting/mapper/LsEmailSettingMapper.java b/ruoyi-segchk/src/main/java/com/ruoyi/setting/mapper/LsEmailSettingMapper.java new file mode 100644 index 0000000..582c4d0 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/setting/mapper/LsEmailSettingMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.setting.mapper; + +import com.ruoyi.setting.domain.LsEmailSetting; + +import java.util.List; + +/** + * 邮箱设置Mapper接口 + * + * @author 魔金商城 + * @date 2020-07-28 + */ +public interface LsEmailSettingMapper { + /** + * 查询邮箱设置 + * + * @param id 邮箱设置ID + * @return 邮箱设置 + */ + public LsEmailSetting selectLsEmailSettingById(Long id); + + /** + * 查询邮箱设置列表 + * + * @param lsEmailSetting 邮箱设置 + * @return 邮箱设置集合 + */ + public List selectLsEmailSettingList(LsEmailSetting lsEmailSetting); + + /** + * 新增邮箱设置 + * + * @param lsEmailSetting 邮箱设置 + * @return 结果 + */ + public int insertLsEmailSetting(LsEmailSetting lsEmailSetting); + + /** + * 修改邮箱设置 + * + * @param lsEmailSetting 邮箱设置 + * @return 结果 + */ + public int updateLsEmailSetting(LsEmailSetting lsEmailSetting); + + /** + * 删除邮箱设置 + * + * @param id 邮箱设置ID + * @return 结果 + */ + public int deleteLsEmailSettingById(Long id); + + /** + * 批量删除邮箱设置 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteLsEmailSettingByIds(Long[] ids); +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/setting/mapper/LsProvinceMapper.java b/ruoyi-segchk/src/main/java/com/ruoyi/setting/mapper/LsProvinceMapper.java new file mode 100644 index 0000000..8dba4d3 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/setting/mapper/LsProvinceMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.setting.mapper; + +import com.ruoyi.setting.domain.LsProvince; + +import java.util.List; + +/** + * 区域省Mapper接口 + * + * @author 魔金商城 + * @date 2020-07-29 + */ +public interface LsProvinceMapper { + /** + * 查询区域省 + * + * @param id 区域省ID + * @return 区域省 + */ + public LsProvince selectLsProvinceById(Long id); + + /** + * 查询区域省列表 + * + * @param lsProvince 区域省 + * @return 区域省集合 + */ + public List selectLsProvinceList(LsProvince lsProvince); + + /** + * 新增区域省 + * + * @param lsProvince 区域省 + * @return 结果 + */ + public int insertLsProvince(LsProvince lsProvince); + + /** + * 修改区域省 + * + * @param lsProvince 区域省 + * @return 结果 + */ + public int updateLsProvince(LsProvince lsProvince); + + /** + * 删除区域省 + * + * @param id 区域省ID + * @return 结果 + */ + public int deleteLsProvinceById(Long id); + + /** + * 批量删除区域省 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteLsProvinceByIds(Long[] ids); +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/setting/mapper/LsSmsSettingMapper.java b/ruoyi-segchk/src/main/java/com/ruoyi/setting/mapper/LsSmsSettingMapper.java new file mode 100644 index 0000000..346d114 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/setting/mapper/LsSmsSettingMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.setting.mapper; + +import com.ruoyi.setting.domain.LsSmsSetting; + +import java.util.List; + +/** + * 短信接口设置Mapper接口 + * + * @author 魔金商城 + * @date 2020-07-28 + */ +public interface LsSmsSettingMapper { + /** + * 查询短信接口设置 + * + * @param id 短信接口设置ID + * @return 短信接口设置 + */ + public LsSmsSetting selectLsSmsSettingById(Long id); + + /** + * 查询短信接口设置列表 + * + * @param lsSmsSetting 短信接口设置 + * @return 短信接口设置集合 + */ + public List selectLsSmsSettingList(LsSmsSetting lsSmsSetting); + + /** + * 新增短信接口设置 + * + * @param lsSmsSetting 短信接口设置 + * @return 结果 + */ + public int insertLsSmsSetting(LsSmsSetting lsSmsSetting); + + /** + * 修改短信接口设置 + * + * @param lsSmsSetting 短信接口设置 + * @return 结果 + */ + public int updateLsSmsSetting(LsSmsSetting lsSmsSetting); + + /** + * 删除短信接口设置 + * + * @param id 短信接口设置ID + * @return 结果 + */ + public int deleteLsSmsSettingById(Long id); + + /** + * 批量删除短信接口设置 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteLsSmsSettingByIds(Long[] ids); +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/setting/mapper/LsStationLetterMapper.java b/ruoyi-segchk/src/main/java/com/ruoyi/setting/mapper/LsStationLetterMapper.java new file mode 100644 index 0000000..c55e93f --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/setting/mapper/LsStationLetterMapper.java @@ -0,0 +1,116 @@ +package com.ruoyi.setting.mapper; + +import com.ruoyi.setting.domain.LsStationLetter; + +import java.util.List; +import java.util.Map; + +/** + * 站内信Mapper接口 + * + * @author 魔金商城 + * @date 2020-07-29 + */ +public interface LsStationLetterMapper { + /** + * 新增站内信 + * + * @param stationLetters 站内信 + * @return 成功返回>1 失败返回0 + */ + + int addStationLetters(List stationLetters); + + /** + * 删除站内信 + * + * @param id 站内信id + * @return 成功返回1,失败返回0 + */ + + int deleteStationLetters(long id); + + /** + * 根据会员id查询会员的站内信 + * + * @param params 查询参数 + * @return 返回会员的站内信 + */ + + List queryStationLettersByCustomerId(Map params); + + /** + * 查询会员的站内信总纪录数 + * + * @param params 查询参数 + * @return 返回会员的站内信总记录数 + */ + + int queryStationLettersCountByCustomerId(Map params); + + /** + * 更新会员的站内信的阅读状态 + * + * @param params 参数 + * @return 成功返回1,失败返回0 + */ + + int updateStationLettersIsRead(Map params); + + /** + * 获得用户未读消息的数量 + * + * @param customerId 用户id + * @return 返回用户未读消息的数量 + */ + + int unReadNum(long customerId); + + /** + * 查询站内信 + * + * @param id 站内信ID + * @return 站内信 + */ + public LsStationLetter selectLsStationLetterById(Long id); + + /** + * 查询站内信列表 + * + * @param lsStationLetter 站内信 + * @return 站内信集合 + */ + public List selectLsStationLetterList(LsStationLetter lsStationLetter); + + /** + * 新增站内信 + * + * @param lsStationLetter 站内信 + * @return 结果 + */ + public int insertLsStationLetter(LsStationLetter lsStationLetter); + + /** + * 修改站内信 + * + * @param lsStationLetter 站内信 + * @return 结果 + */ + public int updateLsStationLetter(LsStationLetter lsStationLetter); + + /** + * 删除站内信 + * + * @param id 站内信ID + * @return 结果 + */ + public int deleteLsStationLetterById(Long id); + + /** + * 批量删除站内信 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteLsStationLetterByIds(Long[] ids); +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/setting/mapper/LsSystemSeoMapper.java b/ruoyi-segchk/src/main/java/com/ruoyi/setting/mapper/LsSystemSeoMapper.java new file mode 100644 index 0000000..dabdaa7 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/setting/mapper/LsSystemSeoMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.setting.mapper; + +import com.ruoyi.setting.domain.LsSystemSeo; + +import java.util.List; + +/** + * 系统seo设置Mapper接口 + * + * @author 魔金商城 + * @date 2020-07-29 + */ +public interface LsSystemSeoMapper { + /** + * 查询系统seo设置 + * + * @param id 系统seo设置ID + * @return 系统seo设置 + */ + public LsSystemSeo selectLsSystemSeoById(Long id); + + /** + * 查询系统seo设置列表 + * + * @param lsSystemSeo 系统seo设置 + * @return 系统seo设置集合 + */ + public List selectLsSystemSeoList(LsSystemSeo lsSystemSeo); + + /** + * 新增系统seo设置 + * + * @param lsSystemSeo 系统seo设置 + * @return 结果 + */ + public int insertLsSystemSeo(LsSystemSeo lsSystemSeo); + + /** + * 修改系统seo设置 + * + * @param lsSystemSeo 系统seo设置 + * @return 结果 + */ + public int updateLsSystemSeo(LsSystemSeo lsSystemSeo); + + /** + * 删除系统seo设置 + * + * @param id 系统seo设置ID + * @return 结果 + */ + public int deleteLsSystemSeoById(Long id); + + /** + * 批量删除系统seo设置 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteLsSystemSeoByIds(Long[] ids); +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/setting/mapper/LsWxCustomerLinkMapper.java b/ruoyi-segchk/src/main/java/com/ruoyi/setting/mapper/LsWxCustomerLinkMapper.java new file mode 100644 index 0000000..82c3ccc --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/setting/mapper/LsWxCustomerLinkMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.setting.mapper; + +import com.ruoyi.setting.domain.LsWxCustomerLink; + +import java.util.List; + +/** + * 微信登录和商城用户的关联Mapper接口 + * + * @author 魔金商城 + * @date 2020-07-29 + */ +public interface LsWxCustomerLinkMapper { + /** + * 查询微信登录和商城用户的关联 + * + * @param id 微信登录和商城用户的关联ID + * @return 微信登录和商城用户的关联 + */ + public LsWxCustomerLink selectLsWxCustomerLinkById(Long id); + + /** + * 查询微信登录和商城用户的关联列表 + * + * @param lsWxCustomerLink 微信登录和商城用户的关联 + * @return 微信登录和商城用户的关联集合 + */ + public List selectLsWxCustomerLinkList(LsWxCustomerLink lsWxCustomerLink); + + /** + * 新增微信登录和商城用户的关联 + * + * @param lsWxCustomerLink 微信登录和商城用户的关联 + * @return 结果 + */ + public int insertLsWxCustomerLink(LsWxCustomerLink lsWxCustomerLink); + + /** + * 修改微信登录和商城用户的关联 + * + * @param lsWxCustomerLink 微信登录和商城用户的关联 + * @return 结果 + */ + public int updateLsWxCustomerLink(LsWxCustomerLink lsWxCustomerLink); + + /** + * 删除微信登录和商城用户的关联 + * + * @param id 微信登录和商城用户的关联ID + * @return 结果 + */ + public int deleteLsWxCustomerLinkById(Long id); + + /** + * 批量删除微信登录和商城用户的关联 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteLsWxCustomerLinkByIds(Long[] ids); +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/setting/mapper/OssMapper.java b/ruoyi-segchk/src/main/java/com/ruoyi/setting/mapper/OssMapper.java new file mode 100644 index 0000000..ff793d1 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/setting/mapper/OssMapper.java @@ -0,0 +1,30 @@ +package com.ruoyi.setting.mapper; + + +import com.ruoyi.setting.bean.OssSetting; +import org.springframework.stereotype.Repository; + +/** + * Created by luozhuo on 2020/7/7 + * 云存储设置数据库接口 + */ +@Repository +public interface OssMapper { + + /** + * 查询系统设置的云存储信息 + * + * @return 返回云存储信息 + */ + + OssSetting queryOssSetting(); + + /** + * 修改又拍云信息 + * + * @param ossSetting 云存储信息 + * @return 成功返回1 失败返回0 + */ + + int updateOss(OssSetting ossSetting); +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/setting/mapper/SCommunityBuySettingMapper.java b/ruoyi-segchk/src/main/java/com/ruoyi/setting/mapper/SCommunityBuySettingMapper.java new file mode 100644 index 0000000..f401ad4 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/setting/mapper/SCommunityBuySettingMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.setting.mapper; + +import com.ruoyi.setting.domain.SCommunityBuySetting; + +import java.util.List; + +/** + * 社区团购设置Mapper接口 + * + * @author 魔金商城 + * @date 2020-07-28 + */ +public interface SCommunityBuySettingMapper { + /** + * 查询社区团购设置 + * + * @param id 社区团购设置ID + * @return 社区团购设置 + */ + public SCommunityBuySetting selectSCommunityBuySettingById(Long id); + + /** + * 查询社区团购设置列表 + * + * @param sCommunityBuySetting 社区团购设置 + * @return 社区团购设置集合 + */ + public List selectSCommunityBuySettingList(SCommunityBuySetting sCommunityBuySetting); + + /** + * 新增社区团购设置 + * + * @param sCommunityBuySetting 社区团购设置 + * @return 结果 + */ + public int insertSCommunityBuySetting(SCommunityBuySetting sCommunityBuySetting); + + /** + * 修改社区团购设置 + * + * @param sCommunityBuySetting 社区团购设置 + * @return 结果 + */ + public int updateSCommunityBuySetting(SCommunityBuySetting sCommunityBuySetting); + + /** + * 删除社区团购设置 + * + * @param id 社区团购设置ID + * @return 结果 + */ + public int deleteSCommunityBuySettingById(Long id); + + /** + * 批量删除社区团购设置 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteSCommunityBuySettingByIds(Long[] ids); +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/setting/mapper/SegchkPaySettingMapper.java b/ruoyi-segchk/src/main/java/com/ruoyi/setting/mapper/SegchkPaySettingMapper.java new file mode 100644 index 0000000..dbbc923 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/setting/mapper/SegchkPaySettingMapper.java @@ -0,0 +1,82 @@ +package com.ruoyi.setting.mapper; + +import com.ruoyi.setting.bean.PaySet; +import com.ruoyi.setting.domain.SegchkPaySetting; + +import java.util.List; + +/** + * 支付设置Mapper接口 + * + * @author 魔金商城 + * @date 2020-07-28 + */ +public interface SegchkPaySettingMapper { + /** + * 查询支付设置 + * + * @param id 支付设置ID + * @return 支付设置 + */ + public SegchkPaySetting selectLsPaySettingById(Long id); + + /** + * 查询支付设置列表 + * + * @param segchkPaySetting 支付设置 + * @return 支付设置集合 + */ + public List selectLsPaySettingList(SegchkPaySetting segchkPaySetting); + + /** + * 新增支付设置 + * + * @param segchkPaySetting 支付设置 + * @return 结果 + */ + public int insertLsPaySetting(SegchkPaySetting segchkPaySetting); + + /** + * 修改支付设置 + * + * @param segchkPaySetting 支付设置 + * @return 结果 + */ + public int updateLsPaySetting(SegchkPaySetting segchkPaySetting); + + /** + * 删除支付设置 + * + * @param id 支付设置ID + * @return 结果 + */ + public int deleteLsPaySettingById(Long id); + + /** + * 批量删除支付设置 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteLsPaySettingByIds(Long[] ids); + + List queryPaySet(); + + /** + * 根据codeType删除支付接口设置 + * + * @param codeType 1支付宝 2微信 3银联 + * @return 返回删除行数 + */ + + int deletePaySet(String codeType); + + /** + * 批量插入支付接口设置 + * + * @param list PaySet集合 + * @return 返回插入行数 + */ + + int addPaySet(List list); +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/setting/service/AreaService.java b/ruoyi-segchk/src/main/java/com/ruoyi/setting/service/AreaService.java new file mode 100644 index 0000000..f8b9fca --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/setting/service/AreaService.java @@ -0,0 +1,155 @@ +package com.ruoyi.setting.service; + + +import com.ruoyi.setting.domain.LsCity; +import com.ruoyi.setting.domain.LsDistrict; +import com.ruoyi.setting.domain.LsProvince; +import com.ruoyi.setting.vo.AreaItem; +import com.ruoyi.setting.vo.Locality; + +import java.util.List; + +/** + * Created by 魔金商城 on 17/5/15. + * 地区服务接口 + */ +public interface AreaService { + + /** + * 查询所有省份 + * + * @param areaItems 查询参数 不带只查询省 + * @return 返回所有省份 + */ + List queryAllProvinces(AreaItem... areaItems); + + + /** + * 查询所有地区信息(特殊数据接口) + * + * @return 所有地区信息 + */ + List queryAllLocality(); + + + /** + * 根据省份id查询下面的市 + * + * @param provinceId 省份id + * @return 返回该省下面的市 + */ + List queryCityByProvinceId(long provinceId); + + /** + * 根据市id查询下面的区县 + * + * @param cityId 市id + * @return 返回市下面的区县 + */ + List queryDistrictByCityId(long cityId); + + /** + * 添加省份 + * + * @param province 省份信息 + * @return 成功返回1 失败返回0 + */ + int addProvince(LsProvince province); + + /** + * 添加市 + * + * @param city 市 + * @return 成返回1 失败返回0 + */ + int addCity(LsCity city); + + /** + * 添加区 + * + * @param district 区信息 + * @return 成功返回1 失败返回0 + */ + int addDistrict(LsDistrict district); + + + /** + * 根据省份id删除省信息 + * + * @param provinceId 省份id + * @return 1 成功 0 失败 -1 下面有市不能删除 + */ + int deleteProvinceById(long provinceId); + + /** + * 根据市id删除市信息 + * + * @param cityId 市id + * @return 返回 1 成功 0 失败 -1 下面有区 不能删除 + */ + int deleteCityById(long cityId); + + /** + * 根据区id删除区 + * + * @param districtId 区id + * @return 返回 1 成功 0 失败 + */ + int deleteDistrictById(long districtId); + + /** + * 根据省份id查询省份信息 + * + * @param id 省份id + * @return 返回省份信息 + */ + LsProvince queryProvinceById(long id); + + /** + * 根据市id查询市信息 + * + * @param id 市id + * @return 返回市信息 + */ + LsCity queryCityById(long id); + + /** + * 根据区id查询区信息 + * + * @param id 区id + * @return 返回区信息 + */ + LsDistrict queryDistrictById(long id); + + /** + * 修改省份 + * + * @param province 省份信息 + * @return 成功返回1 失败返回0 + */ + int updateProvince(LsProvince province); + + /** + * 修改市 + * + * @param city 市信息 + * @return 成功返回1 失败返回0 + */ + int updateCity(LsCity city); + + /** + * 修改区 + * + * @param district 区信息 + * @return 成功返回1 失败返回0 + */ + int updateDistrict(LsDistrict district); + + /** + * 根据市名称查找市id + * + * @param cityName 市名称 + * @return 市id + */ + long queryCityIdByName(String cityName); +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/setting/service/BaseInfoSetService.java b/ruoyi-segchk/src/main/java/com/ruoyi/setting/service/BaseInfoSetService.java new file mode 100644 index 0000000..dfe0e21 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/setting/service/BaseInfoSetService.java @@ -0,0 +1,49 @@ +package com.ruoyi.setting.service; + +import com.ruoyi.setting.bean.BaseInfoSet; + +/** + * 基本信息设置service层 + * + * @author 魔金商城 on 2017/5/17. + */ +public interface BaseInfoSetService { + /** + * 查询基本信息和高级信息设置 + * + * @return 基本信息设置实体类 + */ + BaseInfoSet queryBaseInfoSet(); + + /** + * 编辑基本信息和高级信息 + * + * @param baseInfoSet 基本信息实体类 + * @param type 1 基本信息 0高级信息 + * @return -1编辑失败 1编辑成功 0编辑失败 + */ + int editBaseInfoSet(BaseInfoSet baseInfoSet, int type); + + /** + * 设置审核开关 + * + * @param storeSpuAudit 店铺商品审核开关 0 需要审核 1 不需要 默认0 + * @return 成功返回1,失败返回0 + */ + int setAuditSwitch(String storeSpuAudit); + + /** + * 设置会员价启用状态 + * + * @param memberPriceStatus 会员等级启用状态 0 启用 1 不启用 默认0 + * @return 成功返回1,失败返回0 + */ + int setMemberPriceStatus(String memberPriceStatus); + + /** + * 判断单品是否需要审核 + * + * @return 需要审核返回true 不需要返回false + */ + boolean isSkuNeedAudit(); +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/setting/service/ILsCityService.java b/ruoyi-segchk/src/main/java/com/ruoyi/setting/service/ILsCityService.java new file mode 100644 index 0000000..72e28cb --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/setting/service/ILsCityService.java @@ -0,0 +1,61 @@ +package com.ruoyi.setting.service; + +import com.ruoyi.setting.domain.LsCity; + +import java.util.List; + +/** + * 区域市Service接口 + * + * @author 魔金商城 + * @date 2020-07-29 + */ +public interface ILsCityService { + /** + * 查询区域市 + * + * @param id 区域市ID + * @return 区域市 + */ + public LsCity selectLsCityById(Long id); + + /** + * 查询区域市列表 + * + * @param lsCity 区域市 + * @return 区域市集合 + */ + public List selectLsCityList(LsCity lsCity); + + /** + * 新增区域市 + * + * @param lsCity 区域市 + * @return 结果 + */ + public int insertLsCity(LsCity lsCity); + + /** + * 修改区域市 + * + * @param lsCity 区域市 + * @return 结果 + */ + public int updateLsCity(LsCity lsCity); + + /** + * 批量删除区域市 + * + * @param ids 需要删除的区域市ID + * @return 结果 + */ + public int deleteLsCityByIds(Long[] ids); + + /** + * 删除区域市信息 + * + * @param id 区域市ID + * @return 结果 + */ + public int deleteLsCityById(Long id); +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/setting/service/ILsDistrictService.java b/ruoyi-segchk/src/main/java/com/ruoyi/setting/service/ILsDistrictService.java new file mode 100644 index 0000000..f1d9db9 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/setting/service/ILsDistrictService.java @@ -0,0 +1,61 @@ +package com.ruoyi.setting.service; + +import com.ruoyi.setting.domain.LsDistrict; + +import java.util.List; + +/** + * 区域区Service接口 + * + * @author 魔金商城 + * @date 2020-07-29 + */ +public interface ILsDistrictService { + /** + * 查询区域区 + * + * @param id 区域区ID + * @return 区域区 + */ + public LsDistrict selectLsDistrictById(Long id); + + /** + * 查询区域区列表 + * + * @param lsDistrict 区域区 + * @return 区域区集合 + */ + public List selectLsDistrictList(LsDistrict lsDistrict); + + /** + * 新增区域区 + * + * @param lsDistrict 区域区 + * @return 结果 + */ + public int insertLsDistrict(LsDistrict lsDistrict); + + /** + * 修改区域区 + * + * @param lsDistrict 区域区 + * @return 结果 + */ + public int updateLsDistrict(LsDistrict lsDistrict); + + /** + * 批量删除区域区 + * + * @param ids 需要删除的区域区ID + * @return 结果 + */ + public int deleteLsDistrictByIds(Long[] ids); + + /** + * 删除区域区信息 + * + * @param id 区域区ID + * @return 结果 + */ + public int deleteLsDistrictById(Long id); +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/setting/service/ILsEmailSettingService.java b/ruoyi-segchk/src/main/java/com/ruoyi/setting/service/ILsEmailSettingService.java new file mode 100644 index 0000000..a851365 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/setting/service/ILsEmailSettingService.java @@ -0,0 +1,61 @@ +package com.ruoyi.setting.service; + +import com.ruoyi.setting.domain.LsEmailSetting; + +import java.util.List; + +/** + * 邮箱设置Service接口 + * + * @author 魔金商城 + * @date 2020-07-28 + */ +public interface ILsEmailSettingService { + /** + * 查询邮箱设置 + * + * @param id 邮箱设置ID + * @return 邮箱设置 + */ + public LsEmailSetting selectLsEmailSettingById(Long id); + + /** + * 查询邮箱设置列表 + * + * @param lsEmailSetting 邮箱设置 + * @return 邮箱设置集合 + */ + public List selectLsEmailSettingList(LsEmailSetting lsEmailSetting); + + /** + * 新增邮箱设置 + * + * @param lsEmailSetting 邮箱设置 + * @return 结果 + */ + public int insertLsEmailSetting(LsEmailSetting lsEmailSetting); + + /** + * 修改邮箱设置 + * + * @param lsEmailSetting 邮箱设置 + * @return 结果 + */ + public int updateLsEmailSetting(LsEmailSetting lsEmailSetting); + + /** + * 批量删除邮箱设置 + * + * @param ids 需要删除的邮箱设置ID + * @return 结果 + */ + public int deleteLsEmailSettingByIds(Long[] ids); + + /** + * 删除邮箱设置信息 + * + * @param id 邮箱设置ID + * @return 结果 + */ + public int deleteLsEmailSettingById(Long id); +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/setting/service/ILsPaySettingService.java b/ruoyi-segchk/src/main/java/com/ruoyi/setting/service/ILsPaySettingService.java new file mode 100644 index 0000000..349e9ca --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/setting/service/ILsPaySettingService.java @@ -0,0 +1,76 @@ +package com.ruoyi.setting.service; + +import com.ruoyi.setting.bean.PaySetCommon; +import com.ruoyi.setting.domain.SegchkPaySetting; + +import java.util.List; + +/** + * 支付设置Service接口 + * + * @author 魔金商城 + * @date 2020-07-28 + */ +public interface ILsPaySettingService { + /** + * 查询所有支付接口设置 + * + * @return 返回PaySetCommon + */ + PaySetCommon queryPaySet(); + + /** + * 编辑支付接口设置 + * + * @return -1编辑出错 1成功 + */ + int editPaySet(PaySetCommon paySetCommon, String codeType); + + /** + * 查询支付设置 + * + * @param id 支付设置ID + * @return 支付设置 + */ + public SegchkPaySetting selectLsPaySettingById(Long id); + + /** + * 查询支付设置列表 + * + * @param segchkPaySetting 支付设置 + * @return 支付设置集合 + */ + public List selectLsPaySettingList(SegchkPaySetting segchkPaySetting); + + /** + * 新增支付设置 + * + * @param segchkPaySetting 支付设置 + * @return 结果 + */ + public int insertLsPaySetting(SegchkPaySetting segchkPaySetting); + + /** + * 修改支付设置 + * + * @param segchkPaySetting 支付设置 + * @return 结果 + */ + public int updateLsPaySetting(SegchkPaySetting segchkPaySetting); + + /** + * 批量删除支付设置 + * + * @param ids 需要删除的支付设置ID + * @return 结果 + */ + public int deleteLsPaySettingByIds(Long[] ids); + + /** + * 删除支付设置信息 + * + * @param id 支付设置ID + * @return 结果 + */ + public int deleteLsPaySettingById(Long id); +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/setting/service/ILsProvinceService.java b/ruoyi-segchk/src/main/java/com/ruoyi/setting/service/ILsProvinceService.java new file mode 100644 index 0000000..bf6b104 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/setting/service/ILsProvinceService.java @@ -0,0 +1,61 @@ +package com.ruoyi.setting.service; + +import com.ruoyi.setting.domain.LsProvince; + +import java.util.List; + +/** + * 区域省Service接口 + * + * @author 魔金商城 + * @date 2020-07-29 + */ +public interface ILsProvinceService { + /** + * 查询区域省 + * + * @param id 区域省ID + * @return 区域省 + */ + public LsProvince selectLsProvinceById(Long id); + + /** + * 查询区域省列表 + * + * @param lsProvince 区域省 + * @return 区域省集合 + */ + public List selectLsProvinceList(LsProvince lsProvince); + + /** + * 新增区域省 + * + * @param lsProvince 区域省 + * @return 结果 + */ + public int insertLsProvince(LsProvince lsProvince); + + /** + * 修改区域省 + * + * @param lsProvince 区域省 + * @return 结果 + */ + public int updateLsProvince(LsProvince lsProvince); + + /** + * 批量删除区域省 + * + * @param ids 需要删除的区域省ID + * @return 结果 + */ + public int deleteLsProvinceByIds(Long[] ids); + + /** + * 删除区域省信息 + * + * @param id 区域省ID + * @return 结果 + */ + public int deleteLsProvinceById(Long id); +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/setting/service/ILsSmsSettingService.java b/ruoyi-segchk/src/main/java/com/ruoyi/setting/service/ILsSmsSettingService.java new file mode 100644 index 0000000..ea1ccb7 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/setting/service/ILsSmsSettingService.java @@ -0,0 +1,61 @@ +package com.ruoyi.setting.service; + +import com.ruoyi.setting.domain.LsSmsSetting; + +import java.util.List; + +/** + * 短信接口设置Service接口 + * + * @author 魔金商城 + * @date 2020-07-28 + */ +public interface ILsSmsSettingService { + /** + * 查询短信接口设置 + * + * @param id 短信接口设置ID + * @return 短信接口设置 + */ + public LsSmsSetting selectLsSmsSettingById(Long id); + + /** + * 查询短信接口设置列表 + * + * @param lsSmsSetting 短信接口设置 + * @return 短信接口设置集合 + */ + public List selectLsSmsSettingList(LsSmsSetting lsSmsSetting); + + /** + * 新增短信接口设置 + * + * @param lsSmsSetting 短信接口设置 + * @return 结果 + */ + public int insertLsSmsSetting(LsSmsSetting lsSmsSetting); + + /** + * 修改短信接口设置 + * + * @param lsSmsSetting 短信接口设置 + * @return 结果 + */ + public int updateLsSmsSetting(LsSmsSetting lsSmsSetting); + + /** + * 批量删除短信接口设置 + * + * @param ids 需要删除的短信接口设置ID + * @return 结果 + */ + public int deleteLsSmsSettingByIds(Long[] ids); + + /** + * 删除短信接口设置信息 + * + * @param id 短信接口设置ID + * @return 结果 + */ + public int deleteLsSmsSettingById(Long id); +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/setting/service/ILsStationLetterService.java b/ruoyi-segchk/src/main/java/com/ruoyi/setting/service/ILsStationLetterService.java new file mode 100644 index 0000000..c352bfa --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/setting/service/ILsStationLetterService.java @@ -0,0 +1,105 @@ +package com.ruoyi.setting.service; + +import com.ruoyi.setting.domain.LsStationLetter; +import com.ruoyi.util.PageHelper; + +import java.util.List; + +/** + * 站内信Service接口 + * + * @author 魔金商城 + * @date 2020-07-29 + */ +public interface ILsStationLetterService { + /** + * 查询站内信 + * + * @param id 站内信ID + * @return 站内信 + */ + public LsStationLetter selectLsStationLetterById(Long id); + + /** + * 查询站内信列表 + * + * @param lsStationLetter 站内信 + * @return 站内信集合 + */ + public List selectLsStationLetterList(LsStationLetter lsStationLetter); + + /** + * 新增站内信 + * + * @param lsStationLetter 站内信 + * @return 结果 + */ + public int insertLsStationLetter(LsStationLetter lsStationLetter); + + /** + * 修改站内信 + * + * @param lsStationLetter 站内信 + * @return 结果 + */ + public int updateLsStationLetter(LsStationLetter lsStationLetter); + + /** + * 批量删除站内信 + * + * @param ids 需要删除的站内信ID + * @return 结果 + */ + public int deleteLsStationLetterByIds(Long[] ids); + + /** + * 删除站内信信息 + * + * @param id 站内信ID + * @return 结果 + */ + public int deleteLsStationLetterById(Long id); + + /** + * 新增站内信 + * + * @param stationLetters 站内信集合 + * @return 成功返回>1 失败返回0 + */ + int addStationLetters(List stationLetters); + + /** + * 删除站内信 + * + * @param id 站内信id + * @return 成功返回1,失败返回0 + */ + int deleteStationLetters(long id); + + /** + * 根据会员di查询会员的站内信 + * + * @param pageHelper 分页帮助类 + * @param customerId 会员id + * @return 返回会员的站内信 + */ + PageHelper queryStationLettersByCustomerId(PageHelper pageHelper, long customerId); + + /** + * 更新会员的站内信的阅读状态 + * + * @param id 站内信id + * @param customerId 用户id + * @return 成功返回1,失败返回0 + */ + int updateStationLettersIsRead(long id, long customerId); + + /** + * 获得用户未读的消息数量 + * + * @param customerId 会员id + * @return 返回用户未读消息的数量 + */ + int unReadNum(long customerId); + +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/setting/service/ILsSystemSeoService.java b/ruoyi-segchk/src/main/java/com/ruoyi/setting/service/ILsSystemSeoService.java new file mode 100644 index 0000000..75851c1 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/setting/service/ILsSystemSeoService.java @@ -0,0 +1,61 @@ +package com.ruoyi.setting.service; + +import com.ruoyi.setting.domain.LsSystemSeo; + +import java.util.List; + +/** + * 系统seo设置Service接口 + * + * @author 魔金商城 + * @date 2020-07-29 + */ +public interface ILsSystemSeoService { + /** + * 查询系统seo设置 + * + * @param id 系统seo设置ID + * @return 系统seo设置 + */ + public LsSystemSeo selectLsSystemSeoById(Long id); + + /** + * 查询系统seo设置列表 + * + * @param lsSystemSeo 系统seo设置 + * @return 系统seo设置集合 + */ + public List selectLsSystemSeoList(LsSystemSeo lsSystemSeo); + + /** + * 新增系统seo设置 + * + * @param lsSystemSeo 系统seo设置 + * @return 结果 + */ + public int insertLsSystemSeo(LsSystemSeo lsSystemSeo); + + /** + * 修改系统seo设置 + * + * @param lsSystemSeo 系统seo设置 + * @return 结果 + */ + public int updateLsSystemSeo(LsSystemSeo lsSystemSeo); + + /** + * 批量删除系统seo设置 + * + * @param ids 需要删除的系统seo设置ID + * @return 结果 + */ + public int deleteLsSystemSeoByIds(Long[] ids); + + /** + * 删除系统seo设置信息 + * + * @param id 系统seo设置ID + * @return 结果 + */ + public int deleteLsSystemSeoById(Long id); +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/setting/service/ILsWxCustomerLinkService.java b/ruoyi-segchk/src/main/java/com/ruoyi/setting/service/ILsWxCustomerLinkService.java new file mode 100644 index 0000000..b2d328a --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/setting/service/ILsWxCustomerLinkService.java @@ -0,0 +1,61 @@ +package com.ruoyi.setting.service; + +import com.ruoyi.setting.domain.LsWxCustomerLink; + +import java.util.List; + +/** + * 微信登录和商城用户的关联Service接口 + * + * @author 魔金商城 + * @date 2020-07-29 + */ +public interface ILsWxCustomerLinkService { + /** + * 查询微信登录和商城用户的关联 + * + * @param id 微信登录和商城用户的关联ID + * @return 微信登录和商城用户的关联 + */ + public LsWxCustomerLink selectLsWxCustomerLinkById(Long id); + + /** + * 查询微信登录和商城用户的关联列表 + * + * @param lsWxCustomerLink 微信登录和商城用户的关联 + * @return 微信登录和商城用户的关联集合 + */ + public List selectLsWxCustomerLinkList(LsWxCustomerLink lsWxCustomerLink); + + /** + * 新增微信登录和商城用户的关联 + * + * @param lsWxCustomerLink 微信登录和商城用户的关联 + * @return 结果 + */ + public int insertLsWxCustomerLink(LsWxCustomerLink lsWxCustomerLink); + + /** + * 修改微信登录和商城用户的关联 + * + * @param lsWxCustomerLink 微信登录和商城用户的关联 + * @return 结果 + */ + public int updateLsWxCustomerLink(LsWxCustomerLink lsWxCustomerLink); + + /** + * 批量删除微信登录和商城用户的关联 + * + * @param ids 需要删除的微信登录和商城用户的关联ID + * @return 结果 + */ + public int deleteLsWxCustomerLinkByIds(Long[] ids); + + /** + * 删除微信登录和商城用户的关联信息 + * + * @param id 微信登录和商城用户的关联ID + * @return 结果 + */ + public int deleteLsWxCustomerLinkById(Long id); +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/setting/service/ISCommunityBuySettingService.java b/ruoyi-segchk/src/main/java/com/ruoyi/setting/service/ISCommunityBuySettingService.java new file mode 100644 index 0000000..c620b1a --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/setting/service/ISCommunityBuySettingService.java @@ -0,0 +1,61 @@ +package com.ruoyi.setting.service; + +import com.ruoyi.setting.domain.SCommunityBuySetting; + +import java.util.List; + +/** + * 社区团购设置Service接口 + * + * @author 魔金商城 + * @date 2020-07-28 + */ +public interface ISCommunityBuySettingService { + /** + * 查询社区团购设置 + * + * @param id 社区团购设置ID + * @return 社区团购设置 + */ + public SCommunityBuySetting selectSCommunityBuySettingById(Long id); + + /** + * 查询社区团购设置列表 + * + * @param sCommunityBuySetting 社区团购设置 + * @return 社区团购设置集合 + */ + public List selectSCommunityBuySettingList(SCommunityBuySetting sCommunityBuySetting); + + /** + * 新增社区团购设置 + * + * @param sCommunityBuySetting 社区团购设置 + * @return 结果 + */ + public int insertSCommunityBuySetting(SCommunityBuySetting sCommunityBuySetting); + + /** + * 修改社区团购设置 + * + * @param sCommunityBuySetting 社区团购设置 + * @return 结果 + */ + public int updateSCommunityBuySetting(SCommunityBuySetting sCommunityBuySetting); + + /** + * 批量删除社区团购设置 + * + * @param ids 需要删除的社区团购设置ID + * @return 结果 + */ + public int deleteSCommunityBuySettingByIds(Long[] ids); + + /** + * 删除社区团购设置信息 + * + * @param id 社区团购设置ID + * @return 结果 + */ + public int deleteSCommunityBuySettingById(Long id); +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/setting/service/OssService.java b/ruoyi-segchk/src/main/java/com/ruoyi/setting/service/OssService.java new file mode 100644 index 0000000..f59a877 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/setting/service/OssService.java @@ -0,0 +1,61 @@ +package com.ruoyi.setting.service; + + +import com.ruoyi.setting.bean.OssSetting; +import com.ruoyi.setting.bean.UploadData; + +import java.util.List; + +/** + * Created by luozhuo on 2020/7/7. + * 云存储服务接口 + */ +public interface OssService { + + /** + * 上传到云存储 + * + * @param uploadDatas 上传的参数 + * @return 返回图片在云存储的地址 + */ + List uploadToQqOss(List uploadDatas); + + /** + * 上传到腾讯云存储(上传base64图片) + * + * @param uploadDatas 上传的参数 + * @return 返回图片在云存储的地址 + */ + List uploadToQqOssForBase64(List uploadDatas); + + /** + * 上传到腾讯云存储 + * + * @param uploadDatas 上传的参数 + * @return 返回图片在云存储的地址 + */ + List uploadToOss(List uploadDatas); + + /** + * 上传到云存储(上传base64图片) + * + * @param uploadDatas 上传的参数 + * @return 返回图片在云存储的地址 + */ + List uploadToOssForBase64(List uploadDatas); + + /** + * 查询系统设置的云存储信息 + * + * @return 返回云存储信息 + */ + OssSetting queryOssSetting(); + + /** + * 修改云存储设置信息 + * + * @param OssSetting 云存储设置实体 + * @return 成功返回1 失败返回0 + */ + int updateOss(OssSetting OssSetting); +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/setting/service/impl/AreaServiceImpl.java b/ruoyi-segchk/src/main/java/com/ruoyi/setting/service/impl/AreaServiceImpl.java new file mode 100644 index 0000000..339eefe --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/setting/service/impl/AreaServiceImpl.java @@ -0,0 +1,270 @@ +package com.ruoyi.setting.service.impl; + + +import com.ruoyi.common.utils.spring.SpringUtils; +import com.ruoyi.setting.domain.LsCity; +import com.ruoyi.setting.domain.LsDistrict; +import com.ruoyi.setting.domain.LsProvince; +import com.ruoyi.setting.mapper.AreaMapper; +import com.ruoyi.setting.service.AreaService; +import com.ruoyi.setting.vo.AreaItem; +import com.ruoyi.setting.vo.Locality; +import com.ruoyi.util.RedisCahceKey; +import org.apache.commons.lang.ArrayUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.cache.annotation.CacheEvict; +import org.springframework.cache.annotation.Cacheable; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** + * Created by 魔金商城 on 17/5/15 + * 地区服务实现接口 + */ +@Service +public class AreaServiceImpl implements AreaService { + + /** + * 调试日志 + */ + private Logger logger = LoggerFactory.getLogger(AreaServiceImpl.class); + + /** + * 地区数据库接口 + */ + @Autowired + private AreaMapper areaMapper; + + @Cacheable(value = RedisCahceKey.AREA, key = "'AREA'+#areaItems.hashCode()") + @Override + public List queryAllProvinces(AreaItem... areaItems) { + logger.debug("queryAllProvinces.....areaItems:{}", areaItems); + + List provinces = areaMapper.queryAllProvinces(); + + // 如果没有省则直接返回 + if (CollectionUtils.isEmpty(provinces)) { + return provinces; + } + + // 设置省下面的市 + if (ArrayUtils.contains(areaItems, AreaItem.CITY)) { + provinces.parallelStream().forEach(province -> province.setChild(this.queryCityByProvinceId(province.getId()))); + } + + // 设置市下面的区 + if (ArrayUtils.contains(areaItems, AreaItem.DISTRICT)) { + provinces.parallelStream().forEach(province -> province.getChild().stream().forEach(city -> city.setChild(this.queryDistrictByCityId(city.getId())))); + } + + // 查询所有省市区 + if (ArrayUtils.contains(areaItems, AreaItem.ALL)) { + provinces.parallelStream().forEach(province -> province.setChild(this.queryCityByProvinceId(province.getId()))); + provinces.parallelStream().forEach(province -> province.getChild().stream().forEach(city -> city.setChild(this.queryDistrictByCityId(city.getId())))); + } + + return provinces; + } + + + /** + * 查询所有地区信息(特殊数据接口) + * + * @return 所有地区信息 + */ + @Override + public List queryAllLocality() { + logger.debug("queryAllLocality...."); + + List provinceList = SpringUtils.getBean(AreaService.class).queryAllProvinces(AreaItem.ALL); + + //初始化返回集合 + List localities = new ArrayList<>(); + + //构建数据结构 + for (int i = 0, size = provinceList.size(); i < size; i++) { + //省份 + localities.add(new Locality(provinceList.get(i).getName(), "P-" + provinceList.get(i).getId(), "0", provinceList.get(i).getId())); + for (int k = 0; k < provinceList.get(i).getChild().size(); k++) { + //城市 + localities.add(new Locality(provinceList.get(i).getChild().get(k).getName(), "C-" + provinceList.get(i).getChild().get(k).getId(), "P-" + provinceList.get(i).getChild().get(k).getProvinceId(), provinceList.get(i).getChild().get(k).getId())); + for (int j = 0; j < provinceList.get(i).getChild().get(k).getChild().size(); j++) { + //地区 + localities.add(new Locality(provinceList.get(i).getChild().get(k).getChild().get(j).getName(), "D-" + provinceList.get(i).getChild().get(k).getChild().get(j).getId(), "C-" + provinceList.get(i).getChild().get(k).getId(), provinceList.get(i).getChild().get(k).getChild().get(j).getId())); + } + } + } + + return localities; + + } + + + @Override + public List queryCityByProvinceId(long provinceId) { + logger.debug("queryCityByProvinceId and provinceId:{}", provinceId); + return areaMapper.queryCityByProvinceId(provinceId); + } + + @Override + public List queryDistrictByCityId(long cityId) { + logger.debug("queryDistrictByCityId and cityId:{}", cityId); + return areaMapper.queryDistrictByCityId(cityId); + } + + @CacheEvict(value = RedisCahceKey.AREA, allEntries = true) + @Override + public int addProvince(LsProvince province) { + logger.debug("addProvince and province:{}", province); + + if (Objects.isNull(province)) { + logger.error("addProvince fail due to province is null...."); + return 0; + } + return areaMapper.addProvince(province); + } + + @CacheEvict(value = RedisCahceKey.AREA, allEntries = true) + @Override + public int addCity(LsCity city) { + logger.debug("addCity and city :{}", city); + if (Objects.isNull(city)) { + logger.error("addCity fail due to city is null...."); + return 0; + } + return areaMapper.addCity(city); + } + + @CacheEvict(value = RedisCahceKey.AREA, allEntries = true) + @Override + public int addDistrict(LsDistrict district) { + + logger.debug("addDistrict and district:{}", district); + + if (Objects.isNull(district)) { + logger.error("addDistrict fail due to district is null..."); + return 0; + } + return areaMapper.addDistrict(district); + } + + @CacheEvict(value = RedisCahceKey.AREA, allEntries = true) + @Override + public int deleteProvinceById(long provinceId) { + logger.debug("deleteProvinceById and provinceId:{}", provinceId); + + if (!isProvinceCanDelete(provinceId)) { + logger.error("deleteProvinceById fail due to province has city..."); + return -1; + } + + return areaMapper.deleteProvinceById(provinceId); + } + + @CacheEvict(value = RedisCahceKey.AREA, allEntries = true) + @Override + public int deleteCityById(long cityId) { + logger.debug("deleteCityById and cityId:{}", cityId); + + if (!isCityCanDelete(cityId)) { + logger.error("deleteCityById fail due to city has district"); + return -1; + } + return areaMapper.deleteCityById(cityId); + } + + @CacheEvict(value = RedisCahceKey.AREA, allEntries = true) + @Override + public int deleteDistrictById(long districtId) { + logger.debug("deleteDistrictById and districtId:{}", districtId); + return areaMapper.deleteDistrictById(districtId); + } + + + @Override + public LsProvince queryProvinceById(long id) { + logger.debug("queryProvinceById and id:{}", id); + return areaMapper.queryProvinceById(id); + } + + @Override + public LsCity queryCityById(long id) { + logger.debug("queryCityById and id:{}", id); + return areaMapper.queryCityById(id); + } + + @Override + public LsDistrict queryDistrictById(long id) { + logger.debug("queryDistrictById and id :{}", id); + return areaMapper.queryDistrictById(id); + } + + @CacheEvict(value = RedisCahceKey.AREA, allEntries = true) + @Override + public int updateProvince(LsProvince province) { + logger.debug("updateProvince and province:{}", province); + if (Objects.isNull(province)) { + logger.error("updateProvince fail ..."); + return 0; + } + return areaMapper.updateProvince(province); + } + + @CacheEvict(value = RedisCahceKey.AREA, allEntries = true) + @Override + public int updateCity(LsCity city) { + logger.debug("updateCity and city:{}", city); + + if (Objects.isNull(city)) { + logger.error("updateCity fail..."); + return 0; + } + return areaMapper.updateCity(city); + } + + @CacheEvict(value = RedisCahceKey.AREA, allEntries = true) + @Override + public int updateDistrict(LsDistrict district) { + logger.debug("updateDistrict and district:{}", district); + + if (Objects.isNull(district)) { + logger.error("updateDistrict fail...."); + return 0; + } + return areaMapper.updateDistrict(district); + } + + @Override + public long queryCityIdByName(String cityName) { + logger.debug("queryCityIdByName and cityName:{}", cityName); + Long cityId = areaMapper.queryCityIdByName(cityName); + return Objects.isNull(cityId) ? -1 : cityId; + } + + + /** + * 判断市是否可以删除 + * + * @param cityId 市id + * @return 可以返回true 不可以返回false 市下面有区则不能删除 + */ + private boolean isCityCanDelete(long cityId) { + return CollectionUtils.isEmpty(this.queryDistrictByCityId(cityId)); + } + + /** + * 判断省份是否可以删除 + * + * @param provinceId 省份id + * @return 可以删除 返回true 不可以删除 返回false (省份下面有市则不能删除) + */ + private boolean isProvinceCanDelete(long provinceId) { + return CollectionUtils.isEmpty(this.queryCityByProvinceId(provinceId)); + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/setting/service/impl/BaseInfoSetServiceImpl.java b/ruoyi-segchk/src/main/java/com/ruoyi/setting/service/impl/BaseInfoSetServiceImpl.java new file mode 100644 index 0000000..c600301 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/setting/service/impl/BaseInfoSetServiceImpl.java @@ -0,0 +1,116 @@ +package com.ruoyi.setting.service.impl; + +import com.ruoyi.setting.bean.BaseInfoSet; +import com.ruoyi.setting.mapper.BaseInfoSetMapper; +import com.ruoyi.setting.service.BaseInfoSetService; +import com.ruoyi.util.RedisCahceKey; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.cache.annotation.CacheEvict; +import org.springframework.cache.annotation.Cacheable; +import org.springframework.stereotype.Service; + +/** + * 基本信息设置service实现类 + * + * @author 魔金商城 on 2017/5/17. + */ +@Service +public class BaseInfoSetServiceImpl implements BaseInfoSetService { + + /** + * 调试日志 + */ + private Logger logger = LoggerFactory.getLogger(BaseInfoSetServiceImpl.class); + + /** + * 注入信息设置mapper + */ + @Autowired + private BaseInfoSetMapper baseInfoSetMapper; + + /** + * 查询基本信息和高级信息设置 + * + * @return 基本信息和高级信息设置实体类 + */ + @Cacheable(value = RedisCahceKey.BASE_INFO_SET, key = "'BaseInfoSet'") + @Override + public BaseInfoSet queryBaseInfoSet() { + logger.debug("queryBaseInfoSet..."); + return baseInfoSetMapper.queryBaseInfoSet(); + } + + /** + * 编辑基本信息和高级信息 + * + * @param baseInfoSet 基本信息实体类 + * @param type 1 基本信息 0高级信息 + * @return -1编辑失败 1编辑成功 0编辑失败 + */ + @CacheEvict(value = RedisCahceKey.BASE_INFO_SET, allEntries = true) + @Override + public int editBaseInfoSet(BaseInfoSet baseInfoSet, int type) { + logger.debug("editBaseInfoSet and baseInfoSet:{}\r\n type:{}", baseInfoSet, type); + //非法参数 + if (!checkParam(type)) { + logger.error("editBaseInfoSet error due to type is illegal..."); + return -1; + } + baseInfoSet.dealPicUrl(); + //设置基本信息 + if (type == 1) { + logger.debug("editBaseInfoSet to editBaseInfoSetA and type:{}", type); + return baseInfoSetMapper.editBaseInfoSetA(baseInfoSet); + } + //设置高级信息 + if (type == 0) { + logger.debug("editBaseInfoSet to editBaseInfoSetB and type:{}", type); + return baseInfoSetMapper.editBaseInfoSetB(baseInfoSet); + } + return 0; + } + + /** + * 设置审核开关 + * + * @param storeSpuAudit 店铺商品审核开关 0 需要审核 1 不需要 默认0 + * @return 成功返回1,失败返回0 + */ + @CacheEvict(value = RedisCahceKey.BASE_INFO_SET, allEntries = true) + @Override + public int setAuditSwitch(String storeSpuAudit) { + logger.debug("setAuditSwitch and storeSpuAudit :{}", storeSpuAudit); + return baseInfoSetMapper.setAuditSwitch(storeSpuAudit); + } + + /** + * 设置会员价启用状态 + * + * @param memberPriceStatus 会员等级启用状态 0 启用 1 不启用 默认0 + * @return 成功返回1,失败返回0 + */ + @CacheEvict(value = RedisCahceKey.BASE_INFO_SET, allEntries = true) + @Override + public int setMemberPriceStatus(String memberPriceStatus) { + logger.debug("setMemberPriceStatus and memberPriceStatus :{}", memberPriceStatus); + return baseInfoSetMapper.setMemberPriceStatus(memberPriceStatus); + } + + @Override + public boolean isSkuNeedAudit() { + return queryBaseInfoSet().isSpuNeedAudit(); + } + + /** + * 校验参数是否为 0 或 1 + * + * @param type 参数 + * @return 正确true 错误 FALSE + */ + private boolean checkParam(int type) { + return type == 1 || type == 0; + } + +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/setting/service/impl/LsCityServiceImpl.java b/ruoyi-segchk/src/main/java/com/ruoyi/setting/service/impl/LsCityServiceImpl.java new file mode 100644 index 0000000..79a1ffd --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/setting/service/impl/LsCityServiceImpl.java @@ -0,0 +1,92 @@ +package com.ruoyi.setting.service.impl; + +import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.setting.domain.LsCity; +import com.ruoyi.setting.mapper.LsCityMapper; +import com.ruoyi.setting.service.ILsCityService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 区域市Service业务层处理 + * + * @author 魔金商城 + * @date 2020-07-29 + */ +@Service +public class LsCityServiceImpl implements ILsCityService { + private static final Logger logger = LoggerFactory.getLogger(LsCityServiceImpl.class); + @Autowired + private LsCityMapper lsCityMapper; + + /** + * 查询区域市 + * + * @param id 区域市ID + * @return 区域市 + */ + @Override + public LsCity selectLsCityById(Long id) { + return lsCityMapper.selectLsCityById(id); + } + + /** + * 查询区域市列表 + * + * @param lsCity 区域市 + * @return 区域市 + */ + @Override + public List selectLsCityList(LsCity lsCity) { + return lsCityMapper.selectLsCityList(lsCity); + } + + /** + * 新增区域市 + * + * @param lsCity 区域市 + * @return 结果 + */ + @Override + public int insertLsCity(LsCity lsCity) { + lsCity.setCreateTime(DateUtils.getNowDate()); + return lsCityMapper.insertLsCity(lsCity); + } + + /** + * 修改区域市 + * + * @param lsCity 区域市 + * @return 结果 + */ + @Override + public int updateLsCity(LsCity lsCity) { + return lsCityMapper.updateLsCity(lsCity); + } + + /** + * 批量删除区域市 + * + * @param ids 需要删除的区域市ID + * @return 结果 + */ + @Override + public int deleteLsCityByIds(Long[] ids) { + return lsCityMapper.deleteLsCityByIds(ids); + } + + /** + * 删除区域市信息 + * + * @param id 区域市ID + * @return 结果 + */ + @Override + public int deleteLsCityById(Long id) { + return lsCityMapper.deleteLsCityById(id); + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/setting/service/impl/LsDistrictServiceImpl.java b/ruoyi-segchk/src/main/java/com/ruoyi/setting/service/impl/LsDistrictServiceImpl.java new file mode 100644 index 0000000..2bbca57 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/setting/service/impl/LsDistrictServiceImpl.java @@ -0,0 +1,92 @@ +package com.ruoyi.setting.service.impl; + +import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.setting.domain.LsDistrict; +import com.ruoyi.setting.mapper.LsDistrictMapper; +import com.ruoyi.setting.service.ILsDistrictService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 区域区Service业务层处理 + * + * @author 魔金商城 + * @date 2020-07-29 + */ +@Service +public class LsDistrictServiceImpl implements ILsDistrictService { + private static final Logger logger = LoggerFactory.getLogger(LsDistrictServiceImpl.class); + @Autowired + private LsDistrictMapper lsDistrictMapper; + + /** + * 查询区域区 + * + * @param id 区域区ID + * @return 区域区 + */ + @Override + public LsDistrict selectLsDistrictById(Long id) { + return lsDistrictMapper.selectLsDistrictById(id); + } + + /** + * 查询区域区列表 + * + * @param lsDistrict 区域区 + * @return 区域区 + */ + @Override + public List selectLsDistrictList(LsDistrict lsDistrict) { + return lsDistrictMapper.selectLsDistrictList(lsDistrict); + } + + /** + * 新增区域区 + * + * @param lsDistrict 区域区 + * @return 结果 + */ + @Override + public int insertLsDistrict(LsDistrict lsDistrict) { + lsDistrict.setCreateTime(DateUtils.getNowDate()); + return lsDistrictMapper.insertLsDistrict(lsDistrict); + } + + /** + * 修改区域区 + * + * @param lsDistrict 区域区 + * @return 结果 + */ + @Override + public int updateLsDistrict(LsDistrict lsDistrict) { + return lsDistrictMapper.updateLsDistrict(lsDistrict); + } + + /** + * 批量删除区域区 + * + * @param ids 需要删除的区域区ID + * @return 结果 + */ + @Override + public int deleteLsDistrictByIds(Long[] ids) { + return lsDistrictMapper.deleteLsDistrictByIds(ids); + } + + /** + * 删除区域区信息 + * + * @param id 区域区ID + * @return 结果 + */ + @Override + public int deleteLsDistrictById(Long id) { + return lsDistrictMapper.deleteLsDistrictById(id); + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/setting/service/impl/LsEmailSettingServiceImpl.java b/ruoyi-segchk/src/main/java/com/ruoyi/setting/service/impl/LsEmailSettingServiceImpl.java new file mode 100644 index 0000000..38c3b1f --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/setting/service/impl/LsEmailSettingServiceImpl.java @@ -0,0 +1,90 @@ +package com.ruoyi.setting.service.impl; + +import com.ruoyi.setting.domain.LsEmailSetting; +import com.ruoyi.setting.mapper.LsEmailSettingMapper; +import com.ruoyi.setting.service.ILsEmailSettingService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 邮箱设置Service业务层处理 + * + * @author 魔金商城 + * @date 2020-07-28 + */ +@Service +public class LsEmailSettingServiceImpl implements ILsEmailSettingService { + private static final Logger logger = LoggerFactory.getLogger(LsEmailSettingServiceImpl.class); + @Autowired + private LsEmailSettingMapper lsEmailSettingMapper; + + /** + * 查询邮箱设置 + * + * @param id 邮箱设置ID + * @return 邮箱设置 + */ + @Override + public LsEmailSetting selectLsEmailSettingById(Long id) { + return lsEmailSettingMapper.selectLsEmailSettingById(id); + } + + /** + * 查询邮箱设置列表 + * + * @param lsEmailSetting 邮箱设置 + * @return 邮箱设置 + */ + @Override + public List selectLsEmailSettingList(LsEmailSetting lsEmailSetting) { + return lsEmailSettingMapper.selectLsEmailSettingList(lsEmailSetting); + } + + /** + * 新增邮箱设置 + * + * @param lsEmailSetting 邮箱设置 + * @return 结果 + */ + @Override + public int insertLsEmailSetting(LsEmailSetting lsEmailSetting) { + return lsEmailSettingMapper.insertLsEmailSetting(lsEmailSetting); + } + + /** + * 修改邮箱设置 + * + * @param lsEmailSetting 邮箱设置 + * @return 结果 + */ + @Override + public int updateLsEmailSetting(LsEmailSetting lsEmailSetting) { + return lsEmailSettingMapper.updateLsEmailSetting(lsEmailSetting); + } + + /** + * 批量删除邮箱设置 + * + * @param ids 需要删除的邮箱设置ID + * @return 结果 + */ + @Override + public int deleteLsEmailSettingByIds(Long[] ids) { + return lsEmailSettingMapper.deleteLsEmailSettingByIds(ids); + } + + /** + * 删除邮箱设置信息 + * + * @param id 邮箱设置ID + * @return 结果 + */ + @Override + public int deleteLsEmailSettingById(Long id) { + return lsEmailSettingMapper.deleteLsEmailSettingById(id); + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/setting/service/impl/LsPaySettingServiceImpl.java b/ruoyi-segchk/src/main/java/com/ruoyi/setting/service/impl/LsPaySettingServiceImpl.java new file mode 100644 index 0000000..26f8a1b --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/setting/service/impl/LsPaySettingServiceImpl.java @@ -0,0 +1,172 @@ +package com.ruoyi.setting.service.impl; + +import com.ruoyi.setting.bean.PaySet; +import com.ruoyi.setting.bean.PaySetCommon; +import com.ruoyi.setting.domain.SegchkPaySetting; +import com.ruoyi.setting.mapper.SegchkPaySettingMapper; +import com.ruoyi.setting.service.ILsPaySettingService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +/** + * 支付设置Service业务层处理 + * + * @author 魔金商城 + * @date 2020-07-28 + */ +@Service +public class LsPaySettingServiceImpl implements ILsPaySettingService { + private static final Logger logger = LoggerFactory.getLogger(LsPaySettingServiceImpl.class); + /** + * 支付类型列表 + */ + private final static List codeTypeList = Arrays.asList("1", "2", "3", "4", "5", "6"); + @Autowired + private SegchkPaySettingMapper segchkPaySettingMapper; + + /** + * 查询支付设置 + * + * @param id 支付设置ID + * @return 支付设置 + */ + @Override + public SegchkPaySetting selectLsPaySettingById(Long id) { + return segchkPaySettingMapper.selectLsPaySettingById(id); + } + + /** + * 查询支付接口设置 + * + * @return 返回PaySetCommon + */ + @Override + public PaySetCommon queryPaySet() { + logger.debug("queryPaySet..."); + return PaySetCommon.getPaySetCommon(new PaySetCommon(), segchkPaySettingMapper.queryPaySet()); + } + + /** + * 编辑支付接口设置 + * + * @param paySetCommon 实体类参数 + * @param codeType 支付设置类型 1 支付宝 2 微信(扫码,公众号,H5) 3 银联 4预存款 5 微信支app付 6微信小程序支付 + * @return -1编辑出错 >=1成功 + */ + @Override + @Transactional + public int editPaySet(PaySetCommon paySetCommon, String codeType) { + List list = new ArrayList<>(); + if (codeTypeList.indexOf(codeType) < 0) { + logger.error("editPaySet error codeType is illegal"); + return -1; + } + //先删后增 + segchkPaySettingMapper.deletePaySet(codeType); + if ("1".equals(codeType)) { + logger.debug("editPaySet aliPay..."); + list.add(PaySet.getPaySet(new PaySet(), codeType, paySetCommon.getAliPaySet().getAppId(), "appId")); + list.add(PaySet.getPaySet(new PaySet(), codeType, paySetCommon.getAliPaySet().getAlipayPublicKey(), "alipayPublicKey")); + list.add(PaySet.getPaySet(new PaySet(), codeType, paySetCommon.getAliPaySet().getAppPrivateKey(), "appPrivateKey")); + list.add(PaySet.getPaySet(new PaySet(), codeType, paySetCommon.getAliPaySet().getIsUse(), "isUse")); + } + if ("2".equals(codeType)) { + logger.debug("editPaySet wechatPay..."); + list.add(PaySet.getPaySet(new PaySet(), codeType, paySetCommon.getWechatPaySet().getAppId(), "appId")); + list.add(PaySet.getPaySet(new PaySet(), codeType, paySetCommon.getWechatPaySet().getAppSecret(), "appSecret")); + list.add(PaySet.getPaySet(new PaySet(), codeType, paySetCommon.getWechatPaySet().getMerchantNum(), "merchantNum")); + list.add(PaySet.getPaySet(new PaySet(), codeType, paySetCommon.getWechatPaySet().getApiKey(), "apiKey")); + list.add(PaySet.getPaySet(new PaySet(), codeType, paySetCommon.getWechatPaySet().getLoginNotice(), "loginNotice")); + list.add(PaySet.getPaySet(new PaySet(), codeType, paySetCommon.getWechatPaySet().getIsUse(), "isUse")); + } + if ("3".equals(codeType)) { + logger.debug("editPaySet unionPay..."); + list.add(PaySet.getPaySet(new PaySet(), codeType, paySetCommon.getUnionPaySet().getMerchantNum(), "merchantNum")); + list.add(PaySet.getPaySet(new PaySet(), codeType, paySetCommon.getUnionPaySet().getApiKey(), "apiKey")); + list.add(PaySet.getPaySet(new PaySet(), codeType, paySetCommon.getUnionPaySet().getIsUse(), "isUse")); + } + if ("4".equals(codeType)) { + logger.debug("editPaySet prePay..."); + list.add(PaySet.getPaySet(new PaySet(), codeType, paySetCommon.getPrePaySet().getIsUse(), "isUse")); + } + if ("5".equals(codeType)) { + logger.debug("editPaySet wechatAppPay..."); + list.add(PaySet.getPaySet(new PaySet(), codeType, paySetCommon.getWechatAppPaySet().getAppId(), "appId")); + list.add(PaySet.getPaySet(new PaySet(), codeType, paySetCommon.getWechatAppPaySet().getAppSecret(), "appSecret")); + list.add(PaySet.getPaySet(new PaySet(), codeType, paySetCommon.getWechatAppPaySet().getMerchantNum(), "merchantNum")); + list.add(PaySet.getPaySet(new PaySet(), codeType, paySetCommon.getWechatAppPaySet().getApiKey(), "apiKey")); + list.add(PaySet.getPaySet(new PaySet(), codeType, paySetCommon.getWechatAppPaySet().getIsUse(), "isUse")); + } + if ("6".equals(codeType)) { + logger.debug("editPaySet wechatAppletPay..."); + list.add(PaySet.getPaySet(new PaySet(), codeType, paySetCommon.getWechatAppletPaySet().getAppId(), "appId")); + list.add(PaySet.getPaySet(new PaySet(), codeType, paySetCommon.getWechatAppletPaySet().getAppSecret(), "appSecret")); + list.add(PaySet.getPaySet(new PaySet(), codeType, paySetCommon.getWechatAppletPaySet().getMerchantNum(), "merchantNum")); + list.add(PaySet.getPaySet(new PaySet(), codeType, paySetCommon.getWechatAppletPaySet().getApiKey(), "apiKey")); + list.add(PaySet.getPaySet(new PaySet(), codeType, paySetCommon.getWechatAppletPaySet().getIsUse(), "isUse")); + } + return segchkPaySettingMapper.addPaySet(list); + } + + /** + * 查询支付设置列表 + * + * @param segchkPaySetting 支付设置 + * @return 支付设置 + */ + @Override + public List selectLsPaySettingList(SegchkPaySetting segchkPaySetting) { + return segchkPaySettingMapper.selectLsPaySettingList(segchkPaySetting); + } + + /** + * 新增支付设置 + * + * @param segchkPaySetting 支付设置 + * @return 结果 + */ + @Override + public int insertLsPaySetting(SegchkPaySetting segchkPaySetting) { + return segchkPaySettingMapper.insertLsPaySetting(segchkPaySetting); + } + + /** + * 修改支付设置 + * + * @param segchkPaySetting 支付设置 + * @return 结果 + */ + @Override + public int updateLsPaySetting(SegchkPaySetting segchkPaySetting) { + return segchkPaySettingMapper.updateLsPaySetting(segchkPaySetting); + } + + /** + * 批量删除支付设置 + * + * @param ids 需要删除的支付设置ID + * @return 结果 + */ + @Override + public int deleteLsPaySettingByIds(Long[] ids) { + return segchkPaySettingMapper.deleteLsPaySettingByIds(ids); + } + + /** + * 删除支付设置信息 + * + * @param id 支付设置ID + * @return 结果 + */ + @Override + public int deleteLsPaySettingById(Long id) { + return segchkPaySettingMapper.deleteLsPaySettingById(id); + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/setting/service/impl/LsProvinceServiceImpl.java b/ruoyi-segchk/src/main/java/com/ruoyi/setting/service/impl/LsProvinceServiceImpl.java new file mode 100644 index 0000000..1e4fb0c --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/setting/service/impl/LsProvinceServiceImpl.java @@ -0,0 +1,92 @@ +package com.ruoyi.setting.service.impl; + +import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.setting.domain.LsProvince; +import com.ruoyi.setting.mapper.LsProvinceMapper; +import com.ruoyi.setting.service.ILsProvinceService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 区域省Service业务层处理 + * + * @author 魔金商城 + * @date 2020-07-29 + */ +@Service +public class LsProvinceServiceImpl implements ILsProvinceService { + private static final Logger logger = LoggerFactory.getLogger(LsProvinceServiceImpl.class); + @Autowired + private LsProvinceMapper lsProvinceMapper; + + /** + * 查询区域省 + * + * @param id 区域省ID + * @return 区域省 + */ + @Override + public LsProvince selectLsProvinceById(Long id) { + return lsProvinceMapper.selectLsProvinceById(id); + } + + /** + * 查询区域省列表 + * + * @param lsProvince 区域省 + * @return 区域省 + */ + @Override + public List selectLsProvinceList(LsProvince lsProvince) { + return lsProvinceMapper.selectLsProvinceList(lsProvince); + } + + /** + * 新增区域省 + * + * @param lsProvince 区域省 + * @return 结果 + */ + @Override + public int insertLsProvince(LsProvince lsProvince) { + lsProvince.setCreateTime(DateUtils.getNowDate()); + return lsProvinceMapper.insertLsProvince(lsProvince); + } + + /** + * 修改区域省 + * + * @param lsProvince 区域省 + * @return 结果 + */ + @Override + public int updateLsProvince(LsProvince lsProvince) { + return lsProvinceMapper.updateLsProvince(lsProvince); + } + + /** + * 批量删除区域省 + * + * @param ids 需要删除的区域省ID + * @return 结果 + */ + @Override + public int deleteLsProvinceByIds(Long[] ids) { + return lsProvinceMapper.deleteLsProvinceByIds(ids); + } + + /** + * 删除区域省信息 + * + * @param id 区域省ID + * @return 结果 + */ + @Override + public int deleteLsProvinceById(Long id) { + return lsProvinceMapper.deleteLsProvinceById(id); + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/setting/service/impl/LsSmsSettingServiceImpl.java b/ruoyi-segchk/src/main/java/com/ruoyi/setting/service/impl/LsSmsSettingServiceImpl.java new file mode 100644 index 0000000..05430f0 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/setting/service/impl/LsSmsSettingServiceImpl.java @@ -0,0 +1,90 @@ +package com.ruoyi.setting.service.impl; + +import com.ruoyi.setting.domain.LsSmsSetting; +import com.ruoyi.setting.mapper.LsSmsSettingMapper; +import com.ruoyi.setting.service.ILsSmsSettingService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 短信接口设置Service业务层处理 + * + * @author 魔金商城 + * @date 2020-07-28 + */ +@Service +public class LsSmsSettingServiceImpl implements ILsSmsSettingService { + private static final Logger logger = LoggerFactory.getLogger(LsSmsSettingServiceImpl.class); + @Autowired + private LsSmsSettingMapper lsSmsSettingMapper; + + /** + * 查询短信接口设置 + * + * @param id 短信接口设置ID + * @return 短信接口设置 + */ + @Override + public LsSmsSetting selectLsSmsSettingById(Long id) { + return lsSmsSettingMapper.selectLsSmsSettingById(id); + } + + /** + * 查询短信接口设置列表 + * + * @param lsSmsSetting 短信接口设置 + * @return 短信接口设置 + */ + @Override + public List selectLsSmsSettingList(LsSmsSetting lsSmsSetting) { + return lsSmsSettingMapper.selectLsSmsSettingList(lsSmsSetting); + } + + /** + * 新增短信接口设置 + * + * @param lsSmsSetting 短信接口设置 + * @return 结果 + */ + @Override + public int insertLsSmsSetting(LsSmsSetting lsSmsSetting) { + return lsSmsSettingMapper.insertLsSmsSetting(lsSmsSetting); + } + + /** + * 修改短信接口设置 + * + * @param lsSmsSetting 短信接口设置 + * @return 结果 + */ + @Override + public int updateLsSmsSetting(LsSmsSetting lsSmsSetting) { + return lsSmsSettingMapper.updateLsSmsSetting(lsSmsSetting); + } + + /** + * 批量删除短信接口设置 + * + * @param ids 需要删除的短信接口设置ID + * @return 结果 + */ + @Override + public int deleteLsSmsSettingByIds(Long[] ids) { + return lsSmsSettingMapper.deleteLsSmsSettingByIds(ids); + } + + /** + * 删除短信接口设置信息 + * + * @param id 短信接口设置ID + * @return 结果 + */ + @Override + public int deleteLsSmsSettingById(Long id) { + return lsSmsSettingMapper.deleteLsSmsSettingById(id); + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/setting/service/impl/LsStationLetterServiceImpl.java b/ruoyi-segchk/src/main/java/com/ruoyi/setting/service/impl/LsStationLetterServiceImpl.java new file mode 100644 index 0000000..d37857f --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/setting/service/impl/LsStationLetterServiceImpl.java @@ -0,0 +1,147 @@ +package com.ruoyi.setting.service.impl; + +import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.setting.domain.LsStationLetter; +import com.ruoyi.setting.mapper.LsStationLetterMapper; +import com.ruoyi.setting.service.ILsStationLetterService; +import com.ruoyi.util.PageHelper; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.util.*; + +/** + * 站内信Service业务层处理 + * + * @author 魔金商城 + * @date 2020-07-29 + */ +@Service +public class LsStationLetterServiceImpl implements ILsStationLetterService { + private static final Logger logger = LoggerFactory.getLogger(LsStationLetterServiceImpl.class); + @Autowired + private LsStationLetterMapper lsStationLetterMapper; + + /** + * 查询站内信 + * + * @param id 站内信ID + * @return 站内信 + */ + @Override + public LsStationLetter selectLsStationLetterById(Long id) { + return lsStationLetterMapper.selectLsStationLetterById(id); + } + + /** + * 查询站内信列表 + * + * @param lsStationLetter 站内信 + * @return 站内信 + */ + @Override + public List selectLsStationLetterList(LsStationLetter lsStationLetter) { + return lsStationLetterMapper.selectLsStationLetterList(lsStationLetter); + } + + /** + * 新增站内信 + * + * @param lsStationLetter 站内信 + * @return 结果 + */ + @Override + public int insertLsStationLetter(LsStationLetter lsStationLetter) { + lsStationLetter.setCreateTime(DateUtils.getNowDate()); + return lsStationLetterMapper.insertLsStationLetter(lsStationLetter); + } + + /** + * 修改站内信 + * + * @param lsStationLetter 站内信 + * @return 结果 + */ + @Override + public int updateLsStationLetter(LsStationLetter lsStationLetter) { + return lsStationLetterMapper.updateLsStationLetter(lsStationLetter); + } + + /** + * 批量删除站内信 + * + * @param ids 需要删除的站内信ID + * @return 结果 + */ + @Override + public int deleteLsStationLetterByIds(Long[] ids) { + return lsStationLetterMapper.deleteLsStationLetterByIds(ids); + } + + + @Override + public int addStationLetters(List stationLetters) { + logger.debug("addStationLetters and stationLetters:{}", stationLetters); + + if (CollectionUtils.isEmpty(stationLetters)) { + logger.error("addStationLetters fail due to params is null..."); + return 0; + } + return lsStationLetterMapper.addStationLetters(stationLetters); + } + + /** + * 删除站内信 + * + * @param id 站内信id + * @return 成功返回1,失败返回0 + */ + @Override + public int deleteStationLetters(long id) { + logger.debug("deleteStationLetters and id :{}", id); + return lsStationLetterMapper.deleteStationLetters(id); + } + + /** + * 更新会员的站内信的阅读状态 + * + * @param id 站内信id + * @return 成功返回1,失败返回0 + */ + @Override + public int updateStationLettersIsRead(long id, long customerId) { + logger.debug("updateStationLettersIsRead and id :{} \r\n customerId:{}", id, customerId); + Map params = new HashMap<>(); + params.put("id", id); + params.put("customerId", customerId); + return lsStationLetterMapper.updateStationLettersIsRead(params); + } + + @Override + public PageHelper queryStationLettersByCustomerId(PageHelper pageHelper, long customerId) { + logger.debug("queryStationLettersByCustomerId and customerId:{} and pageHelper:{}", customerId, pageHelper); + Map params = new HashMap<>(); + params.put("customerId", customerId); + return pageHelper.setListDates(lsStationLetterMapper.queryStationLettersByCustomerId(pageHelper.getQueryParams(params, lsStationLetterMapper.queryStationLettersCountByCustomerId(params)))); + } + + @Override + public int unReadNum(long customerId) { + logger.debug("unReadNum and customerId:{}", customerId); + return lsStationLetterMapper.unReadNum(customerId); + } + + /** + * 删除站内信信息 + * + * @param id 站内信ID + * @return 结果 + */ + @Override + public int deleteLsStationLetterById(Long id) { + return lsStationLetterMapper.deleteLsStationLetterById(id); + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/setting/service/impl/LsSystemSeoServiceImpl.java b/ruoyi-segchk/src/main/java/com/ruoyi/setting/service/impl/LsSystemSeoServiceImpl.java new file mode 100644 index 0000000..8c9622b --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/setting/service/impl/LsSystemSeoServiceImpl.java @@ -0,0 +1,90 @@ +package com.ruoyi.setting.service.impl; + +import com.ruoyi.setting.domain.LsSystemSeo; +import com.ruoyi.setting.mapper.LsSystemSeoMapper; +import com.ruoyi.setting.service.ILsSystemSeoService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 系统seo设置Service业务层处理 + * + * @author 魔金商城 + * @date 2020-07-29 + */ +@Service +public class LsSystemSeoServiceImpl implements ILsSystemSeoService { + private static final Logger logger = LoggerFactory.getLogger(LsSystemSeoServiceImpl.class); + @Autowired + private LsSystemSeoMapper lsSystemSeoMapper; + + /** + * 查询系统seo设置 + * + * @param id 系统seo设置ID + * @return 系统seo设置 + */ + @Override + public LsSystemSeo selectLsSystemSeoById(Long id) { + return lsSystemSeoMapper.selectLsSystemSeoById(id); + } + + /** + * 查询系统seo设置列表 + * + * @param lsSystemSeo 系统seo设置 + * @return 系统seo设置 + */ + @Override + public List selectLsSystemSeoList(LsSystemSeo lsSystemSeo) { + return lsSystemSeoMapper.selectLsSystemSeoList(lsSystemSeo); + } + + /** + * 新增系统seo设置 + * + * @param lsSystemSeo 系统seo设置 + * @return 结果 + */ + @Override + public int insertLsSystemSeo(LsSystemSeo lsSystemSeo) { + return lsSystemSeoMapper.insertLsSystemSeo(lsSystemSeo); + } + + /** + * 修改系统seo设置 + * + * @param lsSystemSeo 系统seo设置 + * @return 结果 + */ + @Override + public int updateLsSystemSeo(LsSystemSeo lsSystemSeo) { + return lsSystemSeoMapper.updateLsSystemSeo(lsSystemSeo); + } + + /** + * 批量删除系统seo设置 + * + * @param ids 需要删除的系统seo设置ID + * @return 结果 + */ + @Override + public int deleteLsSystemSeoByIds(Long[] ids) { + return lsSystemSeoMapper.deleteLsSystemSeoByIds(ids); + } + + /** + * 删除系统seo设置信息 + * + * @param id 系统seo设置ID + * @return 结果 + */ + @Override + public int deleteLsSystemSeoById(Long id) { + return lsSystemSeoMapper.deleteLsSystemSeoById(id); + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/setting/service/impl/LsWxCustomerLinkServiceImpl.java b/ruoyi-segchk/src/main/java/com/ruoyi/setting/service/impl/LsWxCustomerLinkServiceImpl.java new file mode 100644 index 0000000..92d1bd5 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/setting/service/impl/LsWxCustomerLinkServiceImpl.java @@ -0,0 +1,90 @@ +package com.ruoyi.setting.service.impl; + +import com.ruoyi.setting.domain.LsWxCustomerLink; +import com.ruoyi.setting.mapper.LsWxCustomerLinkMapper; +import com.ruoyi.setting.service.ILsWxCustomerLinkService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 微信登录和商城用户的关联Service业务层处理 + * + * @author 魔金商城 + * @date 2020-07-29 + */ +@Service +public class LsWxCustomerLinkServiceImpl implements ILsWxCustomerLinkService { + private static final Logger logger = LoggerFactory.getLogger(LsWxCustomerLinkServiceImpl.class); + @Autowired + private LsWxCustomerLinkMapper lsWxCustomerLinkMapper; + + /** + * 查询微信登录和商城用户的关联 + * + * @param id 微信登录和商城用户的关联ID + * @return 微信登录和商城用户的关联 + */ + @Override + public LsWxCustomerLink selectLsWxCustomerLinkById(Long id) { + return lsWxCustomerLinkMapper.selectLsWxCustomerLinkById(id); + } + + /** + * 查询微信登录和商城用户的关联列表 + * + * @param lsWxCustomerLink 微信登录和商城用户的关联 + * @return 微信登录和商城用户的关联 + */ + @Override + public List selectLsWxCustomerLinkList(LsWxCustomerLink lsWxCustomerLink) { + return lsWxCustomerLinkMapper.selectLsWxCustomerLinkList(lsWxCustomerLink); + } + + /** + * 新增微信登录和商城用户的关联 + * + * @param lsWxCustomerLink 微信登录和商城用户的关联 + * @return 结果 + */ + @Override + public int insertLsWxCustomerLink(LsWxCustomerLink lsWxCustomerLink) { + return lsWxCustomerLinkMapper.insertLsWxCustomerLink(lsWxCustomerLink); + } + + /** + * 修改微信登录和商城用户的关联 + * + * @param lsWxCustomerLink 微信登录和商城用户的关联 + * @return 结果 + */ + @Override + public int updateLsWxCustomerLink(LsWxCustomerLink lsWxCustomerLink) { + return lsWxCustomerLinkMapper.updateLsWxCustomerLink(lsWxCustomerLink); + } + + /** + * 批量删除微信登录和商城用户的关联 + * + * @param ids 需要删除的微信登录和商城用户的关联ID + * @return 结果 + */ + @Override + public int deleteLsWxCustomerLinkByIds(Long[] ids) { + return lsWxCustomerLinkMapper.deleteLsWxCustomerLinkByIds(ids); + } + + /** + * 删除微信登录和商城用户的关联信息 + * + * @param id 微信登录和商城用户的关联ID + * @return 结果 + */ + @Override + public int deleteLsWxCustomerLinkById(Long id) { + return lsWxCustomerLinkMapper.deleteLsWxCustomerLinkById(id); + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/setting/service/impl/OssServiceImpl.java b/ruoyi-segchk/src/main/java/com/ruoyi/setting/service/impl/OssServiceImpl.java new file mode 100644 index 0000000..6c743c9 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/setting/service/impl/OssServiceImpl.java @@ -0,0 +1,89 @@ +package com.ruoyi.setting.service.impl; + + +import com.ruoyi.setting.bean.OssSetting; +import com.ruoyi.setting.bean.UploadData; +import com.ruoyi.setting.mapper.OssMapper; +import com.ruoyi.setting.service.OssService; +import com.ruoyi.util.YunUploadUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.util.Arrays; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; + + +/** + * Created by luozhuo on 2020/7/7. + * 云存储服务实现类 + */ +@Service +public class OssServiceImpl implements OssService { + + private Logger logger = LoggerFactory.getLogger(OssServiceImpl.class); + + @Autowired + private OssMapper ossMapper; + + @Override + public List uploadToQqOss(List uploadDatas) { + logger.debug("Begin to uploadToQqOss...."); + if (CollectionUtils.isEmpty(uploadDatas)) { + logger.error("uploadDatas fail due to params is empty..."); + return Arrays.asList(""); + } + return uploadDatas.stream().filter(Objects::nonNull).map(uploadData -> YunUploadUtils.getInstance().uploadToQqOss(queryOssSetting().getUpYunConf(), uploadData.getMultipartFile(), uploadData.getDatas(), uploadData.getFileOriginName(), uploadData.getType())).collect(Collectors.toList()); + + } + + @Override + public List uploadToQqOssForBase64(List uploadDatas) { + if (CollectionUtils.isEmpty(uploadDatas)) { + logger.error("uploadToQqOssForBase64 fail due to params is empty..."); + return Arrays.asList(""); + } + return uploadDatas.stream().filter(Objects::nonNull).map(uploadData -> YunUploadUtils.getInstance(). + uploadToQqForBase64(queryOssSetting().getUpYunConf(), uploadData.getInputStream(), uploadData.getDatas(), uploadData.getFileOriginName())).collect(Collectors.toList()); + + } + + @Override + public List uploadToOss(List uploadDatas) { + logger.debug("Begin to uploadToOss...."); + if (CollectionUtils.isEmpty(uploadDatas)) { + logger.error("uploadDatas fail due to params is empty..."); + return Arrays.asList(""); + } + return uploadDatas.stream().filter(Objects::nonNull).map(uploadData -> YunUploadUtils.getInstance().uploadToOssYun(queryOssSetting().getUpYunConf(), uploadData.getInputStream(), uploadData.getDatas(), uploadData.getFileOriginName(), uploadData.getType())).collect(Collectors.toList()); + + } + + @Override + public List uploadToOssForBase64(List uploadDatas) { + if (CollectionUtils.isEmpty(uploadDatas)) { + logger.error("uploadToOssForBase64 fail due to params is empty..."); + return Arrays.asList(""); + } + + return uploadDatas.stream().filter(Objects::nonNull).map(uploadData -> YunUploadUtils.getInstance(). + uploadToQqForBase64(queryOssSetting().getUpYunConf(), uploadData.getInputStream(), uploadData.getDatas(), uploadData.getFileOriginName())).collect(Collectors.toList()); + + } + + @Override + public OssSetting queryOssSetting() { + logger.debug("Begin to queryUpYunSetting...."); + return ossMapper.queryOssSetting(); + } + + @Override + public int updateOss(OssSetting ossSetting) { + logger.error("updateOss and OssSetting:{}", ossSetting); + return ossMapper.updateOss(ossSetting); + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/setting/service/impl/SCommunityBuySettingServiceImpl.java b/ruoyi-segchk/src/main/java/com/ruoyi/setting/service/impl/SCommunityBuySettingServiceImpl.java new file mode 100644 index 0000000..f9e4330 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/setting/service/impl/SCommunityBuySettingServiceImpl.java @@ -0,0 +1,90 @@ +package com.ruoyi.setting.service.impl; + +import com.ruoyi.setting.domain.SCommunityBuySetting; +import com.ruoyi.setting.mapper.SCommunityBuySettingMapper; +import com.ruoyi.setting.service.ISCommunityBuySettingService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 社区团购设置Service业务层处理 + * + * @author 魔金商城 + * @date 2020-07-28 + */ +@Service +public class SCommunityBuySettingServiceImpl implements ISCommunityBuySettingService { + private static final Logger logger = LoggerFactory.getLogger(SCommunityBuySettingServiceImpl.class); + @Autowired + private SCommunityBuySettingMapper sCommunityBuySettingMapper; + + /** + * 查询社区团购设置 + * + * @param id 社区团购设置ID + * @return 社区团购设置 + */ + @Override + public SCommunityBuySetting selectSCommunityBuySettingById(Long id) { + return sCommunityBuySettingMapper.selectSCommunityBuySettingById(id); + } + + /** + * 查询社区团购设置列表 + * + * @param sCommunityBuySetting 社区团购设置 + * @return 社区团购设置 + */ + @Override + public List selectSCommunityBuySettingList(SCommunityBuySetting sCommunityBuySetting) { + return sCommunityBuySettingMapper.selectSCommunityBuySettingList(sCommunityBuySetting); + } + + /** + * 新增社区团购设置 + * + * @param sCommunityBuySetting 社区团购设置 + * @return 结果 + */ + @Override + public int insertSCommunityBuySetting(SCommunityBuySetting sCommunityBuySetting) { + return sCommunityBuySettingMapper.insertSCommunityBuySetting(sCommunityBuySetting); + } + + /** + * 修改社区团购设置 + * + * @param sCommunityBuySetting 社区团购设置 + * @return 结果 + */ + @Override + public int updateSCommunityBuySetting(SCommunityBuySetting sCommunityBuySetting) { + return sCommunityBuySettingMapper.updateSCommunityBuySetting(sCommunityBuySetting); + } + + /** + * 批量删除社区团购设置 + * + * @param ids 需要删除的社区团购设置ID + * @return 结果 + */ + @Override + public int deleteSCommunityBuySettingByIds(Long[] ids) { + return sCommunityBuySettingMapper.deleteSCommunityBuySettingByIds(ids); + } + + /** + * 删除社区团购设置信息 + * + * @param id 社区团购设置ID + * @return 结果 + */ + @Override + public int deleteSCommunityBuySettingById(Long id) { + return sCommunityBuySettingMapper.deleteSCommunityBuySettingById(id); + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/setting/vo/AreaItem.java b/ruoyi-segchk/src/main/java/com/ruoyi/setting/vo/AreaItem.java new file mode 100644 index 0000000..fb9974a --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/setting/vo/AreaItem.java @@ -0,0 +1,9 @@ +package com.ruoyi.setting.vo; + +/** + * Created by 魔金商城 on 17/11/21. + * 区域枚举 + */ +public enum AreaItem { + CITY, DISTRICT, NO, ALL +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/setting/vo/Locality.java b/ruoyi-segchk/src/main/java/com/ruoyi/setting/vo/Locality.java new file mode 100644 index 0000000..42e40f7 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/setting/vo/Locality.java @@ -0,0 +1,89 @@ +package com.ruoyi.setting.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + * @author 魔金商城 + * @date 2019-12-04 15:09 + *

+ * 地区新数据接口实体 + */ +@ApiModel(description = "地区新数据接口实体") +public class Locality { + + + /** + * 地区名称 + */ + @ApiModelProperty(value = "地区名称") + private String name; + + + /** + * 数据真实主键ID + */ + @ApiModelProperty(value = "数据真实主键ID") + private String id; + + + /** + * 临时Id字串 保证唯一 + */ + @ApiModelProperty(value = "临时Id字串 保证唯一") + private String value; + + + /** + * 父类的临时字串 一级为0 + */ + @ApiModelProperty(value = "父类的临时字串 一级为0") + private String parent; + + + /** + * 重写全参构造 + * + * @param name 地区名称 + * @param value ID + * @param parent 父类ID 一级为0 + */ + public Locality(String name, String value, String parent, long id) { + this.name = name; + this.value = value; + this.parent = parent; + this.id = String.valueOf(id); + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + public String getParent() { + return parent; + } + + public void setParent(String parent) { + this.parent = parent; + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/util/AesUtils.java b/ruoyi-segchk/src/main/java/com/ruoyi/util/AesUtils.java new file mode 100644 index 0000000..db7acf8 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/util/AesUtils.java @@ -0,0 +1,82 @@ +package com.ruoyi.util; + +import org.bouncycastle.jce.provider.BouncyCastleProvider; + +import javax.crypto.BadPaddingException; +import javax.crypto.Cipher; +import javax.crypto.IllegalBlockSizeException; +import javax.crypto.NoSuchPaddingException; +import javax.crypto.spec.IvParameterSpec; +import javax.crypto.spec.SecretKeySpec; +import java.security.*; + +/** + * AES加密类 + * + * @author SK + * @since 2018/6/13 + */ +public class AesUtils { + + { + Security.addProvider(new BouncyCastleProvider()); + } + + /** + * 获取对象 + */ + public static AesUtils getInstance() { + return LazyHolder.aesUtils; + } + + // 生成iv + private static AlgorithmParameters generateIV(byte[] iv) throws Exception { + AlgorithmParameters params = AlgorithmParameters.getInstance("AES"); + params.init(new IvParameterSpec(iv)); + return params; + } + + /** + * AES对称解密工具类 + * + * @param content 密文 + * @return + * @throws InvalidAlgorithmParameterException + * @throws NoSuchProviderException + */ + public byte[] decrypt(byte[] content, byte[] keyByte, byte[] ivByte) throws InvalidAlgorithmParameterException { + try { + // java是没有 + Cipher cipher = Cipher.getInstance("AES/CBC/PKCS7Padding"); + Key sKeySpec = new SecretKeySpec(keyByte, "AES"); + + cipher.init(Cipher.DECRYPT_MODE, sKeySpec, generateIV(ivByte));// 初始化 + byte[] result = cipher.doFinal(content); + return result; + } catch (NoSuchAlgorithmException e) { + e.printStackTrace(); + } catch (NoSuchPaddingException e) { + e.printStackTrace(); + } catch (InvalidKeyException e) { + e.printStackTrace(); + } catch (IllegalBlockSizeException e) { + e.printStackTrace(); + } catch (BadPaddingException e) { + e.printStackTrace(); + } catch (NoSuchProviderException e) { + e.printStackTrace(); + } catch (Exception e) { + e.printStackTrace(); + } + return null; + } + + /** + * 延迟加载(线程安全) + */ + private static class LazyHolder { + private static AesUtils aesUtils = new AesUtils(); + } +} + + diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/util/BaseResponse.java b/ruoyi-segchk/src/main/java/com/ruoyi/util/BaseResponse.java new file mode 100644 index 0000000..7bc2a82 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/util/BaseResponse.java @@ -0,0 +1,89 @@ +package com.ruoyi.util; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import java.util.List; + +/** + * Created by 魔金商城 on 17/5/9. + * 分页基础响应类 + */ +@ApiModel(description = "分页基础响应类") +public class BaseResponse { + + + /** + * 返回的数据 + */ + @ApiModelProperty(value = "返回的数据") + private List data; + /** + * 总记录数 + */ + @ApiModelProperty(value = "总记录数") + private int recordsTotal; + /** + * 过滤后的记录数 + */ + @ApiModelProperty(value = "过滤后的记录数") + private int recordsFiltered; + /** + * 总的页数 + */ + @ApiModelProperty(value = "总的页数") + private int totalPage; + + private BaseResponse() { + + } + + private BaseResponse(PageHelper pageHelper) { + this.data = pageHelper.getList(); + this.recordsTotal = pageHelper.getRows(); + this.recordsFiltered = pageHelper.getRows(); + this.totalPage = pageHelper.getTotalPages(); + } + + /** + * 构造分页响应实体 + * + * @param pageHelper 分页帮助类 + * @return 返回分页响应实体 + */ + public static BaseResponse build(PageHelper pageHelper) { + return new BaseResponse(pageHelper); + } + + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + public int getRecordsTotal() { + return recordsTotal; + } + + public void setRecordsTotal(int recordsTotal) { + this.recordsTotal = recordsTotal; + } + + public int getRecordsFiltered() { + return recordsFiltered; + } + + public void setRecordsFiltered(int recordsFiltered) { + this.recordsFiltered = recordsFiltered; + } + + public int getTotalPage() { + return totalPage; + } + + public void setTotalPage(int totalPage) { + this.totalPage = totalPage; + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/util/Claims.java b/ruoyi-segchk/src/main/java/com/ruoyi/util/Claims.java new file mode 100644 index 0000000..7ae8dd1 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/util/Claims.java @@ -0,0 +1,133 @@ +package com.ruoyi.util; + +import com.alibaba.fastjson.annotation.JSONField; +import com.ruoyi.util.CommonConstant; +import org.springframework.util.StringUtils; + +/** + * Created by 魔金商城 on 2018/6/13. + * 小程序凭证实体 + */ +public class Claims { + + /** + * 小程序unionId + */ + @JSONField(name = "unionId") + private String unionId; + + /** + * 会员id + */ + @JSONField(name = "userId") + private Long userId; + + /** + * 小程序sessionKey + */ + @JSONField(name = "sessionKey") + private String sessionKey; + + /** + * 微信用户标识 + */ + @JSONField(name = "openId") + private String openId; + + /** + * 用户角色 + */ + @JSONField(name = "userLevel") + private int userLevel; + + /** + * 归属运营商id + */ + @JSONField(name = "providerId") + private Long providerId; + + + + + /** + * 判断是否有unionId + * + * @return 有返回true 没有返回fasle + */ + public boolean hasUnionId() { + return !StringUtils.isEmpty(this.unionId); + } + + /** + * 判断是否有会员id + * + * @return 有返回true 没有返回false + */ + public boolean hasCustomerId() { + return CommonConstant.NO_LOGIN_CUSTOMERID != this.userId; + } + + public String getUnionId() { + return unionId; + } + + public void setUnionId(String unionId) { + this.unionId = unionId; + } + + public long getUserId() { + return userId; + } + + public void setUserId(long userId) { + this.userId = userId; + } + + public String getSessionKey() { + return sessionKey; + } + + public void setSessionKey(String sessionKey) { + this.sessionKey = sessionKey; + } + + public String getOpenId() { + return openId; + } + + public void setOpenId(String openId) { + this.openId = openId; + } + + public void setUserId(Long userId) { + this.userId = userId; + } + + public void setUserLevel(int userLevel) { + this.userLevel = userLevel; + } + + public void setProviderId(Long providerId) { + this.providerId = providerId; + } + + @Override + public String toString() { + return "Claims{" + + "unionId='" + unionId + '\'' + + ", userId=" + userId + + ", sessionKey='" + sessionKey + '\'' + + ", openId='" + openId + '\'' + + ", userLevel=" + userLevel + + ", providerId=" + providerId + + '}'; + } + + public int getUserLevel() { + return userLevel; + } + + public Long getProviderId() { + return providerId; + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/util/CommonConstant.java b/ruoyi-segchk/src/main/java/com/ruoyi/util/CommonConstant.java new file mode 100644 index 0000000..8eeabe8 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/util/CommonConstant.java @@ -0,0 +1,303 @@ +package com.ruoyi.util; + +/** + * Created by 魔金商城 on 17/5/2. + * 公共常量类 + */ +public interface CommonConstant { + + /** + * 开始页 + */ + String START_ROW_NUM = "startRowNum"; + + /** + * 每页大小 + */ + String PAGE_SIZE = "pageSize"; + + /** + * store端session放置手机验证码的key(代客下单) + */ + String STORE_SHOPPING_CODE_KEY = "STORE_SHOPPING_CODE_KEY"; + + /** + * store端session放置验证标记key(代客下单) + */ + String STORE_SHOPPING_MOBILE_KEY = "STORE_SHOPPING_VALIDFLAG_KEY"; + + /** + * 加号替换 + */ + String PLUS_REPLACE = "5lec2shop0"; + /** + * 从pc端发出 + */ + String FROM_PC = "FROM_PC"; + + /** + * admin端店铺id默认值0 + */ + long ADMIN_STOREID = 0; + + /** + * 查询的时候不需要带店铺id过滤 + */ + long QUERY_WITH_NO_STORE = -1; + + /** + * 查询的收货不需要带用户id进行过滤 + */ + long QUERY_WITH_NO_CUSTOMER = -1; + + /** + * 评论、回复不根据ISSHOW显示 + */ + long QUERY_WITH_NO_ISSHOW = -1; + /** + * 评论、回复根据ISSHOW显示 + */ + long QUERY_WITH_ISSHOW = 1; + + /** + * 主题不根据ISUSE显示 + */ + long QUERY_WITH_NO_ISUSE = -1; + /** + * 主题根据ISUSE显示 + */ + long QUERY_WITH_ISUSE = 1; + /** + * 文章不根据columnId显示 + */ + long QUERY_WITH_NO_COLUMNID = -1; + /** + * 文章根据ISRELEASE显示 + */ + long QUERY_WITH_ISRELEASE = 1; + /** + * 验证通过标记 + */ + String PASS_FLAG = "PASS"; + + /** + * 未登录状态下的会员id + */ + long NO_LOGIN_CUSTOMERID = -1; + + /** + * 登录成功后把用户信息放入session的key + */ + String MOBILE_LOGIN_SESSION_KEY = "MOBILE_LOGIN_SESSION_KEY"; + + /** + * 微信授权后把openId放入session的key(微信内置浏览器) + */ + String MOBILE_OPENID_SESSION_KEY = "MOBILE_OPENID_SESSION_KEY"; + /** + * 微信授权后把unionId放入session的key(微信内置浏览器) + */ + String MOBILE_UNIONID_SESSION_KEY = "MOBILE_UNIONID_SESSION_KEY"; + + /** + * mobile端session放置手机验证码的key(注册) + */ + String MOBILE_REGISTER_CODE_KEY = "MOBILE_REGISTER_CODE_KEY"; + + /** + * mobile端session放置手机验证码的key(忘记密码) + */ + String MOBILE_FORGETPWD_CODE_KEY = "MOBILE_FORGETPWD_CODE_KEY"; + /** + * mobile端session放置手机验证码的key(绑定新手机_旧手机验证码) + */ + String MOBILE_BINDNEWMOBILE_CODE_KEY = "MOBILE_BINDNEWMOBILE_CODE_KEY"; + /** + * mobile端session放置手机验证码的key(绑定新手机_新手机验证码) + */ + String MOBILE_BINDNEWMOBILE_NEWMOBILE_CODE_KEY = "MOBILE_BINDNEWMOBILE_NEWMOBILE_CODE_KEY"; + /** + * mobile端session放置验证标记key(绑定新手机) + */ + String MOBILE_BINDNEWMOBILE_VALIDFLAG_KEY = "MOBILE_BINDNEWMOBILE_VALIDFLAG_KEY"; + /** + * mobile端session放置手机验证码的key(更新支付密码) + */ + String MOBILE_UPDATEPAYPWD_CODE_KEY = "MOBILE_UPDATEPAYPWD_CODE_KEY"; + /** + * mobile端session放置手机验证码的key(更新密码) + */ + String MOBILE_UPDATEPWD_CODE_KEY = "MOBILE_UPDATEPWD_CODE_KEY"; + /** + * 订单支付 + */ + int ORDER_PAY = 1; + + /** + * 门店订单支付 + */ + int STORE_ORDER_PAY = 3; + + /** + * 预存款充值 + */ + int RECHARGE_PAY = 2; + + /** + * 支付宝支付 + */ + String ALI_PAY = "支付宝"; + /** + * 微信支付 + */ + String WECHAT_PAY = "微信"; + /** + * 银联支付 + */ + String UNION_PAY = "银联"; + + /** + * 抢购代号 + */ + String PANIC_BUY = "3"; + + /** + * 未过期的活动标记 + */ + String NOT_PAST = "999"; + + /** + * 没有用户id + */ + long NO_CUSTOMER_ID = -1; + + /** + * 还没使用抢购 + */ + int NO_USE_PANIC = -1; + + /** + * 没有抢购促销 + */ + int NO_PANIC_MARKETING = -2; + + /** + * 没有商品试用申请 + */ + int NO_SKU_TRY_APPLY = -1; + + /** + * 平台关注人数 + */ + int ADMIN_FOLLOW_NUM = 10000; + + + /** + * 小程序端redis放置手机验证码的key(注册) + */ + String APPLET_REGISTER_CODE_KEY = "APPLET_REGISTER_CODE_KEY"; + + /** + * 小程序端redis放置登录的key(注册登录) + */ + String APPLET_LOGIN_KEY = "APPLET_LOGIN_KEY"; + + + + /** + * 与会员价互斥 + */ + long MEMBER_PRICE_EXCLUSION = 2L; + + /** + * 与商品组合互斥 + */ + long COMBINATION_EXCLUSION = 1L; + + /** + * 与批发单品互斥 + */ + long BATCH_SKU_EXCLUSION = 3L; + + + /** + * 上传的图片 + */ + String UPLOAD_PIC = "0"; + + /** + * 门店订单 + */ + String STORE_ORDER = "1"; + + /** + * 普通订单 + */ + String ORDINARY_ORDER = "2"; + + /** + * 预存款订单 + */ + String PREALSE_ORDER = "3"; + + /** + * 二级分销 + */ + String SECOND_COMMISSION_LEVEL = "2"; + + /** + * 抢购促销图片类型 + */ + String PANIC_MARKETING_PIC_TYPE = "1"; + + /** + * 预售促销图片类型 + */ + String PRESALE_MARKETING_PIC_TYPE = "2"; + + /** + * 拼团促销图片类型 + */ + String GROUP_MARKETING_PIC_TYPE = "3"; + + /** + * 试用促销图片类型 + */ + String TRY_MARKETING_PIC_TYPE = "4"; + + /** + * 秒杀促销显示 + */ + String PANIC_SHOW = "1"; + + /** + * 秒杀促销不显示 + */ + String PANIC_NOT_SHOW = "0"; + + /** + * 预售分类 + */ + String PRESALE_MARKETING_CATE = "1"; + + /** + * 拼团分类 + */ + String GROUP_MARKETING_CATE = "2"; + + /** + * 试用分类 + */ + String TRY_MARKETING_CATE = "3"; + + /** + * 定金预售类型 + */ + String DEPOSIT_PRESALE_TYPE = "1"; + + /** + * 全款预售类型 + */ + String FULL_PRESALE_TYPE = "2"; + +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/util/CommonResponse.java b/ruoyi-segchk/src/main/java/com/ruoyi/util/CommonResponse.java new file mode 100644 index 0000000..db7a516 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/util/CommonResponse.java @@ -0,0 +1,73 @@ +package com.ruoyi.util; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.springframework.util.ObjectUtils; + +/** + * Created by 魔金商城 on 17/12/1. + * 通用返回对象 + */ +@ApiModel(description = "通用返回对象") +public class CommonResponse { + + /** + * 返回码 1 成功 其他失败 默认0没有数据 + */ + @ApiModelProperty(value = "返回码 1 成功 其他失败 默认0没有数据") + private int flag = 0; + + /** + * 数据 + */ + @ApiModelProperty(value = "数据") + private T data; + + + /** + * 构造返回对象 + * + * @param t 返回的对象 + * @return 返回的对象 + */ + public static CommonResponse build(T t) { + CommonResponse commonResponse = new CommonResponse<>(); + // 没有数据 + if (ObjectUtils.isEmpty(t)) { + return commonResponse; + } + commonResponse.flag = 1; + commonResponse.data = t; + return commonResponse; + } + + /** + * 构造返回对象 + * + * @param t 返回的对象 + * @param code 返回码 + * @return 返回的对象 + */ + public static CommonResponse build(T t, int code) { + CommonResponse commonResponse = new CommonResponse<>(); + commonResponse.flag = code; + commonResponse.data = t; + return commonResponse; + } + + public int getFlag() { + return flag; + } + + public void setFlag(int flag) { + this.flag = flag; + } + + public T getData() { + return data; + } + + public void setData(T data) { + this.data = data; + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/util/CustomHttpUtils.java b/ruoyi-segchk/src/main/java/com/ruoyi/util/CustomHttpUtils.java new file mode 100644 index 0000000..549613d --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/util/CustomHttpUtils.java @@ -0,0 +1,349 @@ +package com.ruoyi.util; + +import org.apache.http.NameValuePair; +import org.apache.http.client.HttpClient; +import org.apache.http.client.entity.UrlEncodedFormEntity; +import org.apache.http.client.methods.*; +import org.apache.http.config.RegistryBuilder; +import org.apache.http.conn.socket.ConnectionSocketFactory; +import org.apache.http.conn.socket.PlainConnectionSocketFactory; +import org.apache.http.conn.ssl.SSLConnectionSocketFactory; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.HttpClientBuilder; +import org.apache.http.impl.conn.BasicHttpClientConnectionManager; +import org.apache.http.message.BasicNameValuePair; +import org.apache.http.util.EntityUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.util.StringUtils; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import javax.servlet.http.Cookie; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.nio.charset.Charset; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** + * 自定义http工具类 + * + * @author 魔金商城 created on 2020/4/14 + */ +public class CustomHttpUtils { + + private static final Logger logger = LoggerFactory.getLogger(CustomHttpUtils.class); + /** + * 执行GET方法请求数据 + * + * @param url 请求地址 + * @return 返回数据 + */ + public static String doGet(String url) { + logger.debug("CustomHttpUtils.doGet and url:{}", url); + return getResult(getHttpClient(), new HttpGet(url)); + } + + /** + * 执行POST方法form方式请求数据 + * + * @param url 请求地址 + * @param params 请求参数 + * @return 返回数据 + */ + public static String postForm(String url, Map params) { + logger.debug("CustomHttpUtils.postForm and url:{} \r\n params:{}", url, params); + return getFormRequestResult(getHttpClient(), new HttpPost(url), params); + } + + + /** + * 执行POST方法json方式请求数据 + * + * @param url 请求地址 + * @param jsonString 请求参数(json字符串) + * @return 返回数据 + */ + public static String postJson(String url, String jsonString) { + logger.debug("CustomHttpUtils.postJson and url:{} \r\n jsonString:{}", url, jsonString); + return getJsonRequestResult(jsonString, getHttpClient(), new HttpPost(url)); + } + + + /** + * 执行DELETE方法请求数据 + * + * @param url 请求地址 + * @return 返回数据 + */ + public static String doDelete(String url) { + logger.debug("CustomHttpUtils.doDelete and url:{}", url); + return getResult(getHttpClient(), new HttpDelete(url)); + } + + + /** + * 执行put方法form方式请求数据 + * + * @param url 请求地址 + * @param params 请求参数 + * @return 返回数据 + */ + public static String putForm(String url, Map params) { + logger.debug("CustomHttpUtils.putForm and url:{} \r\n params:{}", url, params); + return getFormRequestResult(getHttpClient(), new HttpPut(url), params); + } + + + /** + * 执行put方法json方式请求数据 + * + * @param url 请求地址 + * @param jsonString 请求参数(json字符串) + * @return 返回数据 + */ + public static String putJson(String url, String jsonString) { + logger.debug("CustomHttpUtils.putJson and url:{} \r\n jsonString:{}", url, jsonString); + return getJsonRequestResult(jsonString, getHttpClient(), new HttpPut(url)); + } + + + /** + * 从cookie中获取token + */ + public static String getTokenFromCookie() { + HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); + String token = ""; + Cookie[] cookies = request.getCookies(); + if (Objects.isNull(cookies)) { + return ""; + } + for (Cookie temp : cookies) { + if (temp.getName().equals("Authorization")) { + token = temp.getValue(); + } + } + return token; + } + + /** + * 从header中获取token + */ + public static String getTokenFromHeader() { + HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); + String token = ""; + // 认证信息在header 中的key + final String authHeader = request.getHeader("Authorization"); + if (Objects.isNull(authHeader) || !authHeader.startsWith("Bearer ")) { + logger.info("getToken from header fail...."); + } else { + token = authHeader.substring(7); + } + return token; + } + + /** + * 通用获取token(如果request头中有Auth信息,则返回头中的token,否则返回cookie中的token) + * + * @return token + */ + private static String getTokenCommon() { + HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); + if (!StringUtils.isEmpty(request.getHeader("Authorization"))) { + logger.info("getTokenCommon:getAuthorization from header is not empty"); + return getTokenFromHeader(); + } + return getTokenFromCookie(); + } + +// /** +// * 从token获取userName +// * +// * @param token token +// * @param publicKey 公钥 +// * @return userName +// */ +// public static String getUserNameFromToken(String token, String publicKey) { +// log.debug("getUserNameFromToken and token:{} \r\n publicKey:{}", token, publicKey); +// if (StringUtils.isEmpty(token)) { +// return ""; +// } +// Jwt jwt = null; +// try { +// SignatureVerifier verifier = new RsaVerifier(publicKey); +// jwt = JwtHelper.decodeAndVerify(token, verifier); +// } catch (Exception e) { +// log.error(e.getMessage()); +// } +// if (Objects.nonNull(jwt)) { +// log.debug("getUserNameFromToken and claims:{}", jwt.getClaims()); +// JSONObject claims = JSONObject.parseObject(jwt.getClaims()); +// // 判断有效期是否过期 +// if (Long.parseLong(claims.getString("exp")) > new Date().getTime() / 1000) { +// return claims.getString("user_name"); +// } +// } +// return ""; +// } + + /** + * 下载文件 + * + * @param out 输出流 + * @param url 文件地址 + */ + public static void downLoadFile(OutputStream out, String url) { + logger.debug("downLoadFile and url:{}", url); + if (StringUtils.isEmpty(url)) { + logger.debug("downLoadFile fail : url is empty"); + return; + } + InputStream inputStream = null; + try { + inputStream = getInputStreamResultFormUrl(url); + int b = 0; + byte[] buffer = new byte[512]; + while (b != -1) { + b = inputStream.read(buffer); + //4.写到输出流(out)中 + out.write(buffer, 0, b); + } + + } catch (IOException e) { + logger.error(e.getMessage()); + } finally { + try { + if (inputStream != null) { + inputStream.close(); + } + out.close(); + out.flush(); + } catch (IOException e) { + logger.error(e.getMessage()); + } + } + } + + public static InputStream getInputStreamResultFormUrl(String url) throws IOException { + return getInputStreamResult(getHttpClient(), new HttpGet(url)); + } + + /** + * 设置下载信息 + * + * @param response 返回 + * @param fileName 文件名 + */ + public static void setDownloadInfo(HttpServletResponse response, String fileName) { + //1.设置文件ContentType类型,这样设置,会自动判断下载文件类型 + response.setContentType("multipart/form-data"); + //2.设置文件头:最后一个参数是设置下载文件 + response.setHeader("Content-Disposition", "attachment;fileName=" + fileName); + } + + /** + * 获取httpClient + */ + private static HttpClient getHttpClient() { + BasicHttpClientConnectionManager connManager = new BasicHttpClientConnectionManager( + RegistryBuilder.create() + .register("http", PlainConnectionSocketFactory.getSocketFactory()) + .register("https", SSLConnectionSocketFactory.getSocketFactory()) + .build(), + null, + null, + null + ); + return HttpClientBuilder.create() + .setConnectionManager(connManager) + .build(); + } + + + /** + * 获取json请求返回值 + * + * @param jsonString 请求参数 + * @param httpClient http客户端 + * @param httpRequest 请求对象 + * @return 请求返回 + */ + private static String getJsonRequestResult(String jsonString, HttpClient httpClient, HttpEntityEnclosingRequestBase httpRequest) { + String result = null; + //设置token +// httpRequest.setHeader("Authorization", "Bearer " + getTokenCommon()); + httpRequest.setHeader("Content-type", "application/json; charset=utf-8"); + StringEntity requestParam = new StringEntity(jsonString, "UTF-8"); + requestParam.setContentType("application/json"); + try { + httpRequest.setEntity(requestParam); + result = EntityUtils.toString(httpClient.execute(httpRequest).getEntity(), "UTF-8");//取出应答字符串 + } catch (IOException e) { + logger.error(e.getMessage()); + } + logger.debug("getJsonRequestResult and result:{}", result == null ? "" : result); + return result; + } + + /** + * 获取form请求返回值 + * + * @param formParam 请求参数 + * @param httpClient http客户端 + * @param httpRequest 请求对象 + * @return 请求返回 + */ + private static String getFormRequestResult(HttpClient httpClient, HttpEntityEnclosingRequestBase httpRequest, Map formParam) { + String result = null; + List params = new ArrayList<>(); + if (Objects.nonNull(formParam)) { + formParam.forEach((key, value) -> params.add(new BasicNameValuePair(key, value))); + } +// httpRequest.setHeader("Authorization", "Bearer " + getTokenCommon()); + try { + httpRequest.setEntity(new UrlEncodedFormEntity(params, "UTF-8")); + result = EntityUtils.toString(httpClient.execute(httpRequest).getEntity(), "UTF-8");//取出应答字符串 + } catch (IOException e) { + logger.error(e.getMessage()); + } + logger.debug("getFormRequestResult and result:{}", result == null ? "" : result); + return result; + } + + /** + * 获取http请求返回 + * + * @param httpClient http客户端 + * @param httpRequest 请求对象 + * @return 请求返回 + */ + private static String getResult(HttpClient httpClient, HttpUriRequest httpRequest) { + String result = null; +// httpRequest.setHeader("Authorization", "Bearer " + getTokenCommon()); + try { + result = EntityUtils.toString(httpClient.execute(httpRequest).getEntity(), Charset.forName("utf-8"));//取出应答字符串 + } catch (IOException e) { + logger.error(e.getMessage()); + } + logger.debug("getResult and result:{}", result == null ? "" : result); + return result; + } + + /** + * 获取http请求输入流返回 + * + * @param httpClient http客户端 + * @param httpRequest 请求对象 + * @return 请求返回 + */ + private static InputStream getInputStreamResult(HttpClient httpClient, HttpUriRequest httpRequest) throws IOException { + return httpClient.execute(httpRequest).getEntity().getContent(); + } + +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/util/Express100Utils.java b/ruoyi-segchk/src/main/java/com/ruoyi/util/Express100Utils.java new file mode 100644 index 0000000..2ee1b61 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/util/Express100Utils.java @@ -0,0 +1,47 @@ +package com.ruoyi.util; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * 快递100工具类 + */ +public class Express100Utils { + + /** + * 快递100获取查询地址的接口地址 + */ + private final static String KUAIDI_URL = "https://www.kuaidi100.com/chaxun?com=%s&nu=%s"; + /** + * H5查询物流信息地址 + */ + private final static String H5_KUAIDI_URL = "https://m.kuaidi100.com/app/query/?coname=lecshop&com=%s&nu=%s&callbackurl=%s"; + /** + * 日志 + */ + static Logger logger = LoggerFactory.getLogger(Express100Utils.class); + + /** + * 获得htmlapi的快递查询地址 + * + * @param express100Code 快递代号 + * @param waybillCode 运单号 + */ + public static String getHtmlApiURl(String express100Code, String waybillCode) { + logger.debug("getHtmlApiURl and express100Code:{} \r\n waybillCode:{}", express100Code, waybillCode); + return String.format(KUAIDI_URL, express100Code, waybillCode); + } + + /** + * 生成H5查询物流信息url + * + * @param express100Code 快递代号 + * @param waybillCode 运单号 + * @param callBackUrl 回跳地址(http开头) + * @return h5物流信息url + */ + public static String formatH5Url(String express100Code, String waybillCode, String callBackUrl) { + return String.format(H5_KUAIDI_URL, express100Code, waybillCode, callBackUrl); + } + +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/util/JaxbUtil.java b/ruoyi-segchk/src/main/java/com/ruoyi/util/JaxbUtil.java new file mode 100644 index 0000000..d1c91f4 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/util/JaxbUtil.java @@ -0,0 +1,130 @@ +package com.ruoyi.util; + + +import javax.xml.bind.*; +import javax.xml.bind.annotation.XmlAnyElement; +import javax.xml.namespace.QName; +import java.io.StringReader; +import java.io.StringWriter; +import java.util.Collection; + + +/** + * xml转换工具类 + */ +public class JaxbUtil { + // 多线程安全的Context. + private JAXBContext jaxbContext; + + /** + * @param types 所有需要序列化的Root对象的类型. + */ + public JaxbUtil(Class... types) { + try { + jaxbContext = JAXBContext.newInstance(types); + } catch (JAXBException e) { + throw new RuntimeException(e); + } + } + + /** + * Java Object->Xml. + */ + public String toXml(Object root, String encoding) { + try { + StringWriter writer = new StringWriter(); + createMarshaller(encoding).marshal(root, writer); + return writer.toString(); + } catch (JAXBException e) { + throw new RuntimeException(e); + } + } + + /** + * Java Object->Xml, 特别支持对Root Element是Collection的情形. + */ + @SuppressWarnings("unchecked") + public String toXml(Collection root, String rootName, String encoding) { + try { + CollectionWrapper wrapper = new CollectionWrapper(); + wrapper.collection = root; + + JAXBElement wrapperElement = new JAXBElement( + new QName(rootName), CollectionWrapper.class, wrapper); + + StringWriter writer = new StringWriter(); + createMarshaller(encoding).marshal(wrapperElement, writer); + + return writer.toString(); + } catch (JAXBException e) { + throw new RuntimeException(e); + } + } + + /** + * Xml->Java Object. + */ + @SuppressWarnings("unchecked") + public T fromXml(String xml) { + try { + StringReader reader = new StringReader(xml); + return (T) createUnmarshaller().unmarshal(reader); + } catch (JAXBException e) { + throw new RuntimeException(e); + } + } + + /** + * Xml->Java Object, 支持大小写敏感或不敏感. + */ + @SuppressWarnings("unchecked") + public T fromXml(String xml, boolean caseSensitive) { + try { + String fromXml = xml; + if (!caseSensitive) + fromXml = xml.toLowerCase(); + StringReader reader = new StringReader(fromXml); + return (T) createUnmarshaller().unmarshal(reader); + } catch (JAXBException e) { + throw new RuntimeException(e); + } + } + + /** + * 创建Marshaller, 设定encoding(可为Null). + */ + public Marshaller createMarshaller(String encoding) { + try { + Marshaller marshaller = jaxbContext.createMarshaller(); + + marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE); + + if (!org.springframework.util.StringUtils.isEmpty(encoding)) { + marshaller.setProperty(Marshaller.JAXB_ENCODING, encoding); + } + return marshaller; + } catch (JAXBException e) { + throw new RuntimeException(e); + } + } + + /** + * 创建UnMarshaller. + */ + public Unmarshaller createUnmarshaller() { + try { + return jaxbContext.createUnmarshaller(); + } catch (JAXBException e) { + throw new RuntimeException(e); + } + } + + /** + * 封装Root Element 是 Collection的情况. + */ + public static class CollectionWrapper { + @SuppressWarnings("unchecked") + @XmlAnyElement + protected Collection collection; + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/util/MarketingConstant.java b/ruoyi-segchk/src/main/java/com/ruoyi/util/MarketingConstant.java new file mode 100644 index 0000000..d1b21bd --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/util/MarketingConstant.java @@ -0,0 +1,76 @@ +package com.ruoyi.util; + +import java.util.Arrays; +import java.util.List; + +/** + * Created by 魔金商城 on 17/6/8. + * 促销常量类 + */ +public interface MarketingConstant { + + /** + * 直降促销 + */ + String FALL_MARKETING = "1"; + + /** + * 满赠 + */ + String FULL_GIFT_MARKETING = "2"; + + /** + * 抢购促销 + */ + String PANIC_BUY_MARKETING = "3"; + + /** + * 满减促销 + */ + String FULL_DOWN_MARKETING = "4"; + + /** + * 满折促销 + */ + String FULL_DISCOUNT_MARKETING = "5"; + + /** + * 包邮促销 + */ + String FREE_SHIP_MARKETING = "6"; + + /** + * 定金预售 + */ + String DEPOSIT_PRE_SALE_MARKETING = "7"; + + /** + * 全款预售 + */ + String FULL_PRE_SALE_MARKETING = "8"; + + /** + * 试用促销 + */ + String TRY_MARKETING = "9"; + + /** + * 拼团促销 + */ + String GROUP_MARKETING = "10"; + + /** + * 众筹促销 + */ + String CROWD_FUNDING_MARKETING = "11"; + + /** + * 存在互斥的促销类型 + */ + List EXCLUSION_MARKETING_TYPES = Arrays.asList(PANIC_BUY_MARKETING, FALL_MARKETING, GROUP_MARKETING, DEPOSIT_PRE_SALE_MARKETING, FULL_PRE_SALE_MARKETING, TRY_MARKETING, CROWD_FUNDING_MARKETING); + + /** + * 批发商品互斥的促销类型 + */ + List BATCH_EXCLUSION_MARKETING_TYPES = Arrays.asList(PANIC_BUY_MARKETING, GROUP_MARKETING, DEPOSIT_PRE_SALE_MARKETING, FULL_PRE_SALE_MARKETING, TRY_MARKETING, CROWD_FUNDING_MARKETING); +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/util/PageHelper.java b/ruoyi-segchk/src/main/java/com/ruoyi/util/PageHelper.java new file mode 100644 index 0000000..6290a95 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/util/PageHelper.java @@ -0,0 +1,132 @@ +package com.ruoyi.util; + + +import org.springframework.util.CollectionUtils; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.function.Function; +import java.util.stream.Collectors; + +/** + * Created by 魔金商城 on 17/5/2. + * 分页帮助类 + */ + +public class PageHelper { + + /** + * 当前查询的列表数据 + */ + private List list = new ArrayList<>(); + + /** + * 总计录数 + */ + private int rows; + + /** + * 每页显示记录数 默认10条记录 + */ + private int pageSize = 10; + + /** + * 当前页码 默认第一页 + */ + private int pageNum = 0; + + /** + * 构造分页对象 + * + * @param pageHelper 原始分页对象 + * @param function 转化函数 + * @return 返回新的返回对象 + */ + public static PageHelper buildByCopy(PageHelper pageHelper, Function function) { + PageHelper pageHelper1 = new PageHelper(); + pageHelper1.setRows(pageHelper.getRows()); + pageHelper1.setPageNum(pageHelper.getPageNum()); + pageHelper1.setPageSize(pageHelper.getPageSize()); + + if (!CollectionUtils.isEmpty(pageHelper.getList())) { + pageHelper1.setList((List) pageHelper.getList().stream().map(function).collect(Collectors.toList())); + } + return pageHelper1; + } + + /** + * 获取开始页 + * + * @return 返回开始页 + */ + public int getStartRowNum() { + return pageNum * pageSize; + } + + /** + * 设置当前的数据列表 + * + * @param list 当前数据 + * @return 返回当前对象 + */ + public PageHelper setListDates(List list) { + this.list = list; + return this; + } + + /** + * 获得设置通用分页 + * + * @param params 查询参数 + * @param rows 总记录数 + * @return 返回查询参数 + */ + public Map getQueryParams(Map params, int rows) { + this.setRows(rows); + params.put(CommonConstant.START_ROW_NUM, this.getStartRowNum()); + params.put(CommonConstant.PAGE_SIZE, this.getPageSize()); + return params; + } + + /** + * 获得总页数 + * + * @return 返回总的页数 此方法不能删除 + */ + public int getTotalPages() { + return rows % pageSize == 0 ? rows / pageSize : rows / pageSize + 1; + } + + public List getList() { + return list; + } + + public void setList(List list) { + this.list = list; + } + + public int getRows() { + return rows; + } + + public void setRows(int rows) { + this.rows = rows; + } + + public int getPageSize() { + return pageSize; + } + + public void setPageSize(int pageSize) { + this.pageSize = pageSize; + } + + public int getPageNum() { + return pageNum; + } + + public void setPageNum(int pageNum) { + this.pageNum = pageNum; + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/util/QRCodeUtils.java b/ruoyi-segchk/src/main/java/com/ruoyi/util/QRCodeUtils.java new file mode 100644 index 0000000..19d3ea1 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/util/QRCodeUtils.java @@ -0,0 +1,181 @@ +package com.ruoyi.util; + +import com.google.zxing.BarcodeFormat; +import com.google.zxing.EncodeHintType; +import com.google.zxing.MultiFormatWriter; +import com.google.zxing.common.BitMatrix; +import org.springframework.util.ObjectUtils; + +import javax.imageio.ImageIO; +import javax.servlet.http.HttpServletResponse; +import java.awt.image.BufferedImage; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.OutputStream; +import java.util.Hashtable; + +/** + * Created by 魔金商城 on 17/3/13. + * 二维码生成器 + */ +public final class QRCodeUtils { + + /** + * 黑色 + */ + private static final int BLACK = 0xFF000000; + + /** + * 白色 + */ + private static final int WHITE = 0xFFFFFFFF; + + private QRCodeUtils() { + + } + + /** + * 创建二维码图片 + * + * @param url 链接地址 + * @param width 宽 + * @param height 高 + */ + public static void createQRImg(HttpServletResponse response, String url, Integer width, Integer height) { + OutputStream outputStream = null; + try { + //如果宽高没有赋值,则给一个默认值 + if (ObjectUtils.isEmpty(width)) { + width = 200; + } + if (ObjectUtils.isEmpty(height)) { + height = 200; + } + outputStream = response.getOutputStream(); + QRCodeUtils.createQrCode(url, width, height, "jpg", outputStream); + outputStream.flush(); + } catch (Exception e) { + e.printStackTrace(); + } finally { + try { + outputStream.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + + } + + + /** + * 生成二维码 + * + * @param content 内容 + * @param width 宽 + * @param height 高 + */ + public static void createQrCode(String content, int width, int height, String format, OutputStream stream) throws Exception { + + Hashtable hints = new Hashtable<>(); + hints.put(EncodeHintType.CHARACTER_SET, "utf-8"); + BitMatrix bitMatrix = new MultiFormatWriter().encode(content, BarcodeFormat.QR_CODE, width, height, hints); + + BufferedImage bufferedImage = toBufferedImage(deleteWhite(bitMatrix)); + BufferedImage poster = QRPostersUtil.drawImage2out(null, bufferedImage, "C:\\Users\\Public\\Desktop\\dome.jpg"); + ImageIO.write(poster, format, stream); + } + + /** + * 生成二维码 + * + * @param content 内容 + * @param width 宽 + * @param height 高 + * @param format 图片格式 + * @return 返回图片字节 + */ + public static byte[] createQrCode(String content, int width, int height, String format) throws Exception { + + Hashtable hints = new Hashtable<>(); + hints.put(EncodeHintType.CHARACTER_SET, "utf-8"); + BitMatrix bitMatrix = new MultiFormatWriter().encode(content, BarcodeFormat.QR_CODE, width, height, hints); + + return imageToBytes(toBufferedImage(bitMatrix), format); + } + + + /** + * 生成图片 + */ + private static BufferedImage toBufferedImage(BitMatrix matrix) { + int width = matrix.getWidth(); + int height = matrix.getHeight(); + BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB); + for (int x = 0; x < width; x++) { + for (int y = 0; y < height; y++) { + image.setRGB(x, y, matrix.get(x, y) ? BLACK : WHITE); + } + } + return image; + } + + + /** + * 去白边 + */ + private static BitMatrix deleteWhite(BitMatrix matrix) { + int[] rec = matrix.getEnclosingRectangle(); + int resWidth = rec[2] + 1; + int resHeight = rec[3] + 1; + + BitMatrix resMatrix = new BitMatrix(resWidth, resHeight); + resMatrix.clear(); + for (int i = 0; i < resWidth; i++) { + for (int j = 0; j < resHeight; j++) { + if (matrix.get(i + rec[0], j + rec[1])) { + resMatrix.set(i, j); + } + } + } + + int width = resMatrix.getWidth(); + int height = resMatrix.getHeight(); + BufferedImage image = new BufferedImage(width, height, + BufferedImage.TYPE_INT_RGB); + for (int x = 0; x < width; x++) { + for (int y = 0; y < height; y++) { + image.setRGB(x, y, resMatrix.get(x, y) ? 0 : 255); + } + } + + return resMatrix; + + } + + /** + * 转换BufferedImage 数据为byte数组 + * + * @param bImage + * @param format image格式字符串.如"gif","png" + * @return byte数组 + */ + public static byte[] imageToBytes(BufferedImage bImage, String format) { + ByteArrayOutputStream out = new ByteArrayOutputStream(); + byte[] bytes = null; + try { + ImageIO.write(bImage, format, out); + bytes = out.toByteArray(); + } catch (IOException e) { + e.printStackTrace(); + } finally { + try { + out.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + return bytes; + } + + +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/util/QRPostersUtil.java b/ruoyi-segchk/src/main/java/com/ruoyi/util/QRPostersUtil.java new file mode 100644 index 0000000..d08e761 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/util/QRPostersUtil.java @@ -0,0 +1,360 @@ +package com.ruoyi.util; + + +import com.google.zxing.BarcodeFormat; +import com.google.zxing.EncodeHintType; +import com.google.zxing.MultiFormatWriter; +import com.google.zxing.common.BitMatrix; +import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.core.io.ClassPathResource; +import org.springframework.core.io.DefaultResourceLoader; +import org.springframework.core.io.Resource; +import org.springframework.stereotype.Component; +import org.springframework.util.ResourceUtils; + +import javax.imageio.ImageIO; +import java.awt.*; +import java.awt.geom.Ellipse2D; +import java.awt.geom.RoundRectangle2D; +import java.awt.image.BufferedImage; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.net.HttpURLConnection; +import java.net.URL; +import java.util.ArrayList; +import java.util.Hashtable; +import java.util.Random; + +/** + * 提供二维码生成和解析工具类 + * @author Administrator + * + */ +public class QRPostersUtil { + + private static final String CHARSET = "utf-8"; + private static final String FORMAT_NAME = "JPG"; + private static final int QRCODE_SIZE = 150; // 二维码尺寸,宽度和高度均是300 + private static final int WIDTH = 50; //LOGO宽度 + private static final int HEIGHT = 50; //LOGO高度 + + + /** + * 生成二维码的方法 + * @param content 目标url + * @param imgPath logo图片地址 + * @param needCompress 是否压缩logo + * @return 二维码图片 + * @throws Exception + */ + private static BufferedImage createImage(String content, String imgPath,boolean needCompress) throws Exception { + Hashtable hints = new Hashtable(); + hints.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.H);//指定二维码的纠错等级为高级 + hints.put(EncodeHintType.CHARACTER_SET, CHARSET);//指定字符编码为“utf-8” + hints.put(EncodeHintType.MARGIN, 1); //设置图片的边距 + //参数1:内容,目标url,参数2:固定写法,参数3:二维码的宽度,参数4:二维码的高度,参数5:二维码属性设置 + BitMatrix bitMatrix = new MultiFormatWriter().encode(content,BarcodeFormat.QR_CODE, QRCODE_SIZE, QRCODE_SIZE, hints); + int width = bitMatrix.getWidth();//二维码的宽度 + int height = bitMatrix.getHeight();//二维码的高度 + BufferedImage image = new BufferedImage(width, height,BufferedImage.TYPE_INT_RGB);//生成的二维码image + for (int x = 0; x < width; x++) { + for (int y = 0; y < height; y++) { + image.setRGB(x, y, bitMatrix.get(x, y) ? 0xFF000000: 0xFFFFFFFF); + } + } + if (imgPath == null || "".equals(imgPath)) {//logo图片地址为null或空时 + return image; //只返回二维码图片,无中间的logo + } + // 插入logo图片 参数1:二维码图片,参数2:logo图片地址,参数3:压缩图片 + QRPostersUtil.insertImage(image, imgPath, needCompress); + return image; + } + /** + * 插入logo图片 + * @param source 二维码图片 + * @param imgPath LOGO图片地址 + * @param needCompress 是否压缩 + * @throws Exception + */ + private static void insertImage(BufferedImage source, String imgPath,boolean needCompress) throws Exception { + + File file = new File(imgPath);//logo图片地址放入文件 + Image src; + if (!file.exists()) { + //通过网络路径获取 + InputStream inputStream=getImageStream(imgPath); + src = ImageIO.read(inputStream); + }else { + //本地路径获取 + src = ImageIO.read(new File(imgPath)); + } + int width = src.getWidth(null); + int height = src.getHeight(null); + if (needCompress) { // 压缩LOGO + if (width > WIDTH) { //如果上传logo宽 >60 + width = WIDTH; + } + if (height > HEIGHT) { //如果上传logo高>60 + height = HEIGHT; + } + Image image = src.getScaledInstance(width, height,Image.SCALE_SMOOTH); + BufferedImage tag = new BufferedImage(width, height,BufferedImage.TYPE_INT_RGB); + Graphics g = tag.getGraphics(); + g.drawImage(image, 0, 0, null); // 绘制缩小后的图 + g.dispose(); + src = image; + } + // 插入LOGO + Graphics2D graph = source.createGraphics(); + int x = (QRCODE_SIZE - width) / 2; + int y = (QRCODE_SIZE - height) / 2; + graph.drawImage(src, x, y, width, height, null); + Shape shape = new RoundRectangle2D.Float(x, y, width, width, 6, 6); + graph.setStroke(new BasicStroke(3f)); + graph.draw(shape); + graph.dispose(); + } + /** + * 生成二维码(内嵌LOGO) + * @param content 内容 + * @param imgPath logo地址 + * @param destPath 存放目录 + * @param needCompress 是否压缩logo + * @throws Exception + */ + public static void encode(String content, String imgPath, String destPath, boolean needCompress) throws Exception { + BufferedImage image = QRPostersUtil.createImage(content, imgPath,needCompress); //生成二维码 + mkdirs(destPath); + String file = new Random().nextInt(99999) + ".jpg"; + ImageIO.write(image, FORMAT_NAME, new File(destPath + "/" + file)); + } + /** + * 当文件夹不存在时,mkdirs会自动创建多层目录,区别于mkdir.(mkdir如果父目录不存在则会抛出异常) + * @param destPath 存放目录 + */ + public static void mkdirs(String destPath) { + File file = new File(destPath); + if (!file.exists() && !file.isDirectory()) { + file.mkdirs(); + } + } + + + /** + * 生成二维码(内嵌LOGO) + * + * @param content 内容 + * @param imgPath LOGO地址 + * @param output 输出流 + * @param needCompress 是否压缩LOGO + * @throws Exception + */ + public static void encode(String content, String imgPath,OutputStream output, boolean needCompress) throws Exception { + BufferedImage image = QRPostersUtil.createImage(content, imgPath,needCompress); + ImageIO.write(image, FORMAT_NAME, output); + } + /** + * 生成二维码 + * + * @param content 内容 + * @param output 输出流 + * @throws Exception + */ + public static void encode(String content, OutputStream output)throws Exception { + QRPostersUtil.encode(content, null, output, false); + } + + + /** + * 获取网络图片流 + * + * @param url + * @return + */ + public static InputStream getImageStream(String url) { + try { + HttpURLConnection connection = (HttpURLConnection) new URL(url).openConnection(); + connection.setReadTimeout(5000); + connection.setConnectTimeout(5000); + connection.setRequestMethod("GET"); + if (connection.getResponseCode() == HttpURLConnection.HTTP_OK) { + InputStream inputStream = connection.getInputStream(); + return inputStream; + } + } catch (IOException e) { + System.out.println("获取网络图片出现异常,图片路径为:" + url); + e.printStackTrace(); + } + return null; + } + + + /** + *将头像,二维码和海报合成 + * @throws IOException + */ + public static void drawImage() throws IOException { + //海报图 + String backgroundImageUrl = "https://img.redocn.com/sheji/20170911/daxuexiaoyuanyinlejiegechangbisaihaibao_8694885.jpg"; + //二维码 + String qrCodeImageUrl = "https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1553504957130&di=02fae20a5c0f885d52299b2b1d682c86&imgtype=0&src=http%3A%2F%2Fimg.atobo.com%2FProductImg%2FEWM%2FUWeb%2F3%2F2%2F1%2F3%2F061%2F3213061%2F1.gif"; + //头像 + String headUrl = "http://pic.51yuansu.com/pic3/cover/00/63/25/589bdedf5475d_610.jpg"; + + BufferedImage bgBufImage = ImageIO.read(new URL(backgroundImageUrl)); + Graphics2D bgBufImageGraphics = bgBufImage.createGraphics(); + + BufferedImage qrCodeImage = ImageIO.read(new URL(qrCodeImageUrl)); + BufferedImage headImage = ImageIO.read(new URL(headUrl)); + //设置圆形图片 + BufferedImage roundHeadImg = new BufferedImage(headImage.getWidth(), headImage.getHeight(), BufferedImage.TYPE_INT_RGB); + + Graphics2D roundHeadGraphics = roundHeadImg.createGraphics(); + Ellipse2D.Double shape = new Ellipse2D.Double(0, 0, roundHeadImg.getWidth(), roundHeadImg.getHeight()); + roundHeadGraphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); + roundHeadImg = roundHeadGraphics.getDeviceConfiguration().createCompatibleImage(headImage.getWidth(), headImage.getHeight(), + Transparency.TRANSLUCENT); + roundHeadGraphics = roundHeadImg.createGraphics(); + // 使用 setRenderingHint 设置抗锯齿 + roundHeadGraphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); + roundHeadGraphics.setClip(shape); + roundHeadGraphics.drawImage(headImage, 0, 0, null); + roundHeadGraphics.dispose(); + + bgBufImageGraphics.drawImage(qrCodeImage,390, 200, qrCodeImage.getWidth(), qrCodeImage.getHeight(), null); + //bgBufImageGraphics.drawImage(roundHeadImg, 50, 100, HEAD_URL_WIDTH, HEAD_URL_HEIGHT, null); + bgBufImageGraphics.dispose(); + ImageIO.write(bgBufImage, "png", new File("C:\\Users\\Public\\Desktop\\demo2.png")); + System.out.printf("生成图片完成"); + + } + + /** + *将二维码和海报合成一张图片 + * @throws IOException + */ + public static void drawImage1(String backgroundImageUrl,BufferedImage qrCodeImage,String putImgPoster) throws IOException { + //这里对方法进行了修改直接把 BufferedImage qrCodeImage传入进来方便处理 也可以传入 String qrCodeImageUrl 图片网络路径 + BufferedImage bgBufImage = ImageIO.read(new URL(backgroundImageUrl)); + Graphics2D bgBufImageGraphics = bgBufImage.createGraphics(); + //BufferedImage qrCodeImage = ImageIO.read(new URL(qrCodeImageUrl)); + bgBufImageGraphics.drawImage(qrCodeImage,390, 200, qrCodeImage.getWidth(), qrCodeImage.getHeight(), null); + bgBufImageGraphics.dispose(); + ImageIO.write(bgBufImage, "png", new File(putImgPoster)); + System.out.printf("生成图片完成"); + } + + /** + *将二维码和海报合成一张图片 + * @param backgroundImageUrl 海报背景图片url。为空时。使用 templates\posters\bg.jpg + * @param qrCodeImage 二维码图片流 + * @param putImgPoster 海报保存地址 + * @throws IOException + */ + public static BufferedImage drawImage2out(String backgroundImageUrl,BufferedImage qrCodeImage,String putImgPoster) throws IOException { + //这里对方法进行了修改直接把 BufferedImage qrCodeImage传入进来方便处理 也可以传入 String qrCodeImageUrl 图片网络路径 +// InputStream resourceAsStream = QRPostersUtil.class.getClassLoader().getResourceAsStream("templates/posters/bg.png"); +// File bgPath = ResourceUtils.getFile("classpath:templates/posters/bg.png"); +// Resource resource = new ClassPathResource("templates/posters/bg.png"); +// Resource resource = new DefaultResourceLoader().getResource("templates/posters/bg.png"); +// ClassPathResource classPathResource = new ClassPathResource("templates/posters/bg.png"); + BufferedImage bgBufImage = null; + if(null == backgroundImageUrl){ + bgBufImage = ImageIO.read(new File("F:\\ideaproj\\RuoYi-Vue\\ruoyi-segchk\\src\\main\\resources\\templates\\posters\\bg.jpg")); + } + else { + bgBufImage = ImageIO.read(new URL(backgroundImageUrl)); + } + Graphics2D bgBufImageGraphics = bgBufImage.createGraphics(); + //BufferedImage qrCodeImage = ImageIO.read(new URL(qrCodeImageUrl)); + Font font6 = new Font("苹方-简", Font.BOLD, 28); + drawString(bgBufImageGraphics, font6, "sdafasdfasdfasd",bgBufImage.getTileWidth(), 20, 10, 2 , 2); + bgBufImageGraphics.drawImage(qrCodeImage,(bgBufImage.getWidth()-qrCodeImage.getWidth())/2, (bgBufImage.getHeight()-qrCodeImage.getHeight())/2, qrCodeImage.getWidth(), qrCodeImage.getHeight(), null); + bgBufImageGraphics.dispose(); + if(putImgPoster != null){ +// Resource outres = new ClassPathResource("templates/posters/posters.png"); + ImageIO.write(bgBufImage, "png", new File(putImgPoster)); + } + System.out.printf("生成图片完成"); + return bgBufImage; + } + + /** + * 文字超出限定长度自动换行 + * + * @param g 画布 + * @param font 字体样式 + * @param text 文字 + * @param widthLength 最大长度 (多少长度后需要换行) + * @param x 文字位置坐标 x + * @param y 文字位置坐标 Y + * @param yn 每次换行偏移多少pt + * showLine 显示行数 文字可能过多 我们只显示showLine行文字 + */ + private static int drawString(Graphics2D g, Font font, String text, int widthLength, int x, int y, int yn,int showLine) { + FontMetrics fg = g.getFontMetrics(font); + ArrayList ls = new ArrayList(); + getListText(fg, text, widthLength, ls); + g.setFont(font); + for (int i = 0; i < ls.size(); i++) { + if(i==showLine) { + break; + } + if (i == 0) { + g.drawString(ls.get(i), x, y); + } else { + g.drawString(ls.get(i), x, y + i*yn); + } + } + int height=fg.getHeight(); + if(ls.size()<=showLine) { + y=y+height*ls.size(); + }else { + y=y+height*showLine; + } + return y; + } + + /** + * 递归 切割字符串 + * @param fg + * @param text + * @param widthLength + * @param ls + */ + private static void getListText(FontMetrics fg, String text, int widthLength, ArrayList ls) { + String ba = text; + boolean b = true; + int i = 1; + while (b) { + if (fg.stringWidth(text) > widthLength) { + text = text.substring(0, text.length() - 1); + i++; + } else { + b = false; + } + } + if (i != 1) { + ls.add(ba.substring(0, ba.length() - i)); + getListText(fg, ba.substring(ba.length() - i), widthLength, ls); + } else { + ls.add(text); + } + } + + public static void main(String[] args) throws Exception{ +// 先生成二维码 + BufferedImage ti =createImage("xh6lSOzYdIMVanArR9AY0","https://b-ssl.duitang.com/uploads/item/201706/27/20170627012435_mJLiX.thumb.700_0.jpeg",true); + //输出文件 + File file = new File("E:\\123.jpg"); + ImageIO.write(ti, "jpg", file); +// drawImage(); + drawImage1("https://img.redocn.com/sheji/20170911/daxuexiaoyuanyinlejiegechangbisaihaibao_8694885.jpg",ti,"C:\\Users\\Public\\Desktop\\dome.jpg"); + } + + +} + diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/util/QqOssClient.java b/ruoyi-segchk/src/main/java/com/ruoyi/util/QqOssClient.java new file mode 100644 index 0000000..85969ea --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/util/QqOssClient.java @@ -0,0 +1,366 @@ +package com.ruoyi.util; + + +import com.qcloud.cos.COSClient; +import com.qcloud.cos.ClientConfig; +import com.qcloud.cos.auth.BasicCOSCredentials; +import com.qcloud.cos.auth.COSCredentials; +import com.qcloud.cos.exception.CosClientException; +import com.qcloud.cos.exception.CosServiceException; +import com.qcloud.cos.model.*; +import com.qcloud.cos.region.Region; +import com.ruoyi.util.bean.OssYunConf; +import com.ruoyi.util.md5.MD5; +import org.springframework.web.multipart.MultipartFile; + +import java.io.ByteArrayInputStream; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.util.Date; +import java.util.List; + +/** + * @Author: SunJunxian + * @Date: 2018/12/17 + * @Description: java实现腾讯云存储服务(COSClient) + * @REGIONID 区域 + * @KEY 上传上云之后的名字 + * @KEY01 需要删除的文件 + */ +public class QqOssClient { + + + private static final String ACCESSKEY = "AKID187989o64Q4hjfItRjjplnu6HFwouHOEo7AOQgl"; + private static final String SECRETKEY = "ysBE66Bs64LZ56onV1KPIu3CUWWGfngdIhpiKn"; + private static final String BUCKETNAME = "wans76787hunfu-1301582899"; + private static final String APPID = "125178787827811"; + private static final String REGIONID = "ap-g798uangzhou"; + private static final String KEY = "MyFile1/989zookeeper-3.4.8.tar.gz"; + private static final String KEY01 = "MyFil989e1/1.jpg"; + + /** + * 上传腾讯云 + * + * @param file + * @param bytes 图片字节 + * @param type 上传的类型 0 图片 1 视频 + * @return 返回图片在又拍云的地址 + */ + public static String uploadToQqOss(OssYunConf cloudStorageConfig, MultipartFile file, byte[] bytes, String fileOriginName, String type) { + String url = null; + + String accessKey = cloudStorageConfig.getAccessKeyId(); + String secretKey = cloudStorageConfig.getAccessKeySecret(); + String bucket = cloudStorageConfig.getEndPoint(); + // bucket的命名规则为{name}-{appid} ,此处填写的存储桶名称必须为此格式 + String bucketName = cloudStorageConfig.getBucketName(); + // 1 初始化用户身份信息(secretId, secretKey) + COSCredentials cred = new BasicCOSCredentials(accessKey, secretKey); + // 2 设置bucket的区域, COS地域的简称请参照 https://cloud.tencent.com/document/product/436/6224 + ClientConfig clientConfig = new ClientConfig(new Region(bucket)); + // 3 生成cos客户端 + COSClient cosclient = new COSClient(cred, clientConfig); + // String suffix = fileOriginName.substring(fileOriginName.lastIndexOf(".")).toLowerCase(); + //获取腾讯云路径前缀 + String dir = cloudStorageConfig.getPrefix(); + + // 简单文件上传, 最大支持 5 GB, 适用于小文件上传, 建议 20 M 以下的文件使用该接口 + // 大文件上传请参照 API 文档高级 API 上传 + File localFile = null; + try { + // 获取字符串的MD5结果,file.getBytes()--输入的字符串转换成字节数组 + String md5 = MD5.getMessageDigest(file.getBytes()); + String filePath = String.format("%1$s/%2$s%3$s", dir, md5, fileOriginName); + localFile = File.createTempFile("temp", null); + file.transferTo(localFile); + // 指定要上传到 COS 上的路径 + String key = filePath; + PutObjectRequest putObjectRequest = new PutObjectRequest(bucketName, key, localFile); + PutObjectResult putObjectResult = cosclient.putObject(putObjectRequest); + String qCloudDomain = cloudStorageConfig.getAddress(); + url = String.format("%1$s/%2$s", qCloudDomain, filePath); + + } catch (IOException e) { + + } finally { + // 关闭客户端(关闭后台线程) + cosclient.shutdown(); + } + + return url; + } + + /** + * 初始化CosClient相关配置, appid、accessKey、secretKey、region + * + * @return + */ + public static COSClient getCosClient() { + // 1 初始化用户身份信息(secretId, secretKey) + COSCredentials cred = new BasicCOSCredentials(ACCESSKEY, SECRETKEY); + // 2 设置bucket的区域, COS地域的简称请参照 https://cloud.tencent.com/document/product/436/6224 + // clientConfig中包含了设置region, https(默认http), 超时, 代理等set方法, 使用可参见源码或者接口文档FAQ中说明 + ClientConfig clientConfig = new ClientConfig(new Region(REGIONID)); + // 3 生成cos客户端 + COSClient cosClient = new COSClient(cred, clientConfig); + // bucket的命名规则为{name}-{appid} ,此处填写的存储桶名称必须为此格式 + //String bucketName = BUCKETNAME; + return cosClient; + } + + /** + * 上传文件 + * + * @return //绝对路径和相对路径都OK + */ + public static String uploadFile() { +// File localFile = new File("E:\\software\\JavaProject\\demo\\demo20\\src\\main\\resources\\1.jpg"); + File localFile = new File("C:\\Users\\DEL\\Desktop\\pic\\logo.png"); + PutObjectRequest putObjectRequest = new PutObjectRequest(BUCKETNAME, localFile.getName(), localFile); + + // 设置存储类型, 默认是标准(Standard), 低频(standard_ia),一般为标准的 + putObjectRequest.setStorageClass(StorageClass.Standard); + + COSClient cc = getCosClient(); + try { + PutObjectResult putObjectResult = cc.putObject(putObjectRequest); + // putobjectResult会返回文件的etag + String etag = putObjectResult.getETag(); + + System.out.println(etag); + } catch (CosServiceException e) { + e.printStackTrace(); + } catch (CosClientException e) { + e.printStackTrace(); + } + // 关闭客户端 + cc.shutdown(); + return null; + } + + /** + * 下载文件 + * + * @param bucketName + * @param key + * @return + */ + public static String downLoadFile(String bucketName, String key) { + File downFile = new File("E:\\software\\1.jpg"); + COSClient cc = getCosClient(); + GetObjectRequest getObjectRequest = new GetObjectRequest(bucketName, key); + + ObjectMetadata downObjectMeta = cc.getObject(getObjectRequest, downFile); + cc.shutdown(); + String etag = downObjectMeta.getETag(); + return etag; + } + + /** + * 删除文件 + * + * @param bucketName + * @param key + */ + public static void deleteFile(String bucketName, String key) { + COSClient cc = getCosClient(); + try { + cc.deleteObject(bucketName, key); + } catch (CosClientException e) { + e.printStackTrace(); + } finally { + cc.shutdown(); + } + + } + + /** + * 创建桶 + * + * @param bucketName + * @return + * @throws CosClientException + * @throws CosServiceException + */ + public static Bucket createBucket(String bucketName) throws CosClientException, CosServiceException { + COSClient cc = getCosClient(); + Bucket bucket = null; + try { + bucket = cc.createBucket(bucketName); + } catch (CosClientException e) { + e.printStackTrace(); + } finally { + } + return bucket; + } + + ; + + public static String uploadToUpYunForBase64(OssYunConf cloudStorageConfig, InputStream inputStream, byte[] bytes, String fileOriginName, byte[] bytes1) { + String url = null; + + String accessKey = cloudStorageConfig.getAccessKeyId(); + String secretKey = cloudStorageConfig.getAccessKeySecret(); + String bucket = cloudStorageConfig.getEndPoint(); + // bucket的命名规则为{name}-{appid} ,此处填写的存储桶名称必须为此格式 + String bucketName = cloudStorageConfig.getBucketName(); + // 1 初始化用户身份信息(secretId, secretKey) + COSCredentials cred = new BasicCOSCredentials(accessKey, secretKey); + // 2 设置bucket的区域, COS地域的简称请参照 https://cloud.tencent.com/document/product/436/6224 + ClientConfig clientConfig = new ClientConfig(new Region(bucket)); + // 3 生成cos客户端 + COSClient cosclient = new COSClient(cred, clientConfig); + // String suffix = fileOriginName.substring(fileOriginName.lastIndexOf(".")).toLowerCase(); + //获取腾讯云路径前缀 + String dir = cloudStorageConfig.getPrefix(); + + // 简单文件上传, 最大支持 5 GB, 适用于小文件上传, 建议 20 M 以下的文件使用该接口 + // 大文件上传请参照 API 文档高级 API 上传 + try { + // 获取字符串的MD5结果,file.getBytes()--输入的字符串转换成字节数组 + String md5 = MD5.getMessageDigest(bytes); + String filePath = String.format("%1$s/%2$s%3$s", dir, md5, fileOriginName); + + // 指定要上传到 COS 上的路径 + String key = filePath; + ObjectMetadata metadata = new ObjectMetadata(); + // metadata.setContentType("image/jpeg"); + String backUrl = ""; + metadata.setContentLength(bytes.length); + PutObjectRequest putObjectRequest = new PutObjectRequest(bucketName, key, new ByteArrayInputStream(bytes), + metadata); + + // 设置存储类型, 默认是标准(Standard), 低频(standard_ia) + putObjectRequest.setStorageClass(StorageClass.Standard_IA); + COSClient cc = getCosClient(); + try { + PutObjectResult putObjectResult1 = cc.putObject(putObjectRequest); + // putobjectResult会返回文件的etag + backUrl = cloudStorageConfig.getAddress() + "/" + key; + return backUrl; + } catch (CosServiceException e) { + e.printStackTrace(); + } catch (CosClientException e) { + e.printStackTrace(); + } + // 关闭客户端 + cc.shutdown(); + + return backUrl; + + } catch (Exception e) { + + } finally { + // 关闭客户端(关闭后台线程) + cosclient.shutdown(); + } + + return url; + } + + /** + * 判断桶是否存在 + * + * @param bucketName + * @return + * @throws CosClientException + * @throws CosServiceException + */ + public static boolean doesBucketExist(String bucketName) throws CosClientException, CosServiceException { + COSClient cc = getCosClient(); + boolean bucketExistFlag = cc.doesBucketExist(bucketName); + return bucketExistFlag; + } + + ; + + /** + * 查看桶文件 + * + * @param bucketName + * @return + * @throws CosClientException + * @throws CosServiceException + */ + public static ObjectListing listObjects(String bucketName) throws CosClientException, CosServiceException { + COSClient cc = getCosClient(); + + // 获取 bucket 下成员(设置 delimiter) + ListObjectsRequest listObjectsRequest = new ListObjectsRequest(); + listObjectsRequest.setBucketName(bucketName); + // 设置 list 的 prefix, 表示 list 出来的文件 key 都是以这个 prefix 开始 + listObjectsRequest.setPrefix(""); + // 设置 delimiter 为/, 即获取的是直接成员,不包含目录下的递归子成员 + listObjectsRequest.setDelimiter("/"); + // 设置 marker, (marker 由上一次 list 获取到, 或者第一次 list marker 为空) + listObjectsRequest.setMarker(""); + // 设置最多 list 100 个成员,(如果不设置, 默认为 1000 个,最大允许一次 list 1000 个 key) + listObjectsRequest.setMaxKeys(100); + + ObjectListing objectListing = cc.listObjects(listObjectsRequest); + // 获取下次 list 的 marker + String nextMarker = objectListing.getNextMarker(); + // 判断是否已经 list 完, 如果 list 结束, 则 isTruncated 为 false, 否则为 true + boolean isTruncated = objectListing.isTruncated(); + List objectSummaries = objectListing.getObjectSummaries(); + for (COSObjectSummary cosObjectSummary : objectSummaries) { + // get file path + String key = cosObjectSummary.getKey(); + // get file length + long fileSize = cosObjectSummary.getSize(); + // get file etag + String eTag = cosObjectSummary.getETag(); + // get last modify time + Date lastModified = cosObjectSummary.getLastModified(); + // get file save type + String StorageClassStr = cosObjectSummary.getStorageClass(); + } + return objectListing; + } + + ; + + /** + * 查询一个 Bucket 所在的 Region。 + * + * @param bucketName + * @return + * @throws CosClientException + * @throws CosServiceException + */ + public static String getBucketLocation(String bucketName) throws CosClientException, CosServiceException { + COSClient cosClient = getCosClient(); + // bucket 的命名规则为{name}-{appid} ,此处填写的存储桶名称必须为此格式 + String location = cosClient.getBucketLocation(bucketName); + return location; + } + + public static void main(String[] args) { + uploadFile(); +// downLoadFile(BUCKETNAME , KEY); + // deleteFile(BUCKETNAME , KEY01); +// createBucket("sunjunxian01-1251782781"); + //deleteBucket(); +// doesBucketExist("sunjunxian01-1251782781"); +// System.out.println(listObjects(BUCKETNAME)); + //System.out.println("BUCKETNAME的位置:" + getBucketLocation(BUCKETNAME)); + } + + /** + * 删除桶 + * + * @param bucketName + * @throws CosClientException + * @throws CosServiceException + */ + public void deleteBucket(String bucketName) throws CosClientException, CosServiceException { + COSClient cc = getCosClient(); + try { + cc.deleteBucket(bucketName); + } catch (CosClientException e) { + e.printStackTrace(); + } finally { + } + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/util/RandomMathLetter.java b/ruoyi-segchk/src/main/java/com/ruoyi/util/RandomMathLetter.java new file mode 100644 index 0000000..a2fc8d3 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/util/RandomMathLetter.java @@ -0,0 +1,37 @@ +package com.ruoyi.util; + +import java.util.Random; + +/** + * 随机生成字母和数字组合 + * + * @author 魔金商城 on 2017/6/1. + */ +public class RandomMathLetter { + /** + * 产生随机字符串 + */ + private static Random randGen = null; + /** + * 数字和字母 + */ + private static char[] numbersAndLetters = null; + + /** + * 字符串 + */ + public static String randomString(int length) { + if (length < 1) { + return null; + } + if (randGen == null) { + randGen = new Random(); + numbersAndLetters = ("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ").toCharArray(); + } + char[] randBuffer = new char[length]; + for (int i = 0; i < randBuffer.length; i++) { + randBuffer[i] = numbersAndLetters[randGen.nextInt(35)]; + } + return new String(randBuffer); + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/util/RedisCacheErrorHandler.java b/ruoyi-segchk/src/main/java/com/ruoyi/util/RedisCacheErrorHandler.java new file mode 100644 index 0000000..ed83962 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/util/RedisCacheErrorHandler.java @@ -0,0 +1,44 @@ +package com.ruoyi.util; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.cache.Cache; +import org.springframework.cache.interceptor.CacheErrorHandler; +import org.springframework.stereotype.Service; + +/** + * Created by 魔金商城 on 18/2/5. + * redis 异常处理器 + */ +@Service +public class RedisCacheErrorHandler implements CacheErrorHandler { + + /** + * 调试日志 + */ + private Logger logger = LoggerFactory.getLogger(RedisCacheErrorHandler.class); + + @Override + public void handleCacheClearError(RuntimeException e, Cache cache) { + logger.error("handleCacheClearError", e); + } + + @Override + public void handleCacheGetError(RuntimeException e, Cache cache, Object o) { + logger.error("get from redis fail and cache:{} \r\n o:{}", cache, o); + logger.error("handleCacheGetError", e); + + } + + + @Override + public void handleCacheEvictError(RuntimeException e, Cache cache, Object o) { + logger.error("Evict from redis fail and cache:{} \r\n o:{}", cache, o); + logger.error("handleCacheEvictError", e); + } + + @Override + public void handleCachePutError(RuntimeException e, Cache cache, Object o, Object o1) { + logger.error("handleCachePutError", e); + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/util/RedisCahceKey.java b/ruoyi-segchk/src/main/java/com/ruoyi/util/RedisCahceKey.java new file mode 100644 index 0000000..e5ee146 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/util/RedisCahceKey.java @@ -0,0 +1,86 @@ +package com.ruoyi.util; + +/** + * Created by 魔金商城 on 18/2/6. + * redis缓存中的key + */ +public interface RedisCahceKey { + + /** + * mobile端首页缓存key + */ + String MOBILE_TEMPLATE = "MOBILE_TEMPLATE"; + + /** + * 地区缓存key + */ + String AREA = "AREA"; + + /** + * 基本信息设置缓存key + */ + String BASE_INFO_SET = "BASE_INFO_SET"; + + /** + * pc端首页缓存key + */ + String PC_TEMPLATE = "PC_TEMPLATE"; + + + // pc端店铺首页模版缓存key + String STORE_PC_TEMPLATE = "STORE_PC_TEMPLATE"; + + /** + * 手机端专题页缓存key + */ + String MOBILE_THEMATIC = "MOBILE_THEMATIC"; + + /** + * PC端专题页缓存key + */ + String PC_THEMATIC = "PC_THEMATIC"; + + /** + * APP端首页模版缓存key + */ + String APP_INDEX_TEMPLATE = "APP_INDEX_TEMPLATE"; + + /** + * APP 专题页缓存 + */ + String APP_THEMATIC = "APP_THEMATIC"; + + /** + * APPLET 端首页模版缓存key + */ + String APPLET_INDEX_TEMPLATE = "APPLET_INDEX_TEMPLATE"; + + /** + * APPLET 专题页缓存 + */ + String APPLET_THEMATIC = "APPLET_THEMATIC"; + + + /** + * 促销设置缓存key + */ + String MARKETING_SETTING = "MARKETING_SETTING"; + + /** + * 微信用户关联缓存key + */ + String WE_CHAT_CUSTOMER_LINK = "WE_CHAT_CUSTOMER_LINK"; + + /** + * app版本 + */ + String APP_VERSION = "APP_VERSION"; + /** + * 社区团购设置 + */ + String COMMUNITY_BUY_SETTING = "COMMUNITY_BUY_SETTING"; + /** + * 社区推广 + */ + String COMMUNITY_BUY_INDEX = "COMMUNITY_BUY_INDEX"; +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/util/ShareCodeUtils.java b/ruoyi-segchk/src/main/java/com/ruoyi/util/ShareCodeUtils.java new file mode 100644 index 0000000..9586b29 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/util/ShareCodeUtils.java @@ -0,0 +1,64 @@ +package com.ruoyi.util; + +import java.util.Random; + +/** + * 邀请码生成器,算法原理:
+ * 1) 获取id: 1127738
+ * 2) 使用自定义进制转为:gpm6
+ * 3) 转为字符串,并在后面加'o'字符:gpm6o
+ * 4)在后面随机产生若干个随机数字字符:gpm6o7
+ * 转为自定义进制后就不会出现o这个字符,然后在后面加个'o',这样就能确定唯一性。最后在后面产生一些随机字符进行补全。
+ */ +public class ShareCodeUtils { + + /** + * 自定义进制(0,1没有加入,容易与o,l混淆) + */ + private static final char[] r = new char[]{'q', 'w', 'e', '8', 'a', 's', '2', 'd', 'z', 'x', '9', 'c', '7', 'p', '5', 'i', 'k', '3', 'm', 'j', 'u', 'f', 'r', '4', 'v', 'y', 'l', 't', 'n', '6', 'b', 'g', 'h'}; + + /** + * (不能与自定义进制有重复) + */ + private static final char b = 'o'; + + /** + * 进制长度 + */ + private static final int binLen = r.length; + + /** + * 序列最小长度 + */ + private static final int s = 6; + + /** + * 根据ID生成六位随机码 + * + * @param id ID + * @return 随机码 + */ + public static String toSerialCode(long id) { + char[] buf = new char[32]; + int charPos = 32; + + while ((id / binLen) > 0) { + int ind = (int) (id % binLen); + buf[--charPos] = r[ind]; + id /= binLen; + } + buf[--charPos] = r[(int) (id % binLen)]; + String str = new String(buf, charPos, (32 - charPos)); + // 不够长度的自动随机补全 + if (str.length() < s) { + StringBuilder sb = new StringBuilder(); + sb.append(b); + Random rnd = new Random(); + for (int i = 1; i < s - str.length(); i++) { + sb.append(r[rnd.nextInt(binLen)]); + } + str += sb.toString(); + } + return str; + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/util/SmsUtil.java b/ruoyi-segchk/src/main/java/com/ruoyi/util/SmsUtil.java new file mode 100644 index 0000000..704b03d --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/util/SmsUtil.java @@ -0,0 +1,124 @@ +package com.ruoyi.util; + +import com.aliyuncs.DefaultAcsClient; +import com.aliyuncs.dysmsapi.model.v20170525.SendSmsRequest; +import com.aliyuncs.dysmsapi.model.v20170525.SendSmsResponse; +import com.aliyuncs.exceptions.ClientException; +import com.aliyuncs.http.MethodType; +import com.aliyuncs.profile.DefaultProfile; +import com.ruoyi.util.bean.RequestParam; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.Objects; + +/** + * 发送短信工具类 + * + * @author 魔金商城 on 2017/9/7. + */ +public class SmsUtil { + + private static final Logger logger = LoggerFactory.getLogger(SmsUtil.class); + + /** + * 发送短信-新 + * + * @param requestParam 请求中的参数实体类 + * @return 0 成功 1失败 + */ + public static int newSendSms(RequestParam requestParam) { + logger.info("newSendSms response info:{}", requestParam); + if (Objects.isNull(requestParam)) { + logger.info("newSendSms error due to requestParam is null"); + return 1; + } + //设置超时时间-可自行调整 + System.setProperty("sun.net.client.defaultConnectTimeout", "10000"); + System.setProperty("sun.net.client.defaultReadTimeout", "10000"); + //初始化ascClient需要的几个参数 + final String product = "Dysmsapi";//短信API产品名称(短信产品名固定,无需修改) + final String domain = requestParam.getInterfaceUrl();//短信API产品域名(接口地址固定,无需修改) + //你的accessKeyId + final String accessKeyId = requestParam.getAccessKeyId(); + //你的accessKeySecret + final String accessKeySecret = requestParam.getAccessKeySecret(); + //组装请求对象 + SendSmsRequest sendSmsRequest = new SendSmsRequest(); + //使用post提交 + sendSmsRequest.setMethod(MethodType.POST); + //必填:待发送手机号。支持以逗号分隔的形式进行批量调用,批量上限为1000个手机号码,批量调用相对于单条调用及时性稍有延迟,验证码类型的短信推荐使用单条调用的方式 + sendSmsRequest.setPhoneNumbers(requestParam.getPhoneNumbers()); + //必填:短信签名-可在短信控制台中找到 + sendSmsRequest.setSignName(requestParam.getSignName()); + //必填:短信模板-可在短信控制台中找到 + sendSmsRequest.setTemplateCode(requestParam.getTemplateCode()); + //可选:模板中的变量替换JSON串,如模板内容为"亲爱的${name},您的验证码为${code}"时,此处的值为(友情提示:如果JSON中需要带换行符,请参照标准的JSON协议对换行符的要求,比如短信内容中包含\r\n的情况在JSON中需要表示成\\r\\n,否则会导致JSON在服务端解析失败) + sendSmsRequest.setTemplateParam("{\"code\":\"" + requestParam.getTemplateParam() + "\"}"); + //1.可选-上行短信扩展码(无特殊需求用户请忽略此字段):request.setSmsUpExtendCode("90997");//2.可选:outId为提供给业务方扩展字段,最终在短信回执消息中将此值带回给调用者:request.setOutId("yourOutId"); + //请求失败这里会抛ClientException异常 + SendSmsResponse sendSmsResponse; + try { + //初始化ascClient,暂时不支持多region + DefaultProfile.addEndpoint("cn-hangzhou", "cn-hangzhou", product, domain); + sendSmsResponse = new DefaultAcsClient(DefaultProfile.getProfile("cn-hangzhou", accessKeyId, accessKeySecret)).getAcsResponse(sendSmsRequest); + } catch (ClientException e) { + logger.error("newSendSms error{}:", e); + return 1; + } + logger.info("newSendSms response code:{} \r\n message:{}", sendSmsResponse.getCode(), sendSmsResponse.getMessage()); + return "OK".equals(sendSmsResponse.getCode()) ? 0 : 1; + } + + + /** + * 发送短信-新通用 + * + * @param requestParam 请求中的参数实体类 + * @return 0 成功 1失败 + */ + public static int newSendSmsCommon(RequestParam requestParam) { + logger.info("newSendSms response info:{}", requestParam); + if (Objects.isNull(requestParam)) { + logger.info("newSendSms error due to requestParam is null"); + return 1; + } + //设置超时时间-可自行调整 + System.setProperty("sun.net.client.defaultConnectTimeout", "10000"); + System.setProperty("sun.net.client.defaultReadTimeout", "10000"); + //初始化ascClient需要的几个参数 + final String product = "Dysmsapi";//短信API产品名称(短信产品名固定,无需修改) + final String domain = requestParam.getInterfaceUrl();//短信API产品域名(接口地址固定,无需修改) + //你的accessKeyId + final String accessKeyId = requestParam.getAccessKeyId(); + //你的accessKeySecret + final String accessKeySecret = requestParam.getAccessKeySecret(); + //组装请求对象 + SendSmsRequest sendSmsRequest = new SendSmsRequest(); + //使用post提交 + sendSmsRequest.setMethod(MethodType.POST); + //必填:待发送手机号。支持以逗号分隔的形式进行批量调用,批量上限为1000个手机号码,批量调用相对于单条调用及时性稍有延迟,验证码类型的短信推荐使用单条调用的方式 + sendSmsRequest.setPhoneNumbers(requestParam.getPhoneNumbers()); + //必填:短信签名-可在短信控制台中找到 + sendSmsRequest.setSignName(requestParam.getSignName()); + //必填:短信模板-可在短信控制台中找到 + sendSmsRequest.setTemplateCode(requestParam.getTemplateCode()); + //可选:模板中的变量替换JSON串,如模板内容为"亲爱的${name},您的验证码为${code}"时,此处的值为(友情提示:如果JSON中需要带换行符,请参照标准的JSON协议对换行符的要求,比如短信内容中包含\r\n的情况在JSON中需要表示成\\r\\n,否则会导致JSON在服务端解析失败) + sendSmsRequest.setTemplateParam(requestParam.getSmsParamString()); + //1.可选-上行短信扩展码(无特殊需求用户请忽略此字段):request.setSmsUpExtendCode("90997");//2.可选:outId为提供给业务方扩展字段,最终在短信回执消息中将此值带回给调用者:request.setOutId("yourOutId"); + //请求失败这里会抛ClientException异常 + SendSmsResponse sendSmsResponse; + try { + //初始化ascClient,暂时不支持多region + DefaultProfile.addEndpoint("cn-hangzhou", "cn-hangzhou", product, domain); + sendSmsResponse = new DefaultAcsClient(DefaultProfile.getProfile("cn-hangzhou", accessKeyId, accessKeySecret)).getAcsResponse(sendSmsRequest); + } catch (ClientException e) { + logger.error("newSendSms error{}:", e); + return 1; + } + logger.info("newSendSms response code:{} \r\n message:{}", sendSmsResponse.getCode(), sendSmsResponse.getMessage()); + return "OK".equals(sendSmsResponse.getCode()) ? 0 : 1; + } + + +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/util/SnowflakeIdWorker.java b/ruoyi-segchk/src/main/java/com/ruoyi/util/SnowflakeIdWorker.java new file mode 100644 index 0000000..7100e4f --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/util/SnowflakeIdWorker.java @@ -0,0 +1,171 @@ +package com.ruoyi.util; + + +/** + * Created by 魔金商城 on 17/11/02. + *

+ * Twitter_Snowflake
+ * SnowFlake的结构如下(每部分用-分开):
+ * 0 - 0000000000 0000000000 0000000000 0000000000 0 - 00000 - 00000 - 000000000000
+ * 1位标识,由于long基本类型在Java中是带符号的,最高位是符号位,正数是0,负数是1,所以id一般是正数,最高位是0
+ * 41位时间截(毫秒级),注意,41位时间截不是存储当前时间的时间截,而是存储时间截的差值(当前时间截 - 开始时间截) + * 得到的值),这里的的开始时间截,一般是我们的id生成器开始使用的时间,由我们程序来指定的(如下下面程序IdWorker类的startTime属性)。41位的时间截,可以使用69年,年T = (1L << 41) / (1000L * 60 * 60 * 24 * 365) = 69
+ * 10位的数据机器位,可以部署在1024个节点,包括5位datacenterId和5位workerId
+ * 12位序列,毫秒内的计数,12位的计数顺序号支持每个节点每毫秒(同一机器,同一时间截)产生4096个ID序号
+ * 加起来刚好64位,为一个Long型。
+ * SnowFlake的优点是,整体上按照时间自增排序,并且整个分布式系统内不会产生ID碰撞(由数据中心ID和机器ID作区分),并且效率较高,经测试,SnowFlake每秒能够产生26万ID左右。 + */ +public class SnowflakeIdWorker { + /** + * 开始时间截 (2015-01-01) + */ + private final long twepoch = 1420041600000L; + + /** + * 机器id所占的位数 + */ + private final long workerIdBits = 5L; + + /** + * 数据标识id所占的位数 + */ + private final long datacenterIdBits = 5L; + + /** + * 支持的最大机器id,结果是31 (这个移位算法可以很快的计算出几位二进制数所能表示的最大十进制数) + */ + private final long maxWorkerId = -1L ^ (-1L << workerIdBits); + + /** + * 支持的最大数据标识id,结果是31 + */ + private final long maxDatacenterId = -1L ^ (-1L << datacenterIdBits); + + /** + * 序列在id中占的位数 + */ + private final long sequenceBits = 12L; + + /** + * 机器ID向左移12位 + */ + private final long workerIdShift = sequenceBits; + + /** + * 数据标识id向左移17位(12+5) + */ + private final long datacenterIdShift = sequenceBits + workerIdBits; + + /** + * 时间截向左移22位(5+5+12) + */ + private final long timestampLeftShift = sequenceBits + workerIdBits + datacenterIdBits; + + /** + * 生成序列的掩码,这里为4095 (0b111111111111=0xfff=4095) + */ + private final long sequenceMask = -1L ^ (-1L << sequenceBits); + + /** + * 工作机器ID(0~31) + */ + private long workerId; + + /** + * 数据中心ID(0~31) + */ + private long datacenterId; + + /** + * 毫秒内序列(0~4095) + */ + private long sequence = 0L; + + /** + * 上次生成ID的时间截 + */ + private long lastTimestamp = -1L; + + //==============================Constructors===================================== + + /** + * 构造函数 + * + * @param workerId 工作ID (0~31) + * @param datacenterId 数据中心ID (0~31) + */ + public SnowflakeIdWorker(long workerId, long datacenterId) { + if (workerId > maxWorkerId || workerId < 0) { + throw new IllegalArgumentException(String.format("worker Id can't be greater than %d or less than 0", maxWorkerId)); + } + if (datacenterId > maxDatacenterId || datacenterId < 0) { + throw new IllegalArgumentException(String.format("datacenter Id can't be greater than %d or less than 0", maxDatacenterId)); + } + this.workerId = workerId; + this.datacenterId = datacenterId; + } + + // ==============================Methods========================================== + + /** + * 获得下一个ID (该方法是线程安全的) + * + * @return SnowflakeId + */ + public synchronized long nextId() { + long timestamp = timeGen(); + + //如果当前时间小于上一次ID生成的时间戳,说明系统时钟回退过这个时候应当抛出异常 + if (timestamp < lastTimestamp) { + throw new RuntimeException( + String.format("Clock moved backwards. Refusing to generate id for %d milliseconds", lastTimestamp - timestamp)); + } + + //如果是同一时间生成的,则进行毫秒内序列 + if (lastTimestamp == timestamp) { + sequence = (sequence + 1) & sequenceMask; + //毫秒内序列溢出 + if (sequence == 0) { + //阻塞到下一个毫秒,获得新的时间戳 + timestamp = tilNextMillis(lastTimestamp); + } + } + //时间戳改变,毫秒内序列重置 + else { + sequence = 0L; + } + + //上次生成ID的时间截 + lastTimestamp = timestamp; + + //移位并通过或运算拼到一起组成64位的ID + return ((timestamp - twepoch) << timestampLeftShift) // + | (datacenterId << datacenterIdShift) // + | (workerId << workerIdShift) // + | sequence; + } + + /** + * 阻塞到下一个毫秒,直到获得新的时间戳 + * + * @param lastTimestamp 上次生成ID的时间截 + * @return 当前时间戳 + */ + protected long tilNextMillis(long lastTimestamp) { + long timestamp = timeGen(); + while (timestamp <= lastTimestamp) { + timestamp = timeGen(); + } + return timestamp; + } + + /** + * 返回以毫秒为单位的当前时间 + * + * @return 当前时间(毫秒) + */ + protected long timeGen() { + return System.currentTimeMillis(); + } + +} \ No newline at end of file diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/util/ThreadTask.java b/ruoyi-segchk/src/main/java/com/ruoyi/util/ThreadTask.java new file mode 100644 index 0000000..4893cb6 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/util/ThreadTask.java @@ -0,0 +1,33 @@ +package com.ruoyi.util; + +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; + +/** + * Created by 魔金商城 on 17/6/20. + * 线程池 + */ +public class ThreadTask { + + private static final ThreadTask threadTask = new ThreadTask(); + /** + * 固定线程池 + */ + private ExecutorService executorService = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors()); + + private ThreadTask() { + } + + public static ThreadTask getInstance() { + return threadTask; + } + + /** + * 加入线程池执行 + * + * @param runnable 执行线程 + */ + public void addTask(Runnable runnable) { + executorService.execute(runnable); + } +} \ No newline at end of file diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/util/UnionPayUtils.java b/ruoyi-segchk/src/main/java/com/ruoyi/util/UnionPayUtils.java new file mode 100644 index 0000000..e69de29 diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/util/VerifyCodeUtils.java b/ruoyi-segchk/src/main/java/com/ruoyi/util/VerifyCodeUtils.java new file mode 100644 index 0000000..3701ce3 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/util/VerifyCodeUtils.java @@ -0,0 +1,202 @@ +package com.ruoyi.util; + +import javax.imageio.ImageIO; +import java.awt.*; +import java.awt.geom.AffineTransform; +import java.awt.image.BufferedImage; +import java.io.IOException; +import java.io.OutputStream; +import java.security.SecureRandom; +import java.util.Arrays; +import java.util.Random; + +/** + * 验证码工具类 + * + * @author ruoyi + */ +public class VerifyCodeUtils { + // 使用到Algerian字体,系统里没有的话需要安装字体,字体只显示大写,去掉了1,0,i,o几个容易混淆的字符 + public static final String VERIFY_CODES = "123456789ABCDEFGHJKLMNPQRSTUVWXYZ"; + + private static Random random = new SecureRandom(); + + /** + * 使用系统默认字符源生成验证码 + * + * @param verifySize 验证码长度 + * @return + */ + public static String generateVerifyCode(int verifySize) { + return generateVerifyCode(verifySize, VERIFY_CODES); + } + + /** + * 使用指定源生成验证码 + * + * @param verifySize 验证码长度 + * @param sources 验证码字符源 + * @return + */ + public static String generateVerifyCode(int verifySize, String sources) { + if (sources == null || sources.length() == 0) { + sources = VERIFY_CODES; + } + int codesLen = sources.length(); + Random rand = new Random(System.currentTimeMillis()); + StringBuilder verifyCode = new StringBuilder(verifySize); + for (int i = 0; i < verifySize; i++) { + verifyCode.append(sources.charAt(rand.nextInt(codesLen - 1))); + } + return verifyCode.toString(); + } + + /** + * 输出指定验证码图片流 + * + * @param w + * @param h + * @param os + * @param code + * @throws IOException + */ + public static void outputImage(int w, int h, OutputStream os, String code) throws IOException { + int verifySize = code.length(); + BufferedImage image = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB); + Random rand = new Random(); + Graphics2D g2 = image.createGraphics(); + g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); + Color[] colors = new Color[5]; + Color[] colorSpaces = new Color[]{Color.WHITE, Color.CYAN, Color.GRAY, Color.LIGHT_GRAY, Color.MAGENTA, + Color.ORANGE, Color.PINK, Color.YELLOW}; + float[] fractions = new float[colors.length]; + for (int i = 0; i < colors.length; i++) { + colors[i] = colorSpaces[rand.nextInt(colorSpaces.length)]; + fractions[i] = rand.nextFloat(); + } + Arrays.sort(fractions); + + g2.setColor(Color.GRAY);// 设置边框色 + g2.fillRect(0, 0, w, h); + + Color c = getRandColor(200, 250); + g2.setColor(c);// 设置背景色 + g2.fillRect(0, 2, w, h - 4); + + // 绘制干扰线 + Random random = new Random(); + g2.setColor(getRandColor(160, 200));// 设置线条的颜色 + for (int i = 0; i < 20; i++) { + int x = random.nextInt(w - 1); + int y = random.nextInt(h - 1); + int xl = random.nextInt(6) + 1; + int yl = random.nextInt(12) + 1; + g2.drawLine(x, y, x + xl + 40, y + yl + 20); + } + + // 添加噪点 + float yawpRate = 0.05f;// 噪声率 + int area = (int) (yawpRate * w * h); + for (int i = 0; i < area; i++) { + int x = random.nextInt(w); + int y = random.nextInt(h); + int rgb = getRandomIntColor(); + image.setRGB(x, y, rgb); + } + + shear(g2, w, h, c);// 使图片扭曲 + + g2.setColor(getRandColor(100, 160)); + int fontSize = h - 4; + Font font = new Font("Algerian", Font.ITALIC, fontSize); + g2.setFont(font); + char[] chars = code.toCharArray(); + for (int i = 0; i < verifySize; i++) { + AffineTransform affine = new AffineTransform(); + affine.setToRotation(Math.PI / 4 * rand.nextDouble() * (rand.nextBoolean() ? 1 : -1), + (w / verifySize) * i + fontSize / 2, h / 2); + g2.setTransform(affine); + g2.drawChars(chars, i, 1, ((w - 10) / verifySize) * i + 5, h / 2 + fontSize / 2 - 10); + } + + g2.dispose(); + ImageIO.write(image, "jpg", os); + } + + private static Color getRandColor(int fc, int bc) { + if (fc > 255) { + fc = 255; + } + if (bc > 255) { + bc = 255; + } + int r = fc + random.nextInt(bc - fc); + int g = fc + random.nextInt(bc - fc); + int b = fc + random.nextInt(bc - fc); + return new Color(r, g, b); + } + + private static int getRandomIntColor() { + int[] rgb = getRandomRgb(); + int color = 0; + for (int c : rgb) { + color = color << 8; + color = color | c; + } + return color; + } + + private static int[] getRandomRgb() { + int[] rgb = new int[3]; + for (int i = 0; i < 3; i++) { + rgb[i] = random.nextInt(255); + } + return rgb; + } + + private static void shear(Graphics g, int w1, int h1, Color color) { + shearX(g, w1, h1, color); + shearY(g, w1, h1, color); + } + + private static void shearX(Graphics g, int w1, int h1, Color color) { + + int period = random.nextInt(2); + + boolean borderGap = true; + int frames = 1; + int phase = random.nextInt(2); + + for (int i = 0; i < h1; i++) { + double d = (double) (period >> 1) + * Math.sin((double) i / (double) period + (6.2831853071795862D * (double) phase) / (double) frames); + g.copyArea(0, i, w1, 1, (int) d, 0); + if (borderGap) { + g.setColor(color); + g.drawLine((int) d, i, 0, i); + g.drawLine((int) d + w1, i, w1, i); + } + } + + } + + private static void shearY(Graphics g, int w1, int h1, Color color) { + + int period = random.nextInt(40) + 10; // 50; + + boolean borderGap = true; + int frames = 20; + int phase = 7; + for (int i = 0; i < w1; i++) { + double d = (double) (period >> 1) + * Math.sin((double) i / (double) period + (6.2831853071795862D * (double) phase) / (double) frames); + g.copyArea(i, 0, 1, h1, 0, (int) d); + if (borderGap) { + g.setColor(color); + g.drawLine(i, (int) d, i, 0); + g.drawLine(i, (int) d + h1, i, h1); + } + + } + } +} \ No newline at end of file diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/util/WeChatAppletLoginResponse.java b/ruoyi-segchk/src/main/java/com/ruoyi/util/WeChatAppletLoginResponse.java new file mode 100644 index 0000000..36adc77 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/util/WeChatAppletLoginResponse.java @@ -0,0 +1,115 @@ +package com.ruoyi.util; + +import com.alibaba.fastjson.JSONObject; +import com.alibaba.fastjson.annotation.JSONField; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.springframework.util.StringUtils; + +/** + * 微信小程序登录返回 + * + * @author SK + * @since 2018/6/13 + */ +public class WeChatAppletLoginResponse { + /** + * 用户唯一标志 + */ + @JSONField(name = "openid") + private String openid; + + /** + * 会话密钥 + */ + @JSONField(name = "session_key") + private String session_key; + + /** + * 联合登录id 只有在用户将公众号绑定到微信开放平台帐号后,才会出现该字段。 + */ + @JSONField(name = "unionid") + private String unionid; + + /** + * 错误码(出错时返回) + */ + @JSONField(name = "errcode") + private String errcode; + + /** + * 错误信息(出错时返回) + */ + @JSONField(name = "errmsg") + private String errmsg; + + public WeChatAppletLoginResponse(String openid, String session_key, String unionid) { + this.openid = openid; + this.session_key = session_key; + this.unionid = unionid; + } + + /** + * 转换为字符串 + */ + @Override + public String toString() { + return JSONObject.toJSONString(this); + } + + /** + * 判断是否失败 + */ + @JsonIgnore + public boolean isError() { + return !StringUtils.isEmpty(this.errcode); + } + + /** + * 判断是否有unionId + * + * @return 有返回true, 否则返回false + */ + public boolean hasUnionId() { + return !StringUtils.isEmpty(unionid); + } + + public String getOpenid() { + return openid; + } + + public void setOpenid(String openid) { + this.openid = openid; + } + + public String getSession_key() { + return session_key; + } + + public void setSession_key(String session_key) { + this.session_key = session_key; + } + + public String getUnionid() { + return unionid; + } + + public void setUnionid(String unionid) { + this.unionid = unionid; + } + + public String getErrcode() { + return errcode; + } + + public void setErrcode(String errcode) { + this.errcode = errcode; + } + + public String getErrmsg() { + return errmsg; + } + + public void setErrmsg(String errmsg) { + this.errmsg = errmsg; + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/util/WeChatAppletUserInfo.java b/ruoyi-segchk/src/main/java/com/ruoyi/util/WeChatAppletUserInfo.java new file mode 100644 index 0000000..c50fe05 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/util/WeChatAppletUserInfo.java @@ -0,0 +1,101 @@ +package com.ruoyi.util; + + +/** + * 微信小程序用户信息实体 + * + * @author SK + * @since 2018/6/13 + */ +public class WeChatAppletUserInfo { + + /** + * 错误信息 + */ + private String errMsg; + + /** + * 包括敏感数据在内的完整用户信息的加密数据,详细见加密数据解密算法 + */ + private String encryptedData; + + /** + * 加密算法的初始向量,详细见加密数据解密算法 + */ + private String iv; + + /** + * 使用 sha1( rawData + sessionkey ) 得到字符串,用于校验用户信息,参考文档 + */ + private String signature; + + /** + * 不包括敏感信息的原始数据字符串,用于计算签名。 + */ + private String rawData; + + /** + * 联合登录id 只有在用户将公众号绑定到微信开放平台帐号后,才会出现该字段。 + */ + private String unionId; + + public String getErrMsg() { + return errMsg; + } + + public void setErrMsg(String errMsg) { + this.errMsg = errMsg; + } + + public String getEncryptedData() { + return encryptedData; + } + + public void setEncryptedData(String encryptedData) { + this.encryptedData = encryptedData; + } + + public String getIv() { + return iv; + } + + public void setIv(String iv) { + this.iv = iv; + } + + public String getSignature() { + return signature; + } + + public void setSignature(String signature) { + this.signature = signature; + } + + public String getRawData() { + return rawData; + } + + public void setRawData(String rawData) { + this.rawData = rawData; + } + + public String getUnionId() { + return unionId; + } + + public void setUnionId(String unionId) { + this.unionId = unionId; + } + + @Override + public String toString() { + return "WeChatAppletUserInfo{" + + "errMsg='" + errMsg + '\'' + + ", encryptedData='" + encryptedData + '\'' + + ", iv='" + iv + '\'' + + ", signature='" + signature + '\'' + + ", rawData='" + rawData + '\'' + + ", unionId='" + unionId + '\'' + + '}'; + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/util/WeChatAppletUtils.java b/ruoyi-segchk/src/main/java/com/ruoyi/util/WeChatAppletUtils.java new file mode 100644 index 0000000..08f9877 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/util/WeChatAppletUtils.java @@ -0,0 +1,260 @@ +package com.ruoyi.util; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.util.WeChatAppletLoginResponse; +import com.ruoyi.util.WeChatAppletUserInfo; +import com.ruoyi.util.WechatSetting; +import org.apache.commons.codec.binary.Base64; +import org.apache.http.HttpEntity; +import org.apache.http.HttpResponse; +import org.apache.http.HttpStatus; +import org.apache.http.client.HttpClient; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.config.RegistryBuilder; +import org.apache.http.conn.socket.ConnectionSocketFactory; +import org.apache.http.conn.socket.PlainConnectionSocketFactory; +import org.apache.http.conn.ssl.SSLConnectionSocketFactory; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.HttpClientBuilder; +import org.apache.http.impl.conn.BasicHttpClientConnectionManager; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.util.StringUtils; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.util.Objects; + +/** + * 微信小程序工具类 + * + * @author SK + * @since 2018/6/13 + */ +public class WeChatAppletUtils { + private static final Logger logger = LoggerFactory.getLogger(WeChatAppletUtils.class); + /** + * 获取登录信息地址 + */ + private final static String GET_LOGIN_INFO_URL = "https://api.weixin.qq.com/sns/jscode2session?appid=%s&secret=%s&js_code=%s&grant_type=authorization_code"; + /** + * 新的获取登录信息地址 + */ + private final static String GET_LOGIN_INFO_URL1 = "https://api.weixin.qq.com/sns/oauth2/access_token?appid=%s&secret=%s&code=%s&grant_type=authorization_code"; + /** + * 获取微信小程序access_token地址(参数为 appid 和 secret) + */ + private final static String GET_WECHAT_APPLET_ACCESS_TOKEN_ = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=%s&secret=%s"; + /** + * 获取微信小程序分享码请求地址 + */ + private final static String GET_WECHAT_APPLET_SHARE_CODE_URL = "https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token=%s"; + /** + * 获取微信小程序直播房间列表地址 + */ + private final static String GET_WECHAT_APPLET_LIVE_PLAYER_LIST_URL = "http://api.weixin.qq.com/wxa/business/getliveinfo?access_token=%s"; + + private WeChatAppletUtils() { + } + + /** + * 获取登录信息 + * + * @param code 用户登录凭证(有效期五分钟)。开发者需要在开发者服务器后台调用 api,使用 code 换取 openid 和 session_key 等信息 + * @param wechatSetting 微信设置 + * @return 微信小程序登录返回实体 + */ + public static WeChatAppletLoginResponse getLoginInfo(String code, WechatSetting wechatSetting) { + logger.debug("getLoginInfo and code:{} \r\n wechatSetting:{}", code, wechatSetting); + WeChatAppletLoginResponse weChatAppletLoginResponse = wechatSetting.getType() == 999999 + ? new WeChatAppletLoginResponse(code, code, code) + : JSON.parseObject(WechatUtils.executeHttpGet(String.format(GET_LOGIN_INFO_URL, wechatSetting.getAppId(), wechatSetting.getAppSecret(), code)), WeChatAppletLoginResponse.class); + if (Objects.isNull(weChatAppletLoginResponse)) { + logger.error("getLoginInfo fail : weChatAppletLoginResponse is null"); + return null; + } + if (weChatAppletLoginResponse.isError()) { + logger.debug("getLoginInfo fail and errorMsg:{}", weChatAppletLoginResponse.getErrmsg()); + return null; + } + logger.debug("getLoginInfo get user wechat info: {}", weChatAppletLoginResponse.toString()); + return weChatAppletLoginResponse; + } + + /** + * 根据用户信息获取unionId + * + * @param sessionKey 会话密钥 + * @param weChatAppletUserInfo 微信小程序用户信息实体 + * @return 用户unionId + */ + public static String getUnionIdFromUserInfo(String sessionKey, WeChatAppletUserInfo weChatAppletUserInfo) { + logger.debug("getUnionIdFromUserInfo and sessionKey:{} \r\n weChatAppletUserInfo:{}", sessionKey, weChatAppletUserInfo); + String unionId = null; + if (Objects.isNull(weChatAppletUserInfo)) { + logger.error("getUnionIdFromUserInfo fail:weChatAppletUserInfo is null "); + return null; + } + // 被加密的数据 + byte[] dataByte = Base64.decodeBase64(weChatAppletUserInfo.getEncryptedData()); + // 加密秘钥 + byte[] aeskey = Base64.decodeBase64(sessionKey); + // 偏移量 + byte[] ivByte = Base64.decodeBase64(weChatAppletUserInfo.getIv()); + + try { + byte[] resultByte = AesUtils.getInstance().decrypt(dataByte, aeskey, ivByte); + String userInfo = new String(resultByte, "UTF-8"); + unionId = JSON.parseObject(userInfo).getString("unionId"); + } catch (Exception e) { + e.printStackTrace(); + } + return unionId; + } + + /** + * 获取微信小程序access_token(有效期两小时) + * + * @param wechatSetting 微信设置实体 + * @return 微信小程序access_token + */ + public static String getAccessToken(WechatSetting wechatSetting) { + logger.debug("getAccessToken and wechatSetting:{} ", wechatSetting); + String accessTokenForShareUrl = String.format(GET_WECHAT_APPLET_ACCESS_TOKEN_, wechatSetting.getAppId(), wechatSetting.getAppSecret()); + JSONObject res = JSON.parseObject(CustomHttpUtils.doGet(accessTokenForShareUrl)); + if (!StringUtils.isEmpty(res.getString("errcode"))) { + if (!StringUtils.isEmpty(res.getString("errmsg"))) { + logger.error("getAccessToken Fail and errmsg:{}", res.getString("errmsg")); + } + return null; + } else { + return res.getString("access_token"); + } + } + + /** + * 获取json参数post请求返回值(微信小程序码) + * + * @param url 请求地址 + * @param jsonString 请求参数 + * @return 请求返回(ByteArrayInputStream格式,访问数组的字节输入流) + */ + public static ByteArrayInputStream getJsonRequestResult(String url, String jsonString) { + logger.debug("getWeChatAppletCode and url :{} \r\n jsonString :{} ", url, jsonString); + String result = null; + InputStream inputStream = null; + ByteArrayInputStream byteArrayInputStream = null; + BasicHttpClientConnectionManager connManager = new BasicHttpClientConnectionManager( + RegistryBuilder.create() + .register("http", PlainConnectionSocketFactory.getSocketFactory()) + .register("https", SSLConnectionSocketFactory.getSocketFactory()) + .build(), + null, + null, + null + ); + HttpClient httpClient = HttpClientBuilder.create() + .setConnectionManager(connManager) + .build(); + HttpPost httpRequest = new HttpPost(url); + httpRequest.setHeader("Content-type", "application/json; charset=utf-8"); + StringEntity requestParam = new StringEntity(jsonString, "UTF-8"); + requestParam.setContentType("application/json"); + try { + httpRequest.setEntity(requestParam); + HttpResponse response = httpClient.execute(httpRequest); + if (response.getStatusLine().getStatusCode() == HttpStatus.SC_OK) { + HttpEntity entity = response.getEntity(); + inputStream = entity.getContent(); + ByteArrayOutputStream outStream = new ByteArrayOutputStream(); + // 创建一个Buffer字符串 + byte[] buffer = new byte[1024]; + // 每次读取的字符串长度,如果为-1,代表全部读取完毕 + int len = 0; + // 使用一个输入流从buffer里把数据读取出来 + while ((len = inputStream.read(buffer)) != -1) { + // 用输出流往buffer里写入数据,中间参数代表从哪个位置开始读,len代表读取的长度 + outStream.write(buffer, 0, len); + } + // 关闭输入流 + inputStream.close(); + // 把outStream里的数据写入内存 + byteArrayInputStream = new ByteArrayInputStream(outStream.toByteArray()); + } + } catch (IOException e) { + e.printStackTrace(); + logger.error(e.getMessage()); + } + logger.debug("getJsonRequestResult and result:{}", result == null ? "" : result); + return byteArrayInputStream; + } + + /** + * 数组的字节输入流转化为base64字符串 + * + * @param inputStream 输入流 + * @return base64字符串 + */ + public static String getBase64FromInputStream(InputStream inputStream) { + // 将图片文件转化为字节数组字符串,并对其进行Base64编码处理 + byte[] data = null; + // 读取图片字节数组 + try { + if (Objects.isNull(inputStream) || inputStream.available() <= 200) { + logger.error("getBase64FromInputStream fail due to inputStream is null"); + return null; + } + ByteArrayOutputStream swapStream = new ByteArrayOutputStream(); + byte[] buff = new byte[100]; + int rc = 0; + while ((rc = inputStream.read(buff, 0, 100)) > 0) { + swapStream.write(buff, 0, rc); + } + data = swapStream.toByteArray(); + } catch (IOException e) { + e.printStackTrace(); + } finally { + if (inputStream != null) { + try { + inputStream.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + return java.util.Base64.getEncoder().encodeToString(data); + } + + /** + * 获取微信小程序分享码请求地址 + * + * @param accessToken 微信小程序access_token + * @return 微信小程序分享码请求地址 + */ + public static String getWeChatAppletShareCodeUrl(String accessToken) { + if (StringUtils.isEmpty(accessToken)) { + logger.error("getWeChatAppletShareCodeUrl fail due to accessToken is null"); + return null; + } + return String.format(GET_WECHAT_APPLET_SHARE_CODE_URL, accessToken); + } + + /** + * 获取微信小程序直播列表地址 + * + * @param accessToken 微信小程序access_token + * @return 微信小程序直播列表地址 + */ + public static String getWeChatAppletLivePlayerListUrl(String accessToken) { + if (StringUtils.isEmpty(accessToken)) { + logger.error("getWeChatAppletLivePlayerListUrl fail due to accessToken is null"); + return null; + } + return String.format(GET_WECHAT_APPLET_LIVE_PLAYER_LIST_URL, accessToken); + } + +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/util/WechatSetting.java b/ruoyi-segchk/src/main/java/com/ruoyi/util/WechatSetting.java new file mode 100644 index 0000000..b75050d --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/util/WechatSetting.java @@ -0,0 +1,286 @@ +package com.ruoyi.util; + +import org.springframework.util.StringUtils; + +/** + * 微信设置实体类 + */ +public class WechatSetting { + /** + * 公众号appId(必传) + */ + private String appId; + /** + * AppSecret(必传) + */ + private String appSecret; + /** + * 商户号(支付时必传) + */ + private String merchantNum; + /** + * API密钥(支付时必传) + */ + private String apiKey; + /** + * 支付回调(支付时必传) + */ + private String payCallback; + /** + * 网页授权回调地址(授权时必传) + */ + private String url; + /** + * 网站域名 (H5支付时必传) + */ + private String siteUrl; + + /** + * 网站名称(H5支付时必传) + */ + private String siteName; + + /** + * 终端ip地址 + */ + private String ip; + + /** + * 支付方式 1:公众号支付(openid必传) 2:H5支付 3:扫码支付 4:APP支付 5:小程序支付(openId必传) + */ + private int type; + + /** + * 公众号支付必传 openid(微信公众号支付) + */ + private String openId; + + /** + * 构造微信支付参数实体 + * + * @param ip 终端ip + * @param type 支付方式 1:公众号支付(openid必传) 2:H5支付 3:扫码支付 4:APP支付 + * @param callBackUrl 微信异步回调地址 + * @return 返回构造微信支付参数实体 + */ + public static WechatSetting build(String ip, int type, String callBackUrl) { + WechatSetting wechatSetting = new WechatSetting(); + wechatSetting.ip = ip; + wechatSetting.type = type; + wechatSetting.payCallback = callBackUrl; + return wechatSetting; + } + + /** + * 是否是app支付 + * + * @return app支付返回true 否则返回false + */ + public boolean isAppPay() { + return 4 == this.type; + } + + /** + * 是否是h5支付 + * + * @return h5支付返回true 否则返回false + */ + public boolean isH5Pay() { + return 2 == this.type; + } + + /** + * 是否是扫码支付 + * + * @return 扫码支付返回true 否则返回false + */ + public boolean isQRPay() { + return 3 == this.type; + } + + /** + * 是否是公众号支付 + * + * @return 公众号支付返回true 否则返回false + */ + public boolean isOfficialAccountPay() { + return 1 == this.type; + } + + /** + * 是否是小程序支付 + * + * @return 小程序支付返回true 否则返回false + */ + public boolean isAppletPay() { + return 5 == this.type; + } + + /** + * 检测支付时的参数 + */ + public boolean checkPayParams() { + return !StringUtils.isEmpty(appId) && !StringUtils.isEmpty(appSecret) && + !StringUtils.isEmpty(merchantNum) && !StringUtils.isEmpty(apiKey); + } + + /** + * 增加openid + * + * @param openId 公众号支付必传 openid(微信公众号支付) + * @return 返回当前对象 + */ + public WechatSetting addOpenId(String openId) { + this.openId = openId; + return this; + } + + /** + * 增加网站名称 + * + * @param siteName 网站名称 + * @return 返回当前对象 + */ + public WechatSetting addSiteName(String siteName) { + this.siteName = siteName; + return this; + } + + /** + * 增加网站域名 + * + * @param siteUrl 网站域名 + * @return 返回当前对象 + */ + public WechatSetting addSiteUrl(String siteUrl) { + this.siteUrl = siteUrl; + return this; + } + + /** + * 检测H5支付时的参数 + */ + public boolean checkH5PayParams() { + return !StringUtils.isEmpty(siteUrl) && !StringUtils.isEmpty(siteName) && checkPayParams(); + } + + /** + * 检测授权时的参数 + */ + public boolean checkOAuthParams() { + return !StringUtils.isEmpty(appId) && !StringUtils.isEmpty(appSecret) && + !StringUtils.isEmpty(url); + } + + /** + * 检测小程序授权时的参数 + */ + public boolean checkAppletOAuthParams() { + return !StringUtils.isEmpty(appId) && !StringUtils.isEmpty(appSecret); + } + + public String getAppId() { + return appId; + } + + public void setAppId(String appId) { + this.appId = appId; + } + + public String getAppSecret() { + return appSecret; + } + + public void setAppSecret(String appSecret) { + this.appSecret = appSecret; + } + + public String getMerchantNum() { + return merchantNum; + } + + public void setMerchantNum(String merchantNum) { + this.merchantNum = merchantNum; + } + + public String getApiKey() { + return apiKey; + } + + public void setApiKey(String apiKey) { + this.apiKey = apiKey; + } + + public String getPayCallback() { + return payCallback; + } + + public void setPayCallback(String payCallback) { + this.payCallback = payCallback; + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + public String getSiteUrl() { + return siteUrl; + } + + public void setSiteUrl(String siteUrl) { + this.siteUrl = siteUrl; + } + + public String getSiteName() { + return siteName; + } + + public void setSiteName(String siteName) { + this.siteName = siteName; + } + + public String getIp() { + return ip; + } + + public void setIp(String ip) { + this.ip = ip; + } + + public int getType() { + return type; + } + + public void setType(int type) { + this.type = type; + } + + public String getOpenId() { + return openId; + } + + public void setOpenId(String openId) { + this.openId = openId; + } + + @Override + public String toString() { + return "WechatSetting{" + + "appId='" + appId + '\'' + + ", appSecret='" + appSecret + '\'' + + ", merchantNum='" + merchantNum + '\'' + + ", apiKey='" + apiKey + '\'' + + ", payCallback='" + payCallback + '\'' + + ", url='" + url + '\'' + + ", siteUrl='" + siteUrl + '\'' + + ", siteName='" + siteName + '\'' + + ", ip='" + ip + '\'' + + ", type=" + type + + ", openId='" + openId + '\'' + + '}'; + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/util/WechatUtils.java b/ruoyi-segchk/src/main/java/com/ruoyi/util/WechatUtils.java new file mode 100644 index 0000000..38d5ce1 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/util/WechatUtils.java @@ -0,0 +1,714 @@ +package com.ruoyi.util; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.ruoyi.util.md5.MD5Utils; +import com.ruoyi.util.bean.*; +import com.ruoyi.util.*; +import org.apache.http.HttpEntity; +import org.apache.http.HttpResponse; +import org.apache.http.client.HttpClient; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.config.RegistryBuilder; +import org.apache.http.conn.socket.ConnectionSocketFactory; +import org.apache.http.conn.socket.PlainConnectionSocketFactory; +import org.apache.http.conn.ssl.SSLConnectionSocketFactory; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.HttpClientBuilder; +import org.apache.http.impl.conn.BasicHttpClientConnectionManager; +import org.apache.http.util.EntityUtils; +import org.dom4j.Document; +import org.dom4j.DocumentHelper; +import org.dom4j.Element; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.util.StringUtils; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.util.*; + + +/** + * 微信工具类 + */ +public class WechatUtils { + + /** + * 支付异步回调成功后需返回的xml + */ + public final static String SUCCESS_RETURN = "SUCCESSOK"; + /** + * 成功 + */ + public final static String SUCCESS = "SUCCESS"; + /** + * 公众号支付 + */ + public final static int OFFICIAL_ACCOUNT_PAY = 1; + /** + * H5支付 + */ + public final static int H5_PAY = 2; + /** + * 扫码支付 + */ + public final static int QR_PAY = 3; + /** + * app支付 + */ + public final static int APP_PAY = 4; + /** + * 小程序支付 + */ + public final static int APPLET_PAY = 5; + /** + * 调试日志 + */ + private static final Logger logger = LoggerFactory.getLogger(WechatUtils.class); + /** + * 获取code地址 + */ + private final static String GET_CODE_URL = + "https://open.weixin.qq.com/connect/oauth2/authorize?appid=%s&redirect_uri=%s&response_type=code&scope=%s&state=%s#wechat_redirect"; + /** + * 获取access_token地址 + */ + private final static String GET_ACCESS_TOKEN_URL = + "https://api.weixin.qq.com/sns/oauth2/access_token?appid=%s&secret=%s&code=%s&grant_type=authorization_code"; + /** + * 获取用户信息地址 + */ + private final static String GET_USERINFO_URL = + "https://api.weixin.qq.com/sns/userinfo?access_token=%s&openid=%s&lang=zh_CN"; + /** + * 小程序,公众号支付用户零钱地址 + */ + private final static String MMPAY_MKT_TRANSFERS = + "https://api.mch.weixin.qq.com/mmpaymkttransfers/promotion/transfers"; + /** + * 静默授权 + */ + private final static String SNSAPI_BASE = "snsapi_base"; + /** + * 用户授权 + */ + private final static String SNSAPI_USERINFO = "snsapi_userinfo"; + /** + * 微信支付统一下单地址 + */ + private final static String UNION_SUBMIT_ORDER_URL = "https://api.mch.weixin.qq.com/pay/unifiedorder"; + /** + * 获取微信分享access_token地址(参数为 appid 和 secret) + */ + private final static String GET_ACCESS_TOKEN_FOR_SHARE_URL = + "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=%s&secret=%s"; + /** + * 获取微信分享jsapi_ticket地址(参数为 access_token) + */ + private final static String GET_JSAPI_TICKET_URL = + "https://api.weixin.qq.com/cgi-bin/ticket/getticket?access_token=%s&type=jsapi"; + + private WechatUtils() { + } + + /** + * 获取静默授权地址 + * + * @param fromUrl 拦截前链接 + * @param wechatSetting 微信设置实体 + * @return 静默授权地址 + */ + public static String getCodeUrlBase(String fromUrl, WechatSetting wechatSetting) { + logger.debug("getCodeUrlBase and fromUrl:{} \r\n wechatSetting:{}", fromUrl, wechatSetting); + return String.format(GET_CODE_URL, wechatSetting.getAppId(), wechatSetting.getUrl(), SNSAPI_BASE, fromUrl); + } + + /** + * 获取用户授权地址 + * + * @param fromUrl 拦截前链接 + * @param wechatSetting 微信设置实体 + * @return 用户授权地址 + */ + public static String getCodeUrlInfo(String fromUrl, WechatSetting wechatSetting) { + logger.debug("getCodeUrlInfo and fromUrl:{}\r\n wechatSetting:{} ", fromUrl, wechatSetting); + return String.format(GET_CODE_URL, wechatSetting.getAppId(), wechatSetting.getUrl(), SNSAPI_USERINFO, fromUrl); + } + + /** + * 获取网页授权access_token + * + * @param code 微信code + * @param state 与code一起返回的状态码(额外参数) + * @param wechatSetting 微信设置实体 + * @return 网页授权返回实体类 + */ + public static AccessTokenResult getAccessToken(String code, String state, WechatSetting wechatSetting) { + AccessTokenResult res; + logger.debug("getAccessToken and code:{}\r\n wechatSetting:{} ", code, wechatSetting); + String accessTokenUrl = String.format(GET_ACCESS_TOKEN_URL, wechatSetting.getAppId(), wechatSetting.getAppSecret(), code); + res = JSON.parseObject(executeHttpGet(accessTokenUrl), AccessTokenResult.class); + if (res.isError()) { + if (!StringUtils.isEmpty(res.getErrmsg())) { + logger.error("getAccessToken Fail and errmsg:{}", res.getErrmsg()); + } + return null; + } else { + res.setRedirectUrl(state); + return res; + } + + } + + /** + * 获取微信分享access_token + * + * @param wechatSetting 微信设置实体 + * @return 微信分享access_token + */ + public static String getAccessTokenForShare(WechatSetting wechatSetting) { + logger.debug("getAccessToken and wechatSetting:{} ", wechatSetting); + String accessTokenForShareUrl = String.format(GET_ACCESS_TOKEN_FOR_SHARE_URL, wechatSetting.getAppId(), wechatSetting.getAppSecret()); + JSONObject res = JSON.parseObject(executeHttpGet(accessTokenForShareUrl)); + if (!StringUtils.isEmpty(res.getString("errcode"))) { + if (!StringUtils.isEmpty(res.getString("errmsg"))) { + logger.error("getAccessTokenForShare Fail and errmsg:{}", res.getString("errmsg")); + } + return null; + } else { + return res.getString("access_token"); + } + } + + /** + * 获取微信分享jsapi_ticket + * + * @param access_token 凭证 + * @return 微信分享jsapi_ticket + */ + public static String getJsapiTicketForShare(String access_token) { + logger.debug("getAccessToken and access_token:{} ", access_token); + String jsapiTicketForShareUrl = String.format(GET_JSAPI_TICKET_URL, access_token); + JSONObject res = JSON.parseObject(executeHttpGet(jsapiTicketForShareUrl)); + if (Integer.parseInt(res.getString("errcode")) != 0) { + if (!StringUtils.isEmpty(res.getString("errmsg"))) { + logger.error("getJsapiTicketForShare Fail and errmsg:{}", res.getString("errmsg")); + } + return null; + } else { + return res.getString("ticket"); + } + } + + /** + * 获取用户信息 + * + * @param accessToken 网页授权接口调用凭证 + * @param openId 用户的唯一标识 + * @return 用户信息返回实体类 + */ + public static UserInfoResult getUserInfo(String accessToken, String openId) { + logger.debug("getUserInfo and access_token:{}\r\n openid:{} ", accessToken, openId); + + String userInfoUrl = String.format(GET_USERINFO_URL, accessToken, openId); + UserInfoResult res = JSON.parseObject(executeHttpGet(userInfoUrl), UserInfoResult.class); + if (res.isError()) { + if (!StringUtils.isEmpty(res.getErrmsg())) { + logger.error("getUserInfo Fail and errmsg:{}", res.getErrmsg()); + } + return null; + } else { + return res; + } + } + + /** + * 获取预支付信息 + * + * @param wechatSetting 微信设置实体 + * @param orderInfoForPay 订单信息 + * @return 预支付信息 + */ + public static PrepayResult getPrepay(WechatSetting wechatSetting, OrderInfoForPay orderInfoForPay) { + logger.debug("getPrepay and \r\n wechatSetting:{} \r\n orderInfoForPay:{} ", wechatSetting, orderInfoForPay); + String xml = getWxPayParm(wechatSetting, orderInfoForPay); + String res = executeHttpPost(UNION_SUBMIT_ORDER_URL, xml); + logger.debug("getPrepay and res:{}", res); + + //将xml字符串转换为java对象 + JaxbUtil resultBinder = new JaxbUtil(PrepayResult.class); + PrepayResult prepayResult = resultBinder.fromXml(res); + if (!prepayResult.isError()) { + //公众号支付时增加返回信息 + if (wechatSetting.isOfficialAccountPay() || wechatSetting.isAppletPay()) { + SortedMap packageParams = new TreeMap<>(); + prepayResult.setPackage(); + prepayResult.setSign_type("MD5"); + prepayResult.setTime_stamp(getTimeStamp()); + packageParams.put("appId", prepayResult.getAppid()); + packageParams.put("timeStamp", prepayResult.getTime_stamp()); + packageParams.put("nonceStr", prepayResult.getNonce_str()); + packageParams.put("package", prepayResult.getPackage_()); + packageParams.put("signType", prepayResult.getSign_type()); + prepayResult.setPay_sign(createSign(packageParams, wechatSetting.getApiKey())); + } + else if (wechatSetting.isAppPay()) { + // app支付获得签名 + SortedMap packageParams = new TreeMap<>(); + prepayResult.setTime_stamp(getTimeStamp()); + packageParams.put("appid", prepayResult.getAppid()); + packageParams.put("timestamp", prepayResult.getTime_stamp()); + packageParams.put("noncestr", prepayResult.getNonce_str()); + packageParams.put("package", "Sign=WXPay"); + packageParams.put("partnerid", wechatSetting.getMerchantNum()); + packageParams.put("prepayid", prepayResult.getPrepay_id()); + prepayResult.setPay_sign(createSign(packageParams, wechatSetting.getApiKey())); + } + return prepayResult; + } else { + if (!StringUtils.isEmpty(prepayResult.getErr_code_des())) { + logger.error("getPrepay Fail and returnmsg:{} \r\n errormsg:{} ", prepayResult.getReturn_msg(), prepayResult.getErr_code_des()); + } + return null; + } + } + + + /** + * 获取提现信息 + * + * @param wechatSetting 微信设置实体 + * @param cashInfoForPay 订单信息 + * @return 预支付信息 + */ + public static WxTransferResult getTransfers(WechatSetting wechatSetting, OrderInfoForPay cashInfoForPay) { + logger.debug("getPrepay and \r\n wechatSetting:{} \r\n orderInfoForPay:{} ", wechatSetting, cashInfoForPay); + String xml = getWxPayParm(wechatSetting, cashInfoForPay); + String res = executeHttpPost(MMPAY_MKT_TRANSFERS, xml); + logger.debug("getPrepay and res:{}", res); + + //将xml字符串转换为java对象 + JaxbUtil resultBinder = new JaxbUtil(WxTransferResult.class); + WxTransferResult wxTransferResult = resultBinder.fromXml(res); + if (!wxTransferResult.isError()) { + //公众号支付时增加返回信息 + if (wechatSetting.isOfficialAccountPay() || wechatSetting.isAppletPay()) { + SortedMap packageParams = new TreeMap<>(); + wxTransferResult.setPackage(); + wxTransferResult.setSign_type("MD5"); + wxTransferResult.setTime_stamp(getTimeStamp()); + packageParams.put("appId", wxTransferResult.getMch_appid()); + packageParams.put("timeStamp", wxTransferResult.getPayment_time()); + packageParams.put("nonceStr", wxTransferResult.getNonce_str()); + packageParams.put("package", wxTransferResult.getPackage_()); + packageParams.put("signType", wxTransferResult.getSign_type()); + wxTransferResult.setPay_sign(createSign(packageParams, wechatSetting.getApiKey())); + } else if (wechatSetting.isAppPay()) { + // app支付获得签名 + SortedMap packageParams = new TreeMap<>(); + wxTransferResult.setTime_stamp(getTimeStamp()); + packageParams.put("appid", wxTransferResult.getMch_appid()); + packageParams.put("timestamp", wxTransferResult.getTime_stamp()); + packageParams.put("noncestr", wxTransferResult.getNonce_str()); + packageParams.put("package", "Sign=WXPay"); + packageParams.put("partnerid", wechatSetting.getMerchantNum()); + packageParams.put("prepayid", wxTransferResult.getPrepay_id()); + wxTransferResult.setPay_sign(createSign(packageParams, wechatSetting.getApiKey())); + } + return wxTransferResult; + } else { + if (!StringUtils.isEmpty(wxTransferResult.getErr_code_des())) { + logger.error("getPrepay Fail and returnmsg:{} \r\n errormsg:{} ", wxTransferResult.getReturn_msg(), wxTransferResult.getErr_code_des()); + } + return null; + } + } + + /** + * 获取统一下单请求参数 + * + * @param wechatSetting 微信设置实体 + * @param orderInfoForPay 订单信息 + * @return 统一下单请求参数 + */ + private static String getWxPayParm(WechatSetting wechatSetting, OrderInfoForPay orderInfoForPay) { + logger.debug("getWxPayParm and wechatSetting:{} \r\n orderInfoForPay:{} ", wechatSetting, orderInfoForPay); + SortedMap packageParams = new TreeMap<>(); + // 金额转化为分为单位 + int finalmoney = Integer.parseInt(String.format("%.2f", orderInfoForPay.getPrice()).replace(".", "")); + //交易方式 + String tradeType = ""; + //场景信息 + String sceneInfo; + //商品ID + String productId; + //公众号支付 + if (wechatSetting.isOfficialAccountPay() || wechatSetting.isAppletPay()) { + //用户唯一标识 + packageParams.put("openid", wechatSetting.getOpenId()); + tradeType = "JSAPI"; + } + //H5支付 + if (wechatSetting.isH5Pay()) { + tradeType = "MWEB"; + sceneInfo = "{\"h5_info\": {\"type\":\"Wap\",\"wap_url\": \"" + wechatSetting.getSiteUrl() + "\",\"wap_name\": \"" + wechatSetting.getSiteName() + "\"}}"; + packageParams.put("scene_info", sceneInfo); + } + //扫码支付 + if (wechatSetting.isQRPay()) { + tradeType = "NATIVE"; + productId = String.valueOf(orderInfoForPay.getGoodsId()); + packageParams.put("product_id", productId); + } + + // APP支付 + if (wechatSetting.isAppPay()) { + tradeType = "APP"; + } + //公众账号ID + packageParams.put("appid", wechatSetting.getAppId()); + //商户号 + packageParams.put("mch_id", wechatSetting.getMerchantNum()); + //随机字符串 + packageParams.put("nonce_str", getRandomString()); + //商品描述 + packageParams.put("body", getSubGoodName(orderInfoForPay.getGoodsName())); + //附加数据(支付类型) + packageParams.put("attach", orderInfoForPay.getType() + ""); + //商户订单号 + packageParams.put("out_trade_no", orderInfoForPay.getOrderCode() + "-" + getTimeStamp()); + //标价金额 + packageParams.put("total_fee", String.valueOf(finalmoney)); + //终端IP + packageParams.put("spbill_create_ip", wechatSetting.getIp());//本地测试需替换为外网ip + //通知地址 + packageParams.put("notify_url", wechatSetting.getPayCallback()); + //交易类型 + packageParams.put("trade_type", tradeType); + //签名 + packageParams.put("sign", createSign(packageParams, wechatSetting.getApiKey())); + + return getRequestXml(packageParams); + } + + /** + * 获取企业支付请求参数 + * + * @param wechatSetting 微信设置实体 + * @param cashInfoForPay 订单信息 + * @return 统一下单请求参数 + */ + private static String getWxTransfersParm(WechatSetting wechatSetting, OrderInfoForPay cashInfoForPay) { + logger.debug("getWxPayParm and wechatSetting:{} \r\n orderInfoForPay:{} ", wechatSetting, cashInfoForPay); + SortedMap packageParams = new TreeMap<>(); + // 金额转化为分为单位 + int finalmoney = Integer.parseInt(String.format("%.2f", cashInfoForPay.getPrice()).replace(".", "")); + //交易方式 + String tradeType = ""; + //场景信息 + String sceneInfo; + //商品ID + String productId; + //公众号支付 + if (wechatSetting.isOfficialAccountPay() || wechatSetting.isAppletPay()) { + //用户唯一标识 + packageParams.put("openid", wechatSetting.getOpenId()); + tradeType = "JSAPI"; + } + //H5支付 + if (wechatSetting.isH5Pay()) { + tradeType = "MWEB"; + sceneInfo = "{\"h5_info\": {\"type\":\"Wap\",\"wap_url\": \"" + wechatSetting.getSiteUrl() + "\",\"wap_name\": \"" + wechatSetting.getSiteName() + "\"}}"; + packageParams.put("scene_info", sceneInfo); + } + //扫码支付 + if (wechatSetting.isQRPay()) { + tradeType = "NATIVE"; + productId = String.valueOf(cashInfoForPay.getGoodsId()); + packageParams.put("product_id", productId); + } + + // APP支付 + if (wechatSetting.isAppPay()) { + tradeType = "APP"; + } + //商户账号appid + packageParams.put("mch_appid", wechatSetting.getAppId()); + //商户号 + packageParams.put("mchid", wechatSetting.getMerchantNum()); + //随机字符串 + packageParams.put("nonce_str", getRandomString()); + //附加数据(支付类型) + packageParams.put("check_name", "NO_CHECK"); + //商户订单号 + packageParams.put("partner_trade_no", cashInfoForPay.getOrderCode() + "-" + getTimeStamp()); + //金额 + packageParams.put("amount", String.valueOf(finalmoney)); + //付款备注 + packageParams.put("desc", cashInfoForPay.getType() == 2 ? "奖励提取" : "提现"); + //终端IP + packageParams.put("spbill_create_ip", wechatSetting.getIp());//本地测试需替换为外网ip + //签名 + packageParams.put("sign", createSign(packageParams, wechatSetting.getApiKey())); + + return getRequestXml(packageParams); + } + + + /** + * 截取商品名 + * + * @param goodName 商品名 + * @return 截取后的商品名 + */ + private static String getSubGoodName(String goodName) { + if (goodName.length() < 20) { + return goodName; + } else { + return goodName.substring(0, 19) + "..."; + } + } + + + /** + * 验证返回信息 + * + * @param inputStream 微信回调信息 + * @param wechatSetting 微信设置 + * @return 订单支付信息 + */ + public static OrderInfoAfterPay afterPayInfo(InputStream inputStream, WechatSetting wechatSetting) { + logger.debug("afterPayInfo and wechatSetting:{}", wechatSetting); + OrderInfoAfterPay orderInfoAfterPay = new OrderInfoAfterPay(); + orderInfoAfterPay.setSuccess(false); + BufferedReader br; + br = new BufferedReader(new InputStreamReader(inputStream)); + String line; + StringBuilder sb = new StringBuilder(); + try { + while ((line = br.readLine()) != null) { + sb.append(line); + } + } catch (IOException e) { + e.printStackTrace(); + } finally { + + try { + br.close(); + inputStream.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + //将xml字符串转换为java对象 + JaxbUtil resultBinder = new JaxbUtil(WechatNotifyResult.class); + WechatNotifyResult wechatNotifyResult = resultBinder.fromXml(sb.toString()); + //将xml字符串转换为map + SortedMap resultMap = new TreeMap<>(parseMapFromXmlStr(sb.toString())); + //签名 + String sign = createSign(resultMap, wechatSetting.getApiKey()); + + logger.info("wechat notify and wechatNotifyResult :{}", wechatNotifyResult); + + //验证是否失败,并验证签名 + if (!wechatNotifyResult.isError() && sign.equals(wechatNotifyResult.getSign())) { + //验证其他信息 + if (SUCCESS.equals(wechatNotifyResult.getResult_code()) + && SUCCESS.equals(wechatNotifyResult.getReturn_code()) + && wechatSetting.getAppId().equals(wechatNotifyResult.getAppid()) + && wechatSetting.getMerchantNum().equals(wechatNotifyResult.getMch_id()) + ) { + orderInfoAfterPay.setOrderCode(wechatNotifyResult.getOut_trade_no().split("-")[0]); + orderInfoAfterPay.setSuccess(true); + orderInfoAfterPay.setType(wechatNotifyResult.getAttach()); + orderInfoAfterPay.setTransCode(wechatNotifyResult.getTransaction_id()); + } + + } else { + logger.error("wechat afterPayInfo fail: returnmsg:{}\r\n errormsg:{}", wechatNotifyResult.getReturn_msg(), wechatNotifyResult.getErr_code_des()); + } + return orderInfoAfterPay; + } + + /** + * 获取请求xml + * + * @param packageParams 请求参数 + * @return 请求xml + */ + private static String getRequestXml(SortedMap packageParams) { + StringBuilder sb = new StringBuilder(); + sb.append(""); + Set es = packageParams.entrySet(); + for (Object e : es) { + Map.Entry entry = (Map.Entry) e; + String key = (String) entry.getKey(); + String value = (String) entry.getValue(); + if ("body".equalsIgnoreCase(key) || "sign".equalsIgnoreCase(key)) { + sb.append("<").append(key).append(">").append(""); + } else { + sb.append("<").append(key).append(">").append(value).append(""); + } + } + sb.append(""); + logger.debug("getRequestXml and xml:{}", sb.toString()); + return sb.toString(); + } + + /** + * 签名 + * + * @param packageParams 签名参数 + * @param apiKey 商户key + * @return 签名 + */ + private static String createSign(SortedMap packageParams, String apiKey) { + + StringBuilder sb = new StringBuilder(); + Set es = packageParams.entrySet(); + for (Object e : es) { + Map.Entry entry = (Map.Entry) e; + String k = (String) entry.getKey(); + String v = (String) entry.getValue(); + if ((v != null) && (!"".equals(v)) && (!"sign".equals(k)) && + (!"key".equals(k))) { + sb.append(k).append("=").append(v).append("&"); + } + } + sb.append("key=").append(apiKey); + logger.debug("createSign and key:{}", apiKey); + logger.debug("createSign and stringSign:{}", sb.toString()); + String sign = MD5Utils.getInstance().createMd5(sb.toString()) + .toUpperCase(); + logger.debug("createSign and sign:{}", sign); + return sign; + + } + + /** + * 执行GET方法请求数据 + * + * @param url 请求地址 + * @return 返回数据 + */ + static String executeHttpGet(String url) { + logger.debug("executeHttpGet and url:{}", url); + String result = null; + BasicHttpClientConnectionManager connManager = new BasicHttpClientConnectionManager( + RegistryBuilder.create() + .register("http", PlainConnectionSocketFactory.getSocketFactory()) + .register("https", SSLConnectionSocketFactory.getSocketFactory()) + .build(), + null, + null, + null + ); + + HttpClient httpClient = HttpClientBuilder.create() + .setConnectionManager(connManager) + .build(); + + HttpGet httpRequest = new HttpGet(url); + + try { + //使用DefaultHttpClient类的execute方法发送HTTP GET请求,并返回HttpResponse对象。 + HttpResponse httpResponse = httpClient.execute(httpRequest);//其中HttpGet是HttpUriRequst的子类 + HttpEntity httpEntity = httpResponse.getEntity(); + result = EntityUtils.toString(httpEntity, "UTF-8");//取出应答字符串 + + } catch (Exception e) { + e.printStackTrace(); + } + return result; + } + + /** + * 执行POST方法请求数据 + * + * @param url 请求地址 + * @param xml 请求参数 + * @return 返回数据 + */ + private static String executeHttpPost(String url, String xml) { + logger.debug("executeHttpPost and url:{}", url); + String result = null; + BasicHttpClientConnectionManager connManager = new BasicHttpClientConnectionManager( + RegistryBuilder.create() + .register("http", PlainConnectionSocketFactory.getSocketFactory()) + .register("https", SSLConnectionSocketFactory.getSocketFactory()) + .build(), + null, + null, + null + ); + + HttpClient httpClient = HttpClientBuilder.create() + .setConnectionManager(connManager) + .build(); + HttpPost httpRequest = new HttpPost(url); + + try { + httpRequest.setEntity(new StringEntity(xml, "UTF-8")); + //使用DefaultHttpClient类的execute方法发送HTTP GET请求,并返回HttpResponse对象。 + HttpResponse httpResponse = httpClient.execute(httpRequest);//其中HttpGet是HttpUriRequst的子类 + HttpEntity httpEntity = httpResponse.getEntity(); + result = EntityUtils.toString(httpEntity, "UTF-8");//取出应答字符串 + + } catch (Exception e) { + e.printStackTrace(); + } + return result; + } + + + /** + * 获取随机字符串 + * + * @return 随机字符串 + */ + public static String getRandomString() { + String base = "abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; + Random random = new Random(); + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < 32; i++) { + int number = random.nextInt(base.length()); + sb.append(base.charAt(number)); + } + return sb.toString(); + } + + /** + * 获取时间戳 + * + * @return 时间戳(秒数) + */ + public static String getTimeStamp() { + return String.valueOf(System.currentTimeMillis() / 1000L); + } + + /** + * 将xml字符串转换成map + * + * @param xml xml + * @return Map + */ + private static Map parseMapFromXmlStr(String xml) { + Map map = new HashMap<>(); + Document doc; + try { + doc = DocumentHelper.parseText(xml); // 将字符串转为XML + Element rootElt = doc.getRootElement(); // 获取根节点 + List list = rootElt.elements();//获取根节点下所有节点 + for (Element element : list) { //遍历节点 + map.put(element.getName(), element.getText()); //节点的name为map的key,text为map的value + } + } catch (Exception e) { + e.printStackTrace(); + } + return map; + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/util/YunUploadUtils.java b/ruoyi-segchk/src/main/java/com/ruoyi/util/YunUploadUtils.java new file mode 100644 index 0000000..0cd666d --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/util/YunUploadUtils.java @@ -0,0 +1,219 @@ +package com.ruoyi.util; + +import com.aliyun.oss.ClientException; +import com.aliyun.oss.OSSClient; +import com.aliyun.oss.OSSException; +import com.aliyun.oss.model.PutObjectRequest; +import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.util.bean.OssYunConf; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.web.multipart.MultipartFile; + +import javax.imageio.ImageIO; +import java.awt.image.BufferedImage; +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Date; +import java.util.TimeZone; +import java.util.UUID; + +/** + * Created by 魔金商城 on 17/5/8. + * 又拍云上传工具 + */ +public class YunUploadUtils { + + private static final YunUploadUtils INSTANCE = new YunUploadUtils(); + /** + * 调试工具 + */ + private Logger logger = LoggerFactory.getLogger(YunUploadUtils.class); + private SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMdd"); + + private YunUploadUtils() { + } + + public static YunUploadUtils getInstance() { + return INSTANCE; + } + + + /** + * 获取文件保存路径 + * + * @param fileOriginName 用户上传文件名 + * @return 文件保存路径 + */ + private String getFilePath(String fileOriginName) { + String fileType = "jpg"; + if (!StringUtils.isEmpty(fileOriginName) && fileOriginName.contains(".")) { + fileType = fileOriginName.substring(fileOriginName.lastIndexOf(".") + 1); + } + String fileName = String.valueOf(System.currentTimeMillis()) + "." + fileType; + String date = simpleDateFormat.format(Calendar.getInstance(TimeZone.getTimeZone("GMT+08:00")).getTime()); + return "/" + date + "/" + fileName; + } + + /** + * 判断是否是图片 + * + * @param bytes 字节数组 + * @return 是图片返回true 否则返回false + */ + private boolean isPicture(byte[] bytes) { + try { + BufferedImage image = ImageIO.read(new ByteArrayInputStream(bytes)); + return image != null; + } catch (IOException e) { + logger.error("file is not a picture ...", e); + return false; + } + } + + /** + * 上传腾讯云 + * + * @param file + * @param bytes 图片字节 + * @param type 上传的类型 0 图片 1 视频 + * @return 返回图片在又拍云的地址 + */ + public String uploadToQqOss(OssYunConf cloudStorageConfig, MultipartFile file, byte[] bytes, String fileOriginName, String type) { + return QqOssClient.uploadToQqOss(cloudStorageConfig, file, bytes, fileOriginName, type); + } + + /** + * 上传又拍云 + * + * @param upYunConf 又拍云设置 + * @param inputStream 输入流 + * @param bytes 图片字节 + * @return 返回图片在又拍云的地址 + */ + public String uploadToQqForBase64(OssYunConf upYunConf, InputStream inputStream, byte[] bytes, String fileOriginName) { + logger.debug("Being to uploadToUpYun....."); + if (org.apache.commons.lang3.ArrayUtils.isEmpty(bytes)) { + logger.error("uploadToUpYun fail due to bytes is empty ...."); + return ""; + } + return QqOssClient.uploadToUpYunForBase64(upYunConf, inputStream, bytes, fileOriginName, bytes); + } + + /** + * 上传阿里云 + * + * @param inputStream 输入流 + * @param bytes 图片字节 + * @param type 上传的类型 0 图片 1 视频 + * @return 返回图片在又拍云的地址 + */ + public String uploadToOssYun(OssYunConf config, InputStream inputStream, byte[] bytes, String fileOriginName, String type) { + String url = null; + try { + url = upload(config.getAccessKeyId(), config.getAccessKeySecret(), config.getBucketName(), config.getEndPoint(), + config.getPrefix(), getKey(config.getBucketName(), ""), inputStream); + + } catch (Exception e) { + return e.getMessage(); + } + return url; + } + + /** + * 上传又拍云 + * + * @param inputStream 输入流 + * @param bytes 图片字节 + * @return 返回图片在又拍云的地址 + */ + public String uploadToOssYunForBase64(OssYunConf config, InputStream inputStream, byte[] bytes, String fileOriginName) { + String url = null; + try { + url = upload(config.getAccessKeyId(), config.getAccessKeySecret(), config.getBucketName(), config.getEndPoint(), + config.getPrefix(), getKey(config.getBucketName(), ""), inputStream); + + } catch (Exception e) { + return e.getMessage(); + } + return url; + } + + /** + * 上传文件<>基础方法 + * + * @param accessKeyId 授权 ID + * @param accessKeySecret 授权密钥 + * @param bucketName 桶名 + * @param endpoint 节点名 + * @param styleName 样式名 + * @param key 文件名 + * @param inputStream 文件流 + * @return 访问路径 ,结果为null时说明上传失败 + */ + public String upload(String accessKeyId, String accessKeySecret, String bucketName, String endpoint, String + styleName, String key, InputStream inputStream) { + if (inputStream == null) { + return null; + } + String url = null; + OSSClient ossClient = new OSSClient(endpoint, accessKeyId, accessKeySecret); + try { + // 带进度条的上传 + ossClient.putObject(new PutObjectRequest(bucketName, key, inputStream)); + } catch (OSSException oe) { + oe.printStackTrace(); + key = null; + } catch (ClientException ce) { + ce.printStackTrace(); + key = null; + } catch (Exception e) { + e.printStackTrace(); + key = null; + } finally { + ossClient.shutdown(); + } + if (key != null) { + // 拼接文件访问路径。由于拼接的字符串大多为String对象,而不是""的形式,所以直接用+拼接的方式没有优势 + StringBuffer sb = new StringBuffer(); + sb.append("http://").append(bucketName).append(".").append(endpoint).append("/").append(key); + if (StringUtils.isNotBlank(styleName)) { + sb.append("/").append(styleName); + } + url = sb.toString(); + } + return url; + } + + /** + * 获取文件名(bucket里的唯一key) + * 上传和删除时除了需要bucketName外还需要此值 + * + * @param prefix 前缀(非必传),可以用于区分是哪个模块或子项目上传的文件 + * @param suffix 后缀(非必传), 可以是 png jpg 等 + * @return + */ + public String getKey(final String prefix, final String suffix) { + //生成uuid,替换 - 的目的是因为后期可能会用 - 将key进行split,然后进行分类统计 + String uuid = UUID.randomUUID().toString().replaceAll("-", ""); + //文件路径 + String path = DateUtils.parseDateToStr("yyyyMMdd", new Date()) + "-" + uuid; + + if (StringUtils.isNotBlank(prefix)) { + path = prefix + "-" + path; + } + if (suffix != null) { + if (suffix.startsWith(".")) { + path = path + suffix; + } else { + path = path + "." + suffix; + } + } + return path; + } + +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/util/bean/AccessTokenResult.java b/ruoyi-segchk/src/main/java/com/ruoyi/util/bean/AccessTokenResult.java new file mode 100644 index 0000000..a84de79 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/util/bean/AccessTokenResult.java @@ -0,0 +1,164 @@ +package com.ruoyi.util.bean; + +import com.alibaba.fastjson.JSONObject; +import com.alibaba.fastjson.annotation.JSONField; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.springframework.util.StringUtils; + +/** + * 网页授权返回实体类 + */ +public class AccessTokenResult { + + + /** + * 网页授权接口调用凭证 + */ + @JSONField(name = "access_token") + private String access_token; + + /** + * access_token接口调用凭证超时时间,单位(秒) + */ + @JSONField(name = "expires_in") + private int expires_in; + + /** + * 用户刷新access_token + */ + @JSONField(name = "refresh_token") + private String refresh_token; + + /** + * 用户唯一标识,请注意,在未关注公众号时,用户访问公众号的网页,也会产生一个用户和公众号唯一的OpenID + */ + @JSONField(name = "openid") + private String openid; + + /** + * 用户授权的作用域,使用逗号(,)分隔 + */ + @JSONField(name = "scope") + private String scope; + + /** + * 联合登录id + */ + @JSONField(name = "unionid") + private String unionid; + + /** + * 错误码 + */ + @JSONField(name = "errcode") + private String errcode; + + /** + * 重定向地址(出错时返回) + */ + private String redirectUrl; + + /** + * 错误信息(出错时返回) + */ + @JSONField(name = "errmsg") + private String errmsg; + + /** + * 判断是否失败 + */ + @JsonIgnore + public boolean isError() { + return !StringUtils.isEmpty(this.errcode); + } + + public String getAccess_token() { + return access_token; + } + + public void setAccess_token(String access_token) { + this.access_token = access_token; + } + + public int getExpires_in() { + return expires_in; + } + + public void setExpires_in(int expires_in) { + this.expires_in = expires_in; + } + + public String getRefresh_token() { + return refresh_token; + } + + public void setRefresh_token(String refresh_token) { + this.refresh_token = refresh_token; + } + + public String getOpenid() { + return openid; + } + + public void setOpenid(String openid) { + this.openid = openid; + } + + public String getScope() { + return scope; + } + + public void setScope(String scope) { + this.scope = scope; + } + + public String getUnionid() { + return unionid; + } + + public void setUnionid(String unionid) { + this.unionid = unionid; + } + + public String getErrcode() { + return errcode; + } + + public void setErrcode(String errcode) { + this.errcode = errcode; + } + + public String getRedirectUrl() { + return redirectUrl; + } + + public void setRedirectUrl(String redirectUrl) { + this.redirectUrl = redirectUrl; + } + + public String getErrmsg() { + return errmsg; + } + + public void setErrmsg(String errmsg) { + this.errmsg = errmsg; + } + + /** + * 转换为字符串 + */ + @Override + public String toString() { + return "AccessTokenResult{" + + "access_token='" + access_token + '\'' + + ", expires_in=" + expires_in + + ", refresh_token='" + refresh_token + '\'' + + ", openid='" + openid + '\'' + + ", scope='" + scope + '\'' + + ", unionid='" + unionid + '\'' + + ", errcode='" + errcode + '\'' + + ", redirectUrl='" + redirectUrl + '\'' + + ", errmsg='" + errmsg + '\'' + + '}'; + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/util/bean/AliPaySetting.java b/ruoyi-segchk/src/main/java/com/ruoyi/util/bean/AliPaySetting.java new file mode 100644 index 0000000..d0228f2 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/util/bean/AliPaySetting.java @@ -0,0 +1,106 @@ +package com.ruoyi.util.bean; + +import org.springframework.util.StringUtils; + +/** + * 支付宝设置实体类 + */ +public class AliPaySetting { + /** + * APPID 即创建应用后生成 + */ + private String appId; + /** + * 开发者私钥,由开发者自己生成 + */ + private String appPrivateKey; + /** + * 支付宝公钥,由支付宝生成 + */ + private String alipayPublicKey; + /** + * 前台回调地址 + */ + private String beforeCallbackUrl; + /** + * 后台回调地址 + */ + private String backCallbackUrl; + + /** + * 构造阿里支付实体 + * + * @param beforeCallbackUrl 前台回调地址 + * @param backCallbackUrl 后台回调地址 + * @return 返回支付宝配置信息 + */ + public static AliPaySetting build(String beforeCallbackUrl, String backCallbackUrl) { + AliPaySetting aliPaySetting = new AliPaySetting(); + + //前台同步回调地址 + aliPaySetting.setBeforeCallbackUrl(beforeCallbackUrl); + //异步回调地址 + aliPaySetting.setBackCallbackUrl(backCallbackUrl); + + return aliPaySetting; + } + + /** + * 检测支付时的参数 + */ + public boolean checkPayParams() { + return !StringUtils.isEmpty(appId) && !StringUtils.isEmpty(appPrivateKey) && + !StringUtils.isEmpty(alipayPublicKey); + } + + public String getAppId() { + return appId; + } + + public void setAppId(String appId) { + this.appId = appId; + } + + public String getAppPrivateKey() { + return appPrivateKey; + } + + public void setAppPrivateKey(String appPrivateKey) { + this.appPrivateKey = appPrivateKey; + } + + public String getAlipayPublicKey() { + return alipayPublicKey; + } + + public void setAlipayPublicKey(String alipayPublicKey) { + this.alipayPublicKey = alipayPublicKey; + } + + public String getBeforeCallbackUrl() { + return beforeCallbackUrl; + } + + public void setBeforeCallbackUrl(String beforeCallbackUrl) { + this.beforeCallbackUrl = beforeCallbackUrl; + } + + public String getBackCallbackUrl() { + return backCallbackUrl; + } + + public void setBackCallbackUrl(String backCallbackUrl) { + this.backCallbackUrl = backCallbackUrl; + } + + @Override + public String toString() { + return "AliPaySetting{" + + "appId='" + appId + '\'' + + ", appPrivateKey='" + appPrivateKey + '\'' + + ", alipayPublicKey='" + alipayPublicKey + '\'' + + ", beforeCallbackUrl='" + beforeCallbackUrl + '\'' + + ", backCallbackUrl='" + backCallbackUrl + '\'' + + '}'; + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/util/bean/BeanUtils.java b/ruoyi-segchk/src/main/java/com/ruoyi/util/bean/BeanUtils.java new file mode 100644 index 0000000..5ff34ae --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/util/bean/BeanUtils.java @@ -0,0 +1,104 @@ +package com.ruoyi.util.bean; + +import java.lang.reflect.Method; +import java.util.ArrayList; +import java.util.List; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * Bean 工具类 + * + * @author ruoyi + */ +public class BeanUtils extends org.springframework.beans.BeanUtils { + /** + * Bean方法名中属性名开始的下标 + */ + private static final int BEAN_METHOD_PROP_INDEX = 3; + + /** + * 匹配getter方法的正则表达式 + */ + private static final Pattern GET_PATTERN = Pattern.compile("get(\\p{javaUpperCase}\\w*)"); + + /** + * 匹配setter方法的正则表达式 + */ + private static final Pattern SET_PATTERN = Pattern.compile("set(\\p{javaUpperCase}\\w*)"); + + /** + * Bean属性复制工具方法。 + * + * @param dest 目标对象 + * @param src 源对象 + */ + public static void copyBeanProp(Object dest, Object src) { + try { + copyProperties(src, dest); + } catch (Exception e) { + e.printStackTrace(); + } + } + + /** + * 获取对象的setter方法。 + * + * @param obj 对象 + * @return 对象的setter方法列表 + */ + public static List getSetterMethods(Object obj) { + // setter方法列表 + List setterMethods = new ArrayList(); + + // 获取所有方法 + Method[] methods = obj.getClass().getMethods(); + + // 查找setter方法 + + for (Method method : methods) { + Matcher m = SET_PATTERN.matcher(method.getName()); + if (m.matches() && (method.getParameterTypes().length == 1)) { + setterMethods.add(method); + } + } + // 返回setter方法列表 + return setterMethods; + } + + /** + * 获取对象的getter方法。 + * + * @param obj 对象 + * @return 对象的getter方法列表 + */ + + public static List getGetterMethods(Object obj) { + // getter方法列表 + List getterMethods = new ArrayList(); + // 获取所有方法 + Method[] methods = obj.getClass().getMethods(); + // 查找getter方法 + for (Method method : methods) { + Matcher m = GET_PATTERN.matcher(method.getName()); + if (m.matches() && (method.getParameterTypes().length == 0)) { + getterMethods.add(method); + } + } + // 返回getter方法列表 + return getterMethods; + } + + /** + * 检查Bean方法名中的属性名是否相等。
+ * 如getName()和setName()属性名一样,getName()和setAge()属性名不一样。 + * + * @param m1 方法名1 + * @param m2 方法名2 + * @return 属性名一样返回true,否则返回false + */ + + public static boolean isMethodPropEquals(String m1, String m2) { + return m1.substring(BEAN_METHOD_PROP_INDEX).equals(m2.substring(BEAN_METHOD_PROP_INDEX)); + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/util/bean/CommonWebResult.java b/ruoyi-segchk/src/main/java/com/ruoyi/util/bean/CommonWebResult.java new file mode 100644 index 0000000..0eb14ad --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/util/bean/CommonWebResult.java @@ -0,0 +1,87 @@ +package com.ruoyi.util.bean; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + * 前端通用返回类 + * + * @author 徐凌峰 + */ +@ApiModel("接口返回公共对象") +public class CommonWebResult { + public static final CommonWebResult SUCCESS = new CommonWebResult<>(true); + public static final CommonWebResult FAIL = new CommonWebResult(false); + + static { + SUCCESS.setErrCode(0); + SUCCESS.setErrMsg("SUCCESS"); + } + + /** + * 返回给前端的业务数据 + */ + @ApiModelProperty("返回的具体业务数据") + private T data; + /** + * 错误码 + */ + private Integer errCode; + /** + * 错误信息 + */ + private String errMsg; + + public CommonWebResult(T data) { + this.data = data; + } + + public CommonWebResult() { + } + + public static CommonWebResult getSUCCESS() { + return SUCCESS; + } + + public static CommonWebResult getFAIL() { + return FAIL; + } + + public T getData() { + return data; + } + + public void setData(T data) { + this.data = data; + } + + public Integer getErrCode() { + return errCode; + } + + public void setErrCode(Integer errCode) { + this.errCode = errCode; + } + + public String getErrMsg() { + return errMsg; + } + + public void setErrMsg(String errMsg) { + this.errMsg = errMsg; + } + + public CommonWebResult data(T data) { + this.setData(data); + return this; + } + + @Override + public String toString() { + return "CommonWebResult{" + + "data=" + data + + ", errCode=" + errCode + + ", errMsg='" + errMsg + '\'' + + '}'; + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/util/bean/EmailConf.java b/ruoyi-segchk/src/main/java/com/ruoyi/util/bean/EmailConf.java new file mode 100644 index 0000000..6ae99c8 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/util/bean/EmailConf.java @@ -0,0 +1,58 @@ +package com.ruoyi.util.bean; + + +/** + * Created by 魔金商城 on 17/10/14. + * 邮箱配置类 + */ +public class EmailConf { + + /** + * 邮箱服务器的地址 + */ + private String host; + + /** + * 发送邮件人的用户名 + */ + private String userName; + + /** + * 发送邮件人的密码 + */ + private String password; + + + public String getHost() { + return host; + } + + public void setHost(String host) { + this.host = host; + } + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + @Override + public String toString() { + return "EmailConf{" + + "host='" + host + '\'' + + ", userName='" + userName + '\'' + + ", password='" + password + '\'' + + '}'; + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/util/bean/EmailContent.java b/ruoyi-segchk/src/main/java/com/ruoyi/util/bean/EmailContent.java new file mode 100644 index 0000000..6d75acb --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/util/bean/EmailContent.java @@ -0,0 +1,50 @@ +package com.ruoyi.util.bean; + + +/** + * Created by 魔金商城 on 17/10/14. + * 邮箱内容 + */ +public class EmailContent { + + + /** + * 邮件目的地 + */ + private String sendTo; + + + /** + * 邮件主题 + */ + private String subject; + + /** + * 邮件内容 + */ + private String text; + + public String getSendTo() { + return sendTo; + } + + public void setSendTo(String sendTo) { + this.sendTo = sendTo; + } + + public String getSubject() { + return subject; + } + + public void setSubject(String subject) { + this.subject = subject; + } + + public String getText() { + return text; + } + + public void setText(String text) { + this.text = text; + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/util/bean/LineColor.java b/ruoyi-segchk/src/main/java/com/ruoyi/util/bean/LineColor.java new file mode 100644 index 0000000..0674173 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/util/bean/LineColor.java @@ -0,0 +1,55 @@ +package com.ruoyi.util.bean; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + * 颜色实体类 + * + * @author 魔金商城 created on 2020/4/14 + */ +@ApiModel(description = "颜色实体") +public class LineColor { + + /** + * 红色 + */ + @ApiModelProperty(value = "红色") + private int r; + + /** + * 绿色 + */ + @ApiModelProperty(value = "绿色") + private int g; + + /** + * 蓝色 + */ + @ApiModelProperty(value = "蓝色") + private int b; + + public int getR() { + return r; + } + + public void setR(int r) { + this.r = r; + } + + public int getG() { + return g; + } + + public void setG(int g) { + this.g = g; + } + + public int getB() { + return b; + } + + public void setB(int b) { + this.b = b; + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/util/bean/MonYunSmsResponse.java b/ruoyi-segchk/src/main/java/com/ruoyi/util/bean/MonYunSmsResponse.java new file mode 100644 index 0000000..4de8d83 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/util/bean/MonYunSmsResponse.java @@ -0,0 +1,44 @@ +package com.ruoyi.util.bean; + + +/** + * 梦网云短信发送返回参数 + */ +public class MonYunSmsResponse { + /** + * 短信发送请求处理结果:0代表成功;非0代表失败。错误代码详见附录 + */ + Integer result; + /** + * 平台流水号:非0代表64位整型,对应Java和C#的long,不可用int解析。result非0时,msgid为0 + */ + Long msgid; + /** + * 用户自定义流水号:默认与请求报文multimt包结构内第一条数据的custid保持一致,若请求报文中没有custid参数或值为空,则返回由梦网生成的代表本批短信的唯一编号,result非0时,custid为空 + */ + String custid; + + public Integer getResult() { + return result; + } + + public void setResult(Integer result) { + this.result = result; + } + + public Long getMsgid() { + return msgid; + } + + public void setMsgid(Long msgid) { + this.msgid = msgid; + } + + public String getCustid() { + return custid; + } + + public void setCustid(String custid) { + this.custid = custid; + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/util/bean/OrderInfoAfterPay.java b/ruoyi-segchk/src/main/java/com/ruoyi/util/bean/OrderInfoAfterPay.java new file mode 100644 index 0000000..956fc53 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/util/bean/OrderInfoAfterPay.java @@ -0,0 +1,70 @@ +package com.ruoyi.util.bean; + + +/** + * 支付后返回信息实体类 + */ +public class OrderInfoAfterPay { + + /** + * 订单code + */ + private String orderCode; + + /** + * 判断支付是否成功 + */ + private boolean isSuccess = false; + + /** + * 支付类型 1:订单支付 2:预存款充值 + */ + private int type; + + /** + * 交易流水号 + */ + private String transCode; + + public String getOrderCode() { + return orderCode; + } + + public void setOrderCode(String orderCode) { + this.orderCode = orderCode; + } + + public boolean isSuccess() { + return isSuccess; + } + + public void setSuccess(boolean success) { + isSuccess = success; + } + + public int getType() { + return type; + } + + public void setType(int type) { + this.type = type; + } + + public String getTransCode() { + return transCode; + } + + public void setTransCode(String transCode) { + this.transCode = transCode; + } + + @Override + public String toString() { + return "OrderInfoAfterPay{" + + "orderCode='" + orderCode + '\'' + + ", isSuccess=" + isSuccess + + ", type=" + type + + ", transCode='" + transCode + '\'' + + '}'; + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/util/bean/OrderInfoForPay.java b/ruoyi-segchk/src/main/java/com/ruoyi/util/bean/OrderInfoForPay.java new file mode 100644 index 0000000..7148fc0 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/util/bean/OrderInfoForPay.java @@ -0,0 +1,86 @@ +package com.ruoyi.util.bean; + + +import java.math.BigDecimal; + +/** + * 待付订单信息 + */ +public class OrderInfoForPay { + + /** + * 订单code(或主订单code,必传) + */ + private String orderCode; + + /** + * 单品名称(必传) + */ + private String goodsName; + + /** + * 单品ID 扫码支付必传(微信支付) + */ + private long goodsId; + + /** + * 订单的最终价格 (用户实际付款的金额,必传) + */ + private BigDecimal price; + + /** + * 支付类型 1:订单支付 2:预存款充值(必传) + */ + private int type; + + public String getOrderCode() { + return orderCode; + } + + public void setOrderCode(String orderCode) { + this.orderCode = orderCode; + } + + public String getGoodsName() { + return goodsName; + } + + public void setGoodsName(String goodsName) { + this.goodsName = goodsName; + } + + public long getGoodsId() { + return goodsId; + } + + public void setGoodsId(long goodsId) { + this.goodsId = goodsId; + } + + public BigDecimal getPrice() { + return price; + } + + public void setPrice(BigDecimal price) { + this.price = price; + } + + public int getType() { + return type; + } + + public void setType(int type) { + this.type = type; + } + + @Override + public String toString() { + return "OrderInfoForPay{" + + "orderCode='" + orderCode + '\'' + + ", goodsName='" + goodsName + '\'' + + ", goodsId=" + goodsId + + ", price=" + price + + ", type=" + type + + '}'; + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/util/bean/OssYunConf.java b/ruoyi-segchk/src/main/java/com/ruoyi/util/bean/OssYunConf.java new file mode 100644 index 0000000..038feef --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/util/bean/OssYunConf.java @@ -0,0 +1,114 @@ +package com.ruoyi.util.bean; + + +/** + * Created by 魔金商城 on 17/5/8. + * 又拍云配置 + */ + +public class OssYunConf { + + private String accessKeyId; + private String accessKeySecret; + private String bucketName; + private String endPoint; + private String styleName; + private String prefix; + private String address; + + private OssYunConf() { + + } + + private OssYunConf(String accessKeyId, String accessKeySecret, String bucketName, String endPoint, String styleName, String prefix, String address) { + this.accessKeyId = accessKeyId; + this.accessKeySecret = accessKeySecret; + this.bucketName = bucketName; + this.endPoint = endPoint; + this.styleName = styleName; + this.prefix = prefix; + this.address = address; + } + + /** + * @param accessKeyId + * @param accessKeySecret + * @param bucketName + * @param endPoint + * @param styleName + * @param prefix + * @return + */ + public static OssYunConf buildOssYunConf(String accessKeyId, String accessKeySecret, String bucketName, String endPoint, String styleName, String prefix, String address) { + return new OssYunConf(accessKeyId, accessKeySecret, bucketName, endPoint, styleName, prefix, address); + } + + public String getAccessKeyId() { + return accessKeyId; + } + + public void setAccessKeyId(String accessKeyId) { + this.accessKeyId = accessKeyId; + } + + public String getAccessKeySecret() { + return accessKeySecret; + } + + public void setAccessKeySecret(String accessKeySecret) { + this.accessKeySecret = accessKeySecret; + } + + public String getBucketName() { + return bucketName; + } + + public void setBucketName(String bucketName) { + this.bucketName = bucketName; + } + + public String getEndPoint() { + return endPoint; + } + + public void setEndPoint(String endPoint) { + this.endPoint = endPoint; + } + + public String getStyleName() { + return styleName; + } + + public void setStyleName(String styleName) { + this.styleName = styleName; + } + + public String getPrefix() { + return prefix; + } + + public void setPrefix(String prefix) { + this.prefix = prefix; + } + + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address; + } + + @Override + public String toString() { + return "OssYunConf{" + + "accessKeyId='" + accessKeyId + '\'' + + ", accessKeySecret='" + accessKeySecret + '\'' + + ", bucketName='" + bucketName + '\'' + + ", endPoint='" + endPoint + '\'' + + ", styleName='" + styleName + '\'' + + ", prefix='" + prefix + '\'' + + ", address='" + address + '\'' + + '}'; + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/util/bean/PrepayResult.java b/ruoyi-segchk/src/main/java/com/ruoyi/util/bean/PrepayResult.java new file mode 100644 index 0000000..5c43f2e --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/util/bean/PrepayResult.java @@ -0,0 +1,307 @@ +package com.ruoyi.util.bean; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; + +/** + * 统一下单接口返回实体类 + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlRootElement(name = "xml") +@ApiModel(description = "统一下单接口返回实体类") +public class PrepayResult { + + /** + * 返回状态码 + */ + @XmlElement(name = "return_code") + @ApiModelProperty(value = "返回状态码") + private String return_code; + + /** + * 返回信息 + */ + @XmlElement(name = "return_msg") + @ApiModelProperty(value = "返回信息") + private String return_msg; + + /** + * 公众账号ID + */ + @XmlElement(name = "appid") + @ApiModelProperty(value = "公众账号ID") + private String appid; + + /** + * 商户号 + */ + @XmlElement(name = "mch_id") + @ApiModelProperty(value = "商户号") + private String mch_id; + + /** + * 随机字符串 + */ + @XmlElement(name = "nonce_str") + @ApiModelProperty(value = "随机字符串") + private String nonce_str; + + /** + * 签名 + */ + @XmlElement(name = "sign") + @ApiModelProperty(value = "签名") + private String sign; + + /** + * 业务结果 + */ + @XmlElement(name = "result_code") + @ApiModelProperty(value = "业务结果") + private String result_code; + + /** + * 错误代码 + */ + @XmlElement(name = "err_code") + @ApiModelProperty(value = "错误代码") + private String err_code; + + /** + * 错误代码描述 + */ + @XmlElement(name = "err_code_des") + @ApiModelProperty(value = "错误代码描述") + private String err_code_des; + + /** + * 交易类型 + */ + @XmlElement(name = "trade_type") + @ApiModelProperty(value = "交易类型") + private String trade_type; + + /** + * 预支付交易会话标识 + */ + @XmlElement(name = "prepay_id") + @ApiModelProperty(value = "预支付交易会话标识") + private String prepay_id; + + /** + * 二维码链接 + */ + @XmlElement(name = "code_url") + @ApiModelProperty(value = "二维码链接") + private String code_url; + + /** + * H5支付链接 + */ + @XmlElement(name = "mweb_url") + @ApiModelProperty(value = "H5支付链接") + private String mweb_url; + + /** + * 时间戳(公众号支付时返回) + */ + @ApiModelProperty(value = "时间戳(公众号支付时返回)") + private String time_stamp; + + /** + * 订单详情扩展字符串(公众号支付时返回) + */ + @ApiModelProperty(value = "订单详情扩展字符串(公众号支付时返回)") + private String package_; + /** + * 签名方式(公众号支付时返回) + */ + @ApiModelProperty(value = " 签名方式(公众号支付时返回)") + private String sign_type; + /** + * 签名(公众号支付时返回) + */ + @ApiModelProperty(value = "签名(公众号支付时返回)") + private String pay_sign; + + /** + * 生成订单详情扩展字符串 + */ + @JsonIgnore + public void setPackage() { + this.package_ = "prepay_id=" + prepay_id; + } + + /** + * 判断是否失败 + */ + @JsonIgnore + public boolean isError() { + return "FAIL".equals(this.return_code); + } + + public String getReturn_code() { + return return_code; + } + + public void setReturn_code(String return_code) { + this.return_code = return_code; + } + + public String getReturn_msg() { + return return_msg; + } + + public void setReturn_msg(String return_msg) { + this.return_msg = return_msg; + } + + public String getAppid() { + return appid; + } + + public void setAppid(String appid) { + this.appid = appid; + } + + public String getMch_id() { + return mch_id; + } + + public void setMch_id(String mch_id) { + this.mch_id = mch_id; + } + + public String getNonce_str() { + return nonce_str; + } + + public void setNonce_str(String nonce_str) { + this.nonce_str = nonce_str; + } + + public String getSign() { + return sign; + } + + public void setSign(String sign) { + this.sign = sign; + } + + public String getResult_code() { + return result_code; + } + + public void setResult_code(String result_code) { + this.result_code = result_code; + } + + public String getErr_code() { + return err_code; + } + + public void setErr_code(String err_code) { + this.err_code = err_code; + } + + public String getErr_code_des() { + return err_code_des; + } + + public void setErr_code_des(String err_code_des) { + this.err_code_des = err_code_des; + } + + public String getTrade_type() { + return trade_type; + } + + public void setTrade_type(String trade_type) { + this.trade_type = trade_type; + } + + public String getPrepay_id() { + return prepay_id; + } + + public void setPrepay_id(String prepay_id) { + this.prepay_id = prepay_id; + } + + public String getCode_url() { + return code_url; + } + + public void setCode_url(String code_url) { + this.code_url = code_url; + } + + public String getMweb_url() { + return mweb_url; + } + + public void setMweb_url(String mweb_url) { + this.mweb_url = mweb_url; + } + + public String getTime_stamp() { + return time_stamp; + } + + public void setTime_stamp(String time_stamp) { + this.time_stamp = time_stamp; + } + + public String getPackage_() { + return package_; + } + + public void setPackage_(String package_) { + this.package_ = package_; + } + + public String getSign_type() { + return sign_type; + } + + public void setSign_type(String sign_type) { + this.sign_type = sign_type; + } + + public String getPay_sign() { + return pay_sign; + } + + public void setPay_sign(String pay_sign) { + this.pay_sign = pay_sign; + } + + @Override + public String toString() { + return "PrepayResult{" + + "return_code='" + return_code + '\'' + + ", return_msg='" + return_msg + '\'' + + ", appid='" + appid + '\'' + + ", mch_id='" + mch_id + '\'' + + ", nonce_str='" + nonce_str + '\'' + + ", sign='" + sign + '\'' + + ", result_code='" + result_code + '\'' + + ", err_code='" + err_code + '\'' + + ", err_code_des='" + err_code_des + '\'' + + ", trade_type='" + trade_type + '\'' + + ", prepay_id='" + prepay_id + '\'' + + ", code_url='" + code_url + '\'' + + ", mweb_url='" + mweb_url + '\'' + + ", time_stamp='" + time_stamp + '\'' + + ", package_='" + package_ + '\'' + + ", sign_type='" + sign_type + '\'' + + ", pay_sign='" + pay_sign + '\'' + + '}'; + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/util/bean/RequestParam.java b/ruoyi-segchk/src/main/java/com/ruoyi/util/bean/RequestParam.java new file mode 100644 index 0000000..80a6d05 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/util/bean/RequestParam.java @@ -0,0 +1,147 @@ +package com.ruoyi.util.bean; + + +import com.aliyuncs.dysmsapi.model.v20170525.SendSmsRequest; + +/** + * 发送短信请求变量实体类 + * + * @author 魔金商城 on 2017/9/7. + */ +public class RequestParam extends SendSmsRequest { + /** + * 短信接收号码 + * (支持以逗号分隔的形式进行批量调用,批量上限为1000个手机号码,批量调用相对于单条调用及时性稍有延迟,验证码类型的短信推荐使用单条调用的方式) + * 样例取值:15000000000 + * 是否必填:是 + */ + private String phoneNumbers; + /** + * 短信签名 + * 样例取值:云通信 + * 是否必填:是 + */ + private String signName; + /** + * 短信模板ID + * 样例取值:SMS_0000 + * 是否必填:是 + */ + private String templateCode; + /** + * 短信模板变量 + * (友情提示:如果JSON中需要带换行符,请参照标准的JSON协议对换行符的要求,比如短信内容中包含\r\n的情况在JSON中需要表示成\r\n,否则会导致JSON在服务端解析失败) + * 样例取值:{“code”:”1234”,”product”:”ytx”} + * 是否必填:否 + */ + private String templateParam; + /** + * 上行短信扩展码,无特殊需要此字段的用户请忽略此字段 + * 样例取值:90999 + * 是否必填:否 + */ + private String smsUpExtendCode; + /** + * 外部流水扩展字段 + * 样例取值:abcdefgh + * 是否必填:否 + */ + private String outId; + /** + * 短信接口URL + */ + private String interfaceUrl; + /** + * accessKeyId + */ + private String accessKeyId; + /** + * accessKeySecret + */ + private String accessKeySecret; + + /** + * 参数 + */ + private String SmsParamString; + + public String getPhoneNumbers() { + return phoneNumbers; + } + + public void setPhoneNumbers(String phoneNumbers) { + this.phoneNumbers = phoneNumbers; + } + + public String getSignName() { + return signName; + } + + public void setSignName(String signName) { + this.signName = signName; + } + + public String getTemplateCode() { + return templateCode; + } + + public void setTemplateCode(String templateCode) { + this.templateCode = templateCode; + } + + public String getTemplateParam() { + return templateParam; + } + + public void setTemplateParam(String templateParam) { + this.templateParam = templateParam; + } + + public String getSmsUpExtendCode() { + return smsUpExtendCode; + } + + public void setSmsUpExtendCode(String smsUpExtendCode) { + this.smsUpExtendCode = smsUpExtendCode; + } + + public String getOutId() { + return outId; + } + + public void setOutId(String outId) { + this.outId = outId; + } + + public String getInterfaceUrl() { + return interfaceUrl; + } + + public void setInterfaceUrl(String interfaceUrl) { + this.interfaceUrl = interfaceUrl; + } + + public String getAccessKeyId() { + return accessKeyId; + } + + public void setAccessKeyId(String accessKeyId) { + this.accessKeyId = accessKeyId; + } + + public String getAccessKeySecret() { + return accessKeySecret; + } + + public void setAccessKeySecret(String accessKeySecret) { + this.accessKeySecret = accessKeySecret; + } + + public String getSmsParamString() { + return SmsParamString; + } + + public void setSmsParamString(String smsParamString) { + SmsParamString = smsParamString; + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/util/bean/UnionPaySetting.java b/ruoyi-segchk/src/main/java/com/ruoyi/util/bean/UnionPaySetting.java new file mode 100644 index 0000000..6bb45a5 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/util/bean/UnionPaySetting.java @@ -0,0 +1,44 @@ +package com.ruoyi.util.bean; + + +/** + * 银联支付设置实体 + */ +public class UnionPaySetting { + /** + * 商户号 + */ + private String merchantNum; + /** + * 前台回调地址 + */ + private String beforeCallbackUrl; + /** + * 后台回调地址 + */ + private String backCallbackUrl; + + public String getMerchantNum() { + return merchantNum; + } + + public void setMerchantNum(String merchantNum) { + this.merchantNum = merchantNum; + } + + public String getBeforeCallbackUrl() { + return beforeCallbackUrl; + } + + public void setBeforeCallbackUrl(String beforeCallbackUrl) { + this.beforeCallbackUrl = beforeCallbackUrl; + } + + public String getBackCallbackUrl() { + return backCallbackUrl; + } + + public void setBackCallbackUrl(String backCallbackUrl) { + this.backCallbackUrl = backCallbackUrl; + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/util/bean/UserConstants.java b/ruoyi-segchk/src/main/java/com/ruoyi/util/bean/UserConstants.java new file mode 100644 index 0000000..0e038ce --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/util/bean/UserConstants.java @@ -0,0 +1,89 @@ +package com.ruoyi.util.bean; + +/** + * 用户常量信息 + * + * @author shenzhuan + */ +public class UserConstants { + /** + * 平台内系统用户的唯一标志 + */ + public static final String SYS_USER = "SYS_USER"; + + /** + * 正常状态 + */ + public static final String NORMAL = "0"; + + /** + * 异常状态 + */ + public static final String EXCEPTION = "1"; + + /** + * 用户封禁状态 + */ + public static final String USER_DISABLE = "1"; + + /** + * 角色封禁状态 + */ + public static final String ROLE_DISABLE = "1"; + + /** + * 部门正常状态 + */ + public static final String DEPT_NORMAL = "0"; + + /** + * 部门停用状态 + */ + public static final String DEPT_DISABLE = "1"; + + /** + * 字典正常状态 + */ + public static final String DICT_NORMAL = "0"; + + /** + * 是否为系统默认(是) + */ + public static final String YES = "Y"; + + /** + * 是否菜单外链(是) + */ + public static final String YES_FRAME = "0"; + + /** + * 是否菜单外链(否) + */ + public static final String NO_FRAME = "1"; + + /** + * 菜单类型(目录) + */ + public static final String TYPE_DIR = "M"; + + /** + * 菜单类型(菜单) + */ + public static final String TYPE_MENU = "C"; + + /** + * 菜单类型(按钮) + */ + public static final String TYPE_BUTTON = "F"; + + /** + * Layout组件标识 + */ + public final static String LAYOUT = "Layout"; + + /** + * 校验返回结果码 + */ + public final static String UNIQUE = "0"; + public final static String NOT_UNIQUE = "1"; +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/util/bean/UserInfoResult.java b/ruoyi-segchk/src/main/java/com/ruoyi/util/bean/UserInfoResult.java new file mode 100644 index 0000000..9c7e4e7 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/util/bean/UserInfoResult.java @@ -0,0 +1,179 @@ +package com.ruoyi.util.bean; + +import com.alibaba.fastjson.JSONObject; +import com.alibaba.fastjson.annotation.JSONField; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.springframework.util.StringUtils; + +/** + * 用户信息返回实体类 + */ +public class UserInfoResult { + + /** + * 用户唯一标志 + */ + @JSONField(name = "openid") + private String openid; + + /** + * 昵称 + */ + @JSONField(name = "nickname") + private String nickname; + + /** + * 性别 + */ + @JSONField(name = "sex") + private String sex; + + /** + * 省份 + */ + @JSONField(name = "province") + private String province; + + /** + * 城市 + */ + @JSONField(name = "city") + private String city; + + /** + * 国家 + */ + @JSONField(name = "country") + private String country; + + /** + * + */ + @JSONField(name = "headimgurl") + private String headimgurl; + + /** + * 联合登录id 只有在用户将公众号绑定到微信开放平台帐号后,才会出现该字段。 + */ + @JSONField(name = "unionid") + private String unionid; + + /** + * 错误码(出错时返回) + */ + @JSONField(name = "errcode") + private String errcode; + + /** + * 错误信息(出错时返回) + */ + @JSONField(name = "errmsg") + private String errmsg; + + /** + * 判断是否失败 + */ + @JsonIgnore + public boolean isError() { + return !StringUtils.isEmpty(this.errcode); + } + + public String getOpenid() { + return openid; + } + + public void setOpenid(String openid) { + this.openid = openid; + } + + public String getNickname() { + return nickname; + } + + public void setNickname(String nickname) { + this.nickname = nickname; + } + + public String getSex() { + return sex; + } + + public void setSex(String sex) { + this.sex = sex; + } + + public String getProvince() { + return province; + } + + public void setProvince(String province) { + this.province = province; + } + + public String getCity() { + return city; + } + + public void setCity(String city) { + this.city = city; + } + + public String getCountry() { + return country; + } + + public void setCountry(String country) { + this.country = country; + } + + public String getHeadimgurl() { + return headimgurl; + } + + public void setHeadimgurl(String headimgurl) { + this.headimgurl = headimgurl; + } + + public String getUnionid() { + return unionid; + } + + public void setUnionid(String unionid) { + this.unionid = unionid; + } + + public String getErrcode() { + return errcode; + } + + public void setErrcode(String errcode) { + this.errcode = errcode; + } + + public String getErrmsg() { + return errmsg; + } + + public void setErrmsg(String errmsg) { + this.errmsg = errmsg; + } + + /** + * 转换为字符串 + */ + @Override + public String toString() { + return "UserInfoResult{" + + "openid='" + openid + '\'' + + ", nickname='" + nickname + '\'' + + ", sex='" + sex + '\'' + + ", province='" + province + '\'' + + ", city='" + city + '\'' + + ", country='" + country + '\'' + + ", headimgurl='" + headimgurl + '\'' + + ", unionid='" + unionid + '\'' + + ", errcode='" + errcode + '\'' + + ", errmsg='" + errmsg + '\'' + + '}'; + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/util/bean/WeChatAppletCodeRequest.java b/ruoyi-segchk/src/main/java/com/ruoyi/util/bean/WeChatAppletCodeRequest.java new file mode 100644 index 0000000..593b555 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/util/bean/WeChatAppletCodeRequest.java @@ -0,0 +1,104 @@ +package com.ruoyi.util.bean; + +import com.alibaba.fastjson.annotation.JSONField; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + * 生成微信小程序码请求实体类 + * + * @author 魔金商城 created on 2020/4/14 + */ +@ApiModel(description = "生成微信小程序码请求实体") +public class WeChatAppletCodeRequest { + + /** + * 参数,最大32个可见字符,只支持数字,大小写英文以及部分特殊字符:!#$&'()*+,/:;=?@-._~,其它字符请自行编码为合法字符(因不支持%,中文无法使用 urlencode 处理,请使用其他编码方式) + */ + @ApiModelProperty(value = "参数") + @JSONField(name = "scene") + private String scene; + + /** + * 路径,必须是已经发布的小程序存在的页面(否则报错),例如 pages/index/index, 根路径前不要填加 /,不能携带参数(参数请放在scene字段里),如果不填写这个字段,默认跳主页面 + */ + @ApiModelProperty(value = "路径") + @JSONField(name = "page") + private String page; + + /** + * 二维码的宽度,单位 px,最小 280px,最大 1280px,默认 430 + */ + @ApiModelProperty(value = "二维码的宽度") + @JSONField(name = "width") + private int width; + + /** + * 自动配置线条颜色,如果颜色依然是黑色,则说明不建议配置主色调,默认 false + */ + @ApiModelProperty(value = "是否自动配置线条颜色") + @JSONField(name = "auto_color") + private boolean auto_color; + + /** + * 颜色实体,auto_color 为 false 时生效,使用 rgb 设置颜色 例如 {"r":"xxx","g":"xxx","b":"xxx"} 十进制表示 + */ + @ApiModelProperty(value = "颜色实体") + @JSONField(name = "line_color") + private LineColor line_color; + + /** + * 是否需要透明底色,为 true 时,生成透明底色的小程序,默认 false + */ + @ApiModelProperty(value = "是否需要透明底色") + @JSONField(name = "is_hyaline") + private boolean is_hyaline; + + public String getScene() { + return scene; + } + + public void setScene(String scene) { + this.scene = scene; + } + + public String getPage() { + return page; + } + + public void setPage(String page) { + this.page = page; + } + + public int getWidth() { + return width; + } + + public void setWidth(int width) { + this.width = width; + } + + public boolean isAuto_color() { + return auto_color; + } + + public void setAuto_color(boolean auto_color) { + this.auto_color = auto_color; + } + + public LineColor getLine_color() { + return line_color; + } + + public void setLine_color(LineColor line_color) { + this.line_color = line_color; + } + + public boolean isIs_hyaline() { + return is_hyaline; + } + + public void setIs_hyaline(boolean is_hyaline) { + this.is_hyaline = is_hyaline; + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/util/bean/WechatApletPrepayResult.java b/ruoyi-segchk/src/main/java/com/ruoyi/util/bean/WechatApletPrepayResult.java new file mode 100644 index 0000000..b443ae3 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/util/bean/WechatApletPrepayResult.java @@ -0,0 +1,121 @@ +package com.ruoyi.util.bean; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; + +/** + * 微信公众号,小程序支付返回实体类 + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlRootElement(name = "xml") +@ApiModel(description = "微信公众号,小程序支付返回实体类") +public class WechatApletPrepayResult { + + /** + * 返回状态码 + */ + @XmlElement(name = "appId") + @ApiModelProperty(value = "appId") + private String appId; + + /** + * 随机字符串 + */ + @XmlElement(name = "nonceStr") + @ApiModelProperty(value = "随机字符串") + private String nonceStr; + + /** + * 订单详情扩展字符串(公众号支付时返回) + */ + @XmlElement(name = "package_") + @ApiModelProperty(value = "订单详情扩展字符串(公众号支付时返回)") + private String package_; + + /** + * 签名方式 + */ + @XmlElement(name = "signType") + @ApiModelProperty(value = "签名方式(公众号支付时返回)") + private String signType; + + /** + * 时间戳 + */ + @XmlElement(name = "timeStamp") + @ApiModelProperty(value = "时间戳(公众号支付时返回)") + private String timeStamp; + + /** + * 签名 + */ + @XmlElement(name = "paySign") + @ApiModelProperty(value = "签名(公众号支付时返回)") + private String paySign; + + public String getAppId() { + return appId; + } + + public void setAppId(String appId) { + this.appId = appId; + } + + public String getNonceStr() { + return nonceStr; + } + + public void setNonceStr(String nonceStr) { + this.nonceStr = nonceStr; + } + + public String getPackage_() { + return package_; + } + + public void setPackage_(String package_) { + this.package_ = package_; + } + + public String getSignType() { + return signType; + } + + public void setSignType(String signType) { + this.signType = signType; + } + + public String getTimeStamp() { + return timeStamp; + } + + public void setTimeStamp(String timeStamp) { + this.timeStamp = timeStamp; + } + + public String getPaySign() { + return paySign; + } + + public void setPaySign(String paySign) { + this.paySign = paySign; + } + + @Override + public String toString() { + return "WechatApletPrepayResult{" + + "appId='" + appId + '\'' + + ", nonceStr='" + nonceStr + '\'' + + ", package_='" + package_ + '\'' + + ", signType='" + signType + '\'' + + ", timeStamp='" + timeStamp + '\'' + + ", paySign='" + paySign + '\'' + + '}'; + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/util/bean/WechatNotifyResult.java b/ruoyi-segchk/src/main/java/com/ruoyi/util/bean/WechatNotifyResult.java new file mode 100644 index 0000000..44f7197 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/util/bean/WechatNotifyResult.java @@ -0,0 +1,225 @@ +package com.ruoyi.util.bean; + +import com.fasterxml.jackson.annotation.JsonIgnore; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; + +/** + * 统一下单接口返回实体类 + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlRootElement(name = "xml") +public class WechatNotifyResult { + + /** + * 返回状态码 + */ + @XmlElement(name = "return_code") + private String return_code; + + /** + * 返回信息 + */ + @XmlElement(name = "return_msg") + private String return_msg; + + /** + * 公众账号ID + */ + @XmlElement(name = "appid") + private String appid; + + /** + * 商户号 + */ + @XmlElement(name = "mch_id") + private String mch_id; + + /** + * 随机字符串 + */ + @XmlElement(name = "nonce_str") + private String nonce_str; + + /** + * 签名 + */ + @XmlElement(name = "sign") + private String sign; + + /** + * 业务结果 + */ + @XmlElement(name = "result_code") + private String result_code; + + /** + * 错误代码 + */ + @XmlElement(name = "err_code") + private String err_code; + + /** + * 错误代码描述 + */ + @XmlElement(name = "err_code_des") + private String err_code_des; + + /** + * 交易类型 + */ + @XmlElement(name = "trade_type") + private String trade_type; + + /** + * 附加参数(交易类型) + */ + @XmlElement(name = "attach") + private int attach; + + /** + * 订单号 + */ + @XmlElement(name = "out_trade_no") + private String out_trade_no; + + /** + * 微信交易流水号 + */ + @XmlElement(name = "transaction_id") + private String transaction_id; + + /** + * 判断是否失败 + */ + @JsonIgnore + public boolean isError() { + return "FAIL".equals(this.return_code); + } + + public String getReturn_code() { + return return_code; + } + + public void setReturn_code(String return_code) { + this.return_code = return_code; + } + + public String getReturn_msg() { + return return_msg; + } + + public void setReturn_msg(String return_msg) { + this.return_msg = return_msg; + } + + public String getAppid() { + return appid; + } + + public void setAppid(String appid) { + this.appid = appid; + } + + public String getMch_id() { + return mch_id; + } + + public void setMch_id(String mch_id) { + this.mch_id = mch_id; + } + + public String getNonce_str() { + return nonce_str; + } + + public void setNonce_str(String nonce_str) { + this.nonce_str = nonce_str; + } + + public String getSign() { + return sign; + } + + public void setSign(String sign) { + this.sign = sign; + } + + public String getResult_code() { + return result_code; + } + + public void setResult_code(String result_code) { + this.result_code = result_code; + } + + public String getErr_code() { + return err_code; + } + + public void setErr_code(String err_code) { + this.err_code = err_code; + } + + public String getErr_code_des() { + return err_code_des; + } + + public void setErr_code_des(String err_code_des) { + this.err_code_des = err_code_des; + } + + public String getTrade_type() { + return trade_type; + } + + public void setTrade_type(String trade_type) { + this.trade_type = trade_type; + } + + public int getAttach() { + return attach; + } + + public void setAttach(int attach) { + this.attach = attach; + } + + public String getOut_trade_no() { + return out_trade_no; + } + + public void setOut_trade_no(String out_trade_no) { + this.out_trade_no = out_trade_no; + } + + public String getTransaction_id() { + return transaction_id; + } + + public void setTransaction_id(String transaction_id) { + this.transaction_id = transaction_id; + } + + @Override + public String toString() { + return "WechatNotifyResult{" + + "return_code='" + return_code + '\'' + + ", return_msg='" + return_msg + '\'' + + ", appid='" + appid + '\'' + + ", mch_id='" + mch_id + '\'' + + ", nonce_str='" + nonce_str + '\'' + + ", sign='" + sign + '\'' + + ", result_code='" + result_code + '\'' + + ", err_code='" + err_code + '\'' + + ", err_code_des='" + err_code_des + '\'' + + ", trade_type='" + trade_type + '\'' + + ", attach=" + attach + + ", out_trade_no='" + out_trade_no + '\'' + + ", transaction_id='" + transaction_id + '\'' + + '}'; + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/util/bean/WechatPayResponse.java b/ruoyi-segchk/src/main/java/com/ruoyi/util/bean/WechatPayResponse.java new file mode 100644 index 0000000..6a14738 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/util/bean/WechatPayResponse.java @@ -0,0 +1,69 @@ +package com.ruoyi.util.bean; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import java.math.BigDecimal; + +/** + * 微信支付返回实体(订单支付) + */ +@ApiModel(description = "微信支付返回实体") +public class WechatPayResponse { + + /** + * 订单code + */ + @ApiModelProperty(value = "订单code") + private String orderCode; + + /** + * 订单总金额 + */ + @ApiModelProperty(value = "订单总金额") + private BigDecimal orderMoney; + + /** + * 扫码支付url + */ + @ApiModelProperty(value = "扫码支付url") + private String codeUrl; + + /** + * mweb_url为拉起微信支付收银台的中间页面,可通过访问该url来拉起微信客户端,完成支付,mweb_url的有效期为5分钟。 + */ + @ApiModelProperty(value = "mweb_url为拉起微信支付收银台的中间页面,可通过访问该url来拉起微信客户端,完成支付,mweb_url的有效期为5分钟。") + private String mwebUrl; + + public String getOrderCode() { + return orderCode; + } + + public void setOrderCode(String orderCode) { + this.orderCode = orderCode; + } + + public BigDecimal getOrderMoney() { + return orderMoney; + } + + public void setOrderMoney(BigDecimal orderMoney) { + this.orderMoney = orderMoney; + } + + public String getCodeUrl() { + return codeUrl; + } + + public void setCodeUrl(String codeUrl) { + this.codeUrl = codeUrl; + } + + public String getMwebUrl() { + return mwebUrl; + } + + public void setMwebUrl(String mwebUrl) { + this.mwebUrl = mwebUrl; + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/util/bean/WechatPayResponseForRecharge.java b/ruoyi-segchk/src/main/java/com/ruoyi/util/bean/WechatPayResponseForRecharge.java new file mode 100644 index 0000000..89a892d --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/util/bean/WechatPayResponseForRecharge.java @@ -0,0 +1,62 @@ +package com.ruoyi.util.bean; + + +import java.math.BigDecimal; + +/** + * 微信支付返回实体(充值) + */ +public class WechatPayResponseForRecharge { + + /** + * 订单code + */ + private String transCode; + + /** + * 订单总金额 + */ + private BigDecimal money; + + /** + * 扫码支付url + */ + private String codeUrl; + + /** + * mweb_url为拉起微信支付收银台的中间页面,可通过访问该url来拉起微信客户端,完成支付,mweb_url的有效期为5分钟。 + */ + private String mwebUrl; + + public String getTransCode() { + return transCode; + } + + public void setTransCode(String transCode) { + this.transCode = transCode; + } + + public BigDecimal getMoney() { + return money; + } + + public void setMoney(BigDecimal money) { + this.money = money; + } + + public String getCodeUrl() { + return codeUrl; + } + + public void setCodeUrl(String codeUrl) { + this.codeUrl = codeUrl; + } + + public String getMwebUrl() { + return mwebUrl; + } + + public void setMwebUrl(String mwebUrl) { + this.mwebUrl = mwebUrl; + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/util/bean/WithdrawRequest.java b/ruoyi-segchk/src/main/java/com/ruoyi/util/bean/WithdrawRequest.java new file mode 100644 index 0000000..5443edd --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/util/bean/WithdrawRequest.java @@ -0,0 +1,73 @@ +package com.ruoyi.util.bean; + + +import java.math.BigDecimal; + +/** + * Created by 魔金商城 on 18/2/7. + * 提现请求实体 + */ +public class WithdrawRequest { + + /** + * 交流流水号 + */ + private String tradeNo; + + /** + * 支付包账户 + */ + private String account; + + /** + * 支付包实名认证姓名 + */ + private String name; + + /** + * 提现金额 + */ + private BigDecimal money; + + public String getTradeNo() { + return tradeNo; + } + + public void setTradeNo(String tradeNo) { + this.tradeNo = tradeNo; + } + + public String getAccount() { + return account; + } + + public void setAccount(String account) { + this.account = account; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public BigDecimal getMoney() { + return money; + } + + public void setMoney(BigDecimal money) { + this.money = money; + } + + @Override + public String toString() { + return "WithdrawRequest{" + + "tradeNo='" + tradeNo + '\'' + + ", account='" + account + '\'' + + ", name='" + name + '\'' + + ", money=" + money + + '}'; + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/util/bean/WithdrawResponse.java b/ruoyi-segchk/src/main/java/com/ruoyi/util/bean/WithdrawResponse.java new file mode 100644 index 0000000..998b02f --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/util/bean/WithdrawResponse.java @@ -0,0 +1,77 @@ +package com.ruoyi.util.bean; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + * Created by 魔金商城 on 18/02/07. + * 提现返回实体 + */ +@ApiModel(description = "提现返回实体") +public class WithdrawResponse { + + /** + * 返回code + */ + @ApiModelProperty(value = "返回code") + private String code; + /** + * 业务code + */ + @ApiModelProperty(value = "业务code") + private String subCode; + + private WithdrawResponse() { + + } + + /** + * 构造提现返回实体 + * + * @param code 返回code + * @param subCode 业务返回code + * @return 返回提现返回实体 + */ + public static WithdrawResponse build(String code, String subCode) { + WithdrawResponse withdrawResponse = new WithdrawResponse(); + withdrawResponse.code = code; + withdrawResponse.subCode = subCode; + return withdrawResponse; + } + + /** + * 构造系统异常实体 + * + * @return 返回提现相应实体 + */ + public static WithdrawResponse buildSystemError() { + WithdrawResponse withdrawResponse = new WithdrawResponse(); + withdrawResponse.code = "-10001"; + return withdrawResponse; + } + + /** + * 是否提现成功 + * + * @return 成功返回true + */ + public boolean isSuccess() { + return "10000".equals(this.code); + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getSubCode() { + return subCode; + } + + public void setSubCode(String subCode) { + this.subCode = subCode; + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/util/bean/WxTransferResult.java b/ruoyi-segchk/src/main/java/com/ruoyi/util/bean/WxTransferResult.java new file mode 100644 index 0000000..fec9b1d --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/util/bean/WxTransferResult.java @@ -0,0 +1,339 @@ +package com.ruoyi.util.bean; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; + +/** + * 统一下单接口返回实体类 + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlRootElement(name = "xml") +@ApiModel(description = "统一下单接口返回实体类") +public class WxTransferResult { + + /** + * 返回状态码 + */ + @XmlElement(name = "return_code") + @ApiModelProperty(value = "返回状态码") + private String return_code; + + /** + * 返回信息 + */ + @XmlElement(name = "return_msg") + @ApiModelProperty(value = "返回信息") + private String return_msg; + + /** + * 公众账号ID + */ + @XmlElement(name = "mch_appid") + @ApiModelProperty(value = "商户appid") + private String mch_appid; + + /** + * 商户号 + */ + @XmlElement(name = "mchid") + @ApiModelProperty(value = "商户号") + private String mchid; + + /** + * 随机字符串 + */ + @XmlElement(name = "nonce_str") + @ApiModelProperty(value = "随机字符串") + private String nonce_str; + + /** + * 签名 + */ + @XmlElement(name = "sign") + @ApiModelProperty(value = "签名") + private String sign; + + /** + * 业务结果 + */ + @XmlElement(name = "result_code") + @ApiModelProperty(value = "业务结果") + private String result_code; + + /** + * 错误代码 + */ + @XmlElement(name = "err_code") + @ApiModelProperty(value = "错误代码") + private String err_code; + + /** + * 错误代码描述 + */ + @XmlElement(name = "err_code_des") + @ApiModelProperty(value = "错误代码描述") + private String err_code_des; + + /** + * 商户订单号 + */ + @XmlElement(name = "partner_trade_no") + @ApiModelProperty(value = "商户订单号") + private String partner_trade_no; + + /** + * 微信付款单号 + */ + @XmlElement(name = "payment_no") + @ApiModelProperty(value = "微信付款单号") + private String payment_no; + + /** + * 付款成功时间 + */ + @XmlElement(name = "payment_time") + @ApiModelProperty(value = "付款成功时间") + private String payment_time; + + /** + * 预支付交易会话标识 + */ + @XmlElement(name = "prepay_id") + @ApiModelProperty(value = "预支付交易会话标识") + private String prepay_id; + + /** + * 二维码链接 + */ + @XmlElement(name = "code_url") + @ApiModelProperty(value = "二维码链接") + private String code_url; + + /** + * H5支付链接 + */ + @XmlElement(name = "mweb_url") + @ApiModelProperty(value = "H5支付链接") + private String mweb_url; + + /** + * 时间戳(公众号支付时返回) + */ + @ApiModelProperty(value = "时间戳(公众号支付时返回)") + private String time_stamp; + + /** + * 订单详情扩展字符串(公众号支付时返回) + */ + @ApiModelProperty(value = "订单详情扩展字符串(公众号支付时返回)") + private String package_; + /** + * 签名方式(公众号支付时返回) + */ + @ApiModelProperty(value = " 签名方式(公众号支付时返回)") + private String sign_type; + /** + * 签名(公众号支付时返回) + */ + @ApiModelProperty(value = "签名(公众号支付时返回)") + private String pay_sign; + + /** + * 生成订单详情扩展字符串 + */ + @JsonIgnore + public void setPackage() { + this.package_ = "prepay_id=" + prepay_id; + } + + /** + * 判断是否失败 + */ + @JsonIgnore + public boolean isError() { + return "FAIL".equals(this.return_code); + } + + public String getReturn_code() { + return return_code; + } + + public void setReturn_code(String return_code) { + this.return_code = return_code; + } + + public String getReturn_msg() { + return return_msg; + } + + public void setReturn_msg(String return_msg) { + this.return_msg = return_msg; + } + + public String getMch_appid() { + return mch_appid; + } + + public void setMch_appid(String mch_appid) { + this.mch_appid = mch_appid; + } + + public String getMchid() { + return mchid; + } + + public void setMchid(String mchid) { + this.mchid = mchid; + } + + public String getNonce_str() { + return nonce_str; + } + + public void setNonce_str(String nonce_str) { + this.nonce_str = nonce_str; + } + + public String getSign() { + return sign; + } + + public void setSign(String sign) { + this.sign = sign; + } + + public String getResult_code() { + return result_code; + } + + public void setResult_code(String result_code) { + this.result_code = result_code; + } + + public String getErr_code() { + return err_code; + } + + public void setErr_code(String err_code) { + this.err_code = err_code; + } + + public String getErr_code_des() { + return err_code_des; + } + + public void setErr_code_des(String err_code_des) { + this.err_code_des = err_code_des; + } + + public String getPartner_trade_no() { + return partner_trade_no; + } + + public void setPartner_trade_no(String partner_trade_no) { + this.partner_trade_no = partner_trade_no; + } + + public String getPayment_no() { + return payment_no; + } + + public void setPayment_no(String payment_no) { + this.payment_no = payment_no; + } + + public String getPayment_time() { + return payment_time; + } + + public void setPayment_time(String payment_time) { + this.payment_time = payment_time; + } + + public String getPrepay_id() { + return prepay_id; + } + + public void setPrepay_id(String prepay_id) { + this.prepay_id = prepay_id; + } + + public String getCode_url() { + return code_url; + } + + public void setCode_url(String code_url) { + this.code_url = code_url; + } + + public String getMweb_url() { + return mweb_url; + } + + public void setMweb_url(String mweb_url) { + this.mweb_url = mweb_url; + } + + public String getTime_stamp() { + return time_stamp; + } + + public void setTime_stamp(String time_stamp) { + this.time_stamp = time_stamp; + } + + public String getPackage_() { + return package_; + } + + public void setPackage_(String package_) { + this.package_ = package_; + } + + public String getSign_type() { + return sign_type; + } + + public void setSign_type(String sign_type) { + this.sign_type = sign_type; + } + + public String getPay_sign() { + return pay_sign; + } + + public void setPay_sign(String pay_sign) { + this.pay_sign = pay_sign; + } + + @Override + public String toString() { + return "WxTransferResult{" + + "return_code='" + return_code + '\'' + + ", return_msg='" + return_msg + '\'' + + ", mch_appid='" + mch_appid + '\'' + + ", mchid='" + mchid + '\'' + + ", nonce_str='" + nonce_str + '\'' + + ", sign='" + sign + '\'' + + ", result_code='" + result_code + '\'' + + ", err_code='" + err_code + '\'' + + ", err_code_des='" + err_code_des + '\'' + + ", partner_trade_no='" + partner_trade_no + '\'' + + ", payment_no='" + payment_no + '\'' + + ", payment_time='" + payment_time + '\'' + + ", prepay_id='" + prepay_id + '\'' + + ", code_url='" + code_url + '\'' + + ", mweb_url='" + mweb_url + '\'' + + ", time_stamp='" + time_stamp + '\'' + + ", package_='" + package_ + '\'' + + ", sign_type='" + sign_type + '\'' + + ", pay_sign='" + pay_sign + '\'' + + '}'; + } +} diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/util/md5/MD5.java b/ruoyi-segchk/src/main/java/com/ruoyi/util/md5/MD5.java new file mode 100644 index 0000000..af73692 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/util/md5/MD5.java @@ -0,0 +1,59 @@ +package com.ruoyi.util.md5; + +import java.io.UnsupportedEncodingException; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; + +public class MD5 { + + private MD5() { + } + + public final static String getMessageDigest(byte[] buffer) { + //首先初始化一个字符数组,用来存放每个16进制字符 + char hexDigits[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'}; + try { + // 拿到一个MD5转换器(如果想要SHA1参数换成"SHA1") + MessageDigest mdTemp = MessageDigest.getInstance("MD5"); + // buffer 是输入字符串转换得到的字节数组 + mdTemp.update(buffer); + // 转换并返回结果,也是字节数组,包含16个元素 + byte[] md = mdTemp.digest(); + + int j = md.length; + // new一个字符数组,这个就是用来组成结果字符串的(解释一下:一个byte是八位二进制,也就是2位十六进制字符(2的8次方等于16的2次方)) + char str[] = new char[j * 2]; + int k = 0; + //遍历字节数组,通过位运算(位运算效率高),转换成字符放到字符数组中去 + for (int i = 0; i < j; i++) { + byte byte0 = md[i]; + str[k++] = hexDigits[byte0 >>> 4 & 0xf]; + str[k++] = hexDigits[byte0 & 0xf]; + } + //字符数组转换成字符串返回 + return new String(str); + } catch (Exception e) { + return null; + } + } + + public static String hex(byte[] array) { + StringBuffer sb = new StringBuffer(); + for (int i = 0; i < array.length; ++i) { + sb.append(Integer.toHexString((array[i] + & 0xFF) | 0x100).substring(1, 3)); + } + return sb.toString(); + } + + public static String md5Hex(String message) { + try { + MessageDigest md = + MessageDigest.getInstance("MD5"); + return hex(md.digest(message.getBytes("CP1252"))); + } catch (NoSuchAlgorithmException e) { + } catch (UnsupportedEncodingException e) { + } + return null; + } +} \ No newline at end of file diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/util/md5/MD5Utils.java b/ruoyi-segchk/src/main/java/com/ruoyi/util/md5/MD5Utils.java new file mode 100644 index 0000000..dabcfa4 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/util/md5/MD5Utils.java @@ -0,0 +1,121 @@ +package com.ruoyi.util.md5; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.IOException; +import java.io.InputStream; +import java.io.UnsupportedEncodingException; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * md5工具类 + */ +public class MD5Utils { + + private static final MD5Utils INSTANCE = new MD5Utils(); + /** + * 调试日志 + */ + private Logger logger = LoggerFactory.getLogger(MD5Utils.class); + + private MD5Utils() { + + } + + public static MD5Utils getInstance() { + return INSTANCE; + } + + /** + * 判断订单号是否含有中文 + * + * @param waybillCode 订单号 + * @return true 含有中文 false 不含中文 + */ + public boolean isContainChinese(String waybillCode) { + + Pattern p = Pattern.compile("[\u4e00-\u9fa5]"); + Matcher m = p.matcher(waybillCode); + if (m.find()) { + return true; + } + return false; + } + + /** + * 创建md5值 + * + * @param string 待加密的字符串 + * @return 返回加密后的值 + */ + public String createMd5(String string) { + String result = ""; + try { + MessageDigest md = MessageDigest.getInstance("MD5"); + md.update(string.getBytes("utf-8")); + byte b[] = md.digest(); + int i; + StringBuilder buf = new StringBuilder(); + for (int offset = 0; offset < b.length; offset++) { + i = b[offset]; + if (i < 0) { + i += 256; + } + if (i < 16) { + buf.append("0"); + } + + buf.append(Integer.toHexString(i)); + } + return buf.toString(); + } catch (NoSuchAlgorithmException e) { + logger.error("createMd5 fail...", e); + } catch (UnsupportedEncodingException e) { + logger.error("createMd5 fail...", e); + } + return result; + } + + /** + * 生成md5值 + * + * @param is 输入流 + * @return 返回md5加密后的字符串 + * @throws IOException + */ + public String createMd5ForImageUpload(InputStream is) throws IOException { + char[] hexDigits = new char[]{'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'}; + MessageDigest md5 = null; + try { + md5 = MessageDigest.getInstance("MD5"); + byte[] j = new byte[1024]; + while (true) { + int var14 = is.read(j); + if (var14 > 0) { + md5.update(j, 0, var14); + } + if (var14 == -1) { + is.skip(0L); + break; + } + } + } catch (NoSuchAlgorithmException var12) { + throw new RuntimeException(var12.getMessage()); + } finally { + is.close(); + } + byte[] var15 = md5.digest(); + int var16 = var15.length; + char[] finalValue = new char[var16 * 2]; + int k = 0; + for (byte encoded : var15) { + finalValue[k++] = hexDigits[encoded >> 4 & 15]; + finalValue[k++] = hexDigits[encoded & 15]; + } + return new String(finalValue); + } +} \ No newline at end of file diff --git a/ruoyi-segchk/src/main/java/com/ruoyi/util/md5/MessageSourceUtil.java b/ruoyi-segchk/src/main/java/com/ruoyi/util/md5/MessageSourceUtil.java new file mode 100644 index 0000000..86b3dd6 --- /dev/null +++ b/ruoyi-segchk/src/main/java/com/ruoyi/util/md5/MessageSourceUtil.java @@ -0,0 +1,38 @@ +package com.ruoyi.util.md5; + +import com.ruoyi.common.utils.spring.SpringUtils; +import org.springframework.context.MessageSource; +import org.springframework.context.NoSuchMessageException; +import org.springframework.context.i18n.LocaleContextHolder; + + +/** + * 消息资源根据类 + * Created by 魔金商城 on 17/7/10. + */ +public final class MessageSourceUtil { + private static MessageSource messageSource; + + static { + init((MessageSource) SpringUtils.getBean(MessageSource.class)); + } + + public static void init(MessageSource messageSource) { + MessageSourceUtil.messageSource = messageSource; + } + + + /** + * 根据code 获得国际化文件中的值 + * + * @param code key + * @return 返回值 + */ + public static String getMessage(String code) { + try { + return messageSource.getMessage(code, null, LocaleContextHolder.getLocale()); + } catch (NoSuchMessageException e) { + return null; + } + } +} diff --git a/ruoyi-segchk/src/main/resources/mapper/member/WeChatCustomerLinkMapper.xml b/ruoyi-segchk/src/main/resources/mapper/member/WeChatCustomerLinkMapper.xml new file mode 100644 index 0000000..2ac0ebb --- /dev/null +++ b/ruoyi-segchk/src/main/resources/mapper/member/WeChatCustomerLinkMapper.xml @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + + + + INSERT into ls_wx_customer_link + + + customer_id, + + + wx_union_id, + + + wx_open_id, + + + wx_applet_open_id, + + + + + #{customerId}, + + + #{unionId}, + + + #{openId}, + + + #{appletOpenId}, + + + + + DELETE from ls_wx_customer_link where customer_id=#{customerId} + + + + update ls_wx_customer_link + + + + wx_open_id=#{openId}, + + + wx_applet_open_id=#{appletOpenId}, + + + + where id=#{id}; + + \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/segchk/SegchkProviderIndexMapper.xml b/ruoyi-segchk/src/main/resources/mapper/segchk/SegchkProviderIndexMapper.xml similarity index 98% rename from ruoyi-system/src/main/resources/mapper/segchk/SegchkProviderIndexMapper.xml rename to ruoyi-segchk/src/main/resources/mapper/segchk/SegchkProviderIndexMapper.xml index d11ac08..c34946e 100644 --- a/ruoyi-system/src/main/resources/mapper/segchk/SegchkProviderIndexMapper.xml +++ b/ruoyi-segchk/src/main/resources/mapper/segchk/SegchkProviderIndexMapper.xml @@ -180,4 +180,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" left join (select provider_id, store_id, store_name from segchk_store_basic_info where provider_id = #{providerId}) store on chk.provider_id = store.provider_id and chk.store_id = store.store_id + + \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/segchk/SegchkStoreIndexMapper.xml b/ruoyi-segchk/src/main/resources/mapper/segchk/SegchkStoreIndexMapper.xml similarity index 94% rename from ruoyi-system/src/main/resources/mapper/segchk/SegchkStoreIndexMapper.xml rename to ruoyi-segchk/src/main/resources/mapper/segchk/SegchkStoreIndexMapper.xml index c40efb9..d39158c 100644 --- a/ruoyi-system/src/main/resources/mapper/segchk/SegchkStoreIndexMapper.xml +++ b/ruoyi-segchk/src/main/resources/mapper/segchk/SegchkStoreIndexMapper.xml @@ -61,6 +61,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + @@ -131,6 +132,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + + + + + select provider_id, store_id, store_carousel, sort_id from segchk_carouse_mgt @@ -157,7 +164,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" from (select basic.provider_id, basic.store_id, basic.store_name, basic.service_state, basic.saler_id, basic.store_lon, basic.store_lat, basic.user_dist from - (select provider_id, store_id, store_name, service_state, saler_id, store_lon, store_lat, round(st_distance_sphere(point(#{userLon},#{userLat}), point(store_lon, store_lat))/1000, 2) as user_dist from segchk_store_basic_info where provider_id = #{providerId} and state_flag = 0) basic + (select provider_id, store_id, store_name, service_state, saler_id, store_lon, store_lat + + , round(st_distance_sphere(point(#{userLon},#{userLat}), point(store_lon, store_lat))/1000, 2) + , 0 + + as user_dist from segchk_store_basic_info where provider_id = #{providerId} and state_flag = 0) basic right join ( select tmp.provider_id, tmp.store_id, tmp.lable_id, tmp.sort_id, tmp.type_id, mgt_state from (select provider_id, store_id, lable_id, type_id, mgt_state, sort_id from segchk_store_lable_mgt where provider_id = #{providerId} @@ -200,13 +212,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/segchk/SegchkUserIndexMapper.xml b/ruoyi-segchk/src/main/resources/mapper/segchk/SegchkUserIndexMapper.xml similarity index 88% rename from ruoyi-system/src/main/resources/mapper/segchk/SegchkUserIndexMapper.xml rename to ruoyi-segchk/src/main/resources/mapper/segchk/SegchkUserIndexMapper.xml index d8feae4..4336d94 100644 --- a/ruoyi-system/src/main/resources/mapper/segchk/SegchkUserIndexMapper.xml +++ b/ruoyi-segchk/src/main/resources/mapper/segchk/SegchkUserIndexMapper.xml @@ -160,6 +160,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + + + + + + + + + + + @@ -538,4 +550,89 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" on scc.provider_id = suv.provider_id and scc.card_type_id = suv.card_type_id order by card_type_id + + + + + + + + + + + insert into segchk_user_wechat + + provider_id, + user_id, + openid, + union_id, + nick_name, + icon_url, + mod_time, + + + #{providerId}, + #{userId}, + #{openid}, + #{unionId}, + #{nickName}, + #{iconUrl}, + now(), + + on duplicate key update + + provider_id = #{providerId}, + openid = #{openid}, + union_id = #{unionId}, + nick_name = #{nickName}, + icon_url = #{iconUrl}, + mod_time = now(), + + + + + update segchk_store_basic_info + + openid = #{openid}, + union_id = #{unionId}, + nick_name = #{nickName}, + icon_url = #{iconUrl}, + mod_time = now(), + + where store_id = #{userId} and provider_id = #{providerId} + + + + update segchk_provider_mgt + + openid = #{openid}, + union_id = #{unionId}, + nick_name = #{nickName}, + icon_url = #{iconUrl}, + update_time = now(), + + where provider_id = #{providerId} + \ No newline at end of file diff --git a/ruoyi-segchk/src/main/resources/mapper/setting/AreaMapper.xml b/ruoyi-segchk/src/main/resources/mapper/setting/AreaMapper.xml new file mode 100644 index 0000000..cdac3e7 --- /dev/null +++ b/ruoyi-segchk/src/main/resources/mapper/setting/AreaMapper.xml @@ -0,0 +1,272 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + insert into ls_province + + + name, + + + sort, + + + del_flag, + + + create_time, + + + modify_time, + + + del_time, + + + + + #{name}, + + + #{sort}, + + + #{delFlag}, + + + #{createTime}, + + + #{modifyTime}, + + + #{delTime}, + + + + + + + insert into ls_city + + + name, + + + province_id, + + + sort, + + + del_flag, + + + create_time, + + + modify_time, + + + del_time, + + + + + #{name}, + + + #{provinceId}, + + + #{sort}, + + + #{delFlag}, + + + #{createTime}, + + + #{modifyTime}, + + + #{delTime}, + + + + + + + insert into ls_district + + + name, + + + city_id, + + + sort, + + + del_flag, + + + create_time, + + + modify_time, + + + del_time, + + + + + #{name}, + + + #{cityId}, + + + #{sort}, + + + #{delFlag}, + + + #{createTime}, + + + #{modifyTime}, + + + #{delTime}, + + + + + + + + + + + + + + + update ls_province + set del_flag = '1',del_time = now() + where id = #{provinceId} + + + + update ls_city + set del_flag = '1',del_time = now() + where id = #{cityId} + + + + update ls_district + set del_flag = '1',del_time = now() + where id = #{districtId} + + + + + + + + + update ls_province + + + name = #{name}, + + + sort = #{sort}, + + modify_time = now() + + where id = #{id} + + + + update ls_city + + + name = #{name}, + + + sort = #{sort}, + + modify_time = now() + + where id = #{id} + + + update ls_district + + + name = #{name}, + + + sort = #{sort}, + + modify_time = now() + + where id = #{id} + + + \ No newline at end of file diff --git a/ruoyi-segchk/src/main/resources/mapper/setting/BaseInfoSetMapper.xml b/ruoyi-segchk/src/main/resources/mapper/setting/BaseInfoSetMapper.xml new file mode 100644 index 0000000..0a94e1c --- /dev/null +++ b/ruoyi-segchk/src/main/resources/mapper/setting/BaseInfoSetMapper.xml @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + id,phone,logo,site_url,site_name,label_log,admin_logo,captcha_open,site_login,store_login,site_register,store_register,copyright_info,admin_index_logo, + store_open_protocol,register_protocol,store_register_protocol,store_spu_audit,member_price_status,crowdfunding_protocol,h5_call_back_domain,pc_call_back_domain + + + + + UPDATE segchk_system_setting SET + phone=#{phone},logo=#{logo},site_url=#{siteUrl},site_name=#{siteName},label_log=#{labelLog},admin_logo=#{adminLogo}, + site_login=#{siteLoginPic},store_login=#{storeLoginPic},site_register=#{siteRegisterPic},store_register=#{storeRegisterPic}, + copyright_info=#{copyrightInfo},admin_index_logo=#{adminIndexLogo},store_open_protocol=#{storeOpenProtocol},register_protocol=#{siteRegisterProtocol}, + store_register_protocol=#{storeRegisterProtocol},crowdfunding_protocol=#{crowdFundingProtocol}, + h5_call_back_domain=#{h5CallBackDomain},pc_call_back_domain=#{pcCallBackDomain} + + + UPDATE segchk_system_setting SET captcha_open = #{captchaOpen} + + + UPDATE segchk_system_setting SET store_spu_audit = #{storeSpuAudit} + + + UPDATE segchk_system_setting SET member_price_status = #{memberPriceStatus} + + \ No newline at end of file diff --git a/ruoyi-segchk/src/main/resources/mapper/setting/LsCityMapper.xml b/ruoyi-segchk/src/main/resources/mapper/setting/LsCityMapper.xml new file mode 100644 index 0000000..cc125f1 --- /dev/null +++ b/ruoyi-segchk/src/main/resources/mapper/setting/LsCityMapper.xml @@ -0,0 +1,85 @@ + + + + + + + + + + + + + + + + + select id, name, province_id, sort, del_flag, create_time, modify_time, del_time from ls_city + + + + + + + + insert into ls_city + + name, + province_id, + sort, + del_flag, + create_time, + modify_time, + del_time, + + + #{name}, + #{provinceId}, + #{sort}, + #{delFlag}, + #{createTime}, + #{modifyTime}, + #{delTime}, + + + + + update ls_city + + name = #{name}, + province_id = #{provinceId}, + sort = #{sort}, + del_flag = #{delFlag}, + create_time = #{createTime}, + modify_time = #{modifyTime}, + del_time = #{delTime}, + + where id = #{id} + + + + delete from ls_city where id = #{id} + + + + delete from ls_city where id in + + #{id} + + + + \ No newline at end of file diff --git a/ruoyi-segchk/src/main/resources/mapper/setting/LsDistrictMapper.xml b/ruoyi-segchk/src/main/resources/mapper/setting/LsDistrictMapper.xml new file mode 100644 index 0000000..7543561 --- /dev/null +++ b/ruoyi-segchk/src/main/resources/mapper/setting/LsDistrictMapper.xml @@ -0,0 +1,85 @@ + + + + + + + + + + + + + + + + + select id, name, city_id, sort, del_flag, create_time, modify_time, del_time from ls_district + + + + + + + + insert into ls_district + + name, + city_id, + sort, + del_flag, + create_time, + modify_time, + del_time, + + + #{name}, + #{cityId}, + #{sort}, + #{delFlag}, + #{createTime}, + #{modifyTime}, + #{delTime}, + + + + + update ls_district + + name = #{name}, + city_id = #{cityId}, + sort = #{sort}, + del_flag = #{delFlag}, + create_time = #{createTime}, + modify_time = #{modifyTime}, + del_time = #{delTime}, + + where id = #{id} + + + + delete from ls_district where id = #{id} + + + + delete from ls_district where id in + + #{id} + + + + \ No newline at end of file diff --git a/ruoyi-segchk/src/main/resources/mapper/setting/LsEmailSettingMapper.xml b/ruoyi-segchk/src/main/resources/mapper/setting/LsEmailSettingMapper.xml new file mode 100644 index 0000000..8e8f2fe --- /dev/null +++ b/ruoyi-segchk/src/main/resources/mapper/setting/LsEmailSettingMapper.xml @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + select id, sender_mail, sender_name, smtp_server, smtp_port, username, password from ls_email_setting + + + + + + + + insert into ls_email_setting + + sender_mail, + sender_name, + smtp_server, + smtp_port, + username, + password, + + + #{senderMail}, + #{senderName}, + #{smtpServer}, + #{smtpPort}, + #{username}, + #{password}, + + + + + update ls_email_setting + + sender_mail = #{senderMail}, + sender_name = #{senderName}, + smtp_server = #{smtpServer}, + smtp_port = #{smtpPort}, + username = #{username}, + password = #{password}, + + where id = #{id} + + + + delete from ls_email_setting where id = #{id} + + + + delete from ls_email_setting where id in + + #{id} + + + + \ No newline at end of file diff --git a/ruoyi-segchk/src/main/resources/mapper/setting/LsProvinceMapper.xml b/ruoyi-segchk/src/main/resources/mapper/setting/LsProvinceMapper.xml new file mode 100644 index 0000000..ff7e269 --- /dev/null +++ b/ruoyi-segchk/src/main/resources/mapper/setting/LsProvinceMapper.xml @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + select id, name, sort, del_flag, create_time, modify_time, del_time from ls_province + + + + + + + + insert into ls_province + + name, + sort, + del_flag, + create_time, + modify_time, + del_time, + + + #{name}, + #{sort}, + #{delFlag}, + #{createTime}, + #{modifyTime}, + #{delTime}, + + + + + update ls_province + + name = #{name}, + sort = #{sort}, + del_flag = #{delFlag}, + create_time = #{createTime}, + modify_time = #{modifyTime}, + del_time = #{delTime}, + + where id = #{id} + + + + delete from ls_province where id = #{id} + + + + delete from ls_province where id in + + #{id} + + + + \ No newline at end of file diff --git a/ruoyi-segchk/src/main/resources/mapper/setting/LsSmsSettingMapper.xml b/ruoyi-segchk/src/main/resources/mapper/setting/LsSmsSettingMapper.xml new file mode 100644 index 0000000..1e1c6f8 --- /dev/null +++ b/ruoyi-segchk/src/main/resources/mapper/setting/LsSmsSettingMapper.xml @@ -0,0 +1,111 @@ + + + + + + + + + + + + + + + + + + + + select id, secret, url, sign, template_id, writeoff_template_id, virtual_order_template_id, 'key', audit_template_id, settlement_template_id, withdraw_template_id from segchk_sms_setting + + + + + + + + insert into segchk_sms_setting + + secret, + url, + sign, + template_id, + writeoff_template_id, + virtual_order_template_id, + key, + audit_template_id, + settlement_template_id, + withdraw_template_id, + + + #{secret}, + #{url}, + #{sign}, + #{templateId}, + #{writeoffTemplateId}, + #{virtualOrderTemplateId}, + #{key}, + #{auditTemplateId}, + #{settlementTemplateId}, + #{withdrawTemplateId}, + + + + + update segchk_sms_setting + + secret = #{secret}, + url = #{url}, + sign = #{sign}, + template_id = #{templateId}, + writeoff_template_id = #{writeoffTemplateId}, + virtual_order_template_id = #{virtualOrderTemplateId}, + key = #{key}, + audit_template_id = #{auditTemplateId}, + settlement_template_id = #{settlementTemplateId}, + withdraw_template_id = #{withdrawTemplateId}, + + where id = #{id} + + + + delete from segchk_sms_setting where id = #{id} + + + + delete from segchk_sms_setting where id in + + #{id} + + + + \ No newline at end of file diff --git a/ruoyi-segchk/src/main/resources/mapper/setting/LsStationLetterMapper.xml b/ruoyi-segchk/src/main/resources/mapper/setting/LsStationLetterMapper.xml new file mode 100644 index 0000000..17e1e03 --- /dev/null +++ b/ruoyi-segchk/src/main/resources/mapper/setting/LsStationLetterMapper.xml @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + select id, customer_id, title, content, is_read, del_flag, create_time from ls_station_letter + + + insert into ls_station_letter + + (customer_id,title, content, is_read, del_flag,create_time) + values + + ( + #{stationLetter.customerId}, + #{stationLetter.title}, + #{stationLetter.content}, + '0', + '0', + now() + ) + + + + + + + + + UPDATE ls_station_letter SET del_flag = '1' WHERE id = #{id} + + + + UPDATE ls_station_letter SET is_read = '1' WHERE id = #{id} and customer_id = #{customerId} + + + + + + + + + insert into ls_station_letter + + customer_id, + title, + content, + is_read, + del_flag, + create_time, + + + #{customerId}, + #{title}, + #{content}, + #{isRead}, + #{delFlag}, + #{createTime}, + + + + + update ls_station_letter + + customer_id = #{customerId}, + title = #{title}, + content = #{content}, + is_read = #{isRead}, + del_flag = #{delFlag}, + create_time = #{createTime}, + + where id = #{id} + + + + delete from ls_station_letter where id = #{id} + + + + delete from ls_station_letter where id in + + #{id} + + + + \ No newline at end of file diff --git a/ruoyi-segchk/src/main/resources/mapper/setting/LsSystemSeoMapper.xml b/ruoyi-segchk/src/main/resources/mapper/setting/LsSystemSeoMapper.xml new file mode 100644 index 0000000..298201c --- /dev/null +++ b/ruoyi-segchk/src/main/resources/mapper/setting/LsSystemSeoMapper.xml @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + select id, title, key_word, seo_desc, is_open from ls_system_seo + + + + + + + + insert into ls_system_seo + + title, + key_word, + seo_desc, + is_open, + + + #{title}, + #{keyWord}, + #{seoDesc}, + #{isOpen}, + + + + + update ls_system_seo + + title = #{title}, + key_word = #{keyWord}, + seo_desc = #{seoDesc}, + is_open = #{isOpen}, + + where id = #{id} + + + + delete from ls_system_seo where id = #{id} + + + + delete from ls_system_seo where id in + + #{id} + + + + \ No newline at end of file diff --git a/ruoyi-segchk/src/main/resources/mapper/setting/LsWxCustomerLinkMapper.xml b/ruoyi-segchk/src/main/resources/mapper/setting/LsWxCustomerLinkMapper.xml new file mode 100644 index 0000000..30ccebd --- /dev/null +++ b/ruoyi-segchk/src/main/resources/mapper/setting/LsWxCustomerLinkMapper.xml @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + select id, wx_union_id, customer_id, wx_open_id, wx_applet_open_id from ls_wx_customer_link + + + + + + + + insert into ls_wx_customer_link + + wx_union_id, + customer_id, + wx_open_id, + wx_applet_open_id, + + + #{wxUnionId}, + #{customerId}, + #{wxOpenId}, + #{wxAppletOpenId}, + + + + + update ls_wx_customer_link + + wx_union_id = #{wxUnionId}, + customer_id = #{customerId}, + wx_open_id = #{wxOpenId}, + wx_applet_open_id = #{wxAppletOpenId}, + + where id = #{id} + + + + delete from ls_wx_customer_link where id = #{id} + + + + delete from ls_wx_customer_link where id in + + #{id} + + + + \ No newline at end of file diff --git a/ruoyi-segchk/src/main/resources/mapper/setting/OssMapper.xml b/ruoyi-segchk/src/main/resources/mapper/setting/OssMapper.xml new file mode 100644 index 0000000..ae48799 --- /dev/null +++ b/ruoyi-segchk/src/main/resources/mapper/setting/OssMapper.xml @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + id, + access_key_id, + access_key_secret, + bucket_name, + end_point, + style_name, + prefix, + address + + + + + + + update ls_aliyun_oss_setting + + access_key_id = #{accessKeyId}, + access_key_secret = #{accessKeySecret}, + bucket_name = #{bucketName}, + end_point = #{endPoint}, + style_name = #{styleName}, + prefix = #{prefix}, + address = #{address}, + + where id = #{id} + + \ No newline at end of file diff --git a/ruoyi-segchk/src/main/resources/mapper/setting/SCommunityBuySettingMapper.xml b/ruoyi-segchk/src/main/resources/mapper/setting/SCommunityBuySettingMapper.xml new file mode 100644 index 0000000..c8029c9 --- /dev/null +++ b/ruoyi-segchk/src/main/resources/mapper/setting/SCommunityBuySettingMapper.xml @@ -0,0 +1,81 @@ + + + + + + + + + + + + + + + select id, name, audit, sms_audit_notice, sms_pay_notice, sms_commission_notice from s_community_buy_setting + + + + + + + + insert into s_community_buy_setting + + name, + audit, + sms_audit_notice, + sms_pay_notice, + sms_commission_notice, + + + #{name}, + #{audit}, + #{smsAuditNotice}, + #{smsPayNotice}, + #{smsCommissionNotice}, + + + + + update s_community_buy_setting + + name = #{name}, + audit = #{audit}, + sms_audit_notice = #{smsAuditNotice}, + sms_pay_notice = #{smsPayNotice}, + sms_commission_notice = #{smsCommissionNotice}, + + where id = #{id} + + + + delete from s_community_buy_setting where id = #{id} + + + + delete from s_community_buy_setting where id in + + #{id} + + + + \ No newline at end of file diff --git a/ruoyi-segchk/src/main/resources/mapper/setting/SegchkPaySettingMapper.xml b/ruoyi-segchk/src/main/resources/mapper/setting/SegchkPaySettingMapper.xml new file mode 100644 index 0000000..4cd8ec1 --- /dev/null +++ b/ruoyi-segchk/src/main/resources/mapper/setting/SegchkPaySettingMapper.xml @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + select id, codeType, column_name, column_value, provider_id from segchk_pay_setting + + + + + + + + insert into segchk_pay_setting + + codeType, + column_name, + column_value, + + + #{codetype}, + #{columnName}, + #{columnValue}, + + + + + update segchk_pay_setting + + codeType = #{codetype}, + column_name = #{columnName}, + column_value = #{columnValue}, + + where id = #{id} + + + + delete from segchk_pay_setting where id = #{id} + + + + delete from segchk_pay_setting where id in + + #{id} + + + + + + + + + + + DELETE FROM segchk_pay_setting WHERE codeType=#{codeType} + + + INSERT INTO segchk_pay_setting (codeType,`column_name`,column_value) VALUES + + ( + #{paySet.codeType},#{paySet.columnName},#{paySet.columnValue} + ) + + + \ No newline at end of file diff --git a/ruoyi-segchk/src/main/resources/templates/posters/bg.jpg b/ruoyi-segchk/src/main/resources/templates/posters/bg.jpg new file mode 100644 index 0000000..ad7c1e6 Binary files /dev/null and b/ruoyi-segchk/src/main/resources/templates/posters/bg.jpg differ diff --git a/ruoyi-system/pom.xml b/ruoyi-system/pom.xml index da5569e..8f3fa85 100644 --- a/ruoyi-system/pom.xml +++ b/ruoyi-system/pom.xml @@ -6,6 +6,8 @@ ruoyi com.ruoyi 3.6.0 + ../pom.xml + 4.0.0 diff --git a/ruoyi-system/src/main/java/com/ruoyi/segchk/domain/SegchkRecommenderStoreLableWeb.java b/ruoyi-system/src/main/java/com/ruoyi/segchk/domain/SegchkRecommenderStoreLableWeb.java index ed6ef42..fc462d6 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/segchk/domain/SegchkRecommenderStoreLableWeb.java +++ b/ruoyi-system/src/main/java/com/ruoyi/segchk/domain/SegchkRecommenderStoreLableWeb.java @@ -30,6 +30,9 @@ public class SegchkRecommenderStoreLableWeb extends BaseEntity @Excel(name = "商户标签名称") private String lableName; + /** 标签图片 */ + @Excel(name = "标签图片") + private String lablePic; public Integer getLableId() { return lableId; @@ -63,13 +66,22 @@ public class SegchkRecommenderStoreLableWeb extends BaseEntity this.lableName = lableName; } + public String getLablePic() { + return lablePic; + } + + public void setLablePic(String lablePic) { + this.lablePic = lablePic; + } + @Override public String toString() { return "SegchkRecommenderStoreLableWeb{" + "lableId=" + lableId + ", lableSortId=" + lableSortId + ", lableTypeId=" + lableTypeId + - ", lableName=" + lableName + + ", lableName='" + lableName + '\'' + + ", lablePic='" + lablePic + '\'' + '}'; } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/segchk/domain/SegchkStoreBasicInfo.java b/ruoyi-system/src/main/java/com/ruoyi/segchk/domain/SegchkStoreBasicInfo.java index 7f2bff2..d1a8d9a 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/segchk/domain/SegchkStoreBasicInfo.java +++ b/ruoyi-system/src/main/java/com/ruoyi/segchk/domain/SegchkStoreBasicInfo.java @@ -38,6 +38,10 @@ public class SegchkStoreBasicInfo extends BaseEntity @Excel(name = "微信唯一识别号,用于转账等") private String openid; + /** 微信的联合登录id */ + @Excel(name = "微信的联合登录id") + private String unionId; + /** 商家微信昵称 */ @Excel(name = "商家微信昵称") private String nickName; @@ -366,6 +370,14 @@ public class SegchkStoreBasicInfo extends BaseEntity this.segchkStoreSecurityList = segchkStoreSecurityList; } + public String getUnionId() { + return unionId; + } + + public void setUnionId(String unionId) { + this.unionId = unionId; + } + @Override public String toString() { return "SegchkStoreBasicInfo{" + @@ -374,6 +386,7 @@ public class SegchkStoreBasicInfo extends BaseEntity ", storeName='" + storeName + '\'' + ", storePhone='" + storePhone + '\'' + ", openid='" + openid + '\'' + + ", unionId='" + unionId + '\'' + ", nickName='" + nickName + '\'' + ", iconUrl='" + iconUrl + '\'' + ", serviceState='" + serviceState + '\'' + diff --git a/ruoyi-system/src/main/java/com/ruoyi/segchk/domain/SegchkUserCash.java b/ruoyi-system/src/main/java/com/ruoyi/segchk/domain/SegchkUserCash.java index cda7e5a..41e4fc8 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/segchk/domain/SegchkUserCash.java +++ b/ruoyi-system/src/main/java/com/ruoyi/segchk/domain/SegchkUserCash.java @@ -34,6 +34,10 @@ public class SegchkUserCash extends BaseEntity @Excel(name = "提现id,全表唯一") private Long cashId; + /** 余额id */ + @Excel(name = "余额id,") + private Long accountId; + /** 运营商id,全局唯一 */ @Excel(name = "运营商id,全局唯一") private Long providerId; @@ -111,16 +115,25 @@ public class SegchkUserCash extends BaseEntity return retFlag; } + public Long getAccountId() { + return accountId; + } + + public void setAccountId(Long accountId) { + this.accountId = accountId; + } + @Override public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("userId", getUserId()) - .append("cash", getCash()) - .append("cashType", getCashType()) - .append("cashId", getCashId()) - .append("providerId", getProviderId()) - .append("modTime", getModTime()) - .append("retFlag", getRetFlag()) - .toString(); + return "SegchkUserCash{" + + "userId=" + userId + + ", cash=" + cash + + ", cashType='" + cashType + '\'' + + ", cashId=" + cashId + + ", accountId=" + accountId + + ", providerId=" + providerId + + ", modTime=" + modTime + + ", retFlag=" + retFlag + + '}'; } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/segchk/domain/SegchkUserLevelInfo.java b/ruoyi-system/src/main/java/com/ruoyi/segchk/domain/SegchkUserLevelInfo.java new file mode 100644 index 0000000..dce2c19 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/segchk/domain/SegchkUserLevelInfo.java @@ -0,0 +1,77 @@ +package com.ruoyi.segchk.domain; + +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +import java.util.List; + +/** + * seg用户角色信息对象 SegchkUserLevelInfo + * + * @author yinzhiying + * @date 2021-08-23 + */ +public class SegchkUserLevelInfo extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 用户id,全局唯一 */ + @Excel(name = "用户id,全局唯一") + private Long userId; + + /** 用户角色 */ + @Excel(name = "用户角色") + private Long userLevel; + + /** 运营商id,全局唯一 */ + @Excel(name = "运营商id,全局唯一") + private Long providerId; + + /** token */ + @Excel(name = "token") + private String token; + + public Long getUserId() { + return userId; + } + + public void setUserId(Long userId) { + this.userId = userId; + } + + public Long getUserLevel() { + return userLevel; + } + + public void setUserLevel(Long userLevel) { + this.userLevel = userLevel; + } + + public Long getProviderId() { + return providerId; + } + + public void setProviderId(Long providerId) { + this.providerId = providerId; + } + + public String getToken() { + return token; + } + + public void setToken(String token) { + this.token = token; + } + + @Override + public String toString() { + return "SegchkUserLevelInfo{" + + "userId=" + userId + + ", userLevel=" + userLevel + + ", providerId=" + providerId + + ", token='" + token + '\'' + + '}'; + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/segchk/domain/SegchkUserWechat.java b/ruoyi-system/src/main/java/com/ruoyi/segchk/domain/SegchkUserWechat.java index 85cd80b..367f408 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/segchk/domain/SegchkUserWechat.java +++ b/ruoyi-system/src/main/java/com/ruoyi/segchk/domain/SegchkUserWechat.java @@ -29,6 +29,10 @@ public class SegchkUserWechat extends BaseEntity @Excel(name = "微信唯一识别号,用于转账等") private String openid; + /** 微信的联合登录id */ + @Excel(name = "微信的联合登录id") + private String unionId; + /** 微信昵称 */ @Excel(name = "微信昵称") private String nickName; @@ -97,15 +101,24 @@ public class SegchkUserWechat extends BaseEntity return modTime; } + public String getUnionId() { + return unionId; + } + + public void setUnionId(String unionId) { + this.unionId = unionId; + } + @Override public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("providerId", getProviderId()) - .append("userId", getUserId()) - .append("openid", getOpenid()) - .append("nickName", getNickName()) - .append("iconUrl", getIconUrl()) - .append("modTime", getModTime()) - .toString(); + return "SegchkUserWechat{" + + "providerId=" + providerId + + ", userId=" + userId + + ", openid='" + openid + '\'' + + ", unionId='" + unionId + '\'' + + ", nickName='" + nickName + '\'' + + ", iconUrl='" + iconUrl + '\'' + + ", modTime=" + modTime + + '}'; } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/segchk/service/impl/SegchkUserIndexServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/segchk/service/impl/SegchkUserIndexServiceImpl.java deleted file mode 100644 index 6853b63..0000000 --- a/ruoyi-system/src/main/java/com/ruoyi/segchk/service/impl/SegchkUserIndexServiceImpl.java +++ /dev/null @@ -1,479 +0,0 @@ -package com.ruoyi.segchk.service.impl; - -import com.ruoyi.segchk.domain.*; -import com.ruoyi.segchk.mapper.*; -import com.ruoyi.segchk.service.ISegchkUserIndexService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import java.math.BigDecimal; -import java.util.List; -import java.util.stream.Collectors; - -/** - * seg用户基本信息Service业务层处理 - * - * @author yinzhiying - * @date 2021-07-01 - */ -@Service -public class SegchkUserIndexServiceImpl implements ISegchkUserIndexService -{ - @Autowired - private SegchkUserIndexMapper segchkUserIndexMapper; - - @Autowired - private SegchkIndexUserVipMapper segchkIndexUserVipMapper; - - @Autowired - private SegchkServiceChkMapper segchkServiceChkMapper; - - @Autowired - private SegchkStoreSelfMgtMapper segchkStoreSelfMgtMapper; - - @Autowired - private SegchkSelfServiceChkMapper segchkSelfServiceChkMapper; - - @Autowired - private SegchkUserLikegoMapper segchkUserLikegoMapper; - - @Autowired - private SegchkUserChargeMapper segchkUserChargeMapper; - - @Autowired - private SegchkIndexUserAccountMapper segchkIndexUserAccountMapper; - - @Autowired - private SegchkIndexStoreAccountMapper segchkIndexStoreAccountMapper; - - @Autowired - private SegchkUserSecurityMapper segchkUserSecurityMapper; - - @Autowired - private SegchkUserCertificationInfoMapper segchkUserCertificationInfoMapper; - - @Autowired - private SegchkStoreCashMapper segchkStoreCashMapper; - - @Autowired - private SegchkUserCashMapper segchkUserCashMapper; - - - @Autowired - private SegchkServiceCommentMapper segchkServiceCommentMapper; - /** - * 查询seg用户中心信息 - * - * @param segchkUserWebReq@return seg用户扩展信息 - */ - @Override - public SegchkUserWebResp selectSegchkUserWebInfo(SegchkUserWebReq segchkUserWebReq) { - return segchkUserIndexMapper.selectSegchkUserWebInfo(segchkUserWebReq); - } - - /** - * 查询seg用户核消列表 - * - * @param segchkUserWebReq - * @return seg用户扩展信息 - */ - @Override - public List selectUserServiceCHKList(SegchkUserWebReq segchkUserWebReq) { - return segchkUserIndexMapper.selectUserServiceCHKList(segchkUserWebReq); - } - - /** - * 查询seg用户会员卡列表或赠卡优惠券列表 - * - * @param segchkUserWebReq - * @return seg用户扩展信息 - */ - @Override - public List selectUserCardList(SegchkUserWebReq segchkUserWebReq) { - if(segchkUserWebReq.getUserLevel() == 0 || segchkUserWebReq.getUserLevel() == null) { - return segchkUserIndexMapper.selectUserCardList(segchkUserWebReq); - } - else { - return segchkUserIndexMapper.selectUserPerformanceList(segchkUserWebReq); - } - } - - /** - * 查询seg用户收藏列表 - * - * @param segchkUserWebReq - * @return seg用户扩展信息 - */ - @Override - public List selectUserCollectList(SegchkUserWebReq segchkUserWebReq) { - return segchkUserIndexMapper.selectUserCollectList(segchkUserWebReq); - } - - /** - * 查询seg用户预约列表 - * - * @param segchkUserWebReq@return seg用户扩展信息 - */ - @Override - public List selectUserLikGoList(SegchkUserWebReq segchkUserWebReq) { - return segchkUserIndexMapper.selectUserLikGoList(segchkUserWebReq); - } - - /** - * 查询seg用户充值列表 - * - * @param segchkUserWebReq@return seg用户扩展信息 - */ - @Override - public List selectUserChargeList(SegchkUserWebReq segchkUserWebReq) { - return segchkUserIndexMapper.selectUserChargeList(segchkUserWebReq); - } - - /** - * 查询seg用户提现列表 - * - * @param segchkUserWebReq@return seg用户扩展信息 - */ - @Override - public List selectUserCashList(SegchkUserWebReq segchkUserWebReq) { - return segchkUserIndexMapper.selectUserCashList(segchkUserWebReq); - } - - /** - * 查询seg用户消息列表 - * - * @param segchkUserWebReq@return seg用户扩展信息 - */ - @Override - public List selectUserMsgList(SegchkUserWebReq segchkUserWebReq) { - return segchkUserIndexMapper.selectUserMsgList(segchkUserWebReq); - } - - /** - * 查询seg用户预约可用卡券列表 - * - * @param segchkServiceOrderWebReq seg用户中心请求实体 - * @return seg用户扩展信息 - */ - @Override - public List selectUserOrderPredCardListWebInfo(SegchkServiceOrderWebReq segchkServiceOrderWebReq) { - return segchkUserIndexMapper.selectUserOrderPredCardListWebInfo(segchkServiceOrderWebReq); - } - - /** - * 根据用户核消二维码提取出来相应的信息进行核消,1、检查核卡是否可以核消(防止该卡已经在该商家不能再次核消),2、检查该预约id,是否已经使用(防止多次预约核消使用) - * - * @param segchkUserLikego seg用户想去记录实体 - * @return 结果 - */ - @Override - public void CheckUserServiceChk(SegchkUserLikego segchkUserLikego) { - SegchkServiceOrderWebReq segchkServiceOrderWebReq = new SegchkServiceOrderWebReq(); - segchkServiceOrderWebReq.setProviderId(segchkUserLikego.getProviderId()); - segchkServiceOrderWebReq.setUserId(segchkUserLikego.getUserId()); - segchkServiceOrderWebReq.setStoreId(segchkUserLikego.getStoreId()); - List segchkServiceOrderWebReqList = segchkUserIndexMapper.selectUserOrderPredCardListWebInfo(segchkServiceOrderWebReq); - if(segchkServiceOrderWebReqList == null || segchkServiceOrderWebReqList.isEmpty()){ -// 说明该用户已经没有可使用的卡了 - } - else { - final List collect = segchkServiceOrderWebReqList.stream().filter(v -> v.getProviderId() == segchkUserLikego.getProviderId() && v.getUserId() == segchkUserLikego.getUserId() && v.getStoreId() == segchkUserLikego.getStoreId() && v.getCardId() == segchkUserLikego.getCardId() && v.getTypeId() == segchkUserLikego.getCardType()).collect(Collectors.toList()); - } - - } - - @Override - public SegchkServiceOrderChkTestResp selectUserOrderPredInfo(Long likegoId) { - return segchkUserIndexMapper.selectUserOrderPredInfo(likegoId); - } - - /** - * 根据核查结果进行核消。说明已经满足核消条件 - * - * @param segchkServiceOrderChkTestResp - * @param likegoId - * @return 结果 - */ - @Override - @Transactional - public int OrderCheckTransaction(SegchkServiceOrderChkTestResp segchkServiceOrderChkTestResp, Long likegoId) { - int ret = 0; - if(segchkServiceOrderChkTestResp.getCardType() == 0){ -// 说明是会员卡,则先更新会员卡次数。然后插入核消记录,最后更新预约订单状态 -// SegchkUserVip segchkUserVip = new SegchkUserVip(); - ret += segchkIndexUserVipMapper.updateSegchkUserVipCheck(segchkServiceOrderChkTestResp.getCardId()); - System.out.println(ret); - SegchkServiceChk segchkServiceChk = new SegchkServiceChk(); segchkServiceChk.setCardId(segchkServiceOrderChkTestResp.getCardId()); - segchkServiceChk.setCardTypeId(0L); - segchkServiceChk.setProviderId(segchkServiceOrderChkTestResp.getProviderId()); - segchkServiceChk.setStoreId(segchkServiceOrderChkTestResp.getStoreId()); - segchkServiceChk.setUserId(segchkServiceOrderChkTestResp.getUserId()); - - ret += segchkServiceChkMapper.insertSegchkServiceChk(segchkServiceChk); - System.out.println(ret); - } - else { -// 说明是优惠券或赠卡则先更新赠卡次数。然后插入核消记录,最后更新预约订单状态 - ret += segchkStoreSelfMgtMapper.updateSegchkUserVipCheck(segchkServiceOrderChkTestResp.getCardId()); - System.out.println(ret); - SegchkSelfServiceChk segchkSelfServiceChk = new SegchkSelfServiceChk(); - segchkSelfServiceChk.setCardId(segchkServiceOrderChkTestResp.getCardId()); - segchkSelfServiceChk.setProviderId(segchkServiceOrderChkTestResp.getProviderId()); - segchkSelfServiceChk.setStoreId(segchkServiceOrderChkTestResp.getStoreId()); - segchkSelfServiceChk.setUserId(segchkServiceOrderChkTestResp.getUserId()); - ret += segchkSelfServiceChkMapper.insertSegchkSelfServiceChk(segchkSelfServiceChk); - System.out.println(ret); - } - SegchkUserLikego segchkUserLikego = new SegchkUserLikego(); - segchkUserLikego.setLikegoId(likegoId); - segchkUserLikego.setMgtState(2); - ret += segchkUserLikegoMapper.updateSegchkUserLikego(segchkUserLikego); - System.out.println(ret); - return ret; - } - - /** - * 根据支付回调结果,进行相应的更新 - * - * @param chargeId 核消检查信息 - * @param ret 预约单id - * @return 结果 - */ - @Override - @Transactional - public void chargeRet(String chargeId, int ret) { -// 根据回调结果。如果成功,则插入生成会员卡,并获取会员卡号,否则不产生新的会员卡号 - if(ret == 0){ -// 支付成功,生成新的会员卡信息 - SegchkChargeRet segchkChargeRet = new SegchkChargeRet(); - segchkChargeRet.setChargeId(Long.valueOf(chargeId)); - int insert_ret = segchkIndexUserVipMapper.insertSegchkUserVipByCharge(segchkChargeRet); - if(insert_ret == 0){ - System.out.format("生成新的会员卡失败--->{0}\n", segchkChargeRet.getChargeId()); - } - else{ - System.out.format("生成新的会员卡成功--->{0}:{1}\n", chargeId, segchkChargeRet.getCardId()); - } -// 根据新生成的会员卡号,充值id,更新相应的充值记录表,商家赠卡表等 - SegchkUserCharge segchkUserCharge = new SegchkUserCharge(); - segchkUserCharge.setChargeId(segchkChargeRet.getChargeId()); - segchkUserCharge.setCardId(segchkChargeRet.getCardId()); - segchkUserCharge.setRetFlag(1); - int updaterest = segchkUserChargeMapper.updateSegchkUserChargeByRet(segchkUserCharge); - System.out.println(updaterest); - } - else{ - SegchkUserCharge segchkUserCharge = new SegchkUserCharge(); - segchkUserCharge.setChargeId(Long.parseLong(chargeId)); - segchkUserCharge.setRetFlag(2); - int updaterest = segchkUserChargeMapper.updateSegchkUserCharge(segchkUserCharge); - int deleterest = segchkIndexUserAccountMapper.deleteSegchkUserAccountByCharge(segchkUserCharge); - System.out.println(updaterest); - } - } - - /** - * 根据支用户id,运营商id,查询该用户可购买的卡 - * - * @param segchkUserWebReq 用户请示信息体 - * @return 结果 - */ - @Override - public List SegchkUserChargePre(SegchkUserWebReq segchkUserWebReq) { - List segchkUserChargeCards = segchkUserIndexMapper.selectSegchkUserChargePre(segchkUserWebReq); - -// 说明该用户购买过正式会员卡 -// boolean b = segchkUserChargeCards.parallelStream().anyMatch(v -> v.getHadBuy() != 0 && v.getCardTypeValue().compareTo(new BigDecimal(20.0)) = -1); - if(segchkUserChargeCards.parallelStream().anyMatch(v -> v.getCanBuy() == 1 || v.getCanBuy() == 3)){ -// 如果有一张卡,为正在使用中1,则不可以再充值购买 - return null; - } - else{ - List segchkUserChargeCards1 = segchkUserChargeCards.parallelStream().filter(v -> { -// 通过过滤出可购买的卡(间接过滤到为超限不能再买的卡) - return v.getCanBuy() == 0; - }).collect(Collectors.toList()); - return segchkUserChargeCards1.size() == 0 || segchkUserChargeCards1.isEmpty() ? null : segchkUserChargeCards1; - } - } - - /** - * 根据支用户id,运营商id,用户充值时可用余额 - * - * @param segchkUserCharge 用户请示信息体 - * @return 结果 - */ - @Override - public BigDecimal getAccount(SegchkUserCharge segchkUserCharge) { - SegchkUserAccountCheck segchkUserAccountCheck = new SegchkUserAccountCheck(); - segchkUserAccountCheck.setAccount(segchkUserCharge.getAccountUsed()); - segchkUserAccountCheck.setProviderId(segchkUserCharge.getProviderId()); - segchkUserAccountCheck.setUserId(segchkUserCharge.getUserId()); - BigDecimal ret = segchkIndexUserAccountMapper.checkSegchkUserAccount(segchkUserAccountCheck); - return ret; - } - - /** - * 根据用户id(或者商户id),运营商id,用户身份查询用户余额 - * - * @param segchkUserCashOpsReq 用户请示信息体 - * @return 结果 - */ - @Override - public int getAccountForCash(SegchkUserCashOpsReq segchkUserCashOpsReq) { - SegchkUserCashOpsResp segchkUserCashOpsResp = segchkIndexUserAccountMapper.selectSegchkUserAccountForCash(segchkUserCashOpsReq); - if(segchkUserCashOpsResp == null){ -// 说明用户没有任何余额信息 - return -1; - } - - if(segchkUserCashOpsReq.getUserLevel() != 1 && segchkUserCashOpsReq.getUserLevel() != 2){ -// 非正常用户 - return -2; - } - BigDecimal baseline = segchkUserCashOpsReq.getUserLevel() == 1 ? new BigDecimal(3000.0) : new BigDecimal(0.0); - BigDecimal baseline1 = segchkUserCashOpsReq.getUserLevel() == 1 ? new BigDecimal(5000.0) : new BigDecimal(100.0); - if(segchkUserCashOpsReq.getCash().compareTo(segchkUserCashOpsReq.getCashId() == null ? baseline : baseline1) != 1){ -// 首次提现余额受限 - return -3; - } - if(segchkUserCashOpsReq.getCash().compareTo(segchkUserCashOpsResp.getAccount()) == 1){ -// 提现金额超过余额 - return -4; - } - -// 1、创建提现记录 -// 2 新增余额记录 -// ret = 2 成功 - int ret = makeCashOps(segchkUserCashOpsReq); - return ret; - } - - /** - * 根据提现id,进行提现结果保存,及余额更新 - * - * @param chargeId 行政区代码 - * @param ret 行政区代码 - * @return seg首页轮播图管理 - */ - @Override - @Transactional - public void cashRet(String chargeId, int ret) { - int opsRet = 0; - SegchkUserCash segchkUserCash = new SegchkUserCash(); - segchkUserCash.setCashId(Long.valueOf(chargeId)); - segchkUserCash.setRetFlag(ret == 0 ? 1 : 2); - opsRet = segchkUserCashMapper.updateSegchkUserCash(segchkUserCash); - if(ret != 0){ - opsRet = segchkIndexUserAccountMapper.deleteSegchkUserAccountByCash(segchkUserCash); - } - } - - /** - * 新增用户评价 - * - * @param segchkServiceCommentUserReq 用户评价提交实体 - * @return seg首页轮播图管理 - */ - @Override - @Transactional - public int insertSegchkServiceComment(SegchkServiceCommentUserReq segchkServiceCommentUserReq) { - int ret = segchkServiceCommentMapper.insertSegchkServiceCommentByChk(segchkServiceCommentUserReq); - SegchkServiceChk segchkServiceChk = new SegchkServiceChk(); - segchkServiceChk.setCommentId(segchkServiceCommentUserReq.getCommentId()); - segchkServiceChk.setChkServiceId(segchkServiceCommentUserReq.getChkServiceId()); - ret += segchkServiceChkMapper.updateSegchkServiceChk(segchkServiceChk); - return ret; - } - - /** - * 根据评价id,查询用户评价 - * - * @param segchkServiceCommentUserReq 用户评价提交实体 - * @return seg首页轮播图管理 - */ - @Override - public SegchkServiceComment selectSegchkServiceComment(SegchkServiceCommentUserReq segchkServiceCommentUserReq) { - return segchkServiceCommentMapper.selectSegchkServiceCommentByCommentId(segchkServiceCommentUserReq.getCommentId()); - } - - /** - * 根据用户提交信息进行修改 - * - * @param segchkUserSetInfoReq 用户评价提交实体 - * @return 更新结果 - */ - @Override - public int updateUserInfo(SegchkUserSetInfoReq segchkUserSetInfoReq) { - SegchkUserSecurity segchkUserSecurity = new SegchkUserSecurity(); - segchkUserSecurity.setPasswd(segchkUserSetInfoReq.getPasswd()); - segchkUserSecurity.setUserId(segchkUserSetInfoReq.getUserId()); - segchkUserSecurity.setProviderId(segchkUserSetInfoReq.getProviderId()); - return segchkUserSecurityMapper.insertSegchkUserSecurity(segchkUserSecurity); - } - - /** - * 根据用户提交信息实名设置 - * - * @param segchkUserCertificationInfo 用户提交实体 - * @return 更新结果 - */ - @Override - public int userCerticify(SegchkUserCertificationInfo segchkUserCertificationInfo) { - SegchkUserCertificationInfo tmp = new SegchkUserCertificationInfo(); - tmp.setUserId(segchkUserCertificationInfo.getUserId()); - tmp.setProviderId(segchkUserCertificationInfo.getProviderId()); - List infos = segchkUserCertificationInfoMapper.selectSegchkUserCertificationInfoList(tmp); - if(infos == null || infos.isEmpty()){ - return segchkUserCertificationInfoMapper.insertSegchkUserCertificationInfo(segchkUserCertificationInfo); - } - else{ - segchkUserCertificationInfo.setUsercardId(infos.get(0).getUsercardId()); - return segchkUserCertificationInfoMapper.updateSegchkUserCertificationInfo(segchkUserCertificationInfo); - } - } - - /** - * 根据用户信息返回用户身份 - * - * @param phoneno 用户信息 - * @return 更新结果 - */ - @Override - public int selectUserLevel(String phoneno) { - return segchkIndexUserVipMapper.selectUserLevel(phoneno); - } - - @Transactional - public int makeCashOps(SegchkUserCashOpsReq segchkUserCashOpsReq) { - int ret = 0; - if(segchkUserCashOpsReq.getUserLevel() == 1){ - SegchkStoreCash segchkStoreCash = new SegchkStoreCash(); - segchkStoreCash.setCash(segchkUserCashOpsReq.getCash()); - segchkStoreCash.setCashType("0"); - segchkStoreCash.setProviderId(segchkUserCashOpsReq.getProviderId()); - segchkStoreCash.setStoreId(segchkUserCashOpsReq.getUserId()); - segchkStoreCash.setRetFlag("0"); -// 增加提现记录 - ret = segchkStoreCashMapper.insertSegchkStoreCash(segchkStoreCash); -// 根据提现计算商户全额 - ret += segchkIndexStoreAccountMapper.insertSegchkStoreAccountByCash(segchkStoreCash); - } - else if(segchkUserCashOpsReq.getUserLevel() == 2){ - SegchkUserCash segchkUserCash = new SegchkUserCash(); - segchkUserCash.setCash(segchkUserCashOpsReq.getCash()); - segchkUserCash.setCashType("0"); - segchkUserCash.setProviderId(segchkUserCashOpsReq.getProviderId()); - segchkUserCash.setUserId(segchkUserCashOpsReq.getUserId()); - segchkUserCash.setRetFlag(0); -// 增加提现记录 - ret = segchkUserCashMapper.insertSegchkUserCash(segchkUserCash); -// 根据提现计算最新的余额 - ret += segchkIndexUserAccountMapper.insertSegchkStoreAccountByCash(segchkUserCash); - } - return ret; - } - - -} diff --git a/ruoyi-system/src/main/resources/mapper/segchk/SegchkIndexUserAccountMapper.xml b/ruoyi-system/src/main/resources/mapper/segchk/SegchkIndexUserAccountMapper.xml index 4b68717..f2f2c51 100644 --- a/ruoyi-system/src/main/resources/mapper/segchk/SegchkIndexUserAccountMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/segchk/SegchkIndexUserAccountMapper.xml @@ -113,7 +113,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" , ifnull(account, -1.0) as account from ((select sua.provider_id, sua.user_id, account, user_level, suc.cash_id from (select *, 2 as user_level from segchk_user_account where provider_id = #{providerId} and user_id = #{userId} order by account_id desc limit 1) sua left join (select * from segchk_user_cash where provider_id = #{providerId} and user_id = #{userId} and ret_flag = 1 limit 1) suc on sua.provider_id = suc.provider_id and sua.user_id = suc.user_id) union all - (select ssa.provider_id, ssa.store_id as user_id, account, user_level, cash_id from (select *, 1 as user_level from segchk_store_account where provider_id = #{providerId} and store_id = #{userId} order by account_id desc limit 1) ssa left join (select * from segchk_store_cash where provider_id = #{providerId} and store_id = #{userId} and ret_flag = 1 limit 1) ssc on ssc.provider_id = ssa.provider_id and ssc.store_id = ssa.store_id)) ret + (select ssa.provider_id, ssa.store_id as user_id, account, user_level, ssc.cash_id from (select *, 1 as user_level from segchk_store_account where provider_id = #{providerId} and store_id = #{userId} order by account_id desc limit 1) ssa left join (select * from segchk_store_cash where provider_id = #{providerId} and store_id = #{userId} and ret_flag = 1 limit 1) ssc on ssc.provider_id = ssa.provider_id and ssc.store_id = ssa.store_id)) ret where user_level = #{userLevel} diff --git a/ruoyi-system/src/main/resources/mapper/segchk/SegchkIndexUserVipMapper.xml b/ruoyi-system/src/main/resources/mapper/segchk/SegchkIndexUserVipMapper.xml index dbebd36..b03b24a 100644 --- a/ruoyi-system/src/main/resources/mapper/segchk/SegchkIndexUserVipMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/segchk/SegchkIndexUserVipMapper.xml @@ -38,4 +38,5 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" (select user_id, card_type_id, provider_id from segchk_user_charge where charge_id = #{chargeId} and ret_flag = 0) suc left join segchk_charge_card scc on suc.provider_id = scc.provider_id and suc.card_type_id = scc.card_type_id) ret + \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/segchk/SegchkStoreBasicInfoMapper.xml b/ruoyi-system/src/main/resources/mapper/segchk/SegchkStoreBasicInfoMapper.xml index 6ffb48d..2db1a06 100644 --- a/ruoyi-system/src/main/resources/mapper/segchk/SegchkStoreBasicInfoMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/segchk/SegchkStoreBasicInfoMapper.xml @@ -10,6 +10,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + @@ -88,7 +89,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select provider_id, store_id, store_name, store_phone, openid, nick_name, icon_url, service_state, saler_id, effective_date, store_corporation, store_addr, store_card, with_msg, cash_threshold, cash_day, service_down_threshold, state_flag, store_lon, store_lat, on_service, detail, mod_time from segchk_store_basic_info + select provider_id, store_id, store_name, store_phone, openid, union_id, nick_name, icon_url, service_state, saler_id, effective_date, store_corporation, store_addr, store_card, with_msg, cash_threshold, cash_day, service_down_threshold, state_flag, store_lon, store_lat, on_service, detail, mod_time from segchk_store_basic_info @@ -23,6 +24,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and provider_id = #{providerId} and user_id = #{userId} and openid = #{openid} + and union_id = #{unionId} and nick_name like concat('%', #{nickName}, '%') and icon_url = #{iconUrl} and mod_time between #{params.beginModTime} and #{params.endModTime} @@ -40,6 +42,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" provider_id, user_id, openid, + union_id, nick_name, icon_url, mod_time, @@ -48,6 +51,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{providerId}, #{userId}, #{openid}, + #{unionId}, #{nickName}, #{iconUrl}, #{modTime}, @@ -59,6 +63,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" provider_id = #{providerId}, openid = #{openid}, + union_id = #{unionId}, nick_name = #{nickName}, icon_url = #{iconUrl}, mod_time = #{modTime}, @@ -76,4 +81,5 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{userId} + \ No newline at end of file diff --git a/ruoyi-ui/src/views/segchk/segchk_store_basic_info/index.vue b/ruoyi-ui/src/views/segchk/segchk_store_basic_info/index.vue index 57b9904..ed99871 100644 --- a/ruoyi-ui/src/views/segchk/segchk_store_basic_info/index.vue +++ b/ruoyi-ui/src/views/segchk/segchk_store_basic_info/index.vue @@ -43,6 +43,18 @@ @keyup.enter.native="handleQuery" /> + + + + + + +