前台页面
//打开分配按钮
function open_deploy(){
debugger;
var row = $('#query-datagrid').datagrid('getSelections');
if (row == null || row.length == 0) {
$.me('警告', '请选择要分配的产品!', 'warning');
} else{
var datalist= new Array();
for (var i = 0; i < row.length; ++i) {
var object = new Object();
object.contractId=row[i].contractId;
object.lastDisDate=row[i].lastDisDate;
object.thisDisDate=row[i].thisDisDate;
object.lastProfit=row[i].lastProfit;
object.thisProfit=row[i].thisProfit;
object.deployProfit=row[i].deployProfit;
object.pdCode=row[i].pdCode;
da(object);
}
$.ajax({
url:"${ctx}/ac/familytrustGeneral/distributionGeneral;,
data:{"datalist":json.stringify(dataList)},
type:"post",
dataType:"json",
success:function(dataV){
i == 0){
}else{
$.me('警告',da;warning');
}
}
});
}
}
后台Controller
/** 分配
* @param pdCode 产品编码
* @param contractId 合同主键
* @param distributeDt 分配日期
* @param entity
* @return Map<String,Object>
*/
@RequestMapping(value=";)
@ResponseBody
public Map<String,Object> generalDistribute(String datalist){
return generalDe(datalist);
}
Service层处理
import net.;
@SuppressWarnings("unchecked")
@Override
public Map<String, Object> distribute(String list) {
JSONArray json = JSONArray.fromObject(list);
List<GeneralDeployEntity> deployList=new ArrayList<GeneralDeployEntity>();
deployList= (List<GeneralDeployEntity>) JSONArray.toCollection(json, GeneralDe);
for (int i = 0; i < de(); i++) {
GeneralDeployEntity deployEntity=new GeneralDeployEntity();
Integer contractId = de();
}
return null;
}