开发OTA备案工具-导入导出
This commit is contained in:
+2
@@ -71,4 +71,6 @@ public interface IOtaBaCxJsfzbacsService extends IService<OtaBaCxJsfzbacs> {
|
||||
void importData(MultipartFile file, String otaId, String cut) throws Exception;
|
||||
|
||||
void parseFileList(List<File> upLoadFiles, String otaId, String cut) throws Exception;
|
||||
|
||||
void exportData(File file, String otaId, String cut) throws Exception;
|
||||
}
|
||||
|
||||
+1
-1
@@ -72,5 +72,5 @@ public interface IOtaBaCxKsjjsmccsService extends IService<OtaBaCxKsjjsmccs> {
|
||||
|
||||
void parseFileList(List<File> upLoadFiles, String otaId, String cut) throws Exception;
|
||||
|
||||
void exportData(File file, File attFile, String otaId, String cut) throws Exception
|
||||
void exportData(File file, File attFile, String otaId, String cut) throws Exception;
|
||||
}
|
||||
|
||||
+284
@@ -248,6 +248,7 @@ public class OtaBaCxJsfzbacsServiceImpl extends ServiceImpl<OtaBaCxJsfzbacsMappe
|
||||
parseFileList(upLoadFiles, otaId, cut);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void parseFileList(List<File> upLoadFiles, String otaId, String cut) throws Exception {
|
||||
File upFile = null;
|
||||
@@ -577,4 +578,287 @@ public class OtaBaCxJsfzbacsServiceImpl extends ServiceImpl<OtaBaCxJsfzbacsMappe
|
||||
bass.setEdrScqy(ImportFileUtil.getCellValue(cell, wb));
|
||||
return bass;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void exportData(File file, String otaId, String cut) throws Exception {
|
||||
OtaBaCxJsfzbacs bass = getByOtaId(otaId);
|
||||
Workbook wb = ImportFileUtil.readExcel(file);
|
||||
Sheet s = wb.getSheetAt(0);
|
||||
bass.setOtaId(otaId);
|
||||
|
||||
Row row = s.getRow(2);
|
||||
Cell cell = row.getCell(2);
|
||||
cell.setCellValue(ImportFileUtil.getCellValueYesOrNoInt(bass.getJsfzczjPz()));
|
||||
row = s.getRow(2);
|
||||
cell = row.getCell(4);
|
||||
cell.setCellValue(bass.getJgldSl());
|
||||
row = s.getRow(3);
|
||||
cell = row.getCell(4);
|
||||
cell.setCellValue(bass.getJgldBzwz());
|
||||
row = s.getRow(4);
|
||||
cell = row.getCell(4);
|
||||
cell.setCellValue(bass.getJgldGgxh());
|
||||
row = s.getRow(5);
|
||||
cell = row.getCell(4);
|
||||
cell.setCellValue(bass.getJgldScqy());
|
||||
|
||||
row = s.getRow(6);
|
||||
cell = row.getCell(2);
|
||||
cell.setCellValue(ImportFileUtil.getCellValueYesOrNoInt(bass.getHmbldPz()));
|
||||
row = s.getRow(6);
|
||||
cell = row.getCell(4);
|
||||
cell.setCellValue(bass.getHmbldSl());
|
||||
row = s.getRow(7);
|
||||
cell = row.getCell(4);
|
||||
cell.setCellValue(bass.getHmbldBzwz());
|
||||
row = s.getRow(8);
|
||||
cell = row.getCell(4);
|
||||
cell.setCellValue(bass.getHmbldGgxh());
|
||||
row = s.getRow(9);
|
||||
cell = row.getCell(4);
|
||||
cell.setCellValue(bass.getHmbldScqy());
|
||||
row = s.getRow(10);
|
||||
cell = row.getCell(2);
|
||||
cell.setCellValue(ImportFileUtil.getCellValueYesOrNoInt(bass.getCsbldPz()));
|
||||
row = s.getRow(10);
|
||||
cell = row.getCell(4);
|
||||
cell.setCellValue(bass.getCsbldSl());
|
||||
row = s.getRow(11);
|
||||
cell = row.getCell(4);
|
||||
cell.setCellValue(bass.getCsbldBzwz());
|
||||
row = s.getRow(12);
|
||||
cell = row.getCell(4);
|
||||
cell.setCellValue(bass.getCsbldGgxh());
|
||||
row = s.getRow(13);
|
||||
cell = row.getCell(4);
|
||||
cell.setCellValue(bass.getCsbldScqy());
|
||||
|
||||
row = s.getRow(14);
|
||||
cell = row.getCell(2);
|
||||
cell.setCellValue(ImportFileUtil.getCellValueYesOrNoInt(bass.getSxthsPz()));
|
||||
row = s.getRow(14);
|
||||
cell = row.getCell(4);
|
||||
cell.setCellValue(bass.getSxthsSl());
|
||||
row = s.getRow(15);
|
||||
cell = row.getCell(4);
|
||||
cell.setCellValue(bass.getSxthsBzwz());
|
||||
row = s.getRow(16);
|
||||
cell = row.getCell(4);
|
||||
cell.setCellValue(bass.getSxthsGgxh());
|
||||
row = s.getRow(17);
|
||||
cell = row.getCell(4);
|
||||
cell.setCellValue(bass.getSxthsScqy());
|
||||
|
||||
row = s.getRow(18);
|
||||
cell = row.getCell(2);
|
||||
cell.setCellValue(ImportFileUtil.getCellValueYesOrNoInt(bass.getSxtdsdPz()));
|
||||
row = s.getRow(18);
|
||||
cell = row.getCell(4);
|
||||
cell.setCellValue(bass.getSxtdsdSl());
|
||||
row = s.getRow(19);
|
||||
cell = row.getCell(4);
|
||||
cell.setCellValue(bass.getSxtdsdBzwz());
|
||||
row = s.getRow(20);
|
||||
cell = row.getCell(4);
|
||||
cell.setCellValue(bass.getSxtdsdGgxh());
|
||||
row = s.getRow(21);
|
||||
cell = row.getCell(4);
|
||||
cell.setCellValue(bass.getSxtdsdScqy());
|
||||
|
||||
row = s.getRow(22);
|
||||
cell = row.getCell(2);
|
||||
cell.setCellValue(ImportFileUtil.getCellValueYesOrNoInt(bass.getJsyjkPz()));
|
||||
row = s.getRow(22);
|
||||
cell = row.getCell(4);
|
||||
cell.setCellValue(bass.getJsyjkSl());
|
||||
row = s.getRow(23);
|
||||
cell = row.getCell(4);
|
||||
cell.setCellValue(bass.getJsyjkBzwz());
|
||||
row = s.getRow(24);
|
||||
cell = row.getCell(4);
|
||||
cell.setCellValue(bass.getJsyjkGgxh());
|
||||
row = s.getRow(25);
|
||||
cell = row.getCell(4);
|
||||
cell.setCellValue(bass.getJsyjkScqy());
|
||||
|
||||
row = s.getRow(26);
|
||||
cell = row.getCell(2);
|
||||
cell.setCellValue(ImportFileUtil.getCellValueYesOrNoInt(bass.getJsyhwPz()));
|
||||
row = s.getRow(26);
|
||||
cell = row.getCell(4);
|
||||
cell.setCellValue(bass.getJsyhwSl());
|
||||
row = s.getRow(27);
|
||||
cell = row.getCell(4);
|
||||
cell.setCellValue(bass.getJsyhwBzwz());
|
||||
row = s.getRow(28);
|
||||
cell = row.getCell(4);
|
||||
cell.setCellValue(bass.getJsyhwGgxh());
|
||||
row = s.getRow(29);
|
||||
cell = row.getCell(4);
|
||||
cell.setCellValue(bass.getJsyhwScqy());
|
||||
|
||||
row = s.getRow(30);
|
||||
cell = row.getCell(2);
|
||||
cell.setCellValue(ImportFileUtil.getCellValueYesOrNoInt(bass.getCzwxdwPz()));
|
||||
row = s.getRow(30);
|
||||
cell = row.getCell(4);
|
||||
cell.setCellValue(bass.getCzwxdwGgxh());
|
||||
row = s.getRow(31);
|
||||
cell = row.getCell(4);
|
||||
cell.setCellValue(bass.getCzwxdwScqy());
|
||||
|
||||
row = s.getRow(32);
|
||||
cell = row.getCell(2);
|
||||
cell.setCellValue(ImportFileUtil.getCellValueYesOrNoInt(bass.getGxdhPz()));
|
||||
row = s.getRow(32);
|
||||
cell = row.getCell(4);
|
||||
cell.setCellValue(bass.getGxdhGgxh());
|
||||
row = s.getRow(33);
|
||||
cell = row.getCell(4);
|
||||
cell.setCellValue(bass.getGxdhScqy());
|
||||
|
||||
row = s.getRow(34);
|
||||
cell = row.getCell(2);
|
||||
cell.setCellValue(ImportFileUtil.getCellValueYesOrNoInt(bass.getLsjPz()));
|
||||
row = s.getRow(34);
|
||||
cell = row.getCell(4);
|
||||
cell.setCellValue(bass.getLsjGgxh());
|
||||
row = s.getRow(35);
|
||||
cell = row.getCell(4);
|
||||
cell.setCellValue(bass.getLsjScqy());
|
||||
|
||||
row = s.getRow(36);
|
||||
cell = row.getCell(2);
|
||||
cell.setCellValue(ImportFileUtil.getCellValueYesOrNoInt(bass.getGjddtPz()));
|
||||
row = s.getRow(36);
|
||||
cell = row.getCell(4);
|
||||
cell.setCellValue(bass.getGjddtGgxh());
|
||||
row = s.getRow(37);
|
||||
cell = row.getCell(4);
|
||||
cell.setCellValue(bass.getGjddtScqy());
|
||||
|
||||
row = s.getRow(38);
|
||||
cell = row.getCell(2);
|
||||
cell.setCellValue(ImportFileUtil.getCellValueYesOrNoInt(bass.getDzwlPz()));
|
||||
row = s.getRow(38);
|
||||
cell = row.getCell(4);
|
||||
cell.setCellValue(bass.getDzwlDxxgcs());
|
||||
|
||||
row = s.getRow(39);
|
||||
cell = row.getCell(2);
|
||||
cell.setCellValue(ImportFileUtil.getCellValueYesOrNoInt(bass.getCztxPz()));
|
||||
row = s.getRow(39);
|
||||
cell = row.getCell(4);
|
||||
cell.setCellValue(bass.getCztxXtmc());
|
||||
row = s.getRow(40);
|
||||
cell = row.getCell(4);
|
||||
cell.setCellValue(bass.getCztxGgxh());
|
||||
row = s.getRow(41);
|
||||
cell = row.getCell(4);
|
||||
cell.setCellValue(bass.getCztxScqy());
|
||||
row = s.getRow(42);
|
||||
cell = row.getCell(4);
|
||||
cell.setCellValue(bass.getCztxBbh());
|
||||
row = s.getRow(43);
|
||||
cell = row.getCell(4);
|
||||
cell.setCellValue(bass.getCztxKfqy());
|
||||
|
||||
row = s.getRow(44);
|
||||
cell = row.getCell(2);
|
||||
cell.setCellValue(ImportFileUtil.getCellValueYesOrNoInt(bass.getJsfzczjPz()));
|
||||
row = s.getRow(44);
|
||||
cell = row.getCell(4);
|
||||
cell.setCellValue(bass.getJsfzczjMc());
|
||||
row = s.getRow(45);
|
||||
cell = row.getCell(4);
|
||||
cell.setCellValue(bass.getJsfzczjYjxh());
|
||||
row = s.getRow(46);
|
||||
cell = row.getCell(4);
|
||||
cell.setCellValue(bass.getJsfzczjScqy());
|
||||
|
||||
row = s.getRow(47);
|
||||
cell = row.getCell(2);
|
||||
cell.setCellValue(ImportFileUtil.getCellValueYesOrNoInt(bass.getJsfzzsqPz()));
|
||||
row = s.getRow(47);
|
||||
cell = row.getCell(4);
|
||||
cell.setCellValue(bass.getJsfzzsqMc());
|
||||
row = s.getRow(48);
|
||||
cell = row.getCell(4);
|
||||
cell.setCellValue(bass.getJsfzzsqYjxh());
|
||||
row = s.getRow(49);
|
||||
cell = row.getCell(4);
|
||||
cell.setCellValue(bass.getJsfzzsqScqy());
|
||||
|
||||
row = s.getRow(50);
|
||||
cell = row.getCell(2);
|
||||
cell.setCellValue(ImportFileUtil.getCellValueYesOrNoInt(bass.getFxptstsPz()));
|
||||
row = s.getRow(50);
|
||||
cell = row.getCell(4);
|
||||
cell.setCellValue(bass.getFxptstsMc());
|
||||
row = s.getRow(51);
|
||||
cell = row.getCell(4);
|
||||
cell.setCellValue(bass.getFxptstsYjxh());
|
||||
row = s.getRow(52);
|
||||
cell = row.getCell(4);
|
||||
cell.setCellValue(bass.getFxptstsScqy());
|
||||
|
||||
row = s.getRow(53);
|
||||
cell = row.getCell(2);
|
||||
cell.setCellValue(ImportFileUtil.getCellValueYesOrNoInt(bass.getJsyzyltsPz()));
|
||||
row = s.getRow(53);
|
||||
cell = row.getCell(4);
|
||||
cell.setCellValue(bass.getJsyzyltsMc());
|
||||
row = s.getRow(54);
|
||||
cell = row.getCell(4);
|
||||
cell.setCellValue(bass.getJsyzyltsYjxh());
|
||||
row = s.getRow(55);
|
||||
cell = row.getCell(4);
|
||||
cell.setCellValue(bass.getJsyzyltsScqy());
|
||||
|
||||
row = s.getRow(56);
|
||||
cell = row.getCell(2);
|
||||
cell.setCellValue(ImportFileUtil.getCellValueYesOrNoInt(bass.getDssadPz()));
|
||||
row = s.getRow(56);
|
||||
cell = row.getCell(4);
|
||||
cell.setCellValue(bass.getDssadGgxh());
|
||||
row = s.getRow(57);
|
||||
cell = row.getCell(4);
|
||||
cell.setCellValue(bass.getDssadScqy());
|
||||
|
||||
row = s.getRow(58);
|
||||
cell = row.getCell(2);
|
||||
cell.setCellValue(ImportFileUtil.getCellValueYesOrNoInt(bass.getEdrPz()));
|
||||
row = s.getRow(58);
|
||||
cell = row.getCell(4);
|
||||
cell.setCellValue(bass.getEdrGgxh());
|
||||
row = s.getRow(59);
|
||||
cell = row.getCell(4);
|
||||
cell.setCellValue(bass.getEdrScqy());
|
||||
|
||||
|
||||
List<OtaBaCxSjmk> sjmkList = OtaBaCxSjmkService.queryByOtaId(otaId);
|
||||
int startRow = 63;
|
||||
for (OtaBaCxSjmk sjmk : sjmkList) {
|
||||
row = s.getRow(startRow);
|
||||
cell = row.createCell(0);
|
||||
cell.setCellValue(sjmk.getBjmc());
|
||||
cell = row.createCell(1);
|
||||
cell.setCellValue(ImportFileUtil.getCellValueYesOrNo(sjmk.getPzqk()));
|
||||
cell = row.createCell(2);
|
||||
cell.setCellValue(sjmk.getKzqmc());
|
||||
cell = row.createCell(3);
|
||||
cell.setCellValue(sjmk.getYjggxh());
|
||||
cell = row.createCell(4);
|
||||
cell.setCellValue(sjmk.getYjscqy());
|
||||
cell = row.createCell(5);
|
||||
cell.setCellValue(sjmk.getRjbb());
|
||||
cell = row.createCell(6);
|
||||
cell.setCellValue(sjmk.getRjkfqy());
|
||||
cell = row.createCell(7);
|
||||
cell.setCellValue(sjmk.getBzwz());
|
||||
startRow++;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+3
@@ -209,6 +209,9 @@ public class OtaBaCxListServiceImpl extends ServiceImpl<OtaBaCxListMapper, OtaBa
|
||||
File jsmccsAttFile = ImportFileUtil.findFoder(exportFile, "可在线升级的驾驶辅助功能名称与参数");
|
||||
otaBaCxKsjjsmccsService.exportData(jsmccsFile, jsmccsAttFile, otaId, cut);
|
||||
|
||||
File bacsFile = ImportFileUtil.findFile(exportFile, "驾驶辅助系统基础备案参数.xlsx");
|
||||
otaBaCxJsfzbacsService.exportData(bacsFile, otaId, cut);
|
||||
|
||||
|
||||
String outPath = uploadPath + "/车型及功能备案" + System.currentTimeMillis() + ".zip";
|
||||
FileOutputStream fos1 = new FileOutputStream(outPath);
|
||||
|
||||
+13
-1
@@ -179,6 +179,18 @@ public class ImportFileUtil {
|
||||
return res;
|
||||
}
|
||||
|
||||
public static String getCellValueYesOrNoInt(Integer val) throws Exception {
|
||||
String res = "";
|
||||
if (ObjectUtils.isNotEmpty(val)) {
|
||||
if (val.equals(1)) {
|
||||
res = "是";
|
||||
} else if (val.equals(2)) {
|
||||
res = "否";
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
public static String getCellValueYesOrNo(String str) throws Exception {
|
||||
String res = "";
|
||||
if (StringUtils.isNotEmpty(str)) {
|
||||
@@ -432,7 +444,7 @@ public class ImportFileUtil {
|
||||
/**
|
||||
* 将InputStream写入本地文件
|
||||
*
|
||||
* @param input 输入流
|
||||
* @param input 输入流
|
||||
* @throws IOException IOException
|
||||
*/
|
||||
public static void writeToLocal(String path, InputStream input)
|
||||
|
||||
Reference in New Issue
Block a user