代码清单1
$.ajax({
url: context + "/service/datareport/echartScore",
async: false,
dataType: "json",
data: JSON.stringify({"srYear": $('#srYear').val(), 'srType': $('#srType').val(), 'inspectionTeam': $('#inspectionTeam').val()}),
type: "POST",
contentType:'application/json;charset=UTF-8',
success: function (countData) {
$.each(countData.data, function (index, value) {
if (index < 5) {
xData.push(value.UNIT_NAME);
yDsData.push(value.SCORE);
}
})
}
});
注意的地方是:contentType
、type
、data
。
代码清单2
@RequestMapping("/echartScore")
@ResponseBody
public Map echartScore(@RequestBody Map<String, Object> parameters) {
List<Map> evaluateList;
if (!ObjectUtils.isEmpty(parameters.get("inspectionTeam"))) {
Context context = ContextFactory.getContext();
List<Map> permitList = context.getUserDataPermit((String) parameters.get("inspectionTeam"));
List<String> permitUnitList = permitList.stream().map(s -> (String) s.get("organId")).collect(Collectors.toList());
parameters.put("unitId", permitUnitList);
}
if (StringUtils.equals("0", (String) parameters.get("srType")) || StringUtils.equals("1", (String) parameters.get("srType"))) {
evaluateList = evaluateService.queryUnitScoreByType(parameters);
} else {
evaluateList = evaluateService.queryUnitScore(parameters);
}
Map map = new HashMap();
int total = PageUtil.getTotalCount();
map.put("total", total != -1 ? total : evaluateList.size());
map.put("data", evaluateList);
return map;
}
参考:
最新评论
网飞没问题, 迪士尼+有解决方案么?
pp助手是安卓手机用的,根本下载用不来苹果
已解决
这样的话数据库里的结构为{"attachment":{"content":"xxx"}}, 要怎么才能变成{"content":"xxx"},从而使结构保持一致?
赞! make test不过的坑都写到的,谢谢楼主~
谢谢你
用了root用户还是一直502是怎么回事呢
student id 是空的