This commit is contained in:
墨大叔 2024-08-03 13:51:24 +08:00
parent a72dfb8602
commit cd2eb5adec
11 changed files with 155 additions and 15 deletions

View File

@ -33,4 +33,10 @@ public class BizParameter extends JSONObject
{
this.put(paramName, paramValue);
}
public void addParamNoNull(String paramName, Object paramValue) {
if (paramValue != null) {
this.put(paramName, paramValue);
}
}
}

View File

@ -1,10 +0,0 @@
package com.ruoyi.common.pay.yst.domain.params;
/**
* 消费申请 参数
* @author wjh
* 2024/8/1
*/
public class AddOrderParam {
}

View File

@ -0,0 +1,69 @@
package com.ruoyi.common.pay.yst.domain.params;
import com.ruoyi.common.pay.yst.enums.YstCertType;
import lombok.Builder;
import lombok.Data;
/**
* 个人会员实名及绑卡申请参数
* @author wjh
* 2024/8/3
*/
@Data
@Builder
public class PersonRealNameAndBindCardApplyParam {
/**
* 会员编号
*/
private String signNum;
/**
* 会员角色
*/
private String memberRole;
/**
* 证件类型
*/
private String certType;
/**
* 证件号码
*/
private String certNum;
/**
* 姓名
*/
private String name;
/**
* 银行预留手机号
*/
private String phone;
/**
* 银行卡号
*/
private String acctNum;
/**
* 绑卡方式
*/
private String bindType;
/**
* 针对信用卡
* 有效期月年
* 格式为月年如03212位月2位年
*/
private String validDate;
/**
* 针对信用卡
* cvv2
*/
private String cvv2;
}

View File

@ -0,0 +1,21 @@
package com.ruoyi.common.pay.yst.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* @author wjh
* 2024/8/3
*/
@Getter
@AllArgsConstructor
public enum YstBindType {
TLT("通联通协议支付签约", "6"),
SYB("收银宝快捷支付签约", "7"),
BANK_CARD4("银行卡四要素验证", "8");
private final String name;
private final String type;
}

View File

@ -1,5 +1,7 @@
package com.ruoyi.common.pay.yst.service;
import com.ruoyi.common.pay.yst.domain.params.PersonRealNameAndBindCardApplyParam;
/**
* 云商通账户接口
* @author wjh
@ -10,6 +12,6 @@ public interface YstAccountService {
/**
* 个人会员实名及绑卡申请
*/
void personRealNameAndBindCardApply();
void personRealNameAndBindCardApply(PersonRealNameAndBindCardApplyParam param);
}

View File

@ -1,6 +1,17 @@
package com.ruoyi.common.pay.yst.service.impl;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.pay.yst.config.YstConfig;
import com.ruoyi.common.pay.yst.constants.YstApi;
import com.ruoyi.common.pay.yst.constants.YstTransCode;
import com.ruoyi.common.pay.yst.domain.BizParameter;
import com.ruoyi.common.pay.yst.domain.params.PersonRealNameAndBindCardApplyParam;
import com.ruoyi.common.pay.yst.service.YstAccountService;
import com.ruoyi.common.pay.yst.util.SM4Utils;
import com.ruoyi.common.pay.yst.util.YstClient;
import com.ruoyi.common.utils.SnowFlakeUtil;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
@ -9,11 +20,42 @@ import org.springframework.stereotype.Service;
*/
@Service
public class YstAccountServiceImpl implements YstAccountService {
@Autowired
private YstClient client;
@Autowired
private YstConfig config;
/**
* 个人会员实名及绑卡申请
*/
@Override
public void personRealNameAndBindCardApply() {
public void personRealNameAndBindCardApply(PersonRealNameAndBindCardApplyParam param) {
try {
// 组装参数
BizParameter bizParameter = new BizParameter();
// 发送请求
bizParameter.addParam("reqTraceNum", String.valueOf(SnowFlakeUtil.newId()));
bizParameter.addParam("signNum", param.getSignNum());
bizParameter.addParam("memberRole", param.getMemberRole());
bizParameter.addParam("cerType", param.getCertType());
bizParameter.addParam("cerNum", SM4Utils.encryptEcb(config.getSecretKey(),param.getCertNum()));
bizParameter.addParam("name",param.getName());
bizParameter.addParam("acctNum", SM4Utils.encryptEcb(config.getSecretKey(),param.getAcctNum()));
bizParameter.addParam("phone",param.getPhone());
bizParameter.addParam("bindType",param.getBindType());//6-通联通协议支付7-收银宝快捷8-银行卡四要素
bizParameter.addParam("validDate",param.getValidDate());
bizParameter.addParam("cvv2",param.getCvv2());
bizParameter.addParam("bizOrderCode",String.valueOf(System.currentTimeMillis()));
client.sendRequest(YstApi.TM, YstTransCode.INDIVIDUAL_MEMBER_REAL_NAME_AND_BIND_CARD_APPLY, bizParameter, String.class);
} catch (Exception e) {
throw new ServiceException(e.getMessage());
}
}
}

View File

@ -6,7 +6,6 @@ import com.ruoyi.common.pay.yst.constants.YstTransCode;
import com.ruoyi.common.pay.yst.domain.BizParameter;
import com.ruoyi.common.pay.yst.domain.YstResponse;
import com.ruoyi.common.pay.yst.domain.bizRes.comsumptionApply.ConsumptionApplyRes;
import com.ruoyi.common.pay.yst.domain.params.AddOrderParam;
import com.ruoyi.common.pay.yst.service.YstPayService;
import com.ruoyi.common.pay.yst.util.SM4Utils;
import com.ruoyi.common.pay.yst.util.YstClient;

View File

@ -64,6 +64,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{item}
</foreach>
</if>
<if test="userIds != null and userIds.size() > 0">
and ss.user_id in
<foreach collection="userIds" close=")" item="item" open="(" separator=",">
#{item}
</foreach>
</if>
</sql>
<select id="selectSmStoreList" parameterType="StoreQuery" resultMap="SmStoreResult">

View File

@ -242,6 +242,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<where>
<include refid="searchCondition"/>
</where>
order by stb.create_time desc
</select>
<select id="selectWithdrawById" resultMap="SmTransactionBillResult">

View File

@ -497,6 +497,12 @@ public class TransactionBillServiceImpl implements TransactionBillService {
data.setPayPicture(dto.getPayPicture());
data.setWithdrawType(dto.getWithdrawType());
data.setOfflineImage(dto.getOfflineImage());
// 线下打款并且状态为已打款则修改支付时间为当前
if (WithdrawType.OFFLINE.getType().equals(dto.getWithdrawType()) && TransactionBillStatus.WITHDRAW_SUCCESS.equals(status)) {
data.setPayTime(DateUtils.getNowDate());
}
TransactionBillQuery query = new TransactionBillQuery();
query.setBillId(dto.getBillId());
query.setType(TransactionBillType.WITHDRAW.getType());

View File

@ -4,10 +4,8 @@ import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import com.ruoyi.common.core.domain.ValidGroup;
import com.ruoyi.common.utils.ServiceUtil;
import com.ruoyi.ss.user.domain.SmUserQuery;
import com.ruoyi.ss.user.domain.SmUserVo;
import com.ruoyi.ss.user.service.UserAssembler;