开发OTA备案工具-导入导出
This commit is contained in:
+1
@@ -53,6 +53,7 @@ public class OtaBaCxLsjlController extends JeroController<OtaBaCxLsjl, IOtaBaCxL
|
|||||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||||
HttpServletRequest req) {
|
HttpServletRequest req) {
|
||||||
QueryWrapper<OtaBaCxLsjl> queryWrapper = QueryGenerator.initQueryWrapper(otaBaCxLsjl, req.getParameterMap());
|
QueryWrapper<OtaBaCxLsjl> queryWrapper = QueryGenerator.initQueryWrapper(otaBaCxLsjl, req.getParameterMap());
|
||||||
|
queryWrapper.orderByDesc("create_time");
|
||||||
Page<OtaBaCxLsjl> page = new Page<OtaBaCxLsjl>(pageNo, pageSize);
|
Page<OtaBaCxLsjl> page = new Page<OtaBaCxLsjl>(pageNo, pageSize);
|
||||||
IPage<OtaBaCxLsjl> pageList = otaBaCxLsjlService.page(page, queryWrapper);
|
IPage<OtaBaCxLsjl> pageList = otaBaCxLsjlService.page(page, queryWrapper);
|
||||||
return Result.OK(pageList);
|
return Result.OK(pageList);
|
||||||
|
|||||||
+1
@@ -53,6 +53,7 @@ public class OtaBaCxTxjlController extends JeroController<OtaBaCxTxjl, IOtaBaCxT
|
|||||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||||
HttpServletRequest req) {
|
HttpServletRequest req) {
|
||||||
QueryWrapper<OtaBaCxTxjl> queryWrapper = QueryGenerator.initQueryWrapper(otaBaCxTxjl, req.getParameterMap());
|
QueryWrapper<OtaBaCxTxjl> queryWrapper = QueryGenerator.initQueryWrapper(otaBaCxTxjl, req.getParameterMap());
|
||||||
|
queryWrapper.orderByDesc("create_time");
|
||||||
Page<OtaBaCxTxjl> page = new Page<OtaBaCxTxjl>(pageNo, pageSize);
|
Page<OtaBaCxTxjl> page = new Page<OtaBaCxTxjl>(pageNo, pageSize);
|
||||||
IPage<OtaBaCxTxjl> pageList = otaBaCxTxjlService.page(page, queryWrapper);
|
IPage<OtaBaCxTxjl> pageList = otaBaCxTxjlService.page(page, queryWrapper);
|
||||||
return Result.OK(pageList);
|
return Result.OK(pageList);
|
||||||
|
|||||||
+1
@@ -54,6 +54,7 @@ public class OtaBaSjListController extends JeroController<OtaBaSjList, IOtaBaSjL
|
|||||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||||
HttpServletRequest req) {
|
HttpServletRequest req) {
|
||||||
QueryWrapper<OtaBaSjList> queryWrapper = QueryGenerator.initQueryWrapper(otaBaSjList, req.getParameterMap());
|
QueryWrapper<OtaBaSjList> queryWrapper = QueryGenerator.initQueryWrapper(otaBaSjList, req.getParameterMap());
|
||||||
|
queryWrapper.orderByDesc("create_time");
|
||||||
Page<OtaBaSjList> page = new Page<OtaBaSjList>(pageNo, pageSize);
|
Page<OtaBaSjList> page = new Page<OtaBaSjList>(pageNo, pageSize);
|
||||||
IPage<OtaBaSjList> pageList = otaBaSjListService.page(page, queryWrapper);
|
IPage<OtaBaSjList> pageList = otaBaSjListService.page(page, queryWrapper);
|
||||||
return Result.OK(pageList);
|
return Result.OK(pageList);
|
||||||
|
|||||||
+1
@@ -53,6 +53,7 @@ public class OtaBaSjLsjlController extends JeroController<OtaBaSjLsjl, IOtaBaSjL
|
|||||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||||
HttpServletRequest req) {
|
HttpServletRequest req) {
|
||||||
QueryWrapper<OtaBaSjLsjl> queryWrapper = QueryGenerator.initQueryWrapper(otaBaSjLsjl, req.getParameterMap());
|
QueryWrapper<OtaBaSjLsjl> queryWrapper = QueryGenerator.initQueryWrapper(otaBaSjLsjl, req.getParameterMap());
|
||||||
|
queryWrapper.orderByDesc("create_time");
|
||||||
Page<OtaBaSjLsjl> page = new Page<OtaBaSjLsjl>(pageNo, pageSize);
|
Page<OtaBaSjLsjl> page = new Page<OtaBaSjLsjl>(pageNo, pageSize);
|
||||||
IPage<OtaBaSjLsjl> pageList = otaBaSjLsjlService.page(page, queryWrapper);
|
IPage<OtaBaSjLsjl> pageList = otaBaSjLsjlService.page(page, queryWrapper);
|
||||||
return Result.OK(pageList);
|
return Result.OK(pageList);
|
||||||
|
|||||||
+1
-1
@@ -86,7 +86,7 @@ public class OtaBaCxAqcsServiceImpl extends ServiceImpl<OtaBaCxAqcsMapper, OtaBa
|
|||||||
if (ObjectUtils.isEmpty(otaBaCxAqcsOld)) {
|
if (ObjectUtils.isEmpty(otaBaCxAqcsOld)) {
|
||||||
otaBaCxAqcsOld = new OtaBaCxAqcs();
|
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);
|
otaBaCxTxjlService.saveBatch(reList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+14
-10
@@ -70,7 +70,7 @@ public class ComparisonUtil<T> {
|
|||||||
Object newVal = field.get(newObj);
|
Object newVal = field.get(newObj);
|
||||||
String newStr = "";
|
String newStr = "";
|
||||||
if (ObjectUtils.isNotEmpty(newVal) && !field.getName().equals(tableField.getName())) {
|
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 + "'";
|
content = tableField.get(newObj).toString() + "-" + title + "由'空'改为'" + newStr + "'";
|
||||||
resList.add(new OtaBaCxTxjl(otaId, otaModuleEnum.getName(), content));
|
resList.add(new OtaBaCxTxjl(otaId, otaModuleEnum.getName(), content));
|
||||||
}
|
}
|
||||||
@@ -86,6 +86,7 @@ public class ComparisonUtil<T> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (T oldObj : oldList) {
|
for (T oldObj : oldList) {
|
||||||
|
boolean flag = true;
|
||||||
if (ObjectUtils.isNotEmpty(oldObj)) {
|
if (ObjectUtils.isNotEmpty(oldObj)) {
|
||||||
Field idField = oldObj.getClass().getDeclaredField("id");
|
Field idField = oldObj.getClass().getDeclaredField("id");
|
||||||
idField.setAccessible(true);
|
idField.setAccessible(true);
|
||||||
@@ -94,19 +95,22 @@ public class ComparisonUtil<T> {
|
|||||||
if (ObjectUtils.isNotEmpty(newObj)) {
|
if (ObjectUtils.isNotEmpty(newObj)) {
|
||||||
Object newId = idField.get(newObj);
|
Object newId = idField.get(newObj);
|
||||||
if (ObjectUtils.isNotEmpty(newId) && oldId.equals(newId.toString())) {
|
if (ObjectUtils.isNotEmpty(newId) && oldId.equals(newId.toString())) {
|
||||||
|
flag = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Field tableTitleField = oldObj.getClass().getDeclaredField(tableTitle);
|
if (flag) {
|
||||||
tableTitleField.setAccessible(true);
|
Field tableTitleField = oldObj.getClass().getDeclaredField(tableTitle);
|
||||||
Object tableTitleObj = tableTitleField.get(oldObj);
|
tableTitleField.setAccessible(true);
|
||||||
String tableTitleObjStr = "空";
|
Object tableTitleObj = tableTitleField.get(oldObj);
|
||||||
if (ObjectUtils.isNotEmpty(tableTitleObj)) {
|
String tableTitleObjStr = "空";
|
||||||
tableTitleObjStr = tableTitleObj.toString();
|
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) {
|
} catch (IllegalAccessException | NoSuchFieldException e) {
|
||||||
@@ -136,7 +140,7 @@ public class ComparisonUtil<T> {
|
|||||||
Object newVal = field.get(newClazz);
|
Object newVal = field.get(newClazz);
|
||||||
String newTitleStr = "空";
|
String newTitleStr = "空";
|
||||||
if (ObjectUtils.isNotEmpty(newVal)) {
|
if (ObjectUtils.isNotEmpty(newVal)) {
|
||||||
Field tableField = newVal.getClass().getDeclaredField(tableTitle);
|
Field tableField = newClazz.getClass().getDeclaredField(tableTitle);
|
||||||
tableField.setAccessible(true);
|
tableField.setAccessible(true);
|
||||||
Object newTitleVal = tableField.get(newVal);
|
Object newTitleVal = tableField.get(newVal);
|
||||||
if (ObjectUtils.isNotEmpty(newTitleVal)) {
|
if (ObjectUtils.isNotEmpty(newTitleVal)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user