后端以Integer类型接受,前端传来字符串"null",后端怎么做处理?
@ResponseBody
@RequestMapping(value = {"/mobBaseService/home/queryCompanyMenuFunctionName"}, method = RequestMethod.GET)
public JSONObject queryCompanyMenuAndFunction(@RequestHeader("token") String token,
@RequestParam("companyMenuId") Integer companyMenuId,
@RequestParam("projectId") Integer projectId,
@RequestParam(value = "bidSectionId",required = false) String bidSectionIdstr) {
JSONObject userDetail = jwtUtil.getJWTDetail(token);
Integer userId = Integer.parseInt(userDetail.get("userId").toString());
Integer bidSectionId = 0;
if (bidSectionIdstr == null || bidSectionIdstr.equals("") || bidSectionIdstr.equals("undefined")){
bidSectionId = 0;
}else{
bidSectionId = Integer.parseInt(bidSectionIdstr);
}
return homePageService.queryCompanyMenuFunctionName(userId,companyMenuId,projectId,bidSectionId);
}