文章标题
来源:互联网 发布:caxa编程助手安装 编辑:程序博客网 时间:2024/05/22 06:46
第三步 action
package com.isoftstone.zfmi.struts.action.claim;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import com.isoftstone.iaeap.op.DBPersistenceManager;
import com.isoftstone.iaeap.op.OPSysManager;
import com.isoftstone.iaeap.op.QuerySet;
import com.isoftstone.zfmi.boc.Application.entity.Code;
import com.isoftstone.zfmi.boc.Application.entity.Codefilee;
/**
* @author 1
* wj 编码规则多级菜单的跳转
*
*/
public class ProjectAction extends Action{
public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { // TODO 自动生成方法存根 String aa = request.getParameter("project"); List realsubcodetypeList = new ArrayList(); List<Codefilee> list4 = new ArrayList(); Object[] paras = {}; DBPersistenceManager dbpm = OPSysManager.getInstance().getDBPersistenceManager(); try{ dbpm.currentTransaction().begin(); String sql3="SELECT a.realsubcodetype FROM tb_code_filee a where flag='1' group by realsubcodetype,grade order by grade"; QuerySet dptSet2 = dbpm.executeQuery(sql3, paras); int num3 = dptSet2.getRowCount(); if(num3>0){ for( int i=1; i<= num3; i++ ){ String realsubcodetype =dptSet2.getString(i,"realsubcodetype");//标题编号 realsubcodetypeList.add(realsubcodetype); } } for (int i = 0; i < realsubcodetypeList.size(); i++) { String strRealsubcodetype = (String)realsubcodetypeList.get(i); Object[] paras1 = {strRealsubcodetype}; String sql1 = " SELECT t.* FROM tb_code_filee t where realsubcodetype=? "; QuerySet dptSet = dbpm.executeQuery(sql1, paras1); int num = dptSet.getRowCount(); if(num>0){ List list = new ArrayList(); for( int j=1; j<= num; j++ ){ String codecode= dptSet.getString(j,"codecode");//上级代码 String subcode = dptSet.getString(j,"subcode");//本级代码 String realsubcode= dptSet.getString(j,"realsubcode");//本级编号 String realsubcodetype =dptSet.getString(j,"realsubcodetype");//标题编号 String realsubcname = dptSet.getString(j,"realsubcname");//标题名字 String subcodecname = dptSet.getString(j,"subcodecname");//属性中文名 String grade = dptSet.getString(j,"grade");//等级 Code code =new Code(); code.setCodecode(codecode); code.setSubcode (subcode ); code.setRealsubcode(realsubcode); code.setRealsubcodetype(realsubcodetype); code.setRealsubcname(realsubcname); code.setSubcodecname(subcodecname); code.setGrade(grade); list.add(code); } Codefilee codefileeDto = new Codefilee(); codefileeDto.setTitleName(((Code)list.get(0)).getRealsubcname()); codefileeDto.setGrade(((Code)list.get(0)).getGrade()); codefileeDto.setSubCode(((Code)list.get(0)).getSubcode()); codefileeDto.setRealsubcode(((Code)list.get(0)).getRealsubcode()); codefileeDto.setCodecode(((Code)list.get(0)).getCodecode()); codefileeDto.setListcode(list); list4.add(codefileeDto); } } dbpm.currentTransaction().commit(); dbpm.close(); }catch(Exception ex){ } request.setAttribute("list4", list4);//传值到前端 //log.debug(mapping.getInputForward()); return mapping.findForward("result"); //返回到配置文件指定路径跳转jsp页面 result}
}
- 文章标题文章标题文章标题文章标题文章标题文章标题文章标题文章标题文章标题文章标题文章标题文章标题文章标题文章标题文章标题文章标题文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题 文章标题 文章标题 文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题
- 好帖子地址
- Python2与Python3同时下载与使用的技巧
- 对图片做处理的一个的工具类
- oracle case then用法
- iOS开发笔记12:iOS7上UITextField限制字数输入导致崩溃问题
- 文章标题
- 微信支付错误两个问题的解决:curl出错,错误码:60
- Tree树状结构显示(dtree、xtree、ExtTree、E3tree、ztree)区别
- 深度学习概述:从感知机到深度网络
- Error:Cause: org/gradle/api/publication/maven/internal/DefaultMavenFactory
- 如何从Seacert公司订购Marlin IPTV-ES Keys
- 十一黄金周你非去不可的十大胜地!
- 文章标题
- 前端开发必备!Emmet(Zen Coding)使用手册