From 1de643d453011a81a600ddb536f5ef4c61aa38fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AB=98=E5=B5=A9?= Date: Sun, 16 Apr 2023 14:33:56 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9OTA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/OtaBaCxJsfzbacsServiceImpl.java | 18 ++++++++++--- .../impl/OtaBaCxKsjjsmccsServiceImpl.java | 26 +++++++++++++++--- .../impl/OtaBaCxKsjxtmccsServiceImpl.java | 27 ++++++++++++++++--- .../impl/OtaBaSjSjfzbhServiceImpl.java | 17 +++++++++--- .../impl/OtaBaSjSjxtbhServiceImpl.java | 23 +++++++++++++--- 5 files changed, 91 insertions(+), 20 deletions(-) diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/impl/OtaBaCxJsfzbacsServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/impl/OtaBaCxJsfzbacsServiceImpl.java index b45ceda41..6adca19af 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/impl/OtaBaCxJsfzbacsServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/impl/OtaBaCxJsfzbacsServiceImpl.java @@ -17,10 +17,7 @@ import com.jero.modules.ota.utils.ImportFileUtil; import com.jero.modules.system.service.ISysDictService; import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.StringUtils; -import org.apache.poi.ss.usermodel.Cell; -import org.apache.poi.ss.usermodel.Row; -import org.apache.poi.ss.usermodel.Sheet; -import org.apache.poi.ss.usermodel.Workbook; +import org.apache.poi.ss.usermodel.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; @@ -871,25 +868,38 @@ public class OtaBaCxJsfzbacsServiceImpl extends ServiceImpl sjmkList = OtaBaCxSjmkService.queryByOtaId(otaId); int startRow = 63; for (OtaBaCxSjmk sjmk : sjmkList) { row = s.createRow(startRow); cell = row.createCell(0); + cell.setCellStyle(style); cell.setCellValue(sjmk.getBjmc()); cell = row.createCell(1); + cell.setCellStyle(style); cell.setCellValue(ImportFileUtil.getCellValueHaveOrNot(sjmk.getPzqk())); cell = row.createCell(2); + cell.setCellStyle(style); cell.setCellValue(sjmk.getKzqmc()); cell = row.createCell(3); + cell.setCellStyle(style); cell.setCellValue(sjmk.getYjggxh()); cell = row.createCell(4); + cell.setCellStyle(style); cell.setCellValue(sjmk.getYjscqy()); cell = row.createCell(5); + cell.setCellStyle(style); cell.setCellValue(sjmk.getRjbb()); cell = row.createCell(6); + cell.setCellStyle(style); cell.setCellValue(sjmk.getRjkfqy()); cell = row.createCell(7); + cell.setCellStyle(style); cell.setCellValue(sjmk.getBzwz()); startRow++; } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/impl/OtaBaCxKsjjsmccsServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/impl/OtaBaCxKsjjsmccsServiceImpl.java index 4deb3da19..946350682 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/impl/OtaBaCxKsjjsmccsServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/impl/OtaBaCxKsjjsmccsServiceImpl.java @@ -20,10 +20,7 @@ import com.jero.modules.ota.utils.ImportFileUtil; import com.jero.modules.system.service.ISysDictService; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.ObjectUtils; -import org.apache.poi.ss.usermodel.Cell; -import org.apache.poi.ss.usermodel.Row; -import org.apache.poi.ss.usermodel.Sheet; -import org.apache.poi.ss.usermodel.Workbook; +import org.apache.poi.ss.usermodel.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; @@ -340,44 +337,65 @@ public class OtaBaCxKsjjsmccsServiceImpl extends ServiceImpl mccsList = this.getByOtaId(otaId); Workbook wb = ImportFileUtil.readExcel(file); Sheet s = wb.getSheetAt(0); + CellStyle style = wb.createCellStyle(); + style.setBorderTop(BorderStyle.THIN); + style.setBorderBottom(BorderStyle.THIN); + style.setBorderLeft(BorderStyle.THIN); + style.setBorderRight(BorderStyle.THIN); int startRow = 3; for (int i = 0; i < mccsList.size(); i++) { OtaBaCxKsjjsmccs mccs = mccsList.get(i); Row row = s.getRow(startRow); Cell cell = row.createCell(0); + cell.setCellStyle(style); cell.setCellValue(mccs.getGnmc()); cell = row.createCell(1); + cell.setCellStyle(style); cell.setCellValue(ImportFileUtil.getCellValueHaveOrNot(mccs.getPzqk())); cell = row.createCell(2); + cell.setCellStyle(style); cell.setCellValue(ImportFileUtil.getCellValueYesOrNo(mccs.getSfksj())); cell = row.createCell(3); + cell.setCellStyle(style); cell.setCellValue(ComparisonUtil.queryDictTextByKey("driving_automation_level", mccs.getJszdhjb(), sysDictService)); cell = row.createCell(4); + cell.setCellStyle(style); cell.setCellValue(mccs.getSjggcs()); cell = row.createCell(5); + cell.setCellStyle(style); cell.setCellValue(mccs.getGnms()); cell = row.createCell(6); + cell.setCellStyle(style); cell.setCellValue(mccs.getSytj()); cell = row.createCell(7); + cell.setCellStyle(style); cell.setCellValue(mccs.getKzqmc()); cell = row.createCell(8); + cell.setCellStyle(style); cell.setCellValue(mccs.getKzqscqy()); cell = row.createCell(9); + cell.setCellStyle(style); cell.setCellValue(mccs.getKzqxh()); cell = row.createCell(10); + cell.setCellStyle(style); cell.setCellValue(mccs.getYjbbxx()); cell = row.createCell(11); + cell.setCellStyle(style); cell.setCellValue(mccs.getRjkfqy()); cell = row.createCell(12); + cell.setCellStyle(style); cell.setCellValue(mccs.getCzxtbbh()); cell = row.createCell(13); + cell.setCellStyle(style); cell.setCellValue(mccs.getCsyzsj()); startRow++; } Row row = s.createRow(startRow); Cell cell = row.createCell(0); + cell.setCellStyle(style); cell.setCellValue("证明材料"); cell = row.createCell(1); + cell.setCellStyle(style); OtaBaCxList otaBaCxList = otaBaCxListService.queryById(otaId); if (ObjectUtils.isNotEmpty(otaBaCxList)) { StringBuilder sb = new StringBuilder(); diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/impl/OtaBaCxKsjxtmccsServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/impl/OtaBaCxKsjxtmccsServiceImpl.java index 4c389e199..c780fa0ac 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/impl/OtaBaCxKsjxtmccsServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/impl/OtaBaCxKsjxtmccsServiceImpl.java @@ -20,10 +20,7 @@ import com.jero.modules.ota.utils.ImportFileUtil; import com.jero.modules.system.service.ISysDictService; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.ObjectUtils; -import org.apache.poi.ss.usermodel.Cell; -import org.apache.poi.ss.usermodel.Row; -import org.apache.poi.ss.usermodel.Sheet; -import org.apache.poi.ss.usermodel.Workbook; +import org.apache.poi.ss.usermodel.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; @@ -414,19 +411,28 @@ public class OtaBaCxKsjxtmccsServiceImpl extends ServiceImpl mccsList = this.getByOtaId(otaId); Workbook wb = ImportFileUtil.readExcel(file); Sheet s = wb.getSheetAt(0); + CellStyle style = wb.createCellStyle(); + style.setBorderTop(BorderStyle.THIN); + style.setBorderBottom(BorderStyle.THIN); + style.setBorderLeft(BorderStyle.THIN); + style.setBorderRight(BorderStyle.THIN); int startRow = 3; for (OtaBaCxKsjxtmccs mccs : mccsList) { Row row = s.getRow(startRow); Cell cell = row.createCell(0); + cell.setCellStyle(style); cell.setCellValue(mccs.getXtlb()); cell = row.createCell(1); + cell.setCellStyle(style); cell.setCellValue(ImportFileUtil.getCellValueYesOrNo(mccs.getSfksj())); cell = row.createCell(2); + cell.setCellStyle(style); cell.setCellValue(mccs.getSjbgcs()); cell = row.createCell(3); + cell.setCellStyle(style); StringBuilder sb = new StringBuilder(); String tptStr = mccs.getTpt(); if (StringUtils.isNotEmpty(tptStr)) { @@ -446,26 +452,37 @@ public class OtaBaCxKsjxtmccsServiceImpl extends ServiceImpl