action
@InjectName
@IocBean
@At("shipInfo")
public class ShipInfoAction extends BaseAction {
@Inject
private ShipInfoDao shipInfoDao;
@Inject
private ConsigneeInfoDao consigneeInfoDao;
/**
* 寄件新增
* @param shipInfoAssist
* @return
*/
@At
@Ok("json")
public Object insertShipInfo(@Param("..") ShipInfoAssist shipInfoAssist) {
try {
ShipInfo shipInfo = new ShipInfo();
shipInfo.setDdh(shipInfoAssist.getDdh());
shipInfo.setWpmc(shipInfoAssist.getWpmc());
shipInfo.setJjrxm(shipInfoAssist.getJjrxm());
shipInfo.setJjrdh(shipInfoAssist.getJjrdh());
shipInfo.setJjsj(shipInfoAssist.getJjsj());
shipInfo.setPsjg(shipInfoAssist.getPsjg());
shipInfoDao.insertShipInfo(shipInfo);
ConsigneeInfo consigneeInfo = new ConsigneeInfo();
consigneeInfo.setDdh(shipInfoAssist.getDdh());
consigneeInfo.setSjrxm(shipInfoAssist.getSjrxm());
consigneeInfo.setSjrdh(shipInfoAssist.getSjrdh());
consigneeInfo.setSdrq(shipInfoAssist.getSdrq());
consigneeInfo.setMddz(shipInfoAssist.getMddz());
consigneeInfoDao.insertConsigneeInfo(consigneeInfo);
} catch (Exception e) {
// TODO: handle exception
e.printStackTrace();
return requestResult(false, "快递单生成失败,请重新填写订单信息!!!");
}
return requestResult(true, "快递单已生成!!!");
}
这样请求不生效
$.ajax({
url : 'shipInfo/insertShipInfo.nut',
type : 'POST',
data : json,
dataType : 'json',
success : function(data) {
if(data.success){
mini.alert(data.data,'提醒',function(){
CloseWindow('ok');
});
}else{
mini.alert(data.data ,'提醒',function(){
CloseWindow('ok');
});
}
},
error : function(jqXHR,textStatus,errorThrown){
alert('访问服务器失败!!!');
},
complete : function(){
}
});
日志 路径似乎不对
2018-03-25 16:58:50,921 org.nutz.mvc.impl.UrlMappingImpl.get(UrlMappingImpl.java:110) DEBUG - Search mapping for [POST] path=/order/html/shipInfo/insertShipInfo : NOT Action match