标签:exception nbu button amp hidden 计划 info 格式 getc
//业务控制器类 //查看任务单反馈信息(注:通常是查数据的时候。就是跳转到结果页面) public String view() { try { feedbacklist = feedbackService .getTaskFeedbackInfoListByTaskId(taskinfo.getTaskid()); } catch (Exception e) { e.printStackTrace(); } return "view"; }
//.jsp代码:发出请求 <s:form action="taskInfoAction!save.action" id="myform" method="post" cssClass=‘subForm‘> <s:hidden name=‘taskinfo.taskid‘ /> <div id="bodycontent"> <p align="left"> <font class="title_little">任务情况表</font> </p> <table width="1000" height="" border="1"> <tr> <td class="clum_title" width="125"> 项目编号: </td> <td width="125"> <s:hidden name="taskinfo.projectid" id="projectid"></s:hidden> <s:textfield name="taskinfo.projectcode" maxlength="32" id="projectcode" cssStyle="width:123"/> </td> <td width="125"> 项目简称: </td> <td width="125" colspan="3"> <s:textfield name="taskinfo.projectname" cssClass="required" maxlength="64" id="projectname" cssStyle="width:325" onclick="selectProjectInfo()"/> </td> <!-- <td class="clum_title" width="125"> 项目类型 </td> <td width="125"> <s:select name="taskinfo.tasktype" headerKey="" id="projecttype" cssClass="required" headerValue="--请选择--" list="@com.telewave.projectmanagerweb.util.TwUtil@getDict(‘ProjectType‘)" onchange="showUnitModel(this)"/> </td> <td width="125">所属里程碑</td> <td width="125" id="milestone_td"></td> --> </tr> <tr> <td class="clum_title"> 工作计划 </td> <td colspan="7"> <font class="introduction">(有计划必须填写)</font> <s:hidden name="taskinfo.workplanid" id="workplanid" /> 计划名称: <s:textfield name="planname" cssClass="required" maxlength="64" id="planname" cssStyle="width:160" /> 计划拟制人: <s:textfield name="workplanname" cssClass="" maxlength="64" id="workplanname" cssStyle="width:205" /> <input type="button" value="选择计划信息" onclick="selectWorkPlanInfo(‘add‘)" style="width: 125" /> </td> </tr> <tr> <td class="clum_title"> 任务名称 </td> <td colspan="2"> <s:textfield name="taskinfo.taskname" cssClass="required" cssStyle="width: 100%" maxlength="64" /> </td> <td> 所属部门 </td> <td colspan="2"> <s:select list="organs" name="taskinfo.departmentid" listKey="organcode" listValue="organname" headerKey="" headerValue="--请选择--" cssClass="required"/> </td> <td> 计划外任务单 </td> <td> <s:select list="#{‘1‘:‘是‘,‘0‘:‘否‘}" name="taskinfo.outofplan" headerValue="--请选择--" cssClass="required"/> </td> </tr>
//业务控制器类 // 保存或者改动领导批示信息 public void save() { try { /* 新增任务单基本信息 */ // 获取自己主动生成的id String guidid = GuidManager.GetGuid(); taskinfo.setTaskid(guidid); taskinfo.setLockstate("0"); taskinfo.setTaskcode(this.getTaskcode());// add by hql 20101108 // 新增一条任务单基本信息 if("1".equals(taskinfo.getOutofplan())){ Workplandetail workplandetail=new Workplandetail(); workplandetail.setWorkplandetailid(GuidManager.GetGuid()); workplandetail.setWorkplanid(taskinfo.getWorkplanid()); workplandetail.setPrincipal(taskinfo.getWorkplanname()); workplandetail.setWorkdescription(taskinfo.getTaskname()); workplandetail.setStartdate(taskinfo.getBegindated()); workplandetail.setEnddate(taskinfo.getEnddate()); workplandetail.setPrincipal(taskinfo.getAcceptperson()); workplandetail.setProjectid(taskinfo.getProjectid()); workplandetail.setProjectname(taskinfo.getProjectname()); workplandetail.setPlanresult(taskinfo.getOutputResult()); workplandetail.setWorkcontent(taskinfo.getWorkrequired()); workplandetail.setPlanworkload(taskinfo.getWorkload()); workplandetail.setTaskrelated("是"); plandetailService.save(workplandetail); taskinfo.setWorkplanid(workplandetail.getWorkplandetailid()); } taskinfoService.addTaskinfo(taskinfo); /* 新增任务单方法 */ /* 假设页面中的变更信息不为空,则新增一条变更信息的记录 if (!StringUtils.isNull(changeinfo.getChangecontent())) { // 设置变更信息的外键 changeinfo.setTaskid(guidid); // 新增一条变更信息 changeinfoService.save(changeinfo); } 新增变更信息方法 */ /* 假设页面中的绩效考核信息不为空,则新增一条绩效考核信息的记录 */ if (!isEmpty(evaluateinfo)) { if (!StringUtils.isNull(evaluateinfo.getEvakuateremark()) || !StringUtils.isNull(evaluateinfo.getEvaluatetotalscore()) || !StringUtils.isNull(evaluateinfo.getExecutionevaluatscore()) || !StringUtils.isNull(evaluateinfo.getQualityevaluatscore()) || !StringUtils.isNull(evaluateinfo.getScheduleevaluatscore())) { // 新增绩效考核信息 evaluateinfo.setTaskid(guidid); evaluateinfoService.addTaskresultevaluationinfo(evaluateinfo); } }/* 新增绩效考核信息方法 */ // 新增工作产物信息 if (list!=null&&!list.isEmpty()) { for (int i = 0; i < list.size(); i++) { Taskworkproductinfo workproductentity = new Taskworkproductinfo(); workproductentity = list.get(i); if (!isEmpty(workproductentity)) { if (!isNullWorkProductEntity(workproductentity)) { workproductentity.setTaskid(guidid); String productid = GuidManager.GetGuid(); workproductentity.setId(productid); workproductService.addTaskworkproductinfo(workproductentity); } else { if (!isEmpty(workproductentity.getId())) { workproductService.deleteTaskworkproductinfo(workproductentity.getId()); } } } } } super.printSuccssMsg("新增信息成功", guidid); } catch (Exception e) { super.printFaitureMsg("新增信息失败"); log.error(e.getMessage(), e); } }
//业务控制器类的父类 /** * 响应数据-成功 * @param successMessage * @param id */ protected void printSuccssMsg(String successMessage, String id) { try { if (isEmpty(id)) getResponse().getWriter().print( "{success:true,tip:‘成功提示‘,msg:‘" + successMessage + "‘,Data:‘‘}"); else getResponse().getWriter().print( "{success:true,id:‘" + id + "‘,tip:‘成功提示‘,msg:‘" + successMessage + "‘,Data:‘‘}"); } catch (Exception localException) { } }
//.js代码:发出请求 // 遮罩层-注冊 function register1(){ // 提交表单 var form = document.getElementById("register"); var param = $("#register").serialize(); $.post(form.action, param, function(json){ if(json.success){ $.unblockUI(); // 退出遮罩层 window.location = "registerSuccess.jsp"; //发起一次新的请求 }else{ alert("注冊失败!"); } }, "json"); }
//配置文件 <struts> <package name="loginPackage" extends="struts-default" namespace="/login"> <action name="register" class="loginControllerBean" method="register"></action> </package> </struts>
//业务控制器类 public void register(){ // loginBusiness.register(user); // try { response.getWriter().print("{\"success\":\"true\",\"data\":\"\"}"); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } }
标签:exception nbu button amp hidden 计划 info 格式 getc
原文地址:http://www.cnblogs.com/tlnshuju/p/6723166.html