Commit 56290163 by YG8999

域名改为配置文件配置

parent dc720283
...@@ -218,4 +218,6 @@ order: ...@@ -218,4 +218,6 @@ order:
allow-refund-time: 3600 allow-refund-time: 3600
mqtt: mqtt:
device-op-last-time: -5 device-op-last-time: -5
device-gateway-last-report-time: -10 device-gateway-last-report-time: -10
\ No newline at end of file api:
domain: https://www.coujio.com
\ No newline at end of file
...@@ -216,3 +216,5 @@ order: ...@@ -216,3 +216,5 @@ order:
mqtt: mqtt:
device-op-last-time: -5 device-op-last-time: -5
device-gateway-last-report-time: -10 device-gateway-last-report-time: -10
api:
domain: https://www.coujio.com
...@@ -7,6 +7,7 @@ import com.saobei.open.sdk.model.response.trade.SaobeiMiniPayResponse; ...@@ -7,6 +7,7 @@ import com.saobei.open.sdk.model.response.trade.SaobeiMiniPayResponse;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import share.common.config.SaobeiConfig; import share.common.config.SaobeiConfig;
import share.common.config.WeChatConfig; import share.common.config.WeChatConfig;
...@@ -54,6 +55,11 @@ public class OrderPayServiceImpl implements OrderPayService { ...@@ -54,6 +55,11 @@ public class OrderPayServiceImpl implements OrderPayService {
@Autowired @Autowired
private SaobeiService saobeiService; private SaobeiService saobeiService;
/**
* 获取域名
*/
@Value("${api.domain}")
private String apiDomain;
@Override @Override
public OrderPayResultResponse payment(SOrder sOrder) { public OrderPayResultResponse payment(SOrder sOrder) {
...@@ -142,8 +148,6 @@ public class OrderPayServiceImpl implements OrderPayService { ...@@ -142,8 +148,6 @@ public class OrderPayServiceImpl implements OrderPayService {
* @return 微信预下单对象 * @return 微信预下单对象
*/ */
private CreateOrderRequestVo getUnifiedorderVo(SOrder sOrder, String openid, String appId, String mchId, String signKey) { private CreateOrderRequestVo getUnifiedorderVo(SOrder sOrder, String openid, String appId, String mchId, String signKey) {
// 获取域名
String apiDomain = Constants.CONFIG_KEY_API_URL;
AttachVo attachVo = new AttachVo(OrderTypeEnum.getEnumByCode(sOrder.getOrderType()).getValue(), sOrder.getConsumerId()); AttachVo attachVo = new AttachVo(OrderTypeEnum.getEnumByCode(sOrder.getOrderType()).getValue(), sOrder.getConsumerId());
CreateOrderRequestVo vo = new CreateOrderRequestVo(); CreateOrderRequestVo vo = new CreateOrderRequestVo();
...@@ -204,8 +208,6 @@ public class OrderPayServiceImpl implements OrderPayService { ...@@ -204,8 +208,6 @@ public class OrderPayServiceImpl implements OrderPayService {
* @return 预下单对象 * @return 预下单对象
*/ */
private SaobeiMiniPayRequestVo getSaobeiUnifiedOrderVo(SOrder sOrder, String openid, String appId, String mchId, String signKey) { private SaobeiMiniPayRequestVo getSaobeiUnifiedOrderVo(SOrder sOrder, String openid, String appId, String mchId, String signKey) {
// 获取域名
String apiDomain = Constants.CONFIG_KEY_API_URL;
AttachVo attachVo = new AttachVo(OrderTypeEnum.getEnumByCode(sOrder.getOrderType()).getValue(), sOrder.getConsumerId()); AttachVo attachVo = new AttachVo(OrderTypeEnum.getEnumByCode(sOrder.getOrderType()).getValue(), sOrder.getConsumerId());
SaobeiMiniPayRequestVo vo = new SaobeiMiniPayRequestVo(); SaobeiMiniPayRequestVo vo = new SaobeiMiniPayRequestVo();
......
...@@ -5,6 +5,7 @@ import cn.hutool.json.JSONUtil; ...@@ -5,6 +5,7 @@ import cn.hutool.json.JSONUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.saobei.open.sdk.model.response.trade.SaobeiTradeRefundResponse; import com.saobei.open.sdk.model.response.trade.SaobeiTradeRefundResponse;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import share.common.config.WeChatConfig; import share.common.config.WeChatConfig;
import share.common.constant.Constants; import share.common.constant.Constants;
...@@ -53,6 +54,11 @@ public class OrderRefundServiceImpl extends ServiceImpl<SOrderMapper, SOrder> im ...@@ -53,6 +54,11 @@ public class OrderRefundServiceImpl extends ServiceImpl<SOrderMapper, SOrder> im
private ISConsumptionRecordsService sConsumptionRecordsService; private ISConsumptionRecordsService sConsumptionRecordsService;
@Autowired @Autowired
private ISRoomService roomService; private ISRoomService roomService;
/**
* 获取域名
*/
@Value("${api.domain}")
private String apiDomain;
/** /**
* 退款 需要优化 * 退款 需要优化
...@@ -78,7 +84,6 @@ public class OrderRefundServiceImpl extends ServiceImpl<SOrderMapper, SOrder> im ...@@ -78,7 +84,6 @@ public class OrderRefundServiceImpl extends ServiceImpl<SOrderMapper, SOrder> im
String mchId = weChatConfig.getMchId(); String mchId = weChatConfig.getMchId();
String signKey = weChatConfig.getSignKey(); String signKey = weChatConfig.getSignKey();
String path = weChatConfig.getCertPath(); //TODO 商户证书路径p12(待提供) String path = weChatConfig.getCertPath(); //TODO 商户证书路径p12(待提供)
String apiDomain = Constants.CONFIG_KEY_API_URL;
//统一下单数据 //统一下单数据
WxRefundVo wxRefundVo = new WxRefundVo(); WxRefundVo wxRefundVo = new WxRefundVo();
wxRefundVo.setAppid(appId); wxRefundVo.setAppid(appId);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment