Commit 0f30bc29 by 吕明尚

修改自动删除异常优惠卷

parent 70e036a0
...@@ -130,7 +130,7 @@ public class RedisTask { ...@@ -130,7 +130,7 @@ public class RedisTask {
} }
} }
//逻辑删除所有异常优惠券 //逻辑删除所有异常优惠券
isConsumerCouponService.removeByIds(expiredCoupons); isConsumerCouponService.removeByIdList(expiredCoupons);
} }
} }
......
...@@ -71,4 +71,6 @@ public interface SConsumerCouponMapper extends BaseMapper<SConsumerCoupon> ...@@ -71,4 +71,6 @@ public interface SConsumerCouponMapper extends BaseMapper<SConsumerCoupon>
List<SConsumerCoupon> queryByIds(@Param("couponIds") List<Long> couponIds); List<SConsumerCoupon> queryByIds(@Param("couponIds") List<Long> couponIds);
List<SConsumerCoupon> queryList(); List<SConsumerCoupon> queryList();
int removeByIdList(@Param("couponIds") List<Long> expiredCoupons);
} }
...@@ -84,4 +84,6 @@ public interface ISConsumerCouponService extends IService<SConsumerCoupon> ...@@ -84,4 +84,6 @@ public interface ISConsumerCouponService extends IService<SConsumerCoupon>
int cancelCoupon(Long id); int cancelCoupon(Long id);
int restoreCoupon(Long id); int restoreCoupon(Long id);
int removeByIdList(List<Long> expiredCoupons);
} }
...@@ -446,6 +446,11 @@ public class SConsumerCouponServiceImpl extends ServiceImpl<SConsumerCouponMappe ...@@ -446,6 +446,11 @@ public class SConsumerCouponServiceImpl extends ServiceImpl<SConsumerCouponMappe
return baseMapper.updateSConsumerCoupon(sConsumerCoupon); return baseMapper.updateSConsumerCoupon(sConsumerCoupon);
} }
@Override
public int removeByIdList(List<Long> expiredCoupons) {
return baseMapper.removeByIdList(expiredCoupons);
}
private void extracted(SConsumerCoupon item, BigDecimal bigDecimal, SRoom byId, BigDecimal subtract, SStore sStore) { private void extracted(SConsumerCoupon item, BigDecimal bigDecimal, SRoom byId, BigDecimal subtract, SStore sStore) {
//计算价格 //计算价格
BigDecimal multiply = bigDecimal.multiply(byId.getPrice()); BigDecimal multiply = bigDecimal.multiply(byId.getPrice());
......
...@@ -283,6 +283,14 @@ ...@@ -283,6 +283,14 @@
</trim> </trim>
where id = #{id} where id = #{id}
</update> </update>
<update id="removeByIdList">
update s_consumer_coupon
set is_delete = '1',use_status = '2'
where id in
<foreach item="id" collection="couponIds" open="(" separator="," close=")">
#{id}
</foreach>
</update>
<delete id="deleteSConsumerCouponById" parameterType="Long"> <delete id="deleteSConsumerCouponById" parameterType="Long">
delete from s_consumer_coupon where id = #{id} delete from s_consumer_coupon where id = #{id}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment