退款模式

This commit is contained in:
2026-04-21 18:13:35 +08:00
parent 0f51159f95
commit 28f5ead83a
13 changed files with 5 additions and 274 deletions

View File

@@ -21,7 +21,6 @@ import com.czg.config.RedisCst;
import com.czg.constant.MarketConstants;
import com.czg.constant.TableValueConstant;
import com.czg.constants.PayTypeConstants;
import com.czg.constants.SystemConstants;
import com.czg.entity.notify.CzgRefundNotifyDTO;
import com.czg.enums.ShopTableStatusEnum;
import com.czg.enums.ShopUserFlowBizEnum;
@@ -1841,7 +1840,7 @@ public class OrderInfoCustomServiceImpl implements OrderInfoCustomService {
*/
@Override
public void refundStock(ShopInfo shopInfo, Long orderId, Map<Long, BigDecimal> products, boolean refundStock) {
List<Product> list = productService.list(new QueryWrapper().select(Product::getId, Product::getCategoryId, Product::getRefundMode, Product::getIsRefundStock)
List<Product> list = productService.list(new QueryWrapper().select(Product::getId, Product::getCategoryId, Product::getRefundMode)
.eq(Product::getShopId, shopInfo.getId())
.in(Product::getId, products.keySet()));
if (CollUtil.isEmpty(list)) {
@@ -1855,7 +1854,7 @@ public class OrderInfoCustomServiceImpl implements OrderInfoCustomService {
//分类
if (!categoryMap.containsKey(product.getCategoryId())) {
refundMode = shopProdCategoryService.getOneAs(new QueryWrapper().select(ShopProdCategory::getRefundMode)
.eq(ShopProdCategory::getShopId, shopInfo.getId()).eq(ShopProdCategory::getIsRefundStock, SystemConstants.OneZero.ONE)
.eq(ShopProdCategory::getShopId, shopInfo.getId())
.eq(ShopProdCategory::getId, product.getCategoryId()), Integer.class);
if (refundMode == null) {
refundMode = 2;
@@ -1866,11 +1865,7 @@ public class OrderInfoCustomServiceImpl implements OrderInfoCustomService {
}
} else if (shopInfo.getRefundMode().equals(2)) {
//单商品
if (product.getIsRefundStock().equals(SystemConstants.OneZero.ONE)) {
refundMode = product.getRefundMode();
} else {
refundMode = 2;
}
refundMode = 2;
} else {
log.error("退菜模式错误 店铺{},退款模式{},商品Id{}分类Id{}", shopInfo.getShopName(), shopInfo.getRefundMode(), product.getId(), product.getCategoryId());
throw new CzgException("退菜模式错误");

View File

@@ -714,17 +714,6 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> impl
update(update, query().eq(Product::getId, param.getId()).eq(Product::getShopId, shopId));
}
@Override
public void refundToStock(ProdRefundToStockParam param) {
Long shopId = StpKit.USER.getShopId(0L);
Product entity = super.getOne(query().eq(Product::getId, param.getId()).eq(Product::getShopId, shopId));
if (entity == null) {
throw new CzgException("商品不存在");
}
entity.setIsRefundStock(param.getIsReturn());
super.updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)

View File

@@ -148,15 +148,4 @@ public class ShopProdCategoryServiceImpl extends ServiceImpl<ShopProdCategoryMap
update(prodCategory, query().eq(ShopProdCategory::getId, id).eq(ShopProdCategory::getShopId, shopId));
productService.clearProductCache(id);
}
@Override
public void upRefundStock(Long id, Integer isRefundStock) {
Long shopId = StpKit.USER.getShopId();
ShopProdCategory prodCategory = new ShopProdCategory();
prodCategory.setIsRefundStock(isRefundStock);
update(prodCategory, query().eq(ShopProdCategory::getId, id).eq(ShopProdCategory::getShopId, shopId));
productService.clearProductCache(id);
}
}

View File

@@ -11,7 +11,6 @@ import com.czg.account.entity.ShopInfo;
import com.czg.account.enums.BranchDataSyncMethodEnum;
import com.czg.account.service.ShopConfigService;
import com.czg.account.service.ShopInfoService;
import com.czg.account.service.ShopUserService;
import com.czg.account.service.SyncNoticeService;
import com.czg.constant.CacheConstant;
import com.czg.exception.CzgException;
@@ -73,8 +72,6 @@ public class ShopSyncServiceImpl implements ShopSyncService {
@Resource
private ProductRpcService productRpcService;
@Resource
private ShopUserService shopUserService;
@Resource
private ShopVendorService vendorService;
@DubboReference
private ShopCouponService couponService;
@@ -658,7 +655,6 @@ public class ShopSyncServiceImpl implements ShopSyncService {
newEntity.setIsHot(null);
newEntity.setIsSoldStock(null);
newEntity.setIsSale(null);
newEntity.setIsRefundStock(null);
productService.updateById(newEntity);
} else {
newEntity.setId(null);