$("#parentId").html(result.serviceClass!=null?result.serviceClass.name:"");
<td style="text-align: right;">上级分类名称</td>
<td>
<span id="parentId"></span>
</td>
public void getById() {
// 判断ID是否为空
if (flatInfo != null) {
FlatInfo obj = flatInfoService.getFlatInfoById(flatInfo.getId());
if(obj.getParentId()!=null && !obj.getParentId().equals("")){
FlatInfo fi = flatInfoService.getFlatInfoById(obj.getParentId());
obj.setFlatInfo(fi);
}
CommonUtils.writeJson(obj, request, response);
}
}
$("#provinceRegionCode").html(result.provinceRegionCode !=null?result.provinceRegionCode.name:""+result.cityRegionCode!=null?result.cityRegionCode.name:""+result.countyRegionCode!=null?result.countyRegionCode.name:"");