package cn.axzo.msg.center.message.service.todo;

import cn.axzo.msg.center.domain.entity.PendingMessageRecord;
import cn.axzo.msg.center.domain.entity.PendingRecordAdapter;

/**
 * @author yanglin
 */
public class MigrateUtils {

    public static PendingMessageRecord convertAdapterToPending(PendingRecordAdapter adapter) {
        PendingMessageRecord m = new PendingMessageRecord();
        m.setIdentityCode(adapter.getIdentityCode());
        m.setRequestNo(adapter.getRequestNo());
        m.setPromoterId(adapter.getPromoterId());
        m.setPromoterPersonId(adapter.getPromoterPersonId());
        m.setPromoterName(adapter.getPromoterName());
        m.setPromoterType(adapter.getPromoterType());
        m.setExecutorId(adapter.getExecutorId());
        m.setExecutorPersonId(adapter.getExecutorPersonId());
        m.setExecutorName(adapter.getExecutorName());
        m.setExecutorType(adapter.getExecutorType());
        m.setTemplateCode(adapter.getTemplateCode());
        m.setTitle(adapter.getTitle());
        m.setContent(adapter.getContent());
        m.setOrgType(adapter.getOrgType());
        m.setOrgId(adapter.getOrgId());
        m.setOrgName(adapter.getOrgName());
        m.setOuId(adapter.getOuId());
        m.setState(adapter.getState());
        m.setBizCategory(adapter.getBizCategory());
        m.setBizCode(adapter.getBizCode());
        m.setSubBizCode(adapter.getSubBizCode());
        m.setBizDesc(adapter.getBizDesc());
        m.setBizFlag(adapter.getBizFlag());
        m.setBizExtParam(adapter.getBizExtParam());
        m.setRouterParams(adapter.getRouterParams());
        m.setBizFinalState(adapter.getBizFinalState());
        m.setDeadline(adapter.getDeadline());
        m.setRetryCount(adapter.getRetryCount());
        m.setFailCause(null);
        m.setHideUntil(adapter.getHideUntil());
        m.setRecordExt(adapter.getRecordExt());
        m.setIsOuIdMigrated(adapter.getIsOuIdMigrated());
        m.setCreateAt(adapter.getCreateAt());
        m.setUpdateAt(adapter.getUpdateAt());
        return m;
    }

}
