遍历rg的时候出错了 错误信息如下java.lang.ClassCastException: java.util.LinkedHashMap cannot be cast to org.nutz.lang.util.NutMap
@At("/list")
@Ok("json:{ignoreNull:false}")
public Object list(@Param("id") String id,
@Param("state") String state){
List<NutMap> reg = new ArrayList<>();
List<NutMap> rg = new ArrayList<NutMap>();
try {
if(state!=null){
Sql rg_sql = dao.sqls().create("return_good_state.list");
rg_sql.params().set("uid", id);
rg_sql.params().set("state", id);
rg = appReturnGoodService.listMap(rg_sql);
}else {
Sql rg_sql = dao.sqls().create("return_good.list");
rg_sql.params().set("uid", id);
rg = appReturnGoodService.listMap(rg_sql);
}
String ret_id = null;
if(rg.size() > 0){
for(NutMap r :rg){
ret_id = r.getString("id");
if(ret_id!=null){
Sql sql = dao.sqls().create("return_item.list");
sql.params().set("ret_id", ret_id);
List<NutMap> rg_item = appReturnGoodService.listMap(sql);
r.addv("items",rg_item);
reg.add(r);
}
}
}
if(reg.size() > 0){
return ResultApp.success("请求成功",reg);
} else {
return ResultApp.success("02","无退货商品",reg);
}
} catch (Exception e) {
System.out.print(e.toString());
return ResultApp.error("请求失败");
}
}