package com.rongwei.savecheck.controller;

import com.rongwei.rwcommon.base.R;
import com.rongwei.sfcommon.sys.service.AspSafetyPerformanceAppraisalService;
import com.rongwei.sfcommon.sys.service.CheckItemsService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("aspSafetyPerformance")
@Slf4j
public class AspSafetyPerformanceAppraisalController {

    @Autowired
    private AspSafetyPerformanceAppraisalService aspSafetyPerformanceAppraisalService;

    /**
     * 导入安全绩效考核
     *
     * @return
     */
    @RequestMapping("/importFile")
    @ResponseBody
    public R importFile(@RequestParam MultipartFile file, HttpServletRequest request, @RequestParam String type) throws Exception {
        if (file == null) {
            return R.error("文件解析失败");
        }
        return aspSafetyPerformanceAppraisalService.importFile(file, type);
    }

}
