|
|
@ -13,6 +13,7 @@ import javax.servlet.http.HttpServletResponse;
|
|
|
|
import javax.ws.rs.GET;
|
|
|
|
import javax.ws.rs.GET;
|
|
|
|
import javax.ws.rs.Path;
|
|
|
|
import javax.ws.rs.Path;
|
|
|
|
import javax.ws.rs.Produces;
|
|
|
|
import javax.ws.rs.Produces;
|
|
|
|
|
|
|
|
import javax.ws.rs.QueryParam;
|
|
|
|
import javax.ws.rs.core.Context;
|
|
|
|
import javax.ws.rs.core.Context;
|
|
|
|
import javax.ws.rs.core.MediaType;
|
|
|
|
import javax.ws.rs.core.MediaType;
|
|
|
|
import javax.ws.rs.core.Response;
|
|
|
|
import javax.ws.rs.core.Response;
|
|
|
@ -20,6 +21,10 @@ import javax.ws.rs.core.StreamingOutput;
|
|
|
|
import java.io.UnsupportedEncodingException;
|
|
|
|
import java.io.UnsupportedEncodingException;
|
|
|
|
import java.net.URLEncoder;
|
|
|
|
import java.net.URLEncoder;
|
|
|
|
import java.time.LocalDate;
|
|
|
|
import java.time.LocalDate;
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
|
|
|
import java.util.Arrays;
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @Author weaver_cl
|
|
|
|
* @Author weaver_cl
|
|
|
@ -36,10 +41,15 @@ public class ExportCommonController {
|
|
|
|
@GET
|
|
|
|
@GET
|
|
|
|
@Path("/resource/export")
|
|
|
|
@Path("/resource/export")
|
|
|
|
@Produces(MediaType.APPLICATION_OCTET_STREAM)
|
|
|
|
@Produces(MediaType.APPLICATION_OCTET_STREAM)
|
|
|
|
public Response resourceExport(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
|
|
|
public Response resourceExport(@Context HttpServletRequest request, @Context HttpServletResponse response,
|
|
|
|
HrmResourceSearchParam param = buildResourceParam(request);
|
|
|
|
@QueryParam("ids") String ids) {
|
|
|
|
|
|
|
|
//HrmResourceSearchParam param = buildResourceParam(request);
|
|
|
|
|
|
|
|
List<Long> idList = new ArrayList<>();
|
|
|
|
|
|
|
|
if (StringUtils.isNotBlank(ids)){
|
|
|
|
|
|
|
|
idList = Arrays.stream(ids.split(",")).map(Long::parseLong).collect(Collectors.toList());
|
|
|
|
|
|
|
|
}
|
|
|
|
User user = HrmUserVarify.getUser(request, response);
|
|
|
|
User user = HrmUserVarify.getUser(request, response);
|
|
|
|
XSSFWorkbook workbook = getExportCommonWrapper(user).resourceExport(param);
|
|
|
|
XSSFWorkbook workbook = getExportCommonWrapper(user).resourceExport(idList);
|
|
|
|
String time = LocalDate.now().toString();
|
|
|
|
String time = LocalDate.now().toString();
|
|
|
|
String fileName = "人员导出" + time;
|
|
|
|
String fileName = "人员导出" + time;
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|