/*********************************************************************
*  All Rights reserved,Copyright (c) K-Opticom
**********************************************************************
*＜プログラム内容＞
*	システム名			：eo顧客基幹システム
*	モジュール名		：JBSbatCHSeikyusReHakIcrnSksTrn
*	ソースファイル名	：JBSbatCHSeikyusReHakIcrnSksTrn.java
*	作成者				：富士通　
*	作成日				：2011年11月28日
*＜機能概要＞
*　請求書再発行一覧作成処理部品です。
*＜修正履歴＞
*	バージョン	修正日		修正者		修正内容
*	v1.00.00	2011/11/28   富士通		新規作成
*	v3.00		2012/10/04	FJ)岡田		【ST2-2012-0001733】請求金額のNULL考慮追加
*	v4.00		2013/03/28	FJ)浜口		【内部管理番号-0000791】集約キーに料金対応記録大分類コード、料金対応記録詳細分類コードを追加
*********************************************************************/
package eo.business.service;

import java.util.HashMap;

import eo.business.common.JACBatCommon;
import eo.business.common.JACbatDebugLogUtil;
import eo.business.common.JBSbatBusinessService;
import eo.business.common.JCHbatSeikyKaknoBusinessUtil;
import eo.business.util.file.JBSbatCHIFE036;
import eo.business.util.file.JBSbatCHIFM125;
import eo.business.util.table.JBSbatCH_M_PRC_KMK_CS_CHGE;
import eo.business.util.table.JBSbatZM_M_CD_NM_KANRI;
import eo.common.constant.JACStrConst;
import eo.common.constant.JPCBatchMessageConstant;
import eo.common.util.JPCUtilCommon;
import eo.framework.application.JBSbatBusinessException;
import eo.framework.db.JBSbatSQLAccess;
import eo.framework.item.JBSbatCommonDBInterface;
import eo.framework.item.JBSbatCommonItem;
import eo.framework.item.JBSbatOutputItem;
import eo.framework.item.JBSbatServiceInterfaceMap;

/**
* (クラスの機能概要) <p>
*<BR>
* @author 富士通
*/
public class JBSbatCHSeikyusReHakIcrnSksTrn extends JBSbatBusinessService
{
	/**▼▼▼▼▼▼ツールから生成した宣言です 開始▼▼▼▼▼▼*/
	/** テーブル(コード名称管理)*/
	private static final String D_TBL_NAME_ZM_M_CD_NM_KANRI = "ZM_M_CD_NM_KANRI";

	/** SQL定義キー(CH_SELECT_005)*/
	private static final String ZM_M_CD_NM_KANRI_CH_SELECT_005 = "CH_SELECT_005";

	/** テーブルアクセスクラス(コード名称管理)*/
	private JBSbatSQLAccess db_ZM_M_CD_NM_KANRI = null;
	/**▲▲▲▲▲▲ツールから生成した宣言です 終了▲▲▲▲▲▲*/

	/** 入力．キー項目（登録者ＩＤ＋登録時刻＋請求契約番号） */
	private String inSaveKey = null;

	/** 退避．キー項目（登録者ＩＤ＋登録時刻＋請求契約番号） */
	private String befSaveKey = null;

	/** 退避．手数料有無フラグ */
	private String commisionUmFlg = null;

	/** キー単位出力件数 */
	private int keygruOutCnt = 0;
	
	/** 請求対応内容_発行手数料マップ */
	private HashMap<String, String> hakkoCommisionMap = null;
	
	/** 印紙税対象マップ */
	private HashMap<String, String> inshiTaxTgMap = null;

	/** 
	 * インデント用：全角SP3文字 
	 */
	private static final String ZEN_SPECE_3 = "　　　";
	
	/** 編集用 文字数制限値（２５） */
	private static final int MOJISUU_25 = 25;

	/**
	 * 初期処理
	 * @param JBSbatCommonItem commonItem　バッチ共通パラメータ電文
	 * @throws Exception
	 */
	public void initial(JBSbatCommonItem commonItem) throws Exception
	{
	/**▼▼▼▼▼▼業務サービスの初期処理を記述してください。▼▼▼▼▼▼*/
		/**▼▼▼▼▼▼ツールから生成した初期化のソースです 開始▼▼▼▼▼▼*/
		// 共通パラメータを設定します
		super.setCommonInfo(commonItem);

		// DBアクセスクラスを生成します
		db_ZM_M_CD_NM_KANRI = new JBSbatSQLAccess(commonItem, D_TBL_NAME_ZM_M_CD_NM_KANRI);
		/**▲▲▲▲▲▲ツールから生成した初期化のソースです 終了▲▲▲▲▲▲*/
		
		
		assert JACbatDebugLogUtil.printDebugLog(super.logPrint, "[S][initial]");
		assert JACbatDebugLogUtil.printDebugLog(super.logPrint, "[S][initial][opeDate=" + super.opeDate + "]");
		assert JACbatDebugLogUtil.printDebugLog(super.logPrint, "[S][initial][freeItem=" + super.freeItem + "]");
		
		// TODO 暫定対応開始　※決まっていないため仮コード
		// コード名称取得
//		this.hakkoCommisionMap = makeCodeMap("CDXXXXX");
//		this.inshiTaxTgMap = makeCodeMap("CDXXXXX");
		this.hakkoCommisionMap = new HashMap<String, String>();
		this.inshiTaxTgMap = new HashMap<String, String>();
		this.hakkoCommisionMap.put(JACStrConst.COMMISION_UM_FLG_OFF, "発行手数料なし");
		this.hakkoCommisionMap.put(JACStrConst.COMMISION_UM_FLG_ON, "発行手数料あり");
		this.inshiTaxTgMap.put("1", "要");
		// 暫定対応終了
		
		// キー単位出力件数を初期化
		this.keygruOutCnt = 0;
		
		assert JACbatDebugLogUtil.printDebugLog(super.logPrint, "[E][initial][keygruOutCnt=" + keygruOutCnt + "]");
		assert JACbatDebugLogUtil.printDebugLog(super.logPrint, "[E][initial]");
		
	/**▲▲▲▲▲▲業務サービスの初期処理を記述してください。▲▲▲▲▲▲*/
	}

	/**
	 * コードマップを作成します。
	 * 
	 * @param cdShbt コード種別
	 * @return codeMap コードマップ
	 * @throws Exception 業務サービス内で発生した例外全般
	 */
	private HashMap<String, String> makeCodeMap(String cdShbt) throws Exception
	{
		assert JACbatDebugLogUtil.printDebugLog(super.logPrint, "[S][makeCodeMap]");
		assert JACbatDebugLogUtil.printDebugLog(super.logPrint, "[S][setPayWay][cdShbt=" + cdShbt + "]");
		
		JBSbatCommonDBInterface whereParam = new JBSbatCommonDBInterface();
		
		// コード種別コード
		whereParam.setValue(cdShbt);
		// 適用開始年月日
		whereParam.setValue(super.opeDate);
		// 適用終了年月日
		whereParam.setValue(super.opeDate);

		// SQL実行
		executeZM_M_CD_NM_KANRI_CH_SELECT_005(whereParam.getList().toArray());
		JBSbatCommonDBInterface selectMap = db_ZM_M_CD_NM_KANRI.selectNext(); 
		
		// コードマップ作成
		HashMap<String, String> codeMap = new HashMap<String, String>();

		// 取得結果判定
		if (selectMap != null)
		{
			while (selectMap != null)
			{
				//KEY（コード区分）:VALUE（コード区分名称）
				codeMap.put(selectMap.getString(JBSbatZM_M_CD_NM_KANRI.CD_DIV), selectMap.getString(JBSbatZM_M_CD_NM_KANRI.CD_DIV_NM));
				selectMap = db_ZM_M_CD_NM_KANRI.selectNext();
			}
		}
		else
		{
			// ログ出力（【最重要】ＤＢ未存在エラー）
			String[] msgParam = new String[]{ JBSbatCH_M_PRC_KMK_CS_CHGE.TABLE_NAME, whereParam.getList().toString() };
			throw new JBSbatBusinessException(JPCBatchMessageConstant.ECHB0270CH, msgParam);
		}
		
		assert JACbatDebugLogUtil.printDebugLog(super.logPrint, "[E][makeCodeMap][codeMap=" + codeMap.toString() + "]");
		assert JACbatDebugLogUtil.printDebugLog(super.logPrint, "[E][makeCodeMap]");
		
		return codeMap;
	}

	/**
	 * 主処理
	 * @param inMap　入力電文
	 * @return JBSbatOutputItem　出力情報
	 * @throws Exception
	 */
	public JBSbatOutputItem execute(JBSbatServiceInterfaceMap inMap) throws Exception
	{
	/**▼▼▼▼▼▼業務サービスの主処理を記述してください。▼▼▼▼▼▼*/
		
		assert JACbatDebugLogUtil.printDebugLog(super.logPrint, "[S][execute]");
		assert inMap != null ? JACbatDebugLogUtil.printDebugLog(super.logPrint, "[S][execute][inMap = " + inMap.getMap().toString() + "]") : true;
		
		// 請求書再発行一覧（未納分）作成
		JBSbatOutputItem outputItem = new JBSbatOutputItem();
		JBSbatServiceInterfaceMap outMap = new JBSbatServiceInterfaceMap();
		
		{
			// キー項目の作成
			this.makeKeySubject(inMap);
			
			// 退避．キー項目 ≠ NULL かつ 退避．キー項目 ≠ 入力．キー項目 の場合
			if(this.befSaveKey != null && !this.befSaveKey.equals(this.inSaveKey))
			{
				assert outMap != null ? JACbatDebugLogUtil.printDebugLog(super.logPrint, "[L][キーブレーク][befSaveKey = " + this.befSaveKey + "]") : true;
				assert outMap != null ? JACbatDebugLogUtil.printDebugLog(super.logPrint, "[L][キーブレーク][inSaveKey = " + this.inSaveKey + "]") : true;
				
				// キー単位出力件数 ＝ 1 の場合
				if(this.keygruOutCnt == 1)
				{
					assert outMap != null ? JACbatDebugLogUtil.printDebugLog(super.logPrint, "[L][execute][対象キー = " + this.inSaveKey + "]") : true;
					assert outMap != null ? JACbatDebugLogUtil.printDebugLog(super.logPrint, "[L][execute][出力件数 = " + keygruOutCnt + "]") : true;
					
					// 再請求対応内容を出力
					outMap = createOutPut2(inMap, commisionUmFlg);
					outputItem.addOutMapList(outMap);
				}
				
				// キー単位出力件数に0を設定
				this.keygruOutCnt = 0;
			}
			
			// ファイル出力
			if(keygruOutCnt == 0)
			{
				assert outMap != null ? JACbatDebugLogUtil.printDebugLog(super.logPrint, "[L][execute][対象キー = " + this.inSaveKey + "]") : true;
				assert outMap != null ? JACbatDebugLogUtil.printDebugLog(super.logPrint, "[L][execute][出力件数 = " + keygruOutCnt + "]") : true;
				
				// １行目を出力
				outMap = createOutPut(inMap);
			}
			else
			{
				assert outMap != null ? JACbatDebugLogUtil.printDebugLog(super.logPrint, "[L][execute][対象キー = " + this.inSaveKey + "]") : true;
				assert outMap != null ? JACbatDebugLogUtil.printDebugLog(super.logPrint, "[L][execute][出力件数 = " + keygruOutCnt + "]") : true;
				
				// ２行目以降を出力
				outMap = createOutPut2(inMap, null);
			}
		}
		
		// 編集情報を更新
		this.befSaveKey = this.inSaveKey;
		this.commisionUmFlg = inMap.getString(JBSbatCHIFM125.COMMISION_UM_FLG);
		this.keygruOutCnt++;
		
		//最終レコードの場合
		if(super.commonItem.isEndRecordFlg())
		{
			assert outMap != null ? JACbatDebugLogUtil.printDebugLog(super.logPrint, "[L][execute][最終レコード]") : true;
			
			// キー単位出力件数 ＝ 1 の場合
			if(this.keygruOutCnt == 1)
			{
				assert outMap != null ? JACbatDebugLogUtil.printDebugLog(super.logPrint, "[L][execute][対象キー = " + this.inSaveKey + "]") : true;
				assert outMap != null ? JACbatDebugLogUtil.printDebugLog(super.logPrint, "[L][execute][出力件数 = " + this.keygruOutCnt + "]") : true;
				
				// 発行手数料データを出力しておく
				assert outMap != null ? JACbatDebugLogUtil.printDebugLog(super.logPrint, "[L][execute][outMap = " + outMap.getMap().toString() + "]") : true;
				outputItem.addOutMapList(outMap);
				
				// 再請求対応内容を出力
				outMap = createOutPut2(inMap, commisionUmFlg);
			}
		}
		
		assert outMap != null ? JACbatDebugLogUtil.printDebugLog(super.logPrint, "[L][execute][outMap = " + outMap.getMap().toString() + "]") : true;
		outputItem.addOutMapList(outMap);
		
		assert JACbatDebugLogUtil.printDebugLog(super.logPrint, "[E][execute]");
		
		return outputItem;
		
	/**▲▲▲▲▲▲業務サービスの主処理を記述してください。▲▲▲▲▲▲*/
	}

	/**
	 * キー項目を作成します
	 * @param inMap　入力電文
	 * @throws Exception
	 */
	private void makeKeySubject(JBSbatServiceInterfaceMap inMap) throws Exception
	{
		assert JACbatDebugLogUtil.printDebugLog(super.logPrint, "[S][makeKeySubject]");
		assert inMap != null ? JACbatDebugLogUtil.printDebugLog(super.logPrint, "[S][makeKeySubject][inMap=" + inMap.getMap().toString() + "]") : true;
		
		StringBuffer strBuf = new StringBuffer();
		strBuf.append(inMap.getString(JBSbatCHIFM125.ADD_ID));
		strBuf.append(inMap.getString(JBSbatCHIFM125.ADD_DTM));
		strBuf.append(inMap.getString(JBSbatCHIFM125.SEIKY_KEI_NO));
		strBuf.append(inMap.getString(JBSbatCHIFM125.PRC_TAIO_KIROK_SBT_CD));
		strBuf.append(inMap.getString(JBSbatCHIFM125.PRC_TAIO_KIROK_SBT_DTL_CD));
		
		//キー項目
		inSaveKey = strBuf.toString();
		
		assert inSaveKey != null ? JACbatDebugLogUtil.printDebugLog(super.logPrint, "[E][makeKeySubject][key1 = " + inSaveKey + "]") : true;
		assert JACbatDebugLogUtil.printDebugLog(super.logPrint, "[E][makeKeySubject]");
	}

	/**
	 *  請求書再発行一覧（未納分）ファイル(再請求対応内容)を作成
	 * @param inMap　入力電文
	 * @param commisionUmFlg　手数料有無フラグ
	 * @return outMap　出力情報
	 * @throws Exception
	 */
	private JBSbatServiceInterfaceMap createOutPut2(JBSbatServiceInterfaceMap inMap, String commisionUm) throws Exception
	{
		assert JACbatDebugLogUtil.printDebugLog(super.logPrint, "[S][createOutPut2]");
		assert inMap != null ? JACbatDebugLogUtil.printDebugLog(super.logPrint, "[S][createOutPut2][inMap=" + inMap.getMap().toString() + "]") : true;
		assert commisionUm != null ? JACbatDebugLogUtil.printDebugLog(super.logPrint, "[S][createOutPut2][commisionUm=" + commisionUm + "]") : true;
		
		JBSbatServiceInterfaceMap outMap = new JBSbatServiceInterfaceMap();
		
		// 1.処理日
		outMap.set(JBSbatCHIFE036.TRN_DAY, JACBatCommon.formatDate(super.opeDate));
		// 2.操作者
		outMap.set(JBSbatCHIFE036.SOSASYA, JACStrConst.KARA_MOJI);
		// 3.操作時刻
		outMap.set(JBSbatCHIFE036.SOSA_JI, JACStrConst.KARA_MOJI);
		// 4.請求契約番号
		outMap.set(JBSbatCHIFE036.SEIKY_KEI_NO, JACStrConst.KARA_MOJI);
		// 5.送付先名（カナ）
		outMap.set(JBSbatCHIFE036.SOHU_SAKI_NM_KANA, JACStrConst.KARA_MOJI);
		// 6.再請求対応内容
		if(keygruOutCnt == 1)
		{
			assert outMap != null ? JACbatDebugLogUtil.printDebugLog(super.logPrint, "[L][execute][対象キー = " + this.inSaveKey + "]") : true;
			assert outMap != null ? JACbatDebugLogUtil.printDebugLog(super.logPrint, "[L][execute][出力件数 = " + keygruOutCnt + "]") : true;
			
			if(commisionUm != null)
			{
				assert outMap != null ? JACbatDebugLogUtil.printDebugLog(super.logPrint, "[L][createOutPut2][退避.手数料有無フラグを使用する]") : true;

				// 退避した手数料有無フラグに対応する値を設定
				outMap.set(JBSbatCHIFE036.RE_SEIKY_TAIO_NAIYO, ZEN_SPECE_3.concat(this.hakkoCommisionMap.get(commisionUm)));
			}
			else
			{
				assert outMap != null ? JACbatDebugLogUtil.printDebugLog(super.logPrint, "[L][createOutPut2][入力.手数料有無フラグを使用する]") : true;
				
				// 入力.手数料有無フラグに対応する値を設定
				outMap.set(JBSbatCHIFE036.RE_SEIKY_TAIO_NAIYO, ZEN_SPECE_3.concat(this.hakkoCommisionMap.get(inMap.getString(JBSbatCHIFM125.COMMISION_UM_FLG))));
			}
		}
		else
		{
			assert outMap != null ? JACbatDebugLogUtil.printDebugLog(super.logPrint, "[L][execute][対象キー = " + this.inSaveKey + "]") : true;
			assert outMap != null ? JACbatDebugLogUtil.printDebugLog(super.logPrint, "[L][execute][出力件数 = " + keygruOutCnt + "]") : true;
			
			outMap.set(JBSbatCHIFE036.RE_SEIKY_TAIO_NAIYO, JACStrConst.KARA_MOJI);
		}
		// 7.随時請求フラグ
		outMap.set(JBSbatCHIFE036.ZUIJI_SIKY_FLG, JACStrConst.KARA_MOJI);
		// 8.対象請求月
		outMap.set(JBSbatCHIFE036.TRGT_SEIKY_MON, JACStrConst.KARA_MOJI);
		// 9.支払期限日
		outMap.set(JBSbatCHIFE036.PAY_KIGEN_DAY, JACStrConst.KARA_MOJI);
		// 10.取扱期限日
		outMap.set(JBSbatCHIFE036.TORI_KIGEN_DAY, JACStrConst.KARA_MOJI);
		// 11.請求額
		outMap.set(JBSbatCHIFE036.SEIKY_AMNT, JACStrConst.KARA_MOJI);
		// 12.印紙
		outMap.set(JBSbatCHIFE036.INSHI, JACStrConst.KARA_MOJI);
		
		//「""」で囲む
		outMap.setMap(JCHbatSeikyKaknoBusinessUtil.quote(outMap.getMap(), JACStrConst.DOUBLE_QUOTE, JACStrConst.DOUBLE_QUOTE));
		
		// 出力フラグを設定
		outMap.setOutFlg(true);
		
		assert outMap != null ? JACbatDebugLogUtil.printDebugLog(super.logPrint, "[S][createOutPut2][outMap=" + outMap.getMap().toString() + "]") : true;
		assert JACbatDebugLogUtil.printDebugLog(super.logPrint, "[E][createOutPut2]");
		return outMap;
	}

	/**
	 *  請求書再発行一覧（未納分）ファイル(発行手数料データ)を作成
	 * @param inMap　入力電文
	 * @return outMap　出力情報
	 * @throws Exception
	 */
	private JBSbatServiceInterfaceMap createOutPut(JBSbatServiceInterfaceMap inMap) throws Exception
	{
		assert JACbatDebugLogUtil.printDebugLog(super.logPrint, "[S][createOutPut]");
		assert inMap != null ? JACbatDebugLogUtil.printDebugLog(super.logPrint, "[S][createOutPut][inMap=" + inMap.getMap().toString() + "]") : true;
		
		JBSbatServiceInterfaceMap outMap = new JBSbatServiceInterfaceMap();
		
		// 1.処理日
		outMap.set(JBSbatCHIFE036.TRN_DAY, JACBatCommon.formatDate(super.opeDate));
		
		// 2.操作者
		outMap.set(JBSbatCHIFE036.SOSASYA, inMap.getString(JBSbatCHIFM125.ADD_ID));
		// 3.操作時刻
		outMap.set(JBSbatCHIFE036.SOSA_JI, JCHbatSeikyKaknoBusinessUtil.formatHms(inMap.getString(JBSbatCHIFM125.ADD_DTM)));
		// 4.請求契約番号
		outMap.set(JBSbatCHIFE036.SEIKY_KEI_NO, inMap.getString(JBSbatCHIFM125.SEIKY_KEI_NO));
		// 5.送付先名（カナ）
		String value = inMap.getString(JBSbatCHIFM125.SHS_KANA);
		if(MOJISUU_25 < value.length())
		{
			// 25桁までを設定
			outMap.set(JBSbatCHIFE036.SOHU_SAKI_NM_KANA, value.substring(0, MOJISUU_25));
		}
		else
		{
			outMap.set(JBSbatCHIFE036.SOHU_SAKI_NM_KANA, value);
		}
		// 6.再請求対応内容
		outMap.set(JBSbatCHIFE036.RE_SEIKY_TAIO_NAIYO, inMap.getString(JBSbatCHIFM125.PAY_WAY));
		// 7.随時請求フラグ
		outMap.set(JBSbatCHIFE036.ZUIJI_SIKY_FLG, inMap.getString(JBSbatCHIFM125.SEIKY_SBT_CD));
		// 8.対象請求月
		outMap.set(JBSbatCHIFE036.TRGT_SEIKY_MON, JPCUtilCommon.formatYears(inMap.getString(JBSbatCHIFM125.TG_SEIKY_YM)));
		// 9.支払期限日
		outMap.set(JBSbatCHIFE036.PAY_KIGEN_DAY, JPCUtilCommon.formatDate(inMap.getString(JBSbatCHIFM125.PAY_KIGEN_YMD)));
		// 10.取扱期限日
		outMap.set(JBSbatCHIFE036.TORI_KIGEN_DAY, JPCUtilCommon.formatDate(inMap.getString(JBSbatCHIFM125.TRAT_LIMIT_YMD)));
		// 11.請求額
		outMap.set(JBSbatCHIFE036.SEIKY_AMNT, formatSeikyAmnt(inMap.get(JBSbatCHIFM125.SEIKY_AMNT)));
		// 12.印紙
		if("0".equals(inMap.getString(JBSbatCHIFM125.INSHI_FLG)))
		{
			// "0"の場合は、""（空文字）を設定
			outMap.set(JBSbatCHIFE036.INSHI, JACStrConst.KARA_MOJI);
			assert outMap != null ? JACbatDebugLogUtil.printDebugLog(super.logPrint, "[L][createOutPut][印紙フラグ = " + inMap.getString(JBSbatCHIFM125.INSHI_FLG) + "]") : true;
		}
		else
		{
			outMap.set(JBSbatCHIFE036.INSHI, inshiTaxTgMap.get(inMap.getString(JBSbatCHIFM125.INSHI_FLG)));
			assert outMap != null ? JACbatDebugLogUtil.printDebugLog(super.logPrint, "[L][createOutPut][印紙フラグ = " + inMap.getString(JBSbatCHIFM125.INSHI_FLG) + "]") : true;
		}
		
		//「""」で囲む
		outMap.setMap(JCHbatSeikyKaknoBusinessUtil.quote(outMap.getMap(), JACStrConst.DOUBLE_QUOTE, JACStrConst.DOUBLE_QUOTE));
		
		// 出力フラグを設定
		outMap.setOutFlg(true);
		
		
		assert outMap != null ? JACbatDebugLogUtil.printDebugLog(super.logPrint, "[S][createOutPut][outMap=" + outMap.getMap().toString() + "]") : true;
		assert JACbatDebugLogUtil.printDebugLog(super.logPrint, "[E][createOutPut]");
		return outMap;
	}

	/**
	 * 金額オブジェクトをカンマ区切り文字列編集する。
	 * （空文字可、NULL不可）
	 * 
	 * @param objAmnt 金額（オブジェクト）
	 * @return 編集後金額
	 */
	private String formatSeikyAmnt(Object objAmnt)
	{
		// 金額を文字列に変換する
		String strAmnt = String.valueOf(objAmnt);
		
		// 金額が空文字or空白の場合
		if (strAmnt.trim().length() == 0)
		{
			// 空文字を返却する
			return JACStrConst.KARA_MOJI;
		}
		
		// 金額のカンマ区切り編集を行う
		return JPCUtilCommon.formatNumber(strAmnt);
		
	}
	
	/**
	 * 業務サービス終了処理
	 * @throws Exception
	 */
	public void terminal() throws Exception
	{
	/**▼▼▼▼▼▼業務サービスの終了処理を記述してください。▼▼▼▼▼▼*/
		/**▼▼▼▼▼▼ツールから生成した終了処理のソースです 開始▼▼▼▼▼▼*/
		// DBアクセスクラスをクローズします
		db_ZM_M_CD_NM_KANRI.close();
		/**▲▲▲▲▲▲ツールから生成した終了処理のソースです 終了▲▲▲▲▲▲*/
		
		assert JACbatDebugLogUtil.printDebugLog(super.logPrint, "[S][terminal]");
		assert JACbatDebugLogUtil.printDebugLog(super.logPrint, "[E][terminal]");
		
	/**▲▲▲▲▲▲業務サービスの終了処理を記述してください。▲▲▲▲▲▲*/
	}

	/**▼▼▼▼▼▼ツールから生成したメソッドです 開始▼▼▼▼▼▼*/

	/**
	 * SQLKEY(CH_SELECT_005)でDBアクセスを行います。<br>
	 * <p>
	 * <b>処理フロー</b><br>
	 * <pre>
	 * 1.引数でバイント変数を設定します。<br>
	 *
	 * 2.DBアクセスを実行します。<br>
	 * 
	 * 3.メソッドの呼び出し方です。<br>
	 *		引数:
	 *		param:順にバイント変数の値をparam配列に入れます。バイント変数は以下に説明します。
	 *		 	コード種別コード
	 *		 	適用開始年月日
	 *		 	適用終了年月日
	 * </pre>
	 * <p>
	 * @param param バイント変数の値配列。
	 * @throws Exception 業務サービス内で発生した例外全般。
	 */
	private void executeZM_M_CD_NM_KANRI_CH_SELECT_005(Object[] param) throws Exception
	{
		// バイント変数のリストを生成します
		JBSbatCommonDBInterface paramList = new JBSbatCommonDBInterface();
		paramList.setValue(param[0].toString());
		paramList.setValue(param[1].toString());
		paramList.setValue(param[2].toString());

		// DBアクセスを実行します
		db_ZM_M_CD_NM_KANRI.selectBySqlDefine(paramList, ZM_M_CD_NM_KANRI_CH_SELECT_005);
	}
	/**▲▲▲▲▲▲ツールから生成したメソッドです 終了▲▲▲▲▲▲*/
}
