订单退款方式

This commit is contained in:
wangw 2025-04-08 09:35:07 +08:00
parent f6b4504132
commit 4e9d4b620f
4 changed files with 14 additions and 9 deletions

View File

@ -23,7 +23,6 @@ import lombok.NoArgsConstructor;
* @since 2025-02-13 * @since 2025-02-13
*/ */
@Data @Data
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
@Table("tb_order_info") @Table("tb_order_info")
@ -128,6 +127,10 @@ public class OrderInfo implements Serializable {
* 台桌名称 * 台桌名称
*/ */
private String tableName; private String tableName;
/**
* 退款方式 现金退款-cash 原路退回-payBack
*/
private String refundType;
/** /**
* 订单类型- * 订单类型-

View File

@ -71,6 +71,10 @@ public class OrderInfoVo implements Serializable {
* miniapp小程序 * miniapp小程序
*/ */
private String orderType; private String orderType;
/**
* 退款方式 现金退款-cash 原路退回-payBack
*/
private String refundType;
/** /**
* 平台类型 pc 收银机客户端 wechat 微信小程序 alipay 支付宝小程序 admin-pc PC管理端 admin-app APP管理端 * 平台类型 pc 收银机客户端 wechat 微信小程序 alipay 支付宝小程序 admin-pc PC管理端 admin-app APP管理端

View File

@ -667,7 +667,9 @@ public class PayServiceImpl implements PayService {
refundOrder(orderInfo.getShopId(), orderInfo.getId(), orderInfo.getPayOrderId(), refundOrder(orderInfo.getShopId(), orderInfo.getId(), orderInfo.getPayOrderId(),
refPayOrderNo, StrUtil.isBlank(param.getRefundReason()) ? "退款" : param.getRefundReason(), param.getRefundAmount()); refPayOrderNo, StrUtil.isBlank(param.getRefundReason()) ? "退款" : param.getRefundReason(), param.getRefundAmount());
} }
orderInfo.setRefundType("payBack");
} }
orderInfo.setRefundType("cash");
} else { } else {
orderInfo.setOrderAmount(orderInfo.getOrderAmount().subtract(param.getRefundAmount())); orderInfo.setOrderAmount(orderInfo.getOrderAmount().subtract(param.getRefundAmount()));
} }

View File

@ -4,23 +4,17 @@ import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONObject; import com.alibaba.fastjson2.JSONObject;
import com.czg.account.entity.ShopInfo; import com.czg.account.entity.ShopInfo;
import com.czg.account.entity.SysRole;
import com.czg.account.service.ShopInfoService; import com.czg.account.service.ShopInfoService;
import com.czg.account.service.SyncNoticeService;
import com.czg.exception.CzgException; import com.czg.exception.CzgException;
import com.czg.product.entity.*; import com.czg.product.entity.*;
import com.czg.product.service.*; import com.czg.product.service.*;
import com.czg.product.vo.ProductGroupVo; import com.czg.product.vo.ProductGroupVo;
import com.czg.service.product.mapper.ConsInfoMapper;
import com.czg.service.product.mapper.ProdConsRelationMapper;
import com.czg.service.product.mapper.ProdSkuMapper;
import com.czg.utils.AssertUtil; import com.czg.utils.AssertUtil;
import jakarta.annotation.Resource; import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.math.BigDecimal; import java.math.BigDecimal;
@ -31,7 +25,6 @@ import java.util.Map;
import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutorService; import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors; import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import static com.mybatisflex.core.query.QueryMethods.column; import static com.mybatisflex.core.query.QueryMethods.column;
@ -64,6 +57,8 @@ public class ShopSyncServiceImpl implements ShopSyncService {
private ConsGroupService consGroupService; private ConsGroupService consGroupService;
@Resource @Resource
private ProdConsRelationService prodConsRelationService; private ProdConsRelationService prodConsRelationService;
@Resource
private SyncNoticeService syncNoticeService;
private void checkShopInfo(Long sourceShopId, Long targetShopId) { private void checkShopInfo(Long sourceShopId, Long targetShopId) {
AssertUtil.isNull(sourceShopId, "{}不能为空", "源店铺ID"); AssertUtil.isNull(sourceShopId, "{}不能为空", "源店铺ID");
@ -78,6 +73,7 @@ public class ShopSyncServiceImpl implements ShopSyncService {
|| targetShop.getIsHeadShop() == null || targetShop.getIsHeadShop().equals(1)) { || targetShop.getIsHeadShop() == null || targetShop.getIsHeadShop().equals(1)) {
throw new CzgException("同步失败,目标店铺是主店铺或目标店铺是单店"); throw new CzgException("同步失败,目标店铺是主店铺或目标店铺是单店");
} }
} }
@Override @Override