联调问题

This commit is contained in:
马三炮 2025-12-25 09:14:50 +08:00
parent 18281f87a3
commit c4dbaf2455
2 changed files with 57 additions and 0 deletions

View File

@ -8,12 +8,20 @@ import com.bonus.common.utils.poi.ExcelUtil;
import com.bonus.digital.dao.PlanManagementVo;
import com.bonus.digital.dao.WorkloadCategoryVo;
import com.bonus.digital.service.PlanManagementService;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.util.IOUtils;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.InputStream;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.List;
/**
@ -126,4 +134,39 @@ public class PlanManagementController extends BaseController {
}
}
@ApiOperation("模板下载")
@GetMapping("/downloadTeamExcel")
public void downloadTeamExcel(HttpServletRequest request, HttpServletResponse response) {
InputStream inputStream = null;
ServletOutputStream servletOutputStream = null;
try {
String path = "download/" + "计划管理.xlsx";
inputStream = this.getClass().getClassLoader().getResourceAsStream(path);
response.setContentType("application/vnd.ms-excel");
response.addHeader("Cache-Control", "no-cache, no-store, must-revalidate");
response.addHeader("charset", "utf-8");
response.addHeader("Pragma", "no-cache");
String encodeName = URLEncoder.encode("计划管理导入摸板.xlsx", StandardCharsets.UTF_8.toString());
response.setHeader("Content-Disposition", "attachment; filename=\"" + encodeName + "\"; filename*=utf-8''" + encodeName);
servletOutputStream = response.getOutputStream();
IOUtils.copy(inputStream, servletOutputStream);
response.flushBuffer();
//log.info("文件下载成功!!");
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (servletOutputStream != null) {
servletOutputStream.close();
}
if (inputStream != null) {
inputStream.close();
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
}

View File

@ -40,6 +40,20 @@ public class WorkloadCategoryController extends BaseController {
}
}
/**
* 工作量类别列表
*/
@PreAuthorize("@ss.hasPermi('workload:category:list')")
@GetMapping("/getWorkloadCategoryListSelect")
public AjaxResult getWorkloadCategoryListSelect(WorkloadCategoryVo workloadCategoryVo) {
try {
List<WorkloadCategoryVo> list = workloadCategoryService.getWorkloadCategoryList(workloadCategoryVo);
return success(list);
} catch (Exception e) {
return error("系统异常");
}
}
/**
* 新增工作量类别
*/