/*********************************************************************
* All Rights reserved, Copyright (c) K-Opticom
**********************************************************************
*＜プログラム内容＞
*   システム名      ：eo顧客基幹システム
*   モジュール名    ：ZMW04801SFLogic
*   ソースファイル名：ZMW04801SFLogic.java
*   作成者          ：富士通
*   日付            ：2011年04月18日
*＜機能概要＞
*   NGワード一覧のビューロジックです。。
*＜修正履歴＞
*   バージョン  修正日       修正者      修正内容
*   v1.00       2011/04/18   FJ）岩元    新規作成
*
**********************************************************************/

package eo.web.webview.ZMW04801SF;

import java.util.HashMap;

import com.fujitsu.futurity.web.x31.X31CWebConst;
import com.fujitsu.futurity.web.x31.X31SDataBeanAccess;

import eo.common.constant.JPCModelConstant;
import eo.common.constant.JPCOnlineMessageConstant;
import eo.common.util.JPCUtilCommon;
import eo.web.webview.JCCWebBusinessLogic;
import eo.web.webview.CommonInfoCF.CommonInfoCFConst;
import eo.web.webview.ZMW05001SF.ZMW05001SFConst;
import eo.web.webview.ZMW05101SF.ZMW05101SFConst;
import eo.web.webview.common.JZMScreenConst;
import eo.web.webview.common.JZMWebCommon;
import eo.web.webview.common.JZMWebConst;
import eo.web.webview.mapping.ZMSV0017_ZMSV0017OPDBMapper;
import eo.web.webview.mapping.ZMSV0018_ZMSV0018OPDBMapper;

/**
 * NGワード一覧のビューロジックです。
 * @author 909281
 *
 */
@SuppressWarnings("serial")
public class ZMW04801SFLogic extends JCCWebBusinessLogic
{

	/** 機能コード１  */
	private static final String FUNC_CD_1 = JPCModelConstant.FUNC_CD_1;

	/** サーチエラーフラグ 1  */
	private static final String SEARCH_ERR_FLG_ZERO = JPCModelConstant.SEARCH_ERR_FLG_ZERO;

	/** サーチエラーフラグ 2  */
	private static final String SEARCH_ERR_FLG_OVERMAX = JPCModelConstant.SEARCH_ERR_FLG_OVERMAX;

	/** サーチエラーフラグ 3  */
	private static final String SEARCH_ERR_FLG_NODATA = JPCModelConstant.SEARCH_ERR_FLG_NODATA;

	/** メッセージID EKB0330--I  */
	private static final String SEARCH_ERR_MESSAGE_ZERO = JPCOnlineMessageConstant.EKB0330__I;

	/** メッセージID EKB0340--I  */
	private static final String SEARCH_ERR_MESSAGE_OVERMAX =  JPCOnlineMessageConstant.EKB0340__I;

	/** メッセージID EKB0350--I  */
	private static final String SEARCH_ERR_MESSAGE_NODATA =  JPCOnlineMessageConstant.EKB0350__I;

	/** 最大検索数 */
	private static final String MAX_SHOW_CNT = "ZMW04801_MAX_SHOW_CNT";

	
	/**
	 * NGワード更新初期表示処理を行います。
	 * <br>
	 * @return 処理結果 
	 * @throws Exception 予期せぬエラー
	 */
	@SuppressWarnings("unchecked")
	public boolean init()throws Exception
	{
		
		// 共有フォームBean
		X31SDataBeanAccess commonBean = getCommonInfoBean();
		
		// サービスフォームBeanの内容の取得
		X31SDataBeanAccess bean = getServiceFormBean();
		
		// 戻り先IDの取得
		String screenId = JZMWebCommon.getScreenId(this);
		
		// 戻り先IDの有無で戻るボタン表示フラグを表示する
		JZMWebCommon.setSendMessageBoolean(bean, ZMW04801SFConst.BACK_BTN_DSP_FLG, screenId != null);
		
		HashMap<String, Object> input = (HashMap<String, Object>)JZMWebCommon.getScreenInfo(this);
		
		// サービスフォームBeanのデータBeanアクセスクラスを取得。
		X31SDataBeanAccess[] paramBean = {bean};
		
		// ユースケースID格納用マップ
		HashMap<String, Object> paramMap = new HashMap<String, Object>();

		// マッピング用Map
		HashMap<String, Object> dataMap = new HashMap<String, Object>();

		// サービス実行結果データ用Map
		HashMap<String, Object> outputMap = new HashMap<String, Object>();
		
		paramMap.put(X31CWebConst.TELEGRAM_INFO_USECASE_ID, JZMWebConst.SV17);
		
		// マッピングクラスのインスタンスを生成
		ZMSV0017_ZMSV0017OPDBMapper mapper = new ZMSV0017_ZMSV0017OPDBMapper();
		
		// 画面情報が存在する場合
		if(input != null)
		{
			
			// 削除完了画面からの遷移の場合ページリンク情報と選択NGワード番号を削除する
			if(JZMWebCommon.getScreenInfo(this, JZMScreenConst.SCREEN_ID_ZMW05102) != null)
			{
				JZMWebCommon.setScreenInfo(this, JZMScreenConst.SCREEN_ID_ZMW05102, null);
				JZMWebCommon.clearPageLinkInfo(this, this.getGamenId());
				JZMWebCommon.setSendMessageString(bean, ZMW04801SFConst.CHOICE_NG_WORD_NO, null);
			}
			
			// NGワードコードインデックスを設定する
			if(input.containsKey(ZMW04801SFConst.NG_WORD_CD_IDX_01))
			{
				String idx = (String)input.get(ZMW04801SFConst.NG_WORD_CD_IDX_01);
				JZMWebCommon.setPullDownIndex(bean, ZMW04801SFConst.NG_WORD_CD_INFO, ZMW04801SFConst.NG_WORD_CD_IDX_01, idx);
			}
			
			mapper.setZMSV001701SC(paramBean, dataMap, FUNC_CD_1);
			
			// 基準日を設定する
			if(dataMap.containsKey(JZMWebConst.SC1701))
			{
				HashMap<String, Object> inDataMap = (HashMap<String, Object>)dataMap.get(JZMWebConst.SC1701);
				inDataMap.put(JZMWebConst.KEY_STDARDYMD, JZMWebCommon.getOpeDate(this, null));
			}
			
			// NGワードコード検索情報上りマッピング
			mapper.setZMSV001702CC(paramBean, dataMap, FUNC_CD_1);
			
			// ページング情報の設定
			JZMWebCommon.upmapperPageLinkInfo(this, JZMWebConst.CC1702, dataMap);
			
			// サービスの呼び出し
			invokeService(paramMap, dataMap, outputMap);
			
			// マッピングクラスの呼び出し
			mapper.getZMSV001701SC(paramBean, outputMap);
			mapper.getZMSV001702CC(paramBean, outputMap);

			// 検索エラーフラグの取得
			String searchErrFlg = JZMWebCommon.getSearchErrFlg(JZMWebConst.CC1702, outputMap);
			
			if(SEARCH_ERR_FLG_ZERO.equals(searchErrFlg))
			{
				if(!JZMWebCommon.hasMsgList(commonBean))
				{
					// 検索結果が0件の場合、エラーメッセージを表示
					JZMWebCommon.setMessageInfo(this, SEARCH_ERR_MESSAGE_ZERO);
				}
			}
			else if(SEARCH_ERR_FLG_OVERMAX.equals(searchErrFlg))
			{
				if(!JZMWebCommon.hasMsgList(commonBean))
				{
					String[] item = {JZMWebCommon.getSearchConst(MAX_SHOW_CNT)};
					
					// 検索結果が最大検索件数を超える場合、エラーメッセージを表示
					JZMWebCommon.setMessageInfo(this, SEARCH_ERR_MESSAGE_OVERMAX, item);
			
				}
			}
			else
			{
				
				if(SEARCH_ERR_FLG_NODATA.equals(searchErrFlg))
				{
					if(!JZMWebCommon.hasMsgList(commonBean))
					{
						// 表示ページに該当するデータが存在しない場合、エラーメッセージを表示
						JZMWebCommon.setMessageInfo(this, SEARCH_ERR_MESSAGE_NODATA);
				
					}
				}
				
				// ページング情報の設定
				JZMWebCommon.downmapperPageLinkInfo(this, JZMWebConst.CC1702, outputMap);
			
				// 検索のコマンドIDを設定する。
				JZMWebCommon.setSearchCommand(this, JZMWebConst.EVENT_ID_PAGING);
				
				// 明細表示フラグを1(表示)を設定
				bean.sendMessageBoolean(ZMW04801SFConst.DTL_DSP_FLG, X31CWebConst.DATABEAN_SET_VALUE, true);

				// 選択行の設定
				JZMWebCommon.setChoiseRow(bean, 
						ZMW04801SFConst.CHOICE_NG_WORD_NO, 
						ZMW04801SFConst.EZM0161B010CBSMSG1LIST, 
						ZMW04801SFConst.NG_WORD_NO_02, 
						ZMW04801SFConst.CHOICE_ROW);
				
				// 背景色のスタイルクラスを設定
				JZMWebCommon.setRowStyleClass(bean, ZMW04801SFConst.EZM0161B010CBSMSG1LIST, ZMW04801SFConst.ROW_STYLE_CLASS_02);
			}
			
			// 検索フラグを1(表示)を設定
			bean.sendMessageBoolean(ZMW04801SFConst.SEARCH_FLG, X31CWebConst.DATABEAN_SET_VALUE, true);
		}
		else
		{
			
			// マッピング
			mapper.setZMSV001701SC(paramBean, dataMap, FUNC_CD_1);

			// 基準日の設定
			if(dataMap.containsKey(JZMWebConst.SC1701))
			{
				HashMap<String, Object> inDataMap = (HashMap<String, Object>)dataMap.get(JZMWebConst.SC1701);
				inDataMap.put(JZMWebConst.KEY_STDARDYMD, JZMWebCommon.getOpeDate(this, null));
			}
			
			// サービスの呼び出し
			invokeService(paramMap, dataMap, outputMap);
			
			// マッピングクラスの呼び出し
			mapper.getZMSV001701SC(paramBean, outputMap);
			
			// 明細表示フラグを0(非表示)を設定
			bean.sendMessageBoolean(ZMW04801SFConst.DTL_DSP_FLG, X31CWebConst.DATABEAN_SET_VALUE, false);
			
			// 検索フラグを0(非表示)を設定
			bean.sendMessageBoolean(ZMW04801SFConst.SEARCH_FLG, X31CWebConst.DATABEAN_SET_VALUE, false);
		}
		
		// 画面遷移
		commonBean.sendMessageString(CommonInfoCFConst.NEXT_SCREEN_ID, X31CWebConst.DATABEAN_SET_VALUE, JZMScreenConst.SCREEN_ID_ZMW04801);
		commonBean.sendMessageString(CommonInfoCFConst.NEXT_SCREEN_NAME, X31CWebConst.DATABEAN_SET_VALUE, JZMScreenConst.SCREEN_NAME_ZMW04801);
		
		return true;
	}

	/**
	 * 検索処理を行います。
	 * <br>
	 * @return 処理結果 
	 * @throws Exception 予期せぬエラー
	 */
	public boolean search()throws Exception
	{

		// 共有フォームBean
		X31SDataBeanAccess commonBean = getCommonInfoBean();
		
		// サービスフォームBean
		X31SDataBeanAccess bean = getServiceFormBean();
		X31SDataBeanAccess[] paramBean = {bean};
		
		// ページリンク情報の初期化
		JZMWebCommon.clearPageLinkInfo(this, this.getGamenId());

		// 表示情報を検索情報に置き換える
		JZMWebCommon.shiftBeanValue(bean, ZMW04801SFConst.NG_WORD_NO, ZMW04801SFConst.DSP_NG_WORD_NO);
		JZMWebCommon.shiftBeanValue(bean, ZMW04801SFConst.NG_WORD, ZMW04801SFConst.DSP_NG_WORD);
		JZMWebCommon.shiftBeanValue(bean, ZMW04801SFConst.APLY_PRD_END_DAY, ZMW04801SFConst.DSP_APLY_PRD_END_DAY);
		JZMWebCommon.shiftBeanValue(bean, ZMW04801SFConst.APLY_PRD_END_MON, ZMW04801SFConst.DSP_APLY_PRD_END_MON);
		JZMWebCommon.shiftBeanValue(bean, ZMW04801SFConst.APLY_PRD_END_YEAR, ZMW04801SFConst.DSP_APLY_PRD_END_YEAR);
		JZMWebCommon.shiftBeanValue(bean, ZMW04801SFConst.APLY_PRD_STA_DAY, ZMW04801SFConst.DSP_APLY_PRD_STA_DAY);
		JZMWebCommon.shiftBeanValue(bean, ZMW04801SFConst.APLY_PRD_STA_MON, ZMW04801SFConst.DSP_APLY_PRD_STA_MON);
		JZMWebCommon.shiftBeanValue(bean, ZMW04801SFConst.APLY_PRD_STA_YEAR, ZMW04801SFConst.DSP_APLY_PRD_STA_YEAR);
		
		// NGワードコード値の取得と設定
		String selectedValue = JZMWebCommon. getPullDownSelectedValue(bean,
				ZMW04801SFConst.NG_WORD_CD_INFO, ZMW04801SFConst.NG_WORD_CD_VALUE_LIST_01, ZMW04801SFConst.NG_WORD_CD_IDX_01);
		bean.sendMessageString(ZMW04801SFConst.NG_WORD_CD, X31CWebConst.DATABEAN_SET_VALUE, selectedValue);   
		
		// 適用開始年月日
		String  ymd = JPCUtilCommon.concatYmd(bean.sendMessageString(ZMW04801SFConst.APLY_PRD_STA_YEAR, X31CWebConst.DATABEAN_GET_VALUE),
				bean.sendMessageString(ZMW04801SFConst.APLY_PRD_STA_MON, X31CWebConst.DATABEAN_GET_VALUE),
				bean.sendMessageString(ZMW04801SFConst.APLY_PRD_STA_DAY, X31CWebConst.DATABEAN_GET_VALUE));
		bean.sendMessageString(ZMW04801SFConst.APLY_PRD_STA , X31CWebConst.DATABEAN_SET_VALUE , JZMWebCommon.nullToBlank(ymd));
		
		// 適用終了年月日
		ymd = JPCUtilCommon.concatYmd(bean.sendMessageString(ZMW04801SFConst.APLY_PRD_END_YEAR, X31CWebConst.DATABEAN_GET_VALUE),
				bean.sendMessageString(ZMW04801SFConst.APLY_PRD_END_MON, X31CWebConst.DATABEAN_GET_VALUE),
				bean.sendMessageString(ZMW04801SFConst.APLY_PRD_END_DAY, X31CWebConst.DATABEAN_GET_VALUE));
		bean.sendMessageString(ZMW04801SFConst.APLY_PRD_END , X31CWebConst.DATABEAN_SET_VALUE , JZMWebCommon.nullToBlank(ymd));
		
		// 選択行の設定
		JZMWebCommon.setSendMessageString(bean, ZMW04801SFConst.CHOICE_ROW, JZMWebConst.ZERO);
		
		// 検索済みフラグの設定
		JZMWebCommon.setSendMessageBoolean(bean, ZMW04801SFConst.SEARCH_FLG, true);
		
		// 明細表示フラグの設定
		JZMWebCommon.setSendMessageBoolean(bean, ZMW04801SFConst.DTL_DSP_FLG, false);
		
		// 検索サービスを呼び出す
		callSearchSrv(bean, paramBean);

		// 遷移先画面ID、名称の設定
		commonBean.sendMessageString(CommonInfoCFConst.NEXT_SCREEN_ID,
				X31CWebConst.DATABEAN_SET_VALUE, JZMScreenConst.SCREEN_ID_ZMW04801);
		commonBean.sendMessageString(CommonInfoCFConst.NEXT_SCREEN_NAME,
				X31CWebConst.DATABEAN_SET_VALUE, JZMScreenConst.SCREEN_NAME_ZMW04801);
		
		return true;
	}



	/**
	 * ページング処理を行います。
	 * <br>
	 * @return 処理結果 
	 * @throws Exception 予期せぬエラー
	 */
	public boolean paging()throws Exception
	{

		// 共通フォームBeanの内容を取得
		X31SDataBeanAccess commoninfoBean = getCommonInfoBean();
		
		// サービスフォームBeanのデータBeanアクセスクラスを取得。
		X31SDataBeanAccess bean = super.getServiceFormBean();
		X31SDataBeanAccess[] paramBean = {bean};
		
		// 表示情報を検索情報に設定する
		JZMWebCommon.shiftBeanValue(bean, ZMW04801SFConst.DSP_NG_WORD_NO, ZMW04801SFConst.NG_WORD_NO);
		JZMWebCommon.shiftBeanValue(bean, ZMW04801SFConst.DSP_NG_WORD, ZMW04801SFConst.NG_WORD);
		JZMWebCommon.shiftBeanValue(bean, ZMW04801SFConst.DSP_APLY_PRD_END_DAY, ZMW04801SFConst.APLY_PRD_END_DAY);
		JZMWebCommon.shiftBeanValue(bean, ZMW04801SFConst.DSP_APLY_PRD_END_MON, ZMW04801SFConst.APLY_PRD_END_MON);
		JZMWebCommon.shiftBeanValue(bean, ZMW04801SFConst.DSP_APLY_PRD_END_YEAR, ZMW04801SFConst.APLY_PRD_END_YEAR);
		JZMWebCommon.shiftBeanValue(bean, ZMW04801SFConst.DSP_APLY_PRD_STA_DAY, ZMW04801SFConst.APLY_PRD_STA_DAY);
		JZMWebCommon.shiftBeanValue(bean, ZMW04801SFConst.DSP_APLY_PRD_STA_MON, ZMW04801SFConst.APLY_PRD_STA_MON);
		JZMWebCommon.shiftBeanValue(bean, ZMW04801SFConst.DSP_APLY_PRD_STA_YEAR, ZMW04801SFConst.APLY_PRD_STA_YEAR);
		String index = JZMWebCommon.getPullDownIndex(bean,
				ZMW04801SFConst.NG_WORD_CD_INFO,
				ZMW04801SFConst.NG_WORD_CD_VALUE_LIST_01,
				JZMWebCommon.getSendMessageString(bean, ZMW04801SFConst.NG_WORD_CD));
		JZMWebCommon.setPullDownIndex(bean, ZMW04801SFConst.NG_WORD_CD_INFO, ZMW04801SFConst.NG_WORD_CD_IDX_01, index);
		
		// 選択行の設定
		JZMWebCommon.setSendMessageString(bean, ZMW04801SFConst.CHOICE_ROW, JZMWebConst.ZERO);
		
		// 検索済フラグの設定
		JZMWebCommon.setSendMessageBoolean(bean, ZMW04801SFConst.SEARCH_FLG, true);
		
		// 明細表示フラグの設定
		JZMWebCommon.setSendMessageBoolean(bean, ZMW04801SFConst.DTL_DSP_FLG, false);
		
		// 検索情報の実行
		callSearchSrv(bean, paramBean);
			
		// 遷移先画面ID、名称の設定
		commoninfoBean.sendMessageString(CommonInfoCFConst.NEXT_SCREEN_ID,
				X31CWebConst.DATABEAN_SET_VALUE, JZMScreenConst.SCREEN_ID_ZMW04801);
		commoninfoBean.sendMessageString(CommonInfoCFConst.NEXT_SCREEN_NAME,
				X31CWebConst.DATABEAN_SET_VALUE, JZMScreenConst.SCREEN_NAME_ZMW04801);
		return true;
	}
	

	/**
	 * 新規登録ボタン処理を行います。
	 * <br>
	 * @return 処理結果 
	 * @throws Exception 予期せぬエラー
	 */
	public boolean newAdd()throws Exception
	{

		// 共有フォームBean
		X31SDataBeanAccess commonBean = getCommonInfoBean();

		// サービスフォームBean
		X31SDataBeanAccess bean = getServiceFormBean();

		// 情報格納用HashMap
		HashMap<String, Object> paramMap = new HashMap<String, Object>();
		
		// セッションに情報を格納する
		setTransData(bean, paramMap);
		JZMWebCommon.setScreenInfo(this, JZMScreenConst.SCREEN_ID_ZMW04801, paramMap);
		
		// 戻り先画面IDの設定
		JZMWebCommon.setScreenId(this, JZMScreenConst.SCREEN_ID_ZMW04901, JZMScreenConst.SCREEN_ID_ZMW04801);
		JZMWebCommon.setScreenId(this, JZMScreenConst.SCREEN_ID_ZMW04903, JZMScreenConst.SCREEN_ID_ZMW04801);
	
		// 画面遷移
		commonBean.sendMessageString(CommonInfoCFConst.NEXT_SCREEN_ID, X31CWebConst.DATABEAN_SET_VALUE, JZMScreenConst.SCREEN_ID_ZMW04901);
		commonBean.sendMessageString(CommonInfoCFConst.NEXT_SCREEN_NAME, X31CWebConst.DATABEAN_SET_VALUE, JZMScreenConst.SCREEN_NAME_ZMW04901);
				
		return true;
	}

	/**
	 * 更新ボタン処理を行います。
	 * <br>
	 * @return 処理結果 
	 * @throws Exception 予期せぬエラー
	 */
	public boolean upd()throws Exception
	{

		// 共有フォームBean
		X31SDataBeanAccess commonBean = getCommonInfoBean();

		// サービスフォームBean
		X31SDataBeanAccess bean = getServiceFormBean();

		// 選択行インデックスを取得
		String index = JZMWebCommon.getSendMessageString(bean, ZMW04801SFConst.CHOICE_ROW);
		String choiceNo = JZMWebCommon.getBeanArrayValue(bean,
				ZMW04801SFConst.EZM0161B010CBSMSG1LIST,
				Integer.parseInt(index),
				ZMW04801SFConst.NG_WORD_NO_02);
		
		// 情報格納用HashMap
		HashMap<String, Object> paramMap = new HashMap<String, Object>();
		
		// セッションに情報を格納する
		setTransData(bean, paramMap);
		JZMWebCommon.setScreenInfo(this, JZMScreenConst.SCREEN_ID_ZMW04801, paramMap);
		
		// 引渡し情報格納用HashMap
		HashMap<String, Object> output = new HashMap<String, Object>();
		output.put(ZMW05001SFConst.NG_WORD_NO, choiceNo);
		JZMWebCommon.setScreenInfo(this, JZMScreenConst.SCREEN_ID_ZMW05001, output);

		// 戻り先画面IDの設定
		JZMWebCommon.setScreenId(this, JZMScreenConst.SCREEN_ID_ZMW05001, JZMScreenConst.SCREEN_ID_ZMW04801);
		JZMWebCommon.setScreenId(this, JZMScreenConst.SCREEN_ID_ZMW05003, JZMScreenConst.SCREEN_ID_ZMW04801);
	
		// 画面遷移
		commonBean.sendMessageString(CommonInfoCFConst.NEXT_SCREEN_ID, X31CWebConst.DATABEAN_SET_VALUE, JZMScreenConst.SCREEN_ID_ZMW05001);
		commonBean.sendMessageString(CommonInfoCFConst.NEXT_SCREEN_NAME, X31CWebConst.DATABEAN_SET_VALUE, JZMScreenConst.SCREEN_NAME_ZMW05001);
		
		
		return true;
	}
	
	/**
	 * 削除ボタン処理を行います。
	 * <br>
	 * @return 処理結果 
	 * @throws Exception 予期せぬエラー
	 */
	public boolean del()throws Exception
	{

		// 共有フォームBean
		X31SDataBeanAccess commonBean = getCommonInfoBean();

		// サービスフォームBean
		X31SDataBeanAccess bean = getServiceFormBean();
		
		// 選択行のインデックスを取得
		String index = JZMWebCommon.getSendMessageString(bean, ZMW04801SFConst.CHOICE_ROW);
		
		// 選択NGワード番号を取得
		String choiceNo = JZMWebCommon.getBeanArrayValue(bean,
				ZMW04801SFConst.EZM0161B010CBSMSG1LIST,
				Integer.parseInt(index),
				ZMW04801SFConst.NG_WORD_NO_02);
		
		// 選択更新年月日を取得
		String choiceUpdDtm = JZMWebCommon.getBeanArrayValue(bean,
				ZMW04801SFConst.EZM0161B010CBSMSG1LIST,
				Integer.parseInt(index),
				ZMW04801SFConst.UPD_DTM_02);
				
		// 情報格納用HashMap
		HashMap<String, Object> paramMap = new HashMap<String, Object>();
		// セッションに情報を格納する
		setTransData(bean, paramMap);
		
		JZMWebCommon.setScreenInfo(this, JZMScreenConst.SCREEN_ID_ZMW04801, paramMap);

		// 引き渡し情報の格納
		HashMap<String, Object> output = new HashMap<String, Object>();
		output.put(ZMW05101SFConst.NG_WORD_NO, choiceNo);
		output.put(ZMW05101SFConst.UPD_DTM, choiceUpdDtm);
		JZMWebCommon.setScreenInfo(this, JZMScreenConst.SCREEN_ID_ZMW05101, output);
		
		// 戻り先画面IDの設定
		JZMWebCommon.setScreenId(this, JZMScreenConst.SCREEN_ID_ZMW05101, JZMScreenConst.SCREEN_ID_ZMW04801);
		JZMWebCommon.setScreenId(this, JZMScreenConst.SCREEN_ID_ZMW05102, JZMScreenConst.SCREEN_ID_ZMW04801);
	
		// 画面遷移
		commonBean.sendMessageString(CommonInfoCFConst.NEXT_SCREEN_ID, X31CWebConst.DATABEAN_SET_VALUE, JZMScreenConst.SCREEN_ID_ZMW05101);
		commonBean.sendMessageString(CommonInfoCFConst.NEXT_SCREEN_NAME, X31CWebConst.DATABEAN_SET_VALUE, JZMScreenConst.SCREEN_NAME_ZMW05101);
		
		return true;
	}
	
	/**
	 * 戻るボタン処理を行います。
	 * <br>
	 * @return 処理結果 
	 * @throws Exception 予期せぬエラー
	 */
	public boolean back()throws Exception
	{

		// 共有フォームBean
		X31SDataBeanAccess commonBean = getCommonInfoBean();

		// 画面遷移
		commonBean.sendMessageString(CommonInfoCFConst.NEXT_SCREEN_ID, X31CWebConst.DATABEAN_SET_VALUE, JZMWebCommon.getScreenId(this));
		commonBean.sendMessageString(CommonInfoCFConst.NEXT_SCREEN_NAME, X31CWebConst.DATABEAN_SET_VALUE , JZMWebConst.BLANK);
		
		return true;
	}

	/**
	 * 検索サービスを呼び出します
	 * @param bean
	 * @param paramBean
	 */
	private void callSearchSrv(X31SDataBeanAccess bean, X31SDataBeanAccess[] paramBean)
	{
		// ユースケースID格納用マップを生成。
		HashMap<String, Object> paramMap = new HashMap<String, Object>();
		
		paramMap.put(X31CWebConst.TELEGRAM_INFO_USECASE_ID, JZMWebConst.SV18);
		
		// マッピングクラスのインスタンスを生成
		ZMSV0018_ZMSV0018OPDBMapper mapper = new ZMSV0018_ZMSV0018OPDBMapper();
		HashMap<String, Object> dataMap = new HashMap<String, Object>();
		mapper.setZMSV001801CC(paramBean, dataMap, FUNC_CD_1);
		
		// ページング情報の設定
		JZMWebCommon.upmapperPageLinkInfo(this, JZMWebConst.CC1801, dataMap);
		
		// 検索結果格納用マップを生成。
		HashMap<String, Object> outputMap = new HashMap<String, Object>();
		
		// サービスの呼び出し
		invokeService(paramMap, dataMap, outputMap);
		
		// 一覧の初期化
		bean.getDataBeanArray(ZMW04801SFConst.EZM0161B010CBSMSG1LIST).clearArray();
		
		// マッピングクラスの呼び出し
		mapper.getZMSV001801CC(paramBean, outputMap);
		
		// 検索エラーフラグの取得
		String searchErrFlg = JZMWebCommon.getSearchErrFlg(JZMWebConst.CC1801, outputMap);
		
		if(SEARCH_ERR_FLG_ZERO.equals(searchErrFlg))
		{
			
			// 検索結果が0件の場合、エラーメッセージを表示
			JZMWebCommon.setMessageInfo(this, SEARCH_ERR_MESSAGE_ZERO);
		}
		else if(SEARCH_ERR_FLG_OVERMAX.equals(searchErrFlg))
		{
			String[] item = {JZMWebCommon.getSearchConst(MAX_SHOW_CNT)};
			
			// 検索結果が最大検索件数を超える場合、エラーメッセージを表示
			JZMWebCommon.setMessageInfo(this, SEARCH_ERR_MESSAGE_OVERMAX, item);
		}
		else
		{
			if(SEARCH_ERR_FLG_NODATA.equals(searchErrFlg))
			{
				
				// 表示ページに該当するデータが存在しない場合、エラーメッセージを表示
				JZMWebCommon.setMessageInfo(this, SEARCH_ERR_MESSAGE_NODATA);
				JZMWebCommon.setSendMessageString(bean, ZMW04801SFConst.CHOICE_ROW, JZMWebConst.ZERO);
			}
			
			// 明細表示フラグに1(表示)を設定
			JZMWebCommon.setSendMessageBoolean(bean, ZMW04801SFConst.DTL_DSP_FLG, true);
			
			// ページング情報の設定
			JZMWebCommon.downmapperPageLinkInfo(this, JZMWebConst.CC1801, outputMap);
			
			// 検索のコマンドIDを設定する。
			JZMWebCommon.setSearchCommand(this, JZMWebConst.EVENT_ID_PAGING);
			
			// 明細背景色を設定する
			JZMWebCommon.setRowStyleClass(bean, ZMW04801SFConst.EZM0161B010CBSMSG1LIST, ZMW04801SFConst.ROW_STYLE_CLASS_02);
		}
		
		// 検索フラグを1(表示)を設定
		bean.sendMessageBoolean(ZMW04801SFConst.SEARCH_FLG, X31CWebConst.DATABEAN_SET_VALUE, true);
	}

	/**
	 * セッション情報に格納するハッシュマップを作成する
	 * @param bean
	 * @param paramMap
	 */
	private void setTransData(X31SDataBeanAccess bean,
			HashMap<String, Object> paramMap)
	{
		
		// 選択行の取得
		String selectIndex = JZMWebCommon.getSendMessageString(bean, ZMW04801SFConst.CHOICE_ROW);
		if(selectIndex == null || JZMWebConst.BLANK.equals(selectIndex))
		{
			selectIndex = JZMWebConst.ZERO;
		}
		
		// 選択NGワードの取得
		String choiseNgWordNo = JZMWebCommon.getBeanArrayValue(bean,
				ZMW04801SFConst.EZM0161B010CBSMSG1LIST,
				Integer.parseInt(selectIndex),
				ZMW04801SFConst.NG_WORD_NO_02);
		
		// NGワードコードインデックスの取得
		String ngWordCdIndex = JZMWebCommon.getPullDownIndex(bean, 
				ZMW04801SFConst.NG_WORD_CD_INFO,
				ZMW04801SFConst.NG_WORD_CD_VALUE_LIST_01,
				JZMWebCommon.getSendMessageString(bean, ZMW04801SFConst.NG_WORD_CD));

		putBeanValue(bean, paramMap, ZMW04801SFConst.NG_WORD_NO);
		putBeanValue(bean, paramMap, ZMW04801SFConst.NG_WORD_CD);
		putBeanValue(bean, paramMap, ZMW04801SFConst.NG_WORD);
		putBeanValue(bean, paramMap, ZMW04801SFConst.APLY_PRD_STA_YEAR);
		putBeanValue(bean, paramMap, ZMW04801SFConst.APLY_PRD_STA_MON);
		putBeanValue(bean, paramMap, ZMW04801SFConst.APLY_PRD_STA_DAY);
		putBeanValue(bean, paramMap, ZMW04801SFConst.APLY_PRD_STA);
		putBeanValue(bean, paramMap, ZMW04801SFConst.APLY_PRD_END_YEAR);
		putBeanValue(bean, paramMap, ZMW04801SFConst.APLY_PRD_END_MON);
		putBeanValue(bean, paramMap, ZMW04801SFConst.APLY_PRD_END_DAY);
		putBeanValue(bean, paramMap, ZMW04801SFConst.APLY_PRD_END);
		putBeanValue(bean, paramMap, ZMW04801SFConst.DSP_NG_WORD_NO, ZMW04801SFConst.NG_WORD_NO);
		putBeanValue(bean, paramMap, ZMW04801SFConst.DSP_NG_WORD, ZMW04801SFConst.NG_WORD);
		putBeanValue(bean, paramMap, ZMW04801SFConst.DSP_APLY_PRD_STA_YEAR, ZMW04801SFConst.APLY_PRD_STA_YEAR);
		putBeanValue(bean, paramMap, ZMW04801SFConst.DSP_APLY_PRD_STA_MON, ZMW04801SFConst.APLY_PRD_STA_MON);
		putBeanValue(bean, paramMap, ZMW04801SFConst.DSP_APLY_PRD_STA_DAY, ZMW04801SFConst.APLY_PRD_STA_DAY);
		putBeanValue(bean, paramMap, ZMW04801SFConst.DSP_APLY_PRD_END_YEAR, ZMW04801SFConst.APLY_PRD_END_YEAR);
		putBeanValue(bean, paramMap, ZMW04801SFConst.DSP_APLY_PRD_END_MON, ZMW04801SFConst.APLY_PRD_END_MON);
		putBeanValue(bean, paramMap, ZMW04801SFConst.DSP_APLY_PRD_END_DAY, ZMW04801SFConst.APLY_PRD_END_DAY);
		paramMap.put(ZMW04801SFConst.CHOICE_NG_WORD_NO, choiseNgWordNo);
		paramMap.put(ZMW04801SFConst.NG_WORD_CD_IDX_01, ngWordCdIndex);
	}

	
	/** 
	 * bean内の指定した項目をparamMapにputします。 
	 * @param bean	DataBean
	 * @param paramMap
	 * @param key	ハッシュマップのキー項目
	 * */
	private void putBeanValue(X31SDataBeanAccess bean, 
			HashMap<String, Object> paramMap,
			String key)
	{
		String value = JZMWebCommon.getSendMessageString(bean, key);
		paramMap.put(key, value);
	}

	/** 
	 * bean内の指定した項目をparamMapにputします。 
	 * @param bean	DataBean
	 * @param paramMap
	 * @param key	ハッシュマップのキー項目
	 * @param valueColumnName 値を取得する項目名商
	 * */
	private void putBeanValue(X31SDataBeanAccess bean, 
			HashMap<String, Object> paramMap,
			String key,
			String valueColumnName)
	{
		String value = JZMWebCommon.getSendMessageString(bean, valueColumnName);
		paramMap.put(key, value);
	}
}
