public static String getEformHTML(Map<String, String> prefs, String key) {
    StringBuilder sb = new StringBuilder();
    List<LabelValueBean> forms = constructEformList();
    for (LabelValueBean lvb : forms) {
      String checked = new String();

      if (prefs.get(key) != null) {
        String[] savedValues = prefs.get(key).split(",");
        for (int x = 0; x < savedValues.length; x++) {
          if (savedValues[x].equals(lvb.getValue())) {
            checked = "checked=\"checked\"";
          }
        }
      }
      sb.append(
          "<input name=\"pref."
              + UserProperty.EFORM_NAME
              + "\" value=\""
              + lvb.getValue()
              + "\" type=\"checkbox\" "
              + checked
              + "/>"
              + lvb.getLabel()
              + "\n");
      sb.append("<br/>\n");
    }
    return sb.toString();
  }
  /** 获得资源列表 */
  public List getResourceList(String ResourceType, String key) {
    // TODO Auto-generated method stub
    List<LabelValueBean> resourceList = new ArrayList<LabelValueBean>();
    try {
      ResourceInfo resource = new ResourceInfo();
      resource.setResourceType(ResourceType);
      DetachedCriteria dc = DetachedCriteria.forClass(ResourceInfo.class);
      dc.add(Example.create(resource));
      MyQuery myQuery = new MyQueryImpl();
      myQuery.setDetachedCriteria(dc);
      Object[] objs = this.dao.findEntity(myQuery);

      if (null != objs && 0 < objs.length) {
        ResourceInfo res = new ResourceInfo();
        for (int i = 0; i < objs.length; i++) {
          LabelValueBean resourceInfo = new LabelValueBean();
          res = (ResourceInfo) objs[i];
          resourceInfo.setValue(res.getId());
          resourceInfo.setLabel(res.getResourceName());
          resourceList.add(resourceInfo);
        }
      }
    } catch (Exception e) {
      logger.debug(e);
    }
    return resourceList;
  }
示例#3
0
  /**
   * <br>
   * [機 能] 閲覧メンバー一覧を取得する <br>
   * [解 説] <br>
   * [備 考]
   *
   * @param left 取得するユーザSID・グループSID
   * @param con コネクション
   * @return グループ一覧
   * @throws SQLException SQL実行時例外
   */
  private ArrayList<LabelValueBean> __getForumLabel(String[] left, Connection con)
      throws SQLException {

    ArrayList<LabelValueBean> ret = new ArrayList<LabelValueBean>();

    //
    ArrayList<Integer> grpSids = new ArrayList<Integer>();
    ArrayList<String> usrSids = new ArrayList<String>();

    // ユーザSIDとグループSIDを分離
    if (left != null) {
      for (int i = 0; i < left.length; i++) {
        String str = NullDefault.getString(left[i], "-1");
        log__.debug("str==>" + str);
        log__.debug("G.index==>" + str.indexOf("G"));
        if (str.contains(new String("G").subSequence(0, 1))) {
          // グループ
          grpSids.add(new Integer(str.substring(1, str.length())));
        } else {
          // ユーザ
          usrSids.add(str);
        }
      }
    }

    LabelValueBean lavelBean = null;
    if (grpSids.size() > 0) {
      // グループ情報取得
      UsidSelectGrpNameDao gdao = new UsidSelectGrpNameDao(con);
      ArrayList<GroupModel> glist = gdao.selectGroupNmListOrderbyClass(grpSids);
      for (GroupModel gmodel : glist) {
        lavelBean = new LabelValueBean();
        lavelBean.setLabel(gmodel.getGroupName());
        lavelBean.setValue("G" + String.valueOf(gmodel.getGroupSid()));
        ret.add(lavelBean);
      }
    }

    // ユーザ情報取得
    UserBiz userBiz = new UserBiz();
    ArrayList<BaseUserModel> ulist =
        userBiz.getBaseUserList(con, (String[]) usrSids.toArray(new String[usrSids.size()]));
    for (BaseUserModel umodel : ulist) {
      lavelBean = new LabelValueBean();
      lavelBean.setLabel(umodel.getUsisei() + " " + umodel.getUsimei());
      lavelBean.setValue(String.valueOf(umodel.getUsrsid()));
      ret.add(lavelBean);
    }

    return ret;
  }
示例#4
0
  /**
   * <br>
   * [機 能] 表示グループ用のグループリストを取得する(全て) <br>
   * [解 説] <br>
   * [備 考]
   *
   * @param con コネクション
   * @param reqMdl リクエスト情報
   * @return ArrayList
   * @throws SQLException SQL実行時例外
   */
  private ArrayList<LabelValueBean> __getGroupLabelList(Connection con, RequestModel reqMdl)
      throws SQLException {

    ArrayList<LabelValueBean> labelList = new ArrayList<LabelValueBean>();
    GsMessage gsMsg = new GsMessage(reqMdl);
    LabelValueBean labelBean = new LabelValueBean();
    labelBean.setLabel(gsMsg.getMessage("cmn.grouplist"));
    labelBean.setValue(String.valueOf(Sml250Form.GRP_SID_GRPLIST));
    labelList.add(labelBean);

    // グループリスト取得
    GroupBiz gBiz = new GroupBiz();
    ArrayList<GroupModel> gpList = gBiz.getGroupCombList(con);

    GroupModel gpMdl = null;
    for (int i = 0; i < gpList.size(); i++) {
      gpMdl = gpList.get(i);
      labelList.add(new LabelValueBean(gpMdl.getGroupName(), String.valueOf(gpMdl.getGroupSid())));
    }
    log__.debug("labelList.size()=>" + labelList.size());
    return labelList;
  }
  public static String getSelect(Map<String, String> prefs, String key) {
    StringBuilder sb = new StringBuilder();

    List<LabelValueBean> options = getOptions(key);
    String selectedValue = prefs.get(key);
    if (selectedValue == null) {
      selectedValue = new String();
    }
    sb.append("<select name=\"" + key + "\">");
    for (LabelValueBean option : options) {
      String selected = (option.getValue().equals(selectedValue)) ? "selected=\"selected\"" : "";
      sb.append(
          "<option value=\""
              + option.getValue()
              + "\" "
              + selected
              + ">"
              + option.getLabel()
              + "</option>\n");
    }
    sb.append("</select>");
    return sb.toString();
  }
示例#6
0
 /**
  * <br>
  * [機 能] DBから保管済みの自動送信先を読み込む <br>
  * [解 説] <br>
  * [備 考]
  *
  * @param paramModel パラメータモデル
  * @param con コネクション
  * @throws SQLException SQL実行時例外
  */
 public void __loadAuteDest(Sml250ParamModel paramModel, Connection con) throws SQLException {
   SmlAccountAutoDestDao sadDao = new SmlAccountAutoDestDao(con);
   for (int type = 0; type < 3; type++) {
     List<SmlAccountModel> sacModels =
         sadDao.getAutoDestAccounts(paramModel.getSmlAccountSid(), type);
     List<LabelValueBean> labelList = new ArrayList<LabelValueBean>();
     String[] sids = new String[sacModels.size()];
     for (int i = 0; i < sids.length; i++) {
       SmlAccountModel acc = sacModels.get(i);
       LabelValueBean bean = new LabelValueBean();
       if (acc.getUsrSid() > 0) {
         bean.setValue(String.valueOf(acc.getUsrSid()));
       } else {
         bean.setValue(GSConstSmail.SML_ACCOUNT_STR + String.valueOf(acc.getSacSid()));
       }
       bean.setLabel(acc.getSacName());
       labelList.add(bean);
       sids[i] = bean.getValue();
     }
     switch (type) {
       case GSConstSmail.SML_SEND_KBN_ATESAKI:
         paramModel.setSml250AutoDestToLabelList(labelList);
         paramModel.setSml250AutoDestToUsrSid(sids);
         break;
       case GSConstSmail.SML_SEND_KBN_CC:
         paramModel.setSml250AutoDestCcLabelList(labelList);
         paramModel.setSml250AutoDestCcUsrSid(sids);
         break;
       case GSConstSmail.SML_SEND_KBN_BCC:
         paramModel.setSml250AutoDestBccLabelList(labelList);
         paramModel.setSml250AutoDestBccUsrSid(sids);
         break;
       default:
     }
   }
 }
示例#7
0
  /**
   * アクションフォームを初期化します.
   *
   * @param deptId 部門ID
   * @throws ServiceException
   */
  private void init(String deptId) throws ServiceException {
    this.editDeptForm.reset();

    this.editDeptForm.isUpdate = super.userDto.isMenuUpdate(Constants.MENU_ID.SETTING_DEPT);

    List<Dept> deptList = this.deptService.findAllDept();
    for (Dept dept : deptList) {
      this.editDeptForm.parentList.add(new LabelValueBean(dept.name, dept.deptId));
    }
    this.editDeptForm.parentList.add(0, new LabelValueBean());

    if (!StringUtil.hasLength(deptId)) {
      return;
    }

    List<DeptDto> deptDtoList = this.deptService.convertEntityToDto(deptList);
    for (DeptDto dto : deptDtoList) {
      if (!deptId.equals(dto.deptId)) {
        continue;
      }

      List<DeptDto> descDeptList = dto.getDescDetp();

      Iterator<LabelValueBean> ite = this.editDeptForm.parentList.iterator();
      while (ite.hasNext()) {
        LabelValueBean bean = ite.next();
        if (bean.getValue() == null) {

          continue;
        }

        if (bean.getValue().equals(deptId)) {

          ite.remove();
          continue;
        }

        for (DeptDto desc : descDeptList) {
          if (bean.getValue().equals(desc.deptId)) {

            ite.remove();
            break;
          }
        }
      }
    }

    Dept dept = this.deptService.findById(deptId);
    if (dept == null) {
      return;
    }
    Beans.copy(dept, this.editDeptForm)
        .timestampConverter(Constants.FORMAT.TIMESTAMP)
        .dateConverter(Constants.FORMAT.DATE)
        .execute();

    this.editDeptForm.creDatetmShow =
        StringUtil.getDateString(Constants.FORMAT.DATE, dept.creDatetm);
    this.editDeptForm.updDatetmShow =
        StringUtil.getDateString(Constants.FORMAT.DATE, dept.updDatetm);

    this.editDeptForm.editMode = true;
  }
示例#8
0
  /**
   * 设置查询默认值
   *
   * @param actionForm ActionForm 表单From
   * @param request HttpServletRequest Web请求
   * @param response HttpServletResponse Web结果
   * @throws CDealException 处理异常
   */
  public static void setQueryDefault(
      QueryForm pQueryForm, HttpServletRequest request, HttpServletResponse response)
      throws CDealException {
    // 初始化页面,初始化重大事项综合查询下拉菜单
    QueryForm aWebForm1 = (QueryForm) pQueryForm;
    Connection mConn = null;
    PreparedStatement pstmt = null;
    String str = ""; // 要返回的 string
    String sKey = ""; // 取出的TREEMAP的KEY
    String sValue = ""; // 取出的TREEMAP的value
    ArrayList itemtype;
    try {
      // 从CODEMAP表里取 来源分类 菜单
      ArrayList comeList = CCodeMap.getSortedMap("重大事项登记来源分类");

      // 从CODEMAP表里取 本级政府任务督办 菜单
      ArrayList localList = CCodeMap.getSortedMap("本级政府任务督办督查科");

      // 从CODEMAP表里取 上级任务督办 菜单
      ArrayList upList = CCodeMap.getSortedMap("上级任务督办督查科");

      // 添加 来源分类 到一个数组里面去.然后统一输出到页面
      str = "var department=new Array('','全部'";
      int k = 0;
      for (; k < comeList.size(); k++) {
        LabelValueBean aLabelValueBean = (LabelValueBean) comeList.get(k);
        sKey = aLabelValueBean.getValue(); // 名字
        str += ",'" + sKey + "',"; // 取出的TREEMAP的KEY
        sValue = aLabelValueBean.getLabel(); // 值
        str += "'" + sValue + "'\n"; // 取出的TREEMAP的value
      }
      str += ");\n";
      str += " var permissionitem = new Array (" + k + ");\n";
      str += "permissionitem[0]=new Array('','全部');\n";

      // 添加 上级 事项类别列表
      int j = 1;
      str += "permissionitem[" + j + "]=new Array('','全部'";
      for (int i = 0; i < upList.size(); i++) {
        LabelValueBean aLabelValueBean = (LabelValueBean) upList.get(i);
        sKey = aLabelValueBean.getValue(); // 名字
        str += ",'" + sKey + "',"; // 取出的TREEMAP的KEY
        sValue = aLabelValueBean.getLabel(); // 值
        str += "'" + sValue + "'\n"; // 取出的TREEMAP的value
      }
      str += ");\n";

      j = 2;
      str += "permissionitem[" + j + "]=new Array('','全部'";
      for (int i = 0; i < localList.size(); i++) {
        LabelValueBean aLabelValueBean = (LabelValueBean) localList.get(i);
        sKey = aLabelValueBean.getValue(); // 名字
        str += ",'" + sKey + "',"; // 取出的TREEMAP的KEY
        sValue = aLabelValueBean.getLabel(); // 值
        str += "'" + sValue + "'\n"; // 取出的TREEMAP的value
      }
      str += ");\n";

      // 把部门数组和许可事项输出到页面上
      aWebForm1.setPrintSql(str);

      // 初始化重大事项综合查询下拉菜单
      TreeMap itemstatusList = new TreeMap();
      itemstatusList = CCodeMap.getMapByType("重大事项流程");
      aWebForm1.setItemstatusList(itemstatusList);

    } catch (Exception e) {
      throw new CDealException("设置查询默认值时失败。", e);
    }
  }
示例#9
0
  /**
   * <br>
   * [機 能] 初期表示設定を行う <br>
   * [解 説] <br>
   * [備 考]
   *
   * @param con コネクション
   * @param paramMdl パラメータ情報
   * @param reqMdl リクエスト情報
   * @throws Exception 実行時例外
   */
  public void setInitData(Connection con, Sml250ParamModel paramMdl, RequestModel reqMdl)
      throws Exception {

    // 自動削除区分を設定
    SmlCommonBiz smlBiz = new SmlCommonBiz(con, reqMdl);
    SmlAdminModel admMdl = new SmlAdminModel();
    admMdl = smlBiz.getSmailAdminConf(reqMdl.getSmodel().getUsrsid(), con);
    paramMdl.setSml250autoDelKbn(admMdl.getSmaAutoDelKbn());

    ArrayList<LabelValueBean> yearLabel = new ArrayList<LabelValueBean>();
    ArrayList<LabelValueBean> monthLabel = new ArrayList<LabelValueBean>();

    GsMessage gsMsg = new GsMessage(reqMdl);

    // 年リスト
    for (int i = 0; i <= 5; i++) {
      yearLabel.add(
          new LabelValueBean(
              gsMsg.getMessage("cmn.year", new String[] {String.valueOf(i)}), Integer.toString(i)));
    }
    yearLabel.add(
        new LabelValueBean(gsMsg.getMessage("cmn.year", new String[] {String.valueOf(10)}), "10"));
    paramMdl.setSml250YearLabelList(yearLabel);

    // 月リスト
    for (int i = 0; i < 12; i++) {
      monthLabel.add(
          new LabelValueBean(
              gsMsg.getMessage("cmn.months", new String[] {String.valueOf(i)}),
              Integer.toString(i)));
    }
    paramMdl.setSml250MonthLabelList(monthLabel);

    int sacSid = paramMdl.getSmlAccountSid();
    boolean acntUserFlg = getAcntUserFlg(con, paramMdl, sacSid, admMdl);
    paramMdl.setSml250acntUserFlg(acntUserFlg);

    // 新規登録 初期表示
    if (paramMdl.getSml250initFlg() == GSConstSmail.DSP_FIRST
        && paramMdl.getSmlCmdMode() == GSConstSmail.CMDMODE_ADD) {

      paramMdl.setSml250initFlg(GSConstSmail.DSP_ALREADY);

      if (admMdl.getSmaAutoDelKbn() == GSConstSmail.AUTO_DEL_ACCOUNT) {
        paramMdl.setSml250JdelKbn(String.valueOf(GSConstSmail.SML_AUTO_DEL_NO));
        paramMdl.setSml250SdelKbn(String.valueOf(GSConstSmail.SML_AUTO_DEL_NO));
        paramMdl.setSml250WdelKbn(String.valueOf(GSConstSmail.SML_AUTO_DEL_NO));
        paramMdl.setSml250DdelKbn(String.valueOf(GSConstSmail.SML_AUTO_DEL_NO));
      }

      // 編集 初期表示
    } else if (paramMdl.getSml250initFlg() == GSConstSmail.DSP_FIRST
        && paramMdl.getSmlCmdMode() == GSConstSmail.CMDMODE_EDIT) {

      // アカウント情報を設定する
      SmlAccountDao accountDao = new SmlAccountDao(con);
      SmlAccountModel accountMdl = accountDao.select(sacSid);

      if (accountMdl.getUsrSid() > 0) {
        paramMdl.setSml250AccountKbn(GSConstSmail.ACNT_DEF);
        paramMdl.setSml250DefActUsrSid(accountMdl.getUsrSid());
      }

      paramMdl.setSml250name(accountMdl.getSacName());
      paramMdl.setSml250biko(accountMdl.getSacBiko());

      if (acntUserFlg) {
        // 使用者を設定
        SmlAccountUserDao accountUserDao = new SmlAccountUserDao(con);
        List<SmlAccountUserModel> accountUserList = accountUserDao.select(sacSid);
        String[] id = new String[accountUserList.size()];
        for (int index = 0; index < id.length; index++) {

          if (accountUserList.get(index).getUsrSid() > 0) {
            id[index] = String.valueOf(accountUserList.get(index).getUsrSid());
          } else {
            id[index] = "G" + String.valueOf(accountUserList.get(index).getGrpSid());
          }
        }
        paramMdl.setSml250userKbnUser(id);
      }

      // 送信形式
      paramMdl.setSml250sendType(accountMdl.getSacSendMailtype());

      // テーマ
      paramMdl.setSml250theme(accountMdl.getSacTheme());

      // 引用符
      paramMdl.setSml250quotes(accountMdl.getSacQuotes());

      if (admMdl.getSmaAutoDelKbn() == GSConstSmail.AUTO_DEL_ACCOUNT) {
        SmlAdelDao delDao = new SmlAdelDao(con);
        SmlAdelModel delMdl = delDao.select(sacSid);
        if (delMdl == null) {
          delMdl = new SmlAdelModel();
          delMdl.setSadJdelKbn(GSConstSmail.SML_AUTO_DEL_NO);
          delMdl.setSadJdelYear(0);
          delMdl.setSadJdelMonth(0);
          delMdl.setSadSdelKbn(GSConstSmail.SML_AUTO_DEL_NO);
          delMdl.setSadSdelYear(0);
          delMdl.setSadSdelMonth(0);
          delMdl.setSadWdelKbn(GSConstSmail.SML_AUTO_DEL_NO);
          delMdl.setSadWdelYear(0);
          delMdl.setSadWdelMonth(0);
          delMdl.setSadDdelKbn(GSConstSmail.SML_AUTO_DEL_NO);
          delMdl.setSadDdelYear(0);
          delMdl.setSadDdelMonth(0);
        }

        // 受信タブ処理 選択値
        paramMdl.setSml250JdelKbn(
            NullDefault.getStringZeroLength(
                paramMdl.getSml250JdelKbn(), String.valueOf(delMdl.getSadJdelKbn())));

        // 受信タブ 年
        paramMdl.setSml250JYear(
            NullDefault.getStringZeroLength(
                StringUtilHtml.transToHTmlPlusAmparsant(paramMdl.getSml250JYear()),
                String.valueOf(delMdl.getSadJdelYear())));

        // 受信タブ 月
        paramMdl.setSml250JMonth(
            NullDefault.getStringZeroLength(
                StringUtilHtml.transToHTmlPlusAmparsant(paramMdl.getSml250JMonth()),
                String.valueOf(delMdl.getSadJdelMonth())));

        // 送信タブ処理 選択値
        paramMdl.setSml250SdelKbn(
            NullDefault.getStringZeroLength(
                paramMdl.getSml250SdelKbn(), String.valueOf(delMdl.getSadSdelKbn())));

        // 送信タブ 年
        paramMdl.setSml250SYear(
            NullDefault.getStringZeroLength(
                StringUtilHtml.transToHTmlPlusAmparsant(paramMdl.getSml250SYear()),
                String.valueOf(delMdl.getSadSdelYear())));

        // 送信タブ 月
        paramMdl.setSml250SMonth(
            NullDefault.getStringZeroLength(
                StringUtilHtml.transToHTmlPlusAmparsant(paramMdl.getSml250SMonth()),
                String.valueOf(delMdl.getSadSdelMonth())));

        // 草稿タブ処理 選択値
        paramMdl.setSml250WdelKbn(
            NullDefault.getStringZeroLength(
                paramMdl.getSml250WdelKbn(), String.valueOf(delMdl.getSadWdelKbn())));

        // 草稿タブ 年
        paramMdl.setSml250WYear(
            NullDefault.getStringZeroLength(
                StringUtilHtml.transToHTmlPlusAmparsant(paramMdl.getSml250WYear()),
                String.valueOf(delMdl.getSadWdelYear())));

        // 草稿タブ 月
        paramMdl.setSml250WMonth(
            NullDefault.getStringZeroLength(
                StringUtilHtml.transToHTmlPlusAmparsant(paramMdl.getSml250WMonth()),
                String.valueOf(delMdl.getSadWdelMonth())));

        // ゴミ箱タブ処理 選択値
        paramMdl.setSml250DdelKbn(
            NullDefault.getStringZeroLength(
                paramMdl.getSml250DdelKbn(), String.valueOf(delMdl.getSadDdelKbn())));

        // ゴミ箱タブ 年
        paramMdl.setSml250DYear(
            NullDefault.getStringZeroLength(
                StringUtilHtml.transToHTmlPlusAmparsant(paramMdl.getSml250DYear()),
                String.valueOf(delMdl.getSadDdelYear())));

        // ゴミ箱タブ 月
        paramMdl.setSml250DMonth(
            NullDefault.getStringZeroLength(
                StringUtilHtml.transToHTmlPlusAmparsant(paramMdl.getSml250DMonth()),
                String.valueOf(delMdl.getSadDdelMonth())));
      }

      __loadAuteDest(paramMdl, con);
      paramMdl.setSml250initFlg(GSConstSmail.DSP_ALREADY);
    }

    // グループコンボを設定
    //        List<LabelValueBean> groupCombo = new ArrayList<LabelValueBean>();
    //        groupCombo.add(new LabelValueBean(gsMsg.getMessage("cmn.select.plz"), "-1"));
    //
    //        ArrayList<GroupModel> grpList = grpBiz.getGroupCombList(con);
    //        for (GroupModel grpMdl : grpList) {
    //            LabelValueBean label = new LabelValueBean(grpMdl.getGroupName(),
    //                                                    String.valueOf(grpMdl.getGroupSid()));
    //            groupCombo.add(label);
    //        }

    // グループコンボを設定
    paramMdl.setUserKbnGroupCombo(__getGroupLabelList(con, reqMdl));

    // 使用者 グループコンボ、ユーザコンボを設定
    // _setGroupCombo(con, paramMdl);
    _setUserCombo(con, paramMdl, reqMdl);

    // テーマコンボを設定
    List<LabelValueBean> themeCombo = new ArrayList<LabelValueBean>();
    themeCombo.add(
        new LabelValueBean(
            gsMsg.getMessage("cmn.notset"), String.valueOf(GSConstSmail.SAC_THEME_NOSET)));

    CmnThemeDao themeDao = new CmnThemeDao(con);
    List<CmnThemeModel> themeList = themeDao.select();
    for (CmnThemeModel themeData : themeList) {
      themeCombo.add(
          new LabelValueBean(themeData.getCtmName(), String.valueOf(themeData.getCtmSid())));
    }
    paramMdl.setSml250themeList(themeCombo);

    // 引用符コンボを設定
    List<LabelValueBean> quotesCombo = new ArrayList<LabelValueBean>();
    int[] quotesList = {
      GSConstSmail.SAC_QUOTES_DEF,
      GSConstSmail.SAC_QUOTES_NONE,
      GSConstSmail.SAC_QUOTES_2,
      GSConstSmail.SAC_QUOTES_3,
      GSConstSmail.SAC_QUOTES_4,
      GSConstSmail.SAC_QUOTES_5
    };
    for (int quotes : quotesList) {
      quotesCombo.add(
          new LabelValueBean(
              SmlCommonBiz.getViewMailQuotes(quotes, reqMdl), Integer.toString(quotes)));
    }
    paramMdl.setSml250quotesList(quotesCombo);

    /** ********************** 転送設定 ******************************** */
    paramMdl.setSml250tensoKbn(admMdl.getSmaMailfw());
    if (paramMdl.getSmlAccountMode() == GSConstSmail.ACCOUNTMODE_COMMON
        && paramMdl.getSml250tensoKbn() == GSConstSmail.MAIL_FORWARD_OK) {

      //            /** グループコンボセット **************************************************/
      //            GroupBiz biz = new GroupBiz();
      //            paramMdl.setSml250GpLabelList(biz.getGroupTreeLabelList(
      //                    con, true, gsMsg, paramMdl.getSml250userKbnGroup()));

      /** 現在選択中のメンバーコンボセット ************************************* */
      // UserBiz userBiz = new UserBiz();
      paramMdl.setSml250MbLabelList((__getMemberList(paramMdl.getSml250userSid(), con)));

      /** 追加用メンバーコンボセット ******************************************* */

      // デフォルトユーザ存在フラグ
      boolean defUsrFlg = false;
      Map<String, String> usrSidMap = new HashMap<String, String>();

      // グループSID
      //            int gpSid = NullDefault.getInt(paramMdl.getSml250groupSid(), -1);

      // 除外するユーザSID
      ArrayList<Integer> usrSids = new ArrayList<Integer>();
      String[] userSids = paramMdl.getSml250userSid();
      if (userSids != null) {
        for (int i = 0; i < userSids.length; i++) {
          usrSids.add(new Integer(NullDefault.getInt(userSids[i], -1)));
          usrSidMap.put(userSids[i], userSids[i]);
          if (new Integer(NullDefault.getInt(userSids[i], -1))
              == paramMdl.getSml250DefActUsrSid()) {
            defUsrFlg = true;
          }
        }
      }

      //            List<CmnUsrmInfModel> usList = null;
      List<LabelValueBean> labelListAdd = new ArrayList<LabelValueBean>();

      //            if (paramMdl.getSml250userKbn() != USERKBN_USER) {
      //                usList = userBiz.getBelongUserList(con, gpSid, usrSids);
      //                for (int i = 0; i < usList.size(); i++) {
      //                    CmnUsrmInfModel cuiMdl = usList.get(i);
      //                    labelListAdd.add(new LabelValueBean(cuiMdl.getUsiSei() +
      // cuiMdl.getUsiMei(),
      //                                     String.valueOf(cuiMdl.getUsrSid())));
      //                }
      //            } else {
      for (LabelValueBean lv : paramMdl.getUserKbnUserSelectCombo()) {
        if (!usrSidMap.containsKey(lv.getValue())) {
          labelListAdd.add(lv);
        }
      }
      //            }

      // デフォルトユーザを追加
      for (LabelValueBean lv : labelListAdd) {
        if (lv.getValue().equals(String.valueOf(paramMdl.getSml250DefActUsrSid()))) {
          defUsrFlg = true;
        }
      }
      if (!defUsrFlg && paramMdl.getSml250DefActUsrSid() > 0) {
        labelListAdd.add(
            new LabelValueBean(
                paramMdl.getSml250name(), String.valueOf(paramMdl.getSml250DefActUsrSid())));
      }

      paramMdl.setSml250AdLabelList(labelListAdd);

      // メールアドレスコンボ設定
      paramMdl.setSml250MailList(__getMailCombo(reqMdl));
    }

    _setAutoDestDisp(paramMdl, con);
  }
示例#10
0
  /**
   * ]
   *
   * @param aWebForm AddForm
   * @param request HttpServletRequest
   * @param response HttpServletResponse
   * @throws CDealException
   * @throws Exception
   */
  public static void setEdit1(
      EditForm aWebForm, HttpServletRequest request, HttpServletResponse response)
      throws CDealException, Exception {
    EditForm aWebForm1 = (EditForm) aWebForm;
    Connection mConn = null;
    PreparedStatement pstmt = null;
    String str = ""; // 要返回的 string
    String sKey = ""; // 取出的TREEMAP的KEY
    String sValue = ""; // 取出的TREEMAP的value
    TreeMap itemtype;

    // 初始化页面,初始化事项类别下拉菜单
    // 初始化页面,初始化投诉形式下拉菜单

    TreeMap COMPLAINVERSIONListName2 = new TreeMap(); // 取出aWebForm
    COMPLAINVERSIONListName2 = CCodeMap.getMapByType("行政过错职级");
    aWebForm.setCOMPLAINEDGRADELIST(COMPLAINVERSIONListName2);
    TreeMap COMPLAINVERSIONListName3 = new TreeMap(); // 取出aWebForm
    COMPLAINVERSIONListName3 = CCodeMap.getMapByType("行政管理分类");
    aWebForm.setXZGLFLList(COMPLAINVERSIONListName3);
    TreeMap COMPLAINVERSIONListName4 = new TreeMap(); // 取出aWebForm
    COMPLAINVERSIONListName4 = CCodeMap.getMapByType("行政过错表现形式");
    aWebForm.setXZGCBXXSList(COMPLAINVERSIONListName4);

    try {
      // 从CODEMAP表里取 来源分类 菜单
      ArrayList comeList = CCodeMap.getSortedMap("行政过错行为分类");
      // 从CODEMAP表里取 本级政府任务督办 菜单
      ArrayList localList = CCodeMap.getSortedMap("违反规定履行社会管理职责");
      // 从CODEMAP表里取 上级任务督办 菜单
      ArrayList upList = CCodeMap.getSortedMap("违反内部管理制度");
      // 从CODEMAP表里取 上级任务督办 菜单
      ArrayList lbList = CCodeMap.getSortedMap("其他贻误行政管理工作");
      // 添加 来源分类 到一个数组里面去.然后统一输出到页面
      str = "var XZGCXYFL=new Array('','全部'";
      int k = 0;
      for (; k < comeList.size(); k++) {
        LabelValueBean aLabelValueBean = (LabelValueBean) comeList.get(k);
        sKey = aLabelValueBean.getValue(); // 名字
        str += ",'" + sKey + "',"; // 取出的TREEMAP的KEY
        sValue = aLabelValueBean.getLabel(); // 值
        str += "'" + sValue + "'\n"; // 取出的TREEMAP的value
      }
      // CLog.println(str);
      str += ");\n";
      str += " var permissionitem = new Array (" + k + ");\n";
      str += "permissionitem[0]=new Array('','全部');\n";

      // 添加 违反规定履行社会管理职责
      int j = 1;
      str += "permissionitem[" + j + "]=new Array('','全部'";
      for (int i = 0; i < localList.size(); i++) {
        LabelValueBean aLabelValueBean = (LabelValueBean) localList.get(i);
        sKey = aLabelValueBean.getValue(); // 值
        // 添加每个部门对应的事项类别列表
        str += ",'" + sKey + "',"; // 取出的TREEMAP的KEY
        sValue = aLabelValueBean.getLabel(); // 名字
        str += "'" + sValue + "'\n"; // 取出的TREEMAP的value
      }
      str += ");\n";

      // 添加 违反内部管理制度
      j = 2;
      str += "permissionitem[" + j + "]=new Array('','全部'";
      for (int i = 0; i < upList.size(); i++) {
        LabelValueBean aLabelValueBean = (LabelValueBean) upList.get(i);
        sKey = aLabelValueBean.getValue(); // 值
        // 添加每个部门对应的事项类别列表
        str += ",'" + sKey + "',"; // 取出的TREEMAP的KEY
        sValue = aLabelValueBean.getLabel(); // 名字
        str += "'" + sValue + "'\n"; // 取出的TREEMAP的value
      }
      str += ");\n";
      // 添加 其他贻误行政管理工作
      j = 3;
      str += "permissionitem[" + j + "]=new Array('','全部'";
      for (int i = 0; i < lbList.size(); i++) {
        LabelValueBean aLabelValueBean = (LabelValueBean) lbList.get(i);
        sKey = aLabelValueBean.getValue(); // 值
        // 添加每个部门对应的事项类别列表
        str += ",'" + sKey + "',"; // 取出的TREEMAP的KEY
        sValue = aLabelValueBean.getLabel(); // 名字
        str += "'" + sValue + "'\n"; // 取出的TREEMAP的value
      }
      str += ");\n";

      // 把部门数组和许可事项输出到页面上
      aWebForm1.setPrintSql(str);
    } catch (Exception e) {
      throw new CDealException("设置进入时限监察查询处理的初始值时失败。", e);
    } finally {
      if (pstmt != null) {
        try {
          pstmt.close();
        } catch (Exception e) {
        }
        ;
      }
      if (mConn != null) {
        try {
          mConn.close();
        } catch (Exception e) {
        }
        ;
      }
    }
  }
示例#11
0
  /**
   * <br>
   * [機 能] 初期表示情報を設定する <br>
   * [解 説] <br>
   * [備 考]
   *
   * @param paramMdl Adr020ParamModel
   * @param con コネクション
   * @param userMdl セッションユーザ情報
   * @throws Exception 実行例外
   */
  public void setInitData(Adr020ParamModel paramMdl, Connection con, BaseUserModel userMdl)
      throws Exception {

    AddressBiz addressBiz = new AddressBiz(reqMdl_);
    UserBiz userBiz = new UserBiz();

    GsMessage gsMsg = new GsMessage(reqMdl_);

    // 役職コンボを設定
    paramMdl.setPositionCmbList(getAddressPositionLabelList(con));

    // グループコンボを設定
    paramMdl.setGroupCmbList(addressBiz.getGroupLabelList(con));

    // ユーザコンボを設定
    if (paramMdl.getAdr010cmdMode() == Adr010Const.CMDMODE_CONTACT) {
      paramMdl.setUserCmbList(
          userBiz.getNormalUserLabelList(
              con, Integer.parseInt(paramMdl.getAdr010tantoGroupContact()), null, true, gsMsg));
    } else {
      paramMdl.setUserCmbList(
          userBiz.getNormalUserLabelList(
              con, Integer.parseInt(paramMdl.getAdr010tantoGroup()), null, true, gsMsg));
    }

    // 都道府県コンボを設定
    CommonBiz cmnBiz = new CommonBiz();
    paramMdl.setTdfkCmbList(cmnBiz.getTdfkLabelList(con, gsMsg));

    // 管理者設定ボタン表示フラグを設定
    boolean adminUser = cmnBiz.isPluginAdmin(con, userMdl, GSConstAddress.PLUGIN_ID_ADDRESS);

    AdrAconfDao aconfDao = new AdrAconfDao(con);
    AdrAconfModel aconfMdl = aconfDao.selectAconf();
    // 会社追加ボタン表示フラグを設定
    if (adminUser || (aconfMdl == null || aconfMdl.getAacAcoEdit() == 0)) {
      paramMdl.setAdr020addCompanyBtnFlg(1);
    }
    // ラベル追加ボタン表示フラグを設定
    if (adminUser || (aconfMdl == null || aconfMdl.getAacAlbEdit() == 0)) {
      paramMdl.setAdr020addLabelBtnFlg(1);
    }

    // 閲覧・編集権限の初期値を設定(初期表示時)
    if (paramMdl.getAdr020init() == 0) {
      if (aconfMdl != null) {
        // 管理者が設定
        if (aconfMdl.getAacVrmEdit() == GSConstAddress.MEM_DSP_ADM) {
          paramMdl.setAdr020permitView(aconfMdl.getAacPvwKbn());
          paramMdl.setAdr020permitEdit(aconfMdl.getAacPetKbn());
        } else {
          // 個人が設定
          AdrUconfDao uconfDao = new AdrUconfDao(con);
          AdrUconfModel uconfMdl = uconfDao.select(userMdl.getUsrsid());
          if (uconfMdl != null) {
            paramMdl.setAdr020permitView(uconfMdl.getAucPermitView());
            paramMdl.setAdr020permitEdit(uconfMdl.getAucPermitEdit());
          } else {
            paramMdl.setAdr020permitView(aconfMdl.getAacPvwKbn());
            paramMdl.setAdr020permitEdit(aconfMdl.getAacPetKbn());
          }
        }
      } else {
        paramMdl.setAdr020permitView(GSConst.ADR_VIEWPERMIT_OWN);
        paramMdl.setAdr020permitEdit(GSConstAddress.EDITPERMIT_OWN);
      }
    }

    // 初期表示
    if (paramMdl.getAdr020init() == 0) {

      // モード = 新規登録 の場合、担当者にセッションユーザを設定する
      if (paramMdl.getAdr020ProcMode() == GSConstAddress.PROCMODE_ADD) {
        paramMdl.setAdr020tantoList(new String[] {String.valueOf(userMdl.getUsrsid())});
      }

      // モード = 変更 の場合、DBからアドレス帳情報を読み込む
      if (paramMdl.getAdr020ProcMode() == GSConstAddress.PROCMODE_EDIT) {
        _setAddressData(con, paramMdl);
      }

      // WEBメールからの呼び出しの場合、氏名とメールアドレスを追加する
      if (paramMdl.getAdr020webmail() == 1) {
        long mailNum = paramMdl.getAdr020webmailId();
        WmlDao wmlDao = new WmlDao(con);
        WmlMailDataModel mailData = wmlDao.getMailData(mailNum, reqMdl_.getDomain());
        String webmailAddress = NullDefault.getString(mailData.getFromAddress(), "");

        if (webmailAddress.indexOf("<") > 0) {
          String userName = webmailAddress.substring(0, webmailAddress.indexOf("<")).trim();
          webmailAddress = webmailAddress.substring(webmailAddress.indexOf("<") + 1).trim();
          if (userName.startsWith("\"")) {
            userName = userName.substring(1);
          }
          if (userName.endsWith("\"")) {
            userName = userName.substring(0, userName.length() - 1);
          }
          userName = userName.replaceFirst(" ", " ");
          int userIdx = userName.indexOf(" ");
          if (userIdx > 0) {
            paramMdl.setAdr020unameSei(userName.substring(0, userIdx).trim());
            paramMdl.setAdr020unameMei(userName.substring(userIdx).trim());
          } else {
            paramMdl.setAdr020unameSei(userName);
          }

          if (webmailAddress.indexOf(">") > 0) {
            webmailAddress = webmailAddress.substring(0, webmailAddress.indexOf(">"));
          }
        }
        paramMdl.setAdr020mail1(webmailAddress);
      }

      paramMdl.setAdr020init(1);
    }
    // モード = 新規 かつ 複写ボタンをクリック時、DBからアドレス帳情報を読み込む
    if (paramMdl.getAdr020ProcMode() == GSConstAddress.PROCMODE_ADD
        && paramMdl.getAdrCopyFlg() == 1) {
      _setAddressData(con, paramMdl);
      paramMdl.setAdrCopyFlg(0);
    }

    // 会社名を設定
    _setCompanyData(con, paramMdl);

    // 役職を追加した場合の役職の設定
    if (paramMdl.getAdrPosition() > 0) {
      paramMdl.setAdr020position(paramMdl.getAdrPosition());
      paramMdl.setAdrPosition(0);
    }

    // ユーザ一覧を取得する
    CmnCmbsortConfDao sortDao = new CmnCmbsortConfDao(con);
    CmnCmbsortConfModel sortMdl = sortDao.getCmbSortData();
    AddressDao addressDao = new AddressDao(con);
    List<LabelValueBean> allUserCombo = addressDao.getAllUserList(sortMdl);

    // 担当者コンボの設定を行う
    if (paramMdl.getAdr020tantoGroup() == -2
        || paramMdl.getAdr020permitViewUserGroup() == -2
        || paramMdl.getAdr020permitEditUserGroup() == -2) {

      CmnBelongmDao belongmDao = new CmnBelongmDao(con);

      int userSid = userMdl.getUsrsid();
      int defGrpSid = belongmDao.selectUserBelongGroupDef(userSid);

      paramMdl.setAdr020tantoGroup(defGrpSid);
      paramMdl.setAdr020permitViewUserGroup(defGrpSid);
      paramMdl.setAdr020permitEditUserGroup(defGrpSid);
    }

    List<List<LabelValueBean>> tantoComboList =
        addressBiz.getUserCombo(
            con, allUserCombo, paramMdl.getAdr020tantoGroup(), paramMdl.getAdr020tantoList());
    paramMdl.setSelectTantoCombo(tantoComboList.get(0));
    paramMdl.setNoSelectTantoCombo(tantoComboList.get(1));
    ArrayList<String> selSidList = new ArrayList<String>();
    for (LabelValueBean bean : tantoComboList.get(0)) {
      selSidList.add(bean.getValue());
    }
    paramMdl.setAdr020tantoList(selSidList.toArray(new String[0]));

    // グループ一覧を取得
    ArrayList<LabelValueBean> allGroupCombo = new ArrayList<LabelValueBean>();
    GroupBiz groupBiz = new GroupBiz();
    ArrayList<GroupModel> gpList = groupBiz.getGroupList(con);

    for (GroupModel gpMdl : gpList) {
      allGroupCombo.add(
          new LabelValueBean(gpMdl.getGroupName(), String.valueOf(gpMdl.getGroupSid())));
    }
    // 閲覧グループコンボを設定する
    List<List<LabelValueBean>> viewPermitGroupComboList =
        addressBiz.getGroupCombo(con, allGroupCombo, paramMdl.getAdr020permitViewGroup());
    paramMdl.setSelectPermitViewGroup(viewPermitGroupComboList.get(0));
    paramMdl.setNoSelectPermitViewGroup(viewPermitGroupComboList.get(1));
    selSidList = new ArrayList<String>();
    for (LabelValueBean bean : viewPermitGroupComboList.get(0)) {
      selSidList.add(bean.getValue());
    }
    paramMdl.setAdr020permitViewGroup(selSidList.toArray(new String[0]));
    // 編集グループコンボを設定する
    List<List<LabelValueBean>> editPermitGroupComboList =
        addressBiz.getGroupCombo(con, allGroupCombo, paramMdl.getAdr020permitEditGroup());
    paramMdl.setSelectPermitEditGroup(editPermitGroupComboList.get(0));
    paramMdl.setNoSelectPermitEditGroup(editPermitGroupComboList.get(1));
    selSidList = new ArrayList<String>();
    for (LabelValueBean bean : editPermitGroupComboList.get(0)) {
      selSidList.add(bean.getValue());
    }
    paramMdl.setAdr020permitEditGroup(selSidList.toArray(new String[0]));

    // 閲覧ユーザコンボを設定する
    List<List<LabelValueBean>> viewPermitUserComboList =
        addressBiz.getUserCombo(
            con,
            allUserCombo,
            paramMdl.getAdr020permitViewUserGroup(),
            paramMdl.getAdr020permitViewUser());
    paramMdl.setSelectPermitViewUser(viewPermitUserComboList.get(0));
    paramMdl.setNoSelectPermitViewUser(viewPermitUserComboList.get(1));
    selSidList = new ArrayList<String>();
    for (LabelValueBean bean : viewPermitUserComboList.get(0)) {
      selSidList.add(bean.getValue());
    }
    paramMdl.setAdr020permitViewUser(selSidList.toArray(new String[0]));

    // 編集ユーザコンボを設定する
    List<List<LabelValueBean>> editPermitUserComboList =
        addressBiz.getUserCombo(
            con,
            allUserCombo,
            paramMdl.getAdr020permitEditUserGroup(),
            paramMdl.getAdr020permitEditUser());
    paramMdl.setSelectPermitEditUser(editPermitUserComboList.get(0));
    paramMdl.setNoSelectPermitEditUser(editPermitUserComboList.get(1));
    selSidList = new ArrayList<String>();
    for (LabelValueBean bean : editPermitUserComboList.get(0)) {
      selSidList.add(bean.getValue());
    }
    paramMdl.setAdr020permitEditUser(selSidList.toArray(new String[0]));

    // ラベル情報一覧を設定
    this._setLabelList(con, paramMdl);
  }