获取shopId

现金支付 日志
This commit is contained in:
wangw 2025-03-07 15:10:11 +08:00
parent 7e7a764201
commit 2ea4be7f82
2 changed files with 6 additions and 3 deletions

View File

@ -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);
}

View File

@ -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) {
@ -473,7 +477,7 @@ public class PayServiceImpl implements PayService {
shopUserService.updateMoney(shopUser.getShopId(), shopUserMoneyEditDTO);
userFlowService.updateRefund(inFlow.getId(), refPayParam.getRefAmount());
if (giftFlow != null) {
userFlowService.updateRefund( giftFlow.getId(), giftFlow.getAmount());
userFlowService.updateRefund(giftFlow.getId(), giftFlow.getAmount());
}
//移除优惠券
inRecordService.remove(QueryWrapper.create()