优惠券还原
This commit is contained in:
@@ -20,4 +20,6 @@ public interface SmsCouponHistoryMapper extends BaseMapper<SmsCouponHistory> {
|
|||||||
List<SmsCouponHistoryDetail> getDetailList(Long memberId);
|
List<SmsCouponHistoryDetail> getDetailList(Long memberId);
|
||||||
|
|
||||||
int updateUseStatus(@Param("useStatus") int i, @Param("endTime") String tomorrow);
|
int updateUseStatus(@Param("useStatus") int i, @Param("endTime") String tomorrow);
|
||||||
|
|
||||||
|
int updateUseStatuss(@Param("useStatus")int i, @Param("memberId") Long memberId,@Param("couponId") Long couponId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,4 +65,8 @@
|
|||||||
<update id="updateUseStatus">
|
<update id="updateUseStatus">
|
||||||
update sms_coupon_history set use_status = #{useStatus} where end_time <= #{endTime} and use_status = 0
|
update sms_coupon_history set use_status = #{useStatus} where end_time <= #{endTime} and use_status = 0
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
<update id="updateUseStatuss">
|
||||||
|
update sms_coupon_history set use_status = #{useStatus} where member_id = #{memberId} and coupon_id = #{couponId}
|
||||||
|
</update>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -1412,6 +1412,12 @@ public class OmsOrderServiceImpl extends ServiceImpl<OmsOrderMapper, OmsOrder> i
|
|||||||
history.setOrderStatus(OrderStatus.CLOSED.getValue());
|
history.setOrderStatus(OrderStatus.CLOSED.getValue());
|
||||||
history.setNote("取消订单");
|
history.setNote("取消订单");
|
||||||
orderOperateHistoryService.save(history);
|
orderOperateHistoryService.save(history);
|
||||||
|
//将优惠券置为未使用
|
||||||
|
Long couponId = order.getCouponId();
|
||||||
|
if(couponId != null){
|
||||||
|
//将优惠券置为未使用
|
||||||
|
couponHistoryService.updateUseStatuss(0,order.getMemberId(),couponId);
|
||||||
|
}
|
||||||
|
|
||||||
return orderMapper.updateById(order) > 0;
|
return orderMapper.updateById(order) > 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.zscat.mallplus.sms.service;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.zscat.mallplus.sms.entity.SmsCouponHistory;
|
import com.zscat.mallplus.sms.entity.SmsCouponHistory;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
@@ -14,4 +15,6 @@ import com.zscat.mallplus.sms.entity.SmsCouponHistory;
|
|||||||
public interface ISmsCouponHistoryService extends IService<SmsCouponHistory> {
|
public interface ISmsCouponHistoryService extends IService<SmsCouponHistory> {
|
||||||
|
|
||||||
int updateUseStatus(int i, String tomorrow);
|
int updateUseStatus(int i, String tomorrow);
|
||||||
|
|
||||||
|
int updateUseStatuss(int i, Long memberId,Long couponId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,4 +21,9 @@ public class SmsCouponHistoryServiceImpl extends ServiceImpl<SmsCouponHistoryMap
|
|||||||
public int updateUseStatus(int i, String tomorrow) {
|
public int updateUseStatus(int i, String tomorrow) {
|
||||||
return baseMapper.updateUseStatus(i,tomorrow);
|
return baseMapper.updateUseStatus(i,tomorrow);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int updateUseStatuss(int i, Long memberId,Long couponId) {
|
||||||
|
return baseMapper.updateUseStatuss(i,memberId,couponId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user