package com.rongwei.bsserver.sys.controller;


import com.rongwei.bscommon.sys.service.EquLubricationPlanService;
import com.rongwei.rwcommon.base.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.web.bind.annotation.*;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;
import java.util.Map;

/**
 * <p>
 * 设备子系统——润滑计划标准 前端控制器
 * </p>
 *
 * @author fpy
 * @since 2024-01-12
 */
@RestController
@RequestMapping("/equLubricationPlan")
public class EquLubricationPlanController {

    @Autowired
    private EquLubricationPlanService equLubricationPlanService;

    /**
     * 导出润滑计划标准
     * */
    @PostMapping("/wordExportLubrication")
    @ResponseBody
    public void wordExportLubrication(@RequestBody Map<String, Object> parameter, HttpServletResponse response){
        equLubricationPlanService.wordExportLubrication(parameter,response);
    }


    @Scheduled(cron = "0 0 7 * * ? ")
    @PostMapping("/task")
    public R timedTask() {
        return equLubricationPlanService.timedTask();
    }

}

