|
@@ -1,5 +1,7 @@
|
|
|
package com.yingpai.gupiao.service.impl;
|
|
package com.yingpai.gupiao.service.impl;
|
|
|
|
|
|
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
|
|
+import com.yingpai.gupiao.domain.po.SysConfig;
|
|
|
import com.yingpai.gupiao.domain.vo.PaymentConfigVO;
|
|
import com.yingpai.gupiao.domain.vo.PaymentConfigVO;
|
|
|
import com.yingpai.gupiao.mapper.SysConfigMapper;
|
|
import com.yingpai.gupiao.mapper.SysConfigMapper;
|
|
|
import com.yingpai.gupiao.service.PaymentConfigService;
|
|
import com.yingpai.gupiao.service.PaymentConfigService;
|
|
@@ -27,7 +29,7 @@ public class PaymentConfigServiceImpl implements PaymentConfigService {
|
|
|
public PaymentConfigVO getConfig(Integer poolType) {
|
|
public PaymentConfigVO getConfig(Integer poolType) {
|
|
|
if (poolType == 1) {
|
|
if (poolType == 1) {
|
|
|
// 超短池:到当日24点
|
|
// 超短池:到当日24点
|
|
|
- String priceStr = sysConfigMapper.getConfigValue(SHORT_PRICE_KEY);
|
|
|
|
|
|
|
+ String priceStr = getConfigValue(SHORT_PRICE_KEY);
|
|
|
BigDecimal price = priceStr != null ? new BigDecimal(priceStr) : new BigDecimal("18");
|
|
BigDecimal price = priceStr != null ? new BigDecimal(priceStr) : new BigDecimal("18");
|
|
|
|
|
|
|
|
return PaymentConfigVO.builder()
|
|
return PaymentConfigVO.builder()
|
|
@@ -38,7 +40,7 @@ public class PaymentConfigServiceImpl implements PaymentConfigService {
|
|
|
.build();
|
|
.build();
|
|
|
} else if (poolType == 2) {
|
|
} else if (poolType == 2) {
|
|
|
// 强势池:1年
|
|
// 强势池:1年
|
|
|
- String priceStr = sysConfigMapper.getConfigValue(STRONG_PRICE_KEY);
|
|
|
|
|
|
|
+ String priceStr = getConfigValue(STRONG_PRICE_KEY);
|
|
|
BigDecimal price = priceStr != null ? new BigDecimal(priceStr) : new BigDecimal("998");
|
|
BigDecimal price = priceStr != null ? new BigDecimal(priceStr) : new BigDecimal("998");
|
|
|
|
|
|
|
|
return PaymentConfigVO.builder()
|
|
return PaymentConfigVO.builder()
|
|
@@ -51,4 +53,13 @@ public class PaymentConfigServiceImpl implements PaymentConfigService {
|
|
|
|
|
|
|
|
throw new RuntimeException("无效的池类型");
|
|
throw new RuntimeException("无效的池类型");
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ private String getConfigValue(String key) {
|
|
|
|
|
+ SysConfig config = sysConfigMapper.selectOne(
|
|
|
|
|
+ new LambdaQueryWrapper<SysConfig>()
|
|
|
|
|
+ .eq(SysConfig::getConfigKey, key)
|
|
|
|
|
+ .last("LIMIT 1")
|
|
|
|
|
+ );
|
|
|
|
|
+ return config != null ? config.getConfigValue() : null;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|