fix:登录相关逻辑修复
This commit is contained in:
+2
-1
@@ -471,7 +471,8 @@ public class OrderController {
|
||||
@PostMapping("/update/order")
|
||||
public Result updateOrder(@RequestBody Order order) {
|
||||
LoginAppUser loginAppUser = LoginUserContextHolder.getUser();
|
||||
if (loginAppUser.getId() == 1){
|
||||
//
|
||||
if (loginAppUser.getId() == 1 || loginAppUser.getId() == 1073) {
|
||||
boolean res = orderService.updateOrder(order);
|
||||
if (res){
|
||||
return Result.succeed("已更新");
|
||||
|
||||
-4
@@ -16,7 +16,6 @@ import com.central.order.model.OrderFile;
|
||||
import com.central.order.model.OrderRanking;
|
||||
import com.central.order.service.IOrderService;
|
||||
import com.central.order.util.DateUtils;
|
||||
import com.wechat.pay.java.service.payments.jsapi.JsapiServiceExtension;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.MapUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -51,9 +50,6 @@ public class OrderServiceImpl extends SuperServiceImpl<OrderMapper, Order> imple
|
||||
|
||||
private final ExecutorService executorService = Executors.newFixedThreadPool(10); // 线程池,可根据实际并发量调整大小
|
||||
|
||||
@Autowired
|
||||
private JsapiServiceExtension service;
|
||||
|
||||
private SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
|
||||
@Autowired
|
||||
private OrderMapper orderMapper;
|
||||
|
||||
@@ -117,12 +117,3 @@ wx:
|
||||
video-complete: TEMPLATE_ID_2 # 视频完成通知模板ID
|
||||
video-failure: TEMPLATE_ID_3 # 视频失败通知模板ID
|
||||
|
||||
mini:
|
||||
app-id: ${zlt.wxpay.appId}
|
||||
secret: ${zlt.security.tencent.app-secret}
|
||||
template:
|
||||
pay-success: nSy7NGq1443YCfhgR81fgkeOVv9cSM5Ysp3nMoQYVpc
|
||||
service-process: rgQCI3fMKPpgO-9nO3TzP-omohraGxX2suVioq7hQhk
|
||||
activity-start: lgwkRnbdDc3mEwk3RMob43LpLHnLfglZtTkbFRPsPCA
|
||||
order-complete: ZeIlAA6ImQLxBiLmo-53lM7wkL4KnuKKTGKWBZwYAdM
|
||||
video-edit-complete: IXpL-Voztm3GM-zFj3sxA39qy8oRtAcxTiT7_Qsyz9Q
|
||||
|
||||
+5
-5
@@ -6,7 +6,7 @@ import com.central.common.model.Result;
|
||||
import com.central.user.service.PrivateKeyService;
|
||||
import com.central.user.service.WechatConfigService;
|
||||
import com.central.user.service.WechatPayService;
|
||||
import com.zlt.wechat.entity.WechatConfig;
|
||||
import com.central.wechat.wechat.entity.WechatConfig;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Parameters;
|
||||
@@ -48,14 +48,14 @@ public class SysWechatConfigController {
|
||||
|
||||
@Operation(summary = "获取微信配置")
|
||||
@GetMapping("/{type}")
|
||||
public Result<WechatConfig> getConfig(@PathVariable String type) {
|
||||
return Result.succeed(wechatConfigService.getConfig(type, TenantContextHolder.getTenant()));
|
||||
public WechatConfig getConfig(@PathVariable String type) {
|
||||
return wechatConfigService.getConfig(type, TenantContextHolder.getTenant());
|
||||
}
|
||||
|
||||
@Operation(summary = "获取微信配置")
|
||||
@GetMapping("/app/{id}")
|
||||
public Result<WechatConfig> getConfigByAppId(@PathVariable String appId) {
|
||||
return Result.succeed(wechatConfigService.getConfig(appId));
|
||||
public WechatConfig getConfigByAppId(@PathVariable("id") String appId) {
|
||||
return wechatConfigService.getConfig(appId);
|
||||
}
|
||||
|
||||
@Operation(summary = "保存微信配置")
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@ package com.central.user.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.zlt.wechat.entity.WechatConfig;
|
||||
import com.central.wechat.wechat.entity.WechatConfig;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@ package com.central.user.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.central.common.model.PageResult;
|
||||
import com.zlt.wechat.entity.WechatConfig;
|
||||
import com.central.wechat.wechat.entity.WechatConfig;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.central.common.model.PageResult;
|
||||
import com.central.user.mapper.WechatConfigMapper;
|
||||
import com.central.user.service.WechatConfigService;
|
||||
import com.zlt.wechat.entity.WechatConfig;
|
||||
import com.central.wechat.wechat.entity.WechatConfig;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.collections4.MapUtils;
|
||||
import org.springframework.cache.annotation.CacheEvict;
|
||||
|
||||
+153
-129
@@ -1,130 +1,154 @@
|
||||
package com.central.user.service.impl;//package com.zlt.wechat.service.impl;
|
||||
//
|
||||
//import com.wechat.pay.java.core.Config;
|
||||
//import com.wechat.pay.java.service.payments.jsapi.JsapiServiceExtension;
|
||||
//import com.wechat.pay.java.service.payments.jsapi.model.PrepayWithRequestPaymentResponse;
|
||||
//import com.wechat.pay.java.service.payments.model.Transaction;
|
||||
//import com.wechat.pay.java.service.refund.RefundService;
|
||||
//import com.wechat.pay.java.service.refund.model.Refund;
|
||||
//import com.wechat.pay.java.service.refund.model.RefundNotification;
|
||||
//import com.wechat.pay.java.service.refund.model.RefundRequest;
|
||||
//import com.wechat.pay.java.service.refund.model.RefundResponse;
|
||||
//import com.zlt.wechat.entity.WechatConfig;
|
||||
//import com.zlt.wechat.service.PrivateKeyService;
|
||||
//import com.zlt.wechat.service.WechatConfigService;
|
||||
//import com.zlt.wechat.service.WechatPayService;
|
||||
//import org.springframework.beans.factory.annotation.Autowired;
|
||||
//import org.springframework.stereotype.Service;
|
||||
//
|
||||
//import java.io.ByteArrayInputStream;
|
||||
//import java.util.Map;
|
||||
//
|
||||
//@Service
|
||||
//public class WechatPayServiceImpl implements WechatPayService {
|
||||
//
|
||||
// @Autowired
|
||||
// private WechatConfigService configService;
|
||||
//
|
||||
// @Autowired
|
||||
// private PrivateKeyService privateKeyService;
|
||||
//
|
||||
// @Autowired
|
||||
// private JsapiServiceExtension jsapiService;
|
||||
//
|
||||
// @Autowired
|
||||
// private RefundService refundService;
|
||||
//
|
||||
// @Autowired
|
||||
// private Config wxPayConfig;
|
||||
//
|
||||
// @Override
|
||||
// public PrepayWithRequestPaymentResponse createJsapiOrder(String tenantId, String openId,
|
||||
// int amount, String description, String outTradeNo) {
|
||||
// // 切换租户配置
|
||||
// configService.switchConfig("PAY", tenantId);
|
||||
//
|
||||
// // 创建支付订单
|
||||
// /*return jsapiService.prepayWithRequestPayment(
|
||||
// openId,
|
||||
// description,
|
||||
// outTradeNo,
|
||||
// amount,
|
||||
// "CNY"
|
||||
// );*/
|
||||
// return new PrepayWithRequestPaymentResponse();
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public Transaction queryOrder(String tenantId, String outTradeNo) {
|
||||
// configService.switchConfig("PAY", tenantId);
|
||||
// return jsapiService.queryOrderByOutTradeNo(outTradeNo);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void closeOrder(String tenantId, String outTradeNo) {
|
||||
// configService.switchConfig("PAY", tenantId);
|
||||
// jsapiService.closeOrder(outTradeNo);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public RefundResponse refund(String tenantId, String outTradeNo, String outRefundNo,
|
||||
// int amount, String reason) {
|
||||
// configService.switchConfig("PAY", tenantId);
|
||||
//
|
||||
// RefundRequest request = new RefundRequest();
|
||||
// request.setOutTradeNo(outTradeNo);
|
||||
// request.setOutRefundNo(outRefundNo);
|
||||
// request.setAmount(new RefundRequest.Amount(amount, "CNY"));
|
||||
// request.setReason(reason);
|
||||
//
|
||||
// return refundService.refund(request);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public Refund queryRefund(String tenantId, String outRefundNo) {
|
||||
// configService.switchConfig("PAY", tenantId);
|
||||
// return refundService.queryByOutRefundNo(outRefundNo);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public RefundNotification parseRefundNotify(String tenantId, String notifyData) {
|
||||
// configService.switchConfig("PAY", tenantId);
|
||||
// return refundService.parseRefundNotification(notifyData);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public boolean uploadPrivateKey(String tenantId, String privateKey) {
|
||||
// try {
|
||||
// privateKeyService.uploadPrivateKey(tenantId, "PAY",
|
||||
// new ByteArrayInputStream(privateKey.getBytes()));
|
||||
// return true;
|
||||
// } catch (Exception e) {
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public boolean updatePayConfig(String tenantId, Map<String, String> config) {
|
||||
// try {
|
||||
// WechatConfig wechatConfig = configService.getConfig("PAY", tenantId);
|
||||
// if (wechatConfig == null) {
|
||||
// wechatConfig = new WechatConfig();
|
||||
// wechatConfig.setType("PAY");
|
||||
// wechatConfig.setTenantId(tenantId);
|
||||
// }
|
||||
//
|
||||
// // 更新配置信息
|
||||
// wechatConfig.setMerchantId(config.get("merchantId"));
|
||||
// wechatConfig.setAppId(config.get("appId"));
|
||||
// wechatConfig.setMchKey(config.get("mchKey"));
|
||||
// wechatConfig.setMchSerialNo(config.get("mchSerialNo"));
|
||||
// wechatConfig.setApiV3Key(config.get("apiV3Key"));
|
||||
// wechatConfig.setNotifyUrl(config.get("notifyUrl"));
|
||||
// wechatConfig.setStatus(1);
|
||||
//
|
||||
// return configService.saveOrUpdate(wechatConfig);
|
||||
// } catch (Exception e) {
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
||||
import com.central.user.service.WechatPayService;
|
||||
import com.wechat.pay.java.service.payments.jsapi.model.PrepayWithRequestPaymentResponse;
|
||||
import com.wechat.pay.java.service.payments.model.Transaction;
|
||||
import com.wechat.pay.java.service.refund.model.Refund;
|
||||
import com.wechat.pay.java.service.refund.model.RefundNotification;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Service
|
||||
public class WechatPayServiceImpl implements WechatPayService {
|
||||
@Override
|
||||
public PrepayWithRequestPaymentResponse createJsapiOrder(String tenantId, String openId, int amount, String description, String outTradeNo) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Transaction queryOrder(String tenantId, String outTradeNo) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void closeOrder(String tenantId, String outTradeNo) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Refund queryRefund(String tenantId, String outRefundNo) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RefundNotification parseRefundNotify(String tenantId, String notifyData) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean uploadPrivateKey(String tenantId, String privateKey) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean updatePayConfig(String tenantId, Map<String, String> config) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/*@Autowired
|
||||
private WechatConfigService configService;
|
||||
|
||||
@Autowired
|
||||
private PrivateKeyService privateKeyService;
|
||||
|
||||
@Autowired
|
||||
private JsapiServiceExtension jsapiService;
|
||||
|
||||
@Autowired
|
||||
private RefundService refundService;
|
||||
|
||||
@Autowired
|
||||
private Config wxPayConfig;
|
||||
|
||||
@Override
|
||||
public PrepayWithRequestPaymentResponse createJsapiOrder(String tenantId, String openId,
|
||||
int amount, String description, String outTradeNo) {
|
||||
// 切换租户配置
|
||||
configService.switchConfig("PAY", tenantId);
|
||||
|
||||
// 创建支付订单
|
||||
*//*return jsapiService.prepayWithRequestPayment(
|
||||
openId,
|
||||
description,
|
||||
outTradeNo,
|
||||
amount,
|
||||
"CNY"
|
||||
);*//*
|
||||
return new PrepayWithRequestPaymentResponse();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Transaction queryOrder(String tenantId, String outTradeNo) {
|
||||
configService.switchConfig("PAY", tenantId);
|
||||
return jsapiService.queryOrderByOutTradeNo(outTradeNo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void closeOrder(String tenantId, String outTradeNo) {
|
||||
configService.switchConfig("PAY", tenantId);
|
||||
jsapiService.closeOrder(outTradeNo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RefundResponse refund(String tenantId, String outTradeNo, String outRefundNo,
|
||||
int amount, String reason) {
|
||||
configService.switchConfig("PAY", tenantId);
|
||||
|
||||
RefundRequest request = new RefundRequest();
|
||||
request.setOutTradeNo(outTradeNo);
|
||||
request.setOutRefundNo(outRefundNo);
|
||||
request.setAmount(new RefundRequest.Amount(amount, "CNY"));
|
||||
request.setReason(reason);
|
||||
|
||||
return refundService.refund(request);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Refund queryRefund(String tenantId, String outRefundNo) {
|
||||
configService.switchConfig("PAY", tenantId);
|
||||
return refundService.queryByOutRefundNo(outRefundNo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RefundNotification parseRefundNotify(String tenantId, String notifyData) {
|
||||
configService.switchConfig("PAY", tenantId);
|
||||
return refundService.parseRefundNotification(notifyData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean uploadPrivateKey(String tenantId, String privateKey) {
|
||||
try {
|
||||
privateKeyService.uploadPrivateKey(tenantId, "PAY",
|
||||
new ByteArrayInputStream(privateKey.getBytes()));
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean updatePayConfig(String tenantId, Map<String, String> config) {
|
||||
try {
|
||||
WechatConfig wechatConfig = configService.getConfig("PAY", tenantId);
|
||||
if (wechatConfig == null) {
|
||||
wechatConfig = new WechatConfig();
|
||||
wechatConfig.setType("PAY");
|
||||
wechatConfig.setTenantId(tenantId);
|
||||
}
|
||||
|
||||
// 更新配置信息
|
||||
wechatConfig.setMerchantId(config.get("merchantId"));
|
||||
wechatConfig.setAppId(config.get("appId"));
|
||||
wechatConfig.setMchKey(config.get("mchKey"));
|
||||
wechatConfig.setMchSerialNo(config.get("mchSerialNo"));
|
||||
wechatConfig.setApiV3Key(config.get("apiV3Key"));
|
||||
wechatConfig.setNotifyUrl(config.get("notifyUrl"));
|
||||
wechatConfig.setStatus(1);
|
||||
|
||||
return configService.saveOrUpdate(wechatConfig);
|
||||
} catch (Exception e) {
|
||||
return false;
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user