用实体类接收

    @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);

 

public User ajaxRequest(@RequestBody User user){
        System.out.println(user);
        return user;
    }

 

posted @ 2019-09-01 14:46  ThisCall  阅读(522)  评论(0编辑  收藏  举报