用实体类接收
作者:互联网
@RequestMapping("/saveorupdatebasegoodinfo") @ResponseBody public JSONResponse saveOrUpdateBaseGoodinfo(@RequestBody Map<String,Object>map,HttpServletRequest request) { JSONResponse jsonResponse=new JSONResponse(); HttpSession session=request.getSession(false); if(session==null) { throw new RuntimeException("session已经超时!"); } Map<String,Object>firstMap=(Map<String, Object>) session.getAttribute("map"); firstMap.putAll(map); GoodsBaseInfo goodsBaseInfo=new GoodsBaseInfo(); MapUtils.mapToJavaBean(goodsBaseInfo,GoodsBaseInfo.class,firstMap); GoodsBaseInfoVO goodsBaseInfoVO=new GoodsBaseInfoVO(); BeanUtils.copyProperties(goodsBaseInfo, goodsBaseInfoVO); goodsBaseInfoVO.setCreator(ShiroKit.getUser().getId()); goodsBaseInfoVO.setModifier(ShiroKit.getUser().getId()); goodsBaseInfoVO.setRelGoodId(map.get("relGoodId")+""); goodsBaseInfoVO.setCreated(new Date()); goodsBaseInfoVO.setModified(new Date()); goodsBaseInfoVO.setIsDeleted(CommonConst.NO); goodsBaseInfoVO.setIsEnable(CommonConst.YES);
标签:map,实体类,JSONResponse,session,GoodsBaseInfo,goodsBaseInfoVO,new,接收 来源: https://www.cnblogs.com/dianzan/p/11442290.html