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