package com.ruoyi.quartz.task;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.powerdistribution.service.IPdmLineService;
import com.ruoyi.powerdistribution.service.IPdmScoreRankManagerService;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;

/**
 * 配网定时任务调度
 *
 * @author ruoyi
 */
@Component("pdmTask")
public class PdmTask {
    @Resource
    private IPdmLineService lineService;

    /**
     * 计算无故障持续时间奖励金额
     * @param calcuDate
     */
    public void calculateBouns(String calcuDate) {
        System.out.println("=======计算无故障持续时间奖励金额开始=========");
        Map<String,Object> map=new HashMap<>();
        if(StringUtils.isEmpty(calcuDate)){
            calcuDate= DateUtils.getDate();
        }
        map.put("calcuDate",calcuDate);
        lineService.calculateBounsProc(map);
        System.out.println("=======计算无故障持续时间奖励金额结束=========");
    }
}
