コード例 #1
0
ファイル: LoginAction.java プロジェクト: dalinhuang/zg-rfid
  public String login() {

    if (loginForm == null) return LOGIN_PAGE;
    Map map = loginBo.login(loginForm);
    String loginType = this.getRequest().getParameter("loginType");
    this.getRequest().setAttribute("loginType", loginType);
    if (map.get("success").equals("true")) {
      OperatorInfo operatorInfo = (OperatorInfo) map.get("result");
      operatorInfo.setIp(this.getRequest().getRemoteAddr());
      this.getRequest().getSession().setAttribute("operatorInfo", operatorInfo);
      boolean isAdmin = false;
      if (operatorInfo.getUserId().equals("sysadmin")) {
        isAdmin = true;
      }
      this.getRequest().getSession().setAttribute("isAdmin", isAdmin);
      this.getRequest().getSession().setAttribute("_theme", loginForm.getTheme());
      this.getRequest().getSession().setAttribute("loginLgort", null);
      this.getRequest().setAttribute("operatorInfo", operatorInfo);

      // 判断登陆人是否是领料员 如果是刚登陆界面的默认页面是领料页面
      String defaultUrl = loginBo.getDefaultUrl(operatorInfo.getOperatorId());
      String url = "/frame/default/mainframe/body.jsp";
      if (!StringHelper.isEmpty(defaultUrl)) {
        url = defaultUrl;
        // 获取领料的物料组
        String matkls = zgMaterielBo.getMatklByOpertatorId(operatorInfo.getOperatorId());
        getSession().setAttribute(operatorInfo.getOperatorId() + "_matkl", matkls);
      }

      this.getRequest().getSession().setAttribute("defaultUrl", url);
      this.getRequest().getSession().setAttribute("isLLY", !StringHelper.isEmpty(defaultUrl));

      // 查看是否有bom未设置装车信息 是则显示在公告条中
      boolean flag = zgTbomManager.findNullCarInfoBom();
      if (flag) {
        getRequest().getSession().setAttribute("nullCarFlag", "1");
      }

      List<FwSystemNotice> sysNoticeList = fwSystemNoticeBo.findAll();
      getRequest().getSession().setAttribute("sysNoticeList", sysNoticeList);

      return LOGIN_SUCCESS;
    } else {
      String reason = (String) map.get("reason");
      this.getRequest().setAttribute("loginFlag", reason);
      return LOGIN_PAGE;
    }
  }
コード例 #2
0
ファイル: LoginAction.java プロジェクト: dalinhuang/zg-rfid
 public String changeTheme() {
   this.getRequest().getSession().setAttribute("_theme", loginForm.getTheme());
   return LOGIN_PAGE;
 }