用easyui传递对象时,前台的参数名称需要与后端定义实体类时的参数名称一模一样

<table cellspacing="8px">
    <tr>
    <td>服务类型:</td>
    <td>
    <input class="easyui-combobox" id="serveType" name="serveType" data-options="panelHeight:'auto',editable:false,valueField:'dataDicValue',textField:'dataDicValue',url:'${pageContext.request.contextPath}/dataDic/dataDicComboList.do?dataDicName=2'"/>&nbsp;<font color="red">*</font>
    </td>
    <td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
    <td>客户</td>
    <td><input type="text" id="customer" name="customer" class="easyui-validatebox" required="true"/>&nbsp;<font color="red">*</font></td>
    </tr>
    <tr>
    <td>概要:</td>
    <td colspan="4">
    <input type="text" id="overview" name="overview" style="width: 419px" class="easyui-validatebox" required="true"/>&nbsp;<font color="red">*</font>
    </td>
    </tr>
    <tr>
    <td>服务请求:</td>
    <td colspan="4">
    <textarea id="servicerequest" name="servicerequest" rows="5" cols="49" class="easyui-validatebox" required="true">
    </textarea>&nbsp;<font color="red">*</font>
    </td>
    </tr>
    <tr>
    <td>创建人:</td>
    <td>
    <input type="hidden" name="state" value="新创建"/>
    <input type="text" readonly="readonly" id="createPeople" name="createPeople" value="${currentUser.trueName }"/>
    </td>
    <td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
    <td>创建时间:</td>
    <td><input type="text" id="createTime" name="createTime" readonly="readonly"/></td>
    </tr>
    <tr>
    <td colspan="4"></td>
    <td>
    <a href="javascript:saveCustomerService()" class="easyui-linkbutton" iconCls="icon-ok">保存</a>&nbsp;&nbsp;
    <a href="javascript:resetValue()" class="easyui-linkbutton" iconCls="icon-reset">重置</a>
    </td>
    </tr>

    </table>

public class CustomerService implements Serializable{
private static final long serialVersionUID = 1L;


private Integer id; // 编号
private String serveType; // 服务类型 1,咨询 2,建议 3,投诉
private String overview; // 概要
private String customer; // 客户
private String state; // 1,新创建 2,已分配 3,已处理 4,已归档
private String servicerequest; // 服务请求
private String createPeople; // 创建人
private Date createTime; // 创建日期
private String assigner; // 分配人
private Date assignTime; // 分配日期
private String serviceProce; // 服务处理
private String serviceProcePeople; // 服务处理人
private Date serviceProceTime; // 服务处理日期
private String serviceProceResult; // 服务处理结果
private String myd; // 客户满意度

......

}


/**
* 添加或者修改客服服务
* @param contact
* @param response
* @return 
* @throws Exception
* @技术声明:用easyui传递对象时,前台的参数名称需要与后端定义实体类时的参数名称一模一样
*/
@RequestMapping("/save")
public String save(CustomerService customerService,HttpServletResponse response)throws Exception{
System.out.println("customerService==="+customerService.getServicerequest());
int resultTotal=0; // 操作的记录条数
if(customerService.getId()==null){
resultTotal=customerServiceService.add(customerService);
}else{
resultTotal=customerServiceService.update(customerService);
}
JSONObject result=new JSONObject();
if(resultTotal>0){
result.put("success", true);
}else{
result.put("success", false);
}
ResponseUtil.write(response, result);
return null;
}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值