app菜单相关,支付宝自动打款,详情,实名,商户相关
This commit is contained in:
@@ -34,6 +34,11 @@
|
||||
<artifactId>oss-service</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.chaozhanggui.system</groupId>
|
||||
<artifactId>aliPay-service-api</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.jsonwebtoken</groupId>
|
||||
<artifactId>jjwt</artifactId>
|
||||
|
||||
@@ -4,6 +4,8 @@ import com.chaozhanggui.common.system.CommonConfig;
|
||||
import com.chaozhanggui.common.system.util.ExceptionUtil;
|
||||
import com.chaozhanggui.common.system.util.SpringContextHolder;
|
||||
import com.chaozhanggui.dao.system.DaoConfig;
|
||||
import com.chaozhanggui.system.AliPayServiceConfig;
|
||||
import com.chaozhanggui.system.config.AliPayConfig;
|
||||
import com.dianguang.cloud.ossservice.OssServiceConfig;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
@@ -27,9 +29,9 @@ import org.springframework.web.client.RestTemplate;
|
||||
*/
|
||||
@SpringBootApplication
|
||||
@EnableScheduling
|
||||
@EntityScan(basePackageClasses = {Shell.class, DaoConfig.class, OssServiceConfig.class, CommonConfig.class})
|
||||
@MapperScan(basePackageClasses ={Shell.class,DaoConfig.class, OssServiceConfig.class, CommonConfig.class} )
|
||||
@ComponentScan(basePackageClasses ={ Shell.class, DaoConfig.class, OssServiceConfig.class, CommonConfig.class})
|
||||
@EntityScan(basePackageClasses = {Shell.class, DaoConfig.class, OssServiceConfig.class, CommonConfig.class, AliPayServiceConfig.class})
|
||||
@MapperScan(basePackageClasses ={Shell.class,DaoConfig.class, OssServiceConfig.class, CommonConfig.class, AliPayServiceConfig.class} )
|
||||
@ComponentScan(basePackageClasses ={ Shell.class, DaoConfig.class, OssServiceConfig.class, CommonConfig.class, AliPayServiceConfig.class})
|
||||
@Slf4j
|
||||
public class Shell {
|
||||
|
||||
|
||||
@@ -6,13 +6,13 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.chaozhanggui.admin.system.service.AppMenuService;
|
||||
import com.chaozhanggui.common.system.config.RespBody;
|
||||
import com.chaozhanggui.dao.system.entity.TbPlussAppMenu;
|
||||
import com.chaozhanggui.system.service.AliPayService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import static com.chaozhanggui.common.system.util.AlipayTransfer.testAlipayTransfer;
|
||||
|
||||
/**
|
||||
* app菜单相关
|
||||
@@ -49,9 +49,17 @@ public class AppMenuController {
|
||||
return appMenuService.saveAppMenu(entity);
|
||||
}
|
||||
|
||||
|
||||
@Resource
|
||||
private AliPayService aliPayService;
|
||||
@PostMapping("/AlipayTransferTest")
|
||||
public RespBody AlipayTransferTest() throws Exception{
|
||||
String s = testAlipayTransfer();
|
||||
Long l = System.currentTimeMillis();
|
||||
String amount = "0.20";
|
||||
String accountNo = "15619297581";
|
||||
String accountName = "刘一帆";
|
||||
String remake = "11111111111111";
|
||||
String s = aliPayService.alipayTransfer(amount, accountNo, accountName,remake, l.toString());
|
||||
return new RespBody(s);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.chaozhanggui.admin.system.controller;
|
||||
|
||||
|
||||
import com.chaozhanggui.admin.system.service.DictService;
|
||||
import com.chaozhanggui.common.system.config.RespBody;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 字典类
|
||||
* @author lyf
|
||||
*/
|
||||
@CrossOrigin(origins = "*")
|
||||
@RestController
|
||||
@RequestMapping("/dict")
|
||||
@Slf4j
|
||||
public class DictController {
|
||||
@Resource
|
||||
private DictService dictService;
|
||||
|
||||
@GetMapping("/getGroup/{code}")
|
||||
@ResponseBody
|
||||
public RespBody getGroupByCode(@PathVariable(name = "code") String code){
|
||||
return dictService.getGroupByCode(code);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.chaozhanggui.admin.system.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.chaozhanggui.admin.system.service.MerchantInfoService;
|
||||
import com.chaozhanggui.common.system.config.RespBody;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* @author lyf
|
||||
*/
|
||||
@CrossOrigin(origins = "*")
|
||||
@RestController
|
||||
@RequestMapping("/merchantInfo")
|
||||
@Slf4j
|
||||
public class MerchantInfoController {
|
||||
|
||||
@Resource
|
||||
private MerchantInfoService merchantInfoService;
|
||||
|
||||
|
||||
/**
|
||||
* 实名认证信息
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/detail/audit/{userId}")
|
||||
public RespBody auditInfo(@PathVariable("userId") Integer userId) {
|
||||
return merchantInfoService.merchantReal(userId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 商户基本信息
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/detail/merchBaseInfo/{userId}")
|
||||
public RespBody merchBaseInfo(@PathVariable("userId") Integer userId){
|
||||
return merchantInfoService.merchantBaseInfo(userId);
|
||||
}
|
||||
/**
|
||||
* 结算信息
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/detail/merchBaseAccount/{userId}")
|
||||
public RespBody merchBaseAccount(@PathVariable("userId") Integer userId){
|
||||
return merchantInfoService.merchantBaseInfo(userId);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.chaozhanggui.admin.system.service;
|
||||
|
||||
import com.chaozhanggui.common.system.config.RespBody;
|
||||
import com.chaozhanggui.dao.system.dao.TbPlussDictMapper;
|
||||
import com.chaozhanggui.dao.system.entity.TbPlussDict;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lyf
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class DictService {
|
||||
@Resource
|
||||
private TbPlussDictMapper dictMapper;
|
||||
public RespBody getGroupByCode(String code){
|
||||
TbPlussDict dict = dictMapper.selectByCode(code);
|
||||
if (dict == null){
|
||||
log.error("对应字典项不匹配");
|
||||
return new RespBody("000070");
|
||||
}
|
||||
List<TbPlussDict> dictsList = dictMapper.selectByPId(dict.getId());
|
||||
return new RespBody("000000",dictsList);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package com.chaozhanggui.admin.system.service;
|
||||
|
||||
import com.chaozhanggui.common.system.config.RespBody;
|
||||
import com.chaozhanggui.dao.system.dao.TbPlussBankCardMapper;
|
||||
import com.chaozhanggui.dao.system.dao.TbPlussIdCardMapper;
|
||||
import com.chaozhanggui.dao.system.dao.TbPlussMerchantBaseInfoMapper;
|
||||
import com.chaozhanggui.dao.system.dao.TbPlussMerchantImageMapper;
|
||||
import com.chaozhanggui.dao.system.entity.TbPlussBankCard;
|
||||
import com.chaozhanggui.dao.system.entity.TbPlussIdCard;
|
||||
import com.chaozhanggui.dao.system.entity.TbPlussMerchantBaseInfo;
|
||||
import com.chaozhanggui.dao.system.entity.TbPlussMerchantImage;
|
||||
import com.chaozhanggui.dao.system.entity.VO.MerchantBaseVO;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import static com.chaozhanggui.dao.system.entity.TbPlussBankCard.ACCOUNT_TYPE_CERT;
|
||||
import static com.chaozhanggui.dao.system.entity.TbPlussIdCard.TYPE_CERT;
|
||||
|
||||
/**
|
||||
* @author lyf
|
||||
*/
|
||||
@Service
|
||||
public class MerchantInfoService {
|
||||
@Resource
|
||||
private TbPlussIdCardMapper idCardMapper;
|
||||
@Resource
|
||||
private TbPlussBankCardMapper bankCardMapper;
|
||||
@Resource
|
||||
private TbPlussMerchantBaseInfoMapper merchantBaseInfoMapper;
|
||||
@Resource
|
||||
private TbPlussMerchantImageMapper merchantImageMapper;
|
||||
|
||||
public RespBody merchantReal(Integer userId){
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
//身份证
|
||||
TbPlussIdCard idCard = idCardMapper.selectCertByUserId(userId,TYPE_CERT);
|
||||
//银行卡
|
||||
TbPlussBankCard bankCard = bankCardMapper.selectByUserIdCert(userId, ACCOUNT_TYPE_CERT);
|
||||
map.put("idCard",idCard);
|
||||
map.put("bankCard",bankCard);
|
||||
return new RespBody("000000",map);
|
||||
}
|
||||
|
||||
public RespBody merchantBaseInfo(Integer userId){
|
||||
MerchantBaseVO merchantBaseVO = new MerchantBaseVO();
|
||||
//商户基础信息相关
|
||||
TbPlussMerchantBaseInfo merchantBaseInfo = merchantBaseInfoMapper.selectByUserId(userId.toString());
|
||||
if (merchantBaseInfo == null){
|
||||
return new RespBody("000000",merchantBaseVO);
|
||||
}
|
||||
merchantBaseVO.setMerchantBaseInfo(merchantBaseInfo);
|
||||
//图片
|
||||
List<TbPlussMerchantImage> merchantImages = merchantImageMapper.selectByMerchantCode(merchantBaseInfo.getMerchantcode());
|
||||
if (merchantImages == null){
|
||||
return new RespBody("000000",merchantBaseVO);
|
||||
}
|
||||
merchantBaseVO.setMerchantImagesList(merchantImages);
|
||||
|
||||
return new RespBody("000000",merchantBaseVO);
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,7 @@ import cn.hutool.crypto.digest.MD5;
|
||||
import cn.hutool.json.JSONArray;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.alipay.api.AlipayApiException;
|
||||
import com.chaozhanggui.admin.system.util.RedisCst;
|
||||
import com.chaozhanggui.admin.system.util.RedisUtil;
|
||||
import com.chaozhanggui.admin.system.util.StringUtil;
|
||||
@@ -13,12 +14,14 @@ import com.chaozhanggui.common.system.config.RespBody;
|
||||
import com.chaozhanggui.dao.system.dao.*;
|
||||
import com.chaozhanggui.dao.system.entity.*;
|
||||
import com.chaozhanggui.dao.system.model.CashStatus;
|
||||
import com.chaozhanggui.system.service.AliPayService;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -46,6 +49,8 @@ public class Userservice {
|
||||
|
||||
@Autowired
|
||||
TbPlussMerchantBaseInfoMapper baseInfoMapper;
|
||||
@Resource
|
||||
AliPayService aliPayService;
|
||||
|
||||
public RespBody doLogin(String loginName,String password,String userType,String ip) throws Exception {
|
||||
Boolean flag=false;
|
||||
@@ -317,7 +322,7 @@ public class Userservice {
|
||||
|
||||
|
||||
|
||||
public RespBody modifyOutFlow(Integer id,String userId,String status) throws Exception{
|
||||
public RespBody modifyOutFlow(Integer id,String userId,String status) throws Exception{
|
||||
if(ObjectUtil.isEmpty(id)||ObjectUtil.isEmpty(userId)||ObjectUtil.isEmpty(status)){
|
||||
log.error("参数错误");
|
||||
return new RespBody("000019");
|
||||
@@ -435,6 +440,15 @@ public class Userservice {
|
||||
cashStatusList.stream().filter(it->{
|
||||
if(it.getUserId().toString().equals(userId))
|
||||
it.setStatus("2");
|
||||
if(it.getUserType().equals("MG")){
|
||||
//支付宝打款
|
||||
try {
|
||||
aliPayService.alipayTransfer(cash.getVirrealcashamt().toString(),cash.getAccountno(),cash.getAccountname(),"",cash.getCashnumber());
|
||||
} catch (AlipayApiException e) {
|
||||
e.printStackTrace();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}).collect(Collectors.toList());
|
||||
cash.setStatus(2);
|
||||
|
||||
@@ -25,4 +25,11 @@ cloudstorage:
|
||||
qcloudRegion:
|
||||
qcloudAppId:
|
||||
|
||||
alipay-config:
|
||||
privateKey: MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCgreXshrn3IRi7qK9Y3IXN90JRJrZzkLUkjJ42zvCPjUHlVEJ42ZsWxBUwyqXhVGs1kl8+aDEmLfDY5IimjjDWJ6MH0N1+FvHPBINenwiM0qACYioBk3eIzWbtLafokQxDY0cXQ5GZBwNz6CefAt4T6JZNFSaUw05LPDigbsIfr2jYy5uhncAd4EHkY7tpdONQ+UyqU0rOF8fZomljem/YrLukj2nUFlK040n2kvAws3xItZbH5mwpqKs07shav+xkP4LH1KmXe5nSqc6K+KQ6Y0ZRCNjvH1S0ZqdIHmoFaWxHiDAyuXmuUEdTBU/czPIH7PrfVypOaVLEmSGn7bbfAgMBAAECggEAcC3Yt5C8JvBhbyru+PBFLq4xC60mdnqSLSlLkGJcCy0I045HNk5ee798N+tTcoTYsLc3bb+aiNhMLXEogngFWo6jwOIusUhdnDW/bgFEG+U1N1THlQAa1VTqRi646qLR1/5o9LIE5bzCyVpMxzReTbH1tW1N2VCdyeMKed+6Ahn+KrefQr0IWziSWI8lQDsm/eWbrsAl3zv5srSGUfF3mJNPzsXIiviDsIefkJjBv+A/4dlg+RJMv8fBWkRPo9xv0nVwT92tEwTCKw6VwxSWzPMMjMlUbP/h26yd2EeAfsGcLzmZXG5NCNZEl+sAoQfBkSFyWM+t+RPFFZuCsbFnAQKBgQDYEE/a16Q4jx5nErxfvNklx3mWnFST6bGaA/S0QQ3gyuB+9wZnjAvrE59Y7gIR4BMcGYjBpge2OAupUmNONAQBKsF7DadgXwIV+Ih3gR1OX69sTU+i3V98gcwyG+5q5fQ+NUMQu+8goYJY4lcXrZ8+HkyikWiK5SCAFYtvCjLlgQKBgQC+YOjeAn0EeeZAtYZcGOz2RTJ3/LUTLgqmiatDLCv49jRB5zSPwiVefMi9HbaX+2c2eQ5NMXkSmMoi0ptETcxMF3kf6D8PzPekeNhwHJTScO35t4JC6HZIM4HQeQFQIbZBhUP+ujfFyGXmngZazlrHS1wqv5P054x0Y40PnYiMXwKBgQDR98gim7zzWeHpuMNnJla/6AG442Mt+sSlL4L2SOH7uixANj77EZXjdMY93c4VIPRxMj88MOT9p6lteqsWrGXX3Hz54GLvvGSChWvY9phMOaB4Vwk09Hx+uoR9jbc8GwwoCAqMkJXp2Aqb5hlM4WUHMNq4gSZfFBtpXYaK+hZMAQKBgBt1xQEI4Nl9b73TsR6lpcBb+Myf0cqDcJvW7bIRtAIEGUOMQuOdgGBhpV7J42WGqLuNuIdf5HPPQBDHygePJTGwjRMSH856pRm/KJD7PmggS+MiGhLmjvEZJNdaLNtPEYff3g/m8lZ/8lrSXl5It4VZlGDCI2hG4daD6XvgICsHAoGBAIjPTzKO2Eya07CbxhT9iONVqPFyJc2c+6ZChyPcL/b5BM0hpzEeAEX9JcQp82qGuxTlvEezXFcMK9uZNVcVlZwsARzuvz1HyHNOUj4ngV3YgYV30YPpaskr/GAZtc6Z780N1DcgVDmCqgZ37+fRo/W3dqwinrbswP3PQnFEmmFL
|
||||
alipayAppId: 2021003175618263
|
||||
appCertPublicKeyPath: /home/www/service/key/appCertPublicKey_2021003175618263.crt
|
||||
alipayCertPublicKeyPath: /home/www/service/key/alipayCertPublicKey_RSA2.crt
|
||||
alipayRootCertPath: /home/www/service/key/alipayRootCert.crt
|
||||
|
||||
|
||||
|
||||
38
newadmin/aliPay-service-api/pom.xml
Normal file
38
newadmin/aliPay-service-api/pom.xml
Normal file
@@ -0,0 +1,38 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.chaozhanggui.system</groupId>
|
||||
<artifactId>ysk-system</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>aliPay-service-api</artifactId>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.alipay.sdk</groupId>
|
||||
<artifactId>alipay-sdk-java</artifactId>
|
||||
<version>4.38.37.ALL</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-lang</groupId>
|
||||
<artifactId>commons-lang</artifactId>
|
||||
<version>2.5</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.8</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<properties>
|
||||
<maven.compiler.source>8</maven.compiler.source>
|
||||
<maven.compiler.target>8</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.chaozhanggui.system;
|
||||
|
||||
import org.springframework.boot.autoconfigure.domain.EntityScan;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration
|
||||
@EntityScan(basePackageClasses = AliPayServiceConfig.class)
|
||||
@ComponentScan(basePackageClasses = AliPayServiceConfig.class)
|
||||
public class AliPayServiceConfig {
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.chaozhanggui.system.config;
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author lyf
|
||||
*/
|
||||
@Configuration
|
||||
@ConfigurationProperties(prefix = "alipay-config")
|
||||
@Data
|
||||
public class AliPayConfig implements Serializable {
|
||||
/**
|
||||
* 应用私钥
|
||||
*/
|
||||
private String privateKey;
|
||||
/**
|
||||
* 支付宝AppID
|
||||
*/
|
||||
private String alipayAppId;
|
||||
/**
|
||||
* app公钥证书路径
|
||||
*/
|
||||
private String appCertPublicKeyPath;
|
||||
/**
|
||||
* 阿里公钥证书路径
|
||||
*/
|
||||
private String alipayCertPublicKeyPath;
|
||||
/**
|
||||
* 阿里根证书路径
|
||||
*/
|
||||
private String alipayRootCertPath;
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
package com.chaozhanggui.system.service;
|
||||
|
||||
import com.alipay.api.AlipayApiException;
|
||||
import com.alipay.api.AlipayClient;
|
||||
import com.alipay.api.CertAlipayRequest;
|
||||
import com.alipay.api.DefaultAlipayClient;
|
||||
import com.alipay.api.domain.AlipayFundTransUniTransferModel;
|
||||
import com.alipay.api.domain.Participant;
|
||||
import com.alipay.api.request.AlipayFundTransUniTransferRequest;
|
||||
import com.alipay.api.response.AlipayFundTransUniTransferResponse;
|
||||
import com.chaozhanggui.system.config.AliPayConfig;
|
||||
import org.springframework.boot.autoconfigure.domain.EntityScan;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* @author lyf
|
||||
*/
|
||||
@Service
|
||||
public class AliPayService {
|
||||
@Resource
|
||||
AliPayConfig aliPayConfig;
|
||||
public String alipayTransfer(String amount, String accountNo, String accountName,String remake,
|
||||
String cashNumber) throws AlipayApiException {
|
||||
CertAlipayRequest alipayConfig = new CertAlipayRequest();
|
||||
alipayConfig.setPrivateKey(aliPayConfig.getPrivateKey());
|
||||
alipayConfig.setServerUrl("https://openapi.alipay.com/gateway.do");
|
||||
alipayConfig.setAppId(aliPayConfig.getAlipayAppId());
|
||||
alipayConfig.setCharset("UTF8");
|
||||
alipayConfig.setSignType("RSA2");
|
||||
alipayConfig.setEncryptor("");
|
||||
alipayConfig.setFormat("json");
|
||||
alipayConfig.setCertPath(aliPayConfig.getAppCertPublicKeyPath());
|
||||
alipayConfig.setAlipayPublicCertPath(aliPayConfig.getAlipayCertPublicKeyPath());
|
||||
alipayConfig.setRootCertPath(aliPayConfig.getAlipayRootCertPath());
|
||||
AlipayClient alipayClient = new DefaultAlipayClient(alipayConfig);
|
||||
AlipayFundTransUniTransferRequest request = new AlipayFundTransUniTransferRequest();
|
||||
AlipayFundTransUniTransferModel model = new AlipayFundTransUniTransferModel();
|
||||
//商家侧唯一订单号
|
||||
model.setOutBizNo(cashNumber);
|
||||
model.setRemark(remake);
|
||||
model.setBusinessParams("{\"payer_show_name_use_alias\":\"true\"}");
|
||||
model.setBizScene("DIRECT_TRANSFER");
|
||||
//收款方信息
|
||||
Participant payeeInfo = new Participant();
|
||||
//登录号
|
||||
payeeInfo.setIdentity(accountNo);
|
||||
payeeInfo.setIdentityType("ALIPAY_LOGON_ID");
|
||||
//实名
|
||||
payeeInfo.setName(accountName);
|
||||
model.setPayeeInfo(payeeInfo);
|
||||
//打款金额
|
||||
model.setTransAmount(amount);
|
||||
model.setProductCode("TRANS_ACCOUNT_NO_PWD");
|
||||
model.setOrderTitle("");
|
||||
request.setBizModel(model);
|
||||
AlipayFundTransUniTransferResponse response = alipayClient.certificateExecute(request);
|
||||
if (response.isSuccess()) {
|
||||
System.out.println("调用成功");
|
||||
return response.getSubMsg();
|
||||
} else {
|
||||
System.out.println("调用失败");
|
||||
return response.getSubMsg();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,62 +0,0 @@
|
||||
package com.chaozhanggui.common.system.util;
|
||||
|
||||
import com.alipay.api.AlipayApiException;
|
||||
import com.alipay.api.AlipayClient;
|
||||
import com.alipay.api.CertAlipayRequest;
|
||||
import com.alipay.api.DefaultAlipayClient;
|
||||
import com.alipay.api.domain.AlipayFundTransUniTransferModel;
|
||||
import com.alipay.api.domain.Participant;
|
||||
import com.alipay.api.request.AlipayFundTransUniTransferRequest;
|
||||
import com.alipay.api.response.AlipayFundTransUniTransferResponse;
|
||||
|
||||
/**
|
||||
* 支付宝单笔转账
|
||||
* @author lyf
|
||||
*/
|
||||
public class AlipayTransfer {
|
||||
|
||||
public static String testAlipayTransfer() throws AlipayApiException {
|
||||
String privateKey = "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCgreXshrn3IRi7qK9Y3IXN90JRJrZzkLUkjJ42zvCPjUHlVEJ42ZsWxBUwyqXhVGs1kl8+aDEmLfDY5IimjjDWJ6MH0N1+FvHPBINenwiM0qACYioBk3eIzWbtLafokQxDY0cXQ5GZBwNz6CefAt4T6JZNFSaUw05LPDigbsIfr2jYy5uhncAd4EHkY7tpdONQ+UyqU0rOF8fZomljem/YrLukj2nUFlK040n2kvAws3xItZbH5mwpqKs07shav+xkP4LH1KmXe5nSqc6K+KQ6Y0ZRCNjvH1S0ZqdIHmoFaWxHiDAyuXmuUEdTBU/czPIH7PrfVypOaVLEmSGn7bbfAgMBAAECggEAcC3Yt5C8JvBhbyru+PBFLq4xC60mdnqSLSlLkGJcCy0I045HNk5ee798N+tTcoTYsLc3bb+aiNhMLXEogngFWo6jwOIusUhdnDW/bgFEG+U1N1THlQAa1VTqRi646qLR1/5o9LIE5bzCyVpMxzReTbH1tW1N2VCdyeMKed+6Ahn+KrefQr0IWziSWI8lQDsm/eWbrsAl3zv5srSGUfF3mJNPzsXIiviDsIefkJjBv+A/4dlg+RJMv8fBWkRPo9xv0nVwT92tEwTCKw6VwxSWzPMMjMlUbP/h26yd2EeAfsGcLzmZXG5NCNZEl+sAoQfBkSFyWM+t+RPFFZuCsbFnAQKBgQDYEE/a16Q4jx5nErxfvNklx3mWnFST6bGaA/S0QQ3gyuB+9wZnjAvrE59Y7gIR4BMcGYjBpge2OAupUmNONAQBKsF7DadgXwIV+Ih3gR1OX69sTU+i3V98gcwyG+5q5fQ+NUMQu+8goYJY4lcXrZ8+HkyikWiK5SCAFYtvCjLlgQKBgQC+YOjeAn0EeeZAtYZcGOz2RTJ3/LUTLgqmiatDLCv49jRB5zSPwiVefMi9HbaX+2c2eQ5NMXkSmMoi0ptETcxMF3kf6D8PzPekeNhwHJTScO35t4JC6HZIM4HQeQFQIbZBhUP+ujfFyGXmngZazlrHS1wqv5P054x0Y40PnYiMXwKBgQDR98gim7zzWeHpuMNnJla/6AG442Mt+sSlL4L2SOH7uixANj77EZXjdMY93c4VIPRxMj88MOT9p6lteqsWrGXX3Hz54GLvvGSChWvY9phMOaB4Vwk09Hx+uoR9jbc8GwwoCAqMkJXp2Aqb5hlM4WUHMNq4gSZfFBtpXYaK+hZMAQKBgBt1xQEI4Nl9b73TsR6lpcBb+Myf0cqDcJvW7bIRtAIEGUOMQuOdgGBhpV7J42WGqLuNuIdf5HPPQBDHygePJTGwjRMSH856pRm/KJD7PmggS+MiGhLmjvEZJNdaLNtPEYff3g/m8lZ/8lrSXl5It4VZlGDCI2hG4daD6XvgICsHAoGBAIjPTzKO2Eya07CbxhT9iONVqPFyJc2c+6ZChyPcL/b5BM0hpzEeAEX9JcQp82qGuxTlvEezXFcMK9uZNVcVlZwsARzuvz1HyHNOUj4ngV3YgYV30YPpaskr/GAZtc6Z780N1DcgVDmCqgZ37+fRo/W3dqwinrbswP3PQnFEmmFL";
|
||||
CertAlipayRequest alipayConfig = new CertAlipayRequest();
|
||||
alipayConfig.setPrivateKey(privateKey);
|
||||
alipayConfig.setServerUrl("https://openapi.alipay.com/gateway.do");
|
||||
alipayConfig.setAppId("2021003175618263");
|
||||
alipayConfig.setCharset("UTF8");
|
||||
alipayConfig.setSignType("RSA2");
|
||||
alipayConfig.setEncryptor("");
|
||||
alipayConfig.setFormat("json");
|
||||
alipayConfig.setCertPath("/home/www/service/admin/appCertPublicKey_2021003175618263.crt");
|
||||
alipayConfig.setAlipayPublicCertPath("/home/www/service/admin/alipayCertPublicKey_RSA2.crt");
|
||||
alipayConfig.setRootCertPath("/home/www/service/admin/alipayRootCert.crt");
|
||||
AlipayClient alipayClient = new DefaultAlipayClient(alipayConfig);
|
||||
AlipayFundTransUniTransferRequest request = new AlipayFundTransUniTransferRequest();
|
||||
AlipayFundTransUniTransferModel model = new AlipayFundTransUniTransferModel();
|
||||
//商家侧唯一订单号
|
||||
model.setOutBizNo("1690966827");
|
||||
model.setRemark("测试测测测");
|
||||
model.setBusinessParams("{\"payer_show_name_use_alias\":\"true\"}");
|
||||
model.setBizScene("DIRECT_TRANSFER");
|
||||
//收款方信息
|
||||
Participant payeeInfo = new Participant();
|
||||
payeeInfo.setIdentity("15619297581");
|
||||
payeeInfo.setIdentityType("ALIPAY_LOGON_ID");
|
||||
payeeInfo.setName("刘一帆");
|
||||
model.setPayeeInfo(payeeInfo);
|
||||
model.setTransAmount("0.20");
|
||||
model.setProductCode("TRANS_ACCOUNT_NO_PWD");
|
||||
model.setOrderTitle("测试测测测");
|
||||
request.setBizModel(model);
|
||||
AlipayFundTransUniTransferResponse response = alipayClient.certificateExecute(request);
|
||||
System.out.println(response.getBody());
|
||||
if (response.isSuccess()) {
|
||||
System.out.println("调用成功");
|
||||
return response.getBody();
|
||||
} else {
|
||||
System.out.println("调用失败");
|
||||
return response.getBody();
|
||||
// sdk版本是"4.38.0.ALL"及以上,可以参考下面的示例获取诊断链接
|
||||
// String diagnosisUrl = DiagnosisUtils.getDiagnosisUrl(response);
|
||||
// System.out.println(diagnosisUrl);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -73,7 +73,7 @@ public class ExceptionUtil {
|
||||
map.put("000051","修改错误");
|
||||
map.put("000052","增加错误");
|
||||
|
||||
|
||||
map.put("000070","对应字典项不匹配");
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.chaozhanggui.dao.system.dao;
|
||||
import com.chaozhanggui.dao.system.entity.TbPlussBankCard;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@@ -15,6 +16,7 @@ public interface TbPlussBankCardMapper {
|
||||
int insertSelective(TbPlussBankCard record);
|
||||
|
||||
TbPlussBankCard selectByPrimaryKey(Integer id);
|
||||
TbPlussBankCard selectByUserIdCert(@Param("userId") Integer userId,@Param("type") String type);
|
||||
|
||||
int updateByPrimaryKeySelective(TbPlussBankCard record);
|
||||
|
||||
|
||||
@@ -3,8 +3,11 @@ package com.chaozhanggui.dao.system.dao;
|
||||
import com.chaozhanggui.dao.system.entity.TbPlussDict;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Component
|
||||
@Mapper
|
||||
public interface TbPlussDictMapper {
|
||||
@@ -15,6 +18,9 @@ public interface TbPlussDictMapper {
|
||||
int insertSelective(TbPlussDict record);
|
||||
|
||||
TbPlussDict selectByPrimaryKey(Integer id);
|
||||
TbPlussDict selectByCode(@Param("code") String code);
|
||||
|
||||
List<TbPlussDict> selectByPId(@Param("id")Integer id);
|
||||
|
||||
int updateByPrimaryKeySelective(TbPlussDict record);
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@ public interface TbPlussIdCardMapper {
|
||||
int insertSelective(TbPlussIdCard record);
|
||||
|
||||
TbPlussIdCard selectByPrimaryKey(Integer id);
|
||||
TbPlussIdCard selectCertByUserId(Integer userId, String type);
|
||||
|
||||
int updateByPrimaryKeySelective(TbPlussIdCard record);
|
||||
|
||||
|
||||
@@ -5,6 +5,8 @@ import com.chaozhanggui.dao.system.entity.TbPlussMerchantImage;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Component
|
||||
@Mapper
|
||||
public interface TbPlussMerchantImageMapper {
|
||||
@@ -15,6 +17,7 @@ public interface TbPlussMerchantImageMapper {
|
||||
int insertSelective(TbPlussMerchantImage record);
|
||||
|
||||
TbPlussMerchantImage selectByPrimaryKey(Integer id);
|
||||
List<TbPlussMerchantImage> selectByMerchantCode(String merchantCode);
|
||||
|
||||
int updateByPrimaryKeySelective(TbPlussMerchantImage record);
|
||||
|
||||
|
||||
@@ -4,6 +4,20 @@ import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
public class TbPlussBankCard implements Serializable {
|
||||
/**
|
||||
* 对私账户
|
||||
*/
|
||||
public static final String ACCOUNT_TYPE_PRIVATE = "01";
|
||||
|
||||
/**
|
||||
* 对公账户
|
||||
*/
|
||||
public static final String ACCOUNT_TYPE_CORPORATE = "02";
|
||||
|
||||
/**
|
||||
* 实名认证
|
||||
*/
|
||||
public static final String ACCOUNT_TYPE_CERT = "03";
|
||||
private Integer id;
|
||||
|
||||
private String userid;
|
||||
|
||||
@@ -4,6 +4,15 @@ import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
public class TbPlussIdCard implements Serializable {
|
||||
|
||||
/** 实名人 */
|
||||
public static final String TYPE_CERT = "01";
|
||||
|
||||
/** 结算人 */
|
||||
public static final String TYPE_ACCOUNT = "02";
|
||||
|
||||
/** 法人 */
|
||||
public static final String TYPE_LEGAL = "03";
|
||||
private Integer id;
|
||||
|
||||
private Integer userid;
|
||||
|
||||
@@ -4,6 +4,97 @@ import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
public class TbPlussMerchantImage implements Serializable {
|
||||
|
||||
/**
|
||||
* 商户负责人与收银台合照
|
||||
*/
|
||||
public static final String CASH_DESK_WITH_PERSON = "999";
|
||||
|
||||
/**
|
||||
* 身份证正面
|
||||
*/
|
||||
public static final String IDCARD_FRONT = "01";
|
||||
/**
|
||||
* 身份证反面
|
||||
*/
|
||||
public static final String IDCARD_BACK = "02";
|
||||
/**
|
||||
* 营业执照
|
||||
*/
|
||||
public static final String BUSINESS_LICENSE = "03";
|
||||
/**
|
||||
* 组织机构代码证
|
||||
*/
|
||||
public static final String ORGANIZATION_CARD = "04";
|
||||
/**
|
||||
* 开户许可证
|
||||
*/
|
||||
public static final String ACCOUNT_PERMITS = "05";
|
||||
/**
|
||||
* 门头照
|
||||
*/
|
||||
public static final String SHOP_FRONT_DOOR = "06";
|
||||
/**
|
||||
* 非法人结算授权书
|
||||
*/
|
||||
public static final String NON_LEG_SETTLE_AUTH = "07";
|
||||
/**
|
||||
* 法人/非法人手持结算授权书
|
||||
*/
|
||||
public static final String HAND_NON_LEG_SETTLE_AUTH = "B004";
|
||||
/**
|
||||
* 其他
|
||||
*/
|
||||
public static final String OTHER = "08";
|
||||
/**
|
||||
* 收银台照片
|
||||
*/
|
||||
public static final String CASH_DESK_PHOTO = "08";
|
||||
/**
|
||||
* 门店内景照片
|
||||
*/
|
||||
public static final String STORE_INTERIOR_PHOTO = "09";
|
||||
/**
|
||||
* 各大餐饮平台入驻
|
||||
*/
|
||||
public static final String MERCHANT_PLATFORM = "10";
|
||||
/**
|
||||
* 手持身份证
|
||||
*/
|
||||
public static final String HAND_IDCARD_PHOTO = "11";
|
||||
/**
|
||||
* 租赁合同
|
||||
*/
|
||||
public static final String TENANCY_AGREEMENTS = "12";
|
||||
/**
|
||||
* 变更申请表
|
||||
*/
|
||||
public static final String CHANGE_FORM = "13";
|
||||
/**
|
||||
* 结算人身份证正面
|
||||
*/
|
||||
public static final String SETTLE_IDCARD_FRONT = "96";
|
||||
/**
|
||||
* 结算人身份证反面
|
||||
*/
|
||||
public static final String SETTLE_IDCARD_BACK = "97";
|
||||
/**
|
||||
* 银行卡正面
|
||||
*/
|
||||
public static final String BANK_CARD_FRONT = "98";
|
||||
/**
|
||||
* 银行卡反面
|
||||
*/
|
||||
public static final String BANK_CARD_BACK = "99";
|
||||
|
||||
/**
|
||||
* 商户协议
|
||||
*/
|
||||
public static final String MERCHANT_PROTOCOL = "101";
|
||||
/**
|
||||
* 商户附属协议
|
||||
*/
|
||||
public static final String MERCHANT_SUB_PROTOCOL = "102";
|
||||
private Integer id;
|
||||
|
||||
private String merchantcode;
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.chaozhanggui.dao.system.entity.VO;
|
||||
|
||||
import com.chaozhanggui.dao.system.entity.TbPlussMerchantBaseInfo;
|
||||
import com.chaozhanggui.dao.system.entity.TbPlussMerchantImage;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lyf
|
||||
*/
|
||||
@Data
|
||||
public class MerchantBaseVO {
|
||||
/**
|
||||
* 商户基本信息
|
||||
*/
|
||||
private TbPlussMerchantBaseInfo merchantBaseInfo;
|
||||
/**
|
||||
* 图片
|
||||
*/
|
||||
private List<TbPlussMerchantImage> merchantImagesList;
|
||||
|
||||
}
|
||||
@@ -31,7 +31,14 @@
|
||||
from tb_pluss_bank_card
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
||||
<select id="selectByUserIdCert" resultType="com.chaozhanggui.dao.system.entity.TbPlussBankCard">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from tb_pluss_bank_card
|
||||
where `userId` = #{userId}
|
||||
AND `accountType` = #{type}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
||||
delete from tb_pluss_bank_card
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</delete>
|
||||
|
||||
@@ -20,6 +20,20 @@
|
||||
<include refid="Base_Column_List" />
|
||||
from tb_pluss_dict
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</select>
|
||||
<select id="selectByCode" resultType="com.chaozhanggui.dao.system.entity.TbPlussDict">
|
||||
SELECT*
|
||||
FROM
|
||||
tb_pluss_dict
|
||||
where code = #{code}
|
||||
LIMIT 1
|
||||
</select>
|
||||
<select id="selectByPId" resultType="com.chaozhanggui.dao.system.entity.TbPlussDict">
|
||||
select
|
||||
*
|
||||
from tb_pluss_dict
|
||||
where pid = #{id}
|
||||
ORDER BY sort
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
||||
delete from tb_pluss_dict
|
||||
|
||||
@@ -27,6 +27,13 @@
|
||||
from tb_pluss_id_card
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</select>
|
||||
<select id="selectCertByUserId" resultType="com.chaozhanggui.dao.system.entity.TbPlussIdCard">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from tb_pluss_id_card
|
||||
where `userId` = #{userId}
|
||||
AND `userType` = #{type}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
||||
delete from tb_pluss_id_card
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
|
||||
@@ -20,7 +20,14 @@
|
||||
from tb_pluss_merchant_image
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
||||
<select id="selectByMerchantCode" resultType="com.chaozhanggui.dao.system.entity.TbPlussMerchantImage">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from tb_pluss_merchant_image
|
||||
where merchantCode = #{merchantCode}
|
||||
AND photoType IN (06, 08, 09, 101, 102)
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
||||
delete from tb_pluss_merchant_image
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</delete>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<module>merchant-service-api</module>
|
||||
<module>lkl-service-api</module>
|
||||
<!-- <module>order-service</module>-->
|
||||
|
||||
<module>aliPay-service-api</module>
|
||||
</modules>
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user