更新代码
This commit is contained in:
@ -38,11 +38,7 @@ public class BizBidNoticeController {
|
|||||||
@ApiOperation("查询发布列表")
|
@ApiOperation("查询发布列表")
|
||||||
@PostMapping("/list")
|
@PostMapping("/list")
|
||||||
public BasePageResponse<BizBidNotice> get(@RequestBody BizBidNoticeVO bizBidNotice) {
|
public BasePageResponse<BizBidNotice> get(@RequestBody BizBidNoticeVO bizBidNotice) {
|
||||||
if ("已发布".equals(bizBidNotice.getNoticeRelease())) {
|
|
||||||
bizBidNotice.setNoticeRelease("open");
|
|
||||||
} else if ("未发布".equals(bizBidNotice.getNoticeRelease())) {
|
|
||||||
bizBidNotice.setNoticeRelease("close");
|
|
||||||
}
|
|
||||||
return BasePageResponse.success(ibizBidNoticeService.getlist(bizBidNotice));
|
return BasePageResponse.success(ibizBidNoticeService.getlist(bizBidNotice));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,15 @@
|
|||||||
|
package com.chinaunicom.mall.ebtp.extend.export.service;
|
||||||
|
|
||||||
|
import java.io.InputStream;
|
||||||
|
|
||||||
|
public interface TemplateFileService {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据类型获取文件
|
||||||
|
*
|
||||||
|
* @param type
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public InputStream getExportTemplet(String type);
|
||||||
|
}
|
@ -6,6 +6,7 @@ import com.chinaunicom.mall.ebtp.extend.export.bean.ProjectSectionVO;
|
|||||||
import com.chinaunicom.mall.ebtp.extend.export.feign.ProjectFeignService;
|
import com.chinaunicom.mall.ebtp.extend.export.feign.ProjectFeignService;
|
||||||
import com.chinaunicom.mall.ebtp.extend.export.feign.RsmsFeignService;
|
import com.chinaunicom.mall.ebtp.extend.export.feign.RsmsFeignService;
|
||||||
import com.chinaunicom.mall.ebtp.extend.export.service.ExportService;
|
import com.chinaunicom.mall.ebtp.extend.export.service.ExportService;
|
||||||
|
import com.chinaunicom.mall.ebtp.extend.export.service.TemplateFileService;
|
||||||
import com.chinaunicom.mall.ebtp.extend.export.vo.JuryPrintVO;
|
import com.chinaunicom.mall.ebtp.extend.export.vo.JuryPrintVO;
|
||||||
import com.deepoove.poi.XWPFTemplate;
|
import com.deepoove.poi.XWPFTemplate;
|
||||||
import com.deepoove.poi.config.Configure;
|
import com.deepoove.poi.config.Configure;
|
||||||
@ -15,7 +16,7 @@ import org.springframework.stereotype.Service;
|
|||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.io.File;
|
import java.io.InputStream;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@ -31,10 +32,12 @@ import java.util.Map;
|
|||||||
public class JudgesExportServiceImpl implements ExportService {
|
public class JudgesExportServiceImpl implements ExportService {
|
||||||
private final RsmsFeignService rsmsFeignService;
|
private final RsmsFeignService rsmsFeignService;
|
||||||
private final ProjectFeignService projectFeignService;
|
private final ProjectFeignService projectFeignService;
|
||||||
|
private final TemplateFileService templateFileService;
|
||||||
|
|
||||||
public JudgesExportServiceImpl(RsmsFeignService rsmsFeignService, ProjectFeignService projectFeignService) {
|
public JudgesExportServiceImpl(RsmsFeignService rsmsFeignService, ProjectFeignService projectFeignService, TemplateFileService templateFileService) {
|
||||||
this.rsmsFeignService = rsmsFeignService;
|
this.rsmsFeignService = rsmsFeignService;
|
||||||
this.projectFeignService = projectFeignService;
|
this.projectFeignService = projectFeignService;
|
||||||
|
this.templateFileService = templateFileService;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -65,7 +68,7 @@ public class JudgesExportServiceImpl implements ExportService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
//获取模板
|
//获取模板
|
||||||
File file = getExportTemplet("评标委员会签字表.docx");
|
InputStream file = templateFileService.getExportTemplet("judges");
|
||||||
Map<String, Object> all = new HashMap<String, Object>() {{
|
Map<String, Object> all = new HashMap<String, Object>() {{
|
||||||
put("Judges", maps);
|
put("Judges", maps);
|
||||||
put("time", "");
|
put("time", "");
|
||||||
|
@ -6,6 +6,7 @@ import com.chinaunicom.mall.ebtp.extend.export.feign.OpenFeignService;
|
|||||||
import com.chinaunicom.mall.ebtp.extend.export.feign.ProjectFeignService;
|
import com.chinaunicom.mall.ebtp.extend.export.feign.ProjectFeignService;
|
||||||
import com.chinaunicom.mall.ebtp.extend.export.feign.RespsFeignService;
|
import com.chinaunicom.mall.ebtp.extend.export.feign.RespsFeignService;
|
||||||
import com.chinaunicom.mall.ebtp.extend.export.service.ExportService;
|
import com.chinaunicom.mall.ebtp.extend.export.service.ExportService;
|
||||||
|
import com.chinaunicom.mall.ebtp.extend.export.service.TemplateFileService;
|
||||||
import com.deepoove.poi.XWPFTemplate;
|
import com.deepoove.poi.XWPFTemplate;
|
||||||
import com.deepoove.poi.config.Configure;
|
import com.deepoove.poi.config.Configure;
|
||||||
import com.deepoove.poi.policy.HackLoopTableRenderPolicy;
|
import com.deepoove.poi.policy.HackLoopTableRenderPolicy;
|
||||||
@ -14,7 +15,7 @@ import org.springframework.stereotype.Service;
|
|||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.io.File;
|
import java.io.InputStream;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
@ -34,11 +35,12 @@ public class KbjlExportServiceImpl implements ExportService {
|
|||||||
private final ProjectFeignService projectFeignService;
|
private final ProjectFeignService projectFeignService;
|
||||||
private final RespsFeignService respsFeignService;
|
private final RespsFeignService respsFeignService;
|
||||||
private final OpenFeignService openFeignService;
|
private final OpenFeignService openFeignService;
|
||||||
|
private final TemplateFileService templateFileService;
|
||||||
public KbjlExportServiceImpl(ProjectFeignService projectFeignService, RespsFeignService respsFeignService, OpenFeignService openFeignService) {
|
public KbjlExportServiceImpl(ProjectFeignService projectFeignService, RespsFeignService respsFeignService, OpenFeignService openFeignService, TemplateFileService templateFileService) {
|
||||||
this.projectFeignService = projectFeignService;
|
this.projectFeignService = projectFeignService;
|
||||||
this.respsFeignService = respsFeignService;
|
this.respsFeignService = respsFeignService;
|
||||||
this.openFeignService = openFeignService;
|
this.openFeignService = openFeignService;
|
||||||
|
this.templateFileService = templateFileService;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -83,7 +85,7 @@ public class KbjlExportServiceImpl implements ExportService {
|
|||||||
bizBidOpenroom.setAssessRoomId(param.getAssessRoomId());
|
bizBidOpenroom.setAssessRoomId(param.getAssessRoomId());
|
||||||
BaseResponse<List<BizBidOpenroom>> timeList = openFeignService.list(bizBidOpenroom);
|
BaseResponse<List<BizBidOpenroom>> timeList = openFeignService.list(bizBidOpenroom);
|
||||||
|
|
||||||
File file = getExportTemplet("开标记录表.docx");
|
InputStream file = templateFileService.getExportTemplet("kbjl");
|
||||||
Map<String, Object> all = new HashMap<String, Object>() {{
|
Map<String, Object> all = new HashMap<String, Object>() {{
|
||||||
put("Record", maps);
|
put("Record", maps);
|
||||||
|
|
||||||
|
@ -5,6 +5,7 @@ import com.chinaunicom.mall.ebtp.extend.export.bean.BidEvalDetailDTO;
|
|||||||
import com.chinaunicom.mall.ebtp.extend.export.bean.ExportParame;
|
import com.chinaunicom.mall.ebtp.extend.export.bean.ExportParame;
|
||||||
import com.chinaunicom.mall.ebtp.extend.export.feign.RsmsFeignService;
|
import com.chinaunicom.mall.ebtp.extend.export.feign.RsmsFeignService;
|
||||||
import com.chinaunicom.mall.ebtp.extend.export.service.ExportService;
|
import com.chinaunicom.mall.ebtp.extend.export.service.ExportService;
|
||||||
|
import com.chinaunicom.mall.ebtp.extend.export.service.TemplateFileService;
|
||||||
import com.chinaunicom.mall.ebtp.extend.export.vo.BidEvalDetailSummaryVO;
|
import com.chinaunicom.mall.ebtp.extend.export.vo.BidEvalDetailSummaryVO;
|
||||||
import com.chinaunicom.mall.ebtp.extend.export.vo.JuryPrintVO;
|
import com.chinaunicom.mall.ebtp.extend.export.vo.JuryPrintVO;
|
||||||
import com.deepoove.poi.XWPFTemplate;
|
import com.deepoove.poi.XWPFTemplate;
|
||||||
@ -15,9 +16,8 @@ import org.springframework.stereotype.Service;
|
|||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.io.File;
|
import java.io.InputStream;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
@ -31,9 +31,11 @@ import java.util.Map;
|
|||||||
@Service("pbbg")
|
@Service("pbbg")
|
||||||
public class PbbgExportServiceImpl implements ExportService {
|
public class PbbgExportServiceImpl implements ExportService {
|
||||||
private final RsmsFeignService rsmsFeignService;
|
private final RsmsFeignService rsmsFeignService;
|
||||||
|
private final TemplateFileService templateFileService;
|
||||||
|
|
||||||
public PbbgExportServiceImpl(RsmsFeignService rsmsFeignService) {
|
public PbbgExportServiceImpl(RsmsFeignService rsmsFeignService, TemplateFileService templateFileService) {
|
||||||
this.rsmsFeignService = rsmsFeignService;
|
this.rsmsFeignService = rsmsFeignService;
|
||||||
|
this.templateFileService = templateFileService;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -206,7 +208,7 @@ public class PbbgExportServiceImpl implements ExportService {
|
|||||||
.bind("table7", policy7).bind("table8", policy8).build();
|
.bind("table7", policy7).bind("table8", policy8).build();
|
||||||
|
|
||||||
|
|
||||||
File file = getExportTemplet("评标报告.docx");
|
InputStream file = templateFileService.getExportTemplet("pbbg");
|
||||||
XWPFTemplate template = XWPFTemplate.compile(file, config).render(all);
|
XWPFTemplate template = XWPFTemplate.compile(file, config).render(all);
|
||||||
|
|
||||||
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);
|
||||||
|
@ -4,6 +4,7 @@ import com.chinaunicom.mall.ebtp.common.base.entity.BaseResponse;
|
|||||||
import com.chinaunicom.mall.ebtp.extend.export.bean.ExportParame;
|
import com.chinaunicom.mall.ebtp.extend.export.bean.ExportParame;
|
||||||
import com.chinaunicom.mall.ebtp.extend.export.feign.RsmsFeignService;
|
import com.chinaunicom.mall.ebtp.extend.export.feign.RsmsFeignService;
|
||||||
import com.chinaunicom.mall.ebtp.extend.export.service.ExportService;
|
import com.chinaunicom.mall.ebtp.extend.export.service.ExportService;
|
||||||
|
import com.chinaunicom.mall.ebtp.extend.export.service.TemplateFileService;
|
||||||
import com.chinaunicom.mall.ebtp.extend.export.vo.JuryPrintVO;
|
import com.chinaunicom.mall.ebtp.extend.export.vo.JuryPrintVO;
|
||||||
import com.deepoove.poi.XWPFTemplate;
|
import com.deepoove.poi.XWPFTemplate;
|
||||||
import com.deepoove.poi.config.Configure;
|
import com.deepoove.poi.config.Configure;
|
||||||
@ -13,7 +14,7 @@ import org.springframework.stereotype.Service;
|
|||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.io.File;
|
import java.io.InputStream;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
@ -29,9 +30,11 @@ import java.util.Map;
|
|||||||
@Service("pszj")
|
@Service("pszj")
|
||||||
public class PszjExportServiceImpl implements ExportService {
|
public class PszjExportServiceImpl implements ExportService {
|
||||||
private final RsmsFeignService rsmsFeignService;
|
private final RsmsFeignService rsmsFeignService;
|
||||||
|
private final TemplateFileService templateFileService;
|
||||||
|
|
||||||
public PszjExportServiceImpl(RsmsFeignService rsmsFeignService) {
|
public PszjExportServiceImpl(RsmsFeignService rsmsFeignService, TemplateFileService templateFileService) {
|
||||||
this.rsmsFeignService = rsmsFeignService;
|
this.rsmsFeignService = rsmsFeignService;
|
||||||
|
this.templateFileService = templateFileService;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -62,7 +65,7 @@ public class PszjExportServiceImpl implements ExportService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
File file = getExportTemplet("评审专家签到表.docx");
|
InputStream file = templateFileService.getExportTemplet("pszj");
|
||||||
Map<String, Object> all = new HashMap<String, Object>() {{
|
Map<String, Object> all = new HashMap<String, Object>() {{
|
||||||
put("table", maps);
|
put("table", maps);
|
||||||
}};
|
}};
|
||||||
|
@ -0,0 +1,42 @@
|
|||||||
|
package com.chinaunicom.mall.ebtp.extend.export.service.impl;
|
||||||
|
|
||||||
|
import com.chinaunicom.ebtp.mall.cloud.attachment.sdk.api.AttachmentClient;
|
||||||
|
import com.chinaunicom.mall.ebtp.extend.export.service.TemplateFileService;
|
||||||
|
import com.chinaunicom.mall.ebtp.extend.templatewarehouse.entity.BizBidTemplateWarehouse;
|
||||||
|
import com.chinaunicom.mall.ebtp.extend.templatewarehouse.sevice.BizBidTemplateWarehouseService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.io.ByteArrayInputStream;
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class TemplateFileServiceImpl implements TemplateFileService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private BizBidTemplateWarehouseService templateWarehouseService;
|
||||||
|
@Autowired
|
||||||
|
private AttachmentClient attachmentClient;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据类型获取文件
|
||||||
|
*
|
||||||
|
* @param type
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public InputStream getExportTemplet(String type) {
|
||||||
|
BizBidTemplateWarehouse warehouse = templateWarehouseService.getTemplateByType(type);
|
||||||
|
|
||||||
|
Optional<byte[]> bytes = attachmentClient.downloadFileByObjectId(warehouse.getDocumentCenterId());
|
||||||
|
|
||||||
|
InputStream in = null;
|
||||||
|
if (bytes.isPresent()) {
|
||||||
|
byte[] b = bytes.get();
|
||||||
|
in = new ByteArrayInputStream(b);
|
||||||
|
}
|
||||||
|
return in;
|
||||||
|
}
|
||||||
|
}
|
@ -2,6 +2,7 @@ package com.chinaunicom.mall.ebtp.extend.export.service.impl;
|
|||||||
|
|
||||||
import com.chinaunicom.mall.ebtp.extend.export.bean.ExportParame;
|
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.chinaunicom.mall.ebtp.extend.export.service.TemplateFileService;
|
||||||
import com.deepoove.poi.XWPFTemplate;
|
import com.deepoove.poi.XWPFTemplate;
|
||||||
import lombok.SneakyThrows;
|
import lombok.SneakyThrows;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@ -9,7 +10,7 @@ import org.springframework.stereotype.Service;
|
|||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.io.File;
|
import java.io.InputStream;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
|
|
||||||
@ -21,6 +22,11 @@ import java.nio.charset.StandardCharsets;
|
|||||||
@Slf4j
|
@Slf4j
|
||||||
public class ZjcnExportServiceImpl implements ExportService {
|
public class ZjcnExportServiceImpl implements ExportService {
|
||||||
|
|
||||||
|
private final TemplateFileService templateFileService;
|
||||||
|
|
||||||
|
public ZjcnExportServiceImpl(TemplateFileService templateFileService) {
|
||||||
|
this.templateFileService = templateFileService;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出
|
* 导出
|
||||||
@ -33,8 +39,7 @@ public class ZjcnExportServiceImpl implements ExportService {
|
|||||||
@Override
|
@Override
|
||||||
public void doExport(ExportParame param, HttpServletRequest request, HttpServletResponse response) {
|
public void doExport(ExportParame param, HttpServletRequest request, HttpServletResponse response) {
|
||||||
//文件模板从数据库或者项目位置取得
|
//文件模板从数据库或者项目位置取得
|
||||||
File file = getExportTemplet("评标专家承诺书.docx");
|
InputStream file = templateFileService.getExportTemplet("zjcn");
|
||||||
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