/*********************************************************************
*	All Rights reserved,Copyright (c) K-Opticom
**********************************************************************
*＜プログラム内容＞
*	システム名		：eo顧客基幹システム
*	モジュール名	：JCREditSbopSvcNiy
*	ソースファイル名：JCREditSbopSvcNiy.java
*	作成者			：富士通
*	日付			：2011年05月17日
*＜機能概要＞
*	顧客対応履歴管理 サブオプション内容編集処理部品
*＜修正履歴＞
*	バージョン	修正日		修正者		修正内容
*	v1.00.00	2011/05/17	富士通		新規作成
*
**********************************************************************/

package eo.web.webview.common;

import java.util.ArrayList;
import java.util.Map;


/**
 * 対応履歴管理システム サブオプション内容編集処理部品<p>
 * <BR>
 * @author 富士通
 */

public class JCREditSbopSvcNiy
{

	/**
	 * サブオプション内容編集を行います。
	 * @param childMap 情報取得対象
	 * @param opSvcKeiNo オプションサービス契約番号
	 * @return サブオプション内容
	 */
	public static String edit(ArrayList childList, String opSvcKeiNo)
	{
		
		String ret = "";
		if(childList == null || opSvcKeiNo == null)
		{
			return ret;
		}
		
		for (int i = 0; i < childList.size(); i++)
		{
			Map<String, Object> wkMap = (Map<String, Object>) childList.get(i);
			
			if (!opSvcKeiNo.equals((String)wkMap.get("key_op_svc_kei_no")))
			{
				continue;
			}
			
			ArrayList wkList = (ArrayList)wkMap.get("EKK0411B002CBSMsg1List");
			
			if (wkList == null)
			{
				continue;
			}
			
			for (int j = 0; j < wkList.size(); j++)
			{
				Map<String, String> childMap = (Map<String, String>)wkList.get(j);
				
				return (String)childMap.get("alias");
			}
		}

		return ret;
	}
}
