修改OTA

This commit is contained in:
高嵩
2023-04-16 14:33:56 +08:00
parent b058f757dc
commit 1de643d453
5 changed files with 91 additions and 20 deletions
@@ -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<OtaBaCxJsfzbacsMappe
cell.setCellValue(bass.getEdrScqy());
CellStyle style = wb.createCellStyle();
style.setBorderTop(BorderStyle.THIN);
style.setBorderBottom(BorderStyle.THIN);
style.setBorderLeft(BorderStyle.THIN);
style.setBorderRight(BorderStyle.THIN);
List<OtaBaCxSjmk> 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++;
}
@@ -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<OtaBaCxKsjjsmccsMap
List<OtaBaCxKsjjsmccs> 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();
@@ -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<OtaBaCxKsjxtmccsMap
List<OtaBaCxKsjxtmccs> 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<OtaBaCxKsjxtmccsMap
cell.setCellValue(sb.toString());
}
cell = row.createCell(4);
cell.setCellStyle(style);
cell.setCellValue(mccs.getKzqmc());
cell = row.createCell(5);
cell.setCellStyle(style);
cell.setCellValue(mccs.getAqwzxdj());
cell = row.createCell(6);
cell.setCellStyle(style);
cell.setCellValue(mccs.getKzqscqy());
cell = row.createCell(7);
cell.setCellStyle(style);
cell.setCellValue(mccs.getKzqxh());
cell = row.createCell(8);
cell.setCellStyle(style);
cell.setCellValue(mccs.getYjbbxx());
cell = row.createCell(9);
cell.setCellStyle(style);
cell.setCellValue(mccs.getCsrjbbh());
cell = row.createCell(10);
cell.setCellStyle(style);
cell.setCellValue(mccs.getCsrjbwzsj());
cell = row.createCell(11);
cell.setCellStyle(style);
cell.setCellValue(mccs.getSjsfyx());
cell = row.createCell(12);
cell.setCellStyle(style);
cell.setCellValue(mccs.getCzxtlx());
cell = row.createCell(13);
cell.setCellStyle(style);
cell.setCellValue(mccs.getCzxtscqy());
cell = row.createCell(14);
cell.setCellStyle(style);
cell.setCellValue(mccs.getCzxtbbh());
startRow++;
}
@@ -474,8 +491,10 @@ public class OtaBaCxKsjxtmccsServiceImpl extends ServiceImpl<OtaBaCxKsjxtmccsMap
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();
@@ -18,10 +18,7 @@ import com.jero.modules.ota.utils.ImportFileUtil;
import com.jero.modules.system.service.ISysDictService;
import com.jero.modules.system.util.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;
@@ -297,24 +294,36 @@ public class OtaBaSjSjfzbhServiceImpl extends ServiceImpl<OtaBaSjSjfzbhMapper, O
if (ObjectUtils.isNotEmpty(fzbhList)) {
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);
Row row;
Cell cell;
int start = 4;
for (OtaBaSjSjfzbh bh : fzbhList) {
row = s.createRow(start);
cell = row.createCell(0);
cell.setCellStyle(style);
cell.setCellValue(bh.getGnmc());
cell = row.createCell(1);
cell.setCellStyle(style);
cell.setCellValue(bh.getSjmdlx());
cell = row.createCell(2);
cell.setCellStyle(style);
cell.setCellValue(bh.getSjqbgcs());
cell = row.createCell(3);
cell.setCellStyle(style);
cell.setCellValue(bh.getSjhbgcs());
cell = row.createCell(4);
cell.setCellStyle(style);
cell.setCellValue(bh.getGnbgms());
cell = row.createCell(5);
cell.setCellStyle(style);
cell.setCellValue(bh.getSytjbg());
cell = row.createCell(6);
cell.setCellStyle(style);
cell.setCellValue(bh.getSjsjkzq());
start++;
}
@@ -18,10 +18,8 @@ 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.hssf.usermodel.HSSFCellStyle;
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;
@@ -290,34 +288,51 @@ public class OtaBaSjSjxtbhServiceImpl extends ServiceImpl<OtaBaSjSjxtbhMapper, O
if (ObjectUtils.isNotEmpty(bhList)) {
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);
Row row;
Cell cell;
int start = 4;
for (OtaBaSjSjxtbh bh : bhList) {
row = s.createRow(start);
cell = row.createCell(0);
cell.setCellStyle(style);
cell.setCellValue(bh.getXtmc());
cell = row.createCell(1);
cell.setCellStyle(style);
cell.setCellValue(bh.getSjqbgcs());
cell = row.createCell(2);
cell.setCellStyle(style);
cell.setCellValue(bh.getSjhbgcs());
cell = row.createCell(3);
cell.setCellStyle(style);
cell.setCellValue(bh.getSjkzqmc());
cell = row.createCell(4);
cell.setCellStyle(style);
cell.setCellValue(bh.getYjbb());
cell = row.createCell(5);
cell.setCellStyle(style);
cell.setCellValue(bh.getSjqrjbb());
cell = row.createCell(6);
cell.setCellStyle(style);
cell.setCellValue(bh.getSjhrjbb());
cell = row.createCell(7);
cell.setCellStyle(style);
cell.setCellValue(bh.getSjqczxt());
cell = row.createCell(8);
cell.setCellStyle(style);
cell.setCellValue(bh.getSjhczxt());
cell = row.createCell(9);
cell.setCellStyle(style);
cell.setCellValue(bh.getSjbyzsj());
cell = row.createCell(10);
cell.setCellStyle(style);
cell.setCellValue(bh.getSjbdx());
cell = row.createCell(11);
cell.setCellStyle(style);
cell.setCellValue(ImportFileUtil.getCellValueYesOrNo(bh.getSfcfsj()));
start++;
}