数据:
{
linkList=[{name=, id=d1ade9ce7c94466db617a35bc350d295, source=1d9cfb4d5b164ee18f78a386093b7d6b, category=2, target=fdc2cd75c27c486390dc69576632bd57}],
nodeList=[
{draggable=true, data=null, moved=false, name=酒泉, x=48, y=200, weight=0, monitor=null, id=1d9cfb4d5b164ee18f78a386093b7d6b, category=0, type=2, value=null},
{draggable=true, data=null, moved=false, name=宁夏, x=172, y=23, weight=0, monitor=null, id=bf38a6c3facb44a7a81670cdd6716a64, category=0, type=2, value=null},
{draggable=true, data=null, moved=false, name=兰州, x=100, y=122, weight=0, monitor=null, id=fdc2cd75c27c486390dc69576632bd57, category=0, type=2, value=null}
],
dictList=[
{classify=告警级别, code=3, name=警告, remark=#3333fe, id=042ff8df57bf4e7b863618a40b8a24a8, sort=3, delFlag=false},
{classify=告警级别, code=4, name=错误, remark=#f3fb10, id=d35c81fbeaa144be87602d1c2a7dc67b, sort=4, delFlag=false},
{classify=告警级别, code=5, name=致命, remark=#fd2020, id=31b62b41cea54cdcb0c4ec398fec9100, sort=5, delFlag=false}
]
}
操作代码如下:
File file=tempFile.getFile();
String fileDate=fileDataService.readerFile(file);
if("".equals(fileDate)){
return new Result(false,"该文件没有数据!");
}
NutMap map=Json.fromJson(NutMap.class,Json.toJson(fileDate));
出现错误:
org.nutz.castor.FailToCastObjectException: Fail to cast from <java.lang.String> to <org.nutz.lang.util.NutMap> for {{linkList=[{name=, id=d1ade9ce7c94466db617a35bc350d295, source=1d9cfb4d5b164ee18f78a386093b7d6b, category=2, target=fdc2cd75c27c486390dc69576632bd57}], nodeList=[{draggable=true, data=null, moved=false, name=酒泉, x=48, y=200, weight=0, monitor=null, id=1d9cfb4d5b164ee18f78a386093b7d6b, category=0, type=2, value=null}, {draggable=true, data=null, moved=false, name=宁夏, x=172, y=23, weight=0, monitor=null, id=bf38a6c3facb44a7a81670cdd6716a64, category=0, type=2, value=null}, {draggable=true, data=null, moved=false, name=兰州, x=100, y=122, weight=0, monitor=null, id=fdc2cd75c27c486390dc69576632bd57, category=0, type=2, value=null}], dictList=[{classify=告警级别, code=3, name=警告, remark=#3333fe, id=042ff8df57bf4e7b863618a40b8a24a8, sort=3, delFlag=false}, {classify=告警级别, code=4, name=错误, remark=#f3fb10, id=d35c81fbeaa144be87602d1c2a7dc67b, sort=4, delFlag=false}, {classify=告警级别, code=5, name=致命, remark=#fd2020, id=31b62b41cea54cdcb0c4ec398fec9100, sort=5, delFlag=false}]}}