修复 错误
This commit is contained in:
+11
-7
@@ -1,9 +1,11 @@
|
||||
package cn.iocoder.yudao.module.system.dict;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.system.service.dict.DictDataService;
|
||||
import com.alibaba.druid.support.json.JSONUtils;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.alibaba.fastjson.parser.Feature;
|
||||
@@ -97,13 +99,15 @@ public class DictAspect {
|
||||
|
||||
for (Object record : ((PageResult) ((CommonResult) result).getData()).getList()) {
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
String json="{}";
|
||||
try {
|
||||
//解决@JsonFormat注解解析不了的问题详见SysAnnouncement类的@JsonFormat
|
||||
json = mapper.writeValueAsString(record);
|
||||
} catch (JsonProcessingException e) {
|
||||
log.error("json解析失败"+e.getMessage(),e);
|
||||
}
|
||||
// 1String json="{}";
|
||||
String json = JSONUtil.toJsonStr(record);
|
||||
|
||||
// try {
|
||||
// //解决@JsonFormat注解解析不了的问题详见SysAnnouncement类的@JsonFormat
|
||||
// json = mapper.writeValueAsString(record);
|
||||
// } catch (JsonProcessingException e) {
|
||||
// log.error("json解析失败"+e.getMessage(),e);
|
||||
// }
|
||||
//update-begin--Author:scott -- Date:20211223 ----for:【issues/3303】restcontroller返回json数据后key顺序错乱 -----
|
||||
JSONObject item = JSONObject.parseObject(json, Feature.OrderedField);
|
||||
//update-end--Author:scott -- Date:20211223 ----for:【issues/3303】restcontroller返回json数据后key顺序错乱 -----
|
||||
|
||||
Reference in New Issue
Block a user