Ejemplo n.º 1
0
  /**
   * <br>
   * [機 能] 初期表示を行う <br>
   * [解 説] <br>
   * [備 考]
   *
   * @param con コネクション
   * @param paramMdl パラメータ情報
   * @param userSid ユーザSID
   * @param reqMdl リクエスト情報
   * @throws SQLException SQL実行時例外
   */
  public void setInitData(
      Connection con, Sml310ParamModel paramMdl, int userSid, RequestModel reqMdl)
      throws SQLException {

    List<AccountDataModel> adMdlList = new ArrayList<AccountDataModel>();
    List<LabelDataModel> ldMdlList = new ArrayList<LabelDataModel>();
    Sml310Dao dao = new Sml310Dao(con);

    //        SmlCommonBiz comonBiz = new SmlCommonBiz(con, reqMdl);
    //        //アカウントリストを取得
    //        adMdlList = dao.getAccountList(userSid);
    //        paramMdl.setAcntList(comonBiz.getAcntCombo(reqMdl, adMdlList));
    // アカウント名取得
    int selectSacSid = paramMdl.getSmlAccountSid();
    SmlAccountDao sacDao = new SmlAccountDao(con);
    SmlAccountModel sacMdl = sacDao.select(selectSacSid);
    paramMdl.setSml310accountName(sacMdl.getSacName());

    // ラベルリストを取得
    int dspCnt = paramMdl.getDspCount();
    if (dspCnt == 0 && adMdlList.size() != 0) {
      paramMdl.setSmlAccountSid(adMdlList.get(0).getAccountSid());
      paramMdl.setDspCount(1);
    }

    int selectAccountNum = paramMdl.getSmlAccountSid();
    ldMdlList = dao.getLabelList(selectAccountNum);
    LabelDataModel sldDspMdl = null;

    int count = 0;
    // ラベルを画面表示用に加工する
    List<LabelDataModel> lbList = new ArrayList<LabelDataModel>();

    for (LabelDataModel sldSetMdl : ldMdlList) {
      sldDspMdl = new LabelDataModel();
      sldDspMdl.setLabelSid(sldSetMdl.getLabelSid());
      sldDspMdl.setLabelName(sldSetMdl.getLabelName());
      sldDspMdl.setLabelOrder(sldSetMdl.getLabelOrder());
      sldDspMdl.setLbValue(
          __getRadioValueStr(sldSetMdl.getLabelSid(), sldSetMdl.getLabelOrder(), count));
      count++;
      lbList.add(sldDspMdl);
    }
    paramMdl.setLbnList(lbList);

    // チェックされている並び順がNULLの場合、初期値設定
    if (StringUtil.isNullZeroString(paramMdl.getSml310SortRadio()) && ldMdlList.size() > 0) {

      LabelDataModel sldMdl = ldMdlList.get(0);
      paramMdl.setSml310SortRadio(
          __getRadioValueStr(sldMdl.getLabelSid(), sldMdl.getLabelOrder(), 0));
    }
  }
Ejemplo n.º 2
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:
     }
   }
 }
Ejemplo n.º 3
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);
  }
Ejemplo n.º 4
0
  /**
   * <br>
   * [機 能] 確定ボタンクリック時 <br>
   * [解 説] <br>
   * [備 考]
   *
   * @param map ActionMapping
   * @param form フォーム
   * @param req リクエスト
   * @param res レスポンス
   * @param con コネクション
   * @return forward アクションフォワード
   * @throws Exception 実行時例外
   */
  public ActionForward __doDelete(
      ActionMapping map,
      Sml140knForm form,
      HttpServletRequest req,
      HttpServletResponse res,
      Connection con)
      throws Exception {

    ActionForward forward = null;

    if (!isTokenValid(req, true)) {
      log__.info("2重投稿");
      forward = getSubmitErrorPage(map, req);
      return forward;
    }

    con.setAutoCommit(false);
    boolean commit = false;
    RequestModel reqMdl = getRequestModel(req);

    try {

      Sml140knParamModel paramMdl = new Sml140knParamModel();
      paramMdl.setParam(form);
      Sml140knBiz biz = new Sml140knBiz(con);
      biz.updateSyudoDelSetting(reqMdl, paramMdl);
      paramMdl.setFormData(form);

      GsMessage gsMsg = new GsMessage(reqMdl);
      String delete = gsMsg.getMessage("cmn.delete");

      // ログ出力処理
      SmlAccountModel sacMdl = new SmlAccountModel();
      SmlAccountDao sacDao = new SmlAccountDao(con);
      sacMdl = sacDao.select(form.getSml140AccountSid());

      String accountName = sacMdl.getSacName();

      if (paramMdl.getSml140SelKbn() != GSConstSmail.ACCOUNT_SEL) {
        accountName = gsMsg.getMessage("wml.wml120.01");
      }

      SmlCommonBiz smlBiz = new SmlCommonBiz(con, reqMdl);
      smlBiz.outPutLog(
          map,
          reqMdl,
          delete,
          GSConstLog.LEVEL_INFO,
          "アカウント:"
              + accountName
              + "\n[value]"
              + form.getSml140JdelKbn()
              + "-"
              + form.getSml140JYear()
              + "-"
              + form.getSml140JMonth()
              + ", "
              + form.getSml140SdelKbn()
              + "-"
              + form.getSml140SYear()
              + "-"
              + form.getSml140SMonth()
              + ", "
              + form.getSml140WdelKbn()
              + "-"
              + form.getSml140WYear()
              + "-"
              + form.getSml140WMonth()
              + ", "
              + form.getSml140DdelKbn()
              + "-"
              + form.getSml140DYear()
              + "-"
              + form.getSml140DMonth());
      commit = true;

      forward = __doCompDsp(map, form, req, res);
      return forward;

    } catch (SQLException e) {
      log__.error("SQLException", e);
      throw e;
    } finally {
      if (commit) {
        con.commit();
      } else {
        JDBCUtil.rollback(con);
      }
    }
  }