/**
  * 准备拷贝模板
  *
  * @param request
  * @return
  */
 @RequestMapping("/toCopy")
 public ModelAndView toCopy(HttpServletRequest request) {
   Map<String, Object> map = new HashMap<String, Object>();
   String templateId = request.getParameter("templateId");
   DwmisTemplateInfo dwmisTemplateInfo =
       dwmisTemplateInfoService.getDwmisTemplateInfoById(templateId);
   map.put("dwmisTemplateInfo", dwmisTemplateInfo);
   return new ModelAndView("dwmis/template/copyTemplate", map);
 }
 /**
  * 模板列表
  *
  * @param request
  * @param dwmisTemplateInfo
  * @return
  */
 @RequestMapping("/list")
 public ModelAndView list(HttpServletRequest request, DwmisTemplateInfo dwmisTemplateInfo) {
   Map<String, Object> map = new HashMap<String, Object>();
   List<DwmisTemplateInfo> templateInfoList =
       dwmisTemplateInfoService.listPageTemplateInfo(dwmisTemplateInfo);
   map.put("templateInfoList", templateInfoList);
   map.put("dwmisTemplateInfo", dwmisTemplateInfo);
   return new ModelAndView("dwmis/template/templateList", map);
 }
Esempio n. 3
0
 /**
  * 请求瞭望塔权限页面
  *
  * @param roleId
  * @param model
  * @return
  */
 @RequestMapping(value = "/authDwmis{userId}")
 public ModelAndView authDwmis(@PathVariable int userId, Model model) {
   List<DwmisTemplateInfo> dwmisTemplateInfoList = dwmisTemplateInfoService.listAllTemplateInfo();
   User user = userService.getUserById(userId);
   ModelAndView mv = new ModelAndView();
   mv.setViewName("/user/authorizationDwmis1");
   mv.addObject("dwmisTemplateInfoList", dwmisTemplateInfoList);
   mv.addObject("user", user);
   mv.addObject("userId", userId);
   return mv;
 }
 /**
  * 删除模板
  *
  * @param out
  * @param request
  * @param response
  */
 @RequestMapping("/del")
 public void delTemplate(HttpServletRequest request, HttpServletResponse response) {
   String templateId = request.getParameter("templateId");
   try {
     dwmisTemplateInfoService.deleteTemplate(templateId);
     this.sendMsgToClient(this.isSuccess, response);
   } catch (Exception e) {
     e.printStackTrace();
     this.logger.error(e.getMessage(), e);
     this.sendMsgToClient(this.isFailed, response);
   }
 }
 /**
  * 拷贝模板
  *
  * @param request
  * @param response
  * @param dwmisTemplateInfo
  * @return
  * @throws Exception
  */
 @RequestMapping("/copy")
 public ModelAndView copyTemplate(
     HttpServletRequest request, HttpServletResponse response, DwmisTemplateInfo dwmisTemplateInfo)
     throws Exception {
   ModelAndView mv = new ModelAndView();
   boolean isSuccess = true;
   // 复制模板
   try {
     if (dwmisTemplateInfo != null) {
       dwmisTemplateInfoService.saveCopyTemplateInfo(dwmisTemplateInfo);
     } else {
       isSuccess = false;
     }
   } catch (Exception e) {
     e.printStackTrace();
     this.logger.error(e.getMessage(), e);
     isSuccess = false;
   }
   mv.addObject("msg", isSuccess ? this.isSuccess : this.isFailed);
   mv.setViewName(SUCCESS_ACTION);
   return mv;
 }