📄 planmngaction.java
字号:
aple.printStackTrace();
req.setAttribute("errorId",ErrorCode.COMMONSERVICE_ERROR);
return (mapping.findForward("error"));
}
catch(java.sql.SQLException sqle)
{
//捕获调用aplcoms异常,定向到出错页面,错误码为ErrorCode.DATABASE_ERROR
sqle.printStackTrace();
req.setAttribute("errorId",ErrorCode.DATABASE_ERROR);
return (mapping.findForward("error"));
}
catch(Exception e)
{
//捕获未知异常,定向到出错页面,错误码为ErrorCode.UNKNOW_ERROR
e.printStackTrace();
req.setAttribute("errorId",ErrorCode.UNKNOW_ERROR);
return (mapping.findForward("error"));
}
finally
//关闭连接实例
{
if(aplcoms != null)
{
aplcoms.close();
}
}
}
/****************************************************
* 删除计划
****************************************************/
private ActionForward delPlan (ActionMapping mapping,
ActionForm form, HttpServletRequest req,
HttpServletResponse res)
{
String operatorflag = ((PlanmngForm)form).getOperatorflag();
String staffno = req.getSession().getAttribute("staffno").toString();
//得到待删除的itemidarray 数组
String idarray[] = ((PlanmngForm)form).getItemidarray();
//将数组中的每个字符串以#分割,赋给idstring
String idstring = "";
for (int i=0; i < idarray.length ;i++)
{
if (idstring == "")
{
idstring = idarray[i];
}
else
{
idstring = idstring + "#" + idarray[i];
}
}
SysDbConn aplcoms = null;
try
{
//连接数据源
aplcoms = SysConnPool.getInstance().getAplComs();
aplcoms.preparedSP();
//获得输入参数
aplcoms.setString(1,idstring);
//if (调用存储过程 P_Agt_DelPlanArchive 删除学习计划)
SysDataSet ds1 = aplcoms.csCommonSP("P_Agt_DelPlan");
SysRecord rc1 = ds1.getParamSet() ;
if(rc1!=null && rc1.getInt(0) == 0)
{
if (operatorflag.equalsIgnoreCase("PLANMNG_DEL")){
((PlanmngForm)form).setOperatorflag("PLANMNG_QUERY_LIST");
((PlanmngForm)form).setSenderid(staffno);
((PlanmngForm)form).setStatus("0");
((PlanmngForm) form).setItemid("");
((PlanmngForm) form).setRecieverid("");
((PlanmngForm) form).setSenderid("");
((PlanmngForm) form).setResponseid("");
((PlanmngForm) form).setCourseid("");
((PlanmngForm) form).setTestid("");
((PlanmngForm) form).setFeedback("");
//如果是在未下发计划列表中进行删除操作,那么调用queryPlanList查询,再回到列表页面
return queryPlanList(mapping,form,req,res);
}
else if (operatorflag.equalsIgnoreCase("PLANMNG_DEL_RESPONSE"))
{
//如果是在修改页面上进行删除操作,那么定位到成功页面
req.setAttribute("successId",SuccessCode.PLANMNG_DEL);
req
return(mapping.findForward("success"));
}
else
{
req.setAttribute("errorId",ErrorCode.UNKNOW_ERROR);
return(mapping.findForward("error"));
}
}
else if(rc1!=null && rc1.getInt(0) == 2) //未完全删除
{
//定位到错误叶面错误码为 errorcode.PLANMNG_DELUNCOMP
req.setAttribute("errorId",ErrorCode.PLANMNG_DELUNCOMP);
return(mapping.findForward("error"));
}
else
{
// 定位到错误页面错误码为 errorcode.PLANMNG_DEL
req.setAttribute("errorId",ErrorCode.PLANMNG_DEL);
return (mapping.findForward("error"));
}
}
catch (SysDbException aple)
{
//捕获CommonService系统异常,定向到出错页面,错误码为ErrorCode.COMMONSERVICE_ERROR
aple.printStackTrace();
req.setAttribute("errorId",ErrorCode.COMMONSERVICE_ERROR);
return (mapping.findForward("error"));
}
catch(java.sql.SQLException sqle)
{
//捕获调用aplcoms异常,定向到出错页面,错误码为ErrorCode.DATABASE_ERROR
sqle.printStackTrace();
req.setAttribute("errorId",ErrorCode.DATABASE_ERROR);
return (mapping.findForward("error"));
}
catch(Exception e)
{
//捕获未知异常,定向到出错页面,错误码为ErrorCode.UNKNOW_ERROR
e.printStackTrace();
req.setAttribute("errorId",ErrorCode.UNKNOW_ERROR);
return (mapping.findForward("error"));
}
finally
//关闭连接实例
{
if(aplcoms != null)
{
aplcoms.close();
}
}
}
/****************************************************
* 发布计划
****************************************************/
private ActionForward releasePlan (ActionMapping mapping,
ActionForm form, HttpServletRequest req,
HttpServletResponse res)
{
String operatorflag = ((PlanmngForm)form).getOperatorflag();
String staffno = req.getSession().getAttribute("staffno").toString();
//得到待下发的itemidarray 数组
String idarray[] = ((PlanmngForm)form).getItemidarray();
//将数组中的每个字符串以#分割,赋给idstring
String idstring = "";
for (int i=0; i < idarray.length ;i++)
{
if (idstring == "")
{
idstring = idarray[i];
}
else
{
idstring = idstring + "#" + idarray[i];
}
}
SysDbConn aplcoms = null;
try
{
//连接数据源
aplcoms = SysConnPool.getInstance().getAplComs();
aplcoms.preparedSP();
//获得输入参数
aplcoms.setString(1,idstring);
aplcoms.setString(2,staffno);
aplcoms.setInt(3,Initor.systemConfig.getInt("agt/planNotify",3));
//if (调用存储过程 P_Agt_ReleasePlan 发布学习计划)
SysDataSet ds1 = aplcoms.csCommonSP("P_Agt_ReleasePlan");
SysRecord rc1 = ds1.getParamSet() ;
if(rc1!=null && rc1.getInt(0) == 0)
{
((PlanmngForm)form).setOperatorflag("PLANMNG_QUERY_LIST");
((PlanmngForm)form).setSenderid(staffno);
((PlanmngForm)form).setStatus("0");
((PlanmngForm) form).setItemid("");
((PlanmngForm) form).setRecieverid("");
((PlanmngForm) form).setSenderid("");
((PlanmngForm) form).setResponseid("");
((PlanmngForm) form).setCourseid("");
((PlanmngForm) form).setTestid("");
((PlanmngForm) form).setFeedback("");
//调用 queryPlanList 查询
return queryPlanList(mapping,form,req,res);
}
else if(rc1!=null && rc1.getInt(0) == 2) //未完全删除
{
//定位到错误叶面错误码为 errorcode.PLANMNG_RELEASEUNCOMP
req.setAttribute("errorId",ErrorCode.PLANMNG_RELEASEUNCOMP);
return(mapping.findForward("error"));
}
else
{
// 定位到错误页面错误码为 errorcode.PLANMNG_RELEASE
req.setAttribute("errorId",ErrorCode.PLANMNG_RELEASE);
return (mapping.findForward("error"));
}
}
catch (SysDbException aple)
{
//捕获CommonService系统异常,定向到出错页面,错误码为ErrorCode.COMMONSERVICE_ERROR
aple.printStackTrace();
req.setAttribute("errorId",ErrorCode.COMMONSERVICE_ERROR);
return (mapping.findForward("error"));
}
catch(java.sql.SQLException sqle)
{
//捕获调用aplcoms异常,定向到出错页面,错误码为ErrorCode.DATABASE_ERROR
sqle.printStackTrace();
req.setAttribute("errorId",ErrorCode.DATABASE_ERROR);
return (mapping.findForward("error"));
}
catch(Exception e)
{
//捕获未知异常,定向到出错页面,错误码为ErrorCode.UNKNOW_ERROR
e.printStackTrace();
req.setAttribute("errorId",ErrorCode.UNKNOW_ERROR);
return (mapping.findForward("error"));
}
finally
//关闭连接实例
{
if(aplcoms != null)
{
aplcoms.close();
}
}
}
/****************************************************
* 直接发布计划
****************************************************/
/* private ActionForward releasePland (ActionMapping mapping,
ActionForm form, HttpServletRequest req,
HttpServletResponse res)
{
//得到输入参数
String operatorflag = ((PlanmngForm) form).getOperatorflag();
String senderid = ((PlanmngForm) form).getSenderid();
String recieverid = ((PlanmngForm) form).getRecieverid();
String title = ((PlanmngForm) form).getTitle();
String discription = ((PlanmngForm) form).getDiscription();
String startdate = ((PlanmngForm) form).getStartdate();
String enddate = ((PlanmngForm) form).getEnddate();
String courseid = ((PlanmngForm) form).getCourseid();
String cstarget = ((PlanmngForm) form).getCstarget();
String cscontent = ((PlanmngForm) form).getCscontent();
String testid = ((PlanmngForm) form).getTestid();
String tstarget = ((PlanmngForm) form).getTstarget();
String tscontent = ((PlanmngForm) form).getTscontent();
String staffno = req.getSession().getAttribute("staffno").toString();
String itemid = ((PlanmngForm) form).getItemid();
SysDataSet ds;
SysRecord rc ;
SysDbConn aplcoms = null ;
try
{
//连接数据源
aplcoms = SysConnPool.getInstance().getAplComs();
if (itemid == "" )
{
aplcoms.preparedSP();
//获得输入参数
aplcoms.setString(1,senderid);
aplcoms.setString(2,recieverid);
aplcoms.setString(3,title);
aplcoms.setString(4,discription);
aplcoms.setString(5,startdate);
aplcoms.setString(6,enddate);
aplcoms.setString(7,courseid);
aplcoms.setString(8,cstarget);
aplcoms.setString(9,cscontent);
aplcoms.setString(10,testid);
aplcoms.setString(11,tstarget);
aplcoms.setString(12,tscontent);
aplcoms.setString(13,"1");
ds = aplcoms.csCommonSP("P_Agt_AddPlan");
rc = ds.getParamSet();
}
else
{
aplcoms.preparedSP();
//获得输入参数
aplcoms.setString(1,senderid);
aplcoms.setString(2,recieverid);
aplcoms.setString(3,title);
aplcoms.setString(4,discription);
aplcoms.setString(5,startdate);
aplcoms.setString(6,enddate);
aplcoms.setString(7,courseid);
aplcoms.setString(8,cstarget);
aplcoms.setString(9,cscontent);
aplcoms.setString(10,testid);
aplcoms.setString(11,tstarget);
aplcoms.setString(12,tscontent);
aplcoms.setString(13,"1");
aplcoms.setString(14,itemid);
ds = aplcoms.csCommonSP("P_Agt_UpdatePlan");
rc = ds.getParamSet();
}
if (rc!=null && rc.getInt(0) == 0)
{
return(mapping.findForward("success"));
}
else return(mapping.findForward("error"));
}
catch (SysDbException aple)
{
//捕获CommonService系统异常,定向到出错页面,错误码为ErrorCode.COMMONSERVICE_ERROR
aple.printStackTrace();
req.setAttribute("errorId",ErrorCode.COMMONSERVICE_ERROR);
return (mapping.findForward("error"));
}
catch(java.sql.SQLException sqle)
{
//捕获调用aplcoms异常,定向到出错页面,错误码为ErrorCode.DATABASE_ERROR
req.setAttribute("errorId",ErrorCode.DATABASE_ERROR);
return (mapping.findForward("error"));
}
catch(Exception e)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -