|
@@ -9,6 +9,7 @@ import com.ozs.common.core.domain.model.LoginUser;
|
|
|
import com.ozs.common.enums.BusinessType;
|
|
|
import com.ozs.common.exception.ServiceException;
|
|
|
import com.ozs.common.utils.StringUtils;
|
|
|
+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.ProvisionalPlan;
|
|
@@ -19,8 +20,11 @@ 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.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;
|
|
@@ -29,6 +33,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;
|
|
@@ -41,6 +46,7 @@ import java.util.stream.Collectors;
|
|
|
* @author sunhh
|
|
|
*/
|
|
|
@Api(tags = "临时计划")
|
|
|
+@Slf4j
|
|
|
@RestController
|
|
|
@RequestMapping("/plan/provisionalPlan")
|
|
|
public class ProvisionalPlanController extends BaseController {
|
|
@@ -201,4 +207,19 @@ public class ProvisionalPlanController extends BaseController {
|
|
|
provisionalPlanVo.setUpdated(String.valueOf(loginUser.getUserId()));
|
|
|
return provisionalPlanService.auditNoPass(provisionalPlanVo);
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ @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);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}
|