子店铺去除 可用
This commit is contained in:
parent
2e99dd5745
commit
a069d14657
|
|
@ -1333,7 +1333,7 @@ public class ShopSyncServiceImpl implements ShopSyncService {
|
||||||
case 2://先删除再新增
|
case 2://先删除再新增
|
||||||
List<ShopCoupon> couponList = couponService.list(new QueryWrapper().eq(ShopCoupon::getSyncId, couponId));
|
List<ShopCoupon> couponList = couponService.list(new QueryWrapper().eq(ShopCoupon::getSyncId, couponId));
|
||||||
Map<Long, Long> map = couponList.stream().collect(Collectors.toMap(ShopCoupon::getShopId, ShopCoupon::getId));
|
Map<Long, Long> map = couponList.stream().collect(Collectors.toMap(ShopCoupon::getShopId, ShopCoupon::getId));
|
||||||
deleteCouponsBySyncId(couponId);
|
deleteCouponsBySyncId(couponId);//假性删除
|
||||||
saveCouponsForShops(map, ids, couponSource, couponId);
|
saveCouponsForShops(map, ids, couponSource, couponId);
|
||||||
break;
|
break;
|
||||||
case 3:// 删除
|
case 3:// 删除
|
||||||
|
|
@ -1365,7 +1365,7 @@ public class ShopSyncServiceImpl implements ShopSyncService {
|
||||||
if (CollUtil.isNotEmpty(map) && map.containsKey(id)) {
|
if (CollUtil.isNotEmpty(map) && map.containsKey(id)) {
|
||||||
coupon.setId(map.get(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) {
|
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));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue