package com.kxs.product.biz.task;

import cn.hutool.crypto.symmetric.AES;
import com.alibaba.fastjson.JSON;
import com.alibaba.nacos.api.config.annotation.NacosValue;
import com.kxs.common.core.util.R;
import com.kxs.common.security.annotation.Inner;
import com.kxs.product.api.model.KxsMachine;
import com.kxs.product.api.model.KxsMachineDeduct;
import com.kxs.product.biz.config.KxsOldConfigProperties;
import com.kxs.product.biz.mapper.KxsMachineDeductMapper;
import com.kxs.product.biz.mapper.KxsMachineMapper;
import com.kxs.product.biz.service.KxsMachineService;
import com.kxs.system.api.feign.RemoteOldService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.List;

/**
 * 产品模块定时任务
 *
 * @author 没秃顶的码农
 * @date 2024-03-13
 */
@RequiredArgsConstructor
@Slf4j
@RestController
@RequestMapping("product-job")
public class KxsProductTask {

    private final KxsMachineService kxsMachineService;

    /**
     * 循环过期机具添加预扣款
     * 一个小时执行一次
     * 异步执行
     */
    @Inner
    @GetMapping("/recycleMachineSchedule")
    public void recycleMachineSchedule(@RequestParam("param") String para)  {

        kxsMachineService.recycleMachineSchedule(para);

    }
}
