开发OTA备案工具-导入导出

This commit is contained in:
高嵩
2023-03-27 11:40:16 +08:00
parent d57248b15b
commit dc92697f3e
@@ -38,7 +38,7 @@ public class ComparisonUtil<T> {
String newStr = parseDictText(ote, field, newClazz, sysDictService); String newStr = parseDictText(ote, field, newClazz, sysDictService);
String oldStr = parseDictText(ote, field, oldClazz, sysDictService); String oldStr = parseDictText(ote, field, oldClazz, sysDictService);
if (!newStr.equals(oldStr)) { if (!newStr.equals(oldStr)) {
String content = "" + title + "" + oldStr + "改为" + newStr; String content = "" + title + "'" + oldStr + "'改为'" + newStr + "'";
resList.add(new OtaBaCxTxjl(otaId, otaModuleEnum.getName(), content)); resList.add(new OtaBaCxTxjl(otaId, otaModuleEnum.getName(), content));
} }
} }
@@ -56,7 +56,7 @@ public class ComparisonUtil<T> {
if (ObjectUtils.isEmpty(id)) { if (ObjectUtils.isEmpty(id)) {
Field tableField = newObj.getClass().getDeclaredField(tableTitle); Field tableField = newObj.getClass().getDeclaredField(tableTitle);
tableField.setAccessible(true); tableField.setAccessible(true);
String content = "新增了一条" + tableField.get(newObj).toString(); String content = "新增了一条'" + tableField.get(newObj).toString() + "'";
resList.add(new OtaBaCxTxjl(otaId, otaModuleEnum.getName(), content)); resList.add(new OtaBaCxTxjl(otaId, otaModuleEnum.getName(), content));
Field[] fields = newObj.getClass().getDeclaredFields(); Field[] fields = newObj.getClass().getDeclaredFields();
for (Field field : fields) { for (Field field : fields) {
@@ -68,12 +68,12 @@ public class ComparisonUtil<T> {
title = ote.getValue(); title = ote.getValue();
field.setAccessible(true); field.setAccessible(true);
Object newVal = field.get(newObj); Object newVal = field.get(newObj);
String newStr = ""; String newStr = "";
if (ObjectUtils.isNotEmpty(newVal)) { if (ObjectUtils.isNotEmpty(newVal)) {
newStr = newVal.toString(); newStr = newVal.toString();
content = tableField.get(newObj).toString() + "-" + title + "由'空'改为'" + newStr + "'";
resList.add(new OtaBaCxTxjl(otaId, otaModuleEnum.getName(), content));
} }
content = "增加" + tableField.get(newObj).toString() + "" + title + "" + newStr;
resList.add(new OtaBaCxTxjl(otaId, otaModuleEnum.getName(), content));
} }
} else { } else {
for (T oldObj : oldList) { for (T oldObj : oldList) {
@@ -105,7 +105,7 @@ public class ComparisonUtil<T> {
if (ObjectUtils.isNotEmpty(tableTitleObj)) { if (ObjectUtils.isNotEmpty(tableTitleObj)) {
tableTitleObjStr = tableTitleObj.toString(); tableTitleObjStr = tableTitleObj.toString();
} }
String content = "删除了" + tableTitleObjStr; String content = "删除了'" + tableTitleObjStr + "'";
resList.add(new OtaBaCxTxjl(otaId, otaModuleEnum.getName(), content)); resList.add(new OtaBaCxTxjl(otaId, otaModuleEnum.getName(), content));
} }
} }
@@ -143,7 +143,7 @@ public class ComparisonUtil<T> {
newTitleStr = newTitleVal.toString(); newTitleStr = newTitleVal.toString();
} }
} }
String content = newTitleStr + "" + title + "" + oldStr + "改为" + newStr; String content = newTitleStr + "-" + title + "'" + oldStr + "'改为'" + newStr + "'";
resList.add(new OtaBaCxTxjl(otaId, otaModuleEnum.getName(), content)); resList.add(new OtaBaCxTxjl(otaId, otaModuleEnum.getName(), content));
} }
} catch (IllegalAccessException | NoSuchFieldException e) { } catch (IllegalAccessException | NoSuchFieldException e) {