|
@@ -121,9 +121,16 @@ public class TableServiceCmdService {
|
|
|
GenTable genTable = getTableFromRedisByTableName(RedisKey.TABLE_INFO, dto.getTable());
|
|
|
String pkName = IdUtils.getPkName(genTable.getColumns());
|
|
|
|
|
|
- RowResult rowResult = deleteService.objectDelete(idArr, dto.getTable(), requireNonNull(pkName, "主键名称为空"));
|
|
|
- LOGGER.info(rowResult.getMessage() + ", id: {}", Arrays.toString(idArr));
|
|
|
- return AjaxResult.success(rowResult);
|
|
|
+ List<RowResult> result = Lists.newArrayListWithCapacity(idArr.length);
|
|
|
+ for (Long id : idArr) {
|
|
|
+ RowResult rowResult = deleteService.deleteById(dto.getTable(), pkName, id);
|
|
|
+ result.add(rowResult);
|
|
|
+ LOGGER.info(rowResult.getMessage() + ", id: {}", Arrays.toString(idArr));
|
|
|
+ }
|
|
|
+
|
|
|
+ // RowResult rowResult = deleteService.objectDelete(idArr, dto.getTable(), requireNonNull(pkName, "主键名称为空"));
|
|
|
+
|
|
|
+ return AjaxResult.success(result);
|
|
|
}
|
|
|
|
|
|
|
|
@@ -447,12 +454,27 @@ public class TableServiceCmdService {
|
|
|
for (GenTableColumn column : columns) {
|
|
|
String dictType = column.getDictType();
|
|
|
if (ObjectUtils.isNotEmpty(dictType)) {
|
|
|
- List<SysDictData> sysDictData = dictTypeService.selectDictDataByType(dictType);
|
|
|
- column.setSysDictData(sysDictData);
|
|
|
+ List<SysDictData> sysDictData1 = dictTypeService.selectDictDataByType(dictType);
|
|
|
+ column.setSysDictData(coverSysDictDataToJSONObject(sysDictData1));
|
|
|
}
|
|
|
}
|
|
|
|
|
|
return AjaxResult.success(genTable);
|
|
|
}
|
|
|
+
|
|
|
+ public List<JSONObject> coverSysDictDataToJSONObject(List<SysDictData> sysDictData) {
|
|
|
+ List<JSONObject> result = Lists.newArrayListWithCapacity(sysDictData.size());
|
|
|
+ for (SysDictData data : sysDictData) {
|
|
|
+ JSONObject jsonObject = new JSONObject();
|
|
|
+ String dictLabel = data.getDictLabel();
|
|
|
+ String dictValue = data.getDictValue();
|
|
|
+ jsonObject.put(DictConstant.DICT_LABEL, dictLabel);
|
|
|
+ jsonObject.put(DictConstant.DICT_VALUE, dictValue);
|
|
|
+ result.add(jsonObject);
|
|
|
+ }
|
|
|
+
|
|
|
+ return result;
|
|
|
+
|
|
|
+ }
|
|
|
}
|
|
|
|