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

This commit is contained in:
高嵩
2023-03-29 20:45:00 +08:00
parent e9c29074ba
commit 9457c81e13
4 changed files with 21 additions and 48 deletions
@@ -197,7 +197,7 @@ public enum OtaTitleEnum {
GZBG("gzbg", "告知实施的变更", "0"),
GZSCNR("gzscnr", "告知了对用户手册的全部更新内容", "0"),
GZYHFS("gzyhfs", "告知用户方式(可多选)", "0"),
XGWJ("xgwj", "用户告知相关文件", "0"),
// XGWJ("xgwj", "用户告知相关文件", "0"),
RWMC("rwmc", "任务名称", "0"),
SJFBSJ("sjfbsj", "升级发布时间", "0"),
SJJZSJ("sjjzsj", "升级计划截止时间", "0");
@@ -116,36 +116,7 @@ public class OtaBaCxKsjjsmccsServiceImpl extends ServiceImpl<OtaBaCxKsjjsmccsMap
String oldFjStr = otaBaCxList.getZxsjjsfj();
otaBaCxList.setZxsjjsfj(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_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()));
}
}
}
}
reList.addAll(cu.comparisonRecord(otaId, fj, oldFjStr, OtaModuleEnum.CX_KZXSJDJSFZGNMCYCS, "附件", ossFileService));
otaBaCxTxjlService.saveBatch(reList);
}
}
@@ -1,10 +1,9 @@
package com.jero.modules.ota.service.impl;
import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jero.common.exception.JeroBootException;
import com.jero.modules.ota.entity.AttachmentEO;
import com.jero.modules.ota.entity.OtaBaCxAqcs;
import com.jero.modules.oss.service.IOSSFileService;
import com.jero.modules.ota.entity.OtaBaCxTxjl;
import com.jero.modules.ota.entity.OtaBaSjGgnrfs;
import com.jero.modules.ota.enums.OtaModuleEnum;
@@ -18,16 +17,13 @@ import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.io.File;
import java.util.List;
import java.util.Date;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.util.Date;
import java.util.List;
/**
* @Description: 升级备案-用户告知内容及方式
@@ -50,6 +46,9 @@ public class OtaBaSjGgnrfsServiceImpl extends ServiceImpl<OtaBaSjGgnrfsMapper, O
@Autowired
private ISysDictService sysDictService;
@Autowired
private IOSSFileService ossFileService;
/**
* 保存
*
@@ -61,8 +60,10 @@ public class OtaBaSjGgnrfsServiceImpl extends ServiceImpl<OtaBaSjGgnrfsMapper, O
Date now = new Date();
if (null != otaBaSjGgnrfs) {
OtaBaSjGgnrfs otaBaSjGgnrfsOld = this.getByOtaId(otaBaSjGgnrfs.getOtaId());
String oldFjStr = "";
if (null != otaBaSjGgnrfsOld) {
otaBaSjGgnrfs.setId(otaBaSjGgnrfsOld.getId());
oldFjStr = otaBaSjGgnrfsOld.getXgwj();
} else {
otaBaSjGgnrfs.setCreateTime(now);
}
@@ -73,6 +74,8 @@ public class OtaBaSjGgnrfsServiceImpl extends ServiceImpl<OtaBaSjGgnrfsMapper, O
otaBaSjGgnrfsOld = new OtaBaSjGgnrfs();
}
List<OtaBaCxTxjl> reList = cu.comparisonRecord(otaBaSjGgnrfs.getOtaId(), OtaModuleEnum.SJ_YHGZNRFS, otaBaSjGgnrfsOld, otaBaSjGgnrfs, sysDictService);
reList.addAll(cu.comparisonRecord(otaBaSjGgnrfs.getOtaId(), otaBaSjGgnrfs.getXgwj(), oldFjStr, OtaModuleEnum.SJ_YHGZNRFS, "附件", ossFileService));
otaBaCxTxjlService.saveBatch(reList);
}
}
@@ -107,15 +107,14 @@ public class OtaBaSjSjfzbhServiceImpl extends ServiceImpl<OtaBaSjSjfzbhMapper, O
ComparisonUtil cu = new ComparisonUtil();
List<OtaBaCxTxjl> reList = cu.comparisonListRecord(otaId, OtaModuleEnum.SJ_SJJSMCBH, OtaTitleEnum.GNMC.getName(), oldList, newList, sysDictService);
saveOrUpdateBatch(newList);
otaBaCxTxjlService.saveBatch(reList);
String fj = (String) json.get("fj");
if (StringUtils.isNotEmpty(fj)) {
OtaBaSjList otaBaSjList = otaBaSjListService.queryById(otaId);
if (ObjectUtils.isNotEmpty(otaBaSjList)) {
otaBaSjList.setSjjsfj(fj);
otaBaSjListService.editById(otaBaSjList);
}
}
OtaBaSjList otaBaSjList = otaBaSjListService.queryById(otaId);
String oldFjStr = otaBaSjList.getSjjsfj();
otaBaSjList.setSjjsfj(fj);
otaBaSjListService.editById(otaBaSjList);
reList.addAll(cu.comparisonRecord(otaId, fj, oldFjStr, OtaModuleEnum.SJ_SJJSMCBH, "附件", ossFileService));
otaBaCxTxjlService.saveBatch(reList);
}
}