11-19-模板初版
This commit is contained in:
@ -77,6 +77,16 @@ public class HseSafetyWeeklyReportVo implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private Long excelId;
|
private Long excelId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* excel文件原始名称
|
||||||
|
*/
|
||||||
|
private String excelFileName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* excel路径
|
||||||
|
*/
|
||||||
|
private String excelPath;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 文件后缀
|
* 文件后缀
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -111,6 +111,6 @@ public interface IHseSafetyWeeklyReportService extends IService<HseSafetyWeeklyR
|
|||||||
/**
|
/**
|
||||||
* 生成项目周报模板
|
* 生成项目周报模板
|
||||||
*/
|
*/
|
||||||
File testExcel(HseSafetyWeeklyReport report);
|
File testExcel(HseSafetyWeeklyReport report,Integer weekOfYear);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -20,6 +20,10 @@ import org.dromara.common.core.utils.StringUtils;
|
|||||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||||
import org.dromara.out.service.impl.OutConstructionValueRangeServiceImpl;
|
import org.dromara.out.service.impl.OutConstructionValueRangeServiceImpl;
|
||||||
|
import org.dromara.progress.domain.enums.PgsProgressCategoryTypeEnum;
|
||||||
|
import org.dromara.progress.domain.vo.progresscategory.PgsProgressCategoryDatePlanVo;
|
||||||
|
import org.dromara.progress.domain.vo.progresscategory.PgsProgressCategoryDateTotalVo;
|
||||||
|
import org.dromara.progress.service.IPgsProgressCategoryService;
|
||||||
import org.dromara.project.domain.vo.project.BusProjectVo;
|
import org.dromara.project.domain.vo.project.BusProjectVo;
|
||||||
import org.dromara.project.service.IBusProjectService;
|
import org.dromara.project.service.IBusProjectService;
|
||||||
import org.dromara.safety.domain.HseSafetyWeeklyReport;
|
import org.dromara.safety.domain.HseSafetyWeeklyReport;
|
||||||
@ -41,7 +45,10 @@ import java.io.File;
|
|||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.PrintWriter;
|
import java.io.PrintWriter;
|
||||||
|
import java.math.BigDecimal;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Scanner;
|
import java.util.Scanner;
|
||||||
@ -62,6 +69,8 @@ public class HseSafetyWeeklyReportServiceImpl extends ServiceImpl<HseSafetyWeekl
|
|||||||
@Resource
|
@Resource
|
||||||
private IBusProjectService projectService;
|
private IBusProjectService projectService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IPgsProgressCategoryService progressCategoryService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private SysOssServiceImpl sysOssService;
|
private SysOssServiceImpl sysOssService;
|
||||||
@ -94,7 +103,9 @@ public class HseSafetyWeeklyReportServiceImpl extends ServiceImpl<HseSafetyWeekl
|
|||||||
@Override
|
@Override
|
||||||
public TableDataInfo<HseSafetyWeeklyReportVo> queryPageList(HseSafetyWeeklyReportQueryReq req, PageQuery pageQuery) {
|
public TableDataInfo<HseSafetyWeeklyReportVo> queryPageList(HseSafetyWeeklyReportQueryReq req, PageQuery pageQuery) {
|
||||||
Page<HseSafetyWeeklyReport> result = this.page(pageQuery.build(), this.buildQueryWrapper(req));
|
Page<HseSafetyWeeklyReport> result = this.page(pageQuery.build(), this.buildQueryWrapper(req));
|
||||||
return TableDataInfo.build(this.getVoPage(result));
|
Page<HseSafetyWeeklyReportVo> voPage = this.getVoPage(result);
|
||||||
|
setValue(voPage.getRecords());
|
||||||
|
return TableDataInfo.build(voPage);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -123,8 +134,12 @@ public class HseSafetyWeeklyReportServiceImpl extends ServiceImpl<HseSafetyWeekl
|
|||||||
// 数据校验
|
// 数据校验
|
||||||
validEntityBeforeSave(safetyWeeklyReport, true);
|
validEntityBeforeSave(safetyWeeklyReport, true);
|
||||||
|
|
||||||
|
//处理周期
|
||||||
|
Integer weekOfYear = outConstructionValueRangeService.getCurrentWeekOfYear(LocalDate.now().toString());
|
||||||
|
safetyWeeklyReport.setWeek(weekOfYear.toString());
|
||||||
|
|
||||||
//处理Excel
|
//处理Excel
|
||||||
File file = testExcel(safetyWeeklyReport);
|
File file = testExcel(safetyWeeklyReport,weekOfYear);
|
||||||
SysOssVo sysOssVo = sysOssService.upload(file);
|
SysOssVo sysOssVo = sysOssService.upload(file);
|
||||||
file.delete();
|
file.delete();
|
||||||
if (sysOssVo != null){
|
if (sysOssVo != null){
|
||||||
@ -219,7 +234,10 @@ public class HseSafetyWeeklyReportServiceImpl extends ServiceImpl<HseSafetyWeekl
|
|||||||
safetyWeeklyReportVo.setFileName(ossVo.getOriginalName());
|
safetyWeeklyReportVo.setFileName(ossVo.getOriginalName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return safetyWeeklyReportVo;
|
//装填Excel文件信息
|
||||||
|
List<HseSafetyWeeklyReportVo> safetyWeeklyReportVo1 = List.of(safetyWeeklyReportVo);
|
||||||
|
setValue(safetyWeeklyReportVo1);
|
||||||
|
return safetyWeeklyReportVo1.getFirst();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -295,8 +313,15 @@ public class HseSafetyWeeklyReportServiceImpl extends ServiceImpl<HseSafetyWeekl
|
|||||||
if (jsonObj.getInt("status") == 2 || jsonObj.getInt("status") == 6) {
|
if (jsonObj.getInt("status") == 2 || jsonObj.getInt("status") == 6) {
|
||||||
String downloadUri = (String) jsonObj.get("url");
|
String downloadUri = (String) jsonObj.get("url");
|
||||||
HseSafetyWeeklyReport document = this.getById(id);
|
HseSafetyWeeklyReport document = this.getById(id);
|
||||||
String filePath = document.getPath();
|
String[] split = downloadUri.split("\\.");
|
||||||
SysOssVo ossVo = ossService.getById(Long.valueOf(filePath));
|
String s = split[split.length - 1];
|
||||||
|
Long filePath;
|
||||||
|
if ("xlsx".equals(s)) {
|
||||||
|
filePath = document.getExcelId();
|
||||||
|
}else {
|
||||||
|
filePath = Long.valueOf(document.getPath());
|
||||||
|
}
|
||||||
|
SysOssVo ossVo = ossService.getById(filePath);
|
||||||
ossService.uploadFileUrlWithNoSave(downloadUri, ossVo.getFileName());
|
ossService.uploadFileUrlWithNoSave(downloadUri, ossVo.getFileName());
|
||||||
} else if (jsonObj.getInt("status") == 3 || jsonObj.getInt("status") == 7) {
|
} else if (jsonObj.getInt("status") == 3 || jsonObj.getInt("status") == 7) {
|
||||||
writer.write("{\"error\":-1}");
|
writer.write("{\"error\":-1}");
|
||||||
@ -307,15 +332,30 @@ public class HseSafetyWeeklyReportServiceImpl extends ServiceImpl<HseSafetyWeekl
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据回显
|
||||||
|
*/
|
||||||
|
public void setValue(List<HseSafetyWeeklyReportVo> vos){
|
||||||
|
for (HseSafetyWeeklyReportVo vo : vos) {
|
||||||
|
if (vo.getExcelId() != null){
|
||||||
|
SysOssVo byId = sysOssService.getById(vo.getExcelId());
|
||||||
|
if (byId != null){
|
||||||
|
vo.setExcelFileName(byId.getOriginalName());
|
||||||
|
vo.setExcelPath(byId.getUrl());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 测试生成Excel模板
|
* 测试生成Excel模板
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public File testExcel(HseSafetyWeeklyReport report) {
|
public File testExcel(HseSafetyWeeklyReport report,Integer weekOfYear) {
|
||||||
// 生成Excel模板文件
|
// 生成Excel模板文件
|
||||||
// String outputFilePath = "C:\\Users\\Administrator\\Desktop\\周报模板.xlsx";
|
// String outputFilePath = "C:\\Users\\Administrator\\Desktop\\周报模板.xlsx";
|
||||||
try {
|
try {
|
||||||
File file = generateWeeklyReportTemplate(report);
|
File file = generateWeeklyReportTemplate(report,weekOfYear);
|
||||||
return file;
|
return file;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
System.err.println("Excel模板生成失败:" + e.getMessage());
|
System.err.println("Excel模板生成失败:" + e.getMessage());
|
||||||
@ -329,7 +369,7 @@ public class HseSafetyWeeklyReportServiceImpl extends ServiceImpl<HseSafetyWeekl
|
|||||||
* @return 生成的Excel文件对象
|
* @return 生成的Excel文件对象
|
||||||
* @throws Exception 异常抛出
|
* @throws Exception 异常抛出
|
||||||
*/
|
*/
|
||||||
public File generateWeeklyReportTemplate(HseSafetyWeeklyReport report) throws Exception {
|
public File generateWeeklyReportTemplate(HseSafetyWeeklyReport report,Integer weekOfYear) throws Exception {
|
||||||
FileOutputStream outputStream = null;
|
FileOutputStream outputStream = null;
|
||||||
File targetFile = null;
|
File targetFile = null;
|
||||||
|
|
||||||
@ -348,7 +388,7 @@ public class HseSafetyWeeklyReportServiceImpl extends ServiceImpl<HseSafetyWeekl
|
|||||||
// targetFile = File.createTempFile("周报模板_", ".xlsx");
|
// targetFile = File.createTempFile("周报模板_", ".xlsx");
|
||||||
// targetFile.deleteOnExit();
|
// targetFile.deleteOnExit();
|
||||||
// }
|
// }
|
||||||
targetFile = File.createTempFile("周报模板_", ".xlsx");
|
targetFile = File.createTempFile("周报_"+ LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy_MM_dd_HH_mm_ss")), ".xlsx");
|
||||||
|
|
||||||
// 2. 使用POI直接创建复杂格式
|
// 2. 使用POI直接创建复杂格式
|
||||||
Workbook workbook = new XSSFWorkbook();
|
Workbook workbook = new XSSFWorkbook();
|
||||||
@ -357,7 +397,7 @@ public class HseSafetyWeeklyReportServiceImpl extends ServiceImpl<HseSafetyWeekl
|
|||||||
|
|
||||||
// 3. 构建完整模板结构
|
// 3. 构建完整模板结构
|
||||||
setupSheetBasicStyle(sheet); // 设置基础样式
|
setupSheetBasicStyle(sheet); // 设置基础样式
|
||||||
buildTemplateFullStructure(sheet, workbook,report); // 创建所有内容
|
buildTemplateFullStructure(sheet, workbook,report,weekOfYear); // 创建所有内容
|
||||||
setKeyRowHeights(sheet); // 设置行高
|
setKeyRowHeights(sheet); // 设置行高
|
||||||
|
|
||||||
// 4. 写入文件
|
// 4. 写入文件
|
||||||
@ -382,7 +422,7 @@ public class HseSafetyWeeklyReportServiceImpl extends ServiceImpl<HseSafetyWeekl
|
|||||||
targetFile.delete();
|
targetFile.delete();
|
||||||
System.err.println("异常时已清理损坏文件");
|
System.err.println("异常时已清理损坏文件");
|
||||||
}
|
}
|
||||||
throw new Exception("模板生成流程失败:" + e.getMessage(), e);
|
throw new RuntimeException("模板生成流程失败:" + e.getMessage(), e);
|
||||||
} finally {
|
} finally {
|
||||||
if (outputStream != null) {
|
if (outputStream != null) {
|
||||||
try {
|
try {
|
||||||
@ -409,7 +449,7 @@ public class HseSafetyWeeklyReportServiceImpl extends ServiceImpl<HseSafetyWeekl
|
|||||||
/**
|
/**
|
||||||
* 构建模板完整结构(添加自动调整行高)
|
* 构建模板完整结构(添加自动调整行高)
|
||||||
*/
|
*/
|
||||||
private void buildTemplateFullStructure(Sheet sheet, Workbook workbook,HseSafetyWeeklyReport report) {
|
private void buildTemplateFullStructure(Sheet sheet, Workbook workbook,HseSafetyWeeklyReport report,Integer weekOfYear) {
|
||||||
// 创建所有需要的样式
|
// 创建所有需要的样式
|
||||||
CellStyle titleStyle = createTitleCellStyle(workbook);
|
CellStyle titleStyle = createTitleCellStyle(workbook);
|
||||||
CellStyle headerStyle = createHeaderCellStyle(workbook);
|
CellStyle headerStyle = createHeaderCellStyle(workbook);
|
||||||
@ -426,7 +466,7 @@ public class HseSafetyWeeklyReportServiceImpl extends ServiceImpl<HseSafetyWeekl
|
|||||||
setupAllSmallMergeRegions(sheet);
|
setupAllSmallMergeRegions(sheet);
|
||||||
|
|
||||||
// 3. 项目信息行(第3行)- A,B列合并
|
// 3. 项目信息行(第3行)- A,B列合并
|
||||||
createProjectInfoRow(sheet, headerStyle, contentStyle,busProjectVo);
|
createProjectInfoRow(sheet, headerStyle, contentStyle,busProjectVo,weekOfYear);
|
||||||
|
|
||||||
// 4. 主表头行(第4行)
|
// 4. 主表头行(第4行)
|
||||||
createMainHeaderRow(sheet, headerStyle, contentStyle);
|
createMainHeaderRow(sheet, headerStyle, contentStyle);
|
||||||
@ -435,10 +475,10 @@ public class HseSafetyWeeklyReportServiceImpl extends ServiceImpl<HseSafetyWeekl
|
|||||||
createProjectBasicInfoModule(sheet, workbook, 4, headerStyle, contentStyle,busProjectVo,report);
|
createProjectBasicInfoModule(sheet, workbook, 4, headerStyle, contentStyle,busProjectVo,report);
|
||||||
|
|
||||||
// 6. 本周进度模块(第7行)- 调整行高
|
// 6. 本周进度模块(第7行)- 调整行高
|
||||||
createWeeklyProgressModule(sheet, workbook, 6, headerStyle, contentStyle);
|
createWeeklyProgressModule(sheet, workbook, 6, headerStyle, contentStyle,report);
|
||||||
|
|
||||||
// 7. 下周计划模块(第8行)
|
// 7. 下周计划模块(第8行)
|
||||||
createNextWeekPlanModule(sheet, workbook, 7, headerStyle, contentStyle);
|
createNextWeekPlanModule(sheet, workbook, 7, headerStyle, contentStyle,report);
|
||||||
|
|
||||||
// 8. 质量情况模块(第9行)- 调整行高
|
// 8. 质量情况模块(第9行)- 调整行高
|
||||||
createQualityStatusModule(sheet, workbook, 8, headerStyle, contentStyle);
|
createQualityStatusModule(sheet, workbook, 8, headerStyle, contentStyle);
|
||||||
@ -501,7 +541,7 @@ public class HseSafetyWeeklyReportServiceImpl extends ServiceImpl<HseSafetyWeekl
|
|||||||
/**
|
/**
|
||||||
* 项目信息行(第3行)- 修正合并区域
|
* 项目信息行(第3行)- 修正合并区域
|
||||||
*/
|
*/
|
||||||
private void createProjectInfoRow(Sheet sheet, CellStyle headerStyle, CellStyle contentStyle,BusProjectVo busProjectVo) {
|
private void createProjectInfoRow(Sheet sheet, CellStyle headerStyle, CellStyle contentStyle,BusProjectVo busProjectVo,Integer weekOfYear) {
|
||||||
Row infoRow = sheet.getRow(2);
|
Row infoRow = sheet.getRow(2);
|
||||||
|
|
||||||
// A3:B3合并(项目名称标签)
|
// A3:B3合并(项目名称标签)
|
||||||
@ -525,7 +565,7 @@ public class HseSafetyWeeklyReportServiceImpl extends ServiceImpl<HseSafetyWeekl
|
|||||||
|
|
||||||
Cell reportNoValue = infoRow.createCell(8);
|
Cell reportNoValue = infoRow.createCell(8);
|
||||||
|
|
||||||
Integer weekOfYear = outConstructionValueRangeService.getCurrentWeekOfYear(LocalDate.now().toString());
|
// Integer weekOfYear = outConstructionValueRangeService.getCurrentWeekOfYear(LocalDate.now().toString());
|
||||||
reportNoValue.setCellValue(weekOfYear);
|
reportNoValue.setCellValue(weekOfYear);
|
||||||
reportNoValue.setCellStyle(contentStyle);
|
reportNoValue.setCellStyle(contentStyle);
|
||||||
|
|
||||||
@ -619,6 +659,8 @@ public class HseSafetyWeeklyReportServiceImpl extends ServiceImpl<HseSafetyWeekl
|
|||||||
|
|
||||||
// J5:L6合并(空)- 修正:J5-L6合并
|
// J5:L6合并(空)- 修正:J5-L6合并
|
||||||
Cell emptyJK = row1.createCell(9);
|
Cell emptyJK = row1.createCell(9);
|
||||||
|
BigDecimal totalProgressPercentage = progressCategoryService.getTotalProgressPercentage(report.getProjectId());
|
||||||
|
emptyJK.setCellValue(totalProgressPercentage.multiply(BigDecimal.valueOf(100)).toString() + "%");
|
||||||
emptyJK.setCellStyle(contentStyle);
|
emptyJK.setCellStyle(contentStyle);
|
||||||
addMergedRegionSafe(sheet, startRow, startRow + 1, 9, 11);
|
addMergedRegionSafe(sheet, startRow, startRow + 1, 9, 11);
|
||||||
}
|
}
|
||||||
@ -627,7 +669,8 @@ public class HseSafetyWeeklyReportServiceImpl extends ServiceImpl<HseSafetyWeekl
|
|||||||
* 本周进度模块(第7行)
|
* 本周进度模块(第7行)
|
||||||
*/
|
*/
|
||||||
private void createWeeklyProgressModule(Sheet sheet, Workbook workbook, int startRow,
|
private void createWeeklyProgressModule(Sheet sheet, Workbook workbook, int startRow,
|
||||||
CellStyle headerStyle, CellStyle contentStyle) {
|
CellStyle headerStyle, CellStyle contentStyle,
|
||||||
|
HseSafetyWeeklyReport report) {
|
||||||
Row progressRow = sheet.createRow(startRow);
|
Row progressRow = sheet.createRow(startRow);
|
||||||
progressRow.setHeightInPoints(60);
|
progressRow.setHeightInPoints(60);
|
||||||
|
|
||||||
@ -640,9 +683,52 @@ public class HseSafetyWeeklyReportServiceImpl extends ServiceImpl<HseSafetyWeekl
|
|||||||
titleCell.setCellStyle(headerStyle);
|
titleCell.setCellStyle(headerStyle);
|
||||||
|
|
||||||
Cell contentCell = progressRow.createCell(2);
|
Cell contentCell = progressRow.createCell(2);
|
||||||
contentCell.setCellValue("本周有1天因下雨全部停工;\n" +
|
|
||||||
"本周完成量:清表0亩,累计完成4104亩;钻孔4875个,累计完成119985个,灌注桩浇筑3955个,累计完成104434个桩,安装支架644组,累计完成6412组,安装光伏组件409组,累计完成4902组;\n" +
|
//语句
|
||||||
"直流电缆电池至逆变器电缆 H1Z2Z2-k-1×4mm2约10km,累计完成55km;1×6mm2约10km,累计完成32km;接地扁钢40*4约2km,累计完成7km;50*5约1km,累计完成4km;接地角钢100根,累计完成250根;场区道路改扩建10%,累计30%。");
|
StringBuffer sb = new StringBuffer();
|
||||||
|
|
||||||
|
//送出线路
|
||||||
|
List<PgsProgressCategoryDateTotalVo> scxl = progressCategoryService.getProgressCategoryByDate(report.getProjectId(), PgsProgressCategoryTypeEnum.SEND_LINE, report.getScope(), report.getScopeEnd());
|
||||||
|
for (PgsProgressCategoryDateTotalVo vo : scxl) {
|
||||||
|
sb.append(vo.getName()).append(": ").append("本周完成").append(vo.getCompletedNum()).append(vo.getUnit()).append(",").append("累计完成").append(vo.getCompletedTotal()).append(vo.getUnit()).append("。\n");
|
||||||
|
}
|
||||||
|
if (!scxl.isEmpty()) {
|
||||||
|
sb.append("\n");
|
||||||
|
}
|
||||||
|
//升压站
|
||||||
|
List<PgsProgressCategoryDateTotalVo> syz = progressCategoryService.getProgressCategoryByDate(report.getProjectId(), PgsProgressCategoryTypeEnum.BOOSTER_STATION, report.getScope(), report.getScopeEnd());
|
||||||
|
for (PgsProgressCategoryDateTotalVo vo : syz) {
|
||||||
|
sb.append(vo.getName()).append(": ").append("本周完成").append(vo.getCompletedNum()).append(vo.getUnit()).append(",").append("累计完成").append(vo.getCompletedTotal()).append(vo.getUnit()).append("。\n");
|
||||||
|
}
|
||||||
|
if (!syz.isEmpty()) {
|
||||||
|
sb.append("\n");
|
||||||
|
}
|
||||||
|
//集电线路
|
||||||
|
List<PgsProgressCategoryDateTotalVo> jdlx = progressCategoryService.getProgressCategoryByDate(report.getProjectId(), PgsProgressCategoryTypeEnum.COLLECTING_LINE, report.getScope(), report.getScopeEnd());
|
||||||
|
for (PgsProgressCategoryDateTotalVo vo : jdlx) {
|
||||||
|
sb.append(vo.getName()).append(": ").append("本周完成").append(vo.getCompletedNum()).append(vo.getUnit()).append(",").append("累计完成").append(vo.getCompletedTotal()).append(vo.getUnit()).append("。\n");
|
||||||
|
}
|
||||||
|
if (!jdlx.isEmpty()) {
|
||||||
|
sb.append("\n");
|
||||||
|
}
|
||||||
|
//光伏场区
|
||||||
|
List<PgsProgressCategoryDateTotalVo> gfcq = progressCategoryService.getProgressCategoryByDate(report.getProjectId(), PgsProgressCategoryTypeEnum.PHOTOVOLTAIC_AREA, report.getScope(), report.getScopeEnd());
|
||||||
|
for (PgsProgressCategoryDateTotalVo vo : gfcq) {
|
||||||
|
sb.append(vo.getName()).append(": ").append("本周完成").append(vo.getCompletedNum()).append(vo.getUnit()).append(",").append("累计完成").append(vo.getCompletedTotal()).append(vo.getUnit()).append("。\n");
|
||||||
|
}
|
||||||
|
if (!gfcq.isEmpty()) {
|
||||||
|
sb.append("\n");
|
||||||
|
}
|
||||||
|
//其他工程
|
||||||
|
List<PgsProgressCategoryDateTotalVo> qtgc = progressCategoryService.getProgressCategoryByDate(report.getProjectId(), PgsProgressCategoryTypeEnum.OTHER_PROJECT, report.getScope(), report.getScopeEnd());
|
||||||
|
for (PgsProgressCategoryDateTotalVo vo : qtgc) {
|
||||||
|
sb.append(vo.getName()).append(": ").append("本周完成").append(vo.getCompletedNum()).append(vo.getUnit()).append(",").append("累计完成").append(vo.getCompletedTotal()).append(vo.getUnit()).append("。\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
// contentCell.setCellValue("本周有1天因下雨全部停工;\n" +
|
||||||
|
// "本周完成量:清表0亩,累计完成4104亩;钻孔4875个,累计完成119985个,灌注桩浇筑3955个,累计完成104434个桩,安装支架644组,累计完成6412组,安装光伏组件409组,累计完成4902组;\n" +
|
||||||
|
// "直流电缆电池至逆变器电缆 H1Z2Z2-k-1×4mm2约10km,累计完成55km;1×6mm2约10km,累计完成32km;接地扁钢40*4约2km,累计完成7km;50*5约1km,累计完成4km;接地角钢100根,累计完成250根;场区道路改扩建10%,累计30%。");
|
||||||
|
contentCell.setCellValue(sb.toString());
|
||||||
contentCell.setCellStyle(contentStyle);
|
contentCell.setCellStyle(contentStyle);
|
||||||
addMergedRegionSafe(sheet, startRow, startRow, 2, 11);
|
addMergedRegionSafe(sheet, startRow, startRow, 2, 11);
|
||||||
}
|
}
|
||||||
@ -651,7 +737,8 @@ public class HseSafetyWeeklyReportServiceImpl extends ServiceImpl<HseSafetyWeekl
|
|||||||
* 修正其他模块的行号(去掉空行后)
|
* 修正其他模块的行号(去掉空行后)
|
||||||
*/
|
*/
|
||||||
private void createNextWeekPlanModule(Sheet sheet, Workbook workbook, int startRow,
|
private void createNextWeekPlanModule(Sheet sheet, Workbook workbook, int startRow,
|
||||||
CellStyle headerStyle, CellStyle contentStyle) {
|
CellStyle headerStyle, CellStyle contentStyle,
|
||||||
|
HseSafetyWeeklyReport report) {
|
||||||
Row planRow = sheet.createRow(startRow);
|
Row planRow = sheet.createRow(startRow);
|
||||||
|
|
||||||
Cell seqCell = planRow.createCell(0);
|
Cell seqCell = planRow.createCell(0);
|
||||||
@ -663,7 +750,50 @@ public class HseSafetyWeeklyReportServiceImpl extends ServiceImpl<HseSafetyWeekl
|
|||||||
titleCell.setCellStyle(headerStyle);
|
titleCell.setCellStyle(headerStyle);
|
||||||
|
|
||||||
Cell contentCell = planRow.createCell(2);
|
Cell contentCell = planRow.createCell(2);
|
||||||
contentCell.setCellValue("继续钻孔、安装钢筋笼、浇筑混凝土、支架安装、光伏组件安装、接地扁铁安装、电缆沟开挖等工作。");
|
|
||||||
|
//语句
|
||||||
|
StringBuffer sb = new StringBuffer();
|
||||||
|
|
||||||
|
//送出线路
|
||||||
|
List<PgsProgressCategoryDatePlanVo> scxl = progressCategoryService.getProgressCategoryPlanByDate(report.getProjectId(), PgsProgressCategoryTypeEnum.SEND_LINE, report.getScope(), report.getScopeEnd());
|
||||||
|
for (PgsProgressCategoryDatePlanVo vo : scxl) {
|
||||||
|
sb.append(vo.getName()).append(": ").append("下周计划周完成").append(vo.getPlanNum()).append(vo.getUnit()).append("。\n");
|
||||||
|
}
|
||||||
|
if (!scxl.isEmpty()) {
|
||||||
|
sb.append("\n");
|
||||||
|
}
|
||||||
|
//升压站
|
||||||
|
List<PgsProgressCategoryDatePlanVo> syz = progressCategoryService.getProgressCategoryPlanByDate(report.getProjectId(), PgsProgressCategoryTypeEnum.BOOSTER_STATION, report.getScope(), report.getScopeEnd());
|
||||||
|
for (PgsProgressCategoryDatePlanVo vo : syz) {
|
||||||
|
sb.append(vo.getName()).append(": ").append("下周计划周完成").append(vo.getPlanNum()).append(vo.getUnit()).append("。\n");
|
||||||
|
}
|
||||||
|
if (!syz.isEmpty()) {
|
||||||
|
sb.append("\n");
|
||||||
|
}
|
||||||
|
//集电线路
|
||||||
|
List<PgsProgressCategoryDatePlanVo> jdlx = progressCategoryService.getProgressCategoryPlanByDate(report.getProjectId(), PgsProgressCategoryTypeEnum.COLLECTING_LINE, report.getScope(), report.getScopeEnd());
|
||||||
|
for (PgsProgressCategoryDatePlanVo vo : jdlx) {
|
||||||
|
sb.append(vo.getName()).append(": ").append("下周计划周完成").append(vo.getPlanNum()).append(vo.getUnit()).append("。\n");
|
||||||
|
}
|
||||||
|
if (!jdlx.isEmpty()) {
|
||||||
|
sb.append("\n");
|
||||||
|
}
|
||||||
|
//光伏场区
|
||||||
|
List<PgsProgressCategoryDatePlanVo> gfcq = progressCategoryService.getProgressCategoryPlanByDate(report.getProjectId(), PgsProgressCategoryTypeEnum.PHOTOVOLTAIC_AREA, report.getScope(), report.getScopeEnd());
|
||||||
|
for (PgsProgressCategoryDatePlanVo vo : gfcq) {
|
||||||
|
sb.append(vo.getName()).append(": ").append("下周计划周完成").append(vo.getPlanNum()).append(vo.getUnit()).append("。\n");
|
||||||
|
}
|
||||||
|
if (!gfcq.isEmpty()) {
|
||||||
|
sb.append("\n");
|
||||||
|
}
|
||||||
|
//其他工程
|
||||||
|
List<PgsProgressCategoryDatePlanVo> qtgc = progressCategoryService.getProgressCategoryPlanByDate(report.getProjectId(), PgsProgressCategoryTypeEnum.OTHER_PROJECT, report.getScope(), report.getScopeEnd());
|
||||||
|
for (PgsProgressCategoryDatePlanVo vo : qtgc) {
|
||||||
|
sb.append(vo.getName()).append(": ").append("下周计划周完成").append(vo.getPlanNum()).append(vo.getUnit()).append("。\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
// contentCell.setCellValue("继续钻孔、安装钢筋笼、浇筑混凝土、支架安装、光伏组件安装、接地扁铁安装、电缆沟开挖等工作。");
|
||||||
|
contentCell.setCellValue(sb.toString());
|
||||||
contentCell.setCellStyle(contentStyle);
|
contentCell.setCellStyle(contentStyle);
|
||||||
addMergedRegionSafe(sheet, startRow, startRow, 2, 11);
|
addMergedRegionSafe(sheet, startRow, startRow, 2, 11);
|
||||||
}
|
}
|
||||||
@ -706,6 +836,10 @@ public class HseSafetyWeeklyReportServiceImpl extends ServiceImpl<HseSafetyWeekl
|
|||||||
titleCell.setCellStyle(headerStyle);
|
titleCell.setCellStyle(headerStyle);
|
||||||
|
|
||||||
Cell contentCell = personnelRow.createCell(2);
|
Cell contentCell = personnelRow.createCell(2);
|
||||||
|
|
||||||
|
//统计考勤
|
||||||
|
|
||||||
|
|
||||||
contentCell.setCellValue("本周施工人员633人,共投入光伏钻机21台,小蜜蜂钻机6台,履带式潜孔钻机4台,柴油发动空压机6台,无人机18台,汽油发动振捣棒20台,小型电动工具一批。");
|
contentCell.setCellValue("本周施工人员633人,共投入光伏钻机21台,小蜜蜂钻机6台,履带式潜孔钻机4台,柴油发动空压机6台,无人机18台,汽油发动振捣棒20台,小型电动工具一批。");
|
||||||
contentCell.setCellStyle(contentStyle);
|
contentCell.setCellStyle(contentStyle);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user