From 0bbdb48b2182400830885bf0086f21eb4e60158d Mon Sep 17 00:00:00 2001 From: xhxu Date: Tue, 12 Sep 2023 15:49:52 +0800 Subject: [PATCH] //.. --- .../schedule/ProductOrderSharingSchedule.java | 156 +++++++++--------- 1 file changed, 78 insertions(+), 78 deletions(-) diff --git a/suimangSchedule/src/main/java/com/iformall/schedule/ProductOrderSharingSchedule.java b/suimangSchedule/src/main/java/com/iformall/schedule/ProductOrderSharingSchedule.java index c2af785..e0ea8d2 100644 --- a/suimangSchedule/src/main/java/com/iformall/schedule/ProductOrderSharingSchedule.java +++ b/suimangSchedule/src/main/java/com/iformall/schedule/ProductOrderSharingSchedule.java @@ -1,78 +1,78 @@ -package com.iformall.schedule; - -import com.iformall.domain.po.ProductOrder; -import com.iformall.domain.po.ProductOrderSharing; -import com.iformall.enums.*; -import com.iformall.service.ProductOrderService; -import com.iformall.service.ProductOrderSharingService; -import com.iformall.utils.DateUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.scheduling.annotation.Scheduled; -import org.springframework.stereotype.Component; - -import java.util.*; - -@Component -public class ProductOrderSharingSchedule { - - private final Logger logger = LoggerFactory.getLogger(this.getClass()); - - @Autowired - private ProductOrderService productOrderService; - - @Autowired - private ProductOrderSharingService productOrderSharingService; - - @Scheduled(cron = "0 15 1 * * ?") // 每天凌晨02:00分账重试 - public void productOrderSharingSchedule() { - ProductOrder productOrderQ = new ProductOrder(); - productOrderQ.setOrderStatus(EnumProductOrderStatus.ORDER_STATUS_PAYMENT_SUCCESS.getCode()); - productOrderQ.setProfitSharing(EnumProfitSharing.PROFIT_SHARING_MAST.getCode()); - productOrderQ.setPayEndDate(DateUtils.getDateBefore(7,new Date())); - List orderList = productOrderService.findList(productOrderQ); - for (ProductOrder order: orderList) { - try{ - productOrderService.handldSharing(order); - - productOrderSharingService.sharingOrder(order.getId()); - - }catch(Exception e){ - logger.error("分账失败:" + e.getMessage()); - } - - } - } - - @Scheduled(cron = "0 15 2 * * ?") // 每天凌晨02:00分账重试 - public void productOrderSharing2Schedule() { - ProductOrderSharing productOrderSharingQ = new ProductOrderSharing(); - productOrderSharingQ.setSettleStatus(EnumProductOrderSettleStatus.unfreeze_before.getCode()); - List sharingList = productOrderSharingService.findList(productOrderSharingQ); - for (ProductOrderSharing sharing: sharingList) { - try{ - productOrderSharingService.sharingOrder(sharing.getId()); - }catch(Exception e){ - logger.error("分账失败:" + e.getMessage()); - } - - } - } - - @Scheduled(cron = "0 15 3 * * ?") // 查询分账结果 - public void productOrderSharingQuerySchedule() { - ProductOrderSharing productOrderSharingQ = new ProductOrderSharing(); - productOrderSharingQ.setSettleStatus(EnumProductOrderSettleStatus.unfreeze_ing.getCode()); - List sharingList = productOrderSharingService.findList(productOrderSharingQ); - for (ProductOrderSharing sharing: sharingList) { - try{ - productOrderSharingService.handleSharingOrder(sharing.getId()); - }catch(Exception e){ - logger.error("分账失败:" + e.getMessage()); - } - - } - } - -} \ No newline at end of file +//package com.iformall.schedule; +// +//import com.iformall.domain.po.ProductOrder; +//import com.iformall.domain.po.ProductOrderSharing; +//import com.iformall.enums.*; +//import com.iformall.service.ProductOrderService; +//import com.iformall.service.ProductOrderSharingService; +//import com.iformall.utils.DateUtils; +//import org.slf4j.Logger; +//import org.slf4j.LoggerFactory; +//import org.springframework.beans.factory.annotation.Autowired; +//import org.springframework.scheduling.annotation.Scheduled; +//import org.springframework.stereotype.Component; +// +//import java.util.*; +// +//@Component +//public class ProductOrderSharingSchedule { +// +// private final Logger logger = LoggerFactory.getLogger(this.getClass()); +// +// @Autowired +// private ProductOrderService productOrderService; +// +// @Autowired +// private ProductOrderSharingService productOrderSharingService; +// +// @Scheduled(cron = "0 15 1 * * ?") // 每天凌晨02:00分账重试 +// public void productOrderSharingSchedule() { +// ProductOrder productOrderQ = new ProductOrder(); +// productOrderQ.setOrderStatus(EnumProductOrderStatus.ORDER_STATUS_PAYMENT_SUCCESS.getCode()); +// productOrderQ.setProfitSharing(EnumProfitSharing.PROFIT_SHARING_MAST.getCode()); +// productOrderQ.setPayEndDate(DateUtils.getDateBefore(7,new Date())); +// List orderList = productOrderService.findList(productOrderQ); +// for (ProductOrder order: orderList) { +// try{ +// productOrderService.handldSharing(order); +// +// productOrderSharingService.sharingOrder(order.getId()); +// +// }catch(Exception e){ +// logger.error("分账失败:" + e.getMessage()); +// } +// +// } +// } +// +// @Scheduled(cron = "0 15 2 * * ?") // 每天凌晨02:00分账重试 +// public void productOrderSharing2Schedule() { +// ProductOrderSharing productOrderSharingQ = new ProductOrderSharing(); +// productOrderSharingQ.setSettleStatus(EnumProductOrderSettleStatus.unfreeze_before.getCode()); +// List sharingList = productOrderSharingService.findList(productOrderSharingQ); +// for (ProductOrderSharing sharing: sharingList) { +// try{ +// productOrderSharingService.sharingOrder(sharing.getId()); +// }catch(Exception e){ +// logger.error("分账失败:" + e.getMessage()); +// } +// +// } +// } +// +// @Scheduled(cron = "0 15 3 * * ?") // 查询分账结果 +// public void productOrderSharingQuerySchedule() { +// ProductOrderSharing productOrderSharingQ = new ProductOrderSharing(); +// productOrderSharingQ.setSettleStatus(EnumProductOrderSettleStatus.unfreeze_ing.getCode()); +// List sharingList = productOrderSharingService.findList(productOrderSharingQ); +// for (ProductOrderSharing sharing: sharingList) { +// try{ +// productOrderSharingService.handleSharingOrder(sharing.getId()); +// }catch(Exception e){ +// logger.error("分账失败:" + e.getMessage()); +// } +// +// } +// } +// +//} \ No newline at end of file