2
0

fix: 支付货币对接

This commit is contained in:
caiyuchao
2025-04-28 14:31:08 +08:00
parent 0fa1439304
commit 095dacb873
7 changed files with 44 additions and 30 deletions

View File

@@ -12,10 +12,12 @@ import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.wfc.common.core.constant.CacheConstants;
import org.wfc.common.core.domain.R;
import org.wfc.common.core.web.controller.BaseController;
import org.wfc.common.core.web.domain.AjaxResult;
import org.wfc.common.core.web.page.TableDataInfo;
import org.wfc.common.redis.service.RedisService;
import org.wfc.common.security.annotation.InnerAuth;
import org.wfc.common.security.utils.SecurityUtils;
import org.wfc.user.domain.UOrder;
@@ -47,6 +49,9 @@ public class UOrderController extends BaseController {
@Autowired
private IURateLimitService uRateLimitService;
@Autowired
private RedisService redisService;
@GetMapping("/page")
public TableDataInfo page(UOrder uOrder) {
startPage();
@@ -59,8 +64,19 @@ public class UOrderController extends BaseController {
startPage();
List<UOrder> list = uOrderService.list(Wrappers.<UOrder>lambdaQuery()
.eq(UOrder::getUserId, SecurityUtils.getUserId()).eq(UOrder::getType, 1)
.eq(UOrder::getStatus, 1)
.orderByDesc(UOrder::getCreateTime));
return getDataTable(list);
}
@GetMapping("/packagePage")
public TableDataInfo packagePage() {
startPage();
List<UOrder> list = uOrderService.list(Wrappers.<UOrder>lambdaQuery()
.eq(UOrder::getUserId, SecurityUtils.getUserId()).eq(UOrder::getType, 0)
.eq(UOrder::getStatus, 1)
.orderByDesc(UOrder::getCreateTime));
for (UOrder uOrder : list) {
if (ObjectUtil.isNull(uOrder.getPackageId())) {
continue;
@@ -74,22 +90,6 @@ public class UOrderController extends BaseController {
return getDataTable(list);
}
@GetMapping("/packagePage")
public TableDataInfo packagePage() {
startPage();
List<UOrder> list = uOrderService.list(Wrappers.<UOrder>lambdaQuery()
.eq(UOrder::getUserId, SecurityUtils.getUserId()).eq(UOrder::getType, 0)
.orderByDesc(UOrder::getCreateTime));
for (UOrder uOrder : list) {
if (ObjectUtil.isNull(uOrder.getPackageId())) {
continue;
}
UPackage uPackage = uPackageService.getById(uOrder.getPackageId());
uOrder.setUPackage(uPackage);
}
return getDataTable(list);
}
@GetMapping("/list")
public AjaxResult list(UOrder uOrder) {
List<UOrder> list = uOrderService.list();
@@ -98,7 +98,12 @@ public class UOrderController extends BaseController {
@GetMapping(value = "/{id}")
public AjaxResult getById(@PathVariable("id") Long id) {
return success(uOrderService.getById(id));
Object cacheMapValue = redisService.getCacheMapValue(CacheConstants.SYS_PAY_CONFIG_KEY, CacheConstants.SYS_PAY_CURRENCY_KEY);
UOrder order = uOrderService.getById(id);
if (cacheMapValue != null) {
order.setCurrency(cacheMapValue.toString());
}
return success(order);
}
@PostMapping

View File

@@ -48,4 +48,7 @@ public class UOrder extends BaseData {
@TableField(exist = false)
private UPackage uPackage;
@TableField(exist = false)
private String currency;
}