|
@@ -43,12 +43,10 @@ import org.springblade.core.tool.utils.DateUtil;
|
|
|
import org.springblade.feign.ArchiveFileTaskClient;
|
|
|
import org.springblade.manager.entity.ContractInfo;
|
|
|
import org.springblade.manager.entity.ContractRelationJlyz;
|
|
|
-import org.springblade.manager.entity.WbsTreePrivate;
|
|
|
import org.springblade.manager.feign.FormulaClient;
|
|
|
import org.springblade.manager.vo.ReportResult;
|
|
|
import org.springblade.meter.dto.*;
|
|
|
import org.springblade.meter.entity.*;
|
|
|
-import org.springblade.meter.mapper.MaterialStartStatementMapper;
|
|
|
import org.springblade.meter.mapper.MiddleMeterApplyMapper;
|
|
|
import org.springblade.meter.service.IMaterialStartStatementService;
|
|
|
import org.springblade.meter.service.impl.*;
|
|
@@ -2612,6 +2610,8 @@ public class TaskController extends BladeController {
|
|
|
if(Func.isNotEmpty(reportResults)){
|
|
|
/*List<String> dataListPdf = new ArrayList<>();*/
|
|
|
String file_path = CollectionUtils.getSysLocalFileUrl();
|
|
|
+ Map<String,Object> projectMap=jdbcTemplate.queryForMap("select b.project_name projectName from m_contract_info a join m_project_info b on a.p_id=b.id where a.id= "+report.getContractId());
|
|
|
+ String projectName = projectMap.getOrDefault("projectName",StringPool.EMPTY).toString();
|
|
|
/* String fileUrl = "";*/
|
|
|
List<Map<String,Object>> excelInfo=jdbcTemplate.queryForList("SELECT id,file_url from m_excel_tab where id in("+reportResults.stream().map(ReportResult::getExcelId).distinct().map(Objects::toString).collect(Collectors.joining(","))+")");
|
|
|
if(Func.isNotEmpty(excelInfo)){
|
|
@@ -2648,6 +2648,7 @@ public class TaskController extends BladeController {
|
|
|
pdfCopy = new PdfCopy(doc, new FileOutputStream(rs.getPdfPath()));
|
|
|
int pageCount;
|
|
|
doc.open();
|
|
|
+ String tile=projectName+StringPool.DASH+rs.getName();
|
|
|
for(Map<String,Object> dataMap:rs.getData()){
|
|
|
if (Func.isNotEmpty(dataMap)) {
|
|
|
try {
|
|
@@ -2669,6 +2670,8 @@ public class TaskController extends BladeController {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ /*设置表头*/
|
|
|
+ setTitle(sheet,tile);
|
|
|
/*输出到内存*/
|
|
|
//去掉表格虚线
|
|
|
sheet.setPrintGridlines(false);
|
|
@@ -2717,6 +2720,28 @@ public class TaskController extends BladeController {
|
|
|
return fileUrl;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+ public void setTitle(Sheet sheet,String name){
|
|
|
+ if(name.contains("封面")){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ Row row = sheet.getRow(0);
|
|
|
+ Cell cell = row.getCell(0);
|
|
|
+ if(cell!=null){
|
|
|
+ Workbook workbook=sheet.getWorkbook();
|
|
|
+ Font font = workbook.createFont();
|
|
|
+ font.setFontName("黑体"); // 设置字体名称
|
|
|
+ font.setFontHeightInPoints((short) 20); // 设置字号为20
|
|
|
+ CellStyle style = workbook.createCellStyle();
|
|
|
+ style.setFont(font); // 将字体应用到样式中
|
|
|
+ style.setAlignment(HorizontalAlignment.CENTER);
|
|
|
+ style.setVerticalAlignment(VerticalAlignment.CENTER);
|
|
|
+ cell.setCellValue(name);
|
|
|
+ cell.setCellStyle(style);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
@Data
|
|
|
class Report{
|
|
|
public final String[] REPORT_TYPE=new String[]{"s_interim_pay_certificate","s_material_start_statement","s_material_start_statement"};
|