parent
7e7a764201
commit
2ea4be7f82
|
|
@ -146,8 +146,7 @@ public class OrderPayController {
|
||||||
* checkOrderPay.orderAmount 必填
|
* checkOrderPay.orderAmount 必填
|
||||||
*/
|
*/
|
||||||
@PostMapping("/shopPayApi/js2Pay")
|
@PostMapping("/shopPayApi/js2Pay")
|
||||||
public CzgResult<Map<String, Object>> js2PayOrder(@RequestHeader Long shopId, HttpServletRequest request, @RequestBody OrderPayParamDTO payParam) {
|
public CzgResult<Map<String, Object>> js2PayOrder(HttpServletRequest request, @RequestBody OrderPayParamDTO payParam) {
|
||||||
payParam.setShopId(shopId);
|
|
||||||
return payService.js2PayOrder(ServletUtil.getClientIP(request), payParam);
|
return payService.js2PayOrder(ServletUtil.getClientIP(request), payParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,7 @@ import com.mybatisflex.core.update.UpdateChain;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
import jakarta.validation.constraints.NotBlank;
|
import jakarta.validation.constraints.NotBlank;
|
||||||
import lombok.NonNull;
|
import lombok.NonNull;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.dubbo.config.annotation.DubboReference;
|
import org.apache.dubbo.config.annotation.DubboReference;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
@ -56,6 +57,7 @@ import java.util.Map;
|
||||||
* @author ww
|
* @author ww
|
||||||
* @description
|
* @description
|
||||||
*/
|
*/
|
||||||
|
@Slf4j
|
||||||
@Service
|
@Service
|
||||||
public class PayServiceImpl implements PayService {
|
public class PayServiceImpl implements PayService {
|
||||||
|
|
||||||
|
|
@ -99,6 +101,7 @@ public class PayServiceImpl implements PayService {
|
||||||
private OrderInfo checkPay(CheckOrderPay checkOrderPay) {
|
private OrderInfo checkPay(CheckOrderPay checkOrderPay) {
|
||||||
OrderInfo orderInfo = orderInfoService.checkOrderPay(checkOrderPay);
|
OrderInfo orderInfo = orderInfoService.checkOrderPay(checkOrderPay);
|
||||||
if (orderInfo.getOrderAmount().compareTo(BigDecimal.ZERO) == 0) {
|
if (orderInfo.getOrderAmount().compareTo(BigDecimal.ZERO) == 0) {
|
||||||
|
log.info("订单:{} 金额为0", orderInfo);
|
||||||
orderInfoService.upOrderInfo(orderInfo, orderInfo.getOrderAmount(),
|
orderInfoService.upOrderInfo(orderInfo, orderInfo.getOrderAmount(),
|
||||||
LocalDateTime.now(), null, PayEnums.CASH_PAY);
|
LocalDateTime.now(), null, PayEnums.CASH_PAY);
|
||||||
redisService.del(RedisCst.classKeyExpired.EXPIRED_ORDER + orderInfo.getId());
|
redisService.del(RedisCst.classKeyExpired.EXPIRED_ORDER + orderInfo.getId());
|
||||||
|
|
@ -152,6 +155,7 @@ public class PayServiceImpl implements PayService {
|
||||||
@Transactional
|
@Transactional
|
||||||
public CzgResult<Object> cashPayOrder(OrderPayParamDTO payParam) {
|
public CzgResult<Object> cashPayOrder(OrderPayParamDTO payParam) {
|
||||||
OrderInfo orderInfo = checkPay(payParam.getCheckOrderPay());
|
OrderInfo orderInfo = checkPay(payParam.getCheckOrderPay());
|
||||||
|
log.info("现金付款:{}", orderInfo);
|
||||||
orderInfoService.upOrderInfo(orderInfo, orderInfo.getOrderAmount(),
|
orderInfoService.upOrderInfo(orderInfo, orderInfo.getOrderAmount(),
|
||||||
LocalDateTime.now(), null, PayEnums.CASH_PAY);
|
LocalDateTime.now(), null, PayEnums.CASH_PAY);
|
||||||
if (orderInfo.getPointsNum() != null && orderInfo.getPointsNum() > 0) {
|
if (orderInfo.getPointsNum() != null && orderInfo.getPointsNum() > 0) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue