/** 新增阈值全量同步 */ public ActionForward saveCacheContor( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { CommonActionForm aForm = (CommonActionForm) form; Dto inDto = aForm.getParamAsDto(request); // String account = request.getParameter("account"); String account = WebUtils.getSessionContainer(request).getUserInfo().getAccount(); Dto dto = new BaseDto(); inDto.put("account", account); dto.put("account", account); Dto userDto = organizationService.getUserInfo(dto); UserInfoVo userInfo = (UserInfoVo) userDto.get("userInfo"); inDto.put("oper_id", userInfo.getUserid()); inDto.put("dept_id", userInfo.getDeptid()); inDto.put("operpassword", userInfo.getOperpassword()); Dto outDto = adsService.saveCacheContor(inDto); String jsonString = JsonHelper.encodeObject2Json(outDto); write(jsonString, response); return mapping.findForward(null); }
/** * 修改广告 V1.0.00.14 * * @param * @return */ public ActionForward updateAds( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { log.info("更新广告操作"); CommonActionForm aForm = (CommonActionForm) form; Dto inDto = aForm.getParamAsDto(request); String id = inDto.getAsString("id"); log.info("查询此广告是否存在 id =" + id); Integer totalCount = (Integer) urmReader.queryForObject("SignalingLoadNumConfig.getNameByUpdate", inDto); log.info("数据库中存在该广告的条数为:" + totalCount); inDto.put("sum", totalCount); String account = WebUtils.getSessionContainer(request).getUserInfo().getAccount(); Dto dto = new BaseDto(); dto.put("account", account); Dto userDto = organizationService.getUserInfo(dto); UserInfoVo user = (UserInfoVo) userDto.get("userInfo"); inDto.put("oper_id", user.getUserid()); inDto.put("dept_id", user.getDeptid()); Dto outDto = adsService.updateAds(inDto); String retString = JsonHelper.encodeObject2Json(outDto); write(retString, response); setOkTipMsg("广告修改成功", response); return mapping.findForward(null); }
/** * 生成卡片树 * * @param rootMenuId */ private String generateCardTrees(Dto pDto) { IReader sqlRunner = (IReader) SpringBeanLoader.getSpringBean("g4Reader"); HttpServletRequest request = (HttpServletRequest) pageContext.getRequest(); SessionContainer sessionContainer = WebUtils.getSessionContainer(request); String userid = sessionContainer.getUserInfo().getUserid(); Dto qDto = new BaseDto(); qDto.put("userid", userid); List cardList = (List) pDto.get("cardList"); String treesString = scriptStart + "Ext.onReady(function(){"; for (int i = 0; i < cardList.size(); i++) { MenuVo cardVo = (MenuVo) cardList.get(i); qDto.put("menuid", cardVo.getMenuid()); qDto.put("accountType", pDto.getAsString("accountType")); List menuList = armTagSupportService.getCardTreeList(qDto).getDefaultAList(); String rootName = (String) sqlRunner.queryForObject("Organization.getMenuNameForCNPath", "01"); Dto pathDto = new BaseDto(); pathDto.put("01", rootName); Dto dto = new BaseDto(); dto.put("menuList", generateMenuPathName(menuList, pathDto)); dto.put("menuid", cardVo.getMenuid()); TemplateEngine engine = TemplateEngineFactory.getTemplateEngine(TemplateType.VELOCITY); DefaultTemplate template = new FileTemplate(); template.setTemplateResource( TagHelper.getTemplatePath(getClass().getName(), "CardTreesTag.tpl")); StringWriter writer = engine.mergeTemplate(template, dto); treesString = treesString + "\n" + writer.toString(); } return treesString + "\n});" + scriptEnd; }
/** * 删除网络区域 * * @param * @return */ public ActionForward deleteAds( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { String strChecked = request.getParameter("strChecked"); Dto inDto = new BaseDto(); inDto.put("strChecked", strChecked); String account = WebUtils.getSessionContainer(request).getUserInfo().getAccount(); Dto dto = new BaseDto(); dto.put("account", account); Dto userDto = organizationService.getUserInfo(dto); UserInfoVo user = (UserInfoVo) userDto.get("userInfo"); inDto.put("oper_id", user.getUserid()); inDto.put("dept_id", user.getDeptid()); Dto outDto = adsService.deleteAds(inDto); String retString = JsonHelper.encodeObject2Json(outDto); write(retString, response); // setOkTipMsg("网络区域删除成功", response); return mapping.findForward(null); }
/** * 获取Viewport标记脚本 * * @return 返回Viewport标记脚本 */ private String getPanelScript() { IReader g4Reader = (IReader) SpringBeanLoader.getSpringBean("g4Reader"); // String rootName = // (String)g4Reader.queryForObject("getMenuNameForCNPath", "01"); HttpServletRequest request = (HttpServletRequest) this.pageContext.getRequest(); Dto dto = new BaseDto(); dto.put("northTitle", northTitle); dto.put( "centerTitle", G4Utils.isEmpty(WebUtils.getParamValue("MENU_FIRST", request)) ? "请配置" : WebUtils.getParamValue("MENU_FIRST", request)); dto.put( "welcomePageTitle", G4Utils.isEmpty(WebUtils.getParamValue("WELCOME_PAGE_TITLE", request)) ? "请配置" : WebUtils.getParamValue("WELCOME_PAGE_TITLE", request)); dto.put("banner", request.getContextPath() + WebUtils.getParamValue("INDEX_BANNER", request)); dto.put("westTitle", westTitle); dto.put("scriptStart", scriptStart); dto.put("scriptEnd", scriptEnd); dto.put("copyright", WebUtils.getParamValue("BOTTOM_COPYRIGHT", request)); String activeOnTop = "true"; if ("0".equals(WebUtils.getParamValue("WEST_CARDMENU_ACTIVEONTOP", request))) { activeOnTop = "false"; } dto.put("activeOnTop", activeOnTop); SessionContainer sessionContainer = WebUtils.getSessionContainer(request); String userid = sessionContainer.getUserInfo().getUserid(); Dto dto2 = new BaseDto(); dto2.put("userid", userid); String account = sessionContainer.getUserInfo().getAccount(); account = account == null ? "" : account; String accountType = ArmConstants.ACCOUNTTYPE_NORMAL; if (account.equalsIgnoreCase(WebUtils.getParamValue("DEFAULT_ADMIN_ACCOUNT", request))) { accountType = ArmConstants.ACCOUNTTYPE_SUPER; } else if (account.equalsIgnoreCase( WebUtils.getParamValue("DEFAULT_DEVELOP_ACCOUNT", request))) { accountType = ArmConstants.ACCOUNTTYPE_DEVELOPER; } dto2.put("accountType", accountType); dto.put("accountType", accountType); List cardList = armTagSupportService.getCardList(dto2).getDefaultAList(); for (int i = 0; i < cardList.size(); i++) { MenuVo cardVo = (MenuVo) cardList.get(i); if (i != cardList.size() - 1) { cardVo.setIsNotLast("true"); } } dto.put("date", G4Utils.getCurDate()); dto.put("week", G4Utils.getWeekDayByDate(G4Utils.getCurDate())); dto.put("welcome", getWelcomeMsg()); dto.put("cardList", cardList); dto.put("username", sessionContainer.getUserInfo().getUsername()); dto.put("account", sessionContainer.getUserInfo().getAccount()); Dto qDto = new BaseDto(); qDto.put("deptid", sessionContainer.getUserInfo().getDeptid()); dto.put("deptname", armTagSupportService.getDepartmentInfo(qDto).getAsString("deptname")); Dto themeDto = new BaseDto(); themeDto.put("userid", WebUtils.getSessionContainer(request).getUserInfo().getUserid()); Dto resultDto = new BaseDto(); resultDto = armTagSupportService.getEauserSubInfo(themeDto); String theme = resultDto.getAsString("theme"); theme = G4Utils.isEmpty(theme) ? "default" : theme; dto.put("theme", theme); dto.put("themeColor", getThemeColor(theme)); TemplateEngine engine = TemplateEngineFactory.getTemplateEngine(TemplateType.VELOCITY); DefaultTemplate template = new FileTemplate(); template.setTemplateResource(TagHelper.getTemplatePath(getClass().getName())); StringWriter writer = engine.mergeTemplate(template, dto); String treesString = generateCardTrees(dto); return treesString + "\n" + writer.toString(); }