提交 6ef1753a authored 作者: kxjia's avatar kxjia

修改bug

上级 85d38cf5
......@@ -94,7 +94,7 @@ public class DictAspect {
* @param result
*/
private Object parseDictText(Object result) {
//if (result instanceof Result) {
if (result instanceof Result) {
if (true) {
if (((Result) result).getResult() instanceof IPage) {
List<JSONObject> items = new ArrayList<>();
......@@ -104,21 +104,21 @@ public class DictAspect {
// 字典数据列表, key = 字典code,value=数据列表
Map<String, List<String>> dataListMap = new HashMap<>(5);
//取出结果集
List<Object> records=((IPage) ((Result) result).getResult()).getRecords();
List<Object> records = ((IPage) ((Result) result).getResult()).getRecords();
// 代码逻辑说明: 【VUEN-1230】 判断是否含有字典注解,没有注解返回-----
Boolean hasDict= checkHasDict(records);
if(!hasDict){
Boolean hasDict = checkHasDict(records);
if (!hasDict) {
return result;
}
log.debug(" __ 进入字典翻译切面 DictAspect —— " );
log.debug(" __ 进入字典翻译切面 DictAspect —— ");
for (Object record : records) {
String json="{}";
String json = "{}";
try {
//解决@JsonFormat注解解析不了的问题详见SysAnnouncement类的@JsonFormat
json = objectMapper.writeValueAsString(record);
} catch (JsonProcessingException e) {
log.error("json解析失败"+e.getMessage(),e);
log.error("json解析失败" + e.getMessage(), e);
}
// 代码逻辑说明: 【issues/3303】restcontroller返回json数据后key顺序错乱 -----
JSONObject item = JSONObject.parseObject(json, Feature.OrderedField);
......@@ -177,7 +177,7 @@ public class DictAspect {
String value = record.getString(field.getName());
if (oConvertUtils.isNotEmpty(value)) {
List<DictModel> dictModels = translText.get(fieldDictCode);
if(dictModels==null || dictModels.size()==0){
if (dictModels == null || dictModels.size() == 0) {
continue;
}
......@@ -198,7 +198,7 @@ public class DictAspect {
((IPage) ((Result) result).getResult()).setRecords(items);
}
}
}
return result;
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论