package org.dromara.job.snailjob;


import com.aizuda.snailjob.client.job.core.annotation.JobExecutor;
import com.aizuda.snailjob.client.job.core.dto.JobArgs;
import com.aizuda.snailjob.client.model.ExecuteResult;
import org.dromara.common.core.utils.PddUtil;
import org.dromara.job.domains.ShopOrderVO;
import org.dromara.job.service.IPddService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
@JobExecutor(name = "getOrderNowJobExecutor")
public class GetOrderNowJobExecutor {

    @Autowired
    public IPddService pddService;

    //todo  拿不到未支付订单
    //增量订单 （30分钟之内）
    public ExecuteResult jobExecute(JobArgs jobArgs) throws Exception {

        //todo 多店铺需要同步
        ShopOrderVO shopOrderVO = new ShopOrderVO();
        shopOrderVO.setMallId(146727039);
        shopOrderVO.setShopName("古威教辅专营店");
        shopOrderVO.setAccessToken(PddUtil.getToken());

        pddService.getNowOrderList(shopOrderVO);

        return ExecuteResult.success("-----增量订单同步成功-----");
    }






}
