Package org.g4studio.core.metatype.impl

Examples of org.g4studio.core.metatype.impl.BaseDto


    while (dataList.size() > 10) {
      dataList.remove(dataList.size() - 10);
    }
    setSessionAttribute(request, "JVM_MEM_LIST", dataList);
    String xmlString = FcfDataMapper.toFcfXmlData(dataList, graphConfig);
    Dto outDto = new BaseDto();
    outDto.put("success", new Boolean(true));
    outDto.put("xmlstring", xmlString);
    write(JsonHelper.encodeObject2Json(outDto), response);
    return null;
  }
View Full Code Here


   * 标签开始
   */
  public int doStartTag() throws JspException {
    Dao g4Dao = (Dao) SpringBeanLoader.getSpringBean("g4Dao");
    HttpServletRequest request = (HttpServletRequest) this.pageContext.getRequest();
    Dto grantDto = new BaseDto();
    grantDto.put("roleid", request.getParameter("roleid"));
    grantDto.put("authorizelevel", authorizelevel);
    List grantedList = g4Dao.queryForList("ArmTagSupport.queryGrantedMenusByRoleId", grantDto);
    List menuList = new ArrayList();
    String account = WebUtils.getSessionContainer(request).getUserInfo().getAccount();
    String developerAccount = WebUtils.getParamValue("DEFAULT_DEVELOP_ACCOUNT", request);
    String superAccount = WebUtils.getParamValue("DEFAULT_ADMIN_ACCOUNT", request);
    Dto qDto = new BaseDto();
    String userid = WebUtils.getSessionContainer(request).getUserInfo().getUserid();
    qDto.put("userid", userid);
    String roletype = request.getParameter("roletype");
    String menutype = SystemConstants.MENUTYPE_SYSTEM;
    if (roletype.equals(SystemConstants.ROLETYPE_BUSINESS)) {
      menutype = SystemConstants.MENUTYPE_BUSINESS;
    }
    if (authorizelevel.equals(SystemConstants.AUTHORIZELEVEL_ADMIN)) {
      menutype = SystemConstants.MENUTYPE_BUSINESS;
    }
    qDto.put("roleid", roletype);
    qDto.put("menutype", menutype);
    if (account.equalsIgnoreCase(developerAccount) || account.equalsIgnoreCase(superAccount)) {
      menuList = g4Dao.queryForList("ArmTagSupport.queryMenusForRoleGrant", qDto);
    } else {
      qDto.put("menutype", SystemConstants.MENUTYPE_BUSINESS);
      menuList = g4Dao.queryForList("ArmTagSupport.queryMenusForGrant", qDto);
    }
    for (int i = 0; i < menuList.size(); i++) {
      MenuVo menuVo = (MenuVo) menuList.get(i);
      if (checkGeant(grantedList, menuVo.getMenuid()).booleanValue()) {
        menuVo.setChecked("true");
      } else {
        menuVo.setChecked("false");
      }
      if (menuVo.getParentid().equals("0")) {
        menuVo.setIsRoot("true");
      }
      if (menuVo.getMenuid().length() < 6) {
        menuVo.setExpanded("true");
      }
    }
    Dto dto = new BaseDto();
    dto.put("menuList", menuList);
    dto.put("key", key);
    dto.put("authorizelevel", authorizelevel);
    TemplateEngine engine = TemplateEngineFactory.getTemplateEngine(TemplateType.VELOCITY);
    DefaultTemplate template = new FileTemplate();
    template.setTemplateResource(TagHelper.getTemplatePath(getClass().getName()));
    StringWriter writer = engine.mergeTemplate(template, dto);
    try {
View Full Code Here

  public int doStartTag() throws JspException{
    Dao g4Dao = (Dao)SpringBeanLoader.getSpringBean("g4Dao");
    HttpServletRequest request = (HttpServletRequest)this.pageContext.getRequest();
    String deptid = request.getParameter("deptid");
    String roletype = request.getParameter("roletype");
    Dto deptDto = new BaseDto();
    deptDto.put("deptid", deptid);
    List deptList = g4Dao.queryForList("ArmTagSupport.queryDeptsForRoleGrant", deptDto);
    List userList = new ArrayList();
    Dto userDto = new BaseDto();
    //角色类型和用户类型代码是对应的
    userDto.put("usertype", roletype);
    if (roletype.equals("1")) {
      //注册用户
      //userDto.put("usertype4", "4");
    }
    for(int i = 0; i < deptList.size(); i++){
      DeptVo deptVo = (DeptVo)deptList.get(i);
      if(deptVo.getDeptid().equals(deptid)){
        deptVo.setIsroot("true");
      }
      userDto.put("deptid", deptVo.getDeptid());
      List tempList = g4Dao.queryForList("ArmTagSupport.queryUsersForRoleGrant", userDto);
      userList.addAll(tempList);
    }
    Dto grantDto = new BaseDto();
    grantDto.put("roleid", request.getParameter("roleid"));
    List grantList = g4Dao.queryForList("ArmTagSupport.queryGrantedUsersByRoleId", grantDto);
    for(int i = 0; i < userList.size(); i++){
      UserVo userVo = (UserVo)userList.get(i);
      String usertypeString = WebUtils.getCodeDesc("USERTYPE", userVo.getUsertype(), request);
      String usernameString = userVo.getUsername();
      usernameString += "[" + userVo.getAccount() + ", " + usertypeString + "]";
      userVo.setUsername(usernameString);
      if(checkGrant(grantList, userVo.getUserid())){
        userVo.setChecked("true");
      }
    }
        Dto dto = new BaseDto();
        dto.put("deptList", deptList);
        dto.put("userList", userList);
        dto.put("deptid", deptid);
    TemplateEngine engine = TemplateEngineFactory.getTemplateEngine(TemplateType.VELOCITY);
    DefaultTemplate template = new FileTemplate();
    template.setTemplateResource(TagHelper.getTemplatePath(getClass().getName()));
    StringWriter writer = engine.mergeTemplate(template, dto);
    try {
View Full Code Here

  /**
   * 构造报表数据对象
   */
  public ActionForward buildReportDataObject(ActionMapping mapping, ActionForm form, HttpServletRequest request,
      HttpServletResponse response) throws Exception {
    Dto dto = new BaseDto();
    dto.put("reportTitle", "北京市第一人民医院收费项目明细报表(演示)");
    dto.put("jbr", getSessionContainer(request).getUserInfo().getUsername());
    dto.put("jbsj", G4Utils.getCurrentTime());
    Dto inDto = (BaseDto)getSessionAttribute(request, "QUERYCATALOGS4PRINT_QUERYDTO");
    List catalogList = g4Reader.queryForList("Demo.queryCatalogsForPrintLimitRows", inDto);
    int toIndex = 80;
    if (catalogList.size() <=toIndex) {
      toIndex = catalogList.size() - 1;
View Full Code Here

  private String getPanelScript() {
    Reader g4Reader = (Reader) SpringBeanLoader.getSpringBean("g4Reader");
    // String rootName =
    // (String)g4Reader.queryForObject("getMenuNameForCNPath", "01");
    HttpServletRequest request = (HttpServletRequest) this.pageContext.getRequest();
    Dto dto = new BaseDto();
    dto.put("contextPath", request.getContextPath());
    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 = SystemConstants.ACCOUNTTYPE_NORMAL;
    if (account.equalsIgnoreCase(WebUtils.getParamValue("DEFAULT_ADMIN_ACCOUNT", request))) {
      accountType = SystemConstants.ACCOUNTTYPE_SUPER;
    } else if (account.equalsIgnoreCase(WebUtils.getParamValue("DEFAULT_DEVELOP_ACCOUNT", request))) {
      accountType = SystemConstants.ACCOUNTTYPE_DEVELOPER;
    }
    dto2.put("accountType", accountType);
    dto.put("accountType", accountType);
    List cardList = tagSupportService.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", tagSupportService.getDepartmentInfo(qDto).getAsString("deptname"));
    Dto themeDto = new BaseDto();
    themeDto.put("userid", WebUtils.getSessionContainer(request).getUserInfo().getUserid());
    Dto resultDto = new BaseDto();
    resultDto = tagSupportService.getEauserSubInfo(themeDto);
    String theme = resultDto.getAsString("theme");
    theme = G4Utils.isEmpty(theme) ? "default" : theme;
    dto.put("theme", theme);
    String layout = null;
    if(G4Utils.isNotEmpty(resultDto))
      layout = resultDto.getAsString("layout");
    String defaultLayout = WebUtils.getParamValue("APP_LAYOUT", request);
    layout = G4Utils.isEmpty(layout) ? defaultLayout : layout;
    dto.put("layout", layout);
    dto.put("themeColor", getThemeColor(theme));
    TemplateEngine engine = TemplateEngineFactory.getTemplateEngine(TemplateType.VELOCITY);
View Full Code Here

   * @param
   * @return
   */
  public ActionForward queryMenuItems(ActionMapping mapping, ActionForm form, HttpServletRequest request,
      HttpServletResponse response) throws Exception {
    Dto dto = new BaseDto();
    String nodeid = request.getParameter("node");
    dto.put("parentid", nodeid);
    dto.put("menutype", SystemConstants.MENUTYPE_BUSINESS);
    List menuList = g4Reader.queryForList("Resource.queryMenuItemsByDto", dto);
    Dto menuDto = new BaseDto();
    for (int i = 0; i < menuList.size(); i++) {
      menuDto = (BaseDto) menuList.get(i);
      if (menuDto.getAsString("leaf").equals(SystemConstants.LEAF_Y))
        menuDto.put("leaf", new Boolean(true));
      else
        menuDto.put("leaf", new Boolean(false));
      if (menuDto.getAsString("id").length() == 4)
        menuDto.put("expanded", new Boolean(true));
    }
    write(JsonHelper.encodeObject2Json(menuList), response);
    return mapping.findForward(null);
  }
View Full Code Here

   */
  public ActionForward saveDirtyDatas(ActionMapping mapping, ActionForm form, HttpServletRequest request,
      HttpServletResponse response) throws Exception {
    BaseActionForm aForm = (BaseActionForm) form;
    List list  = aForm.getGridDirtyData(request);
    Dto inDto = new BaseDto();
    inDto.setDefaultAList(list);
    Dto outDto = service.saveDirtyDatas(inDto);
    if (outDto.getSuccess()) {
      setOkTipMsg("数据保存成功", response);
    }else {
      setOkTipMsg("保存操作被取消,同一托管页面上元素Dom标志只能唯一,请检查", response);
View Full Code Here

   * @return
   */
  public ActionForward init(ActionMapping mapping, ActionForm form, HttpServletRequest request,
      HttpServletResponse response) throws Exception {
    super.removeSessionAttribute(request, "deptid");
    Dto inDto = new BaseDto();
    String deptid = super.getSessionContainer(request).getUserInfo().getDeptid();
    inDto.put("deptid", deptid);
    Dto outDto = organizationService.queryDeptinfoByDeptid(inDto);
    request.setAttribute("rootDeptid", outDto.getAsString("deptid"));
    request.setAttribute("rootDeptname", outDto.getAsString("deptname"));
    Dto dto = (Dto)g4Reader.queryForObject("Resource.queryEamenuByMenuID", "01");
    request.setAttribute("rootMenuName", dto.getAsString("menuname"));
View Full Code Here

   * @param
   * @return
   */
  public ActionForward departmentTreeInit(ActionMapping mapping, ActionForm form, HttpServletRequest request,
      HttpServletResponse response) throws Exception {
    Dto dto = new BaseDto();
    String nodeid = request.getParameter("node");
    dto.put("parentid", nodeid);
    Dto outDto = organizationService.queryDeptItems(dto);
    write(outDto.getAsString("jsonString"), response);
    return mapping.findForward(null);
  }
View Full Code Here

   */
  public ActionForward savePartUserGrantDatas(ActionMapping mapping, ActionForm form, HttpServletRequest request,
      HttpServletResponse response) throws Exception {
    BaseActionForm aForm = (BaseActionForm) form;
    List list  = aForm.getGridDirtyData(request);
    Dto inDto = new BaseDto();
    inDto.setDefaultAList(list);
    if (!isDemoMode(response)) {
      partService.savePartRoleGrantDatas(inDto);
      setOkTipMsg("授权数据保存成功", response);
    }
    return mapping.findForward(null);
View Full Code Here

TOP

Related Classes of org.g4studio.core.metatype.impl.BaseDto

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.