20个文件已修改
24个文件已删除
16个文件已添加
| | |
| | | <groupId>cn.hutool</groupId> |
| | | <artifactId>hutool-all</artifactId> |
| | | </dependency> |
| | | |
| | | |
| | | <dependency> |
| | | <groupId>commons-io</groupId> |
| | | <artifactId>commons-io</artifactId> |
| | | <version>2.6</version> |
| | | </dependency> |
| | | |
| | | <!--中台sdk--> |
| | | <dependency> |
| | | <groupId>com.zhongtai</groupId> |
| | | <artifactId>zhongtai-sdk</artifactId> |
| | | <version>1.0.0</version> |
| | | <scope>system</scope> |
| | | <systemPath>${pom.basedir}/lib/openApiClient-1.0.0.jar</systemPath> |
| | | </dependency> |
| | | <!--单点登录sdk--> |
| | | <dependency> |
| | | <groupId>com.cas</groupId> |
| | | <artifactId>cas-sdk</artifactId> |
| | | <version>3.0.5</version> |
| | | <scope>system</scope> |
| | | <systemPath>${pom.basedir}/lib/cas-client-oncon-3.0.5.jar</systemPath> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.cas</groupId> |
| | | <artifactId>cas-sdk</artifactId> |
| | | <version>1.2.2</version> |
| | | <scope>system</scope> |
| | | <systemPath>${pom.basedir}/lib/cas-client-oncon-core-1.2.2.jar</systemPath> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>commons-httpclient</groupId> |
| | | <artifactId>commons-httpclient</artifactId> |
| | | <version>3.1</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>it.sauronsoftware</groupId> |
| | | <artifactId>base64</artifactId> |
| | | <version>1.3.1</version> |
| | | <scope>system</scope> |
| | | <systemPath>${pom.basedir}/lib/javabase64-1.3.1.jar</systemPath> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | |
| | | <build> |
| | | |
| | | |
| | | <!--打包jar包方式--> |
| | | <!--<plugins>--> |
| | | <!--<plugin>--> |
| | | <!--<groupId>org.springframework.boot</groupId>--> |
| | | <!--<artifactId>spring-boot-maven-plugin</artifactId>--> |
| | | <!--<configuration>--> |
| | | <!--<fork>true</fork><!– 如果没有该项配置,肯呢个devtools不会起作用,即应用不会restart –>--> |
| | | <!--</configuration>--> |
| | | <!--</plugin>--> |
| | | <!--</plugins>--> |
| | | |
| | | <!--打包war包引入本地jar的打包方式--> |
| | | <plugins> |
| | | <plugin> |
| | | <!--<groupId>org.apache.maven.plugins</groupId> |
| | | <artifactId>maven-war-plugin</artifactId> |
| | | <configuration> |
| | | <!– 设置成false,否则检查web.xml是否存在。因为springboot是没有web.xml的 –> |
| | | <failOnMissingWebXml>false</failOnMissingWebXml> |
| | | <!–打包后的项目名–> |
| | | <!–<warName>example</warName>–> |
| | | <!–<webResources>–> |
| | | <!–<resource>–> |
| | | <!–<!–把本地lib里面的jar复制到lib–>–> |
| | | <!–<directory>${project.basedir}/lib</directory>–> |
| | | <!–<targetPath>WEB-INF/lib/</targetPath>–> |
| | | <!–<includes>–> |
| | | <!–<include>**/*.jar</include>–> |
| | | <!–</includes>–> |
| | | <!–</resource>–> |
| | | <!–</webResources>–> |
| | | </configuration>--> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-maven-plugin</artifactId> |
| | | <configuration> |
| | | <includeSystemScope>true</includeSystemScope> |
| | | <fork>true</fork><!-- 如果没有该项配置,肯呢个devtools不会起作用,即应用不会restart --> |
| | | </configuration> |
| | | </plugin> |
| | | </plugins> |
| | | |
| | | |
| | | |
| | | <!--打包war包引入本地jar的打包方式--> |
| | | <!-- <plugins>--> |
| | | <!-- <plugin>--> |
| | | <!-- <!–<groupId>org.apache.maven.plugins</groupId>--> |
| | | <!-- <artifactId>maven-war-plugin</artifactId>--> |
| | | <!-- <configuration>--> |
| | | <!-- <!– 设置成false,否则检查web.xml是否存在。因为springboot是没有web.xml的 –>--> |
| | | <!-- <failOnMissingWebXml>false</failOnMissingWebXml>--> |
| | | <!-- <!–打包后的项目名–>--> |
| | | <!-- <!–<warName>example</warName>–>--> |
| | | <!-- <!–<webResources>–>--> |
| | | <!-- <!–<resource>–>--> |
| | | <!-- <!–<!–把本地lib里面的jar复制到lib–>–>--> |
| | | <!-- <!–<directory>${project.basedir}/lib</directory>–>--> |
| | | <!-- <!–<targetPath>WEB-INF/lib/</targetPath>–>--> |
| | | <!-- <!–<includes>–>--> |
| | | <!-- <!–<include>**/*.jar</include>–>--> |
| | | <!-- <!–</includes>–>--> |
| | | <!-- <!–</resource>–>--> |
| | | <!-- <!–</webResources>–>--> |
| | | <!-- </configuration>–>--> |
| | | <!-- <groupId>org.springframework.boot</groupId>--> |
| | | <!-- <artifactId>spring-boot-maven-plugin</artifactId>--> |
| | | <!-- <configuration>--> |
| | | <!-- <includeSystemScope>true</includeSystemScope>--> |
| | | <!-- </configuration>--> |
| | | <!-- </plugin>--> |
| | | <!-- </plugins>--> |
| | | |
| | | |
| | | <resources> |
| | | <resource> |
| | | <directory>lib</directory> |
| | |
| | | package com.stylefeng.guns; |
| | | |
| | | import com.stylefeng.guns.modular.system.util.GDFalconUtil; |
| | | import org.apache.http.client.HttpClient; |
| | | import org.apache.http.config.SocketConfig; |
| | | import org.apache.http.impl.client.HttpClientBuilder; |
| | | import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.boot.SpringApplication; |
| | | import org.springframework.boot.autoconfigure.SpringBootApplication; |
| | | import org.springframework.boot.builder.SpringApplicationBuilder; |
| | | import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; |
| | | import org.springframework.cloud.client.loadbalancer.LoadBalanced; |
| | | import org.springframework.cloud.netflix.eureka.EnableEurekaClient; |
| | | import org.springframework.context.annotation.Bean; |
| | |
| | | private final static Logger logger = LoggerFactory.getLogger(GunsApplication.class); |
| | | |
| | | public static void main(String[] args) { |
| | | try{ |
| | | try { |
| | | SpringApplication.run(GunsApplication.class, args); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | logger.info("GunsApplication is success!"); |
| | | } catch (Exception e) { |
| | | logger.error("GunsApplication启动异常", e); |
| | | } |
| | | logger.info("GunsApplication is success!"); |
| | | |
| | | // GDFalconUtil gdFalconUtil = new GDFalconUtil(); |
| | | // gdFalconUtil.init();//初始化猎鹰服务 |
| | | } |
| | | |
| | | |
| | |
| | | import com.google.code.kaptcha.impl.DefaultKaptcha; |
| | | import com.google.code.kaptcha.util.Config; |
| | | import com.stylefeng.guns.config.properties.GunsProperties; |
| | | import com.stylefeng.guns.core.intercept.RestApiInteceptor; |
| | | import com.stylefeng.guns.core.listener.ConfigListener; |
| | | import com.stylefeng.guns.core.xss.XssFilter; |
| | | import edu.yale.its.tp.cas.client.filter.OnconMDWebCasFilter; |
| | | import org.jasig.cas.client.session.SingleSignOutFilter; |
| | | import org.jasig.cas.client.session.SingleSignOutHttpSessionListener; |
| | | import org.springframework.aop.Advisor; |
| | | import org.springframework.aop.support.DefaultPointcutAdvisor; |
| | | import org.springframework.aop.support.JdkRegexpMethodPointcut; |
| | |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.web.context.request.RequestContextListener; |
| | | import org.springframework.web.servlet.config.annotation.InterceptorRegistry; |
| | | import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; |
| | | import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.Properties; |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Configuration |
| | | public class WebConfig extends WebMvcConfigurerAdapter { |
| | | |
| | | @Autowired |
| | | private GunsProperties gunsProperties; |
| | | |
| | | /** |
| | | * 增加swagger的支持 |
| | | */ |
| | | @Override |
| | | public void addResourceHandlers(ResourceHandlerRegistry registry) { |
| | | if (gunsProperties.getSwaggerOpen()) { |
| | | registry.addResourceHandler("swagger-ui.html").addResourceLocations("classpath:/META-INF/resources/"); |
| | | registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 增加对rest api鉴权的spring mvc拦截器 |
| | | */ |
| | | @Override |
| | | public void addInterceptors(InterceptorRegistry registry) { |
| | | registry.addInterceptor(new RestApiInteceptor()).addPathPatterns("/api/**") |
| | | .excludePathPatterns("/api/placeOrder/notifyUrl") |
| | | .excludePathPatterns("/api/placeOrder/notifyUrlOne"); |
| | | } |
| | | |
| | | /** |
| | | * druidServlet注册 |
| | | */ |
| | | @Bean |
| | | public ServletRegistrationBean druidServletRegistration() { |
| | | ServletRegistrationBean registration = new ServletRegistrationBean(new StatViewServlet()); |
| | | registration.addUrlMappings("/druid/*"); |
| | | return registration; |
| | | } |
| | | |
| | | /** |
| | | * druid监控 配置URI拦截策略 |
| | | */ |
| | | @Bean |
| | | public FilterRegistrationBean druidStatFilter() { |
| | | FilterRegistrationBean filterRegistrationBean = new FilterRegistrationBean(new WebStatFilter()); |
| | | //添加过滤规则. |
| | | filterRegistrationBean.addUrlPatterns("/*"); |
| | | //添加不需要忽略的格式信息. |
| | | filterRegistrationBean.addInitParameter( |
| | | "exclusions", "/static/*,*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid,/druid/*"); |
| | | //用于session监控页面的用户名显示 需要登录后主动将username注入到session里 |
| | | filterRegistrationBean.addInitParameter("principalSessionName", "username"); |
| | | return filterRegistrationBean; |
| | | } |
| | | |
| | | /** |
| | | * druid数据库连接池监控 |
| | | */ |
| | | @Bean |
| | | public DruidStatInterceptor druidStatInterceptor() { |
| | | return new DruidStatInterceptor(); |
| | | } |
| | | |
| | | @Bean |
| | | public JdkRegexpMethodPointcut druidStatPointcut() { |
| | | JdkRegexpMethodPointcut druidStatPointcut = new JdkRegexpMethodPointcut(); |
| | | String patterns = "com.stylefeng.guns.modular.*.service.*"; |
| | | //可以set多个 |
| | | druidStatPointcut.setPatterns(patterns); |
| | | return druidStatPointcut; |
| | | } |
| | | |
| | | /** |
| | | * druid数据库连接池监控 |
| | | */ |
| | | @Bean |
| | | public BeanTypeAutoProxyCreator beanTypeAutoProxyCreator() { |
| | | BeanTypeAutoProxyCreator beanTypeAutoProxyCreator = new BeanTypeAutoProxyCreator(); |
| | | beanTypeAutoProxyCreator.setTargetBeanType(DruidDataSource.class); |
| | | beanTypeAutoProxyCreator.setInterceptorNames("druidStatInterceptor"); |
| | | return beanTypeAutoProxyCreator; |
| | | } |
| | | |
| | | /** |
| | | * druid 为druidStatPointcut添加拦截 |
| | | * |
| | | * @return |
| | | */ |
| | | |
| | | @Autowired |
| | | private GunsProperties gunsProperties; |
| | | |
| | | /** |
| | | * 增加swagger的支持 |
| | | */ |
| | | @Override |
| | | public void addResourceHandlers(ResourceHandlerRegistry registry) { |
| | | if (gunsProperties.getSwaggerOpen()) { |
| | | registry.addResourceHandler("swagger-ui.html").addResourceLocations("classpath:/META-INF/resources/"); |
| | | registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 增加对rest api鉴权的spring mvc拦截器 |
| | | */ |
| | | //舍弃原有的权限校验功能 |
| | | // @Override |
| | | // public void addInterceptors(InterceptorRegistry registry) { |
| | | // registry.addInterceptor(new RestApiInteceptor()).addPathPatterns("/api/**"); |
| | | // } |
| | | |
| | | /** |
| | | * druidServlet注册 |
| | | */ |
| | | @Bean |
| | | public ServletRegistrationBean druidServletRegistration() { |
| | | ServletRegistrationBean registration = new ServletRegistrationBean(new StatViewServlet()); |
| | | registration.addUrlMappings("/druid/*"); |
| | | return registration; |
| | | } |
| | | |
| | | /** |
| | | * druid监控 配置URI拦截策略 |
| | | */ |
| | | @Bean |
| | | public FilterRegistrationBean druidStatFilter() { |
| | | FilterRegistrationBean filterRegistrationBean = new FilterRegistrationBean(new WebStatFilter()); |
| | | //添加过滤规则. |
| | | filterRegistrationBean.addUrlPatterns("/*"); |
| | | //添加不需要忽略的格式信息. |
| | | filterRegistrationBean.addInitParameter( |
| | | "exclusions", "/static/*,*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid,/druid/*"); |
| | | //用于session监控页面的用户名显示 需要登录后主动将username注入到session里 |
| | | filterRegistrationBean.addInitParameter("principalSessionName", "username"); |
| | | return filterRegistrationBean; |
| | | } |
| | | |
| | | /** |
| | | * druid数据库连接池监控 |
| | | */ |
| | | @Bean |
| | | public BeanTypeAutoProxyCreator beanTypeAutoProxyCreator() { |
| | | BeanTypeAutoProxyCreator beanTypeAutoProxyCreator = new BeanTypeAutoProxyCreator(); |
| | | beanTypeAutoProxyCreator.setTargetBeanType(DruidDataSource.class); |
| | | beanTypeAutoProxyCreator.setInterceptorNames("druidStatInterceptor"); |
| | | return beanTypeAutoProxyCreator; |
| | | } |
| | | |
| | | /** |
| | | * druid 为druidStatPointcut添加拦截 |
| | | * |
| | | * @return |
| | | */ |
| | | @Bean |
| | | public Advisor druidStatAdvisor() { |
| | | return new DefaultPointcutAdvisor(druidStatPointcut(), druidStatInterceptor()); |
| | | } |
| | | |
| | | @Bean |
| | | public JdkRegexpMethodPointcut druidStatPointcut() { |
| | | JdkRegexpMethodPointcut druidStatPointcut = new JdkRegexpMethodPointcut(); |
| | | String patterns = "com.stylefeng.guns.modular.*.service.*"; |
| | | //可以set多个 |
| | | druidStatPointcut.setPatterns(patterns); |
| | | return druidStatPointcut; |
| | | } |
| | | |
| | | /** |
| | | * druid数据库连接池监控 |
| | | */ |
| | | @Bean |
| | | public DruidStatInterceptor druidStatInterceptor() { |
| | | return new DruidStatInterceptor(); |
| | | } |
| | | |
| | | /** |
| | | * xssFilter注册 |
| | |
| | | */ |
| | | @Bean |
| | | public DefaultKaptcha kaptcha() { |
| | | Properties properties = new Properties(); |
| | | properties.put("kaptcha.border", "no"); |
| | | properties.put("kaptcha.border.color", "105,179,90"); |
| | | properties.put("kaptcha.textproducer.font.color", "blue"); |
| | | properties.put("kaptcha.image.width", "125"); |
| | | properties.put("kaptcha.image.height", "45"); |
| | | properties.put("kaptcha.textproducer.font.size", "45"); |
| | | properties.put("kaptcha.session.key", "code"); |
| | | properties.put("kaptcha.textproducer.char.length", "4"); |
| | | properties.put("kaptcha.textproducer.font.names", "宋体,楷体,微软雅黑"); |
| | | Config config = new Config(properties); |
| | | DefaultKaptcha defaultKaptcha = new DefaultKaptcha(); |
| | | defaultKaptcha.setConfig(config); |
| | | return defaultKaptcha; |
| | | Properties properties = new Properties(); |
| | | properties.put("kaptcha.border", "no"); |
| | | properties.put("kaptcha.border.color", "105,179,90"); |
| | | properties.put("kaptcha.textproducer.font.color", "blue"); |
| | | properties.put("kaptcha.image.width", "125"); |
| | | properties.put("kaptcha.image.height", "45"); |
| | | properties.put("kaptcha.textproducer.font.size", "45"); |
| | | properties.put("kaptcha.session.key", "code"); |
| | | properties.put("kaptcha.textproducer.char.length", "4"); |
| | | properties.put("kaptcha.textproducer.font.names", "宋体,楷体,微软雅黑"); |
| | | Config config = new Config(properties); |
| | | DefaultKaptcha defaultKaptcha = new DefaultKaptcha(); |
| | | defaultKaptcha.setConfig(config); |
| | | return defaultKaptcha; |
| | | } |
| | | |
| | | |
| | | /********************黔云通单点登录拦截器**********************/ |
| | | |
| | | // @Override |
| | | // public void addViewControllers(ViewControllerRegistry registry) { |
| | | // registry.addViewController("/index").setViewName("index"); |
| | | // } |
| | | @Bean |
| | | public FilterRegistrationBean getOnconMDWebCasFilter() { |
| | | OnconMDWebCasFilter onconMDWebCasFilter = new OnconMDWebCasFilter(); |
| | | |
| | | FilterRegistrationBean registrationBean = new FilterRegistrationBean(); |
| | | registrationBean.setFilter(onconMDWebCasFilter); |
| | | List<String> urlPatterns = new ArrayList<String>(); |
| | | urlPatterns.add("/*");//拦截路径,可以添加多个 |
| | | registrationBean.setUrlPatterns(urlPatterns); |
| | | registrationBean.setOrder(2); |
| | | |
| | | registrationBean.addInitParameter("oncon.com.security.urls", "/api/**"); |
| | | registrationBean.addInitParameter("erp.si-tech.com.cn.noCheckUrl", "/index,/ajaxgetticket.jsp,/ssoAutologin.jsp,/login.jsp,/nologingetuserinfo.jsp,/toautologin.jsp,/autologin.jsp,/remotelogin.jsp,/toremotelogin.jsp,/js/**,/remoteloginajax.jsp"); |
| | | registrationBean.addInitParameter("erp.si-tech.com.cn.nologinstatus", "/*"); |
| | | registrationBean.addInitParameter("erp.si-tech.com.cn.loginstatus", "/login.jsp,/nologingetuserinfo.jsp"); |
| | | registrationBean.addInitParameter("com.oncon.sso.urlparams.nologin", "code,code2"); |
| | | |
| | | registrationBean.addInitParameter("edu.yale.its.tp.cas.client.filter.loginUrl", "https://testsso1.teamshub.com/login"); |
| | | registrationBean.addInitParameter("edu.yale.its.tp.cas.client.filter.validateUrl", "https://testsso1.teamshub.com/serviceValidate"); |
| | | registrationBean.addInitParameter("com.oncon.md.loginUrl", "https://testsso1.teamshub.com/sso-session/login"); |
| | | registrationBean.addInitParameter("edu.yale.its.tp.cas.client.filter.serverName", "172.26.200.34:9180"); |
| | | registrationBean.addInitParameter("edu.yale.its.tp.cas.client.filter.casServiceUrlForStatic", "http://172.26.200.34:9180/sso-springboot-client/getUserInfo"); |
| | | registrationBean.addInitParameter("edu.yale.its.tp.cas.client.filter.loginatUrlForStatic", ""); |
| | | registrationBean.addInitParameter("edu.yale.its.tp.cas.client.filter.loginFailedUrlForStatic", "http://172.26.200.34:9180/error.html"); |
| | | |
| | | |
| | | return registrationBean; |
| | | } |
| | | |
| | | @Bean |
| | | public FilterRegistrationBean getSingleSignOutFilter() { |
| | | SingleSignOutFilter singleSignOutFilter = new SingleSignOutFilter(); |
| | | FilterRegistrationBean registrationBean = new FilterRegistrationBean(); |
| | | registrationBean.setFilter(singleSignOutFilter); |
| | | List<String> urlPatterns = new ArrayList<String>(); |
| | | urlPatterns.add("/api/**");//拦截路径,可以添加多个 |
| | | registrationBean.setUrlPatterns(urlPatterns); |
| | | registrationBean.setOrder(1); |
| | | |
| | | registrationBean.addInitParameter("wmall.flag", "false"); |
| | | |
| | | return registrationBean; |
| | | } |
| | | |
| | | @Bean |
| | | public ServletListenerRegistrationBean<SingleSignOutHttpSessionListener> getSingleSignOutHttpSessionListener() { |
| | | ServletListenerRegistrationBean<SingleSignOutHttpSessionListener> servletListenerRegistrationBean |
| | | = new ServletListenerRegistrationBean<>(); |
| | | servletListenerRegistrationBean.setListener(new SingleSignOutHttpSessionListener()); |
| | | return servletListenerRegistrationBean; |
| | | } |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.stylefeng.guns.core.shiro.ShiroKit; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.modular.account.model.TBank; |
| | | import com.stylefeng.guns.modular.account.model.TBankNext; |
| | |
| | | import com.stylefeng.guns.modular.account.service.ITBankNextService; |
| | | import com.stylefeng.guns.modular.account.service.ITBankService; |
| | | import com.stylefeng.guns.modular.account.service.UserWithdrawalService; |
| | | import com.stylefeng.guns.modular.account.util.Base64Util; |
| | | import com.stylefeng.guns.modular.cloudPayment.example.BalanceAcctExample; |
| | | import com.stylefeng.guns.modular.cloudPayment.example.CusApplicationExample; |
| | | import com.stylefeng.guns.modular.cloudPayment.example.SettleAcctExample; |
| | | import com.stylefeng.guns.modular.cloudPayment.req.BalanceAcctReq; |
| | | import com.stylefeng.guns.modular.cloudPayment.req.UserBankAccountReq; |
| | | import com.stylefeng.guns.modular.system.model.BankCard; |
| | | import com.stylefeng.guns.modular.system.model.Driver; |
| | | import com.stylefeng.guns.modular.system.model.ElectronicLedger; |
| | | import com.stylefeng.guns.modular.system.model.UserWithdrawal; |
| | | import com.stylefeng.guns.modular.system.service.IBankCardService; |
| | | import com.stylefeng.guns.modular.system.service.IDriverService; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import com.unionpay.upyzt.resp.BalanceAcctStoreResp; |
| | | import com.unionpay.upyzt.resp.SettleAcctDeleteResp; |
| | | import com.unionpay.upyzt.resp.SettleAcctResp; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | |
| | | import org.springframework.transaction.annotation.Isolation; |
| | | import org.springframework.transaction.annotation.Propagation; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.util.StringUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | @Slf4j |
| | | @Api(tags = "司机绑卡-提现") |
| | |
| | | return ResultUtil.error(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | @ResponseBody |
| | | @RequestMapping(value = "/getCode", method = RequestMethod.POST) |
| | | @ApiOperation(value = "获取验证码", tags = {"司机端-获取验证码"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."), |
| | | }) |
| | | @Transactional(isolation = Isolation.READ_UNCOMMITTED,rollbackFor = Exception.class,propagation = Propagation.REQUIRED) |
| | | public ResultUtil getCode(String phone){ |
| | | try { |
| | | CusApplicationExample.smsCode(phone); |
| | | return ResultUtil.success(); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.error(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @RequestMapping(value = "/getBindCardList", method = RequestMethod.POST) |
| | | @ApiOperation(value = "获取银行卡", tags = {"司机端-获取银行卡"}, notes = "") |
| | |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.modular.account.service.ITEnterpriseWithdrawalService; |
| | | import com.stylefeng.guns.modular.account.service.UserWithdrawalService; |
| | | import com.stylefeng.guns.modular.account.unionpay.*; |
| | | import com.stylefeng.guns.modular.cloudPayment.example.*; |
| | | import com.stylefeng.guns.modular.cloudPayment.req.AllocationReq; |
| | | import com.stylefeng.guns.modular.cloudPayment.req.BalanceAcctReq; |
| | | import com.stylefeng.guns.modular.cloudPayment.req.DepositReq; |
| | | import com.stylefeng.guns.modular.cloudPayment.req.WithdrawalReq; |
| | | import com.stylefeng.guns.modular.account.unionpay.GetOpenBodySig; |
| | | import com.stylefeng.guns.modular.account.unionpay.NotifyDemo; |
| | | import com.stylefeng.guns.modular.account.unionpay.QrCodeConfiguration; |
| | | import com.stylefeng.guns.modular.account.unionpay.Util; |
| | | import com.stylefeng.guns.modular.crossCity.model.OrderCrossCity; |
| | | import com.stylefeng.guns.modular.crossCity.server.IOrderCrossCityService; |
| | | import com.stylefeng.guns.modular.enums.PaymentTypeEnum; |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.model.Reassign; |
| | | import com.stylefeng.guns.modular.system.service.*; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import com.unionpay.upyzt.exception.UpyztException; |
| | | import com.unionpay.upyzt.resp.*; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.PrintWriter; |
| | | import java.math.BigDecimal; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | |
| | | /** |
| | |
| | | // return "/WEB-INF/views/jsp/payResult.jsp"; |
| | | } |
| | | |
| | | // @ResponseBody |
| | | // @RequestMapping(value = "/api/placeOrder/appPayRecharge", method = RequestMethod.POST) |
| | | // @ApiOperation(value = "支付充值", tags = {"支付充值"}, notes = "") |
| | | // @ApiImplicitParams({ |
| | | // @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | // }) |
| | | public static void app(){ |
| | | DepositReq depositReq = new DepositReq(); |
| | | depositReq.setOutOrderNo(ToolUtil.getRandomString(32)); |
| | | //- |
| | | depositReq.setAmount(60000); // 支付金额 |
| | | depositReq.setBalanceAcctId("2008429872055963229"); |
| | | depositReq.setDepositType("1"); |
| | | depositReq.setPaymentType(PaymentTypeEnum.CUP_APP.getCode()); |
| | | //- |
| | | depositReq.setPaymentTradeNo("88890525-135"); |
| | | depositReq.setPaymentSucceededAt(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ").format(new Date())); |
| | | //- |
| | | depositReq.setOrderNo("88890525-135"); |
| | | depositReq.setOrderAmount(1L); |
| | | depositReq.setProductName("充值金额"); |
| | | depositReq.setProductCount(1); |
| | | depositReq.setNotifyUrl("http://zhentonggongsi.com:8010/api/placeOrder/notifyUrlOne"); |
| | | DepositResp depositResp = null; |
| | | try { |
| | | depositResp = DepositExample.create(depositReq); |
| | | } catch (UpyztException e) { |
| | | log.error(e.getMessage()); |
| | | e.printStackTrace(); |
| | | } |
| | | System.err.println(depositResp); |
| | | log.info("支付充值成功:{}",depositResp); |
| | | } |
| | | |
| | | // @ResponseBody |
| | | // @RequestMapping(value = "/api/placeOrder/queryApp", method = RequestMethod.POST) |
| | | // @ApiOperation(value = "支付充值查询", tags = {"支付充值查询"}, notes = "") |
| | | // @ApiImplicitParams({ |
| | | // @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | // }) |
| | | public void queryApp(){ |
| | | DepositResp balanceAcctResp = null; |
| | | try { |
| | | balanceAcctResp = DepositExample.retrieveById("2008429872055963229"); |
| | | System.err.println(balanceAcctResp); |
| | | } catch (UpyztException e) { |
| | | log.error("电子账簿查询失败:{}",e.getMessage()); |
| | | e.printStackTrace(); |
| | | } |
| | | log.info("电子账簿查询完成=========:{}",balanceAcctResp); |
| | | } |
| | | |
| | | |
| | | // @ResponseBody |
| | | // @RequestMapping(value = "/api/placeOrder/fenZhang", method = RequestMethod.POST) |
| | | // @ApiOperation(value = "分账", tags = {"分账"}, notes = "") |
| | | // @ApiImplicitParams({ |
| | | // @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | // }) |
| | | public void fenZhang(){ |
| | | log.info("平台分账到司机电子账簿========="); |
| | | AllocationReq allocationReq = userWithdrawalService.createAllocationReq("2007942595542621717", "2007942320163036794", 1,"123456"); |
| | | allocationReq.setOrderNo("202304041039329889826910"); |
| | | allocationReq.setPassword("123456"); |
| | | allocationReq.setOrderAmount(1L); |
| | | allocationReq.setProductName("测试退货5(1111)"); |
| | | allocationReq.setProductCount(1); |
| | | AllocationResp allocationResp = null; |
| | | try { |
| | | allocationResp = AllocationExample.create(allocationReq); |
| | | } catch (UpyztException e) { |
| | | log.error("平台分账到司机电子账簿失败:{}",e.getMessage()); |
| | | e.printStackTrace(); |
| | | } |
| | | log.info("平台分账到司机电子账簿完成=========:{}",allocationResp); |
| | | } |
| | | // @ResponseBody |
| | | // @RequestMapping(value = "/api/placeOrder/dianZi", method = RequestMethod.POST) |
| | | // @ApiOperation(value = "电子账簿查询", tags = {"电子账簿查询"}, notes = "") |
| | | // @ApiImplicitParams({ |
| | | // @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | // }) |
| | | public void dianZi(){ |
| | | BalanceAcctListResp balanceAcctListResp = null; |
| | | try { |
| | | BalanceAcctReq balanceAcctReq = new BalanceAcctReq(); |
| | | balanceAcctReq.setMchId("1008427961477222943"); |
| | | balanceAcctListResp = BalanceAcctExample.retrieveByUserId(balanceAcctReq); |
| | | System.err.println(balanceAcctListResp); |
| | | } catch (UpyztException e) { |
| | | log.error("电子账簿查询失败:{}",e.getMessage()); |
| | | e.printStackTrace(); |
| | | } |
| | | log.info("电子账簿查询完成=========:{}",balanceAcctListResp); |
| | | } |
| | | |
| | | // @ResponseBody |
| | | // @RequestMapping(value = "/api/placeOrder/tiXian", method = RequestMethod.POST) |
| | | // @ApiOperation(value = "提现", tags = {"提现"}, notes = "") |
| | | // @ApiImplicitParams({ |
| | | // @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | // }) |
| | | public void tiXian(){ |
| | | WithdrawalResp balanceAcctResp = null; |
| | | try { |
| | | |
| | | /*params.put("out_order_no", withdrawalReq.getOutOrderNo()); |
| | | params.put("amount", withdrawalReq.getAmount()); |
| | | params.put("balance_acct_id", withdrawalReq.getBalanceAcctId()); |
| | | params.put("bank_acct_no", Upyzt.encryptField(withdrawalReq.getBankAcctNo())); |
| | | params.put("password", Upyzt.encryptField(withdrawalReq.getPassword()));*/ |
| | | WithdrawalReq withdrawalReq = new WithdrawalReq(); |
| | | withdrawalReq.setOutOrderNo(ToolUtil.getRandomString(32)); |
| | | withdrawalReq.setAmount(1); |
| | | withdrawalReq.setBalanceAcctId("2007942320163036794"); |
| | | withdrawalReq.setBankAcctNo("149245719387"); |
| | | withdrawalReq.setPassword("123456"); |
| | | balanceAcctResp = WithdrawalExample.create(withdrawalReq); |
| | | System.err.println(balanceAcctResp); |
| | | } catch (UpyztException e) { |
| | | System.err.println("提现失败:{}"+e.getMessage()); |
| | | e.printStackTrace(); |
| | | } |
| | | log.info("提现完成=========:{}",balanceAcctResp); |
| | | } |
| | | |
| | | // @ResponseBody |
| | | // @RequestMapping(value = "/api/placeOrder/tiXianQuery", method = RequestMethod.POST) |
| | | // @ApiOperation(value = "提现查询", tags = {"提现查询"}, notes = "") |
| | | // @ApiImplicitParams({ |
| | | // @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | // }) |
| | | public void tiXianQuery(){ |
| | | WithdrawalResp balanceAcctResp = null; |
| | | try { |
| | | balanceAcctResp = WithdrawalExample.retrieveById("3708203534784717899"); |
| | | System.err.println(balanceAcctResp); |
| | | } catch (UpyztException e) { |
| | | System.err.println("提现失败:{}"+e.getMessage()); |
| | | e.printStackTrace(); |
| | | } |
| | | log.info("提现完成=========:{}",balanceAcctResp); |
| | | } |
| | | |
| | | } |
| | |
| | | package com.stylefeng.guns.modular.account.controller; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.modular.account.model.TBankNext; |
| | | import com.stylefeng.guns.modular.account.req.UserWithdrawalReq; |
| | | import com.stylefeng.guns.modular.account.service.*; |
| | | import com.stylefeng.guns.modular.account.util.Base64Util; |
| | | import com.stylefeng.guns.modular.cloudPayment.example.*; |
| | | import com.stylefeng.guns.modular.cloudPayment.req.AllocationReq; |
| | | import com.stylefeng.guns.modular.cloudPayment.req.BalanceAcctReq; |
| | | import com.stylefeng.guns.modular.cloudPayment.req.UserBankAccountReq; |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.account.service.ElectronicLedgerService; |
| | | import com.stylefeng.guns.modular.account.service.ITBankNextService; |
| | | import com.stylefeng.guns.modular.account.service.UserBankAccountService; |
| | | import com.stylefeng.guns.modular.account.service.UserWithdrawalService; |
| | | import com.stylefeng.guns.modular.system.model.Company; |
| | | import com.stylefeng.guns.modular.system.model.Driver; |
| | | import com.stylefeng.guns.modular.system.model.ElectronicLedger; |
| | | import com.stylefeng.guns.modular.system.model.UserWithdrawal; |
| | | import com.stylefeng.guns.modular.system.service.IBankCardService; |
| | | import com.stylefeng.guns.modular.system.service.ICompanyService; |
| | | import com.stylefeng.guns.modular.system.service.IDriverService; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import com.unionpay.upyzt.exception.InvalidRequestException; |
| | | import com.unionpay.upyzt.exception.UpyztException; |
| | | import com.unionpay.upyzt.param.FailureMsgParam; |
| | | import com.unionpay.upyzt.resp.*; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.transaction.annotation.Isolation; |
| | | import org.springframework.transaction.annotation.Propagation; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.util.StringUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | |
| | | this.bankNextService = bankNextService; |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @RequestMapping(value = "/addElectronicLedger", method = RequestMethod.POST) |
| | | @ApiOperation(value = "司机进件(提现账户设置)", tags = {"司机端-司机进件(提现账户设置)"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | @Transactional(isolation = Isolation.READ_UNCOMMITTED,rollbackFor = Exception.class,propagation = Propagation.REQUIRED) |
| | | public ResultUtil addElectronicLedger(UserWithdrawalReq userWithdrawalReq, HttpServletRequest request){ |
| | | System.out.println(userWithdrawalReq); |
| | | if(StringUtils.hasLength(userWithdrawalReq.getBankName())){ |
| | | userWithdrawalReq.setBankName(userWithdrawalReq.getBankName().replace("& #40;","(")); |
| | | userWithdrawalReq.setBankName(userWithdrawalReq.getBankName().replace("& #41;",")")); |
| | | } |
| | | |
| | | userWithdrawalReq.setCopy1(userWithdrawalReq.getCopy1().replaceAll(" ","+")); |
| | | userWithdrawalReq.setCopy2(userWithdrawalReq.getCopy2().replaceAll(" ","+")); |
| | | // 用户进件 |
| | | // 获取当前用户id |
| | | Integer driverId = null; |
| | | try { |
| | | driverId = driverService.getUserIdFormRedis(request); |
| | | } catch (Exception e) { |
| | | return ResultUtil.error(e.getMessage()); |
| | | } |
| | | if(null == driverId){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | // 查询司机 |
| | | // Driver driver = driverService.selectById(id); |
| | | |
| | | userWithdrawalReq.setOutRequestNo(ToolUtil.getRandomString(32)); |
| | | UserWithdrawal userWithdrawal = new UserWithdrawal(); |
| | | BeanUtils.copyProperties(userWithdrawalReq,userWithdrawal); |
| | | |
| | | String password = userWithdrawal.getTransactionAuthorizationCode(); |
| | | userWithdrawal.setOutRequestNo(ToolUtil.getRandomString(32)); |
| | | try { |
| | | // 司机进件 |
| | | CusApplicationResp cusApplicationResp = CusApplicationExample.create(userWithdrawalReq); |
| | | System.out.println(cusApplicationResp); |
| | | // 交易授权码加密,并保存司机进件信息 |
| | | userWithdrawal.setTransactionAuthorizationCode(Base64Util.encode(userWithdrawal.getTransactionAuthorizationCode())); |
| | | // userWithdrawal.setUserId(userWithdrawal.getUserId()); |
| | | userWithdrawal.setUserId(driverId); |
| | | userWithdrawal.setUserType(2); |
| | | userWithdrawal.setImgUrl(userWithdrawalReq.getIdCardFrontPicture()); |
| | | userWithdrawal.setImgUrlOne(userWithdrawalReq.getIdCardReversePicture()); |
| | | userWithdrawal.setIdCardFrontPicture(userWithdrawalReq.getCopy1()); |
| | | userWithdrawal.setIdCardReversePicture(userWithdrawalReq.getCopy2()); |
| | | userWithdrawalService.insert(userWithdrawal); |
| | | |
| | | // 通过司机进件信息封装银行卡信息进行数据库存储 |
| | | BankCard bankCard = userBankAccountService.userWithdrawalToBankCard(userWithdrawal); |
| | | bankCardService.insert(bankCard); |
| | | // 添加用户银行卡 |
| | | UserBankAccount userBankAccount = userBankAccountService.userWithdrawalToUserBankAccount(userWithdrawal); |
| | | userBankAccountService.insert(userBankAccount); |
| | | |
| | | // 判断是否开户成功 |
| | | if("succeeded".equals(cusApplicationResp.getApplicationStatus())){ |
| | | |
| | | // 开户将司机进件返回的信息进行保存 |
| | | userWithdrawalService.cusApplicationRespToUserWithdrawal(userWithdrawal,cusApplicationResp); |
| | | userWithdrawalService.updateById(userWithdrawal); |
| | | System.out.println("开户将司机进件返回的信息"); |
| | | // 开户成功,开通电子账户,绑定账户 |
| | | // 开通电子账簿 |
| | | // BalanceAcctReq balanceAcctReq = electronicLedgerService.createBalanceAcctReq(userWithdrawal.getCusId(),password); |
| | | // BalanceAcctStoreResp balanceAcctStoreResp = BalanceAcctExample.create(balanceAcctReq); |
| | | |
| | | // 开通电子账簿成功,封装实体 |
| | | ElectronicLedger electronicLedger = electronicLedgerService.createElectronicLedger(cusApplicationResp,userWithdrawal,password); |
| | | System.out.println("开通电子账簿成功,封装实体11111"); |
| | | electronicLedgerService.insert(electronicLedger); |
| | | System.out.println("开通电子账簿成功,封装实体22222"); |
| | | |
| | | // 绑定银行卡 |
| | | // UserBankAccountReq userBankAccountReq = electronicLedgerService.createUserBankAccountReq(bankCard,userWithdrawal.getCusId(),userWithdrawal.getCode()); |
| | | // SettleAcctResp settleAcctResp = SettleAcctExample.create(userBankAccountReq); |
| | | |
| | | // 保存绑定银行卡返回信息 |
| | | // bankCard.setVerifyStatus(settleAcctResp.getVerifyStatus()); |
| | | // bankCard.setSettleAcctId(settleAcctResp.getSettleAcctId()); |
| | | // bankCard.setAcctValidationFailureMsg(settleAcctResp.getAcctValidationFailureMsg()); |
| | | // bankCard.setAcctValidationFinishedAt(settleAcctResp.getAcctValidationFinishedAt()); |
| | | // bankCardService.updateById(bankCard); |
| | | return ResultUtil.success(); |
| | | } |
| | | if("failed".equals(cusApplicationResp.getApplicationStatus())){ |
| | | List<FailureMsgParam> failureMsgs = cusApplicationResp.getFailureMsgs(); |
| | | if(failureMsgs != null && failureMsgs.size()>0){ |
| | | return ResultUtil.error(failureMsgs.get(0).getReason()); |
| | | } |
| | | } |
| | | return ResultUtil.success(); |
| | | }catch (UpyztException e){ |
| | | e.printStackTrace(); |
| | | if(e.getCode().equals("100101")){ |
| | | return ResultUtil.error(e.getIssue()); |
| | | } |
| | | return ResultUtil.error(e.getMessage()); |
| | | } catch (Exception e){ |
| | | return ResultUtil.error(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | @ResponseBody |
| | | @RequestMapping(value = "/updateElectronicLedgerInfo", method = RequestMethod.POST) |
| | | @ApiOperation(value = "司机修改进件信息", tags = {"司机端-司机修改进件信息"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | @Transactional(isolation = Isolation.READ_UNCOMMITTED,rollbackFor = Exception.class,propagation = Propagation.REQUIRED) |
| | | public ResultUtil updateElectronicLedgerInfo(String idCardFrontPicture, |
| | | String idCardReversePicture, |
| | | String certificateCode, |
| | | String certificateName, |
| | | String certificateExpireTime, |
| | | String openAccountName, |
| | | String bankCardCode, |
| | | String bankCode, |
| | | String bankBranchCode, |
| | | String phone, |
| | | String code, |
| | | String copy1, |
| | | String copy2, |
| | | HttpServletRequest request){ |
| | | try { |
| | | Integer driverId = driverService.getUserIdFormRedis(request); |
| | | if(null == driverId){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | Driver driver = driverService.selectById(driverId); |
| | | // TODO 司机进件信息 |
| | | UserWithdrawal userWithdrawal1 = userWithdrawalService.selectOne(new EntityWrapper<UserWithdrawal>() |
| | | .eq("phone",driver.getPhone()) |
| | | .last("LIMIT 1")); |
| | | if(Objects.isNull(userWithdrawal1)){ |
| | | return ResultUtil.error("请先进行个人用户进件信息填写"); |
| | | } |
| | | TBankNext bankNext = bankNextService.selectOne(new EntityWrapper<TBankNext>() |
| | | .eq("bankCode", bankBranchCode) |
| | | .last("LIMIT 1")); |
| | | UserWithdrawal userWithdrawal = new UserWithdrawal(); |
| | | if(Objects.nonNull(bankNext)){ |
| | | userWithdrawal1.setBankName(bankNext.getBankName()); |
| | | } |
| | | |
| | | BeanUtils.copyProperties(userWithdrawal1,userWithdrawal); |
| | | |
| | | userWithdrawal.setIdCardFrontPicture(copy1); |
| | | userWithdrawal.setIdCardReversePicture(copy2); |
| | | userWithdrawal.setImgUrl(idCardFrontPicture); |
| | | userWithdrawal.setImgUrlOne(idCardReversePicture); |
| | | userWithdrawal.setCertificateCode(certificateCode); |
| | | userWithdrawal.setCertificateName(certificateName); |
| | | userWithdrawal.setCertificateExpireTime(certificateExpireTime); |
| | | userWithdrawal.setOpenAccountName(openAccountName); |
| | | userWithdrawal.setBankCardCode(bankCardCode); |
| | | userWithdrawal.setCusId(userWithdrawal1.getCusId()); |
| | | userWithdrawal.setPhone(phone); |
| | | userWithdrawal.setBankCode(bankCode); |
| | | userWithdrawal.setBankBranchCode(bankBranchCode); |
| | | userWithdrawal.setCode(code); |
| | | System.out.println(userWithdrawal); |
| | | CusApplicationResp renew = CusApplicationExample.renew(userWithdrawal); |
| | | System.out.println("修改个人用户进件信息返回:{}"+renew); |
| | | if("succeeded".equals(renew.getApplicationStatus())){ |
| | | System.out.println("修改成功"); |
| | | userWithdrawal1.setIdCardFrontPicture(copy1); |
| | | userWithdrawal1.setIdCardReversePicture(copy2); |
| | | userWithdrawal1.setImgUrl(idCardFrontPicture); |
| | | userWithdrawal1.setImgUrlOne(idCardReversePicture); |
| | | userWithdrawal1.setCertificateCode(certificateCode); |
| | | userWithdrawal1.setCertificateName(certificateName); |
| | | userWithdrawal1.setCertificateExpireTime(certificateExpireTime); |
| | | userWithdrawal1.setOpenAccountName(openAccountName); |
| | | userWithdrawal1.setBankCardCode(bankCardCode); |
| | | userWithdrawal1.setBankCode(bankCode); |
| | | userWithdrawal1.setBankBranchCode(bankBranchCode); |
| | | userWithdrawal1.setPhone(phone); |
| | | userWithdrawalService.updateById(userWithdrawal1); |
| | | // 修改成功 查询该银行卡是否存在 如果不存在则添加 |
| | | System.out.println("修改成功"); |
| | | int count = bankCardService.selectCount(new EntityWrapper<BankCard>() |
| | | .eq("code", bankCardCode) |
| | | .eq("status",true)); |
| | | System.out.println("查询该银行卡是否存在 如果不存在则添加"); |
| | | if(count<1){ |
| | | System.out.println("该银行卡不存在则添加"); |
| | | BankCard bankCard = userBankAccountService.userWithdrawalToBankCard(userWithdrawal); |
| | | bankCardService.insert(bankCard); |
| | | System.out.println("该银行卡添加成功"); |
| | | } |
| | | System.out.println("查询该银行卡账户是否存在"); |
| | | int count1 = userBankAccountService.selectCount(new EntityWrapper<UserBankAccount>() |
| | | .eq("bankCardCode", bankCardCode) |
| | | .eq("userType", 1) |
| | | .eq("status",true)); |
| | | if(count1<1){ |
| | | // 添加用户银行卡 |
| | | System.out.println("该银行卡账户不存在则添加"); |
| | | UserBankAccount userBankAccount = userBankAccountService.userWithdrawalToUserBankAccount(userWithdrawal); |
| | | userBankAccountService.insert(userBankAccount); |
| | | System.out.println("该银行卡账户添加成功"); |
| | | } |
| | | } |
| | | if("failed".equals(renew.getApplicationStatus())){ |
| | | List<FailureMsgParam> failureMsgs = renew.getFailureMsgs(); |
| | | if(failureMsgs != null && failureMsgs.size()>0){ |
| | | return ResultUtil.error(failureMsgs.get(0).getReason()); |
| | | } |
| | | } |
| | | return ResultUtil.success(); |
| | | }catch (UpyztException e){ |
| | | e.printStackTrace(); |
| | | if(e.getCode().equals("100101")){ |
| | | return ResultUtil.error(e.getIssue()); |
| | | } |
| | | return ResultUtil.error(e.getMessage()); |
| | | } catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.error(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | |
| | | .eq("userId", company.getId()) |
| | | .eq("userType", 3) |
| | | .last("LIMIT 1")); |
| | | try { |
| | | // 进行平台分账到司机电子账簿 |
| | | System.out.println("平台分账到司机电子账簿========="); |
| | | AllocationReq allocationReq = userWithdrawalService.createAllocationReq(userWithdrawal.getBalanceAcctId(), electronicLedger.getBalanceAcctId(), amount,userWithdrawal.getTransactionAuthorizationCode()); |
| | | AllocationResp allocationResp = AllocationExample.create(allocationReq); |
| | | System.out.println("平台分账到司机电子账簿完成=========:{}"+allocationResp); |
| | | |
| | | // 用户电子账簿进行提现操作 |
| | | WithdrawalResp withdrawalResp = WithdrawalExample.create(userWithdrawalService.createWithdrawalReq(userWithdrawal.getBalanceAcctId(), amount, userWithdrawal.getTransactionAuthorizationCode(), bankAcctNo)); |
| | | System.out.println("司机电子账簿提现完成=========:{}"+withdrawalResp); |
| | | return ResultUtil.success(); |
| | | }catch (Exception e){ |
| | | System.out.println("司机提现失败=========:{}"+e.getMessage()); |
| | | e.printStackTrace(); |
| | | return ResultUtil.error(e.getMessage()); |
| | | } |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | @ResponseBody |
| | |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil querySettledAmount(HttpServletRequest request){ |
| | | BalanceAcctListResp balanceAcctListResp = null; |
| | | // ElectronicLedger electronicLedger = null; |
| | | UserWithdrawal userWithdrawal = null; |
| | | try { |
| | | Integer driverId = driverService.getUserIdFormRedis(request); |
| | | Driver driver = driverService.selectById(driverId); |
| | | // 通过司机id查询开户信息, |
| | | // 司机进件信息 |
| | | // electronicLedger = electronicLedgerService.selectOne(new EntityWrapper<ElectronicLedger>() |
| | | // .eq("userId", driverId) |
| | | // .eq("userType", 2)); |
| | | userWithdrawal = userWithdrawalService.selectOne(new EntityWrapper<UserWithdrawal>() |
| | | .eq("phone", driver.getPhone()) |
| | | .eq("userType", 2) |
| | | .eq("applicationStatus","succeeded") |
| | | .last("LIMIT 1")); |
| | | if(Objects.isNull(userWithdrawal)){ |
| | | return ResultUtil.error("该司机开户信息为空"); |
| | | } |
| | | BalanceAcctReq balanceAcctReq = new BalanceAcctReq(); |
| | | balanceAcctReq.setCusId(userWithdrawal.getCusId()); |
| | | balanceAcctListResp = BalanceAcctExample.retrieveByUserId(balanceAcctReq); |
| | | System.err.println(balanceAcctListResp); |
| | | } catch (Exception e) { |
| | | log.error("电子账簿可提现余额查询失败:{}",e.getMessage()); |
| | | e.printStackTrace(); |
| | | } |
| | | if(Objects.isNull(balanceAcctListResp)){ |
| | | log.error("电子账簿可提现余额查询失败"); |
| | | return ResultUtil.error("电子账簿可提现余额查询失败"); |
| | | } |
| | | log.info("电子账簿可提现余额查询完成=========:{}",balanceAcctListResp); |
| | | List<BalanceAcctItem> balanceAccts = balanceAcctListResp.getBalanceAccts(); |
| | | if(CollectionUtils.isEmpty(balanceAccts)){ |
| | | log.error("电子账簿可提现余额查询失败"); |
| | | return ResultUtil.error("电子账簿可提现余额查询失败"); |
| | | } |
| | | for (BalanceAcctItem balanceAcct : balanceAccts) { |
| | | if(userWithdrawal.getBalanceAcctId().equals(balanceAcct.getBalanceAcctId())){ |
| | | return ResultUtil.success(new BigDecimal(balanceAcct.getSettledAmount()).divide(new BigDecimal(100))); |
| | | } |
| | | } |
| | | |
| | | return ResultUtil.success(BigDecimal.ZERO); |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @RequestMapping(value = "/uploadImg", method = RequestMethod.POST) |
| | | @ApiOperation(value = "进件上传图片", tags = {"司机端-进件上传图片"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | }) |
| | | @Transactional(isolation = Isolation.READ_UNCOMMITTED,rollbackFor = Exception.class,propagation = Propagation.REQUIRED) |
| | | public ResultUtil uploadImg(MultipartFile multipartFile, HttpServletRequest request){ |
| | | try { |
| | | MediaResp mediaResp = MediaExample.uploadImage(multipartFile); |
| | | System.out.println(mediaResp); |
| | | String mediaId = mediaResp.getMediaId(); |
| | | return ResultUtil.success(mediaId); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.error(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | package com.stylefeng.guns.modular.account.schedule; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.stylefeng.guns.modular.account.service.UserWithdrawalService; |
| | | import com.stylefeng.guns.modular.cloudPayment.example.BalanceAcctExample; |
| | | import com.stylefeng.guns.modular.cloudPayment.example.CusApplicationExample; |
| | | import com.stylefeng.guns.modular.cloudPayment.example.SettleAcctExample; |
| | | import com.stylefeng.guns.modular.cloudPayment.example.WithdrawalExample; |
| | | import com.stylefeng.guns.modular.cloudPayment.req.BalanceAcctReq; |
| | | import com.stylefeng.guns.modular.cloudPayment.req.UserBankAccountReq; |
| | | import com.stylefeng.guns.modular.system.model.ElectronicLedger; |
| | | import com.stylefeng.guns.modular.system.model.UserWithdrawal; |
| | | import com.unionpay.upyzt.exception.UpyztException; |
| | | import com.unionpay.upyzt.resp.BalanceAcctStoreResp; |
| | | import com.unionpay.upyzt.resp.CusApplicationResp; |
| | | import com.unionpay.upyzt.resp.SettleAcctResp; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.EnableScheduling; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Slf4j |
| | | @Component |
| | |
| | | */ |
| | | @Scheduled(cron = "0 0/1 * * * ? ") |
| | | private void configureTasks() { |
| | | List<UserWithdrawal> userWithdrawals = userWithdrawalService.selectList(new EntityWrapper<UserWithdrawal>() |
| | | .eq("userType", 2) |
| | | .ne("applicationStatus", "succeeded")); |
| | | if(!CollectionUtils.isEmpty(userWithdrawals)){ |
| | | for (UserWithdrawal userWithdrawal : userWithdrawals) { |
| | | try { |
| | | CusApplicationResp cusApplicationResp = CusApplicationExample.retrieveById(userWithdrawal.getCusApplicationId()); |
| | | // 开户将司机进件返回的信息进行保存 |
| | | userWithdrawalService.cusApplicationRespToUserWithdrawal(userWithdrawal,cusApplicationResp); |
| | | userWithdrawalService.updateById(userWithdrawal); |
| | | |
| | | // 开户成功,开通电子账户,绑定账户 |
| | | // 开通电子账簿 |
| | | /*BalanceAcctReq balanceAcctReq = electronicLedgerService.createBalanceAcctReq(userWithdrawal.getCusId(),password); |
| | | BalanceAcctStoreResp balanceAcctStoreResp = BalanceAcctExample.create(balanceAcctReq); |
| | | |
| | | // 开通电子账簿成功,封装实体 |
| | | ElectronicLedger electronicLedger = electronicLedgerService.createElectronicLedger(balanceAcctStoreResp,userWithdrawal,password); |
| | | electronicLedgerService.insert(electronicLedger); |
| | | |
| | | // 绑定银行卡 |
| | | UserBankAccountReq userBankAccountReq = electronicLedgerService.createUserBankAccountReq(bankCard,userWithdrawal.getCusId(),userWithdrawal.getCode()); |
| | | SettleAcctResp settleAcctResp = SettleAcctExample.create(userBankAccountReq); |
| | | |
| | | // 保存绑定银行卡返回信息 |
| | | bankCard.setVerifyStatus(settleAcctResp.getVerifyStatus()); |
| | | bankCard.setSettleAcctId(settleAcctResp.getSettleAcctId()); |
| | | bankCard.setAcctValidationFailureMsg(settleAcctResp.getAcctValidationFailureMsg()); |
| | | bankCard.setAcctValidationFinishedAt(settleAcctResp.getAcctValidationFinishedAt()); |
| | | bankCardService.updateById(bankCard);*/ |
| | | } catch (UpyztException e) { |
| | | log.error("个人用户进件状态查询(系统订单号)失败:{}",e.getMessage()); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | package com.stylefeng.guns.modular.account.service; |
| | | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.stylefeng.guns.modular.cloudPayment.req.BalanceAcctReq; |
| | | import com.stylefeng.guns.modular.cloudPayment.req.UserBankAccountReq; |
| | | import com.stylefeng.guns.modular.system.model.BankCard; |
| | | import com.stylefeng.guns.modular.system.model.ElectronicLedger; |
| | | import com.stylefeng.guns.modular.system.model.UserWithdrawal; |
| | | import com.unionpay.upyzt.resp.BalanceAcctStoreResp; |
| | | import com.unionpay.upyzt.resp.CusApplicationResp; |
| | | |
| | | public interface ElectronicLedgerService extends IService<ElectronicLedger> { |
| | | |
| | | /** |
| | | * 封装开通电子账簿的请求体 |
| | | * @param cusId 司机个人用户号 |
| | | * @param password 交易授权码 |
| | | * @return |
| | | */ |
| | | BalanceAcctReq createBalanceAcctReq(String cusId, String password); |
| | | |
| | | /** |
| | | * 封装电子账簿实体 |
| | | * @param cusApplicationResp |
| | | * @param userWithdrawal |
| | | * @return |
| | | */ |
| | | ElectronicLedger createElectronicLedger(CusApplicationResp cusApplicationResp, UserWithdrawal userWithdrawal, String password); |
| | | |
| | | /** |
| | | * 封装绑定银行卡参数 |
| | | * @param bankCard |
| | | * @return |
| | | */ |
| | | UserBankAccountReq createUserBankAccountReq(BankCard bankCard,String cusId,String code); |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | package com.stylefeng.guns.modular.account.service; |
| | | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.stylefeng.guns.modular.cloudPayment.req.AllocationReq; |
| | | import com.stylefeng.guns.modular.cloudPayment.req.WithdrawalReq; |
| | | import com.stylefeng.guns.modular.system.model.UserWithdrawal; |
| | | import com.unionpay.upyzt.resp.CusApplicationResp; |
| | | |
| | | public interface UserWithdrawalService extends IService<UserWithdrawal> { |
| | | |
| | | /** |
| | | * 封装司机进件返回的数据 |
| | | * @param cusApplicationResp |
| | | */ |
| | | void cusApplicationRespToUserWithdrawal(UserWithdrawal userWithdrawal,CusApplicationResp cusApplicationResp); |
| | | |
| | | /** |
| | | * 封装分账实体 |
| | | * @param balanceAcctId 收款方电子账簿 |
| | | * @param companyBalanceAcctId 付款方电子账簿 |
| | | * @param amount 金额 |
| | | * @return |
| | | */ |
| | | AllocationReq createAllocationReq(String balanceAcctId, String companyBalanceAcctId, Integer amount,String password); |
| | | |
| | | /** |
| | | * 封装提现实体 |
| | | * @param balanceAcctId 体现账户电子账簿 |
| | | * @param amount 金额 |
| | | * @param password 密码 |
| | | * @param code 银行账号 |
| | | * @return |
| | | */ |
| | | WithdrawalReq createWithdrawalReq(String balanceAcctId, Integer amount, String password, String code); |
| | | |
| | | /** |
| | | * 司机提现 |
| | |
| | | package com.stylefeng.guns.modular.account.service.impl; |
| | | |
| | | import cn.hutool.crypto.SecureUtil; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.modular.account.dao.ElectronicLedgerMapper; |
| | | import com.stylefeng.guns.modular.account.service.ElectronicLedgerService; |
| | | import com.stylefeng.guns.modular.cloudPayment.req.BalanceAcctReq; |
| | | import com.stylefeng.guns.modular.cloudPayment.req.UserBankAccountReq; |
| | | import com.stylefeng.guns.modular.system.model.BankCard; |
| | | import com.stylefeng.guns.modular.system.model.ElectronicLedger; |
| | | import com.stylefeng.guns.modular.system.model.UserWithdrawal; |
| | | import com.unionpay.upyzt.resp.BalanceAcctStoreResp; |
| | | import com.unionpay.upyzt.resp.CusApplicationResp; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | | |
| | | |
| | | @Service |
| | | public class ElectronicLedgerServiceImpl extends ServiceImpl<ElectronicLedgerMapper, ElectronicLedger> implements ElectronicLedgerService { |
| | | |
| | | @Override |
| | | public BalanceAcctReq createBalanceAcctReq(String cusId, String password) { |
| | | BalanceAcctReq balanceAcctReq = new BalanceAcctReq(); |
| | | balanceAcctReq.setOutRequestNo(ToolUtil.getRandomString(32)); |
| | | balanceAcctReq.setCusId(cusId); |
| | | balanceAcctReq.setPassword(password); |
| | | return balanceAcctReq; |
| | | } |
| | | |
| | | @Override |
| | | public ElectronicLedger createElectronicLedger(CusApplicationResp cusApplicationResp, UserWithdrawal userWithdrawal, String password) { |
| | | ElectronicLedger electronicLedger = new ElectronicLedger(); |
| | | electronicLedger.setBalanceAcctId(cusApplicationResp.getBalanceAcctId()); |
| | | electronicLedger.setCreateTime(new Date()); |
| | | electronicLedger.setCusId(cusApplicationResp.getCusId()); |
| | | electronicLedger.setOutRequestNo(cusApplicationResp.getOutRequestNo()); |
| | | electronicLedger.setUserId(userWithdrawal.getUserId()); |
| | | electronicLedger.setPassword(SecureUtil.md5(password)); |
| | | electronicLedger.setRelAcctNo(cusApplicationResp.getRelAcctNo()); |
| | | electronicLedger.setUserType(userWithdrawal.getUserType()); |
| | | return electronicLedger; |
| | | } |
| | | |
| | | @Override |
| | | public UserBankAccountReq createUserBankAccountReq(BankCard bankCard,String cusId,String code) { |
| | | UserBankAccountReq userBankAccountReq = new UserBankAccountReq(); |
| | | userBankAccountReq.setBankCode(bankCard.getBankCode()); |
| | | userBankAccountReq.setBankAcctType(bankCard.getBankAcctType()); |
| | | userBankAccountReq.setBankBranchCode(bankCard.getBankBranchCode()); |
| | | userBankAccountReq.setBankCardCode(bankCard.getCode()); |
| | | userBankAccountReq.setPhone(bankCard.getPhone()); |
| | | userBankAccountReq.setOutRequestNo(bankCard.getOutRequestNo()); |
| | | userBankAccountReq.setCusId(cusId); |
| | | userBankAccountReq.setCode(code); |
| | | return userBankAccountReq; |
| | | } |
| | | } |
| | |
| | | package com.stylefeng.guns.modular.account.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.modular.account.dao.UserWithdrawalMapper; |
| | | import com.stylefeng.guns.modular.account.service.UserWithdrawalService; |
| | | import com.stylefeng.guns.modular.cloudPayment.req.AllocationReq; |
| | | import com.stylefeng.guns.modular.cloudPayment.req.WithdrawalReq; |
| | | import com.stylefeng.guns.modular.system.model.UserWithdrawal; |
| | | import com.unionpay.upyzt.resp.CusApplicationResp; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | @Slf4j |
| | | @Service |
| | | public class UserWithdrawalServiceImpl extends ServiceImpl<UserWithdrawalMapper, UserWithdrawal> implements UserWithdrawalService { |
| | | |
| | | @Override |
| | | public void cusApplicationRespToUserWithdrawal(UserWithdrawal userWithdrawal,CusApplicationResp cusApplicationResp) { |
| | | userWithdrawal.setApplicationStatus(cusApplicationResp.getApplicationStatus()); |
| | | userWithdrawal.setCusId(cusApplicationResp.getCusId()); |
| | | userWithdrawal.setSucceededAt(cusApplicationResp.getSucceededAt()); |
| | | if(!CollectionUtils.isEmpty(cusApplicationResp.getFailureMsgs())){ |
| | | userWithdrawal.setFailureMsgsReason(cusApplicationResp.getFailureMsgs().get(0).getReason()); |
| | | } |
| | | userWithdrawal.setRelAcctNo(cusApplicationResp.getRelAcctNo()); |
| | | userWithdrawal.setBindAcctName(cusApplicationResp.getBindAcctName()); |
| | | userWithdrawal.setBalanceAcctId(cusApplicationResp.getBalanceAcctId()); |
| | | userWithdrawal.setSettleAcctId(cusApplicationResp.getSettleAcctId()); |
| | | userWithdrawal.setCusApplicationId(cusApplicationResp.getCusApplicationId()); |
| | | // 审核通过 |
| | | } |
| | | |
| | | @Override |
| | | public AllocationReq createAllocationReq(String balanceAcctId, String companyBalanceAcctId, Integer amount,String password) { |
| | | AllocationReq allocationReq = new AllocationReq(); |
| | | allocationReq.setOutOrderNo(ToolUtil.getRandomString(32)); |
| | | allocationReq.setPayBalanceAcctId(companyBalanceAcctId); |
| | | allocationReq.setRecvBalanceAcctId(balanceAcctId); |
| | | allocationReq.setAmount(amount*100); |
| | | allocationReq.setOrderNo(ToolUtil.getRandomString(32)); |
| | | allocationReq.setPassword(password); |
| | | allocationReq.setOrderAmount(Long.valueOf(amount)); |
| | | allocationReq.setProductName("司机提现"); |
| | | allocationReq.setProductCount(1); |
| | | return allocationReq; |
| | | } |
| | | |
| | | @Override |
| | | public WithdrawalReq createWithdrawalReq(String balanceAcctId, Integer amount, String password, String code) { |
| | | WithdrawalReq withdrawalReq = new WithdrawalReq(); |
| | | withdrawalReq.setOutOrderNo(ToolUtil.getRandomString(32)); |
| | | withdrawalReq.setBalanceAcctId(balanceAcctId); |
| | | withdrawalReq.setAmount(amount*100); |
| | | withdrawalReq.setBankAcctNo(code); |
| | | withdrawalReq.setPassword(password); |
| | | return withdrawalReq; |
| | | } |
| | | |
| | | @Override |
| | | public Boolean withdrawDeposit(Integer amount, String bankAcctNo, String withdrawPassword) { |
| | |
| | | package com.stylefeng.guns.modular.api; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.stylefeng.guns.core.exception.GunsException; |
| | | import com.stylefeng.guns.core.exception.ServiceExceptionEnum; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.modular.account.model.TEnterpriseWithdrawal; |
| | | import com.stylefeng.guns.modular.account.service.ITEnterpriseWithdrawalService; |
| | | import com.stylefeng.guns.modular.account.service.UserWithdrawalService; |
| | | import com.stylefeng.guns.modular.account.util.Base64Util; |
| | | import com.stylefeng.guns.modular.cloudPayment.example.AllocationExample; |
| | | import com.stylefeng.guns.modular.cloudPayment.example.DepositExample; |
| | | import com.stylefeng.guns.modular.cloudPayment.req.AllocationReq; |
| | | import com.stylefeng.guns.modular.cloudPayment.req.DepositReq; |
| | | import com.stylefeng.guns.modular.enums.PaymentTypeEnum; |
| | | import com.stylefeng.guns.modular.system.model.Company; |
| | | import com.stylefeng.guns.modular.system.model.Driver; |
| | | import com.stylefeng.guns.modular.system.model.Reassign; |
| | | import com.stylefeng.guns.modular.system.model.UserWithdrawal; |
| | | import com.stylefeng.guns.modular.system.service.ICompanyService; |
| | | import com.stylefeng.guns.modular.system.service.IDriverService; |
| | | import com.stylefeng.guns.modular.system.service.IReassignService; |
| | | import com.stylefeng.guns.modular.system.util.PayMoneyUtil; |
| | | import com.unionpay.upyzt.resp.AllocationResp; |
| | | import com.unionpay.upyzt.resp.DepositResp; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.PrintWriter; |
| | | import java.math.BigDecimal; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 第三方支付回调控制器 |
| | |
| | | } |
| | | } |
| | | |
| | | private void cloudPay(Integer uid,String total_fee,String transaction_id,int type) { |
| | | if(type==1){ |
| | | BigDecimal divide = new BigDecimal(total_fee).divide(new BigDecimal(100)); |
| | | total_fee=divide.toString(); |
| | | } |
| | | System.out.println("回调参数:"+total_fee+"---"+transaction_id); |
| | | Driver driver = driverService.selectById(uid); |
| | | if(Objects.isNull(driver)){ |
| | | throw new RuntimeException("该司机不存在!"+uid); |
| | | } |
| | | // 查询平台账户 |
| | | Company company = companyService.selectOne(new EntityWrapper<Company>() |
| | | .eq("type", 1) |
| | | .last("LIMIT 1")); |
| | | System.out.println("查询平台账户==============="+company); |
| | | // 查询平台开户信息 |
| | | TEnterpriseWithdrawal enterpriseWithdrawal = enterpriseWithdrawalService.selectOne(new EntityWrapper<TEnterpriseWithdrawal>() |
| | | .eq("companyId", company.getId())); // 替换为公司id |
| | | System.out.println("查询平台开户信息==============="+enterpriseWithdrawal); |
| | | // TODO 司机进件信息 |
| | | UserWithdrawal driverWith = userWithdrawalService.selectOne(new EntityWrapper<UserWithdrawal>() |
| | | .eq("phone", driver.getPhone()) |
| | | .last("LIMIT 1")); |
| | | // DepositReq depositReq = new DepositReq(); |
| | | // depositReq.setOutOrderNo(ToolUtil.getRandomString(32)); |
| | | // depositReq.setTotalAmount(new BigDecimal(total_fee).multiply(new BigDecimal(100)).intValue()); // 总金额 |
| | | // depositReq.setAmount(new BigDecimal(total_fee).multiply(new BigDecimal(100)).intValue()); // 支付金额 |
| | | // depositReq.setDiscountAmount(0); // 优惠金额 |
| | | // depositReq.setBalanceAcctId(driverWith.getBalanceAcctId()); |
| | | // depositReq.setDepositType("1"); |
| | | // depositReq.setPaymentType(PaymentTypeEnum.CUP_APP.getCode()); |
| | | // depositReq.setPaymentTradeNo(transaction_id); // 系统交易流水号 |
| | | // depositReq.setPaymentSucceededAt(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ").format(new Date())); |
| | | // depositReq.setOrderNo(transaction_id); |
| | | // depositReq.setOrderAmount(new BigDecimal(total_fee).multiply(new BigDecimal(100)).longValue()); |
| | | // depositReq.setProductName("司机支付充值"); |
| | | // depositReq.setProductCount(1); |
| | | try { |
| | | // DepositResp depositResp = DepositExample.create(depositReq); |
| | | // System.err.println(depositResp); |
| | | AllocationReq allocationReq = new AllocationReq(); |
| | | allocationReq.setPayBalanceAcctId(driverWith.getBalanceAcctId()); // 发送方 |
| | | allocationReq.setRecvBalanceAcctId(enterpriseWithdrawal.getBalanceAcctId()); // 接收方 |
| | | BigDecimal multiply = new BigDecimal(100).multiply(new BigDecimal(total_fee)); |
| | | allocationReq.setAmount(multiply.intValue()); // 金额 |
| | | allocationReq.setPassword(Base64Util.decode(enterpriseWithdrawal.getTransactionAuthorizationCode())); // 密码 |
| | | allocationReq.setOrderNo(transaction_id); |
| | | allocationReq.setOrderAmount(Long.valueOf(total_fee)); |
| | | allocationReq.setProductName("订单改派"); |
| | | allocationReq.setProductCount(1); |
| | | AllocationResp allocationResp = AllocationExample.create(allocationReq); |
| | | System.err.println("司机分账信息:"+allocationResp); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | } |
| | | } |
| | |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | |
| | | |
| | | import com.stylefeng.guns.core.util.DateUtil; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.modular.crossCity.model.OrderCrossCity; |
| | |
| | | import com.stylefeng.guns.modular.specialTrain.model.OrderPrivateCar; |
| | | import com.stylefeng.guns.modular.specialTrain.server.IOrderPrivateCarService; |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.util.*; |
| | | import com.stylefeng.guns.modular.system.warpper.ActivityWarpper; |
| | | import com.stylefeng.guns.modular.system.service.*; |
| | | import com.stylefeng.guns.modular.system.util.*; |
| | | import com.stylefeng.guns.modular.system.warpper.*; |
| | | import com.stylefeng.guns.modular.taxi.model.OrderTaxi; |
| | | import com.stylefeng.guns.modular.taxi.service.IOrderTaxiService; |
| | |
| | | package com.stylefeng.guns.modular.api; |
| | | |
| | | import com.stylefeng.guns.modular.system.model.Phone; |
| | | import com.stylefeng.guns.modular.system.service.IPhoneService; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import io.swagger.annotations.Api; |
| | |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | |
| | | import com.stylefeng.guns.modular.account.model.TBankNext; |
| | | import com.stylefeng.guns.modular.account.service.ITBankNextService; |
| | | import com.stylefeng.guns.modular.account.service.UserWithdrawalService; |
| | | import com.stylefeng.guns.modular.cloudPayment.example.CusApplicationExample; |
| | | import com.stylefeng.guns.modular.system.model.BankCard; |
| | | import com.stylefeng.guns.modular.system.model.Driver; |
| | | import com.stylefeng.guns.modular.system.model.UserWithdrawal; |
| | |
| | | import com.stylefeng.guns.modular.system.service.IWithdrawalService; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import com.stylefeng.guns.modular.system.warpper.WithdrawalWarpper; |
| | | import com.unionpay.upyzt.resp.CusApplicationResp; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.*; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * 提现控制器 |
| | |
| | | if(Objects.isNull(userWithdrawal)){ |
| | | return ResultUtil.error("请先进行个人用户进件信息填写"); |
| | | } |
| | | |
| | | |
| | | TBankNext bankNext = bankNextService.selectOne(new EntityWrapper<TBankNext>() |
| | | .eq("bankName", bankName) |
| | | .last("LIMIT 1")); |
| | | |
| | | |
| | | userWithdrawal.setBankName(bankName); |
| | | userWithdrawal.setBankCode(bankNext.getDrecCode()); |
| | | userWithdrawal.setBankBranchCode(bankNext.getBankCode()); |
| | | userWithdrawal.setBankCardCode(code); |
| | | userWithdrawal.setCode(smsCode); |
| | | CusApplicationResp renew = CusApplicationExample.renew(userWithdrawal); |
| | | System.err.println("修改个人用户进件信息返回"+renew); |
| | | if("succeeded".equals(renew.getApplicationStatus())){ |
| | | // 修改银行卡信息 |
| | | bankCard.setVerifyStatus("succeeded"); |
| | | bankCard.setSettleAcctId(renew.getSettleAcctId()); |
| | | bankCardService.updateById(bankCard); |
| | | |
| | | userWithdrawal.setBankCardCode(code); |
| | | userWithdrawal.setBankName(bankCard.getBank()); |
| | | userWithdrawal.setSettleAcctId(renew.getSettleAcctId()); |
| | | userWithdrawal.setBalanceAcctId(renew.getBalanceAcctId()); |
| | | userWithdrawal.setBankCode(bankCard.getBankCode()); |
| | | userWithdrawal.setBankBranchCode(bankCard.getBankBranchCode()); |
| | | userWithdrawalService.updateById(userWithdrawal); |
| | | } |
| | | // CusApplicationResp renew = CusApplicationExample.renew(userWithdrawal); |
| | | // System.err.println("修改个人用户进件信息返回"+renew); |
| | | // if("succeeded".equals(renew.getApplicationStatus())){ |
| | | // // 修改银行卡信息 |
| | | // bankCard.setVerifyStatus("succeeded"); |
| | | // bankCard.setSettleAcctId(renew.getSettleAcctId()); |
| | | // bankCardService.updateById(bankCard); |
| | | // |
| | | // userWithdrawal.setBankCardCode(code); |
| | | // userWithdrawal.setBankName(bankCard.getBank()); |
| | | // userWithdrawal.setSettleAcctId(renew.getSettleAcctId()); |
| | | // userWithdrawal.setBalanceAcctId(renew.getBalanceAcctId()); |
| | | // userWithdrawal.setBankCode(bankCard.getBankCode()); |
| | | // userWithdrawal.setBankBranchCode(bankCard.getBankBranchCode()); |
| | | // userWithdrawalService.updateById(userWithdrawal); |
| | | // } |
| | | return withdrawalService.withdrawal(money, bankName, code, name, uid, type); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | |
| | | |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.modular.account.model.TEnterpriseWithdrawal; |
| | | import com.stylefeng.guns.modular.account.service.ITEnterpriseWithdrawalService; |
| | | import com.stylefeng.guns.modular.account.service.UserWithdrawalService; |
| | | import com.stylefeng.guns.modular.account.util.Base64Util; |
| | | import com.stylefeng.guns.modular.cloudPayment.example.AllocationExample; |
| | | import com.stylefeng.guns.modular.cloudPayment.example.DepositExample; |
| | | import com.stylefeng.guns.modular.cloudPayment.req.AllocationReq; |
| | | import com.stylefeng.guns.modular.cloudPayment.req.DepositReq; |
| | | import com.stylefeng.guns.modular.crossCity.model.OrderCrossCity; |
| | | import com.stylefeng.guns.modular.crossCity.server.IOrderCrossCityService; |
| | | import com.stylefeng.guns.modular.crossCity.warpper.OrderCrossCityInfoWrapper; |
| | | import com.stylefeng.guns.modular.crossCity.warpper.OrderCrossCityWarpper; |
| | | import com.stylefeng.guns.modular.crossCity.warpper.OrderWarpper; |
| | | import com.stylefeng.guns.modular.enums.PaymentTypeEnum; |
| | | import com.stylefeng.guns.modular.system.model.Company; |
| | | import com.stylefeng.guns.modular.system.model.Driver; |
| | | import com.stylefeng.guns.modular.system.model.Reassign; |
| | | import com.stylefeng.guns.modular.system.model.UserWithdrawal; |
| | | import com.stylefeng.guns.modular.system.service.ICompanyService; |
| | | import com.stylefeng.guns.modular.system.service.IDriverService; |
| | | import com.stylefeng.guns.modular.system.service.IReassignService; |
| | |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import com.stylefeng.guns.modular.system.util.SystemException; |
| | | import com.stylefeng.guns.modular.system.warpper.BaseWarpper; |
| | | import com.unionpay.upyzt.resp.AllocationResp; |
| | | import com.unionpay.upyzt.resp.DepositResp; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.PrintWriter; |
| | | import java.math.BigDecimal; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | |
| | | |
| | | @Api |
| | |
| | | } |
| | | } |
| | | |
| | | private void cloudPay(Integer uid,String total_fee,String transaction_id,int type) { |
| | | if(type==1){ |
| | | BigDecimal divide = new BigDecimal(total_fee).divide(new BigDecimal(100)); |
| | | total_fee=divide.toString(); |
| | | } |
| | | Driver driver = driverService.selectById(uid); |
| | | if(Objects.isNull(driver)){ |
| | | throw new RuntimeException("该司机不存在!"+uid); |
| | | } |
| | | System.out.println("回调参数:"+total_fee+"---"+transaction_id); |
| | | // 查询平台账户 |
| | | Company company = companyService.selectOne(new EntityWrapper<Company>() |
| | | .eq("type", 1) |
| | | .last("LIMIT 1")); |
| | | System.out.println("查询平台账户==============="+company); |
| | | // 查询平台开户信息 |
| | | TEnterpriseWithdrawal enterpriseWithdrawal = enterpriseWithdrawalService.selectOne(new EntityWrapper<TEnterpriseWithdrawal>() |
| | | .eq("companyId", company.getId())); // 替换为公司id |
| | | System.out.println("查询平台开户信息==============="+enterpriseWithdrawal); |
| | | UserWithdrawal driverWith = userWithdrawalService.selectOne(new EntityWrapper<UserWithdrawal>() |
| | | .eq("phone", driver.getPhone()) |
| | | .last("LIMIT 1")); |
| | | // DepositReq depositReq = new DepositReq(); |
| | | // depositReq.setOutOrderNo(ToolUtil.getRandomString(32)); |
| | | // depositReq.setTotalAmount(new BigDecimal(total_fee).multiply(new BigDecimal(100)).intValue()); // 总金额 |
| | | // depositReq.setAmount(new BigDecimal(total_fee).multiply(new BigDecimal(100)).intValue()); // 支付金额 |
| | | // depositReq.setDiscountAmount(0); // 优惠金额 |
| | | // depositReq.setBalanceAcctId(driverWith.getBalanceAcctId()); |
| | | // depositReq.setDepositType("1"); |
| | | // depositReq.setPaymentType(PaymentTypeEnum.CUP_APP.getCode()); |
| | | // depositReq.setPaymentTradeNo(transaction_id); // 系统交易流水号 |
| | | // depositReq.setPaymentSucceededAt(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ").format(new Date())); |
| | | // depositReq.setOrderNo(transaction_id); |
| | | // depositReq.setOrderAmount(new BigDecimal(total_fee).multiply(new BigDecimal(100)).longValue()); |
| | | // depositReq.setProductName("用户支付充值"); |
| | | // depositReq.setProductCount(1); |
| | | try { |
| | | // DepositResp depositResp = DepositExample.create(depositReq); |
| | | // System.err.println(depositResp); |
| | | AllocationReq allocationReq = new AllocationReq(); |
| | | allocationReq.setPayBalanceAcctId(driverWith.getBalanceAcctId()); // 发送方 |
| | | allocationReq.setRecvBalanceAcctId(enterpriseWithdrawal.getBalanceAcctId()); // 接收方 |
| | | BigDecimal multiply = new BigDecimal(100).multiply(new BigDecimal(total_fee)); |
| | | allocationReq.setAmount(multiply.intValue()); // 金额 |
| | | allocationReq.setPassword(Base64Util.decode(enterpriseWithdrawal.getTransactionAuthorizationCode())); // 密码 |
| | | allocationReq.setOrderNo(transaction_id); |
| | | allocationReq.setOrderAmount(Long.valueOf(total_fee)); |
| | | allocationReq.setProductName("订单改派"); |
| | | allocationReq.setProductCount(1); |
| | | AllocationResp allocationResp = AllocationExample.create(allocationReq); |
| | | System.err.println("司机分账信息:"+allocationResp); |
| | | |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.stylefeng.guns.core.util.DateUtil; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.modular.account.model.TEnterpriseWithdrawal; |
| | | import com.stylefeng.guns.modular.account.service.ITEnterpriseWithdrawalService; |
| | | import com.stylefeng.guns.modular.account.service.UserWithdrawalService; |
| | | import com.stylefeng.guns.modular.account.util.Base64Util; |
| | | import com.stylefeng.guns.modular.cloudPayment.example.AllocationExample; |
| | | import com.stylefeng.guns.modular.cloudPayment.req.AllocationReq; |
| | | import com.stylefeng.guns.modular.smallLogistics.dao.OrderLogisticsMapper; |
| | | import com.stylefeng.guns.modular.smallLogistics.model.OrderLogistics; |
| | | import com.stylefeng.guns.modular.smallLogistics.model.OrderLogisticsSpread; |
| | |
| | | import com.stylefeng.guns.modular.system.service.*; |
| | | import com.stylefeng.guns.modular.system.util.*; |
| | | import com.stylefeng.guns.modular.system.warpper.MerchantCouponListWarpper; |
| | | import com.unionpay.upyzt.exception.UpyztException; |
| | | import com.unionpay.upyzt.resp.AllocationResp; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.math.MathContext; |
| | | import java.math.RoundingMode; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | income.setObjectId(orderLogistics.getCompanyId()); |
| | | incomeService.insert(income); |
| | | |
| | | // TODO 司机云闪付 超时扣款 司机电子余额转账到平台 |
| | | // 超时扣款 司机电子余额转账到平台 |
| | | divideAccounts(orderLogistics.getDriverId(),timeOutMoney,orderLogistics.getOrderNum()); |
| | | } |
| | | } |
| | | |
| | | this.updateById(orderLogistics); |
| | | |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | /** |
| | | * 分账 |
| | | */ |
| | | private void divideAccounts(Integer driverId,double amount,String orderNum){ |
| | | try{ |
| | | |
| | | // 查询平台开户信息 |
| | | TEnterpriseWithdrawal enterpriseWithdrawal = enterpriseWithdrawalService.selectOne(new EntityWrapper<TEnterpriseWithdrawal>() |
| | | .eq("companyId", 1) |
| | | .last("LIMIT 1")); |
| | | if(Objects.isNull(enterpriseWithdrawal)){ |
| | | throw new RuntimeException("平台开户信息为空"); |
| | | } |
| | | // 司机开户信息 |
| | | Driver driver = driverService.selectById(driverId); |
| | | if(Objects.isNull(driver)){ |
| | | throw new RuntimeException("司机信息不存在"); |
| | | } |
| | | // TODO 司机进件信息 |
| | | UserWithdrawal driverWith = userWithdrawalService.selectOne(new EntityWrapper<UserWithdrawal>() |
| | | .eq("phone", driver.getPhone()) |
| | | .last("LIMIT 1")); |
| | | if(Objects.isNull(driverWith)){ |
| | | throw new RuntimeException("司机开户信息为空"); |
| | | } |
| | | |
| | | AllocationReq allocationReq = new AllocationReq(); |
| | | allocationReq.setOutOrderNo(orderNum); |
| | | allocationReq.setPayBalanceAcctId(driverWith.getBalanceAcctId()); // 发送方 |
| | | allocationReq.setRecvBalanceAcctId(enterpriseWithdrawal.getBalanceAcctId()); // 接收方 |
| | | BigDecimal multiply = new BigDecimal(100).multiply(BigDecimal.valueOf(amount)); |
| | | allocationReq.setAmount(multiply.intValue()); // 金额 |
| | | allocationReq.setPassword(Base64Util.decode(enterpriseWithdrawal.getTransactionAuthorizationCode())); // 密码 |
| | | allocationReq.setOrderNo(orderNum); |
| | | allocationReq.setOrderAmount((long) multiply.intValue()); |
| | | allocationReq.setProductName("小件物流超时扣款"); |
| | | allocationReq.setProductCount(1); |
| | | AllocationResp allocationResp = AllocationExample.create(allocationReq); |
| | | System.err.println("小件物流超时扣款:"+allocationResp); |
| | | }catch (UpyztException e){ |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | package com.stylefeng.guns.modular.system.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.modular.account.controller.AppOrderController; |
| | | import com.stylefeng.guns.modular.account.model.TEnterpriseWithdrawal; |
| | | import com.stylefeng.guns.modular.account.service.ITEnterpriseWithdrawalService; |
| | | import com.stylefeng.guns.modular.account.service.UserWithdrawalService; |
| | | import com.stylefeng.guns.modular.account.unionpay.GetOpenBodySig; |
| | | import com.stylefeng.guns.modular.account.unionpay.QrCodeConfiguration; |
| | | import com.stylefeng.guns.modular.account.unionpay.Util; |
| | | import com.stylefeng.guns.modular.account.util.Base64Util; |
| | | import com.stylefeng.guns.modular.cloudPayment.example.AllocationExample; |
| | | import com.stylefeng.guns.modular.cloudPayment.req.AllocationReq; |
| | | import com.stylefeng.guns.modular.crossCity.model.OrderCrossCity; |
| | | import com.stylefeng.guns.modular.crossCity.server.IOrderCrossCityService; |
| | | import com.stylefeng.guns.modular.smallLogistics.model.OrderLogistics; |
| | | import com.stylefeng.guns.modular.smallLogistics.server.IOrderLogisticsService; |
| | | import com.stylefeng.guns.modular.smallLogistics.server.IOrderLogisticsSpreadService; |
| | | import com.stylefeng.guns.modular.specialTrain.model.OrderPrivateCar; |
| | | import com.stylefeng.guns.modular.specialTrain.server.IOrderPrivateCarService; |
| | | import com.stylefeng.guns.modular.system.dao.DispatchMapper; |
| | |
| | | import com.stylefeng.guns.modular.system.util.*; |
| | | import com.stylefeng.guns.modular.taxi.model.OrderTaxi; |
| | | import com.stylefeng.guns.modular.taxi.service.IOrderTaxiService; |
| | | import com.unionpay.upyzt.resp.AllocationResp; |
| | | import org.apache.commons.lang.time.DateFormatUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | |
| | | for(Dispatch dispatch : dispatches){ |
| | | jgPushUtil.push(2,"有新的改派订单需要处理,请及时处理!", "订单改派", map, "DISPATCH" + dispatch.getId()); |
| | | } |
| | | |
| | | // TODO 司机云闪付 改派余额支付,司机电子账簿转账到平台 |
| | | if(BigDecimal.ZERO.compareTo(new BigDecimal(aDouble)) < 0){ |
| | | cloudPay(reassign.getOriginalDriverId(),aDouble,Util.getMerOrderId(qrCodeConfiguration.getMsgSrcId())); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | if(reassign.getPayType() == 4){ |
| | | // TODO 司机云闪付 改派调起云闪付 |
| | |
| | | return resultUtil; |
| | | } |
| | | |
| | | private void cloudPay(Integer uid,Double total_fee,String transaction_id) { |
| | | System.out.println(uid+"======"+total_fee+"====="+transaction_id); |
| | | Driver driver = driverService.selectById(uid); |
| | | if(Objects.isNull(driver)){ |
| | | throw new RuntimeException("该司机不存在!"+uid); |
| | | } |
| | | // 查询平台账户 |
| | | Company company = companyService.selectOne(new EntityWrapper<Company>() |
| | | .eq("type", 1) |
| | | .last("LIMIT 1")); |
| | | System.out.println("查询平台账户==============="+company); |
| | | // 查询平台开户信息 |
| | | TEnterpriseWithdrawal enterpriseWithdrawal = enterpriseWithdrawalService.selectOne(new EntityWrapper<TEnterpriseWithdrawal>() |
| | | .eq("companyId", company.getId())); // 替换为公司id |
| | | System.out.println("查询平台开户信息==============="+enterpriseWithdrawal); |
| | | // TODO 司机进件信息 |
| | | UserWithdrawal driverWith = userWithdrawalService.selectOne(new EntityWrapper<UserWithdrawal>() |
| | | .eq("phone", driver.getPhone()) |
| | | .last("LIMIT 1")); |
| | | try { |
| | | AllocationReq allocationReq = new AllocationReq(); |
| | | allocationReq.setOutOrderNo(transaction_id); |
| | | allocationReq.setPayBalanceAcctId(driverWith.getBalanceAcctId()); // 发送方 |
| | | allocationReq.setRecvBalanceAcctId(enterpriseWithdrawal.getBalanceAcctId()); // 接收方 |
| | | BigDecimal multiply = new BigDecimal(100).multiply(new BigDecimal(total_fee)); |
| | | allocationReq.setAmount(multiply.intValue()); // 金额 |
| | | allocationReq.setPassword(Base64Util.decode(enterpriseWithdrawal.getTransactionAuthorizationCode())); // 密码 |
| | | allocationReq.setOrderNo(transaction_id); |
| | | allocationReq.setOrderAmount(multiply.longValue()); |
| | | allocationReq.setProductName("订单改派"); |
| | | allocationReq.setProductCount(1); |
| | | AllocationResp allocationResp = AllocationExample.create(allocationReq); |
| | | System.err.println("司机分账信息:"+allocationResp); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | } |
| | | |
| | | private ResultUtil placeAnOrder(BigDecimal amount, Integer type,Integer orderType,Integer reassignId) throws Exception { |
| | | Reassign reassign = reassignMapper.selectById(reassignId); |
| | |
| | | package com.stylefeng.guns.modular.system.util; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.stylefeng.guns.modular.account.service.UserWithdrawalService; |
| | | import com.stylefeng.guns.modular.cloudPayment.example.CusApplicationExample; |
| | | import com.stylefeng.guns.modular.system.model.UserWithdrawal; |
| | | import com.stylefeng.guns.modular.system.service.IDriverService; |
| | | import com.stylefeng.guns.modular.system.service.IOrderService; |
| | | import com.stylefeng.guns.modular.system.service.IUserMerchantCouponService; |
| | | import com.unionpay.upyzt.resp.CusApplicationResp; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.boot.web.context.WebServerInitializedEvent; |
| | | import org.springframework.boot.web.server.WebServer; |
| | | import org.springframework.context.ApplicationListener; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.HashSet; |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | import java.util.stream.Collectors; |
| | | |
| | | |
| | | /** |
| | | * 定时任务工具类 |
| | | */ |
| | | @Component |
| | | public class TaskUtil { |
| | | |
| | | public class TaskUtil implements ApplicationListener<WebServerInitializedEvent> { |
| | | |
| | | @Autowired |
| | | private IDriverService driverService; |
| | | |
| | | |
| | | @Autowired |
| | | private IOrderService orderService; |
| | | |
| | | |
| | | @Autowired |
| | | private JGPushUtil jgPushUtil; |
| | | |
| | | |
| | | @Autowired |
| | | private IUserMerchantCouponService userMerchantCouponService; |
| | | @Autowired |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 每隔一分钟去处理的定时任务 |
| | | */ |
| | | // @Scheduled(fixedRate = 1000 * 60) |
| | | // public void userWith(){ |
| | | // try { |
| | | // List<UserWithdrawal> userWithdrawals = userWithdrawalService.selectList(new EntityWrapper<UserWithdrawal>()); |
| | | // List<UserWithdrawal> collect = userWithdrawals.stream().filter(e -> "succeeded".equals(e.getApplicationStatus())).collect(Collectors.toList()); |
| | | // for (UserWithdrawal userWithdrawal : collect) { |
| | | // CusApplicationResp cusApplicationResp = CusApplicationExample.retrieveByOutRequestNo(userWithdrawal.getOutRequestNo()); |
| | | // System.out.println("请求订单号:"+userWithdrawal.getApplicationStatus()+"================="+cusApplicationResp); |
| | | // |
| | | // } |
| | | // } catch (Exception e) { |
| | | // e.printStackTrace(); |
| | | // } |
| | | // } |
| | | |
| | | |
| | | |
| | |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 每天的凌晨执行的任务 |
| | | */ |
| | | @Scheduled(cron = "0 0 0 * * *") |
| | | public void taskDay(){ |
| | | public void taskDay() { |
| | | try { |
| | | //生成当天的司机活动 |
| | | driverService.addTodayActivity(); |
| | | }catch (Exception e){ |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | |
| | | // |
| | | // /** |
| | | // * 每月第一天的1点执行的任务 |
| | | // */ |
| | | // @Scheduled(cron = "0 0 1 1 * *") |
| | | // public void taskMonth(){ |
| | | // try { |
| | | // |
| | | // }catch (Exception e){ |
| | | // e.printStackTrace(); |
| | | // } |
| | | // } |
| | | |
| | | |
| | | @Override |
| | | public void onApplicationEvent(WebServerInitializedEvent event) { |
| | | // 获取环境对象 |
| | | WebServer webServer = event.getWebServer(); |
| | | // 获取端口号 |
| | | int port = webServer.getPort(); |
| | | // 打印端口号 |
| | | System.out.println("Spring Boot应用已启动,访问端口:" + port); |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.util.qianyuntong; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.open.common.util.OpenApiClient; |
| | | import com.open.common.util.SystemParameterNames; |
| | | import com.stylefeng.guns.modular.system.util.qianyuntong.model.*; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | import java.util.UUID; |
| | | |
| | | /** |
| | | * 企业员工工具类 |
| | | * @author zhibing.pu |
| | | * @Date 2025/6/6 16:17 |
| | | */ |
| | | @Slf4j |
| | | public class EmployeeUtil { |
| | | |
| | | |
| | | /** |
| | | * 企业增加员工 |
| | | * @param request |
| | | * @return |
| | | */ |
| | | public static Boolean saveStaffNode(SaveStaffNodeRequest request){ |
| | | //请求路径 |
| | | String url = QianYunTongProperties.apiUrl + "/openapi/rest/1.0/saveStaffNode"; |
| | | //私钥文件 |
| | | String skprivateKeyFile = QianYunTongProperties.privateKeyPath; |
| | | //注意:私钥文件需要开发者手动新建.pem文件,将委办局提供的私钥串复制进文件里用于sign加密 |
| | | String appKey = QianYunTongProperties.appkey;//appkey |
| | | String content="";//业务参数 |
| | | Map<String, String> headers = new HashMap<>(); |
| | | headers.put("Content-Type", "application/json"); |
| | | Date nowdate = new Date(); |
| | | SimpleDateFormat date=new SimpleDateFormat("yyyyMMddHHmmss"); |
| | | |
| | | String timeStamp = date.format(nowdate); |
| | | String messageId = UUID.randomUUID().toString().replaceAll("-",""); |
| | | request.put(SystemParameterNames.getAppKey(), appKey); |
| | | request.put(SystemParameterNames.getMessage_id(), messageId); |
| | | request.put(SystemParameterNames.getUserName(), QianYunTongProperties.userName); |
| | | request.put(SystemParameterNames.getStatus(), QianYunTongProperties.status); |
| | | request.put("content", content); |
| | | log.info("【企业增加员工】请求参数:" + JSON.toJSONString(request)); |
| | | String result = OpenApiClient.sendCommonHttpRequst(url,headers,"POST",skprivateKeyFile,timeStamp,request); |
| | | log.info("【企业增加员工】请求结果:" + result); |
| | | JSONObject jsonObject = JSON.parseObject(result); |
| | | String status = jsonObject.getString("status"); |
| | | if(!"0".equals(status)){ |
| | | log.error("【企业增加员工】请求失败:" + result); |
| | | return false; |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 企业修改员工信息 |
| | | * @param request |
| | | * @return |
| | | */ |
| | | public static Boolean editStaffNode(EditStaffNodeRequest request){ |
| | | //请求路径 |
| | | String url = QianYunTongProperties.apiUrl + "/openapi/rest/1.0/editStaffNode"; |
| | | //私钥文件 |
| | | String skprivateKeyFile = QianYunTongProperties.privateKeyPath; |
| | | //注意:私钥文件需要开发者手动新建.pem文件,将委办局提供的私钥串复制进文件里用于sign加密 |
| | | String appKey = QianYunTongProperties.appkey;//appkey |
| | | String content="";//业务参数 |
| | | Map<String, String> headers = new HashMap<>(); |
| | | headers.put("Content-Type", "application/json"); |
| | | Date nowdate = new Date(); |
| | | SimpleDateFormat date=new SimpleDateFormat("yyyyMMddHHmmss"); |
| | | |
| | | String timeStamp = date.format(nowdate); |
| | | String messageId = UUID.randomUUID().toString().replaceAll("-",""); |
| | | request.put(SystemParameterNames.getAppKey(), appKey); |
| | | request.put(SystemParameterNames.getMessage_id(), messageId); |
| | | request.put(SystemParameterNames.getUserName(), QianYunTongProperties.userName); |
| | | request.put(SystemParameterNames.getStatus(), QianYunTongProperties.status); |
| | | request.put("content", content); |
| | | log.info("【企业修改员工信息】请求参数:" + JSON.toJSONString(request)); |
| | | String result = OpenApiClient.sendCommonHttpRequst(url,headers,"POST",skprivateKeyFile,timeStamp,request); |
| | | log.info("【企业修改员工信息】请求结果:" + result); |
| | | JSONObject jsonObject = JSON.parseObject(result); |
| | | String status = jsonObject.getString("status"); |
| | | if(!"0".equals(status)){ |
| | | log.error("【企业修改员工信息】请求失败:" + result); |
| | | return false; |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 企业删除人员 |
| | | * @param request |
| | | * @return |
| | | */ |
| | | public static Boolean ecrmDeleteStafNode(DeleteStafNodeRequest request){ |
| | | //请求路径 |
| | | String url = QianYunTongProperties.apiUrl + "/openapi/rest/1.0/ecrmDeleteStafNode"; |
| | | //私钥文件 |
| | | String skprivateKeyFile = QianYunTongProperties.privateKeyPath; |
| | | //注意:私钥文件需要开发者手动新建.pem文件,将委办局提供的私钥串复制进文件里用于sign加密 |
| | | String appKey = QianYunTongProperties.appkey;//appkey |
| | | String content="";//业务参数 |
| | | Map<String, String> headers = new HashMap<>(); |
| | | headers.put("Content-Type", "application/json"); |
| | | Date nowdate = new Date(); |
| | | SimpleDateFormat date=new SimpleDateFormat("yyyyMMddHHmmss"); |
| | | |
| | | String timeStamp = date.format(nowdate); |
| | | String messageId = UUID.randomUUID().toString().replaceAll("-",""); |
| | | request.put(SystemParameterNames.getAppKey(), appKey); |
| | | request.put(SystemParameterNames.getMessage_id(), messageId); |
| | | request.put(SystemParameterNames.getUserName(), QianYunTongProperties.userName); |
| | | request.put(SystemParameterNames.getStatus(), QianYunTongProperties.status); |
| | | request.put("content", content); |
| | | log.info("【企业删除人员】请求参数:" + JSON.toJSONString(request)); |
| | | String result = OpenApiClient.sendCommonHttpRequst(url,headers,"POST",skprivateKeyFile,timeStamp,request); |
| | | log.info("【企业删除人员】请求结果:" + result); |
| | | JSONObject jsonObject = JSON.parseObject(result); |
| | | String status = jsonObject.getString("status"); |
| | | if(!"0".equals(status)){ |
| | | log.error("【企业删除人员】请求失败:" + result); |
| | | return false; |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 根据员工ID获取人员信息 |
| | | * @param request |
| | | * @return |
| | | */ |
| | | public static StaffNodeInfo getStaffNode(GetStaffNodeRequest request){ |
| | | //请求路径 |
| | | String url = QianYunTongProperties.apiUrl + "/openapi/rest/1.0/getStaffNode"; |
| | | //私钥文件 |
| | | String skprivateKeyFile = QianYunTongProperties.privateKeyPath; |
| | | //注意:私钥文件需要开发者手动新建.pem文件,将委办局提供的私钥串复制进文件里用于sign加密 |
| | | String appKey = QianYunTongProperties.appkey;//appkey |
| | | String content="";//业务参数 |
| | | Map<String, String> headers = new HashMap<>(); |
| | | headers.put("Content-Type", "application/json"); |
| | | Date nowdate = new Date(); |
| | | SimpleDateFormat date=new SimpleDateFormat("yyyyMMddHHmmss"); |
| | | |
| | | String timeStamp = date.format(nowdate); |
| | | String messageId = UUID.randomUUID().toString().replaceAll("-",""); |
| | | request.put(SystemParameterNames.getAppKey(), appKey); |
| | | request.put(SystemParameterNames.getMessage_id(), messageId); |
| | | request.put(SystemParameterNames.getUserName(), QianYunTongProperties.userName); |
| | | request.put(SystemParameterNames.getStatus(), QianYunTongProperties.status); |
| | | request.put("content", content); |
| | | log.info("【根据员工ID获取人员信息】请求参数:" + JSON.toJSONString(request)); |
| | | String result = OpenApiClient.sendCommonHttpRequst(url,headers,"GET",skprivateKeyFile,timeStamp,request); |
| | | log.info("【根据员工ID获取人员信息】请求结果:" + result); |
| | | JSONObject jsonObject = JSON.parseObject(result); |
| | | String status = jsonObject.getString("status"); |
| | | if(!"0".equals(status)){ |
| | | log.error("【根据员工ID获取人员信息】请求失败:" + result); |
| | | return null; |
| | | } |
| | | StaffNodeInfo staffNodeInfo = jsonObject.getObject("data", StaffNodeInfo.class); |
| | | return staffNodeInfo; |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.util.qianyuntong; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.open.common.util.OpenApiClient; |
| | | import com.open.common.util.SystemParameterNames; |
| | | import com.stylefeng.guns.modular.system.util.qianyuntong.model.CheckEnterExist; |
| | | import com.stylefeng.guns.modular.system.util.qianyuntong.model.CreateEnterpriseRequest; |
| | | import com.stylefeng.guns.modular.system.util.qianyuntong.model.EnterpriseInfo; |
| | | import com.stylefeng.guns.modular.system.util.qianyuntong.model.ModifyEnterpriseInfoRequest; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | import java.lang.reflect.Field; |
| | | import java.lang.reflect.InvocationTargetException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | import java.util.UUID; |
| | | |
| | | /** |
| | | * 企业工具类 |
| | | * |
| | | * @author zhibing.pu |
| | | * @Date 2025/6/6 17:06 |
| | | */ |
| | | @Slf4j |
| | | public class EnterpriseUtil { |
| | | |
| | | |
| | | /** |
| | | * 根据社会信用代码判断企业是否已存在 |
| | | * |
| | | * @param uscc |
| | | * @return |
| | | */ |
| | | public static CheckEnterExist checkEnterExistByEnterIdCardNo(String uscc) { |
| | | //请求路径 |
| | | String url = QianYunTongProperties.apiUrl + "/openapi/rest/1.0/check_enter_exist_by_enterIdCardNo"; |
| | | //私钥文件 |
| | | String skprivateKeyFile = QianYunTongProperties.privateKeyPath; |
| | | //注意:私钥文件需要开发者手动新建.pem文件,将委办局提供的私钥串复制进文件里用于sign加密 |
| | | String appKey = QianYunTongProperties.appkey;//appkey |
| | | String content = "";//业务参数 |
| | | Map<String, String> headers = new HashMap<>(); |
| | | headers.put("Content-Type", "application/json"); |
| | | Map<String, Object> request = new HashMap<String, Object>(); |
| | | Date nowdate = new Date(); |
| | | SimpleDateFormat date = new SimpleDateFormat("yyyyMMddHHmmss"); |
| | | |
| | | String timeStamp = date.format(nowdate); |
| | | String messageId = UUID.randomUUID().toString().replaceAll("-", ""); |
| | | request.put(SystemParameterNames.getAppKey(), appKey); |
| | | request.put(SystemParameterNames.getMessage_id(), messageId); |
| | | request.put(SystemParameterNames.getUserName(), QianYunTongProperties.userName); |
| | | request.put(SystemParameterNames.getStatus(), QianYunTongProperties.status); |
| | | request.put("content", content); |
| | | request.put("uscc", uscc); |
| | | log.info("【根据社会信用代码判断企业是否已存在】请求参数:" + JSON.toJSONString(request)); |
| | | String result = OpenApiClient.sendCommonHttpRequst(url, headers, "POST", skprivateKeyFile, timeStamp, request); |
| | | log.info("【根据社会信用代码判断企业是否已存在】请求结果:" + result); |
| | | JSONObject jsonObject = JSON.parseObject(result); |
| | | String status = jsonObject.getString("status"); |
| | | if (!"0".equals(status)) { |
| | | log.error("【根据社会信用代码判断企业是否已存在】请求失败:" + result); |
| | | return null; |
| | | } |
| | | return jsonObject.getObject("data", CheckEnterExist.class); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 根据企业名称判断企业是否已存在 |
| | | * |
| | | * @param enterName |
| | | * @return |
| | | */ |
| | | public static CheckEnterExist checkEnterNameExist(String enterName) { |
| | | //请求路径 |
| | | String url = QianYunTongProperties.apiUrl + "/openapi/rest/1.0/checkEnterNameExist"; |
| | | //私钥文件 |
| | | String skprivateKeyFile = QianYunTongProperties.privateKeyPath; |
| | | //注意:私钥文件需要开发者手动新建.pem文件,将委办局提供的私钥串复制进文件里用于sign加密 |
| | | String appKey = QianYunTongProperties.appkey;//appkey |
| | | String content = "";//业务参数 |
| | | Map<String, String> headers = new HashMap<>(); |
| | | headers.put("Content-Type", "application/json"); |
| | | Map<String, Object> request = new HashMap<String, Object>(); |
| | | Date nowdate = new Date(); |
| | | SimpleDateFormat date = new SimpleDateFormat("yyyyMMddHHmmss"); |
| | | |
| | | String timeStamp = date.format(nowdate); |
| | | String messageId = UUID.randomUUID().toString().replaceAll("-", ""); |
| | | request.put(SystemParameterNames.getAppKey(), appKey); |
| | | request.put(SystemParameterNames.getMessage_id(), messageId); |
| | | request.put(SystemParameterNames.getUserName(), QianYunTongProperties.userName); |
| | | request.put(SystemParameterNames.getStatus(), QianYunTongProperties.status); |
| | | request.put("content", content); |
| | | request.put("enterName", enterName); |
| | | log.info("【根据企业名称判断企业是否已存在】请求参数:" + JSON.toJSONString(request)); |
| | | String result = OpenApiClient.sendCommonHttpRequst(url, headers, "POST", skprivateKeyFile, timeStamp, request); |
| | | log.info("【根据企业名称判断企业是否已存在】请求结果:" + result); |
| | | JSONObject jsonObject = JSON.parseObject(result); |
| | | String status = jsonObject.getString("status"); |
| | | if (!"0".equals(status)) { |
| | | log.error("【根据企业名称判断企业是否已存在】请求失败:" + result); |
| | | return null; |
| | | } |
| | | return jsonObject.getObject("data", CheckEnterExist.class); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询企业详情 |
| | | * |
| | | * @param enter_code 企业编号 |
| | | * @return |
| | | */ |
| | | public static EnterpriseInfo getEnterpriseDetail(String enter_code) { |
| | | //请求路径 |
| | | String url = QianYunTongProperties.apiUrl + "/openapi/rest/1.0/getEnterpriseDetail"; |
| | | //私钥文件 |
| | | String skprivateKeyFile = QianYunTongProperties.privateKeyPath; |
| | | //注意:私钥文件需要开发者手动新建.pem文件,将委办局提供的私钥串复制进文件里用于sign加密 |
| | | String appKey = QianYunTongProperties.appkey;//appkey |
| | | String content = "";//业务参数 |
| | | Map<String, String> headers = new HashMap<>(); |
| | | headers.put("Content-Type", "application/json"); |
| | | Map<String, Object> request = new HashMap<String, Object>(); |
| | | Date nowdate = new Date(); |
| | | SimpleDateFormat date = new SimpleDateFormat("yyyyMMddHHmmss"); |
| | | |
| | | String timeStamp = date.format(nowdate); |
| | | String messageId = UUID.randomUUID().toString().replaceAll("-", ""); |
| | | request.put(SystemParameterNames.getAppKey(), appKey); |
| | | request.put(SystemParameterNames.getMessage_id(), messageId); |
| | | request.put(SystemParameterNames.getUserName(), QianYunTongProperties.userName); |
| | | request.put(SystemParameterNames.getStatus(), QianYunTongProperties.status); |
| | | request.put("content", content); |
| | | request.put("enter_code", enter_code); |
| | | log.info("【查询企业详情】请求参数:" + JSON.toJSONString(request)); |
| | | String result = OpenApiClient.sendCommonHttpRequst(url, headers, "GET", skprivateKeyFile, timeStamp, request); |
| | | log.info("【查询企业详情】请求结果:" + result); |
| | | JSONObject jsonObject = JSON.parseObject(result); |
| | | String status = jsonObject.getString("status"); |
| | | if (!"0".equals(status)) { |
| | | log.error("【查询企业详情】请求失败:" + result); |
| | | return null; |
| | | } |
| | | EnterpriseInfo enterpriseInfo = jsonObject.getObject("data", EnterpriseInfo.class); |
| | | return enterpriseInfo; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 修改企业基本信息 |
| | | * |
| | | * @param request |
| | | * @return |
| | | */ |
| | | public static Boolean modifyEnterpriseInfo(ModifyEnterpriseInfoRequest request) { |
| | | //请求路径 |
| | | String url = QianYunTongProperties.apiUrl + "/openapi/rest/1.0/modifyEnterpriseInfo"; |
| | | //私钥文件 |
| | | String skprivateKeyFile = QianYunTongProperties.privateKeyPath; |
| | | //注意:私钥文件需要开发者手动新建.pem文件,将委办局提供的私钥串复制进文件里用于sign加密 |
| | | String appKey = QianYunTongProperties.appkey;//appkey |
| | | String content = "";//业务参数 |
| | | Map<String, String> headers = new HashMap<>(); |
| | | headers.put("Content-Type", "application/json"); |
| | | Date nowdate = new Date(); |
| | | SimpleDateFormat date = new SimpleDateFormat("yyyyMMddHHmmss"); |
| | | |
| | | String timeStamp = date.format(nowdate); |
| | | String messageId = UUID.randomUUID().toString().replaceAll("-", ""); |
| | | request.put(SystemParameterNames.getAppKey(), appKey); |
| | | request.put(SystemParameterNames.getMessage_id(), messageId); |
| | | request.put(SystemParameterNames.getUserName(), QianYunTongProperties.userName); |
| | | request.put(SystemParameterNames.getStatus(), QianYunTongProperties.status); |
| | | request.put("content", content); |
| | | log.info("【修改企业基本信息】请求参数:" + JSON.toJSONString(request)); |
| | | String result = OpenApiClient.sendCommonHttpRequst(url, headers, "GET", skprivateKeyFile, timeStamp, request); |
| | | log.info("【修改企业基本信息】请求结果:" + result); |
| | | JSONObject jsonObject = JSON.parseObject(result); |
| | | String status = jsonObject.getString("status"); |
| | | if (!"0".equals(status)) { |
| | | log.error("【修改企业基本信息】请求失败:" + result); |
| | | return false; |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 创建企业 |
| | | * |
| | | * @param request |
| | | * @return |
| | | */ |
| | | public static Boolean createEnterprise(CreateEnterpriseRequest request) { |
| | | //请求路径 |
| | | String url = QianYunTongProperties.apiUrl + "/openapi/rest/1.1/createEnterprise"; |
| | | //私钥文件 |
| | | String skprivateKeyFile = QianYunTongProperties.privateKeyPath; |
| | | //注意:私钥文件需要开发者手动新建.pem文件,将委办局提供的私钥串复制进文件里用于sign加密 |
| | | String appKey = QianYunTongProperties.appkey;//appkey |
| | | String content = "";//业务参数 |
| | | Map<String, String> headers = new HashMap<>(); |
| | | headers.put("Content-Type", "application/json"); |
| | | Map<String, Object> map = new HashMap<String, Object>(); |
| | | Date nowdate = new Date(); |
| | | SimpleDateFormat date = new SimpleDateFormat("yyyyMMddHHmmss"); |
| | | |
| | | String timeStamp = date.format(nowdate); |
| | | String messageId = UUID.randomUUID().toString().replaceAll("-", ""); |
| | | map.put(SystemParameterNames.getAppKey(), appKey); |
| | | map.put(SystemParameterNames.getMessage_id(), messageId); |
| | | map.put(SystemParameterNames.getUserName(), QianYunTongProperties.userName); |
| | | map.put(SystemParameterNames.getStatus(), QianYunTongProperties.status); |
| | | map.put("content", content); |
| | | Class<? extends CreateEnterpriseRequest> clazz = request.getClass(); |
| | | Field[] declaredFields = clazz.getDeclaredFields(); |
| | | for (Field declaredField : declaredFields) { |
| | | String name = declaredField.getName(); |
| | | Object invoke = null; |
| | | try { |
| | | invoke = clazz.getMethod("get" + name.substring(0, 1).toUpperCase() + name.substring(1)).invoke(request); |
| | | } catch (IllegalAccessException e) { |
| | | throw new RuntimeException(e); |
| | | } catch (InvocationTargetException e) { |
| | | throw new RuntimeException(e); |
| | | } catch (NoSuchMethodException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | map.put(name, invoke); |
| | | } |
| | | |
| | | log.info("【创建企业】请求地址:" + url); |
| | | log.info("【创建企业】请求参数:" + JSON.toJSONString(map)); |
| | | String result = OpenApiClient.sendCommonHttpRequst(url, headers, "POST", skprivateKeyFile, timeStamp, map); |
| | | log.info("【创建企业】请求结果:" + result); |
| | | JSONObject jsonObject = JSON.parseObject(result); |
| | | String resCode = jsonObject.getString("resCode"); |
| | | String status = jsonObject.getString("status"); |
| | | if (!"0".equals(status)) { |
| | | log.error("【创建企业】请求失败:" + result); |
| | | return false; |
| | | } |
| | | return true; |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.util.qianyuntong; |
| | | |
| | | /** |
| | | * 黔云通配置 |
| | | * @author zhibing.pu |
| | | * @Date 2025/6/6 15:03 |
| | | */ |
| | | public interface QianYunTongProperties { |
| | | /** |
| | | * appkey |
| | | */ |
| | | String appkey = "10001104"; |
| | | /** |
| | | * 私钥地址 |
| | | */ |
| | | String privateKeyPath = "C:\\Users\\39373\\Desktop\\黔云通\\private_key_test.pem"; |
| | | /** |
| | | * 消费者账号 |
| | | */ |
| | | String userName = "xiaofei"; |
| | | /** |
| | | * 状态 |
| | | * 1:生产环境 |
| | | * 2:测试环境 |
| | | */ |
| | | String status = "2"; |
| | | /** |
| | | * API地址 |
| | | */ |
| | | String apiUrl = "https://test-zhongtai.stqcloud.com:10070"; |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.util.qianyuntong; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.open.common.util.OpenApiClient; |
| | | import com.open.common.util.SystemParameterNames; |
| | | import com.stylefeng.guns.modular.system.util.qianyuntong.model.QYTUserInfo; |
| | | import com.stylefeng.guns.modular.system.util.qianyuntong.model.RegisterViaMobileRequest; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | import java.util.UUID; |
| | | |
| | | /** |
| | | * 用户工具类 |
| | | * |
| | | * @author zhibing.pu |
| | | * @Date 2025/6/6 14:47 |
| | | */ |
| | | @Slf4j |
| | | public class UserUtil { |
| | | |
| | | |
| | | /** |
| | | * 根据手机号和企业编号查询用户信息 |
| | | * |
| | | * @param mobile 手机号码 |
| | | * @param enterNum 企业编号 |
| | | */ |
| | | public static QYTUserInfo getUserInfoByPhone(String mobile, String enterNum) { |
| | | //请求路径 |
| | | String url = QianYunTongProperties.apiUrl + "/openapi/rest/1.0/getUserInfoByPhone"; |
| | | //私钥文件 |
| | | String skprivateKeyFile = QianYunTongProperties.privateKeyPath; |
| | | //注意:私钥文件需要开发者手动新建.pem文件,将委办局提供的私钥串复制进文件里用于sign加密 |
| | | String appKey = QianYunTongProperties.appkey;//appkey |
| | | String content = "";//业务参数 |
| | | Map<String, String> headers = new HashMap<>(); |
| | | headers.put("Content-Type", "application/json"); |
| | | Map<String, Object> contentMap = new HashMap<String, Object>(); |
| | | Date nowdate = new Date(); |
| | | SimpleDateFormat date = new SimpleDateFormat("yyyyMMddHHmmss"); |
| | | |
| | | String timeStamp = date.format(nowdate); |
| | | String messageId = UUID.randomUUID().toString().replaceAll("-", ""); |
| | | contentMap.put(SystemParameterNames.getAppKey(), appKey); |
| | | contentMap.put(SystemParameterNames.getMessage_id(), messageId); |
| | | contentMap.put(SystemParameterNames.getUserName(), QianYunTongProperties.userName); |
| | | contentMap.put(SystemParameterNames.getStatus(), QianYunTongProperties.status); |
| | | contentMap.put("content", content); |
| | | contentMap.put("mobile", mobile); |
| | | contentMap.put("enterNum", enterNum); |
| | | log.info("【根据手机号和企业编号查询用户信息】请求参数:" + JSON.toJSONString(contentMap)); |
| | | String result = OpenApiClient.sendCommonHttpRequst(url, headers, "GET", skprivateKeyFile, timeStamp, contentMap); |
| | | log.info("【根据手机号和企业编号查询用户信息】请求结果:" + result); |
| | | JSONObject jsonObject = JSON.parseObject(result); |
| | | String status = jsonObject.getString("status"); |
| | | if (!"0".equals(status)) { |
| | | log.error("【根据手机号和企业编号查询用户信息】请求失败:" + result); |
| | | return null; |
| | | } |
| | | QYTUserInfo userInfo = jsonObject.getObject("data", QYTUserInfo.class); |
| | | return userInfo; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 根据手机号注册用户 |
| | | * |
| | | * @param request |
| | | * @return |
| | | */ |
| | | public static Boolean registerViaMobile(RegisterViaMobileRequest request) { |
| | | //请求路径 |
| | | String url = QianYunTongProperties.apiUrl + "/openapi/rest/1.0/getUserInfoByPhone"; |
| | | //私钥文件 |
| | | String skprivateKeyFile = QianYunTongProperties.privateKeyPath; |
| | | //注意:私钥文件需要开发者手动新建.pem文件,将委办局提供的私钥串复制进文件里用于sign加密 |
| | | String appKey = QianYunTongProperties.appkey;//appkey |
| | | String content = "";//业务参数 |
| | | Map<String, String> headers = new HashMap<>(); |
| | | headers.put("Content-Type", "application/json"); |
| | | Date nowdate = new Date(); |
| | | SimpleDateFormat date = new SimpleDateFormat("yyyyMMddHHmmss"); |
| | | |
| | | String timeStamp = date.format(nowdate); |
| | | String messageId = UUID.randomUUID().toString().replaceAll("-", ""); |
| | | request.put(SystemParameterNames.getAppKey(), appKey); |
| | | request.put(SystemParameterNames.getMessage_id(), messageId); |
| | | request.put(SystemParameterNames.getUserName(), QianYunTongProperties.userName); |
| | | request.put(SystemParameterNames.getStatus(), QianYunTongProperties.status); |
| | | request.put("content", content); |
| | | log.info("【根据手机号注册用户】请求参数:" + JSON.toJSONString(request)); |
| | | String result = OpenApiClient.sendCommonHttpRequst(url, headers, "POST", skprivateKeyFile, timeStamp, request); |
| | | log.info("【根据手机号注册用户】请求结果:" + result); |
| | | JSONObject jsonObject = JSON.parseObject(result); |
| | | String status = jsonObject.getString("status"); |
| | | if (!"0".equals(status)) { |
| | | log.error("【根据手机号注册用户】请求失败:" + result); |
| | | return false; |
| | | } |
| | | return true; |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.util.qianyuntong.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/6/6 18:12 |
| | | */ |
| | | @Data |
| | | public class CheckEnterExist { |
| | | /** |
| | | * 是否在公有云注册,1:已注册;0:未注册 |
| | | */ |
| | | private String isReg; |
| | | /** |
| | | * 创建者手机号 |
| | | */ |
| | | private String mobile; |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | private String createTime; |
| | | /** |
| | | * 法人姓名 |
| | | */ |
| | | private String larName; |
| | | /** |
| | | * 企业编码 |
| | | */ |
| | | private String enterCode; |
| | | /** |
| | | * 认证状态 |
| | | * 0:已认证;1:未认证,初始状态;2:认证不通过;3:认证中 |
| | | */ |
| | | private Integer auth; |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.util.qianyuntong.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/6/9 19:43 |
| | | */ |
| | | @Data |
| | | public class CreateEnterprise { |
| | | /** |
| | | * |
| | | */ |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.util.qianyuntong.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/6/9 18:20 |
| | | */ |
| | | @Data |
| | | public class CreateEnterpriseRequest { |
| | | /** |
| | | * 企业名称 |
| | | */ |
| | | private String name; |
| | | /** |
| | | * 企业简称/昵称 |
| | | */ |
| | | private String nickName; |
| | | /** |
| | | * 行业编码 |
| | | */ |
| | | private String industry_code; |
| | | /** |
| | | * 手机号码 |
| | | */ |
| | | private String mobile; |
| | | /** |
| | | * 区域编码 |
| | | */ |
| | | private String area; |
| | | /** |
| | | * 企业地址 |
| | | */ |
| | | private String address; |
| | | /** |
| | | * 二级域名 |
| | | */ |
| | | private String secondRealmName; |
| | | /** |
| | | * 企业密码 |
| | | */ |
| | | private String password; |
| | | /** |
| | | * 一级行业分类描述 |
| | | */ |
| | | private String industry_level1; |
| | | /** |
| | | * 二级行业分类描述 |
| | | */ |
| | | private String industry_level2; |
| | | /** |
| | | * 企业来源编码 |
| | | */ |
| | | private String sourceCode; |
| | | /** |
| | | * 企业分类编码 |
| | | */ |
| | | private String typeCode; |
| | | /** |
| | | * 代理商id |
| | | */ |
| | | private String elecsId; |
| | | /** |
| | | * 是否发送短信 |
| | | * 0:不发送,1:发送 |
| | | */ |
| | | private String smsFlag; |
| | | /** |
| | | * 是否激活 |
| | | * 1:激活;0:未激活 |
| | | */ |
| | | private String mobileFlag; |
| | | /** |
| | | * 邮箱 |
| | | */ |
| | | private String email; |
| | | /** |
| | | * 邮箱是否激活 |
| | | * 1:激活;0:未激活 |
| | | */ |
| | | private String emailFlag; |
| | | /** |
| | | * 是否同步通讯录 |
| | | */ |
| | | private String contact_source; |
| | | /** |
| | | * 所属行业通用编码 |
| | | */ |
| | | private String trade_code; |
| | | /** |
| | | * 营业执照扫描件url |
| | | */ |
| | | private String operScanPic; |
| | | /** |
| | | * 运营人员姓名 |
| | | */ |
| | | private String idcardName; |
| | | /** |
| | | * 运营者身份证号码 |
| | | */ |
| | | private String idcardNum; |
| | | /** |
| | | * 运营者身份证照片url |
| | | */ |
| | | private String idcardPic; |
| | | /** |
| | | * 企业工号 |
| | | */ |
| | | private String enterID; |
| | | /** |
| | | * 推荐人 |
| | | */ |
| | | private String recommender; |
| | | /** |
| | | * 创建者姓名 |
| | | */ |
| | | private String creatorName; |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.util.qianyuntong.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.HashMap; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/6/6 16:39 |
| | | */ |
| | | @Data |
| | | public class DeleteStafNodeRequest extends HashMap<String, Object> { |
| | | /** |
| | | * 人员ID |
| | | */ |
| | | private Long empId; |
| | | /** |
| | | * 手机号 |
| | | */ |
| | | private String mobile; |
| | | /** |
| | | * 企业编号 |
| | | */ |
| | | private String entercode; |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.util.qianyuntong.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.HashMap; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/6/6 16:32 |
| | | */ |
| | | @Data |
| | | public class EditStaffNodeRequest extends HashMap<String, Object> { |
| | | /** |
| | | * 人员ID |
| | | */ |
| | | private Long empId; |
| | | /** |
| | | * 企业ID |
| | | */ |
| | | private String enterNum; |
| | | /** |
| | | * 人员显示名 |
| | | */ |
| | | private String empNickname; |
| | | /** |
| | | * 人员性别(男\女) |
| | | */ |
| | | private String empSex; |
| | | /** |
| | | * 人员手机号 |
| | | */ |
| | | private String mphone; |
| | | /** |
| | | * 人员邮箱 |
| | | */ |
| | | private String email; |
| | | /** |
| | | * 员工所属部门ID多个部门英文; 分割 |
| | | */ |
| | | private String deptIds; |
| | | /** |
| | | * 员工职务ID |
| | | */ |
| | | private Long positionId; |
| | | /** |
| | | * 员工职务名称,如不知道ID可以直接传入名称 |
| | | */ |
| | | private String positionName; |
| | | /** |
| | | * 高管模式 1 是 0 不是 |
| | | */ |
| | | private Integer superLevel; |
| | | /** |
| | | * 隐藏号码 1 是 0 不是 |
| | | */ |
| | | private Integer hideMobile; |
| | | |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.util.qianyuntong.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/6/6 17:14 |
| | | */ |
| | | @Data |
| | | public class EnterpriseInfo { |
| | | /** |
| | | * 企业编号 |
| | | */ |
| | | private String enter_code; |
| | | /** |
| | | * 企业名称 |
| | | */ |
| | | private String enter_name; |
| | | /** |
| | | * 是否是全员号码可见,0:是,1:否 |
| | | */ |
| | | private String visible; |
| | | /** |
| | | * 认证状态,0:已认证;1:未认证,初始状态;2:认证不通过;3:认证中 |
| | | */ |
| | | private String auth; |
| | | /** |
| | | * 认证时间 |
| | | */ |
| | | private String auth_time; |
| | | /** |
| | | * 认证注释 |
| | | */ |
| | | private String authRemark; |
| | | /** |
| | | * 运营者姓名(委托人) |
| | | */ |
| | | private String idcard_name; |
| | | /** |
| | | * 运营者证件号 |
| | | */ |
| | | private String idcard_num; |
| | | /** |
| | | * 运营者证件扫描件URL |
| | | */ |
| | | private String idcard_pic; |
| | | /** |
| | | * 统一社会信用代码 |
| | | */ |
| | | private String uscc; |
| | | /** |
| | | * 法人姓名 |
| | | */ |
| | | private String larName; |
| | | /** |
| | | * 法人电话 |
| | | */ |
| | | private String larPhone; |
| | | /** |
| | | * 法人身份证 |
| | | */ |
| | | private String larIdCard; |
| | | /** |
| | | * 法人身份证扫描件URL |
| | | */ |
| | | private String larIdCardPic; |
| | | /** |
| | | * 发票名称 |
| | | */ |
| | | private String invoiceName; |
| | | /** |
| | | * 纳税人识别号(发票) |
| | | */ |
| | | private String invoiceTIN; |
| | | /** |
| | | * 开户行名称(发票) |
| | | */ |
| | | private String invoiceBankersName; |
| | | /** |
| | | * 开户行账号(发票) |
| | | */ |
| | | private String invoiceBankersAccount; |
| | | /** |
| | | * 资质机构名称 |
| | | */ |
| | | private String qualificationOrgName; |
| | | /** |
| | | * 资质注册号/登记号 |
| | | */ |
| | | private String qualificationRegNum; |
| | | /** |
| | | * 资质有效开始时间 |
| | | */ |
| | | private String qualificationStartTime; |
| | | /** |
| | | * 资质有效结束时间 |
| | | */ |
| | | private String qualificationEndTime; |
| | | /** |
| | | * 资格证书扫描件URL |
| | | */ |
| | | private String qualificationCertUrl; |
| | | /** |
| | | * 省份编码 |
| | | */ |
| | | private String provinceCode; |
| | | /** |
| | | * 地市编码 |
| | | */ |
| | | private String cityCode; |
| | | /** |
| | | * 区县编码 |
| | | */ |
| | | private String areaCode; |
| | | /** |
| | | * 乡镇编码 |
| | | */ |
| | | private String townshipCode; |
| | | /** |
| | | * 企业创建时间 |
| | | */ |
| | | private String enter_createdate; |
| | | /** |
| | | * 地址 |
| | | */ |
| | | private String address; |
| | | /** |
| | | * 营业期开始时间,格式:yyyy-MM-dd HH:mm:ss |
| | | */ |
| | | private String businessTermStartTime; |
| | | /** |
| | | * 营业期结束时间,格式:yyyy-MM-dd HH:mm:ss |
| | | */ |
| | | private String businessTermEndTime; |
| | | /** |
| | | * 企业规模 |
| | | */ |
| | | private String enterScale; |
| | | /** |
| | | * 创建者职位 |
| | | */ |
| | | private String creatorPosition; |
| | | /** |
| | | * 企业备注/介绍 |
| | | */ |
| | | private String enterRemark; |
| | | /** |
| | | * 企业logo |
| | | */ |
| | | private String enterLogo; |
| | | /** |
| | | * 企业邮箱 |
| | | */ |
| | | private String enterEmail; |
| | | /** |
| | | * 企业联系电话rg_company_info.enter_tel |
| | | */ |
| | | private String enterTel; |
| | | /** |
| | | * 一级行业分类编码 |
| | | */ |
| | | private String industryStr; |
| | | /** |
| | | * 二级行业分类编码 |
| | | */ |
| | | private String industryStr2; |
| | | /** |
| | | * 企业联系人姓名 |
| | | */ |
| | | private String enterLinkman; |
| | | /** |
| | | * 营业执照扫描件ur |
| | | */ |
| | | private String operScanPic; |
| | | /** |
| | | * 身份证有效期 |
| | | */ |
| | | private String larIdCardValidity; |
| | | /** |
| | | * 经营地址 |
| | | */ |
| | | private String operationAddress; |
| | | /** |
| | | * 法人身份证背面照片 |
| | | */ |
| | | private String larIdCardPicBack; |
| | | /** |
| | | * 法人身份证手持 |
| | | */ |
| | | private String larIdCardPicHold; |
| | | /** |
| | | * 开户许可证 |
| | | */ |
| | | private String accountOpeningPermit; |
| | | /** |
| | | * 自定义的,例如:企业类型 |
| | | */ |
| | | private String tag1; |
| | | /** |
| | | * 自定义的,例如:行业类型 |
| | | */ |
| | | private String tag2; |
| | | /** |
| | | * 企业扩展信息 |
| | | */ |
| | | private String iformContentId; |
| | | /** |
| | | * 国家统计局网站提供的行政地区编码 |
| | | */ |
| | | private String area; |
| | | /** |
| | | * 行业编码 |
| | | */ |
| | | private String industryCode; |
| | | /** |
| | | * 企业创建人姓名 |
| | | */ |
| | | private String creatorName; |
| | | /** |
| | | * 企业创建人手机号 |
| | | */ |
| | | private String creatorMobile; |
| | | /** |
| | | * 管理员邮箱 |
| | | */ |
| | | private String email; |
| | | /** |
| | | * 企业简称 |
| | | */ |
| | | private String enterAbbreviation; |
| | | /** |
| | | * 营业期限 |
| | | */ |
| | | private String businessTermLong; |
| | | /** |
| | | * 一级行业名称 |
| | | */ |
| | | private String industryL1Name; |
| | | /** |
| | | * 二级行业名称 |
| | | */ |
| | | private String industryL2Name; |
| | | /** |
| | | * 企业介绍(全文本) |
| | | */ |
| | | private String enterIntro; |
| | | /** |
| | | * 法人身份证正面照片 |
| | | */ |
| | | private String larIdCardPicFront; |
| | | /** |
| | | * 企业主税机关 |
| | | */ |
| | | private String enterTaxAuthority; |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.util.qianyuntong.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.HashMap; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/6/6 16:42 |
| | | */ |
| | | @Data |
| | | public class GetStaffNodeRequest extends HashMap<String, Object> { |
| | | /** |
| | | * 人员ID |
| | | */ |
| | | private Long empId; |
| | | /** |
| | | * 操作人手机号 |
| | | */ |
| | | private String mobile; |
| | | /** |
| | | * 操作人企业ID |
| | | */ |
| | | private String entercode; |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.util.qianyuntong.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.HashMap; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/6/9 18:13 |
| | | */ |
| | | @Data |
| | | public class ModifyEnterpriseInfoRequest extends HashMap<String, Object> { |
| | | /** |
| | | * 企业编码 |
| | | */ |
| | | private String enter_code; |
| | | /** |
| | | * 操作人员手机号 |
| | | */ |
| | | private String operator; |
| | | /** |
| | | * 企业名称 |
| | | */ |
| | | private String enter_name; |
| | | /** |
| | | * 企业简称 |
| | | */ |
| | | private String enter_nickname; |
| | | /** |
| | | * 企业地址 |
| | | */ |
| | | private String enter_address; |
| | | /** |
| | | * 企业邮箱 |
| | | */ |
| | | private String enter_email; |
| | | /** |
| | | * 联系人姓名 |
| | | */ |
| | | private String contact_name; |
| | | /** |
| | | * 联系人手机号 |
| | | */ |
| | | private String contact_mobile; |
| | | /** |
| | | * 营业执照扫描件URL |
| | | */ |
| | | private String operscanpic; |
| | | /** |
| | | * 营业期开始时间 |
| | | */ |
| | | private String businessTermStartTime; |
| | | /** |
| | | * 营业期结束时间 |
| | | */ |
| | | private String businessTermEndTime; |
| | | /** |
| | | * 区域编码 |
| | | */ |
| | | private String area; |
| | | /** |
| | | * 二级域名 |
| | | */ |
| | | private String second_realms; |
| | | /** |
| | | * 企业来源编码 |
| | | */ |
| | | private String source_code; |
| | | /** |
| | | * 店铺所属行业编码 |
| | | */ |
| | | private String trade_code; |
| | | /** |
| | | * 企业分类编码 |
| | | */ |
| | | private String type_code; |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.util.qianyuntong.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 用户信息 |
| | | * @author zhibing.pu |
| | | * @Date 2025/6/6 15:11 |
| | | */ |
| | | @Data |
| | | public class QYTUserInfo { |
| | | /** |
| | | * 员工名称 |
| | | */ |
| | | private String empName; |
| | | /** |
| | | * 企业编号 |
| | | */ |
| | | private String enterNum; |
| | | /** |
| | | * 节点路径 |
| | | */ |
| | | private String nodePath; |
| | | /** |
| | | * 员工昵称 |
| | | */ |
| | | private String nickName; |
| | | /** |
| | | * 员工编号 |
| | | */ |
| | | private String empId; |
| | | /** |
| | | * 手机号码 |
| | | */ |
| | | private String mphone; |
| | | /** |
| | | * 员工在企业内部的编号 |
| | | */ |
| | | private String loginNo; |
| | | /** |
| | | * 部门ID |
| | | */ |
| | | private String deptId; |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.util.qianyuntong.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.HashMap; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/6/6 16:59 |
| | | */ |
| | | @Data |
| | | public class RegisterViaMobileRequest extends HashMap<String, Object> { |
| | | /** |
| | | * 手机号码 |
| | | */ |
| | | private String mobile; |
| | | /** |
| | | * 客户端appid |
| | | */ |
| | | private String appId; |
| | | /** |
| | | * 用户密码 |
| | | */ |
| | | private String password; |
| | | /** |
| | | * 短信验证码 |
| | | */ |
| | | private String verify_code; |
| | | /** |
| | | * 验证码类型 |
| | | * 0:短信发送的验证码;1:一键获取手机号返回注册验证码;2、验证码验证成功后生成的Ticket |
| | | */ |
| | | private String verify_code_type; |
| | | /** |
| | | * 加密类型 |
| | | * 第三方系统可以填写空 |
| | | */ |
| | | private String encryptType; |
| | | /** |
| | | * 用户类型 |
| | | * 0:普通用户 |
| | | */ |
| | | private String user_type; |
| | | /** |
| | | * 昵称 |
| | | */ |
| | | private String nickname; |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.util.qianyuntong.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.HashMap; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/6/6 16:22 |
| | | */ |
| | | @Data |
| | | public class SaveStaffNodeRequest extends HashMap<String, Object> { |
| | | /** |
| | | * 操作人手机号 |
| | | */ |
| | | private String mobile; |
| | | /** |
| | | * 操作人企业ID |
| | | */ |
| | | private String entercode; |
| | | /** |
| | | * 人员名称 |
| | | */ |
| | | private String empName; |
| | | /** |
| | | * 人员显示名 |
| | | */ |
| | | private String empNickname; |
| | | /** |
| | | * 人员账号 |
| | | */ |
| | | private String loginNo; |
| | | /** |
| | | * 人员性别 |
| | | */ |
| | | private String empSex; |
| | | /** |
| | | * 人员手机号 |
| | | */ |
| | | private String mphone; |
| | | /** |
| | | * 人员邮箱 |
| | | */ |
| | | private String email; |
| | | /** |
| | | * 员工所属部分ID |
| | | */ |
| | | private String deptIds; |
| | | /** |
| | | * 员工职务ID |
| | | */ |
| | | private Long positionId; |
| | | /** |
| | | * 员工职务名称 |
| | | */ |
| | | private String positionName; |
| | | /** |
| | | * 高管模式 1 是 0 不是 |
| | | */ |
| | | private Integer superLevel; |
| | | /** |
| | | * 隐藏号码 1 是 0 不是 |
| | | */ |
| | | private Integer hideMobile; |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.util.qianyuntong.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/6/6 16:44 |
| | | */ |
| | | @Data |
| | | public class StaffNodeInfo { |
| | | /** |
| | | * 人员ID |
| | | */ |
| | | private Integer empId; |
| | | /** |
| | | * 企业ID |
| | | */ |
| | | private String enterNum; |
| | | /** |
| | | * 人员名称 |
| | | */ |
| | | private String empName; |
| | | /** |
| | | * 人员显示名 |
| | | */ |
| | | private String empNickname; |
| | | /** |
| | | * 人员账号 |
| | | */ |
| | | private String loginNo; |
| | | /** |
| | | * 人员性别(男\女) |
| | | */ |
| | | private String empSex; |
| | | /** |
| | | * 人员手机号 |
| | | */ |
| | | private String mphone; |
| | | /** |
| | | * 人员邮箱 |
| | | */ |
| | | private String email; |
| | | /** |
| | | * 员工所属部门ID多个部门英文; 分割 |
| | | */ |
| | | private String deptIds; |
| | | /** |
| | | * 员工职位ID |
| | | */ |
| | | private Long positionId; |
| | | /** |
| | | * 员工职位名称 |
| | | */ |
| | | private String positionName; |
| | | /** |
| | | * 高管模式 1 是 0 不是 |
| | | */ |
| | | private Integer superLevel; |
| | | /** |
| | | * 隐藏手机号 1 是 0 否 |
| | | */ |
| | | private Integer hideMobile; |
| | | } |
| | |
| | | //package com.stylefeng.guns; |
| | | // |
| | | //import com.stylefeng.guns.modular.smallLogistics.server.IOrderLogisticsService; |
| | | //import org.junit.Test; |
| | | //import org.junit.runner.RunWith; |
| | | //import org.springframework.beans.factory.annotation.Autowired; |
| | | //import org.springframework.boot.test.context.SpringBootTest; |
| | | //import org.springframework.test.context.junit4.SpringRunner; |
| | | // |
| | | //@RunWith(SpringRunner.class) |
| | | //@SpringBootTest |
| | | //public class GunsApplicationTest { |
| | | // |
| | | // @Autowired |
| | | // private IOrderLogisticsService orderLogisticsService; |
| | | // |
| | | // |
| | | // @Test |
| | | // public void queryVipLevelList() throws Exception { |
| | | // orderLogisticsService.process(434, 6, 104.0560028754, 30.5855897352, "四川省成都市武侯区石羊街道天府新谷成都高新技术产业开发区(南区)", ""); |
| | | // } |
| | | //} |
| | | package com.stylefeng.guns; |
| | | |
| | | import com.stylefeng.guns.modular.system.util.qianyuntong.EnterpriseUtil; |
| | | import com.stylefeng.guns.modular.system.util.qianyuntong.model.CreateEnterpriseRequest; |
| | | import org.junit.Test; |
| | | import org.junit.runner.RunWith; |
| | | import org.springframework.boot.test.context.SpringBootTest; |
| | | import org.springframework.test.context.junit4.SpringRunner; |
| | | |
| | | @RunWith(SpringRunner.class) |
| | | @SpringBootTest |
| | | public class GunsApplicationTest { |
| | | |
| | | |
| | | @Test |
| | | public void test() throws Exception { |
| | | CreateEnterpriseRequest request = new CreateEnterpriseRequest(); |
| | | request.setName("成都喜望科技有限公司"); |
| | | request.setNickName("成都喜望"); |
| | | request.setIndustry_code("123456789"); |
| | | request.setMobile("15828353127"); |
| | | request.setMobileFlag("1"); |
| | | Boolean enterprise = EnterpriseUtil.createEnterprise(request); |
| | | |
| | | } |
| | | } |