操作密码

This commit is contained in:
2025-03-19 14:43:04 +08:00
parent dd945d7d0b
commit 5cb5e4f439
7 changed files with 40 additions and 8 deletions

View File

@@ -45,4 +45,5 @@ public class VipRefundDTO implements Serializable {
private String platformType;
private String pwd;
}

View File

@@ -5,6 +5,7 @@ import cn.hutool.core.convert.Convert;
import cn.hutool.core.exceptions.ValidateException;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.crypto.SecureUtil;
import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONObject;
import com.czg.account.dto.shopuser.ShopUserMoneyEditDTO;
@@ -466,6 +467,13 @@ public class PayServiceImpl implements PayService {
@Override
public CzgResult<Object> refundVip(VipRefundDTO refPayParam) {
ShopInfo shopInfo = shopInfoService.getById(refPayParam.getShopId());
if (shopInfo.getIsReturnPwd().equals(1)) {
AssertUtil.isBlank(shopInfo.getOperationPwd(), "请设置操作密码后使用");
if (!SecureUtil.md5(refPayParam.getPwd()).equals(shopInfo.getOperationPwd())) {
throw new CzgException("操作密码错误");
}
}
ShopUser shopUser = shopUserService.getShopUserInfo(refPayParam.getShopId(), refPayParam.getUserId());
ShopUserFlow inFlow = userFlowService.getById(refPayParam.getFlowId());
AssertUtil.isNull(inFlow, "充值记录不存在");
@@ -549,6 +557,13 @@ public class PayServiceImpl implements PayService {
@Transactional
public CzgResult<Object> refundOrderBefore(OrderInfoRefundDTO param) {
OrderInfo orderInfo = orderInfoService.getById(param.getOrderId());
ShopInfo shopInfo = shopInfoService.getById(orderInfo.getShopId());
if (shopInfo.getIsReturnPwd().equals(1)) {
AssertUtil.isBlank(shopInfo.getOperationPwd(), "请设置操作密码后使用");
if (!SecureUtil.md5(param.getPwd()).equals(shopInfo.getOperationPwd())) {
throw new CzgException("操作密码错误");
}
}
Map<String, BigDecimal> returnProMap = new HashMap<>();
boolean isPay = true;
String refPayOrderNo = "REFO" + IdUtil.getSnowflakeNextId();