修改小程序支付回调payType

This commit is contained in:
谭凯凯
2024-10-14 15:43:44 +08:00
committed by Tankaikai
parent c78d9d7294
commit c6d073a3fd
2 changed files with 6 additions and 6 deletions

View File

@@ -4,7 +4,6 @@ package com.chaozhanggui.system.cashierservice.controller;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.chaozhanggui.system.cashierservice.entity.Enum.PayTypeConstant;
import com.chaozhanggui.system.cashierservice.interceptor.RequestWrapper;
import com.chaozhanggui.system.cashierservice.service.PayService;
import com.chaozhanggui.system.cashierservice.sign.Result;
@@ -17,7 +16,6 @@ import javax.servlet.http.HttpServletRequest;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.Random;
@CrossOrigin(origins = "*")
@RestController
@@ -81,6 +79,7 @@ public class NotifyController {
&& !"0100".equals(object.getStr("payType"))
){
String orderNo=object.getStr("orderNumber");
return payService.callBackPay(orderNo);
}
}
@@ -110,7 +109,8 @@ public class NotifyController {
if("TRADE_SUCCESS".equals(object.get("state").toString())){
String orderNo=object.get("mchOrderNo").toString();
String tradeNo=object.get("payOrderId").toString();
return payService.callBackPayFST(tradeNo);
String payType=object.getStr("payType");
return payService.callBackPayFST(tradeNo,payType);
}else {
String tradeNo=object.get("payOrderId").toString();
return String.valueOf(payService.activateOrder(tradeNo));

View File

@@ -8,8 +8,8 @@ import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.chaozhanggui.system.cashierservice.dao.*;
import com.chaozhanggui.system.cashierservice.entity.*;
import com.chaozhanggui.system.cashierservice.entity.Enum.OrderUseTypeEnum;
import com.chaozhanggui.system.cashierservice.entity.*;
import com.chaozhanggui.system.cashierservice.entity.dto.ReturnGroupOrderDto;
import com.chaozhanggui.system.cashierservice.entity.dto.ShopEatTypeInfoDTO;
import com.chaozhanggui.system.cashierservice.entity.vo.ShopUserListVo;
@@ -1064,7 +1064,7 @@ public class PayService {
@Transactional(rollbackFor = Exception.class)
public String callBackPayFST(String payOrderNO) {
public String callBackPayFST(String payOrderNO,String payType) {
TbOrderInfo orderInfo = tbOrderInfoMapper.selectByPayOrderNo(payOrderNO);
if (ObjectUtil.isEmpty(orderInfo)) {
return "订单信息不存在";
@@ -1089,7 +1089,7 @@ public class PayService {
//修改主单状态
orderInfo.setStatus("closed");
orderInfo.setPayType("wx_lite");
orderInfo.setPayType(payType);
orderInfo.setPayOrderNo(payOrderNO);
orderInfo.setPayAmount(orderInfo.getOrderAmount());
orderInfo.setPaidTime(System.currentTimeMillis());