|
|
|
@ -1,9 +1,9 @@ |
|
|
|
|
package com.hai.schedule; |
|
|
|
|
|
|
|
|
|
import com.hai.entity.HighDiscountAgentCode; |
|
|
|
|
import com.hai.entity.HighDiscountUserRel; |
|
|
|
|
import com.hai.entity.HighOrder; |
|
|
|
|
import com.hai.entity.*; |
|
|
|
|
import com.hai.service.BsTemporaryServices; |
|
|
|
|
import com.hai.service.HighDiscountAgentCodeService; |
|
|
|
|
import com.hai.service.HighDiscountPackageAgentService; |
|
|
|
|
import com.hai.service.HighDiscountUserRelService; |
|
|
|
|
import org.slf4j.Logger; |
|
|
|
|
import org.slf4j.LoggerFactory; |
|
|
|
@ -11,6 +11,8 @@ import org.springframework.context.annotation.Configuration; |
|
|
|
|
import org.springframework.scheduling.annotation.Scheduled; |
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource; |
|
|
|
|
import java.util.Date; |
|
|
|
|
import java.util.HashMap; |
|
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -29,6 +31,12 @@ public class HighDiscountSchedule { |
|
|
|
|
@Resource |
|
|
|
|
private HighDiscountAgentCodeService highDiscountAgentCodeService; |
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
private BsTemporaryServices bsTemporaryServices; |
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
private HighDiscountPackageAgentService discountPackageAgentService; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @Author 胡锐 |
|
|
|
|
* @Description 处理过期的优惠券 |
|
|
|
@ -55,4 +63,23 @@ public class HighDiscountSchedule { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Scheduled(cron = "0 5 0 * * ?") // 每日凌晨00:00:5执行一次
|
|
|
|
|
public void deleteOilNo() { |
|
|
|
|
List<BsTemporary> list = bsTemporaryServices.getList(new HashMap<>()); |
|
|
|
|
|
|
|
|
|
for (BsTemporary bsTemporary : list) { |
|
|
|
|
|
|
|
|
|
HighDiscountPackageAgentCode discountPackageAgentCode = discountPackageAgentService.findDiscountPackageAgentCode(bsTemporary.getCode()); |
|
|
|
|
discountPackageAgentCode.setStatus(1); |
|
|
|
|
discountPackageAgentCode.setUpdateTime(new Date()); |
|
|
|
|
discountPackageAgentService.updateDiscountPackageAgentCode(discountPackageAgentCode); |
|
|
|
|
bsTemporary.setStatus(0); |
|
|
|
|
bsTemporary.setUpdateTime(new Date()); |
|
|
|
|
bsTemporaryServices.update(bsTemporary); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|