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

This commit is contained in:
高嵩
2023-03-27 23:38:05 +08:00
parent 3a420fd65b
commit 448b5f73fe
6 changed files with 19 additions and 11 deletions
@@ -53,6 +53,7 @@ public class OtaBaCxLsjlController extends JeroController<OtaBaCxLsjl, IOtaBaCxL
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<OtaBaCxLsjl> queryWrapper = QueryGenerator.initQueryWrapper(otaBaCxLsjl, req.getParameterMap());
queryWrapper.orderByDesc("create_time");
Page<OtaBaCxLsjl> page = new Page<OtaBaCxLsjl>(pageNo, pageSize);
IPage<OtaBaCxLsjl> pageList = otaBaCxLsjlService.page(page, queryWrapper);
return Result.OK(pageList);
@@ -53,6 +53,7 @@ public class OtaBaCxTxjlController extends JeroController<OtaBaCxTxjl, IOtaBaCxT
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<OtaBaCxTxjl> queryWrapper = QueryGenerator.initQueryWrapper(otaBaCxTxjl, req.getParameterMap());
queryWrapper.orderByDesc("create_time");
Page<OtaBaCxTxjl> page = new Page<OtaBaCxTxjl>(pageNo, pageSize);
IPage<OtaBaCxTxjl> pageList = otaBaCxTxjlService.page(page, queryWrapper);
return Result.OK(pageList);
@@ -54,6 +54,7 @@ public class OtaBaSjListController extends JeroController<OtaBaSjList, IOtaBaSjL
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<OtaBaSjList> queryWrapper = QueryGenerator.initQueryWrapper(otaBaSjList, req.getParameterMap());
queryWrapper.orderByDesc("create_time");
Page<OtaBaSjList> page = new Page<OtaBaSjList>(pageNo, pageSize);
IPage<OtaBaSjList> pageList = otaBaSjListService.page(page, queryWrapper);
return Result.OK(pageList);
@@ -53,6 +53,7 @@ public class OtaBaSjLsjlController extends JeroController<OtaBaSjLsjl, IOtaBaSjL
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<OtaBaSjLsjl> queryWrapper = QueryGenerator.initQueryWrapper(otaBaSjLsjl, req.getParameterMap());
queryWrapper.orderByDesc("create_time");
Page<OtaBaSjLsjl> page = new Page<OtaBaSjLsjl>(pageNo, pageSize);
IPage<OtaBaSjLsjl> pageList = otaBaSjLsjlService.page(page, queryWrapper);
return Result.OK(pageList);
@@ -86,7 +86,7 @@ public class OtaBaCxAqcsServiceImpl extends ServiceImpl<OtaBaCxAqcsMapper, OtaBa
if (ObjectUtils.isEmpty(otaBaCxAqcsOld)) {
otaBaCxAqcsOld = new OtaBaCxAqcs();
}
List<OtaBaCxTxjl> reList = cu.comparisonRecord(otaBaCxAqcsOld.getOtaId(), OtaModuleEnum.CX_AQCS, otaBaCxAqcsOld, otaBaCxAqcs, sysDictService);
List<OtaBaCxTxjl> reList = cu.comparisonRecord(otaBaCxAqcs.getOtaId(), OtaModuleEnum.CX_AQCS, otaBaCxAqcsOld, otaBaCxAqcs, sysDictService);
otaBaCxTxjlService.saveBatch(reList);
}
}
@@ -70,7 +70,7 @@ public class ComparisonUtil<T> {
Object newVal = field.get(newObj);
String newStr = "";
if (ObjectUtils.isNotEmpty(newVal) && !field.getName().equals(tableField.getName())) {
newStr = newVal.toString();
newStr = parseDictText(ote, field, newObj, sysDictService);
content = tableField.get(newObj).toString() + "-" + title + "由'空'改为'" + newStr + "'";
resList.add(new OtaBaCxTxjl(otaId, otaModuleEnum.getName(), content));
}
@@ -86,6 +86,7 @@ public class ComparisonUtil<T> {
}
}
for (T oldObj : oldList) {
boolean flag = true;
if (ObjectUtils.isNotEmpty(oldObj)) {
Field idField = oldObj.getClass().getDeclaredField("id");
idField.setAccessible(true);
@@ -94,19 +95,22 @@ public class ComparisonUtil<T> {
if (ObjectUtils.isNotEmpty(newObj)) {
Object newId = idField.get(newObj);
if (ObjectUtils.isNotEmpty(newId) && oldId.equals(newId.toString())) {
flag = false;
break;
}
}
}
Field tableTitleField = oldObj.getClass().getDeclaredField(tableTitle);
tableTitleField.setAccessible(true);
Object tableTitleObj = tableTitleField.get(oldObj);
String tableTitleObjStr = "";
if (ObjectUtils.isNotEmpty(tableTitleObj)) {
tableTitleObjStr = tableTitleObj.toString();
if (flag) {
Field tableTitleField = oldObj.getClass().getDeclaredField(tableTitle);
tableTitleField.setAccessible(true);
Object tableTitleObj = tableTitleField.get(oldObj);
String tableTitleObjStr = "";
if (ObjectUtils.isNotEmpty(tableTitleObj)) {
tableTitleObjStr = tableTitleObj.toString();
}
String content = "删除了'" + tableTitleObjStr + "'";
resList.add(new OtaBaCxTxjl(otaId, otaModuleEnum.getName(), content));
}
String content = "删除了'" + tableTitleObjStr + "'";
resList.add(new OtaBaCxTxjl(otaId, otaModuleEnum.getName(), content));
}
}
} catch (IllegalAccessException | NoSuchFieldException e) {
@@ -136,7 +140,7 @@ public class ComparisonUtil<T> {
Object newVal = field.get(newClazz);
String newTitleStr = "";
if (ObjectUtils.isNotEmpty(newVal)) {
Field tableField = newVal.getClass().getDeclaredField(tableTitle);
Field tableField = newClazz.getClass().getDeclaredField(tableTitle);
tableField.setAccessible(true);
Object newTitleVal = tableField.get(newVal);
if (ObjectUtils.isNotEmpty(newTitleVal)) {