Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ApiDataConvertAdapter转换后 值为null字段的字段被清除 #783

Closed
catlvsuger opened this issue Jan 22, 2022 · 2 comments
Closed

Comments

@catlvsuger
Copy link

版本号:1.4.2
问题描述:Api解析时,实现 ApiDataConvertAdapter 自定义转换,getData(JSONObject jsonObject) jsonObject里面字段值为null的字段被清除了,创建报表时获取到的字段缺少

image

public class MyDataConvertAdapter implements ApiDataConvertAdapter {
@OverRide
public String getData(JSONObject jsonObject) {
log.info(jsonObject.toJSONString());
if(jsonObject.containsKey("result")){
try {
JSONArray pageList = jsonObject.getJSONObject("result").getJSONArray("records");
return pageList.toJSONString();
} catch (Exception e){
log.info("contractParser 异常:{}",e.getMessage());
}
}
return "";
}
}

错误日志&截图:

解析前:
image
解析后:
image

重现步骤:通过fastJsonConverters 将null转为"", 可解决,但日期注解@jsonformat 失效,通过MappingJackson2HttpMessageConverter,也可解决,但转换出现其他错误,目前未找到好的解决方法,求助

友情提示(为了提高issue处理效率):

  • 积木报表是一款免费报表产品,功能免费源码不开放;
  • 未按格式要求发帖,会被直接删掉;
  • 请针对问题提供报表设计SQL脚本或在官网制作报表示例并提供ID;
  • 针对不好重现的问题,请录制操作视频或详细的重现步骤;
@lvdandan16
Copy link
Collaborator

收录 ws

@1298191366
Copy link

null字段的字段被清除,已修复,待新版本发布

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants