diff --git a/src/main/java/com/ydool/staff/controller/RecruitmentController.java b/src/main/java/com/ydool/staff/controller/RecruitmentController.java index 7bff0b1..d4f8d2e 100644 --- a/src/main/java/com/ydool/staff/controller/RecruitmentController.java +++ b/src/main/java/com/ydool/staff/controller/RecruitmentController.java @@ -68,7 +68,7 @@ public class RecruitmentController extends BaseController { @GetMapping @ApiOperation("招聘导出") - public void export(String id, HttpServletRequest request, HttpServletResponse response) { - recruitmentService.export(id, request, response); + public void export(String id, HttpServletResponse response) { + recruitmentService.export(id, response); } } diff --git a/src/main/java/com/ydool/staff/service/IRecruitmentService.java b/src/main/java/com/ydool/staff/service/IRecruitmentService.java index c299fe3..f3d2c8f 100644 --- a/src/main/java/com/ydool/staff/service/IRecruitmentService.java +++ b/src/main/java/com/ydool/staff/service/IRecruitmentService.java @@ -30,6 +30,6 @@ public interface IRecruitmentService { */ AjaxResult selectRecruitmentById(String id); - void export(String id, HttpServletRequest request, HttpServletResponse response); + void export(String id, HttpServletResponse response); } diff --git a/src/main/java/com/ydool/staff/service/impl/RecruitmentServiceImpl.java b/src/main/java/com/ydool/staff/service/impl/RecruitmentServiceImpl.java index 0391ce3..b1cdc3b 100644 --- a/src/main/java/com/ydool/staff/service/impl/RecruitmentServiceImpl.java +++ b/src/main/java/com/ydool/staff/service/impl/RecruitmentServiceImpl.java @@ -16,6 +16,7 @@ import com.ydool.common.cache.ConfigCache; import com.ydool.common.constant.ArgsConst; import com.ydool.common.data.dto.AjaxResult; import com.ydool.common.exception.ResultException; +import com.ydool.common.utils.UploadUtils; import com.ydool.staff.dto.RecruitmentDto; import com.ydool.staff.entity.*; import com.ydool.common.base.BaseService; @@ -35,11 +36,10 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.Assert; +import org.springframework.util.ResourceUtils; -import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.*; -import java.net.URLDecoder; import java.net.URLEncoder; import java.util.*; import java.util.concurrent.atomic.AtomicInteger; @@ -56,8 +56,6 @@ import java.util.concurrent.atomic.AtomicInteger; public class RecruitmentServiceImpl extends BaseService implements IRecruitmentService { private static final AtomicInteger counter = new AtomicInteger(0); - - private final String filepath = System.getProperty("user.dir"); @Autowired RecruitmentMapper recruitmentMapper; @Autowired @@ -139,23 +137,28 @@ public class RecruitmentServiceImpl extends BaseService params) { org.springframework.util.Assert.notNull(templatePath, "模板路径不能为空"); org.springframework.util.Assert.notNull(saveDir, "临时文件路径不能为空"); @@ -223,7 +239,6 @@ public class RecruitmentServiceImpl extends BaseService