更新代码
This commit is contained in:
@ -9,7 +9,6 @@ import com.chinaunicom.mall.ebtp.extend.export.bean.ExportParame;
|
|||||||
|
|
||||||
public interface ExportService {
|
public interface ExportService {
|
||||||
|
|
||||||
String ERROR_MESSAGE = "导出失败,请联系管理员";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出
|
* 导出
|
||||||
|
@ -4,6 +4,7 @@ import com.chinaunicom.mall.ebtp.extend.export.bean.ExportParame;
|
|||||||
import com.chinaunicom.mall.ebtp.extend.export.service.ExportService;
|
import com.chinaunicom.mall.ebtp.extend.export.service.ExportService;
|
||||||
import com.deepoove.poi.XWPFTemplate;
|
import com.deepoove.poi.XWPFTemplate;
|
||||||
import lombok.SneakyThrows;
|
import lombok.SneakyThrows;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
@ -17,6 +18,7 @@ import java.nio.charset.StandardCharsets;
|
|||||||
* 评标专家承诺书
|
* 评标专家承诺书
|
||||||
*/
|
*/
|
||||||
@Service("zjcn")
|
@Service("zjcn")
|
||||||
|
@Slf4j
|
||||||
public class ZjcnExportServiceImpl implements ExportService {
|
public class ZjcnExportServiceImpl implements ExportService {
|
||||||
|
|
||||||
|
|
||||||
@ -32,6 +34,7 @@ public class ZjcnExportServiceImpl implements ExportService {
|
|||||||
public void doExport(ExportParame param, HttpServletRequest request, HttpServletResponse response) {
|
public void doExport(ExportParame param, HttpServletRequest request, HttpServletResponse response) {
|
||||||
//文件模板从数据库或者项目位置取得
|
//文件模板从数据库或者项目位置取得
|
||||||
File file = getExportTemplet("评标专家承诺书.docx");
|
File file = getExportTemplet("评标专家承诺书.docx");
|
||||||
|
log.info(file.getName() + " --------------- " + file.getAbsolutePath() + " --------------- " + file.getPath());
|
||||||
XWPFTemplate template = XWPFTemplate.compile(file);
|
XWPFTemplate template = XWPFTemplate.compile(file);
|
||||||
|
|
||||||
String fileName = new String("评标专家承诺书.docx".getBytes(StandardCharsets.UTF_8), StandardCharsets.ISO_8859_1);
|
String fileName = new String("评标专家承诺书.docx".getBytes(StandardCharsets.UTF_8), StandardCharsets.ISO_8859_1);
|
||||||
|
Reference in New Issue
Block a user