开发OTA备案工具-车辆升级

This commit is contained in:
高嵩
2023-03-29 19:51:55 +08:00
parent 31dd9677a1
commit ec6bb00c62
3 changed files with 36 additions and 9 deletions
@@ -106,7 +106,7 @@ public class OtaBaCxAqcsServiceImpl extends ServiceImpl<OtaBaCxAqcsMapper, OtaBa
}
for (String oId : oldAttMap.keySet()) {
if (!newAttMap.containsKey(oId)) {
reList.add(cu.delAttRecord(otaBaCxAqcs.getOtaId(), OtaModuleEnum.CX_AQCS, "证明材料", newAttMap.get(oId)));
reList.add(cu.delAttRecord(otaBaCxAqcs.getOtaId(), OtaModuleEnum.CX_AQCS, "证明材料", oldAttMap.get(oId)));
}
}
otaBaCxTxjlService.saveBatch(reList);
@@ -18,7 +18,7 @@ import com.jero.modules.ota.service.IOtaBaCxTxjlService;
import com.jero.modules.ota.utils.ComparisonUtil;
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.StringUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
@@ -111,15 +111,42 @@ public class OtaBaCxKsjjsmccsServiceImpl extends ServiceImpl<OtaBaCxKsjjsmccsMap
ComparisonUtil cu = new ComparisonUtil();
List<OtaBaCxTxjl> reList = cu.comparisonListRecord(otaId, OtaModuleEnum.CX_KZXSJDJSFZGNMCYCS, OtaTitleEnum.GNMC.getName(), oldList, newList, sysDictService);
saveOrUpdateBatch(newList);
otaBaCxTxjlService.saveBatch(reList);
String fj = (String) json.get("fj");
OtaBaCxList otaBaCxList = otaBaCxListService.queryById(otaId);
String oldFjStr = otaBaCxList.getZxsjjsfj();
otaBaCxList.setZxsjjsfj(fj);
otaBaCxListService.editById(otaBaCxList);
String[] newFjList = {};
if (StringUtils.isNotEmpty(fj)) {
OtaBaCxList otaBaCxList = otaBaCxListService.queryById(otaId);
if (ObjectUtils.isNotEmpty(otaBaCxList)) {
otaBaCxList.setZxsjjsfj(fj);
otaBaCxListService.editById(otaBaCxList);
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_KZXSJDJSFZGNMCYCS, "附件", 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_KZXSJDJSFZGNMCYCS, "附件", f.getFileName()));
}
}
}
}
otaBaCxTxjlService.saveBatch(reList);
}
}
@@ -195,7 +222,7 @@ public class OtaBaCxKsjjsmccsServiceImpl extends ServiceImpl<OtaBaCxKsjjsmccsMap
}
private List<OtaBaCxKsjjsmccs> getByOtaId(String otaId) {
if(org.apache.commons.lang3.StringUtils.isEmpty(otaId)){
if (StringUtils.isEmpty(otaId)) {
return null;
}
LambdaQueryWrapper<OtaBaCxKsjjsmccs> queryWrapper = new LambdaQueryWrapper<>();
@@ -111,7 +111,7 @@ public class OtaBaCxZxsjyqServiceImpl extends ServiceImpl<OtaBaCxZxsjyqMapper, O
}
for (String oId : oldAttMap.keySet()) {
if (!newAttMap.containsKey(oId)) {
reList.add(cu.delAttRecord(otaBaCxZxsjyq.getOtaId(), OtaModuleEnum.CX_ZXSJYQ, "证明材料", newAttMap.get(oId)));
reList.add(cu.delAttRecord(otaBaCxZxsjyq.getOtaId(), OtaModuleEnum.CX_ZXSJYQ, "证明材料", oldAttMap.get(oId)));
}
}
otaBaCxTxjlService.saveBatch(reList);