/*********************************************************************
*  All Rights reserved,Copyright (c) K-Opticom
**********************************************************************
*＜プログラム内容＞
*	システム名			：eo顧客基幹システム
*	モジュール名		：JBSbatCHStpYkkMlSendPrcRrkMake
*	ソースファイル名	：JBSbatCHStpYkkMlSendPrcRrkMake.java
*	作成者				：富士通　
*	作成日				：2012年05月26日
*＜機能概要＞
*　利用停止予告メール送信料金履歴作成部品です。
*＜修正履歴＞
*	バージョン	修正日		修正者		修正内容
*	v1.00.00	2012/05/26   東海林		新規作成
*	v3.00		2012/06/07   FJ）冨井	【ANK-0024-04-00】新規作成
*********************************************************************/
package eo.business.service;



import eo.business.common.JACbatDebugLogUtil;
import eo.business.common.JBSbatBusinessService;
import eo.business.common.JCCBatCommon;
import eo.business.util.file.JBSbatCHIFM096;
import eo.business.util.file.JBSbatCHIFM131;
import eo.common.constant.JACStrConst;
import eo.framework.item.JBSbatCommonItem;
import eo.framework.item.JBSbatServiceInterfaceMap;
import eo.framework.item.JBSbatOutputItem;


/**
* (クラスの機能概要) <p>
*<BR>
* @author 富士通
*/
public class JBSbatCHStpYkkMlSendPrcRrkMake extends JBSbatBusinessService
{
	/**▼▼▼▼▼▼ツールから生成した宣言です 開始▼▼▼▼▼▼*/
	/**▲▲▲▲▲▲ツールから生成した宣言です 終了▲▲▲▲▲▲*/


	/** 処理区分:利用停止予告メール*/
	private static final String TRN_KBN_USE_STP_YKK_ML = "0";

	/** 処理区分:利用停止予告メール*/
	private static final String TRN_KBN_KYOSEI_DSL_YKK_ML = "1";
	
	/** 退避.料金対応記録種別詳細コード */
	private String tmpPrcTaioKirokSbtDtlCd = null;
	
	/**
	 * 初期処理
	 * @param JBSbatCommonItem commonItem　バッチ共通パラメータ電文
	 * @throws Exception
	 */
	public void initial(JBSbatCommonItem commonItem) throws Exception
	{
	/**▼▼▼▼▼▼業務サービスの初期処理を記述してください。▼▼▼▼▼▼*/
		/**▼▼▼▼▼▼ツールから生成した初期化のソースです 開始▼▼▼▼▼▼*/
		// 共通パラメータを設定します
		super.setCommonInfo(commonItem);
		/**▲▲▲▲▲▲ツールから生成した初期化のソースです 終了▲▲▲▲▲▲*/
		
		assert 	JACbatDebugLogUtil.printDebugLog(super.logPrint, "[S][initial]");
		assert 	JACbatDebugLogUtil.printDebugLog(super.logPrint, "[L][initial][opeDate=" + super.opeDate + "]");
		assert 	JACbatDebugLogUtil.printDebugLog(super.logPrint, "[L][initial][freeItem=" + super.freeItem + "]");
		
		// フリー項目から処理区分を取得
		String trnKbn = super.freeItem;
		if(TRN_KBN_USE_STP_YKK_ML.equals(trnKbn))
		{
			// 利用停止予告メールの場合
			this.tmpPrcTaioKirokSbtDtlCd = JACStrConst.TKRK_SBTD_USE_STP_YKK_ML;
			assert JACbatDebugLogUtil.printDebugLog(super.logPrint, "[L][initial][処理区分=利用停止予告メール]");
		}
		else if(TRN_KBN_KYOSEI_DSL_YKK_ML.equals(trnKbn))
		{
			// 強制解約予告メールの場合
			this.tmpPrcTaioKirokSbtDtlCd = JACStrConst.TKRK_SBTD_KYOSEI_DSL_YKK_ML;
			assert JACbatDebugLogUtil.printDebugLog(super.logPrint, "[L][initial][処理区分=強制解約予告メール]");
		}
		
		assert 	JACbatDebugLogUtil.printDebugLog(super.logPrint, "[E][initial]");
	/**▲▲▲▲▲▲業務サービスの初期処理を記述してください。▲▲▲▲▲▲*/
	}

	/**
	 * 主処理
	 * @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();
		{
			
			// 請求契約番号
			outMap.set(JBSbatCHIFM096.SEIKY_KEI_NO, 				inMap.get(JBSbatCHIFM131.SEIKY_KEI_NO));
			// サービス契約番号
			outMap.set(JBSbatCHIFM096.SVC_KEI_NO, 					inMap.get(JBSbatCHIFM131.SVC_NO));
			// 対応年月日時分秒
			outMap.set(JBSbatCHIFM096.TAIO_DTM, 					super.opeDate.concat(JCCBatCommon.getSysDateTimeStamp().substring(8, 17)));
			// 料金対応記録種別コード
			outMap.set(JBSbatCHIFM096.PRC_TAIO_KIROK_SBT_CD, 		JACStrConst.PRC_TAIO_KIROK_SBT_TOK_PRO_BAT);
			// 料金対応記録種別詳細コード
			outMap.set(JBSbatCHIFM096.PRC_TAIO_KIROK_SBT_DTL_CD, 	this.tmpPrcTaioKirokSbtDtlCd);
			// 督促番号
			outMap.set(JBSbatCHIFM096.TOKUSOKU_NO, 					inMap.get(JBSbatCHIFM131.PRC_SVC_CD));
			// 対応履歴連動対象フラグ
			outMap.set(JBSbatCHIFM096.TAIORRKI_RENDO_TG_FLG, 		JACStrConst.TAIORRKI_RENDO_TG_FLG_HYOJI);
			// 督促メールパターン
			outMap.set(JBSbatCHIFM096.TOKUSOKU_ML_PTN_CD, 			inMap.get(JBSbatCHIFM131.SIME_DAY));
			
			// 出力フラグ設定
			outMap.setOutFlg(true);
		}
		
		// 出力処理
		outputItem.addOutMapList(outMap);
		assert JACbatDebugLogUtil.printDebugLog(super.logPrint, "[E][execute]");
		return outputItem;
	/**▲▲▲▲▲▲業務サービスの主処理を記述してください。▲▲▲▲▲▲*/
	}

	/**
	 * 業務サービス終了処理
	 * @throws Exception
	 */
	public void terminal() throws Exception
	{
	/**▼▼▼▼▼▼業務サービスの終了処理を記述してください。▼▼▼▼▼▼*/
		/**▼▼▼▼▼▼ツールから生成した終了処理のソースです 開始▼▼▼▼▼▼*/
		
		assert JACbatDebugLogUtil.printDebugLog(super.logPrint, "[S][terminal]");
		assert JACbatDebugLogUtil.printDebugLog(super.logPrint, "[E][terminal]");
		
		/**▲▲▲▲▲▲ツールから生成した終了処理のソースです 終了▲▲▲▲▲▲*/
	/**▲▲▲▲▲▲業務サービスの終了処理を記述してください。▲▲▲▲▲▲*/
	}

	/**▼▼▼▼▼▼ツールから生成したメソッドです 開始▼▼▼▼▼▼*/
	/**▲▲▲▲▲▲ツールから生成したメソッドです 終了▲▲▲▲▲▲*/
	
}
