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