Merge remote-tracking branch 'origin/dev_2nd_LCYH' into dev_2nd_LCYH

This commit is contained in:
wangzhijiang
2023-04-03 14:10:36 +08:00
5 changed files with 40 additions and 19 deletions
@@ -183,7 +183,7 @@ public enum OtaTitleEnum {
CSRJSJ("csrjsj", "初始软件包的完整性数据", "0", "", 500), CSRJSJ("csrjsj", "初始软件包的完整性数据", "0", "", 500),
SJBYZSJ("sjbyzsj", "升级包完整性验证数据", "0", "", 500), SJBYZSJ("sjbyzsj", "升级包完整性验证数据", "0", "", 500),
SJBDX("sjbdx", "升级包大小", "0", "", 50), SJBDX("sjbdx", "升级包大小", "0", "", 50),
SFCFSJ("sfcfsj", "是否差分升级", "0", "", 50), SFCFSJ("sfcfsj", "是否差分升级", "2", "", 0),
SJMDLX("sjmdlx", "升级目的类型", "0", "", 50), SJMDLX("sjmdlx", "升级目的类型", "0", "", 50),
GNBGMS("gnbgms", "功能变更描述", "0", "", 500), GNBGMS("gnbgms", "功能变更描述", "0", "", 500),
SYTJBG("sytjbg", "适用条件变更", "0", "", 500), SYTJBG("sytjbg", "适用条件变更", "0", "", 500),
@@ -74,6 +74,9 @@ public class OtaBaSjSjxtbhServiceImpl extends ServiceImpl<OtaBaSjSjxtbhMapper, O
String otaId = (String) json.get("otaId"); String otaId = (String) json.get("otaId");
if (StringUtils.isNotEmpty(otaId)) { if (StringUtils.isNotEmpty(otaId)) {
oldList = getByOtaId(otaId); oldList = getByOtaId(otaId);
if (ObjectUtils.isEmpty(oldList)) {
oldList = setDefault(otaId);
}
deleteByOtaId(otaId); deleteByOtaId(otaId);
JSONArray list = json.getJSONArray("list"); JSONArray list = json.getJSONArray("list");
if (null != list) { if (null != list) {
@@ -111,6 +114,19 @@ public class OtaBaSjSjxtbhServiceImpl extends ServiceImpl<OtaBaSjSjxtbhMapper, O
} }
} }
public List<OtaBaSjSjxtbh> setDefault(String otaId) {
List<OtaBaSjSjxtbh> list = this.getByOtaId(otaId);
Date now = new Date();
OtaBaSjSjxtbh bh = new OtaBaSjSjxtbh();
bh.setOtaId(otaId);
bh.setSjkzqmc("ADC ADAS主控制器");
bh.setCreateTime(now);
bh.setId(UUID.randomUUID().toString().replace("-", ""));
list.add(bh);
saveBatch(list);
return list;
}
public void deleteByOtaId(String otaId) { public void deleteByOtaId(String otaId) {
List<OtaBaSjSjxtbh> list = this.getByOtaId(otaId); List<OtaBaSjSjxtbh> list = this.getByOtaId(otaId);
List<String> ids = new ArrayList<>(); List<String> ids = new ArrayList<>();
@@ -183,6 +199,9 @@ public class OtaBaSjSjxtbhServiceImpl extends ServiceImpl<OtaBaSjSjxtbhMapper, O
if (ObjectUtil.isEmpty(res)) { if (ObjectUtil.isEmpty(res)) {
res = getByOtaId(otaIdT); res = getByOtaId(otaIdT);
} }
if (ObjectUtils.isEmpty(res)) {
res = setDefault(otaId);
}
JSONObject json = new JSONObject(); JSONObject json = new JSONObject();
json.put("list", res); json.put("list", res);
@@ -204,13 +223,13 @@ public class OtaBaSjSjxtbhServiceImpl extends ServiceImpl<OtaBaSjSjxtbhMapper, O
} }
@Override @Override
public void importData(MultipartFile file, String otaId, String cut, StringBuilder errMsg) throws Exception{ public void importData(MultipartFile file, String otaId, String cut, StringBuilder errMsg) throws Exception {
List<File> upLoadFiles = ImportFileUtil.importZip(file, cut, uploadPath); List<File> upLoadFiles = ImportFileUtil.importZip(file, cut, uploadPath);
parseFileList(upLoadFiles, otaId, cut,errMsg); parseFileList(upLoadFiles, otaId, cut, errMsg);
} }
@Override @Override
public void parseFileList(List<File> upLoadFiles, String otaId, String cut, StringBuilder errMsg) throws Exception{ public void parseFileList(List<File> upLoadFiles, String otaId, String cut, StringBuilder errMsg) throws Exception {
File upFile = null; File upFile = null;
for (File f : upLoadFiles) { for (File f : upLoadFiles) {
if (f.getName().equals("本次升级的系统名称与变更参数.xlsx")) { if (f.getName().equals("本次升级的系统名称与变更参数.xlsx")) {
@@ -221,7 +240,7 @@ public class OtaBaSjSjxtbhServiceImpl extends ServiceImpl<OtaBaSjSjxtbhMapper, O
throw new JeroBootException("请上传正确的文件"); throw new JeroBootException("请上传正确的文件");
} }
List<OtaBaSjSjxtbh> newList = parseFile(upFile, otaId, cut,errMsg); List<OtaBaSjSjxtbh> newList = parseFile(upFile, otaId, cut, errMsg);
List<OtaBaSjSjxtbh> oldList = getByOtaId(otaId); List<OtaBaSjSjxtbh> oldList = getByOtaId(otaId);
if (ObjectUtils.isEmpty(oldList)) { if (ObjectUtils.isEmpty(oldList)) {
oldList = new ArrayList<>(); oldList = new ArrayList<>();
@@ -233,7 +252,7 @@ public class OtaBaSjSjxtbhServiceImpl extends ServiceImpl<OtaBaSjSjxtbhMapper, O
otaBaCxTxjlService.saveBatch(reList); otaBaCxTxjlService.saveBatch(reList);
} }
private List<OtaBaSjSjxtbh> parseFile(File upFile, String otaId, String cut, StringBuilder errMsg) throws Exception{ private List<OtaBaSjSjxtbh> parseFile(File upFile, String otaId, String cut, StringBuilder errMsg) throws Exception {
Date now = new Date(); Date now = new Date();
List<OtaBaSjSjxtbh> list = new ArrayList<>(); List<OtaBaSjSjxtbh> list = new ArrayList<>();
Workbook wb = ImportFileUtil.readExcel(upFile); Workbook wb = ImportFileUtil.readExcel(upFile);
@@ -270,7 +289,7 @@ public class OtaBaSjSjxtbhServiceImpl extends ServiceImpl<OtaBaSjSjxtbhMapper, O
cell = row.getCell(9); cell = row.getCell(9);
xtbh.setSjbdx(ImportFileUtil.getCellValue(cell, wb)); xtbh.setSjbdx(ImportFileUtil.getCellValue(cell, wb));
cell = row.getCell(10); cell = row.getCell(10);
xtbh.setSfcfsj(ImportFileUtil.getCellValue(cell, wb)); xtbh.setSfcfsj(ImportFileUtil.getCellValueYesOrNo(cell, wb));
ComparisonUtil cu = new ComparisonUtil(); ComparisonUtil cu = new ComparisonUtil();
cu.checkError(xtbh, errMsg, sysDictService, cut); cu.checkError(xtbh, errMsg, sysDictService, cut);
if (xtbh.isNull()) { if (xtbh.isNull()) {
@@ -319,7 +338,7 @@ public class OtaBaSjSjxtbhServiceImpl extends ServiceImpl<OtaBaSjSjxtbhMapper, O
cell = row.createCell(10); cell = row.createCell(10);
cell.setCellValue(bh.getSjbdx()); cell.setCellValue(bh.getSjbdx());
cell = row.createCell(11); cell = row.createCell(11);
cell.setCellValue(bh.getSfcfsj()); cell.setCellValue(ImportFileUtil.getCellValueYesOrNo(bh.getSfcfsj()));
start++; start++;
} }
wb.write(new FileOutputStream(file)); wb.write(new FileOutputStream(file));
@@ -160,8 +160,8 @@ public class OtaBaSjSjyxpgServiceImpl extends ServiceImpl<OtaBaSjSjyxpgMapper, O
Date now = new Date(); Date now = new Date();
OtaBaSjSjyxpg res = new OtaBaSjSjyxpg(); OtaBaSjSjyxpg res = new OtaBaSjSjyxpg();
res.setOtaId(otaId); res.setOtaId(otaId);
res.setFhgd(2); res.setFhgd(1);
res.setZdjsxg(1); res.setZdjsxg(2);
res.setZxsj(2); res.setZxsj(2);
res.setAqjz("2"); res.setAqjz("2");
res.setSfyxaq(2); res.setSfyxaq(2);
+3 -3
View File
@@ -385,7 +385,7 @@
ellipsis: true, ellipsis: true,
dataIndex: 'fileName', dataIndex: 'fileName',
scopedSlots: { customRender: 'fileName' }, scopedSlots: { customRender: 'fileName' },
width: 200 width: 270
}, },
{ {
title: this.$t('fileDeclaration'), title: this.$t('fileDeclaration'),
@@ -393,7 +393,7 @@
ellipsis: true, ellipsis: true,
dataIndex: 'fileDescription', dataIndex: 'fileDescription',
scopedSlots: { customRender: 'projectName' }, scopedSlots: { customRender: 'projectName' },
width: 300 width: 390
}, },
{ {
title: this.$t('uploadedBy'), title: this.$t('uploadedBy'),
@@ -412,7 +412,7 @@
align: 'left', align: 'left',
ellipsis: true, ellipsis: true,
dataIndex: 'createTime', dataIndex: 'createTime',
width: 250 width: 245
}, },
{ {
title: this.$t('operation'), title: this.$t('operation'),
+8 -6
View File
@@ -41,6 +41,7 @@
size="middle" size="middle"
rowKey="id" rowKey="id"
:columns="columns" :columns="columns"
:components="drag(columns,'columns')"
:dataSource="dataSource" :dataSource="dataSource"
:pagination="ipagination" :pagination="ipagination"
:loading="loading" :loading="loading"
@@ -61,10 +62,11 @@
import DataLogModal from './modules/DataLogModal' import DataLogModal from './modules/DataLogModal'
import {JeroListMixin} from '@/mixins/JeroListMixin' import {JeroListMixin} from '@/mixins/JeroListMixin'
import JEllipsis from "@/components/jero/JEllipsis"; import JEllipsis from "@/components/jero/JEllipsis";
import { ResizeHeader, ResizeColumnProvide } from '@/mixins/header'
export default { export default {
name: 'DataLogList', name: 'DataLogList',
mixins: [JeroListMixin], mixins: [JeroListMixin, ResizeHeader, ResizeColumnProvide],
components: { components: {
JEllipsis, JEllipsis,
DataLogModal DataLogModal
@@ -76,28 +78,28 @@
columns: [ columns: [
{ {
title: this.$t('tableName'), title: this.$t('tableName'),
align: 'center', align: 'left',
dataIndex: 'dataTable', dataIndex: 'dataTable',
width: "120" width: "120"
}, { }, {
title: this.$t('DataID'), title: this.$t('DataID'),
align: 'center', align: 'left',
dataIndex: 'dataId', dataIndex: 'dataId',
width: "120" width: "120"
}, { }, {
title: this.$t('VersionNumber'), title: this.$t('VersionNumber'),
align: 'center', align: 'left',
dataIndex: 'dataVersion', dataIndex: 'dataVersion',
width: "50" width: "50"
}, { }, {
title: this.$t('DataContent'), title: this.$t('DataContent'),
align: 'center', align: 'left',
dataIndex: 'dataContent', dataIndex: 'dataContent',
width: "150", width: "150",
scopedSlots: {customRender: 'dataContent'}, scopedSlots: {customRender: 'dataContent'},
}, { }, {
title: this.$t('creator'), title: this.$t('creator'),
align: 'center', align: 'left',
dataIndex: 'createBy', dataIndex: 'createBy',
width: "100" width: "100"
}, },