|  |  |  | 
|---|
|  |  |  | package com.matrix.system.shopXcx.quartz; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.matrix.core.tools.LogUtil; | 
|---|
|  |  |  | import com.matrix.core.tools.WebUtil; | 
|---|
|  |  |  | import com.matrix.system.hive.plugin.util.CollectionUtils; | 
|---|
|  |  |  | import com.matrix.system.shopXcx.bean.ShopActivitiesGroupJoin; | 
|---|
|  |  |  | import com.matrix.system.shopXcx.bean.ShopActivitiesGroupJoinUser; | 
|---|
|  |  |  | 
|---|
|  |  |  | import com.matrix.system.shopXcx.dao.ShopActivitiesGroupJoinDao; | 
|---|
|  |  |  | import com.matrix.system.shopXcx.dao.ShopActivitiesGroupJoinUserDao; | 
|---|
|  |  |  | import com.matrix.system.shopXcx.dao.ShopOrderDao; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
|---|
|  |  |  | import org.springframework.beans.factory.annotation.Value; | 
|---|
|  |  |  | import org.springframework.context.annotation.Configuration; | 
|---|
|  |  |  | import org.springframework.scheduling.annotation.EnableScheduling; | 
|---|
|  |  |  | import org.springframework.scheduling.annotation.Scheduled; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import java.util.List; | 
|---|
|  |  |  | 
|---|
|  |  |  | * @author wzy | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @Configuration | 
|---|
|  |  |  | @EnableScheduling | 
|---|
|  |  |  | public class ShopActivityPayTimeOutQuartz { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private ShopActivitiesGroupJoinDao shopActivitiesGroupJoinDao; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Value("${scheduling.enabled}") | 
|---|
|  |  |  | private boolean taskSwitch; | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Scheduled(cron = "0 */1 * * * ?") | 
|---|
|  |  |  | public void executeExt() { | 
|---|
|  |  |  | if (taskSwitch) { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | LogUtil.info("#拼团支付超时处理任务#"); | 
|---|
|  |  |  | List<ShopActivitiesGroupJoinUser> joinUserList = shopActivitiesGroupJoinUserDao.selectGroupJoinUserEnd(); | 
|---|
|  |  |  | if (CollectionUtils.isNotEmpty(joinUserList)) { | 
|---|
|  |  |  | 
|---|
|  |  |  | shopOrder.setOrderStatus(ShopOrder.ORDER_STATUS_CANCEL); | 
|---|
|  |  |  | shopOrderDao.updateByModel(shopOrder); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|