|
|
@@ -4,18 +4,23 @@ import ch.qos.logback.core.util.StringUtil;
|
|
|
import com.github.microservice.auth.security.helper.AuthHelper;
|
|
|
import com.github.microservice.core.helper.ApplicationContextHolder;
|
|
|
import com.github.microservice.net.ResultContent;
|
|
|
+import com.github.microservice.net.ResultMessage;
|
|
|
import com.wechat.pay.java.service.payments.model.Transaction;
|
|
|
import com.zhongshu.card.client.model.feign.ProjectWxPayParam;
|
|
|
+import com.zhongshu.card.client.model.operLogs.OperationLogsAddParam;
|
|
|
import com.zhongshu.card.client.model.org.OrgUserDetailParam;
|
|
|
import com.zhongshu.card.client.model.org.OrganizationUserModel;
|
|
|
import com.zhongshu.card.client.model.payment.paySetting.WxPayConfigModel;
|
|
|
+import com.zhongshu.card.client.service.feign.OperationLogsFeignService;
|
|
|
import com.zhongshu.card.client.service.feign.OrganizationFeignService;
|
|
|
import com.zhongshu.card.client.service.feign.ProjectPaySettingFeignService;
|
|
|
+import com.zhongshu.card.client.type.LogsLevel;
|
|
|
+import com.zhongshu.card.client.type.MessageType;
|
|
|
import com.zhongshu.payment.client.model.RechargeRecordModel;
|
|
|
import com.zhongshu.payment.client.model.param.OrderParam;
|
|
|
import com.zhongshu.payment.client.model.param.RechargeParam;
|
|
|
import com.zhongshu.payment.client.payModel.commn.ClosePayOrderParam;
|
|
|
-import com.zhongshu.payment.client.payModel.commn.PayNotityParam;
|
|
|
+import com.zhongshu.payment.client.payModel.commn.PayNotifyParam;
|
|
|
import com.zhongshu.payment.client.types.RechargeState;
|
|
|
import com.zhongshu.payment.client.types.TradeType;
|
|
|
import com.zhongshu.payment.client.types.WalletState;
|
|
|
@@ -87,6 +92,9 @@ public class RechargeService extends SuperService {
|
|
|
@Autowired
|
|
|
ExecuteMethodInfoDao executeMethodInfoDao;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ OperationLogsFeignService logsFeignService;
|
|
|
+
|
|
|
/**
|
|
|
* 创建充值本地订单
|
|
|
*/
|
|
|
@@ -160,7 +168,7 @@ public class RechargeService extends SuperService {
|
|
|
}
|
|
|
ExecuteMethodInfo executeMethodInfo = executeMethodInfoDao.findTopByPaymentType(record.getPaymentType());
|
|
|
if (ObjectUtils.isEmpty(executeMethodInfo)) {
|
|
|
- return ResultContent.buildFail(String.format("", record.getPaymentType().getRemark()));
|
|
|
+ return ResultContent.buildFail(String.format(ResultMessage.SERVICE_NAME_NOT_EXIT, record.getPaymentType().getRemark()));
|
|
|
}
|
|
|
SuperPayService service = (SuperPayService) ApplicationContextHolder.getContext().getBean(executeMethodInfo.getBeanName());
|
|
|
return service.createChannelOrder(param);
|
|
|
@@ -175,13 +183,20 @@ public class RechargeService extends SuperService {
|
|
|
public ResultContent payNotify(HttpServletRequest request, String outTradeNo) {
|
|
|
RechargeRecord record = rechargeRecordDao.findByOutTradeNo(outTradeNo);
|
|
|
if (record == null) {
|
|
|
- return ResultContent.buildFail("充值订单:" + outTradeNo + "不存在");
|
|
|
+ OperationLogsAddParam logsAddParam = initLog();
|
|
|
+ logsAddParam.setLevel(LogsLevel.High);
|
|
|
+ logsAddParam.setMessageType(MessageType.Error);
|
|
|
+ String msg = "充值订单:" + outTradeNo + "不存在";
|
|
|
+ logsAddParam.setContent(msg);
|
|
|
+ logsAddParam.setDataId(outTradeNo);
|
|
|
+ logsAddParam.setTitle("微信支付回调错误");
|
|
|
+ return ResultContent.buildFail(msg);
|
|
|
}
|
|
|
- PayNotityParam param = new PayNotityParam();
|
|
|
+ PayNotifyParam param = new PayNotifyParam();
|
|
|
param.setOutTradeNo(outTradeNo);
|
|
|
ExecuteMethodInfo executeMethodInfo = executeMethodInfoDao.findTopByPaymentType(record.getPaymentType());
|
|
|
if (ObjectUtils.isEmpty(executeMethodInfo)) {
|
|
|
- return ResultContent.buildFail(String.format("", record.getPaymentType().getRemark()));
|
|
|
+ return ResultContent.buildFail(String.format(ResultMessage.SERVICE_NAME_NOT_EXIT, record.getPaymentType().getRemark()));
|
|
|
}
|
|
|
SuperPayService service = (SuperPayService) ApplicationContextHolder.getContext().getBean(executeMethodInfo.getBeanName());
|
|
|
return service.payNotify(request, param);
|
|
|
@@ -227,7 +242,7 @@ public class RechargeService extends SuperService {
|
|
|
}
|
|
|
ExecuteMethodInfo executeMethodInfo = executeMethodInfoDao.findTopByPaymentType(record.getPaymentType());
|
|
|
if (ObjectUtils.isEmpty(executeMethodInfo)) {
|
|
|
- return ResultContent.buildFail(String.format("", record.getPaymentType().getRemark()));
|
|
|
+ return ResultContent.buildFail(String.format(ResultMessage.SERVICE_NAME_NOT_EXIT, record.getPaymentType().getRemark()));
|
|
|
}
|
|
|
SuperPayService service = (SuperPayService) ApplicationContextHolder.getContext().getBean(executeMethodInfo.getBeanName());
|
|
|
ResultContent resultContent = service.closePayOrder(ClosePayOrderParam.builder().outTradeNo(outTradeNo).build());
|