|
按钮调用action,action调用存储过程出错
w文件按钮动作如下
var params = new justep.Request.ActionParam();
// List参数
var listParam = new justep.Request.ListParam();
listParam.add(justep.xbl('dataMaster').getCurrentID());
listParam.add(justep.xbl('dataMaster').getCurrentID());
params.setList("param_list", listParam);
// 调用动作
alert(justep.xbl('dataMaster').getCurrentID());
justep.Request.sendBizRequest2({
"dataType": "application/json",
"action": "ckdsh",
"parameters": params,
"callback": function(callbackData) {
callbackData.ignoreError = false;
if (callbackData.state) {
justep.xbl("tip1").show({"message": "传入List参数调用成功。"});
var data = callbackData.response;
// 输出返回结果
TextOut.setText("result1", data);
}
}
});
action如下:
public static String ckdsh(){
Connection ct=null;
Transaction tr=null;
CallableStatement c=null;
System.out.print("hello");
try{
tr=new Transaction();
ct=tr.getConnection("/erp/sfj/data");
com.justep.model.Model fnModel=com.justep.model.ModelUtils.getModel("/system/logic/fn");
// String exp="";
// exp="currentPersonName()";
// String name=(String)com.justep.system.data.Expression.evaluate(exp, null, fnModel);
c=ct.prepareCall("{call ckdsh(?,?,?)}");
c.setString(1,fid);
c.setString(2,shr);
c.registerOutParameter(3,java.sql.Types.INTEGER);
c.execute();
int res=c.getInt(3);
if(res==1){
return "审核成功";}
if(res==2){
return "单据已审核,不能重复审核";}
if(res==3){
return "请先保存";}
System.out.print(res);
return"审核失败";
}catch(Exception e){
e.printStackTrace();
return "审核失败";
}finally{
try{if(null!=c){
c.close();}
if(null!=ct) ct.close();
}catch(Exception e){}
}
}
}
报错提示:
JUSTEP150084, "/erp/sfj/process/ckd/ckdsh"没有定义参数"param_list"详细 |
|