开发OTA备案工具-车辆升级
This commit is contained in:
+2
-2
@@ -40,8 +40,8 @@ public enum OtaTitleEnum {
|
||||
|
||||
XTLB("xtlb", "系统类别", "0"),
|
||||
SFKSJ("sfksj", "是否可升级", "2"),
|
||||
SJBGCS("sjbgcs", "升级变更技术参数", "0"),
|
||||
TPT("tpt", "系统电子控制器架构拓扑图", "0"),
|
||||
SJBGCS("sjbgcs", "升级可能变更的《公告》技术参数(如有)", "0"),
|
||||
//TPT("tpt", "系统-电子控制器架构拓扑图(附件需含拓扑图介绍)", "0"),
|
||||
KZQMC("kzqmc", "电子控制器名称", "0"),
|
||||
AQWZXDJ("aqwzxdj", "安全完整性等级", "0"),
|
||||
KZQSCQY("kzqscqy", "电子控制器生产企业", "0"),
|
||||
|
||||
+76
-18
@@ -32,6 +32,8 @@ import java.io.File;
|
||||
import java.io.InputStream;
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
@@ -108,27 +110,83 @@ public class OtaBaCxKsjxtmccsServiceImpl extends ServiceImpl<OtaBaCxKsjxtmccsMap
|
||||
List<OtaBaCxTxjl> reList = cu.comparisonListRecord(otaId, OtaModuleEnum.CX_KSJDXTMCYCS, OtaTitleEnum.XTLB.getName(), oldList, newList, sysDictService);
|
||||
saveOrUpdateBatch(newList);
|
||||
|
||||
|
||||
for (OtaBaCxKsjxtmccs newMccs:newList) {
|
||||
String newTpt = newMccs.getTpt();
|
||||
if(StringUtils.isNotEmpty(newTpt)){
|
||||
|
||||
|
||||
Map<String, OtaBaCxKsjxtmccs> newMap = newList.stream().collect(Collectors.toMap(OtaBaCxKsjxtmccs::getId, Function.identity()));
|
||||
Map<String, OtaBaCxKsjxtmccs> oldMap = oldList.stream().collect(Collectors.toMap(OtaBaCxKsjxtmccs::getId, Function.identity()));
|
||||
for (String nId : newMap.keySet()) {
|
||||
if (oldMap.containsKey(nId)) {
|
||||
String newTptStr = newMap.get(nId).getTpt();
|
||||
if (StringUtils.isNotEmpty(newTptStr)) {
|
||||
String[] newTpts = newTptStr.split(",");
|
||||
String oldTptStr = oldMap.get(nId).getTpt();
|
||||
for (String nt : newTpts) {
|
||||
if (StringUtils.isEmpty(oldTptStr) || !oldTptStr.contains(nt)) {
|
||||
List<OSSFile> fileList = ossFileService.getFileInfos(nt);
|
||||
if (ObjectUtils.isNotEmpty(fileList)) {
|
||||
for (OSSFile f : fileList) {
|
||||
reList.add(cu.addAttRecord(otaId, OtaModuleEnum.CX_KSJDXTMCYCS, newMap.get(nId).getXtlb() + "-系统-电子控制器架构拓扑图(附件需含拓扑图介绍)", f.getFileName()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (String oId : oldMap.keySet()) {
|
||||
if (newMap.containsKey(oId)) {
|
||||
String oldTptStr = oldMap.get(oId).getTpt();
|
||||
if (StringUtils.isNotEmpty(oldTptStr)) {
|
||||
String[] oldTpts = oldTptStr.split(",");
|
||||
String newTptStr = newMap.get(oId).getTpt();
|
||||
for (String ot : oldTpts) {
|
||||
if (StringUtils.isEmpty(newTptStr) || !newTptStr.contains(ot)) {
|
||||
List<OSSFile> fileList = ossFileService.getFileInfos(ot);
|
||||
if (ObjectUtils.isNotEmpty(fileList)) {
|
||||
for (OSSFile f : fileList) {
|
||||
reList.add(cu.delAttRecord(otaId, OtaModuleEnum.CX_KSJDXTMCYCS, oldMap.get(oId).getXtlb() + "-系统-电子控制器架构拓扑图(附件需含拓扑图介绍)", f.getFileName()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
String fj = (String) json.get("fj");
|
||||
OtaBaCxList otaBaCxList = otaBaCxListService.queryById(otaId);
|
||||
String oldFjStr = otaBaCxList.getZxsjxtfj();
|
||||
otaBaCxList.setZxsjxtfj(fj);
|
||||
otaBaCxListService.editById(otaBaCxList);
|
||||
String[] newFjList = {};
|
||||
if (StringUtils.isNotEmpty(fj)) {
|
||||
newFjList = fj.split(",");
|
||||
}
|
||||
for (String nf : newFjList) {
|
||||
if (StringUtils.isEmpty(oldFjStr) || !oldFjStr.contains(nf)) {
|
||||
List<OSSFile> fileList = ossFileService.getFileInfos(nf);
|
||||
if (ObjectUtils.isNotEmpty(fileList)) {
|
||||
for (OSSFile f : fileList) {
|
||||
reList.add(cu.addAttRecord(otaId, OtaModuleEnum.CX_KSJDXTMCYCS, "附件", f.getFileName()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
String[] oldFjList = {};
|
||||
if (StringUtils.isNotEmpty(oldFjStr)) {
|
||||
oldFjList = oldFjStr.split(",");
|
||||
}
|
||||
for (String of : oldFjList) {
|
||||
if (StringUtils.isEmpty(fj) || !fj.contains(of)) {
|
||||
List<OSSFile> fileList = ossFileService.getFileInfos(of);
|
||||
if (ObjectUtils.isNotEmpty(fileList)) {
|
||||
for (OSSFile f : fileList) {
|
||||
reList.add(cu.delAttRecord(otaId, OtaModuleEnum.CX_KSJDXTMCYCS, "附件", f.getFileName()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
otaBaCxTxjlService.saveBatch(reList);
|
||||
String fj = (String) json.get("fj");
|
||||
if (StringUtils.isNotEmpty(fj)) {
|
||||
OtaBaCxList otaBaCxList = otaBaCxListService.queryById(otaId);
|
||||
if (ObjectUtils.isNotEmpty(otaBaCxList)) {
|
||||
otaBaCxList.setZxsjxtfj(fj);
|
||||
otaBaCxListService.editById(otaBaCxList);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -203,7 +261,7 @@ public class OtaBaCxKsjxtmccsServiceImpl extends ServiceImpl<OtaBaCxKsjxtmccsMap
|
||||
}
|
||||
|
||||
private List<OtaBaCxKsjxtmccs> getByOtaId(String otaId) {
|
||||
if(org.apache.commons.lang3.StringUtils.isEmpty(otaId)){
|
||||
if (org.apache.commons.lang3.StringUtils.isEmpty(otaId)) {
|
||||
return null;
|
||||
}
|
||||
LambdaQueryWrapper<OtaBaCxKsjxtmccs> queryWrapper = new LambdaQueryWrapper<>();
|
||||
@@ -381,7 +439,7 @@ public class OtaBaCxKsjxtmccsServiceImpl extends ServiceImpl<OtaBaCxKsjxtmccsMap
|
||||
startRow++;
|
||||
}
|
||||
Row row = s.getRow(startRow);
|
||||
if(null == row){
|
||||
if (null == row) {
|
||||
row = s.createRow(startRow);
|
||||
}
|
||||
Cell cell = row.createCell(0);
|
||||
|
||||
Reference in New Issue
Block a user