|
@@ -2,33 +2,26 @@ package com.gree.mall.manager.schedule;
|
|
|
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
import cn.hutool.core.date.DateUtil;
|
|
import com.alibaba.excel.util.StringUtils;
|
|
import com.alibaba.excel.util.StringUtils;
|
|
-import com.gree.mall.manager.bean.workorder.OrderAddBean2DTO;
|
|
|
|
import com.gree.mall.manager.constant.Constant;
|
|
import com.gree.mall.manager.constant.Constant;
|
|
import com.gree.mall.manager.enums.OrderInfoSourceEnum;
|
|
import com.gree.mall.manager.enums.OrderInfoSourceEnum;
|
|
import com.gree.mall.manager.enums.OrderStatusEnum;
|
|
import com.gree.mall.manager.enums.OrderStatusEnum;
|
|
import com.gree.mall.manager.enums.PayStatusEnum;
|
|
import com.gree.mall.manager.enums.PayStatusEnum;
|
|
-import com.gree.mall.manager.enums.material.OrderSourceEnum;
|
|
|
|
-import com.gree.mall.manager.helper.ResponseHelper;
|
|
|
|
import com.gree.mall.manager.logic.common.WechatLogic;
|
|
import com.gree.mall.manager.logic.common.WechatLogic;
|
|
import com.gree.mall.manager.logic.order.OrderLogic;
|
|
import com.gree.mall.manager.logic.order.OrderLogic;
|
|
-import com.gree.mall.manager.logic.workorder.OrderBaseLogic;
|
|
|
|
import com.gree.mall.manager.plus.entity.*;
|
|
import com.gree.mall.manager.plus.entity.*;
|
|
import com.gree.mall.manager.plus.service.*;
|
|
import com.gree.mall.manager.plus.service.*;
|
|
-import com.gree.mall.manager.utils.RedisUtil;
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
|
import org.springframework.integration.redis.util.RedisLockRegistry;
|
|
import org.springframework.integration.redis.util.RedisLockRegistry;
|
|
import org.springframework.scheduling.annotation.Scheduled;
|
|
import org.springframework.scheduling.annotation.Scheduled;
|
|
import org.springframework.stereotype.Component;
|
|
import org.springframework.stereotype.Component;
|
|
-import org.springframework.transaction.annotation.Transactional;
|
|
|
|
import org.springframework.util.CollectionUtils;
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
import java.util.Date;
|
|
import java.util.Date;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.concurrent.TimeUnit;
|
|
import java.util.concurrent.TimeUnit;
|
|
import java.util.concurrent.locks.Lock;
|
|
import java.util.concurrent.locks.Lock;
|
|
-import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
* 发货相关任务
|
|
* 发货相关任务
|
|
@@ -94,26 +87,26 @@ public class AutoDeliverSchedule {
|
|
* 定时同步辅材销售单 到微信发货
|
|
* 定时同步辅材销售单 到微信发货
|
|
* @throws Exception
|
|
* @throws Exception
|
|
*/
|
|
*/
|
|
- @Scheduled(fixedDelay = 10 * 1000)
|
|
|
|
- public void task() throws Exception {
|
|
|
|
- List<WebsitSalesPayOrder> list = websitSalesPayOrderService.lambdaQuery()
|
|
|
|
- .eq(WebsitSalesPayOrder::getIsDeliver, false)
|
|
|
|
- .in(WebsitSalesPayOrder::getOrderSource, OrderSourceEnum.M_SALES.getKey(),OrderSourceEnum.P_SALES.getKey())
|
|
|
|
- .le(WebsitSalesPayOrder::getPayTime, DateUtil.offsetMinute(new Date(), -5))
|
|
|
|
- .list();
|
|
|
|
- if(CollectionUtils.isEmpty(list)){
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
- log.info("【定时辅材销售单到微信发货】数量:{}",list.size());
|
|
|
|
- for(WebsitSalesPayOrder bean : list){
|
|
|
|
- //小程序需要对接发货
|
|
|
|
- if(StringUtils.equals(bean.getSource(), OrderInfoSourceEnum.A.getRemark())) {
|
|
|
|
- wechatLogic.deliver(bean.getCompanyWechatId(), bean.getTransactionId(), null, bean.getOpenid());
|
|
|
|
- }
|
|
|
|
- bean.setIsDeliver(true);
|
|
|
|
- bean.updateById();
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+// @Scheduled(fixedDelay = 10 * 1000)
|
|
|
|
+// public void task() throws Exception {
|
|
|
|
+// List<WebsitSalesPayOrder> list = websitSalesPayOrderService.lambdaQuery()
|
|
|
|
+// .eq(WebsitSalesPayOrder::getIsDeliver, false)
|
|
|
|
+// .in(WebsitSalesPayOrder::getOrderSource, OrderSourceEnum.M_SALES.getKey(),OrderSourceEnum.P_SALES.getKey())
|
|
|
|
+// .le(WebsitSalesPayOrder::getPayTime, DateUtil.offsetMinute(new Date(), -5))
|
|
|
|
+// .list();
|
|
|
|
+// if(CollectionUtils.isEmpty(list)){
|
|
|
|
+// return;
|
|
|
|
+// }
|
|
|
|
+// log.info("【定时辅材销售单到微信发货】数量:{}",list.size());
|
|
|
|
+// for(WebsitSalesPayOrder bean : list){
|
|
|
|
+// //小程序需要对接发货
|
|
|
|
+// if(StringUtils.equals(bean.getSource(), OrderInfoSourceEnum.A.getRemark())) {
|
|
|
|
+// wechatLogic.deliver(bean.getCompanyWechatId(), bean.getTransactionId(), null, bean.getOpenid());
|
|
|
|
+// }
|
|
|
|
+// bean.setIsDeliver(true);
|
|
|
|
+// bean.updateById();
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|