IndexAction.java~559~
上传用户:zghglow
上传日期:2022-08-09
资源大小:27227k
文件大小:31k
源码类别:

WEB源码(ASP,PHP,...)

开发平台:

JavaScript

  1. package com.chinacannel.xlchemical.struts.Action;
  2. import org.apache.struts.actions.DispatchAction;
  3. import org.apache.struts.action.ActionForward;
  4. import javax.servlet.http.HttpServletRequest;
  5. import org.apache.struts.action.ActionMapping;
  6. import javax.servlet.http.HttpServletResponse;
  7. import org.apache.struts.action.ActionForm;
  8. import java.util.List;
  9. import java.util.ArrayList;
  10. import com.chinacannel.entity.*;
  11. import com.chinacannel.xlchemical.struts.Vo.ModelVo;
  12. import com.chinacannel.common.PageInfo;
  13. import com.chinacannel.xlchemical.service.*;
  14. import com.chinacannel.xlchemical.struts.ActionForm.AdminActionForm;
  15. import java.io.IOException;
  16. public class IndexAction extends DispatchAction {
  17.     IndexService is = new IndexService();
  18.     MenuService ms = new MenuService();
  19.     CategoryService cs = new CategoryService();
  20.     InformationService infs = new InformationService();
  21.     DownLoadService ds = new DownLoadService();
  22.     LeaveWordService ls = new LeaveWordService();
  23.     ProductService ps = new ProductService();
  24.     JobsService js = new JobsService();
  25.     LinkService links = new LinkService();
  26.     public ActionForward OpenIndex(ActionMapping actionMapping,
  27.                                    ActionForm actionForm,
  28.                                    HttpServletRequest servletRequest,
  29.                                    HttpServletResponse servletResponse) {
  30.         List list = null;
  31.         String Language = "CN";
  32.         List LinkList1 = null;
  33.         List LinkList2 = null;
  34.         try {
  35.             if (servletRequest.getParameter("Language") != null) {
  36.                 Language = servletRequest.getParameter("Language");
  37.                 servletRequest.getSession().setAttribute("Language", Language);
  38.                 servletRequest.getSession().setMaxInactiveInterval(60 * 60 * 24);
  39.             } else {
  40.                 if (servletRequest.getSession().getAttribute("Language") != null) {
  41.                     Language = servletRequest.getSession().getAttribute(
  42.                             "Language").toString();
  43.                 } else {
  44.                     servletRequest.getSession().setAttribute("Language",
  45.                             Language);
  46.                 }
  47.             }
  48.             is.beginTran();
  49.             list = is.GetIndexMenu(Language);
  50.             LinkList1 = links.GetLinkByType(new Long(1));
  51.             LinkList2 = links.GetLinkByType(new Long(2));
  52.             servletRequest.setAttribute("LinkList1", LinkList1);
  53.             servletRequest.setAttribute("LinkList2", LinkList2);
  54.             is.commit();
  55.         } catch (Exception ex) {
  56.             log.error(ex.getMessage(), ex);
  57.             try {
  58.                 is.rollback();
  59.             } catch (Exception ex2) {
  60.                 log.error(ex2.getMessage(), ex2);
  61.             }
  62.         }
  63.         if (list.size() > 0) {
  64.             servletRequest.setAttribute("menu1", (Menu) list.get(0));
  65.         }
  66.         if (list.size() > 1) {
  67.             servletRequest.setAttribute("menu2", (Menu) list.get(1));
  68.         }
  69.         if (list.size() > 2) {
  70.             servletRequest.setAttribute("menu3", (Menu) list.get(2));
  71.         }
  72.         if (list.size() > 3) {
  73.             servletRequest.setAttribute("menu4", (Menu) list.get(3));
  74.         }
  75.         return actionMapping.findForward("OpenIndex");
  76.     }
  77.     private void LeftMenu(String Language, HttpServletRequest servletRequest) {
  78.         List menuList = null;
  79.         Menu fMenu = null;
  80.         Long fMenuID = new Long(0);
  81.         if (servletRequest.getParameter("fMenuID") != null) {
  82.             fMenuID = new Long(servletRequest.getParameter("fMenuID"));
  83.         }
  84.         fMenu = ms.GetMenuById(fMenuID);
  85.         menuList = ms.GetMenuBySuperior(fMenuID, Language);
  86.         servletRequest.setAttribute("menu", fMenu);
  87.         servletRequest.setAttribute("menuList", menuList);
  88.     }
  89.     public ActionForward ShowMenu(ActionMapping actionMapping,
  90.                                   ActionForm actionForm,
  91.                                   HttpServletRequest servletRequest,
  92.                                   HttpServletResponse servletResponse) throws
  93.             IOException {
  94.         String Language = "CN";
  95.         String key = "";
  96.         String s = "";
  97.         try {
  98.             if (servletRequest.getSession().getAttribute("Language") != null) {
  99.                 Language = servletRequest.getSession().getAttribute("Language").
  100.                            toString();
  101.             }
  102.             if (servletRequest.getParameter("key") != null) {
  103.                 key = servletRequest.getParameter("key");
  104.             }
  105.             ms.beginTran();
  106.             Menu menu1 = ms.GetMenuByKey(key + Language);
  107.             List menuList = ms.GetMenuBySuperior(menu1.getMen_ID(), Language);
  108.             ms.commit();
  109.             for (int i = 0; i < menuList.size(); i++) {
  110.                 Menu menu = (Menu) menuList.get(i);
  111.                 if (s == "") {
  112.                     s = "{"name":"" + menu.getMen_DefaultName() +
  113.                         "","fId":"" + menu.getMen_Superior() +
  114.                         "","cId":"" + menu.getMen_ID() + ""}";
  115.                 } else {
  116.                     s += "," + "{"name":"" + menu.getMen_DefaultName() +
  117.                             "","fId":"" + menu.getMen_Superior() +
  118.                             "","cId":"" + menu.getMen_ID() + ""}";
  119.                 }
  120.             }
  121.         } catch (Exception ex) {
  122.             log.error(ex.getMessage(), ex);
  123.             try {
  124.                 is.rollback();
  125.             } catch (Exception ex2) {
  126.                 log.error(ex2.getMessage(), ex2);
  127.             }
  128.         }
  129.         servletResponse.setCharacterEncoding("GBK");
  130.         servletResponse.getWriter().write("[" + s + "]");
  131.         return actionMapping.findForward("ShowMenu");
  132.     }
  133.     public ActionForward OpenIndexMenu(ActionMapping actionMapping,
  134.                                        ActionForm actionForm,
  135.                                        HttpServletRequest servletRequest,
  136.                                        HttpServletResponse servletResponse) {
  137.         String key = "";
  138.         Long cMenuID = new Long(0);
  139.         List menuList = null;
  140.         Menu menu = null;
  141.         Menu fMenu = null;
  142.         String title = "";
  143.         String Language = "CN";
  144.         Long fMenuID = new Long(0);
  145.         try {
  146.             pageNo = Integer.parseInt(servletRequest.getParameter("pageNo"));
  147.         } catch (Exception ex1) {}
  148.         try {
  149.             if (servletRequest.getSession().getAttribute("Language") != null) {
  150.                 Language = servletRequest.getSession().getAttribute("Language").
  151.                            toString();
  152.             }
  153.             if (servletRequest.getParameter("key") != null) {
  154.                 key = servletRequest.getParameter("key");
  155.             }
  156.             if (servletRequest.getParameter("fMenuID") != null) {
  157.                 fMenuID = new Long(servletRequest.getParameter("fMenuID"));
  158.             }
  159.             if (servletRequest.getParameter("cMenuID") != null) {
  160.                 cMenuID = new Long(servletRequest.getParameter("cMenuID"));
  161.             }
  162.             ms.beginTran();
  163.             if (!key.equals("")) {
  164.                 fMenu = ms.GetMenuByKey(key);
  165.             } else {
  166.                 fMenu = ms.GetMenuById(fMenuID);
  167.             }
  168.             menuList = ms.GetMenuBySuperior(fMenu.getMen_ID(), Language);
  169.             if (!cMenuID.equals(new Long(0))) {
  170.                 menu = ms.GetMenuById(cMenuID);
  171.             } else {
  172.                 menu = (Menu) menuList.get(0);
  173.             }
  174.             if (menu != null) {
  175.                 if (!menu.getMen_Default().equals(new Long(1))) {
  176.                     if (menu.getMen_Type().equals(new Long(0))) {
  177.                         Information inf = infs.GetFirstInformationByMenuID(menu.
  178.                                 getMen_ID());
  179.                         if (inf != null) {
  180.                             title = inf.getInf_Title();
  181.                             servletRequest.setAttribute("inf", inf);
  182.                         }
  183.                     } else {
  184.                         PageInfo pageInfo = infs.getPageInfo("", null, menu, "",
  185.                                 menu.getMen_Language(), 0);
  186.                         title = menu.getMen_Name();
  187.                         servletRequest.setAttribute("type", menu.getMen_Type());
  188.                         servletRequest.setAttribute("pageInfo", pageInfo);
  189.                     }
  190.                 } else {
  191.                     String url = menu.getMen_Url() + "&fMenuID=" + fMenu.getMen_ID();
  192.                     servletRequest.setAttribute("url", url);
  193.                     return actionMapping.findForward("Jumping");
  194.                 }
  195.             }
  196.             ms.commit();
  197.         } catch (Exception ex) {
  198.             log.error(ex.getMessage(), ex);
  199.             try {
  200.                 is.rollback();
  201.             } catch (Exception ex2) {
  202.                 log.error(ex2.getMessage(), ex2);
  203.             }
  204.         }
  205.         servletRequest.setAttribute("title", title);
  206.         servletRequest.setAttribute("menu", fMenu);
  207.         servletRequest.setAttribute("menuList", menuList);
  208.         if (menu.getMen_Type().equals(new Long(0))) {
  209.             return actionMapping.findForward("OpenInfo");
  210.         } else if (menu.getMen_Type().equals(new Long(1))) {
  211.             return actionMapping.findForward("OpenList1");
  212.         } else if (menu.getMen_Type().equals(new Long(2))) {
  213.             return actionMapping.findForward("OpenList2");
  214.         } else if (menu.getMen_Type().equals(new Long(3))) {
  215.             return actionMapping.findForward("OpenList3");
  216.         } else {
  217.             return actionMapping.findForward("OpenList4");
  218.         }
  219.     }
  220.     public ActionForward OpenInfo(ActionMapping actionMapping,
  221.                                   ActionForm actionForm,
  222.                                   HttpServletRequest servletRequest,
  223.                                   HttpServletResponse servletResponse) {
  224.         Long type = new Long(0);
  225.         Information inf = null;
  226.         Long fMenuID = new Long(0);
  227.         Menu fMenu = null;
  228.         List menuList = null;
  229.         String Language = "CN";
  230.         try {
  231.             if (servletRequest.getSession().getAttribute("Language") != null) {
  232.                 Language = servletRequest.getSession().getAttribute("Language").
  233.                            toString();
  234.             }
  235.             if (servletRequest.getParameter("type") != null) {
  236.                 type = new Long(servletRequest.getParameter("type"));
  237.             }
  238.             if (servletRequest.getParameter("fMenuID") != null) {
  239.                 fMenuID = new Long(servletRequest.getParameter("fMenuID"));
  240.             }
  241.             infs.beginTran();
  242.             fMenu = ms.GetMenuById(fMenuID);
  243.             menuList = ms.GetMenuBySuperior(fMenuID, Language);
  244.             inf = infs.GetInformationById(new Long(servletRequest.
  245.                     getParameter("infID")));
  246.             if (inf.getInf_Click() == null) {
  247.                 inf.setInf_Click(new Long(1));
  248.             } else {
  249.                 inf.setInf_Click(inf.getInf_Click() + new Long(1));
  250.             }
  251.             infs.UpdateInformation(inf);
  252.             infs.commit();
  253.         } catch (Exception ex) {
  254.             log.error(ex.getMessage(), ex);
  255.             try {
  256.                 is.rollback();
  257.             } catch (Exception ex2) {
  258.                 log.error(ex2.getMessage(), ex2);
  259.             }
  260.         }
  261.         servletRequest.setAttribute("inf", inf);
  262.         servletRequest.setAttribute("menu", fMenu);
  263.         servletRequest.setAttribute("menuList", menuList);
  264.         if (!type.equals(new Long(4))) {
  265.             return actionMapping.findForward("OpenInfo1");
  266.         } else {
  267.             return actionMapping.findForward("OpenInfo2");
  268.         }
  269.     }
  270.     public ActionForward OpenMenu(ActionMapping actionMapping,
  271.                                   ActionForm actionForm,
  272.                                   HttpServletRequest servletRequest,
  273.                                   HttpServletResponse servletResponse) {
  274.         Admin adm = null;
  275.         List fModelList = new ArrayList();
  276.         List cModelList = new ArrayList();
  277.         Role role = null;
  278.         RoleService rs = new RoleService();
  279.         ModelService ms = new ModelService();
  280.         try {
  281.             rs.beginTran();
  282.             adm = (Admin) servletRequest.getSession().getAttribute("admin");
  283.             role = rs.GetRoleById(adm.getRole().getRol_ID());
  284.             String[] fmodels = role.getRol_FModel().split(",");
  285.             String[] cmodels = role.getRol_CModel().split(",");
  286.             for (int i = 0; i < cmodels.length; i++) {
  287.                 cModelList.add(cmodels[i]);
  288.             }
  289.             for (int i = 0; i < fmodels.length; i++) {
  290.                 ModelVo mv = new ModelVo();
  291.                 Model model = ms.GetModelByKey(fmodels[i]);
  292.                 mv.setMod_CnName(model.getMod_CnName());
  293.                 mv.setMod_EnName(model.getMod_EnName());
  294.                 mv.setMod_ID(model.getMod_ID());
  295.                 mv.setMod_Key(model.getMod_Key());
  296.                 mv.setMod_Order(model.getMod_Order());
  297.                 mv.setMod_Superior(model.getMod_Superior());
  298.                 mv.setMod_Url(model.getMod_Url());
  299.                 mv.setMod_EnUrl(model.getMod_EnUrl());
  300.                 List childList = ms.GetChildModel(model.getMod_ID());
  301.                 List cList = new ArrayList();
  302.                 for (int j = 0; j < childList.size(); j++) {
  303.                     Model cmod = (Model) childList.get(j);
  304.                     if (cModelList.contains(cmod.getMod_Key())) {
  305.                         cList.add(cmod);
  306.                     }
  307.                 }
  308.                 mv.setChildModel(cList);
  309.                 fModelList.add(mv);
  310.             }
  311.             rs.commit();
  312.         } catch (Exception ex) {
  313.             log.error(ex.getMessage(), ex);
  314.             try {
  315.                 is.rollback();
  316.             } catch (Exception ex2) {
  317.                 log.error(ex2.getMessage(), ex2);
  318.             }
  319.         }
  320.         servletRequest.setAttribute("modelLength", fModelList.size());
  321.         servletRequest.setAttribute("modelList", fModelList);
  322.         return actionMapping.findForward("OpenMenu");
  323.     }
  324.     //打开后台首页
  325.     public ActionForward OpenBackIndex(ActionMapping actionMapping,
  326.                                        ActionForm actionForm,
  327.                                        HttpServletRequest servletRequest,
  328.                                        HttpServletResponse servletResponse) {
  329.         String language = "CN";
  330.         try {
  331.             if (servletRequest.getParameter("Language") != null) {
  332.                 language = servletRequest.getParameter("Language");
  333.             }
  334.             servletRequest.getSession().setAttribute("Language", language);
  335.             servletRequest.getSession().setMaxInactiveInterval(60 * 60 * 24);
  336.         } catch (Exception ex) {
  337.             log.error(ex.getMessage(), ex);
  338.             try {
  339.                 is.rollback();
  340.             } catch (Exception ex2) {
  341.                 log.error(ex2.getMessage(), ex2);
  342.             }
  343.         }
  344.         return actionMapping.findForward("OpenBackIndex");
  345.     }
  346.     public ActionForward ShowHonnors(ActionMapping actionMapping,
  347.                                      ActionForm actionForm,
  348.                                      HttpServletRequest servletRequest,
  349.                                      HttpServletResponse servletResponse) {
  350.         String Language = "CN";
  351.         List list = null;
  352.         try {
  353.             if (servletRequest.getSession().getAttribute("Language") != null) {
  354.                 Language = servletRequest.getSession().getAttribute("Language").
  355.                            toString();
  356.             }
  357.             cs.beginTran();
  358.             LeftMenu(Language, servletRequest);
  359.             list = cs.getCategoryListByKey("QYRY", Language);
  360.             cs.commit();
  361.         } catch (Exception ex) {
  362.             log.error(ex.getMessage(), ex);
  363.             try {
  364.                 cs.rollback();
  365.             } catch (Exception ex2) {
  366.                 log.error(ex2.getMessage(), ex2);
  367.             }
  368.         }
  369.         servletRequest.setAttribute("categoryList", list);
  370.         return actionMapping.findForward("ShowHonnors");
  371.     }
  372.     public ActionForward ShowDownLoad(ActionMapping actionMapping,
  373.                                       ActionForm actionForm,
  374.                                       HttpServletRequest servletRequest,
  375.                                       HttpServletResponse servletResponse) {
  376.         int pageNo = 0;
  377.         PageInfo pageInfo = null;
  378.         String Language = "CN";
  379.         Long type = new Long(0);
  380.         String title = "";
  381.         try {
  382.             pageNo = Integer.parseInt(servletRequest.getParameter("pageNo"));
  383.         } catch (Exception ex1) {}
  384.         try {
  385.             if (servletRequest.getSession().getAttribute("Language") != null) {
  386.                 Language = servletRequest.getSession().getAttribute("Language").
  387.                            toString();
  388.             }
  389.             if (servletRequest.getParameter("Type") != null) {
  390.                 type = new Long(servletRequest.getParameter("Type"));
  391.             }
  392.             ds.beginTran();
  393.             LeftMenu(Language, servletRequest);
  394.             pageInfo = ds.getPageInfo(type, Language, pageNo);
  395.             if (type.equals(new Long(1))) {
  396.                 if (Language.equals("CN")) {
  397.                     title = "公司报告";
  398.                 } else {
  399.                     title = "Company Reports";
  400.                 }
  401.             } else if (type.equals(new Long(0))) {
  402.                 if (Language.equals("CN")) {
  403.                     title = "运营数据";
  404.                 } else {
  405.                     title = "Operators Data";
  406.                 }
  407.             }
  408.             ds.commit();
  409.         } catch (Exception ex) {
  410.             log.error(ex.getMessage(), ex);
  411.             try {
  412.                 cs.rollback();
  413.             } catch (Exception ex2) {
  414.                 log.error(ex2.getMessage(), ex2);
  415.             }
  416.         }
  417.         servletRequest.setAttribute("title", title);
  418.         servletRequest.setAttribute("pageInfo", pageInfo);
  419.         return actionMapping.findForward("ShowDownLoad");
  420.     }
  421.     public ActionForward ShowLeaveWord(ActionMapping actionMapping,
  422.                                        ActionForm actionForm,
  423.                                        HttpServletRequest servletRequest,
  424.                                        HttpServletResponse servletResponse) {
  425.         String Language = "CN";
  426.         int pageNo = 0;
  427.         PageInfo pageInfo = null;
  428.         try {
  429.             pageNo = Integer.parseInt(servletRequest.getParameter("pageNo"));
  430.         } catch (Exception ex1) {}
  431.         try {
  432.             if (servletRequest.getSession().getAttribute("Language") != null) {
  433.                 Language = servletRequest.getSession().getAttribute("Language").
  434.                            toString();
  435.             }
  436.             ls.beginTran();
  437.             LeftMenu(Language, servletRequest);
  438.             pageInfo = ls.getPageInfo(Language, "1", pageNo);
  439.             ls.commit();
  440.         } catch (Exception ex) {
  441.             log.error(ex.getMessage(), ex);
  442.             try {
  443.                 ls.rollback();
  444.             } catch (Exception ex2) {
  445.                 log.error(ex2.getMessage(), ex2);
  446.             }
  447.         }
  448.         servletRequest.setAttribute("pageInfo", pageInfo);
  449.         return actionMapping.findForward("ShowLeaveWord");
  450.     }
  451.     public ActionForward ShowContact(ActionMapping actionMapping,
  452.                                      ActionForm actionForm,
  453.                                      HttpServletRequest servletRequest,
  454.                                      HttpServletResponse servletResponse) {
  455.         String Language = "CN";
  456.         try {
  457.             if (servletRequest.getSession().getAttribute("Language") != null) {
  458.                 Language = servletRequest.getSession().getAttribute("Language").
  459.                            toString();
  460.             }
  461.             LeftMenu(Language, servletRequest);
  462.         } catch (Exception ex) {
  463.             log.error(ex.getMessage(), ex);
  464.             try {
  465.                 ls.rollback();
  466.             } catch (Exception ex2) {
  467.                 log.error(ex2.getMessage(), ex2);
  468.             }
  469.         }
  470.         return actionMapping.findForward("ShowContact");
  471.     }
  472.     public ActionForward OpenProduct(ActionMapping actionMapping,
  473.                                      ActionForm actionForm,
  474.                                      HttpServletRequest servletRequest,
  475.                                      HttpServletResponse servletResponse) {
  476.         int pageNo = 0;
  477.         String Language = "CN";
  478.         PageInfo pageInfo = null;
  479.         try {
  480.             pageNo = Integer.parseInt(servletRequest.getParameter("pageNo"));
  481.         } catch (Exception ex1) {}
  482.         try {
  483.             if (servletRequest.getSession().getAttribute("Language") != null) {
  484.                 Language = servletRequest.getSession().getAttribute("Language").
  485.                            toString();
  486.             }
  487.             ps.beginTran();
  488.             LeftMenu(Language, servletRequest);
  489.             pageInfo = ps.getPageInfo(Language, pageNo);
  490.             ps.commit();
  491.         } catch (Exception ex) {
  492.             log.error(ex.getMessage(), ex);
  493.             try {
  494.                 ps.rollback();
  495.             } catch (Exception ex2) {
  496.                 log.error(ex2.getMessage(), ex2);
  497.             }
  498.         }
  499.         servletRequest.setAttribute("pageInfo", pageInfo);
  500.         return actionMapping.findForward("OpenProduct");
  501.     }
  502.     public ActionForward OpenJobs(ActionMapping actionMapping,
  503.                                   ActionForm actionForm,
  504.                                   HttpServletRequest servletRequest,
  505.                                   HttpServletResponse servletResponse) {
  506.         int pageNo = 0;
  507.         String Language = "CN";
  508.         PageInfo pageInfo = null;
  509.         try {
  510.             pageNo = Integer.parseInt(servletRequest.getParameter("pageNo"));
  511.         } catch (Exception ex1) {}
  512.         try {
  513.             if (servletRequest.getSession().getAttribute("Language") != null) {
  514.                 Language = servletRequest.getSession().getAttribute("Language").
  515.                            toString();
  516.             }
  517.             js.beginTran();
  518.             LeftMenu(Language, servletRequest);
  519.             pageInfo = js.getPageInfo(Language, pageNo);
  520.             js.commit();
  521.         } catch (Exception ex) {
  522.             log.error(ex.getMessage(), ex);
  523.             try {
  524.                 js.rollback();
  525.             } catch (Exception ex2) {
  526.                 log.error(ex2.getMessage(), ex2);
  527.             }
  528.         }
  529.         servletRequest.setAttribute("pageInfo", pageInfo);
  530.         return actionMapping.findForward("OpenJobs");
  531.     }
  532.     public ActionForward ShowInvitesInfo(ActionMapping actionMapping,
  533.                                          ActionForm actionForm,
  534.                                          HttpServletRequest servletRequest,
  535.                                          HttpServletResponse servletResponse) {
  536.         Jobs jobs = null;
  537.         boolean b = false;
  538.         String Language = "CN";
  539.         try {
  540.             if (servletRequest.getSession().getAttribute("Language") != null) {
  541.                 Language = servletRequest.getSession().getAttribute("Language").
  542.                            toString();
  543.             }
  544.             js.beginTran();
  545.             LeftMenu(Language, servletRequest);
  546.             jobs = js.GetJobsById(new Long(servletRequest.getParameter("jobID")));
  547.             jobs.setJob_Click(jobs.getJob_Click() + new Long(1));
  548.             b = js.UpdateJobs(jobs);
  549.             js.commit();
  550.         } catch (Exception ex) {
  551.             log.error(ex.getMessage(), ex);
  552.             try {
  553.                 js.rollback();
  554.             } catch (Exception ex2) {
  555.                 log.error(ex2.getMessage(), ex2);
  556.             }
  557.         }
  558.         if (b == false) {
  559.         }
  560.         servletRequest.setAttribute("jobs", jobs);
  561.         return actionMapping.findForward("ShowInvitesInfo");
  562.     }
  563.     public ActionForward ShowLink(ActionMapping actionMapping,
  564.                                   ActionForm actionForm,
  565.                                   HttpServletRequest servletRequest,
  566.                                   HttpServletResponse servletResponse) {
  567.         int pageNo = 0;
  568.         PageInfo pageInfo = null;
  569.         String Language = "CN";
  570.         try {
  571.             pageNo = Integer.parseInt(servletRequest.getParameter("pageNo"));
  572.         } catch (Exception ex1) {}
  573.         try {
  574.             if (servletRequest.getSession().getAttribute("Language") != null) {
  575.                 Language = servletRequest.getSession().getAttribute("Language").
  576.                            toString();
  577.             }
  578.             ls.beginTran();
  579.             LeftMenu(Language, servletRequest);
  580.             pageInfo = links.getPageInfo(new Long(3), pageNo);
  581.             ls.commit();
  582.         } catch (Exception ex) {
  583.             log.error(ex.getMessage(), ex);
  584.             try {
  585.                 ls.rollback();
  586.             } catch (Exception ex2) {
  587.                 log.error(ex2.getMessage(), ex2);
  588.             }
  589.         }
  590.         servletRequest.setAttribute("pageInfo", pageInfo);
  591.         return actionMapping.findForward("ShowLink");
  592.     }
  593.     public ActionForward ShowMap(ActionMapping actionMapping,
  594.                                  ActionForm actionForm,
  595.                                  HttpServletRequest servletRequest,
  596.                                  HttpServletResponse servletResponse) {
  597.         String Language = "CN";
  598.         try {
  599.             if (servletRequest.getSession().getAttribute("Language") != null) {
  600.                 Language = servletRequest.getSession().getAttribute("Language").
  601.                            toString();
  602.             }
  603.             ms.beginTran();
  604.             LeftMenu(Language, servletRequest);
  605.             MapSubmit("QYXX", servletRequest);
  606.             MapSubmit("QYWH", servletRequest);
  607.             MapSubmit("XWGG", servletRequest);
  608.             MapSubmit("GDTD", servletRequest);
  609.             MapSubmit("SCJY", servletRequest);
  610.             MapSubmit("LLZY", servletRequest);
  611.             ms.commit();
  612.         } catch (Exception ex) {
  613.             log.error(ex.getMessage(), ex);
  614.             try {
  615.                 ls.rollback();
  616.             } catch (Exception ex2) {
  617.                 log.error(ex2.getMessage(), ex2);
  618.             }
  619.         }
  620.         return actionMapping.findForward("ShowMap");
  621.     }
  622.     private void MapSubmit(String ColumnName, HttpServletRequest servletRequest) {
  623.         Menu menu = null;
  624.         List list = null;
  625.         String Language = "CN";
  626.         if (servletRequest.getSession().getAttribute("Language") != null) {
  627.             Language = servletRequest.getSession().getAttribute("Language").
  628.                        toString();
  629.         }
  630.         menu = ms.GetMenuByKey(ColumnName + Language);
  631.         list = ms.GetMenuBySuperior(menu.getMen_ID(), Language);
  632.         servletRequest.setAttribute(ColumnName + "List", list);
  633.     }
  634.     public ActionForward SearchIndex(ActionMapping actionMapping,
  635.                                      ActionForm actionForm,
  636.                                      HttpServletRequest servletRequest,
  637.                                      HttpServletResponse servletResponse) {
  638.         AdminActionForm aaf = (AdminActionForm) actionForm;
  639.         int pageNo = 0;
  640.         PageInfo pageInfo = null;
  641.         String Language = "CN";
  642.         try {
  643.             pageNo = Integer.parseInt(servletRequest.getParameter("pageNo"));
  644.         } catch (Exception ex1) {}
  645.         try {
  646.             if (servletRequest.getSession().getAttribute("Language") != null) {
  647.                 Language = servletRequest.getSession().getAttribute("Language").
  648.                            toString();
  649.             }
  650.             is.beginTran();
  651.             pageInfo = is.getPageInfo(aaf.getCondition(),null, Language, pageNo);
  652.             is.commit();
  653.         } catch (Exception ex) {
  654.             log.error(ex.getMessage(), ex);
  655.             try {
  656.                 ls.rollback();
  657.             } catch (Exception ex2) {
  658.                 log.error(ex2.getMessage(), ex2);
  659.             }
  660.         }
  661.         servletRequest.setAttribute("pageInfo", pageInfo);
  662.         return actionMapping.findForward("SearchIndex");
  663.     }
  664.     public ActionForward SearchInformation(ActionMapping actionMapping,
  665.                                            ActionForm actionForm,
  666.                                            HttpServletRequest servletRequest,
  667.                                            HttpServletResponse servletResponse) {
  668.         AdminActionForm aaf = (AdminActionForm) actionForm;
  669.         int pageNo = 0;
  670.         PageInfo pageInfo = null;
  671.         String Language = "CN";
  672.         Menu cmenu = null;
  673.         Long menuID = new Long(0);
  674.         String key = "";
  675.         Menu fMenu = null;
  676.         List menuList = null;
  677.         Long cMenuID = new Long(0);
  678.         try {
  679.             pageNo = Integer.parseInt(servletRequest.getParameter("pageNo"));
  680.         } catch (Exception ex1) {}
  681.         try {
  682.             if (servletRequest.getSession().getAttribute("Language") != null) {
  683.                 Language = servletRequest.getSession().getAttribute("Language").
  684.                            toString();
  685.             }
  686.             if (servletRequest.getParameter("menuID") != null) {
  687.                 menuID = new Long(servletRequest.getParameter("menuID"));
  688.             }
  689.             if (servletRequest.getParameter("cMenuID") != null) {
  690.                 cMenuID = new Long(servletRequest.getParameter("cMenuID"));
  691.             }
  692.             if (servletRequest.getParameter("key") != null) {
  693.                 key = servletRequest.getParameter("key");
  694.             }
  695.             is.beginTran();
  696.             if (key.equals("")) {
  697.                 fMenu = ms.GetMenuById(menuID);
  698.             } else {
  699.                 fMenu = ms.GetMenuByKey(key);
  700.             }
  701.             menuList = ms.GetMenuBySuperior(fMenu.getMen_ID(), Language);
  702.             if (!cMenuID.equals(new Long(0))) {
  703.                 cmenu = ms.GetMenuById(cMenuID);
  704.             } else {
  705.                 cmenu = (Menu) menuList.get(0);
  706.             }
  707.             pageInfo = is.getPageInfo(aaf.getCondition1(), cmenu, Language,
  708.                                       pageNo);
  709.             is.commit();
  710.         } catch (Exception ex) {
  711.             log.error(ex.getMessage(), ex);
  712.             try {
  713.                 is.rollback();
  714.             } catch (Exception ex2) {
  715.                 log.error(ex2.getMessage(), ex2);
  716.             }
  717.         }
  718.         servletRequest.setAttribute("menu", fMenu);
  719.         servletRequest.setAttribute("menuList", menuList);
  720.         servletRequest.setAttribute("pageInfo", pageInfo);
  721.         return actionMapping.findForward("SearchIndex");
  722.     }
  723. }