diff --git a/cash-service/product-service/src/main/java/com/czg/service/product/service/impl/ShopSyncServiceImpl.java b/cash-service/product-service/src/main/java/com/czg/service/product/service/impl/ShopSyncServiceImpl.java index ff793837..12fe6a6f 100644 --- a/cash-service/product-service/src/main/java/com/czg/service/product/service/impl/ShopSyncServiceImpl.java +++ b/cash-service/product-service/src/main/java/com/czg/service/product/service/impl/ShopSyncServiceImpl.java @@ -1333,7 +1333,7 @@ public class ShopSyncServiceImpl implements ShopSyncService { case 2://先删除再新增 List couponList = couponService.list(new QueryWrapper().eq(ShopCoupon::getSyncId, couponId)); Map map = couponList.stream().collect(Collectors.toMap(ShopCoupon::getShopId, ShopCoupon::getId)); - deleteCouponsBySyncId(couponId); + deleteCouponsBySyncId(couponId);//假性删除 saveCouponsForShops(map, ids, couponSource, couponId); break; case 3:// 删除 @@ -1365,7 +1365,7 @@ public class ShopSyncServiceImpl implements ShopSyncService { if (CollUtil.isNotEmpty(map) && map.containsKey(id)) { coupon.setId(map.get(id)); } - couponService.save(coupon); + couponService.saveOrUpdate(coupon); } } @@ -1375,6 +1375,8 @@ public class ShopSyncServiceImpl implements ShopSyncService { } private void deleteCouponsBySyncId(Long couponId) { - couponService.remove(new QueryWrapper().eq(ShopCoupon::getSyncId, couponId)); + couponService.update(new ShopCoupon().setIsDel(1), new QueryWrapper() + .eq(ShopCoupon::getSyncId, couponId)); +// couponService.remove(new QueryWrapper().eq(ShopCoupon::getSyncId, couponId)); } }