开发OTA备案工具-车辆升级
This commit is contained in:
+4
-4
@@ -277,10 +277,10 @@ public class OtaBaSjGgnrfsServiceImpl extends ServiceImpl<OtaBaSjGgnrfsMapper, O
|
|||||||
cell.setCellValue(ComparisonUtil.queryDictTextByKey("user_notification_mode", fs.getGzyhfs(), sysDictService));
|
cell.setCellValue(ComparisonUtil.queryDictTextByKey("user_notification_mode", fs.getGzyhfs(), sysDictService));
|
||||||
|
|
||||||
String attStr = fs.getXgwj();
|
String attStr = fs.getXgwj();
|
||||||
List<AttachmentEO> attList = JSONArray.parseArray(attStr, AttachmentEO.class);
|
if(StringUtils.isNotEmpty(attStr)){
|
||||||
if (ObjectUtils.isNotEmpty(attList)) {
|
String[] strs = attStr.split(",");
|
||||||
for (AttachmentEO aeo : attList) {
|
for (String str : strs) {
|
||||||
List<OSSFile> ossFileList = ossFileService.getFileInfos(aeo.getId());
|
List<OSSFile> ossFileList = ossFileService.getFileInfos(str);
|
||||||
for (OSSFile ossFile : ossFileList) {
|
for (OSSFile ossFile : ossFileList) {
|
||||||
String filePath = ossFile.getUrl();
|
String filePath = ossFile.getUrl();
|
||||||
boolean b = CosBootUtil.doesObjectExist(filePath);
|
boolean b = CosBootUtil.doesObjectExist(filePath);
|
||||||
|
|||||||
+3
-3
@@ -187,7 +187,7 @@ public class OtaBaSjListServiceImpl extends ServiceImpl<OtaBaSjListMapper, OtaBa
|
|||||||
@Override
|
@Override
|
||||||
public void exportData(String otaId, HttpServletResponse response, HttpServletRequest request) throws Exception {
|
public void exportData(String otaId, HttpServletResponse response, HttpServletRequest request) throws Exception {
|
||||||
String cut = "cn";
|
String cut = "cn";
|
||||||
File template = new File(templatePath + "在线升级活动备案.zip");
|
File template = new File(templatePath + "在线升级活动备案导出.zip");
|
||||||
File exportFile = ImportFileUtil.copyZip(ImportFileUtil.createMfileByFile(template), cut, uploadPath);
|
File exportFile = ImportFileUtil.copyZip(ImportFileUtil.createMfileByFile(template), cut, uploadPath);
|
||||||
|
|
||||||
File sjmbcxFile = ImportFileUtil.findFile(exportFile, "升级目标车型.xlsx");
|
File sjmbcxFile = ImportFileUtil.findFile(exportFile, "升级目标车型.xlsx");
|
||||||
@@ -211,8 +211,8 @@ public class OtaBaSjListServiceImpl extends ServiceImpl<OtaBaSjListMapper, OtaBa
|
|||||||
otaBaSjSjfzbhService.exportData(sjfzbhFile, otaId, cut);
|
otaBaSjSjfzbhService.exportData(sjfzbhFile, otaId, cut);
|
||||||
|
|
||||||
File fsFile = ImportFileUtil.findFile(exportFile, "用户告知内容及方式.xlsx");
|
File fsFile = ImportFileUtil.findFile(exportFile, "用户告知内容及方式.xlsx");
|
||||||
File fsAttFile = ImportFileUtil.findFile(exportFile, "用户告知内容及方式");
|
File fsAttFile = ImportFileUtil.findFoder(exportFile, "用户告知内容及方式");
|
||||||
otaBaSjGgnrfsService.exportData(sjfzbhFile, fsAttFile, otaId, cut);
|
otaBaSjGgnrfsService.exportData(fsFile, fsAttFile, otaId, cut);
|
||||||
|
|
||||||
File qtFile = ImportFileUtil.findFile(exportFile, "其他升级任务信息.xlsx");
|
File qtFile = ImportFileUtil.findFile(exportFile, "其他升级任务信息.xlsx");
|
||||||
otaBaSjQtsjxxService.exportData(qtFile, otaId, cut);
|
otaBaSjQtsjxxService.exportData(qtFile, otaId, cut);
|
||||||
|
|||||||
+4
-4
@@ -292,10 +292,10 @@ public class OtaBaSjSjmbclServiceImpl extends ServiceImpl<OtaBaSjSjmbclMapper, O
|
|||||||
cell.setCellValue(cl.getVinList());
|
cell.setCellValue(cl.getVinList());
|
||||||
|
|
||||||
String attStr = cl.getCsv();
|
String attStr = cl.getCsv();
|
||||||
List<AttachmentEO> attList = JSONArray.parseArray(attStr, AttachmentEO.class);
|
if (StringUtils.isNotEmpty(attStr)) {
|
||||||
if (ObjectUtils.isNotEmpty(attList)) {
|
String[] strs = attStr.split(",");
|
||||||
for (AttachmentEO aeo : attList) {
|
for (String str : strs) {
|
||||||
List<OSSFile> ossFileList = ossFileService.getFileInfos(aeo.getId());
|
List<OSSFile> ossFileList = ossFileService.getFileInfos(str);
|
||||||
for (OSSFile ossFile : ossFileList) {
|
for (OSSFile ossFile : ossFileList) {
|
||||||
String filePath = ossFile.getUrl();
|
String filePath = ossFile.getUrl();
|
||||||
boolean b = CosBootUtil.doesObjectExist(filePath);
|
boolean b = CosBootUtil.doesObjectExist(filePath);
|
||||||
|
|||||||
+27
-33
@@ -291,7 +291,7 @@ public class OtaBaSjSjyxpgServiceImpl extends ServiceImpl<OtaBaSjSjyxpgMapper, O
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void exportData(File file, File attFile1, File attFile2,String otaId, String cut) throws Exception {
|
public void exportData(File file, File attFile1, File attFile2, String otaId, String cut) throws Exception {
|
||||||
OtaBaSjSjyxpg pg = this.getByOtaId(otaId);
|
OtaBaSjSjyxpg pg = this.getByOtaId(otaId);
|
||||||
if (ObjectUtils.isNotEmpty(pg)) {
|
if (ObjectUtils.isNotEmpty(pg)) {
|
||||||
Workbook wb = ImportFileUtil.readExcel(file);
|
Workbook wb = ImportFileUtil.readExcel(file);
|
||||||
@@ -329,46 +329,40 @@ public class OtaBaSjSjyxpgServiceImpl extends ServiceImpl<OtaBaSjSjyxpgMapper, O
|
|||||||
row = s.getRow(10);
|
row = s.getRow(10);
|
||||||
cell = row.getCell(1);
|
cell = row.getCell(1);
|
||||||
cell.setCellValue(ComparisonUtil.queryDictTextByKey("package_test", pg.getSjbcs(), sysDictService));
|
cell.setCellValue(ComparisonUtil.queryDictTextByKey("package_test", pg.getSjbcs(), sysDictService));
|
||||||
row = s.getRow(9);
|
row = s.getRow(11);
|
||||||
cell = row.getCell(1);
|
cell = row.getCell(1);
|
||||||
cell.setCellValue(ImportFileUtil.getCellValueYesOrNoInt(pg.getAqkkx()));
|
cell.setCellValue(ImportFileUtil.getCellValueYesOrNoInt(pg.getAqkkx()));
|
||||||
|
|
||||||
|
|
||||||
String attStr = pg.getBgfj();
|
|
||||||
if(StringUtils.isNotEmpty(attStr)){
|
|
||||||
List<AttachmentEO> attList = JSONArray.parseArray(attStr, AttachmentEO.class);
|
|
||||||
if (ObjectUtils.isNotEmpty(attList)) {
|
|
||||||
for (AttachmentEO aeo : attList) {
|
|
||||||
List<OSSFile> ossFileList = ossFileService.getFileInfos(aeo.getId());
|
|
||||||
for (OSSFile ossFile : ossFileList) {
|
|
||||||
String filePath = ossFile.getUrl();
|
|
||||||
boolean b = CosBootUtil.doesObjectExist(filePath);
|
|
||||||
if (b) {
|
|
||||||
InputStream download = CosBootUtil.download(filePath);
|
|
||||||
ImportFileUtil.writeToLocal(attFile1.getCanonicalPath() + "/" + ossFile.getFileName(), download);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
String attStr1 = pg.getBgfj();
|
String attStr1 = pg.getBgfj();
|
||||||
if(StringUtils.isNotEmpty(attStr1)){
|
if (StringUtils.isNotEmpty(attStr1)) {
|
||||||
List<AttachmentEO> attList = JSONArray.parseArray(attStr1, AttachmentEO.class);
|
String[] strs = attStr1.split(",");
|
||||||
if (ObjectUtils.isNotEmpty(attList)) {
|
for (String str : strs) {
|
||||||
for (AttachmentEO aeo : attList) {
|
List<OSSFile> ossFileList = ossFileService.getFileInfos(str);
|
||||||
List<OSSFile> ossFileList = ossFileService.getFileInfos(aeo.getId());
|
for (OSSFile ossFile : ossFileList) {
|
||||||
for (OSSFile ossFile : ossFileList) {
|
String filePath = ossFile.getUrl();
|
||||||
String filePath = ossFile.getUrl();
|
boolean b = CosBootUtil.doesObjectExist(filePath);
|
||||||
boolean b = CosBootUtil.doesObjectExist(filePath);
|
if (b) {
|
||||||
if (b) {
|
InputStream download = CosBootUtil.download(filePath);
|
||||||
InputStream download = CosBootUtil.download(filePath);
|
ImportFileUtil.writeToLocal(attFile1.getCanonicalPath() + "/" + ossFile.getFileName(), download);
|
||||||
ImportFileUtil.writeToLocal(attFile2.getCanonicalPath() + "/" + ossFile.getFileName(), download);
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
String attStr2 = pg.getBgfj();
|
||||||
|
if (StringUtils.isNotEmpty(attStr2)) {
|
||||||
|
String[] strs = attStr2.split(",");
|
||||||
|
for (String str : strs) {
|
||||||
|
List<OSSFile> ossFileList = ossFileService.getFileInfos(str);
|
||||||
|
for (OSSFile ossFile : ossFileList) {
|
||||||
|
String filePath = ossFile.getUrl();
|
||||||
|
boolean b = CosBootUtil.doesObjectExist(filePath);
|
||||||
|
if (b) {
|
||||||
|
InputStream download = CosBootUtil.download(filePath);
|
||||||
|
ImportFileUtil.writeToLocal(attFile2.getCanonicalPath() + "/" + ossFile.getFileName(), download);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
wb.write(new FileOutputStream(file));
|
wb.write(new FileOutputStream(file));
|
||||||
wb.close();
|
wb.close();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user