|
@@ -60,7 +60,7 @@ public class CheckQuartz {
|
|
|
/**
|
|
|
* 订单状态定时轮训
|
|
|
*/
|
|
|
- @Scheduled(cron = "0 * * * * ?")
|
|
|
+// @Scheduled(cron = "0 * * * * ?")
|
|
|
public void checkOrderStatus() {
|
|
|
if (lockComponent.tryLock(ORDER_STATUS_LOCK, 15)) {
|
|
|
try {
|
|
@@ -72,7 +72,7 @@ public class CheckQuartz {
|
|
|
OrderDO updateOrderDO = new OrderDO();
|
|
|
updateOrderDO.setStatus(OrderStatusType.CANCELED_SYS.getCode());
|
|
|
updateOrderDO.setGmtUpdate(now);
|
|
|
-// orderBizService.changeOrderStatus(no, OrderStatusType.UNPAY.getCode(), updateOrderDO);
|
|
|
+ orderBizService.changeOrderStatus(no, OrderStatusType.UNPAY.getCode(), updateOrderDO);
|
|
|
} catch (Exception e) {
|
|
|
logger.error("[未付款检测] 异常", e);
|
|
|
}
|
|
@@ -87,7 +87,7 @@ public class CheckQuartz {
|
|
|
OrderDO updateOrderDO = new OrderDO();
|
|
|
updateOrderDO.setStatus(OrderStatusType.WAIT_APPRAISE.getCode());
|
|
|
updateOrderDO.setGmtUpdate(now);
|
|
|
-// orderBizService.changeOrderStatus(item, OrderStatusType.WAIT_CONFIRM.getCode(), updateOrderDO);
|
|
|
+ orderBizService.changeOrderStatus(item, OrderStatusType.WAIT_CONFIRM.getCode(), updateOrderDO);
|
|
|
} catch (Exception e) {
|
|
|
logger.error("[未确认检测] 异常", e);
|
|
|
}
|
|
@@ -104,7 +104,7 @@ public class CheckQuartz {
|
|
|
/**
|
|
|
* 设定60s跑一次,团购商品到期自动退款,改变状态
|
|
|
*/
|
|
|
- @Scheduled(fixedRate = 60000)
|
|
|
+// @Scheduled(fixedRate = 60000)
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public void groupShopStart() throws Exception {
|
|
|
if (lockComponent.tryLock(GROUP_SHOP_START_LOCK, 30)) {
|
|
@@ -129,9 +129,9 @@ public class CheckQuartz {
|
|
|
|
|
|
// 1.2 检查商品是不是已经下架
|
|
|
if (spuDO.getStatus().equals(StatusType.ACTIVE.getCode())) {
|
|
|
-// if (groupShopMapper.updateById(groupShopDO) <= 0) {
|
|
|
-// throw new AdminServiceException(ExceptionDefinition.GROUP_SHOP_SPU_UPDATE_SQL_QUERY_ERROR);
|
|
|
-// }
|
|
|
+ if (groupShopMapper.updateById(groupShopDO) <= 0) {
|
|
|
+ throw new AdminServiceException(ExceptionDefinition.GROUP_SHOP_SPU_UPDATE_SQL_QUERY_ERROR);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -146,7 +146,7 @@ public class CheckQuartz {
|
|
|
|
|
|
}
|
|
|
|
|
|
- @Scheduled(fixedRate = 60000)
|
|
|
+// @Scheduled(fixedRate = 60000)
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public void groupShopEnd() throws Exception {
|
|
|
if (lockComponent.tryLock(GROUP_SHOP_END_LOCK, 30)) {
|
|
@@ -189,7 +189,7 @@ public class CheckQuartz {
|
|
|
protected void doInTransactionWithoutResult(TransactionStatus transactionStatus) {
|
|
|
try {
|
|
|
//对订单退款保证原子性,仅退款成功的单子,变更状态
|
|
|
-// orderBizService.groupShopStatusRefund(orderDO.getOrderNo());
|
|
|
+ orderBizService.groupShopStatusRefund(orderDO.getOrderNo());
|
|
|
logger.info("[团购订单退款] 完成 orderNo:" + orderDO.getOrderNo());
|
|
|
} catch (Exception e) {
|
|
|
logger.error("[团购订单退款] 异常 orderNo:" + orderDO.getOrderNo() + "; errmsg:" + e.getMessage());
|
|
@@ -204,10 +204,10 @@ public class CheckQuartz {
|
|
|
List<Long> collect = lockOrderList.stream().map(s -> s.getId()).collect(Collectors.toList());
|
|
|
OrderDO orderDO = new OrderDO();
|
|
|
orderDO.setStatus(OrderStatusType.WAIT_STOCK.getCode());
|
|
|
-// orderMapper.update(orderDO, (
|
|
|
-// new EntityWrapper<OrderDO>()
|
|
|
-// .in("id", collect)
|
|
|
-// .eq("status", OrderStatusType.GROUP_SHOP_WAIT.getCode())));
|
|
|
+ orderMapper.update(orderDO, (
|
|
|
+ new EntityWrapper<OrderDO>()
|
|
|
+ .in("id", collect)
|
|
|
+ .eq("status", OrderStatusType.GROUP_SHOP_WAIT.getCode())));
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -222,7 +222,7 @@ public class CheckQuartz {
|
|
|
|
|
|
}
|
|
|
|
|
|
- @Scheduled(fixedRate = 60000)
|
|
|
+// @Scheduled(fixedRate = 60000)
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public void groupShopLock() throws Exception {
|
|
|
if (lockComponent.tryLock(GROUP_SHOP_LOCK_LOCK, 30)) {
|
|
@@ -250,7 +250,7 @@ public class CheckQuartz {
|
|
|
GroupShopDO groupShopDO = new GroupShopDO();
|
|
|
groupShopDO.setStatus(StatusType.LOCK.getCode());
|
|
|
groupShopDO.setGmtUpdate(now);
|
|
|
-// groupShopMapper.update(groupShopDO, (new EntityWrapper<GroupShopDO>().in("spu_id", collect)));
|
|
|
+ groupShopMapper.update(groupShopDO, (new EntityWrapper<GroupShopDO>().in("spu_id", collect)));
|
|
|
}
|
|
|
}
|
|
|
} catch (Exception e) {
|