diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/service/impl/OperPersonalMonthReportServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/service/impl/OperPersonalMonthReportServiceImpl.java index 0bcc2e0..a401ebf 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/service/impl/OperPersonalMonthReportServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/service/impl/OperPersonalMonthReportServiceImpl.java @@ -7,15 +7,14 @@ import com.hnac.hzims.operational.access.service.IOperAccessTaskService; import com.hnac.hzims.operational.defect.entity.OperPhenomenonEntity; import com.hnac.hzims.operational.defect.service.IOperPhenomenonService; import com.hnac.hzims.operational.duty.service.IImsDutyMainService; -import com.hnac.hzims.operational.main.common.ExcelData; import com.hnac.hzims.operational.main.vo.DutyPersonalReportVO; -import com.hnac.hzims.operational.report.vo.PersonalMonthReportVO; -import com.hnac.hzims.operational.report.vo.PersonalMonthsReportVO; import com.hnac.hzims.operational.maintenance.constants.MaintenanceConstant; import com.hnac.hzims.operational.maintenance.entity.OperMaintenanceTaskEntity; import com.hnac.hzims.operational.maintenance.service.IOperMaintenanceTaskService; import com.hnac.hzims.operational.report.constants.ReportConstant; import com.hnac.hzims.operational.report.service.IOperPersonalMonthReportService; +import com.hnac.hzims.operational.report.vo.PersonalMonthReportVO; +import com.hnac.hzims.operational.report.vo.PersonalMonthsReportVO; import com.hnac.hzinfo.inspect.gather.entity.TaskGatherEntity; import com.hnac.hzinfo.inspect.gather.feign.IInspectGatherClient; import com.hnac.hzinfo.inspect.task.TaskContants; @@ -28,6 +27,7 @@ import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.tool.utils.CollectionUtil; import org.springblade.core.tool.utils.ObjectUtil; import org.springframework.beans.BeanUtils; +import org.springframework.core.io.ClassPathResource; import org.springframework.stereotype.Service; import org.springframework.web.context.request.RequestAttributes; import org.springframework.web.context.request.RequestContextHolder; @@ -36,10 +36,14 @@ import org.springframework.web.context.request.ServletRequestAttributes; import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServletResponse; import java.io.IOException; +import java.io.InputStream; import java.net.URLEncoder; import java.text.DateFormat; import java.text.SimpleDateFormat; -import java.time.*; +import java.time.Duration; +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.ZoneId; import java.time.format.DateTimeFormatter; import java.time.temporal.TemporalAdjusters; import java.util.*; @@ -119,8 +123,14 @@ public class OperPersonalMonthReportServiceImpl implements IOperPersonalMonthRep PersonalMonthReportVO personalMonthReportVO = this.getPersonalMonthReport(month, AuthUtil.getUserId()); if(ObjectUtil.isNotEmpty(personalMonthReportVO)){ int currentRowNum = 0; - ExcelData ed = new ExcelData(); - XSSFWorkbook readWb = ed.getWb(); + XSSFWorkbook readWb = new XSSFWorkbook(); + try { + ClassPathResource classPathResource = new ClassPathResource("files/运维月度报表-个人报表.xlsx"); + InputStream inputStream =classPathResource.getInputStream(); + readWb = new XSSFWorkbook(inputStream); + } catch (Exception e) { + e.printStackTrace(); + } XSSFSheet readSheet = readWb.getSheet("个人月度报告"); String title = Optional.ofNullable(personalMonthReportVO).map(PersonalMonthReportVO :: getStationName).orElse("")+month+"月个人月总结报告"; readSheet.getRow(currentRowNum).getCell(0).setCellValue(title); @@ -178,7 +188,7 @@ public class OperPersonalMonthReportServiceImpl implements IOperPersonalMonthRep RequestAttributes requestAttributes = RequestContextHolder.currentRequestAttributes(); HttpServletResponse response = ((ServletRequestAttributes)requestAttributes).getResponse(); readWb.setSheetHidden(0,true); - readWb.setSheetHidden(1,true); +// readWb.setSheetHidden(1,true); String filename = "("+month+")个人月度报告"; // 设置头信息 response.setCharacterEncoding("UTF-8"); diff --git a/hzims-service/operational/src/main/resources/files/运维月度报表-个人报表.xlsx b/hzims-service/operational/src/main/resources/files/运维月度报表-个人报表.xlsx new file mode 100644 index 0000000..a5b7438 Binary files /dev/null and b/hzims-service/operational/src/main/resources/files/运维月度报表-个人报表.xlsx differ