소스 검색

[卡券][修改]:自动作废已经没有商户的卡券

release_toaliyun_real
hupeng 7 년 전
부모
커밋
fcbc16f4f9
3개의 변경된 파일9개의 추가작업 그리고 1개의 파일을 삭제
  1. +3
    -1
      mallinkAdmin/src/main/java/com/iformall/schedule/CouponExpiringSchedule.java
  2. +1
    -0
      mallinkService/src/main/java/com/iformall/mapper/WxCouponMapper.java
  3. +5
    -0
      mallinkService/src/main/resources/mapper/WxCouponMapper.xml

+ 3
- 1
mallinkAdmin/src/main/java/com/iformall/schedule/CouponExpiringSchedule.java 파일 보기

@@ -25,10 +25,12 @@ public class CouponExpiringSchedule {
@Scheduled(cron = "0 5 0 * * ?") // 每天凌晨00:05 @Scheduled(cron = "0 5 0 * * ?") // 每天凌晨00:05
//@Scheduled(cron = "*/10 * * * * ?") // 测试10秒中一次 //@Scheduled(cron = "*/10 * * * * ?") // 测试10秒中一次
public void couponExpiringSchedule() { public void couponExpiringSchedule() {

wxCouponMapper.offExpiriedCouponByValidDate(); wxCouponMapper.offExpiriedCouponByValidDate();
wxCouponMapper.offExpiriedCouponByMerchantStatus();
} }


@Scheduled(cron = "0 5 0 * * ?") // 每天凌晨00:05
@Scheduled(cron = "0 3 0 * * ?") // 每天凌晨00:03
//@Scheduled(cron = "*/10 * * * * ?") // 测试10秒中一次 //@Scheduled(cron = "*/10 * * * * ?") // 测试10秒中一次
public void couponChannelExpiringSchedule() { public void couponChannelExpiringSchedule() {




+ 1
- 0
mallinkService/src/main/java/com/iformall/mapper/WxCouponMapper.java 파일 보기

@@ -16,4 +16,5 @@ public interface WxCouponMapper extends CommonMapper<WxCoupon, Long> {
void reduceInventory(@Param("id")Long id,@Param("number")Integer number); void reduceInventory(@Param("id")Long id,@Param("number")Integer number);


void offExpiriedCouponByValidDate(); void offExpiriedCouponByValidDate();
void offExpiriedCouponByMerchantStatus();
} }

+ 5
- 0
mallinkService/src/main/resources/mapper/WxCouponMapper.xml 파일 보기

@@ -252,4 +252,9 @@
where status = 0 and valid_type = 1 and valid_end_date &lt; now() where status = 0 and valid_type = 1 and valid_end_date &lt; now()
</update> </update>


<update id="offExpiriedCouponByMerchantStatus">
update wx_coupon c, wx_merchant m SET c.status = 1, c.update_date = now()
where c.status = 0 and m.status = 0 and m.id = c.merchant_id
</update>

</mapper> </mapper>

불러오는 중...
취소
저장