package com.cim.idm.mwmsextend.checkrecord.management.action.util;

import org.springframework.stereotype.Component;

import com.cim.idm.framework.orm.service.CommonHistoryDataAdaptor;
import com.cim.idm.mwmsextend.checkrecord.management.data.CheckRecord;
import com.cim.idm.mwmsextend.checkrecord.management.data.CheckRecordHistory;
import com.cim.idm.mwmsextend.checkrecord.management.data.CheckRecordHistoryKey;

@Component
public class CheckRecordHistoryDataAdaptor extends
CommonHistoryDataAdaptor<CheckRecord,CheckRecordHistoryKey,CheckRecordHistory>{

	@Override
	protected CheckRecordHistoryKey getHistoryKey(CheckRecord checkRecord) {
		CheckRecordHistoryKey key = new CheckRecordHistoryKey();
		key.setPlanDate(checkRecord.getKey().getPlanDate());
		key.setCheckPlanName(checkRecord.getKey().getCheckPlanName());
		key.setSiteName(checkRecord.getKey().getSiteName());
		key.setMaterialPackingName(checkRecord.getKey().getMaterialPackingName());
		key.setActLocation(checkRecord.getKey().getActLocation());
		key.setTimeKey(checkRecord.getLastEventTimeKey());
		
		return key;
	}

}
