分账提现接口
This commit is contained in:
@@ -1,17 +1,13 @@
|
|||||||
package com.czg.controller.user;
|
package com.czg.controller.user;
|
||||||
|
|
||||||
import com.czg.market.dto.MkDistributionWithdrawFlowDTO;
|
import com.czg.market.dto.MkDistributionWithdrawFlowDTO;
|
||||||
import com.czg.market.entity.MkDistributionFlow;
|
|
||||||
import com.czg.market.entity.MkDistributionWithdrawFlow;
|
|
||||||
import com.czg.market.service.MkDistributionFlowService;
|
|
||||||
import com.czg.market.service.MkDistributionUserService;
|
import com.czg.market.service.MkDistributionUserService;
|
||||||
import com.czg.market.service.MkDistributionWithdrawFlowService;
|
import com.czg.market.service.MkDistributionWithdrawFlowService;
|
||||||
import com.czg.market.vo.DistributionCenterShopVO;
|
import com.czg.market.vo.DistributionCenterShopVO;
|
||||||
import com.czg.order.dto.MkDistributionPayDTO;
|
import com.czg.order.dto.MkDistributionPayDTO;
|
||||||
import com.czg.resp.CzgResult;
|
import com.czg.resp.CzgResult;
|
||||||
import com.czg.sa.StpKit;
|
import com.czg.sa.StpKit;
|
||||||
import com.czg.service.Impl.AppWxServiceImpl;
|
import com.czg.service.market.service.impl.AppWxServiceImpl;
|
||||||
import com.czg.utils.AssertUtil;
|
|
||||||
import com.mybatisflex.core.paginate.Page;
|
import com.mybatisflex.core.paginate.Page;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|||||||
@@ -7,17 +7,15 @@ import cn.hutool.core.util.RandomUtil;
|
|||||||
import com.alibaba.fastjson2.JSONObject;
|
import com.alibaba.fastjson2.JSONObject;
|
||||||
import com.czg.CzgPayUtils;
|
import com.czg.CzgPayUtils;
|
||||||
import com.czg.entity.CzgBaseRespParams;
|
import com.czg.entity.CzgBaseRespParams;
|
||||||
import com.czg.market.service.MkDistributionConfigService;
|
|
||||||
import com.czg.market.service.MkDistributionUserService;
|
import com.czg.market.service.MkDistributionUserService;
|
||||||
import com.czg.mq.PrintMqListener;
|
import com.czg.mq.PrintMqListener;
|
||||||
import com.czg.order.entity.OrderPayment;
|
import com.czg.order.entity.OrderPayment;
|
||||||
import com.czg.order.service.OrderInfoService;
|
import com.czg.order.service.OrderInfoService;
|
||||||
import com.czg.order.service.OrderPaymentService;
|
import com.czg.order.service.OrderPaymentService;
|
||||||
import com.czg.order.service.ShopTableOrderStatisticService;
|
import com.czg.order.service.ShopTableOrderStatisticService;
|
||||||
import com.czg.service.Impl.WxServiceImpl;
|
import com.czg.service.market.service.impl.WxServiceImpl;
|
||||||
import com.czg.task.StatisticTask;
|
import com.czg.task.StatisticTask;
|
||||||
import com.czg.utils.AssertUtil;
|
import com.czg.utils.AssertUtil;
|
||||||
import com.ijpay.core.kit.AesUtil;
|
|
||||||
import com.mybatisflex.core.query.QueryWrapper;
|
import com.mybatisflex.core.query.QueryWrapper;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ public class Main {
|
|||||||
// String packageName = "product";
|
// String packageName = "product";
|
||||||
String packageName = "market";
|
String packageName = "market";
|
||||||
// tableName 指定需要生成的表
|
// tableName 指定需要生成的表
|
||||||
String tableName = "mk_distribution_flow";
|
String tableName = "mk_distribution_withdraw_flow";
|
||||||
String author = "ww";
|
String author = "ww";
|
||||||
//是否生成DTO实体 默认生成
|
//是否生成DTO实体 默认生成
|
||||||
boolean isGenerateDto = true;
|
boolean isGenerateDto = true;
|
||||||
|
|||||||
@@ -1,38 +1,30 @@
|
|||||||
package com.czg.service.Impl;
|
package com.czg.service.market.service.impl;
|
||||||
|
|
||||||
import com.czg.service.RedisService;
|
import com.czg.service.RedisService;
|
||||||
import com.czg.system.service.SysParamsService;
|
import com.czg.system.service.SysParamsService;
|
||||||
import com.czg.service.WxService;
|
|
||||||
import com.ijpay.core.kit.RsaKit;
|
import com.ijpay.core.kit.RsaKit;
|
||||||
import jakarta.annotation.PostConstruct;
|
import jakarta.annotation.PostConstruct;
|
||||||
import jakarta.annotation.Resource;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.dubbo.config.annotation.DubboReference;
|
import org.apache.dubbo.config.annotation.DubboReference;
|
||||||
import org.apache.dubbo.config.annotation.DubboService;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.context.annotation.Primary;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 微信支付service
|
* 微信支付service
|
||||||
* @author Administrator
|
* @author Administrator
|
||||||
*/
|
*/
|
||||||
@DubboService
|
@Component
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class AppWxServiceImpl implements WxService {
|
@Primary
|
||||||
|
public class AppWxServiceImpl extends BaseWx {
|
||||||
|
|
||||||
@Resource
|
|
||||||
private RedisService autoRedisService;
|
|
||||||
@DubboReference
|
@DubboReference
|
||||||
private SysParamsService paramsService;
|
private SysParamsService paramsService;
|
||||||
private static RedisService redisService;
|
|
||||||
private WxService.Config config = new Config();
|
|
||||||
|
|
||||||
@Override
|
public AppWxServiceImpl(@Autowired RedisService autoRedisService) {
|
||||||
public Config getConfig() {
|
this.redisService = autoRedisService;
|
||||||
return config;
|
config = new Config();
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public RedisService getRedisService() {
|
|
||||||
return redisService;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostConstruct
|
@PostConstruct
|
||||||
@@ -66,7 +58,10 @@ public class AppWxServiceImpl implements WxService {
|
|||||||
config.notifyUrl = paramsService.getSysParamValue("native_notify_url") + "/wx/pay";
|
config.notifyUrl = paramsService.getSysParamValue("native_notify_url") + "/wx/pay";
|
||||||
config.refundNotifyUrl = "";
|
config.refundNotifyUrl = "";
|
||||||
config.transferNotifyUrl = paramsService.getSysParamValue("native_notify_url") + "/wx/transfer";
|
config.transferNotifyUrl = paramsService.getSysParamValue("native_notify_url") + "/wx/transfer";
|
||||||
redisService = this.autoRedisService;
|
}
|
||||||
|
|
||||||
|
public BaseWx getAppService() {
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.czg.service;
|
package com.czg.service.market.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.util.IdUtil;
|
import cn.hutool.core.util.IdUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
@@ -6,6 +6,7 @@ import cn.hutool.http.HttpRequest;
|
|||||||
import cn.hutool.http.HttpUtil;
|
import cn.hutool.http.HttpUtil;
|
||||||
import com.alibaba.fastjson2.JSONObject;
|
import com.alibaba.fastjson2.JSONObject;
|
||||||
import com.czg.exception.CzgException;
|
import com.czg.exception.CzgException;
|
||||||
|
import com.czg.service.RedisService;
|
||||||
import com.ijpay.core.IJPayHttpResponse;
|
import com.ijpay.core.IJPayHttpResponse;
|
||||||
import com.ijpay.core.enums.RequestMethodEnum;
|
import com.ijpay.core.enums.RequestMethodEnum;
|
||||||
import com.ijpay.core.enums.SignType;
|
import com.ijpay.core.enums.SignType;
|
||||||
@@ -36,10 +37,12 @@ import java.util.Map;
|
|||||||
* 微信支付相关
|
* 微信支付相关
|
||||||
* @author Administrator
|
* @author Administrator
|
||||||
*/
|
*/
|
||||||
public interface WxService {
|
public abstract class BaseWx {
|
||||||
Logger log = LoggerFactory.getLogger(WxService.class);
|
public Config config;
|
||||||
|
public RedisService redisService;
|
||||||
|
public Logger log = LoggerFactory.getLogger(BaseWx.class);
|
||||||
@Data
|
@Data
|
||||||
class Config {
|
public static class Config {
|
||||||
public String appId;
|
public String appId;
|
||||||
public String appSecret;
|
public String appSecret;
|
||||||
public String certPath;
|
public String certPath;
|
||||||
@@ -56,11 +59,9 @@ public interface WxService {
|
|||||||
public String refundNotifyUrl;
|
public String refundNotifyUrl;
|
||||||
public String transferNotifyUrl;
|
public String transferNotifyUrl;
|
||||||
}
|
}
|
||||||
Config getConfig();
|
|
||||||
RedisService getRedisService();
|
|
||||||
|
|
||||||
|
|
||||||
default String getPhone(String code) {
|
String getPhone(String code) {
|
||||||
String requestBody = JSONObject.toJSONString(Map.of("code", code));
|
String requestBody = JSONObject.toJSONString(Map.of("code", code));
|
||||||
String response = HttpUtil.post("https://api.weixin.qq.com/wxa/business/getuserphonenumber?access_token=" + getAccessToken(false), requestBody);
|
String response = HttpUtil.post("https://api.weixin.qq.com/wxa/business/getuserphonenumber?access_token=" + getAccessToken(false), requestBody);
|
||||||
log.info("获取手机号响应: {}", response);
|
log.info("获取手机号响应: {}", response);
|
||||||
@@ -75,9 +76,8 @@ public interface WxService {
|
|||||||
throw new RuntimeException("获取手机号失败");
|
throw new RuntimeException("获取手机号失败");
|
||||||
}
|
}
|
||||||
|
|
||||||
default String getAccessToken(boolean refresh) {
|
String getAccessToken(boolean refresh) {
|
||||||
Object token = getRedisService().get("access_token");
|
Object token = redisService.get("access_token");
|
||||||
Config config = getConfig();
|
|
||||||
if (!refresh && token instanceof String) {
|
if (!refresh && token instanceof String) {
|
||||||
return (String) token;
|
return (String) token;
|
||||||
}
|
}
|
||||||
@@ -96,15 +96,15 @@ public interface WxService {
|
|||||||
if (expiresIn == null) {
|
if (expiresIn == null) {
|
||||||
expiresIn = 7200L;
|
expiresIn = 7200L;
|
||||||
}
|
}
|
||||||
getRedisService().set("access_token", accessToken, expiresIn - 200);
|
redisService.set("access_token", accessToken, expiresIn - 200);
|
||||||
return accessToken;
|
return accessToken;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 使用微信支付平台证书公钥加密敏感信息(OAEP)
|
* 使用微信支付平台证书公钥加密敏感信息(OAEP)
|
||||||
*/
|
*/
|
||||||
default String encryptByPlatformCert(String content) {
|
String encryptByPlatformCert(String content) {
|
||||||
Config config = getConfig();
|
|
||||||
|
|
||||||
try (var certStream = Thread.currentThread().getContextClassLoader().getResourceAsStream(config.getPlatformCertPath())) {
|
try (var certStream = Thread.currentThread().getContextClassLoader().getResourceAsStream(config.getPlatformCertPath())) {
|
||||||
if (certStream == null) {
|
if (certStream == null) {
|
||||||
@@ -120,7 +120,7 @@ public interface WxService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
default String getSerialNumberFromPem(String certContent) {
|
String getSerialNumberFromPem(String certContent) {
|
||||||
try {
|
try {
|
||||||
// 去掉 PEM 头尾并清理空格换行
|
// 去掉 PEM 头尾并清理空格换行
|
||||||
String pem = certContent
|
String pem = certContent
|
||||||
@@ -151,8 +151,8 @@ public interface WxService {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
default String getSerialNumber() {
|
public String getSerialNumber() {
|
||||||
Config config = getConfig();
|
|
||||||
try (var certStream = Thread.currentThread().getContextClassLoader().getResourceAsStream(config.getCertPath())) {
|
try (var certStream = Thread.currentThread().getContextClassLoader().getResourceAsStream(config.getCertPath())) {
|
||||||
X509Certificate certificate = PayKit.getCertificate(certStream);
|
X509Certificate certificate = PayKit.getCertificate(certStream);
|
||||||
if (certificate != null) {
|
if (certificate != null) {
|
||||||
@@ -168,8 +168,8 @@ public interface WxService {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
default JSONObject verifySignature(HttpServletRequest request) {
|
public JSONObject verifySignature(HttpServletRequest request) {
|
||||||
Config config = getConfig();
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
log.info("开始校验签名并解密");
|
log.info("开始校验签名并解密");
|
||||||
@@ -186,8 +186,8 @@ public interface WxService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
default String decryptToString(String associatedData, String nonceStr, String ciphertext) {
|
public String decryptToString(String associatedData, String nonceStr, String ciphertext) {
|
||||||
AesUtil aesUtil = new AesUtil(getConfig().getApiV3Key().getBytes(StandardCharsets.UTF_8));
|
AesUtil aesUtil = new AesUtil(config.getApiV3Key().getBytes(StandardCharsets.UTF_8));
|
||||||
try {
|
try {
|
||||||
return aesUtil.decryptToString(
|
return aesUtil.decryptToString(
|
||||||
associatedData.getBytes(StandardCharsets.UTF_8),
|
associatedData.getBytes(StandardCharsets.UTF_8),
|
||||||
@@ -199,8 +199,8 @@ public interface WxService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
default String getOpenId(String code) {
|
public String getOpenId(String code) {
|
||||||
Config config = getConfig();
|
|
||||||
String response = HttpUtil.get("https://api.weixin.qq.com/sns/jscode2session",
|
String response = HttpUtil.get("https://api.weixin.qq.com/sns/jscode2session",
|
||||||
Map.of("appid", config.getAppId() , "secret", config.getAppSecret(), "js_code", code, "grant_type", "authorization_code")
|
Map.of("appid", config.getAppId() , "secret", config.getAppSecret(), "js_code", code, "grant_type", "authorization_code")
|
||||||
);
|
);
|
||||||
@@ -213,8 +213,8 @@ public interface WxService {
|
|||||||
throw new RuntimeException("获取openId失败");
|
throw new RuntimeException("获取openId失败");
|
||||||
}
|
}
|
||||||
|
|
||||||
default Map<String, String> v3Pay(String openId, BigDecimal amount, String desc, String tradeNo, String type) {
|
public Map<String, String> v3Pay(String openId, BigDecimal amount, String desc, String tradeNo, String type) {
|
||||||
Config config = getConfig();
|
|
||||||
if (desc == null) desc = "订单支付";
|
if (desc == null) desc = "订单支付";
|
||||||
UnifiedOrderModel model = new UnifiedOrderModel();
|
UnifiedOrderModel model = new UnifiedOrderModel();
|
||||||
model.setAppid(config.getAppId());
|
model.setAppid(config.getAppId());
|
||||||
@@ -256,8 +256,8 @@ public interface WxService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
default Map<String, String> v2Pay(String openId, BigDecimal amount, String desc, String tradeNo) {
|
Map<String, String> v2Pay(String openId, BigDecimal amount, String desc, String tradeNo) {
|
||||||
Config config = getConfig();
|
|
||||||
Map<String, String> payModel = com.ijpay.wxpay.model.UnifiedOrderModel.builder()
|
Map<String, String> payModel = com.ijpay.wxpay.model.UnifiedOrderModel.builder()
|
||||||
.appid(config.appId)
|
.appid(config.appId)
|
||||||
.mch_id(config.mchId)
|
.mch_id(config.mchId)
|
||||||
@@ -290,8 +290,8 @@ public interface WxService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
default String refund(String tradeNo, String refundTradeNo, BigDecimal amount) {
|
String refund(String tradeNo, String refundTradeNo, BigDecimal amount) {
|
||||||
Config config = getConfig();
|
|
||||||
int finalAmount = amount.multiply(new BigDecimal(100)).intValueExact();
|
int finalAmount = amount.multiply(new BigDecimal(100)).intValueExact();
|
||||||
RefundModel model = new RefundModel();
|
RefundModel model = new RefundModel();
|
||||||
model.setOut_trade_no(tradeNo);
|
model.setOut_trade_no(tradeNo);
|
||||||
@@ -325,7 +325,7 @@ public interface WxService {
|
|||||||
return jsonObject.getString("refund_id");
|
return jsonObject.getString("refund_id");
|
||||||
}
|
}
|
||||||
|
|
||||||
default String genCode(int shopId, int id, String path) {
|
String genCode(int shopId, int id, String path) {
|
||||||
Map<String, Object> params = Map.of(
|
Map<String, Object> params = Map.of(
|
||||||
"scene", "id=" + id + "&shopId=" + shopId,
|
"scene", "id=" + id + "&shopId=" + shopId,
|
||||||
"page", path,
|
"page", path,
|
||||||
@@ -346,8 +346,8 @@ public interface WxService {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
default JSONObject transferBalance(String openId, String name, BigDecimal amount, String remarkTxt, String billNoTxt) {
|
JSONObject transferBalance(String openId, String name, BigDecimal amount, String remarkTxt, String billNoTxt) {
|
||||||
Config config = getConfig();
|
|
||||||
String remark = remarkTxt == null ? "佣金" : remarkTxt;
|
String remark = remarkTxt == null ? "佣金" : remarkTxt;
|
||||||
String billNo = billNoTxt == null ? IdUtil.simpleUUID() : billNoTxt;
|
String billNo = billNoTxt == null ? IdUtil.simpleUUID() : billNoTxt;
|
||||||
Map<String, Object> params = Map.of(
|
Map<String, Object> params = Map.of(
|
||||||
@@ -3,10 +3,8 @@ package com.czg.service.market.service.impl;
|
|||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.util.IdUtil;
|
import cn.hutool.core.util.IdUtil;
|
||||||
import com.alibaba.fastjson2.JSONObject;
|
|
||||||
import com.czg.account.entity.ShopInfo;
|
import com.czg.account.entity.ShopInfo;
|
||||||
import com.czg.account.entity.ShopUser;
|
import com.czg.account.entity.ShopUser;
|
||||||
import com.czg.account.entity.UserInfo;
|
|
||||||
import com.czg.account.service.ShopInfoService;
|
import com.czg.account.service.ShopInfoService;
|
||||||
import com.czg.account.service.ShopUserService;
|
import com.czg.account.service.ShopUserService;
|
||||||
import com.czg.account.service.UserInfoService;
|
import com.czg.account.service.UserInfoService;
|
||||||
@@ -31,7 +29,6 @@ import com.czg.order.dto.MkDistributionPayDTO;
|
|||||||
import com.czg.order.entity.OrderPayment;
|
import com.czg.order.entity.OrderPayment;
|
||||||
import com.czg.order.service.OrderPaymentService;
|
import com.czg.order.service.OrderPaymentService;
|
||||||
import com.czg.sa.StpKit;
|
import com.czg.sa.StpKit;
|
||||||
import com.czg.service.Impl.AppWxServiceImpl;
|
|
||||||
import com.czg.service.market.mapper.MkDistributionUserMapper;
|
import com.czg.service.market.mapper.MkDistributionUserMapper;
|
||||||
import com.czg.utils.AssertUtil;
|
import com.czg.utils.AssertUtil;
|
||||||
import com.czg.utils.CzgRandomUtils;
|
import com.czg.utils.CzgRandomUtils;
|
||||||
@@ -74,10 +71,8 @@ public class MkDistributionUserServiceImpl extends ServiceImpl<MkDistributionUse
|
|||||||
private MkDistributionAmountFlowService distributionAmountFlowService;
|
private MkDistributionAmountFlowService distributionAmountFlowService;
|
||||||
@Resource
|
@Resource
|
||||||
private MkDistributionFlowService distributionFlowService;
|
private MkDistributionFlowService distributionFlowService;
|
||||||
@Resource
|
|
||||||
private MkDistributionUserService distributionUserService;
|
|
||||||
|
|
||||||
@DubboReference
|
@Resource
|
||||||
private AppWxServiceImpl appWxService;
|
private AppWxServiceImpl appWxService;
|
||||||
|
|
||||||
@DubboReference
|
@DubboReference
|
||||||
@@ -377,7 +372,7 @@ public class MkDistributionUserServiceImpl extends ServiceImpl<MkDistributionUse
|
|||||||
.setRewardAmount(rewardAmount).setBillNo(IdUtil.simpleUUID());
|
.setRewardAmount(rewardAmount).setBillNo(IdUtil.simpleUUID());
|
||||||
distributionFlowService.save(mkDistributionFlow);
|
distributionFlowService.save(mkDistributionFlow);
|
||||||
|
|
||||||
distributionUserService.updateIncome(!flag ? rewardAmount : BigDecimal.ZERO,
|
updateIncome(!flag ? rewardAmount : BigDecimal.ZERO,
|
||||||
flag ? rewardAmount : BigDecimal.ZERO, BigDecimal.ZERO, distributionUser.getId());
|
flag ? rewardAmount : BigDecimal.ZERO, BigDecimal.ZERO, distributionUser.getId());
|
||||||
|
|
||||||
if (flag) {
|
if (flag) {
|
||||||
@@ -413,6 +408,10 @@ public class MkDistributionUserServiceImpl extends ServiceImpl<MkDistributionUse
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Boolean withdraw(long userId, MkDistributionWithdrawFlowDTO withdrawFlowDTO) {
|
public Boolean withdraw(long userId, MkDistributionWithdrawFlowDTO withdrawFlowDTO) {
|
||||||
|
ShopUser shopUserInfo = shopUserService.getShopUserInfo(withdrawFlowDTO.getShopId(), userId);
|
||||||
|
MkDistributionUser distributionUser = getOne(new QueryWrapper().eq(MkDistributionUser::getShopUserId, shopUserInfo.getId()));
|
||||||
|
AssertUtil.isNull(distributionUser, "分销员不存在");
|
||||||
|
// if (distributionUser.get)
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,47 +1,32 @@
|
|||||||
package com.czg.service.Impl;
|
package com.czg.service.market.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.util.IdUtil;
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
|
||||||
import cn.hutool.http.HttpRequest;
|
|
||||||
import cn.hutool.http.HttpUtil;
|
|
||||||
import com.alibaba.fastjson2.JSONObject;
|
|
||||||
import com.czg.exception.CzgException;
|
|
||||||
import com.czg.service.RedisService;
|
import com.czg.service.RedisService;
|
||||||
import com.czg.system.service.SysParamsService;
|
import com.czg.system.service.SysParamsService;
|
||||||
import com.czg.service.WxService;
|
|
||||||
import com.ijpay.core.kit.RsaKit;
|
import com.ijpay.core.kit.RsaKit;
|
||||||
|
|
||||||
import jakarta.annotation.PostConstruct;
|
import jakarta.annotation.PostConstruct;
|
||||||
import jakarta.annotation.Resource;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.dubbo.config.annotation.DubboReference;
|
import org.apache.dubbo.config.annotation.DubboReference;
|
||||||
import org.apache.dubbo.config.annotation.DubboService;
|
import org.apache.dubbo.config.annotation.DubboService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 微信支付service
|
* 微信支付service
|
||||||
* @author Administrator
|
* @author Administrator
|
||||||
*/
|
*/
|
||||||
@DubboService
|
@Component
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class WxServiceImpl implements WxService {
|
public class WxServiceImpl extends BaseWx {
|
||||||
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
private RedisService autoRedisService;
|
|
||||||
@DubboReference
|
@DubboReference
|
||||||
private SysParamsService paramsService;
|
private SysParamsService paramsService;
|
||||||
private static RedisService redisService;
|
|
||||||
private WxService.Config config = new Config();
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Config getConfig() {
|
|
||||||
return config;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
public WxServiceImpl(@Autowired RedisService redisService) {
|
||||||
public RedisService getRedisService() {
|
this.redisService = redisService;
|
||||||
return redisService;
|
config = new Config();
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostConstruct
|
@PostConstruct
|
||||||
@@ -75,7 +60,10 @@ public class WxServiceImpl implements WxService {
|
|||||||
config.notifyUrl = paramsService.getSysParamValue("native_notify_url") + "/wx/pay";
|
config.notifyUrl = paramsService.getSysParamValue("native_notify_url") + "/wx/pay";
|
||||||
config.refundNotifyUrl = "";
|
config.refundNotifyUrl = "";
|
||||||
config.transferNotifyUrl = paramsService.getSysParamValue("native_notify_url") + "/wx/transfer";
|
config.transferNotifyUrl = paramsService.getSysParamValue("native_notify_url") + "/wx/transfer";
|
||||||
redisService = this.autoRedisService;
|
}
|
||||||
|
|
||||||
|
public BaseWx getAppService() {
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2,7 +2,6 @@ package com.czg.service.order.service.impl;
|
|||||||
|
|
||||||
import cn.hutool.core.util.IdUtil;
|
import cn.hutool.core.util.IdUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.czg.account.entity.ShopInfo;
|
|
||||||
import com.czg.account.entity.ShopUser;
|
import com.czg.account.entity.ShopUser;
|
||||||
import com.czg.account.entity.UserInfo;
|
import com.czg.account.entity.UserInfo;
|
||||||
import com.czg.account.service.ShopInfoService;
|
import com.czg.account.service.ShopInfoService;
|
||||||
@@ -17,7 +16,7 @@ import com.czg.order.dto.MkDistributionPayDTO;
|
|||||||
import com.czg.order.entity.OrderPayment;
|
import com.czg.order.entity.OrderPayment;
|
||||||
import com.czg.order.service.OrderPaymentService;
|
import com.czg.order.service.OrderPaymentService;
|
||||||
import com.czg.resp.CzgResult;
|
import com.czg.resp.CzgResult;
|
||||||
import com.czg.service.Impl.WxServiceImpl;
|
import com.czg.service.market.service.impl.WxServiceImpl;
|
||||||
import com.czg.service.order.service.DistributionPayService;
|
import com.czg.service.order.service.DistributionPayService;
|
||||||
import com.czg.utils.AssertUtil;
|
import com.czg.utils.AssertUtil;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
|
|||||||
Reference in New Issue
Block a user