update:
1. fix
This commit is contained in:
@@ -8,6 +8,7 @@ import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
import jakarta.validation.constraints.Max;
|
||||
import jakarta.validation.constraints.Min;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springblade.core.mp.support.Condition;
|
||||
import org.springblade.core.mp.support.Query;
|
||||
@@ -19,7 +20,9 @@ import org.springblade.modules.api.vo.*;
|
||||
import org.springblade.modules.common.manager.AppCommonManager;
|
||||
import org.springblade.modules.common.pojo.vo.AppCommonRegionsInfoVO;
|
||||
import org.springblade.modules.common.service.*;
|
||||
import org.springblade.modules.system.service.IDictBizService;
|
||||
import org.springblade.modules.system.service.IUserService;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
@@ -52,9 +55,6 @@ public class APPUserController {
|
||||
|
||||
private final ICommonTourInfoService commonTourInfoService;
|
||||
|
||||
private final AppCommonManager appCommonManager;
|
||||
|
||||
|
||||
/**
|
||||
* 是否修改过密码
|
||||
*/
|
||||
@@ -252,8 +252,8 @@ public class APPUserController {
|
||||
@GetMapping("/pay-type")
|
||||
@ApiOperationSupport(order = 24)
|
||||
@Operation(summary = "支付渠道")
|
||||
public R<List<CommonModulePayTypeApiVO>> getModulePayTypeList(@RequestParam String moduleCode) {
|
||||
return R.data(appCommonManager.getModulePayTypeList(moduleCode));
|
||||
public R<List<CommonModulePayTypeApiVO>> modulePayTypeList(@RequestParam String moduleCode) {
|
||||
return R.data(paymentService.modulePayTypeList(moduleCode));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -3,6 +3,9 @@ package org.springblade.modules.api.service;
|
||||
import com.alipay.api.response.AlipayTradeQueryResponse;
|
||||
import org.springblade.modules.api.request.PaymentRequest;
|
||||
import org.springblade.modules.api.response.PaymentResponse;
|
||||
import org.springblade.modules.api.vo.CommonModulePayTypeApiVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public interface IPaymentService {
|
||||
@@ -15,5 +18,5 @@ public interface IPaymentService {
|
||||
|
||||
PaymentResponse wxAppPay(PaymentRequest request);
|
||||
|
||||
|
||||
List<CommonModulePayTypeApiVO> modulePayTypeList(String moduleCode);
|
||||
}
|
||||
|
||||
@@ -4,16 +4,22 @@ import com.alipay.api.response.AlipayTradeCloseResponse;
|
||||
import com.alipay.api.response.AlipayTradeQueryResponse;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springblade.common.cache.DictBizCache;
|
||||
import org.springblade.common.cache.DictCache;
|
||||
import org.springblade.common.cache.PaymentCache;
|
||||
import org.springblade.core.log.exception.ServiceException;
|
||||
import org.springblade.core.tool.utils.StringPool;
|
||||
import org.springblade.core.tool.utils.StringUtil;
|
||||
import org.springblade.modules.api.request.PaymentRequest;
|
||||
import org.springblade.modules.api.response.PaymentResponse;
|
||||
import org.springblade.modules.api.vo.CommonModulePayTypeApiVO;
|
||||
import org.springblade.modules.common.eums.BusinessModule;
|
||||
import org.springblade.modules.common.eums.PaymentType;
|
||||
import org.springblade.modules.api.service.IPaymentService;
|
||||
import org.springblade.modules.common.pojo.entity.CommonUserOrderEntity;
|
||||
import org.springblade.modules.common.service.ICommonUserOrderService;
|
||||
import org.springblade.modules.system.pojo.entity.Dict;
|
||||
import org.springblade.modules.system.pojo.entity.DictBiz;
|
||||
import org.springblade.plugin.pay.api.alipay.IAliPayApiService;
|
||||
import org.springblade.plugin.pay.constant.PayConstant;
|
||||
import org.springblade.plugin.pay.entity.AliPayAccountConfig;
|
||||
@@ -22,6 +28,8 @@ import org.springblade.plugin.pay.service.IOrderService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
@Slf4j
|
||||
@@ -35,6 +43,8 @@ public class IPaymentServiceImpl implements IPaymentService {
|
||||
|
||||
private final IAliPayApiService aliPayApiService;
|
||||
|
||||
private final static String PAY_TYPE_CODE_PREFIX = "app_pay_type_";
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@@ -95,4 +105,23 @@ public class IPaymentServiceImpl implements IPaymentService {
|
||||
public PaymentResponse wxAppPay(PaymentRequest request) {
|
||||
throw new ServiceException("当前微信支付未开放");
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CommonModulePayTypeApiVO> modulePayTypeList(String moduleCode) {
|
||||
if (StringUtil.isBlank(moduleCode)) {
|
||||
throw new ServiceException("无效参数");
|
||||
}
|
||||
BusinessModule businessModule = BusinessModule.fromCodeIgnoreCase(moduleCode);
|
||||
String code = PAY_TYPE_CODE_PREFIX + businessModule.getCode();
|
||||
List<Dict> appPayType = DictCache.getList(code);
|
||||
List<CommonModulePayTypeApiVO> result = new ArrayList<>(appPayType.size());
|
||||
for (Dict dict : appPayType) {
|
||||
CommonModulePayTypeApiVO vo = new CommonModulePayTypeApiVO();
|
||||
vo.setDictKey(dict.getDictKey());
|
||||
vo.setDictValue(dict.getDictValue());
|
||||
vo.setSort(dict.getSort());
|
||||
result.add(vo);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,16 +2,20 @@ package org.springblade.modules.api.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
@Data
|
||||
public class CommonModulePayTypeApiVO {
|
||||
public class CommonModulePayTypeApiVO implements Serializable {
|
||||
|
||||
private Integer code;
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private String name;
|
||||
private String dictKey;
|
||||
|
||||
private String dictValue;
|
||||
|
||||
private Integer sort;
|
||||
|
||||
private Integer isEnable;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user