Commit 000322ae authored by qinhu's avatar qinhu

pdf

parent 8cb23f81
...@@ -61,7 +61,7 @@ public class EntityEnclosureController { ...@@ -61,7 +61,7 @@ public class EntityEnclosureController {
} else { } else {
return BaseResponse.errorMsg("登录信息失效"); return BaseResponse.errorMsg("登录信息失效");
} }
if (!extName.equals(".pdf")) { if (!extName.equals(".pdf") && (extName.equals(".xls") || extName.equals(".xlsx"))) {
String pdfPath = FastDFSUtils.conventAndUpload(file.getInputStream(), fileName); String pdfPath = FastDFSUtils.conventAndUpload(file.getInputStream(), fileName);
map.put("pdfPath", pdfPath); map.put("pdfPath", pdfPath);
} else { } else {
...@@ -133,7 +133,7 @@ public class EntityEnclosureController { ...@@ -133,7 +133,7 @@ public class EntityEnclosureController {
mapSub.put("fileUrl", picUrl); mapSub.put("fileUrl", picUrl);
mapSub.put("fileName", fileName); mapSub.put("fileName", fileName);
mapSub.put("extName", extName); mapSub.put("extName", extName);
if (!extName.equals(".pdf")) { if (!extName.equals(".pdf") && (extName.equals(".xls") || extName.equals(".xlsx"))) {
String pdfPath = FastDFSUtils.conventAndUpload(file.getInputStream(), fileName); String pdfPath = FastDFSUtils.conventAndUpload(file.getInputStream(), fileName);
mapSub.put("pdfPath", pdfPath); mapSub.put("pdfPath", pdfPath);
} else { } else {
......
package cn.wise.sc.cement.business.controller; package cn.wise.sc.cement.business.controller;
import cn.wise.sc.cement.business.model.BaseResponse; import cn.wise.sc.cement.business.model.BaseResponse;
import cn.wise.sc.cement.business.model.FileExt; import cn.wise.sc.cement.business.enumation.FileExt;
import cn.wise.sc.cement.business.model.PageQuery; import cn.wise.sc.cement.business.model.PageQuery;
import cn.wise.sc.cement.business.model.query.*; import cn.wise.sc.cement.business.model.query.*;
import cn.wise.sc.cement.business.model.vo.EntrustVo; import cn.wise.sc.cement.business.model.vo.EntrustVo;
......
...@@ -5,7 +5,7 @@ import cn.hutool.core.date.DateUtil; ...@@ -5,7 +5,7 @@ import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import cn.wise.sc.cement.business.entity.EntityEnclosure; import cn.wise.sc.cement.business.entity.EntityEnclosure;
import cn.wise.sc.cement.business.model.BaseResponse; import cn.wise.sc.cement.business.model.BaseResponse;
import cn.wise.sc.cement.business.model.FileExt; import cn.wise.sc.cement.business.enumation.FileExt;
import cn.wise.sc.cement.business.model.IndustrialElementKey; import cn.wise.sc.cement.business.model.IndustrialElementKey;
import cn.wise.sc.cement.business.model.IndustrialReport; import cn.wise.sc.cement.business.model.IndustrialReport;
import cn.wise.sc.cement.business.model.PageQuery; import cn.wise.sc.cement.business.model.PageQuery;
...@@ -35,7 +35,6 @@ import org.springframework.web.bind.annotation.PostMapping; ...@@ -35,7 +35,6 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.time.LocalDateTime; import java.time.LocalDateTime;
......
package cn.wise.sc.cement.business.model; package cn.wise.sc.cement.business.enumation;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
/** /**
* @description: 文件扩展名 * @description: 文件扩展名
* @author: qh * @author: qh
* @create: 2020-10-16 13:40 * @create: 2020-10-16 13:40
**/ **/
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum FileExt { public enum FileExt {
//office后缀名 //office后缀名
......
package cn.wise.sc.cement.business.util; package cn.wise.sc.cement.business.util;
import cn.wise.sc.cement.business.model.FileExt; import cn.wise.sc.cement.business.enumation.FileExt;
import freemarker.template.Configuration; import freemarker.template.Configuration;
import freemarker.template.Template; import freemarker.template.Template;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment