开发OTA备案工具-车辆升级
This commit is contained in:
+9
-5
@@ -25,6 +25,7 @@ import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.InputStream;
|
||||
import java.util.List;
|
||||
import java.util.Date;
|
||||
@@ -89,9 +90,9 @@ public class OtaBaCxAqcsServiceImpl extends ServiceImpl<OtaBaCxAqcsMapper, OtaBa
|
||||
if (ObjectUtils.isNotEmpty(otaBaCxAqcsOld) && StringUtils.isNotEmpty(otaBaCxAqcsOld.getZmcl())) {
|
||||
List<AttachmentEO> aeoList = JSONArray.parseArray(otaBaCxAqcsOld.getZmcl(), AttachmentEO.class);
|
||||
otaBaCxAqcsOld.setZmclList(aeoList);
|
||||
deleteById(otaBaCxAqcsOld.getId());
|
||||
}
|
||||
deleteById(otaBaCxAqcs.getId());
|
||||
deleteById(otaBaCxAqcsOld.getId());
|
||||
saveOrUpdate(otaBaCxAqcs);
|
||||
ComparisonUtil cu = new ComparisonUtil();
|
||||
if (ObjectUtils.isEmpty(otaBaCxAqcsOld)) {
|
||||
@@ -278,19 +279,20 @@ public class OtaBaCxAqcsServiceImpl extends ServiceImpl<OtaBaCxAqcsMapper, OtaBa
|
||||
|
||||
Row row = s.getRow(2);
|
||||
Cell cell = row.getCell(2);
|
||||
cell.setCellValue(sysDictService.queryDictItemByValue("protection_mechanism", aqcs.getBhjz(), cut));
|
||||
|
||||
cell.setCellValue(ComparisonUtil.queryDictTextByKey("protection_mechanism", aqcs.getBhjz(), sysDictService));
|
||||
|
||||
row = s.getRow(3);
|
||||
cell = row.getCell(2);
|
||||
cell.setCellValue(sysDictService.queryDictItemByValue("fail_safe_mechanism", aqcs.getFsxjz(), cut));
|
||||
cell.setCellValue(ComparisonUtil.queryDictTextByKey("fail_safe_mechanism", aqcs.getFsxjz(), sysDictService));
|
||||
|
||||
row = s.getRow(4);
|
||||
cell = row.getCell(2);
|
||||
cell.setCellValue(sysDictService.queryDictItemByValue("upgrade_failure", aqcs.getSjsbcs(), cut));
|
||||
cell.setCellValue(ComparisonUtil.queryDictTextByKey("upgrade_failure", aqcs.getSjsbcs(), sysDictService));
|
||||
|
||||
row = s.getRow(5);
|
||||
cell = row.getCell(2);
|
||||
cell.setCellValue(sysDictService.queryDictItemByValue("Information_security_mechanism", aqcs.getXxaqjz(), cut));
|
||||
cell.setCellValue(ComparisonUtil.queryDictTextByKey("Information_security_mechanism", aqcs.getXxaqjz(), sysDictService));
|
||||
|
||||
row = s.getRow(2);
|
||||
cell = row.getCell(3);
|
||||
@@ -313,6 +315,8 @@ public class OtaBaCxAqcsServiceImpl extends ServiceImpl<OtaBaCxAqcsMapper, OtaBa
|
||||
}
|
||||
}
|
||||
cell.setCellValue(sb.toString());
|
||||
wb.write(new FileOutputStream(file));
|
||||
wb.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-1
@@ -286,7 +286,8 @@ public class OtaBaCxJbxxServiceImpl extends ServiceImpl<OtaBaCxJbxxMapper, OtaBa
|
||||
cell.setCellValue(jbxx.getDllx2());
|
||||
row = s.getRow(10);
|
||||
cell = row.getCell(1);
|
||||
cell.setCellValue(sysDictService.queryDictTextByKey("communication_terminal", jbxx.getTxzd()));
|
||||
String str = jbxx.getTxzd();
|
||||
cell.setCellValue(ComparisonUtil.queryDictTextByKey("communication_terminal", str, sysDictService));
|
||||
row = s.getRow(11);
|
||||
cell = row.getCell(1);
|
||||
cell.setCellValue(jbxx.getCdotasj());
|
||||
|
||||
+3
@@ -29,6 +29,7 @@ import org.springframework.web.multipart.MultipartFile;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.*;
|
||||
|
||||
@@ -872,6 +873,8 @@ public class OtaBaCxJsfzbacsServiceImpl extends ServiceImpl<OtaBaCxJsfzbacsMappe
|
||||
cell.setCellValue(sjmk.getBzwz());
|
||||
startRow++;
|
||||
}
|
||||
wb.write(new FileOutputStream(file));
|
||||
wb.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+8
-3
@@ -29,6 +29,7 @@ import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.InputStream;
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.*;
|
||||
@@ -340,7 +341,8 @@ public class OtaBaCxKsjjsmccsServiceImpl extends ServiceImpl<OtaBaCxKsjjsmccsMap
|
||||
Workbook wb = ImportFileUtil.readExcel(file);
|
||||
Sheet s = wb.getSheetAt(0);
|
||||
int startRow = 3;
|
||||
for (OtaBaCxKsjjsmccs mccs : mccsList) {
|
||||
for (int i = 0; i < mccsList.size(); i++) {
|
||||
OtaBaCxKsjjsmccs mccs = mccsList.get(i);
|
||||
Row row = s.getRow(startRow);
|
||||
Cell cell = row.createCell(0);
|
||||
cell.setCellValue(mccs.getGnmc());
|
||||
@@ -370,11 +372,12 @@ public class OtaBaCxKsjjsmccsServiceImpl extends ServiceImpl<OtaBaCxKsjjsmccsMap
|
||||
cell.setCellValue(mccs.getCzxtbbh());
|
||||
cell = row.createCell(13);
|
||||
cell.setCellValue(mccs.getCsyzsj());
|
||||
startRow++;
|
||||
}
|
||||
Row row = s.getRow(startRow);
|
||||
Row row = s.createRow(startRow);
|
||||
Cell cell = row.createCell(0);
|
||||
cell.setCellValue("证明材料");
|
||||
cell = row.getCell(1);
|
||||
cell = row.createCell(1);
|
||||
OtaBaCxList otaBaCxList = otaBaCxListService.queryById(otaId);
|
||||
if (ObjectUtils.isNotEmpty(otaBaCxList)) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
@@ -396,5 +399,7 @@ public class OtaBaCxKsjjsmccsServiceImpl extends ServiceImpl<OtaBaCxKsjjsmccsMap
|
||||
cell.setCellValue(sb.toString());
|
||||
}
|
||||
}
|
||||
wb.write(new FileOutputStream(file));
|
||||
wb.close();
|
||||
}
|
||||
}
|
||||
|
||||
+4
-1
@@ -29,6 +29,7 @@ import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.InputStream;
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.*;
|
||||
@@ -471,7 +472,7 @@ public class OtaBaCxKsjxtmccsServiceImpl extends ServiceImpl<OtaBaCxKsjxtmccsMap
|
||||
}
|
||||
Cell cell = row.createCell(0);
|
||||
cell.setCellValue("证明材料");
|
||||
cell = row.getCell(1);
|
||||
cell = row.createCell(1);
|
||||
OtaBaCxList otaBaCxList = otaBaCxListService.queryById(otaId);
|
||||
if (ObjectUtils.isNotEmpty(otaBaCxList)) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
@@ -493,6 +494,8 @@ public class OtaBaCxKsjxtmccsServiceImpl extends ServiceImpl<OtaBaCxKsjxtmccsMap
|
||||
cell.setCellValue(sb.toString());
|
||||
}
|
||||
}
|
||||
wb.write(new FileOutputStream(file));
|
||||
wb.close();
|
||||
}
|
||||
|
||||
}
|
||||
+3
@@ -31,6 +31,7 @@ import org.springframework.web.multipart.MultipartFile;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.InputStream;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
@@ -332,6 +333,8 @@ public class OtaBaCxZxsjyqServiceImpl extends ServiceImpl<OtaBaCxZxsjyqMapper, O
|
||||
}
|
||||
}
|
||||
cell.setCellValue(sb.toString());
|
||||
wb.write(new FileOutputStream(file));
|
||||
wb.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+15
@@ -212,6 +212,21 @@ public class ComparisonUtil<T> {
|
||||
return resList;
|
||||
}
|
||||
|
||||
public static String queryDictTextByKey(String dictKey, String str, ISysDictService sysDictService) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
if (StringUtils.isNotEmpty(str)) {
|
||||
String[] strs = str.split(",");
|
||||
for (int i = 0; i < strs.length; i++) {
|
||||
if (i >= strs.length - 1) {
|
||||
sb.append(sysDictService.queryDictTextByKey(dictKey, strs[i]));
|
||||
} else {
|
||||
sb.append(sysDictService.queryDictTextByKey(dictKey, strs[i])).append(",");
|
||||
}
|
||||
}
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
private String parseDictText(OtaTitleEnum ote, Field field, T clazz, ISysDictService sysDictService) {
|
||||
String res = "空";
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user