关于ajax返回数据获取问题

直接先贴代码

$.ajax({
        type:'post', 
        dataType: "json",
        url:url,
        contentType: 'application/json;charset=utf-8',
        data:JSON.stringify(datas),
        success: function(result){
            alert(result[0].priceId);
            alert(result[0].pricemoney);
            $.each(result, function(index, item){
                findTableQuery += ''+
                                    ''+item.goods.goodsname+''+
                                    ''+item.pricemoney+''+
                                    ''+item.date+''+
                                  ''
            });
            //清空上次数据
            $("#tableQuery tBody tr:not(:first)").html("");
            //插入新查询数据
            $("#tableQuery #trQuyer").after(findTableQuery);
        }

后台代码

    @RequestMapping(value="/recordQuery")
    @ResponseBody
    public List getPriceList(@RequestBody String[] array){
        int areaId = Integer.parseInt(array[0]);
        String goodsName = array[1];
        //查询物品是否存在
        Goods goods = this.goodsService.getGoodsBy(goodsName);
        //查询物品记录
        List priceList = this.priceService.getPriceByList(areaId,goods.getGoodsId());
        for(Price price : priceList){
            System.out.println(price.getArea().getAreaName()+"-"+
                               price.getGoods().getGoodsName()+"-"+
                               price.getPriceMoney()+"-"+price.getDate());
        }
        return priceList;
    }

以下是调试js时查看到result的返回数据

Array(2)
0:{priceId: 1, priceMoney: "3246", date: 1534464000000, areaId: null, goodsId: null, …}
1:{priceId: 2, priceMoney: "3084", date: 1534550400000, areaId: null, goodsId: null, …}
length:2
__proto__:Array(0)

我的问题就是,为什么我获取到priceId是没有问题的,但获取priceMoney得到的确是undefined。
有没有大佬可以告诉我这该怎么解决,百度了老半天,各种五花八门的方法都用遍了,结果还是这样。

每次出问题,在CSDN上询问,都是石沉大海,难道CSDN已经无人了?我一个人在玩单机?

你可能感兴趣的:(关于ajax返回数据获取问题)