1、新增组织购买产品接口、混合支付和异步回调;2、新增微信支付和回调基础代码;3、组织余额新增有效时长内容;4、新增过期支付单处理类;

This commit is contained in:
gaoqr
2025-08-19 17:34:07 +08:00
parent df1915989a
commit 8229f086dd
38 changed files with 1635 additions and 118 deletions
@@ -21,7 +21,7 @@ import java.time.LocalDate;
public class SnowflakeIdWorker3rd {
/** 初始时间 (2024-01-01: 1704038400) */
// private final int twepoch = 28400640;// 1704038400000L/1000/60;
private final int twepoch = 1704038400;
private final int twepoch = 28400640;
/** 序列在id中占位数 */
private final long sequenceBits = 7L;
/** 时间截向左移7bit */
@@ -122,8 +122,8 @@ public class SnowflakeIdWorker3rd {
* @return 当前时间(分钟)
*/
protected int timeGen() {
// String timestamp = String.valueOf(System.currentTimeMillis() / 1000 / 60);
String timestamp = String.valueOf(System.currentTimeMillis() / 1000);
String timestamp = String.valueOf(System.currentTimeMillis() / 1000 / 60);
// String timestamp = String.valueOf(System.currentTimeMillis() / 1000);
return Integer.valueOf(timestamp);
}
@@ -1,9 +1,14 @@
package com.cf.imes.framework.pay.config;
import com.cf.imes.framework.common.util.encrypt.AesUtils;
import com.github.binarywang.wxpay.config.WxPayConfig;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import java.nio.charset.StandardCharsets;
/**
* @author Gqr
* @since 2025/4/15 16:52
@@ -11,4 +16,44 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
@ConfigurationProperties(prefix = "chenfeng.pay.wechat")
@Data
public class ChenfengWechatPayConfig extends WxPayConfig {
@Value("${chenfeng.encrypt.publicKey:}")
private String publicKey;
@Override
public void setAppId(String appId) {
if (StringUtils.isNotEmpty(publicKey)) {
super.setAppId(AesUtils.decrypt(appId, publicKey));
} else {
super.setAppId(appId);
}
}
@Override
public void setMchId(String mchId) {
if (StringUtils.isNotEmpty(publicKey)) {
super.setMchId(AesUtils.decrypt(mchId, publicKey));
} else {
super.setMchId(mchId);
}
}
@Override
public void setMchKey(String mchKey) {
if (StringUtils.isNotEmpty(publicKey)) {
super.setMchKey(AesUtils.decrypt(mchKey, publicKey));
} else {
super.setMchKey(mchKey);
}
}
@Override
public void setKeyContent(byte[] keyContent) {
if (StringUtils.isNotEmpty(publicKey)) {
String encrypted = new String(keyContent, StandardCharsets.UTF_8);
String decrypted = AesUtils.decrypt(encrypted, publicKey);
super.setKeyContent(decrypted.getBytes(StandardCharsets.UTF_8));
} else {
super.setKeyContent(keyContent);
}
}
}