上传岗位添加新接口以及处理上传数据等。
This commit is contained in:
@@ -2,14 +2,21 @@ package com.ruoyi.cms.controller.app;
|
||||
|
||||
import com.ruoyi.cms.service.ICompanyService;
|
||||
import com.ruoyi.cms.service.IJobService;
|
||||
import com.ruoyi.common.config.RuoYiConfig;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.utils.ServletUtils;
|
||||
import com.ruoyi.common.utils.file.FileUploadUtils;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
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 org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* 岗位Controller
|
||||
@@ -46,6 +53,24 @@ public class AppScriptController extends BaseController
|
||||
jobService.importRow(path);
|
||||
return success();
|
||||
}
|
||||
//导入原始数据
|
||||
@GetMapping("/importRow/v2")
|
||||
public AjaxResult importRowV2(@RequestParam("file") MultipartFile file)
|
||||
{
|
||||
// 上传文件路径
|
||||
String filePath = RuoYiConfig.getUploadPath();
|
||||
// 上传并返回新文件名称
|
||||
String fileName = null;
|
||||
try {
|
||||
fileName = FileUploadUtils.upload(filePath, file);
|
||||
} catch (IOException e) {
|
||||
error("读取文件出错");
|
||||
}
|
||||
String path = filePath + fileName.replace("profile/upload/", "");
|
||||
jobService.importRow(path);
|
||||
return success();
|
||||
}
|
||||
|
||||
// 导入500强
|
||||
@GetMapping("/importLabel500")
|
||||
public void importLabel()
|
||||
|
||||
Reference in New Issue
Block a user