|
@@ -13,6 +13,7 @@ import com.ozs.common.core.domain.model.LoginUser;
|
|
|
import com.ozs.common.enums.BusinessType;
|
|
|
import com.ozs.common.enums.DataIsDelete;
|
|
|
import com.ozs.common.utils.PageUtils;
|
|
|
+import com.ozs.common.utils.file.FileUtils;
|
|
|
import com.ozs.common.utils.poi.ExcelUtil;
|
|
|
import com.ozs.framework.web.service.TokenService;
|
|
|
import com.ozs.plan.doman.PlanQuarter;
|
|
@@ -23,9 +24,12 @@ import com.ozs.plan.service.impl.PlanQuarterServiceImpl;
|
|
|
import com.ozs.system.service.ISysDeptService;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.http.MediaType;
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
import org.springframework.util.ObjectUtils;
|
|
|
+import org.springframework.web.bind.annotation.GetMapping;
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
@@ -34,6 +38,7 @@ import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
+import java.io.InputStream;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Date;
|
|
@@ -47,6 +52,7 @@ import java.util.stream.Collectors;
|
|
|
*/
|
|
|
@Api(tags = "季度计划")
|
|
|
@RestController
|
|
|
+@Slf4j
|
|
|
@RequestMapping("/plan/quarter")
|
|
|
public class PlanQuarterController extends BaseController {
|
|
|
@Autowired
|
|
@@ -342,5 +348,18 @@ public class PlanQuarterController extends BaseController {
|
|
|
return success(message);
|
|
|
}
|
|
|
|
|
|
+ @ApiOperation("模板下载")
|
|
|
+ @GetMapping("/downloaExcel")
|
|
|
+ public void downloadZip(HttpServletResponse response) {
|
|
|
+ try {
|
|
|
+ InputStream resourceAsStream = this.getClass().getResourceAsStream("/template/planQuarter.xlsx");
|
|
|
+ response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
|
|
|
+ FileUtils.setAttachmentResponseHeader(response, "季度计划导入模板.xlsx");
|
|
|
+ FileUtils.writeBytesByInput(resourceAsStream, response.getOutputStream());
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("下载文件失败", e);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
}
|