diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/constants/SafeProductConstant.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/constants/SafeProductConstant.java index fd81755..ecff4d7 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/constants/SafeProductConstant.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/constants/SafeProductConstant.java @@ -20,6 +20,7 @@ public interface SafeProductConstant { */ String DOCX_SUFFIX = ".docx"; String PDF_SUFFIX = ".pdf"; + String XLSX_SUFFIX = ".xlsx"; /** * 培训管理 diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/HygieneEvaluationExportDTO.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/HygieneEvaluationExportDTO.java new file mode 100644 index 0000000..2987b84 --- /dev/null +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/HygieneEvaluationExportDTO.java @@ -0,0 +1,59 @@ +package com.hnac.hzims.safeproduct.dto; + +import com.hnac.hzims.safeproduct.vo.HygieneEvaluationPeopleVO; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.List; + +/** + * @author liwen + * @date 2024-08-20 + */ +@Data +@ApiModel(value = "卫生考核导出DTO类") +public class HygieneEvaluationExportDTO { + + @ApiModelProperty(value = "年份") + private String year; + + @ApiModelProperty(value = "月份") + private String month; + + @ApiModelProperty(value = "第一周开始日") + private String firstWeekStart; + + @ApiModelProperty(value = "第一周结束日") + private String firstWeekEnd; + + @ApiModelProperty(value = "第二周开始日") + private String secondWeekStart; + + @ApiModelProperty(value = "第二周结束日") + private String secondWeekEnd; + + @ApiModelProperty(value = "第三周开始日") + private String thirdWeekStart; + + @ApiModelProperty(value = "第三周结束日") + private String thirdWeekEnd; + + @ApiModelProperty(value = "第四周开始日") + private String fourthWeekStart; + + @ApiModelProperty(value = "第四周结束日") + private String fourthWeekEnd; + + @ApiModelProperty(value = "第五周开始日") + private String fifthWeekStart; + + @ApiModelProperty(value = "第五周结束日") + private String fifthWeekEnd; + + @ApiModelProperty(value = "备注") + private String remark; + + @ApiModelProperty(value = "考核人员列表") + private List evaluationList; +} diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/HygieneController.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/HygieneController.java index 1119951..7ac7509 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/HygieneController.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/HygieneController.java @@ -39,7 +39,7 @@ import java.util.Map; @RestController @AllArgsConstructor @RequestMapping("/hygiene") -@Business(module = Constants.APP_NAME, value = "卫生自查", ignore = false) +@Business(module = Constants.APP_NAME, value = "卫生自查") @Api(value = "卫生自查", tags = "卫生自查接口") public class HygieneController extends BladeController { @@ -52,7 +52,7 @@ public class HygieneController extends BladeController { @PostMapping("/savePlan") @ApiOperation(value = "新增卫生自查计划") @ApiOperationSupport(order = 1) - @Operate(label = "新增卫生自查计划", type = BusinessType.INSERT, ignore = false) + @Operate(label = "新增卫生自查计划", type = BusinessType.INSERT) public R savePlan(@Valid @RequestBody HygienePlanDTO hygienePlanDTO) { return hygienePlanService.savePlan(hygienePlanDTO); } @@ -60,7 +60,7 @@ public class HygieneController extends BladeController { @PostMapping("/updatePlan") @ApiOperation(value = "修改卫生自查计划") @ApiOperationSupport(order = 2) - @Operate(label = "修改卫生自查计划", type = BusinessType.UPDATE, ignore = false) + @Operate(label = "修改卫生自查计划", type = BusinessType.UPDATE) public R updatePlan(@Valid @RequestBody HygienePlanDTO hygienePlanDTO) { return hygienePlanService.updatePlan(hygienePlanDTO); } @@ -68,7 +68,7 @@ public class HygieneController extends BladeController { @PostMapping("/removePlan") @ApiOperation(value = "删除卫生自查计划") @ApiOperationSupport(order = 3) - @Operate(label = "删除卫生自查计划", type = BusinessType.DELETE, ignore = false) + @Operate(label = "删除卫生自查计划", type = BusinessType.DELETE) public R removePlan(@RequestParam Long id) { return R.status(hygienePlanService.removePlan(id)); } @@ -76,7 +76,7 @@ public class HygieneController extends BladeController { @GetMapping("/planDetail") @ApiOperation(value = "卫生自查计划详情") @ApiOperationSupport(order = 4) - @Operate(label = "卫生自查计划详情", type = BusinessType.QUERY, ignore = false) + @Operate(label = "卫生自查计划详情", type = BusinessType.QUERY) public R planDetail(@RequestParam Long id) { return R.data(hygienePlanService.getPlan(id)); } @@ -90,7 +90,7 @@ public class HygieneController extends BladeController { }) @ApiOperation(value = "卫生自查计划分页") @ApiOperationSupport(order = 5) - @Operate(label = "卫生自查计划分页", type = BusinessType.QUERY, ignore = false) + @Operate(label = "卫生自查计划分页", type = BusinessType.QUERY) public R> planPage(@ApiIgnore @RequestParam Map param, Query query) { IPage page = hygienePlanService.planPage(param, query); return R.data(page); @@ -99,7 +99,7 @@ public class HygieneController extends BladeController { @PostMapping("/saveRecord") @ApiOperation(value = "新增卫生自查记录") @ApiOperationSupport(order = 6) - @Operate(label = "新增卫生自查记录", type = BusinessType.INSERT, ignore = false) + @Operate(label = "新增卫生自查记录", type = BusinessType.INSERT) public R saveRecord(@Valid @RequestBody HygieneRecordDTO hygieneRecordDTO) { return hygieneRecordService.saveRecord(hygieneRecordDTO); } @@ -107,7 +107,7 @@ public class HygieneController extends BladeController { @PostMapping("/updateRecord") @ApiOperation(value = "修改卫生自查记录") @ApiOperationSupport(order = 7) - @Operate(label = "修改卫生自查记录", type = BusinessType.UPDATE, ignore = false) + @Operate(label = "修改卫生自查记录", type = BusinessType.UPDATE) public R updateRecord(@Valid @RequestBody HygieneRecordDTO hygieneRecordDTO) { return hygieneRecordService.updateRecord(hygieneRecordDTO); } @@ -115,7 +115,7 @@ public class HygieneController extends BladeController { @PostMapping("/removeRecord") @ApiOperation(value = "删除卫生自查记录") @ApiOperationSupport(order = 8) - @Operate(label = "删除卫生自查记录", type = BusinessType.DELETE, ignore = false) + @Operate(label = "删除卫生自查记录", type = BusinessType.DELETE) public R removeRecord(@RequestParam Long id) { return R.status(hygieneRecordService.removeById(id)); } @@ -123,7 +123,7 @@ public class HygieneController extends BladeController { @GetMapping("/recordDetail") @ApiOperation(value = "卫生自查记录详情") @ApiOperationSupport(order = 9) - @Operate(label = "卫生自查记录详情", type = BusinessType.QUERY, ignore = false) + @Operate(label = "卫生自查记录详情", type = BusinessType.QUERY) public R recordDetail(@RequestParam Long id) { return R.data(hygieneRecordService.getRecordDetail(id)); } @@ -137,7 +137,7 @@ public class HygieneController extends BladeController { }) @ApiOperation(value = "卫生自查记录分页") @ApiOperationSupport(order = 10) - @Operate(label = "卫生自查记录分页", type = BusinessType.QUERY, ignore = false) + @Operate(label = "卫生自查记录分页", type = BusinessType.QUERY) public R> recordPage(@ApiIgnore @RequestParam Map param, Query query) { IPage page = hygieneRecordService.recordPage(param, query); return R.data(page); @@ -146,7 +146,7 @@ public class HygieneController extends BladeController { @GetMapping("/dataByMonth") @ApiOperation(value = "月度统计表") @ApiOperationSupport(order = 11) - @Operate(label = "月度统计表", type = BusinessType.QUERY, ignore = false) + @Operate(label = "月度统计表", type = BusinessType.QUERY) public R> dataByMonth(@RequestParam String month, String unit, Query query) { IPage page = hygienePlanService.dataByMonth(month, unit, query); return R.data(page); @@ -155,7 +155,7 @@ public class HygieneController extends BladeController { @GetMapping("/exportHygieneRecordData") @ApiOperation(value = "卫生自查记录表导出") @ApiOperationSupport(order = 12) - @Operate(label = "卫生自查记录表导出", type = BusinessType.EXPORT, ignore = false) + @Operate(label = "卫生自查记录表导出", type = BusinessType.EXPORT) public void exportHygieneRecordData(@RequestParam Long id, HttpServletResponse response) { hygieneRecordService.exportHygieneRecordData(id, response); } @@ -167,7 +167,7 @@ public class HygieneController extends BladeController { }) @ApiOperation(value = "月度数据导出") @ApiOperationSupport(order = 13) - @Operate(label = "月度数据导出", type = BusinessType.EXPORT, ignore = false) + @Operate(label = "月度数据导出", type = BusinessType.EXPORT) public void exportMonthData(@ApiIgnore @RequestParam Map param, Query query, HttpServletResponse response) { hygienePlanService.exportMonthData(param, query, response); } @@ -181,7 +181,7 @@ public class HygieneController extends BladeController { }) @ApiOperation(value = "卫生自查计划导出") @ApiOperationSupport(order = 14) - @Operate(label = "卫生自查计划导出", type = BusinessType.EXPORT, ignore = false) + @Operate(label = "卫生自查计划导出", type = BusinessType.EXPORT) public void exportHygienePlanData(@ApiIgnore @RequestParam Map param, HttpServletResponse response) { hygienePlanService.exportHygienePlanData(param, response); } @@ -189,7 +189,7 @@ public class HygieneController extends BladeController { @PostMapping("/saveHygieneTemplate") @ApiOperation(value = "新增卫生自查模板") @ApiOperationSupport(order = 15) - @Operate(label = "新增卫生自查模板", type = BusinessType.INSERT, ignore = false) + @Operate(label = "新增卫生自查模板", type = BusinessType.INSERT) public R saveHygieneTemplate(@RequestBody HygieneTemplateDTO hygieneTemplateDTO) { boolean save = hygieneTemplateService.saveHygieneTemplate(hygieneTemplateDTO); return R.status(save); @@ -198,7 +198,7 @@ public class HygieneController extends BladeController { @PostMapping("/updateHygieneTemplate") @ApiOperation(value = "修改卫生自查模板") @ApiOperationSupport(order = 16) - @Operate(label = "修改卫生自查模板", type = BusinessType.UPDATE, ignore = false) + @Operate(label = "修改卫生自查模板", type = BusinessType.UPDATE) public R updateHygieneTemplate(@RequestBody HygieneTemplateDTO hygieneTemplateDTO) { boolean update = hygieneTemplateService.updateHygieneTemplate(hygieneTemplateDTO); return R.status(update); @@ -207,7 +207,7 @@ public class HygieneController extends BladeController { @PostMapping("/removeHygieneTemplate") @ApiOperation(value = "删除卫生自查模板") @ApiOperationSupport(order = 17) - @Operate(label = "删除卫生自查模板", type = BusinessType.DELETE, ignore = false) + @Operate(label = "删除卫生自查模板", type = BusinessType.DELETE) public R removeHygieneTemplate(@RequestParam Long id) { boolean remove = hygieneTemplateService.removeHygieneTemplate(id); return R.status(remove); @@ -216,7 +216,7 @@ public class HygieneController extends BladeController { @GetMapping("/hygieneTemplateDetail") @ApiOperation(value = "卫生自查模板详情") @ApiOperationSupport(order = 18) - @Operate(label = "卫生自查模板详情", type = BusinessType.QUERY, ignore = false) + @Operate(label = "卫生自查模板详情", type = BusinessType.QUERY) public R hygieneTemplateDetail(@RequestParam Long id) { HygieneTemplateDetailVO detail = hygieneTemplateService.getHygieneTemplateDetail(id); return R.data(detail); @@ -225,7 +225,7 @@ public class HygieneController extends BladeController { @GetMapping("/hygieneTemplatePage") @ApiOperation(value = "卫生自查模板分页") @ApiOperationSupport(order = 19) - @Operate(label = "卫生自查模板分页", type = BusinessType.QUERY, ignore = false) + @Operate(label = "卫生自查模板分页", type = BusinessType.QUERY) public R> hygieneTemplatePage(@ApiIgnore @RequestParam Map param, Query query) { IPage page = hygieneTemplateService.getHygieneTemplatePage(param, query); return R.data(page); @@ -240,7 +240,7 @@ public class HygieneController extends BladeController { }) @ApiOperation(value = "卫生月度详情列表") @ApiOperationSupport(order = 20) - @Operate(label = "卫生月度详情列表", type = BusinessType.QUERY, ignore = false) + @Operate(label = "卫生月度详情列表", type = BusinessType.QUERY) public R> detailListByMonth(@ApiIgnore @RequestParam Map param, Query query) { IPage page = hygienePlanService.getDetailListByMonth(param, query); return R.data(page); @@ -254,4 +254,12 @@ public class HygieneController extends BladeController { HygieneEvaluationPageVO page = hygieneRecordService.getEvaluationPage(month); return R.data(page); } + + @GetMapping("/exportEvaluationData") + @ApiOperation(value = "卫生考核数据导出") + @ApiOperationSupport(order = 22) + @Operate(label = "卫生考核数据导出", type = BusinessType.EXPORT) + public void exportEvaluationData(@RequestParam String month, HttpServletResponse response) { + hygieneRecordService.exportEvaluationData(month, response); + } } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IHygieneRecordService.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IHygieneRecordService.java index 59152e5..f4f1660 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IHygieneRecordService.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IHygieneRecordService.java @@ -78,4 +78,11 @@ public interface IHygieneRecordService extends IService { * @return 考核记录表VO类 */ HygieneEvaluationPageVO getEvaluationPage(String month); + + /** + * 卫生考核数据导出 + * @param month 当前月份 + * @param response 响应类 + */ + void exportEvaluationData(String month, HttpServletResponse response); } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/HygieneRecordServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/HygieneRecordServiceImpl.java index 755daf7..30db487 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/HygieneRecordServiceImpl.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/HygieneRecordServiceImpl.java @@ -1,17 +1,24 @@ package com.hnac.hzims.safeproduct.service.impl; +import cn.afterturn.easypoi.excel.ExcelExportUtil; +import cn.afterturn.easypoi.excel.entity.TemplateExportParams; import cn.hutool.core.date.DatePattern; +import cn.hutool.core.util.ObjectUtil; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.hnac.hzims.common.utils.DateUtil; import com.hnac.hzims.safeproduct.constants.SafeProductConstant; +import com.hnac.hzims.safeproduct.dto.HygieneEvaluationExportDTO; import com.hnac.hzims.safeproduct.dto.HygieneRecordDTO; import com.hnac.hzims.safeproduct.entity.HygienePlanEntity; import com.hnac.hzims.safeproduct.entity.HygieneRecordEntity; import com.hnac.hzims.safeproduct.entity.HygieneZoneEntity; import com.hnac.hzims.safeproduct.enums.RehearsalStatusEnum; +import com.hnac.hzims.safeproduct.hazard.util.ExcelConvertPdf; import com.hnac.hzims.safeproduct.mapper.HygienePlanMapper; import com.hnac.hzims.safeproduct.mapper.HygieneRecordMapper; import com.hnac.hzims.safeproduct.service.IHygieneRecordService; @@ -19,6 +26,9 @@ import com.hnac.hzims.safeproduct.service.IHygieneZoneService; import com.hnac.hzims.safeproduct.utils.BaseUtil; import com.hnac.hzims.safeproduct.vo.*; import com.hnac.hzinfo.exception.HzServiceException; +import com.itextpdf.text.DocumentException; +import org.apache.poi.ss.usermodel.Sheet; +import org.apache.poi.ss.usermodel.Workbook; import org.springblade.core.log.exception.ServiceException; import org.springblade.core.mp.support.Query; import org.springblade.core.tool.api.R; @@ -32,7 +42,14 @@ import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; import javax.annotation.Resource; +import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.io.OutputStream; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.file.Files; +import java.nio.file.Paths; import java.time.DayOfWeek; import java.time.LocalDate; import java.time.ZoneId; @@ -268,21 +285,21 @@ public class HygieneRecordServiceImpl extends ServiceImpl peopleNameList = baseMapper.selectHygieneZoneByIds(Arrays.asList(zoneIds)); - // 遍历责任区数据 for (int j = 0; j < zoneIds.length; j++) { List scoreList = new ArrayList<>(); HygieneEvaluationPeopleVO peopleVO = new HygieneEvaluationPeopleVO(); + // 查询责任区的负责人名称 String zoneId = zoneIds[j]; Optional zoneOptional = peopleNameList.stream().filter(x -> x.getId().equals(Long.valueOf(zoneId))).findFirst(); if (zoneOptional.isPresent()) { + // 卫生记录周数 Integer weekNo = hygieneRecordEntity.getWeekNum(); - // 考核人名称 + // 负责人名称 String principal = zoneOptional.get().getPrincipal(); - // 判断单位内该名称是否已存在 + // 判断单位内该名称是否已存在,存在则补充新的考核分数据,否则新增其考核分数据 Optional checkPeople = evaluationList.stream().filter(x -> x.getPrincipal().equals(principal) && x.getUnit().equals(hygieneRecordEntity.getUnit())).findFirst(); - if (checkPeople.isPresent()) { peopleVO = checkPeople.get(); scoreList = peopleVO.getScoreList(); @@ -307,11 +324,85 @@ public class HygieneRecordServiceImpl extends ServiceImpl weekList = page.getWeekList(); + weekList.forEach(week -> { + String start = DateUtil.format(week.getStartDate(), "yyyy-MM-dd"); + start = start.substring(start.indexOf("-") + 1); + String end = DateUtil.format(week.getEndDate(), "yyyy-MM-dd"); + end = end.substring(end.indexOf("-") + 1); + switch (week.getWeekNum()) { + case 1: + exportDTO.setFirstWeekStart(start); + exportDTO.setFirstWeekEnd(end); + break; + case 2: + exportDTO.setSecondWeekStart(start); + exportDTO.setSecondWeekEnd(end); + break; + case 3: + exportDTO.setThirdWeekStart(start); + exportDTO.setThirdWeekEnd(end); + break; + case 4: + exportDTO.setFourthWeekStart(start); + exportDTO.setFourthWeekEnd(end); + break; + case 5: + exportDTO.setFifthWeekStart(start); + exportDTO.setFifthWeekEnd(end); + break; + } + }); + // 考核人员数据 + exportDTO.setEvaluationList(page.getEvaluationList()); + // 封装参数 + Map params = BaseUtil.obj2Map(exportDTO); + TemplateExportParams templateParams = new TemplateExportParams("template/卫生考核表.xlsx", true); + // 导出 + try { + String fileName = URLEncoder.encode("卫生考核表.xlsx", "UTF-8"); + response.setHeader("Content-Disposition", "attachment; filename=" + fileName); + response.setContentType("application/vnd.ms-excel;charset=utf-8"); + Workbook workbook = ExcelExportUtil.exportExcel(templateParams, params); + Sheet sheet = workbook.getSheetAt(0); + BaseUtil.mergeCell(0, 0, JSONArray.parseArray(JSON.toJSONString(exportDTO)), "unit").forEach(sheet::addMergedRegion); + BaseUtil.mergeCell(0, 7, JSONArray.parseArray(JSON.toJSONString(exportDTO)), "remark").forEach(sheet::addMergedRegion); + String pdfPath = "D://" + "/卫生考核表" + SafeProductConstant.PDF_SUFFIX; + OutputStream outputStream = Files.newOutputStream(Paths.get(pdfPath)); + ExcelConvertPdf.excelConvertPdf(workbook, outputStream); + BaseUtil.readPdf(response, pdfPath); + } catch (UnsupportedEncodingException e) { + log.error("卫生考核表导出异常-UnsupportedEncodingException:" + e.getMessage()); + } catch (DocumentException e) { + log.error("卫生考核表导出异常-DocumentException:" + e.getMessage()); + } catch (IOException e) { + log.error("卫生考核表导出异常-IOException:" + e.getMessage()); + } + } + + /** * 查询是否存在同月编号 * @param currentMonth 当月 * @return 存在则返回上一编号,否则返回null diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/utils/BaseUtil.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/utils/BaseUtil.java index 2c1755e..914c81f 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/utils/BaseUtil.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/utils/BaseUtil.java @@ -1,10 +1,13 @@ package com.hnac.hzims.safeproduct.utils; import cn.afterturn.easypoi.word.WordExportUtil; +import com.alibaba.fastjson.JSON; +import com.google.common.collect.Lists; import com.hnac.hzims.common.logs.utils.StringUtils; import com.hnac.hzims.safeproduct.constants.SafeProductConstant; import lombok.extern.slf4j.Slf4j; import org.apache.commons.io.IOUtils; +import org.apache.poi.ss.util.CellRangeAddress; import org.apache.poi.xwpf.usermodel.*; import org.json.JSONArray; import org.json.JSONObject; @@ -421,4 +424,41 @@ public class BaseUtil { throw new ServiceException("标准总分值未全部分配"); } } + + /** + * + * @param initRow 起始行数 + * @param initColumn 起始列数 + * @param data 数据 + * @param attribute 合并属性 + * @return 单元格列表 + */ + public static List mergeCell(int initRow, int initColumn, com.alibaba.fastjson.JSONArray data, String attribute) { + List result = Lists.newArrayList(); + String initAttribute = com.alibaba.fastjson.JSONObject.parseObject(JSON.toJSONString(data.get(0))).getString(attribute); + int mergeCount = 1; + for (int index = 0; index < data.size(); index++) { + if (index == 0) { + continue; + } + com.alibaba.fastjson.JSONObject object = com.alibaba.fastjson.JSONObject.parseObject(JSON.toJSONString(data.get(index))); + if (object.getString(attribute).equals(initAttribute)) { + mergeCount++; + } + else { + if (mergeCount > 1) { + result.add(new CellRangeAddress(initRow, initRow+mergeCount-1, initColumn, initColumn)); + } + initRow = initRow+mergeCount; + initAttribute = object.getString(attribute); + mergeCount = 1; + } + if (index == data.size() -1) { + if (mergeCount > 1) { + result.add(new CellRangeAddress(initRow, initRow + mergeCount-1, initColumn, initColumn)); + } + } + } + return result; + } } diff --git a/hzims-service/safeproduct/src/main/resources/template/卫生考核表.xlsx b/hzims-service/safeproduct/src/main/resources/template/卫生考核表.xlsx new file mode 100644 index 0000000..93b2b21 Binary files /dev/null and b/hzims-service/safeproduct/src/main/resources/template/卫生考核表.xlsx differ