这个Controller控制器怎么写

    /**
     * 费用管理修改
     * @throws Exception 
     */
   @ResponseBody
   @RequestMapping(value="/updateCharingCost")
   public boolean updateCharingCost(ChargingCost chargingCost) throws Exception {
        User usr = (User) this.getSession().getAttribute(Const.SESSION_USER);
        String usrID = usr.getUserID();
        boolean bool=false; 
                bool=chargingCostService.update(chargingCost, usrID);                   
        return bool;         
    }
   /**
    * 费用管理删除
 * @throws Exception 
    */
   @ResponseBody
   @RequestMapping(value="/deleteCharingCost")
   public boolean deleteChargingCost(ChargingCost chargingCost) throws Exception{
        User usr = (User) this.getSession().getAttribute(Const.SESSION_USER);
        String usrID = usr.getUserID();
       boolean bool=chargingCostService.delete(chargingCost, usrID);
       return bool;
   }
}
这个是Controller,,

    public boolean update(ChargingCost chargingCost, String usrID) throws Exception {
    boolean bool = false;
    Date date = Tools.getNowtimeTwo();
    chargingCost.setUpdateUser(usrID);
    chargingCost.setUpdateDTTM(date);
    int ExecuteCnt = (int) this.getDaoSupport().update("ChargingCost.update", chargingCost);
    if (ExecuteCnt > 0) {
        bool = true;
    }
    return bool;
}

/**
 * 删除费用
 */
public boolean delete(ChargingCost chargingCost, String usrID) throws Exception {
    boolean bool = false;
    Date date = Tools.getNowtimeTwo();
    chargingCost.setDeleteFlag(0);
    chargingCost.setUpdateUser(usrID);
    chargingCost.setUpdateDTTM(date);
    int ExecuteCnt = (int) this.getDaoSupport().update("ChargingCost.delete", chargingCost);
    if (ExecuteCnt > 0) {
        bool = true;
    }
    return bool;
}
这个是service,

function update_Cost() {
var len = document.getElementsByName("chk").length;
var selectCount = 0; // 判断是否一个未选
for (var i = 0; i < len; i++) {
    if (document.getElementsByName("chk")[i].checked == true) {
        selectCount = selectCount + 1;
        userData.push(i + 1);
        s=i+1;
    }
}
if (selectCount == 1) {
    $('#costInformationUpdate').modal('show');
    // 设置弹出窗口的位置
    var model=document.getElementById("costInformationUpdate");
    var tb = document.getElementById("costTable");
    var tr = tb.rows[s];
    $("#updateChargingStationName").val(tr.cells[2].innerText);
    $("#updateEffectiveDate").val(tr.cells[3].innerText);
} else if (selectCount == 0) {
    showMessge("请选择要操作的数据!","model1");
} else {
    showMessge("抱歉,不能选择多行!","model1");
}

}
//确认修改
function updateChargingCost(){
var updateChargePrice=$("#updateChargePrice").val();
var updateServicePrice=$("#updateServicePrice").val();
var updateMonthKWH=$("#updateMonthKWH").val();
$.ajax({
type: "POST",
url: 'updateCharingCost',
data: {
ChargePrice:updateChargePrice,
ServicePrice:updateServicePrice,
MonthKWH:updateMonthKWH,
},
dataType:'json',
success : function(data) {
if (data) {
showMessge("修改成功!","model1");
$('#update').modal('hide');
saveCharingCost();
} else {
showMessge("修改失败!","model1");
$('#update').modal('hide');
}
},
error : function(data) {
if (data.status == "403" && data.statusText == "Forbidden") {
showMessge("您没有操作权限!","model1");
} else {
showMessge("操作失败!","model1");
}
}
});
}
这个是js,,但是date一直是false,觉得是控制器写错了,,大神告诉我怎么写吧,没有一点思路

自己在逐步排查一下把,应该很简单的问题。看看方法执行成功没,打断点调一下,全搞定了就行

你 url 写的 有问题吧!
url: basePath+"/retrieval/get_informationdate",

get_informationdate", 对应你的 updateCharingCost
"/retrieval/ 是 这个位置的 类名上面的@RequestMapping("/retrieval")
basePath 对应的是这个 var basePath='${pageContext.request.contextPath}';
而且 你在看看 , 你 原来的方法 打 个断点 是否 进入 方法

我的URl没有问题,,我都试过了,,打断点走到success : function(data) {data是flase,然后 Controller走到 boolean bool=false;
bool=chargingCostService.update(chargingCost, usrID);这里bool也成了flase,但是 ChargingCost chargingCost这个里面有值,,就是传不过去