/*********************************************************************
*  All Rights reserved,Copyright (c) K-Opticom
**********************************************************************
*＜プログラム内容＞
*	システム名			：eo顧客基幹システム
*	モジュール名		：JBSbatCHKyoseiMdgcPrcRirekMake
*	ソースファイル名	：JBSbatCHKyoseiMdgcPrcRirekMake.java
*	作成者				：富士通　
*	作成日				：2012年05月30日
*＜機能概要＞
*　強制窓口登録料金履歴作成部品です。
*＜修正履歴＞
*	バージョン	修正日		修正者		修正内容
*	v3.00.00	2012/05/30   FJ(古谷	新規作成
*********************************************************************/
package eo.business.service;

import java.util.HashMap;

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.JBSbatKKIFI003;
import eo.common.constant.JACStrConst;
import eo.framework.item.JBSbatCommonItem;
import eo.framework.item.JBSbatServiceInterfaceMap;
import eo.framework.item.JBSbatOutputItem;
import eo.framework.item.JBSbatCommonDBInterface;
import eo.framework.db.JBSbatSQLAccess;
import eo.framework.util.JBSbatCheckUtil;

/**
* (クラスの機能概要) <p>
*<BR>
* @author 富士通
*/
public class JBSbatCHKyoseiMdgcPrcRirekMake extends JBSbatBusinessService
{
	/**▼▼▼▼▼▼ツールから生成した宣言です 開始▼▼▼▼▼▼*/
	/**▲▲▲▲▲▲ツールから生成した宣言です 終了▲▲▲▲▲▲*/
	
	/** 料金対応記録種別コード*/
	private String prcTaioKrkSbtCd = null;
	
	/** 料金対応記録種別詳細コード*/
	private String prcTaioKrkSbtDtlCd = 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 + "]");
		assert 	JACbatDebugLogUtil.printDebugLog(super.logPrint, "[E][initial]");
		
		// フリー項目を分割する
		String[] freeItem = super.freeItem.split(JACStrConst.FREE_DIV, -1);
		this.prcTaioKrkSbtCd = freeItem[0];
		this.prcTaioKrkSbtDtlCd = freeItem[1];
		
		assert JACbatDebugLogUtil.printDebugLog(super.logPrint, "[L][initial][prcTaioKrkSbtCd = " + this.prcTaioKrkSbtCd + "]");
		assert JACbatDebugLogUtil.printDebugLog(super.logPrint, "[L][initial][prcTaioKrkSbtDtlCd = " + this.prcTaioKrkSbtDtlCd + "]");
		
		
	/**▲▲▲▲▲▲業務サービスの初期処理を記述してください。▲▲▲▲▲▲*/
	}

	/**
	 * 主処理
	 * @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();
		// 料金履歴情報作成（請求書作成）編集・出力
		outputItem.addOutMapList(makePrcRrkInfo(inMap));
		
		assert 	JACbatDebugLogUtil.printDebugLog(super.logPrint, "[E][execute]");
		return outputItem;
	/**▲▲▲▲▲▲業務サービスの主処理を記述してください。▲▲▲▲▲▲*/
	}

	/**
	 * 料金履歴情報作成（請求書作成）編集・出力
	 * @param  inMap       入力電文
	 * @return JBSbatServiceInterfaceMap		出力情報
	 * @throws Exception  業務サービス内で発生した例外全般
	 */
	private JBSbatServiceInterfaceMap makePrcRrkInfo(JBSbatServiceInterfaceMap inMap) throws Exception
	{
		assert 	JACbatDebugLogUtil.printDebugLog(super.logPrint, "[S][makePrcRrkInfo]");
		// 料金履歴情報マップ
		JBSbatServiceInterfaceMap tmpMap = new JBSbatServiceInterfaceMap();

		// 料金対応記録登録情報作成
		// 設定値
		tmpMap.set(JBSbatCHIFM096.SEIKY_KEI_NO, 				inMap.get(JBSbatKKIFI003.SEIKY_KEI_NO));	// 01.請求契約番号
		tmpMap.set(JBSbatCHIFM096.SVC_KEI_NO, 					null);	// 02.サービス契約番号
		tmpMap.set(JBSbatCHIFM096.TAIO_DTM, 					super.opeDate.concat(JCCBatCommon.getSysDateTimeStamp().substring(8, 17)));			// 03.対応年月日時分秒
		tmpMap.set(JBSbatCHIFM096.PRC_TAIO_KIROK_SBT_CD, 		prcTaioKrkSbtCd);	// 04.料金対応記録種別コード
		tmpMap.set(JBSbatCHIFM096.PRC_TAIO_KIROK_SBT_DTL_CD, 	prcTaioKrkSbtDtlCd);// 05.料金対応記録種別詳細コード
		tmpMap.set(JBSbatCHIFM096.KIROK_TG_YM, 					null);	// 06.記録対象年月
		tmpMap.set(JBSbatCHIFM096.TOKUSOKU_NO, 					null);	// 07.督促番号
		tmpMap.set(JBSbatCHIFM096.TOKUSOKU_IDO_NO, 				null);	// 08.督促異動番号
		tmpMap.set(JBSbatCHIFM096.SEIKY_NO, 					null);;// 09.請求番号
		tmpMap.set(JBSbatCHIFM096.KNK_NO, 						null);	// 10.金庫番号
		tmpMap.set(JBSbatCHIFM096.SAIKEN_NO, 					null);	// 11.債権番号
		tmpMap.set(JBSbatCHIFM096.NYUKIN_NO, 					null);	// 12.入金番号
		tmpMap.set(JBSbatCHIFM096.EFILE_KANRI_NO, 				null);	// 13.電子ファイル管理番号
		tmpMap.set(JBSbatCHIFM096.TAIORRKI_RENDO_TG_FLG, 		JACStrConst.TAIORRKI_RENDO_TG_FLG_HIHYOJI);	// 14.対応履歴連動対象フラグ
		tmpMap.set(JBSbatCHIFM096.AMNT_CHBF, 					null);	// 15.変更前金額
		tmpMap.set(JBSbatCHIFM096.AMNT_CHAF, 					null);	// 16.変更後金額
		tmpMap.set(JBSbatCHIFM096.TOKUSOKU_STAT_CHBF, 			null);	// 17.変更前督促ステータス
		tmpMap.set(JBSbatCHIFM096.TOKUSOKU_STAT_CHAF, 			null);	// 18.変更後督促ステータス
		tmpMap.set(JBSbatCHIFM096.KNK_PRC_KMK_CD_CHBF, 			null);	// 19.変更前金庫料金項目コード
		tmpMap.set(JBSbatCHIFM096.KNK_PRC_KMK_CD_CHAF, 			null);	// 20.変更後金庫料金項目コード
		tmpMap.set(JBSbatCHIFM096.TOKUSOKU_ML_PTN_CD, 			null);	// 21.督促メールパターン
		tmpMap.set(JBSbatCHIFM096.COMPENSATION_FLG_CHBF, 		null);	// 22.変更前補償費扱いフラグ
		tmpMap.set(JBSbatCHIFM096.COMPENSATION_FLG_CHAF, 		null);	// 23.変更後補償費扱いフラグ
		tmpMap.set(JBSbatCHIFM096.KIJI, 						null);	// 24.記事
		
		tmpMap.setOutFlg(true);
		
		assert JACbatDebugLogUtil.printDebugLog(super.logPrint, "[L][makePrcRrkInfo][tmpMap=" + tmpMap.getMap().toString() + "]");
		assert 	JACbatDebugLogUtil.printDebugLog(super.logPrint, "[E][makePrcRrkInfo]");
		return tmpMap;
	}

	/**
	 * 業務サービス終了処理
	 * @throws Exception 業務サービス内で発生した例外全般
	 */
	public void terminal() throws Exception
	{
	/**▼▼▼▼▼▼業務サービスの終了処理を記述してください。▼▼▼▼▼▼*/
		/**▼▼▼▼▼▼ツールから生成した終了処理のソースです 開始▼▼▼▼▼▼*/
		/**▲▲▲▲▲▲ツールから生成した終了処理のソースです 終了▲▲▲▲▲▲*/

		assert 	JACbatDebugLogUtil.printDebugLog(super.logPrint, "[S][terminal]");
		assert 	JACbatDebugLogUtil.printDebugLog(super.logPrint, "[E][terminal]");
		
	/**▲▲▲▲▲▲業務サービスの終了処理を記述してください。▲▲▲▲▲▲*/
	}

	/**▼▼▼▼▼▼ツールから生成したメソッドです 開始▼▼▼▼▼▼*/
	/**▲▲▲▲▲▲ツールから生成したメソッドです 終了▲▲▲▲▲▲*/
}
