package com.sinosig.util.domain;

import java.io.Serializable;
import org.springframework.util.DigestUtils;

public class PSDEWF implements Serializable {
    /**
	 * default serialVersionUID
	 */
	private static final long serialVersionUID = 1L;

    /**
	 * 业务实体工作流标识
	 */
	String psdewfid;

	/**
	 * 业务实体工作流名称
	 */
	String psdewfname;

	/**
	 * 业务实体标识
	 */
	String psdataentityid;

    /**
	 * 工作流代理模式
	 */
	Integer wfproxymode;

	/*
	 * 逻辑名
	 */
	String logicname;

	/**
     * 部署系统标识
     */
    String pssystemid;

    /**
     * 部署域标识
     */
    String workflowid;

	public String getPsdewfid() {
		if (this.psdewfid == null) {
            return this.psdewfid;
        }
        String srtTmp = this.psdewfid;
        if (this.pssystemid != null) {
            srtTmp = this.pssystemid + srtTmp;
        }
        if (this.workflowid != null) {
            srtTmp = this.workflowid + srtTmp;
        }
        return DigestUtils.md5DigestAsHex(srtTmp.getBytes());
	}

	public void setPsdewfid(String psdewfid) {
		this.psdewfid = psdewfid;
	}

	public String getPsdewfname() {
		return this.psdewfname;
	}
	public void setPsdewfname(String psdewfname) {
		this.psdewfname = psdewfname;
	}

    public String getPssystemid() {
        if (this.pssystemid == null) {
            return this.pssystemid;
        }
        String srtTmp = this.pssystemid;
        if (this.workflowid != null) {
            srtTmp = this.workflowid + srtTmp;
        }
        return DigestUtils.md5DigestAsHex(srtTmp.getBytes());
    }

    public void setPssystemid(String pssystemid) {
        this.pssystemid = pssystemid;
    }

    public String getWorkflowid() {
        if (this.workflowid != null) {
            return DigestUtils.md5DigestAsHex(this.workflowid.getBytes());
        }
        return this.workflowid;
    }

    public void setWorkflowid(String workflowid) {
        this.workflowid = workflowid;
    }

    public Integer getWfproxymode() {
        return this.wfproxymode;
    }

    public void setWfproxymode(Integer wfproxymode) {
        this.wfproxymode = wfproxymode;
    }

    public String getLogicname() {
		return logicname;
	}

	public void setLogicname(String logicname) {
		this.logicname = logicname;
	}

	public String getPsdataentityid() {
		if (this.psdataentityid == null) {
            return this.psdataentityid;
        }
        String srtTmp = this.psdataentityid;
        if (this.pssystemid != null) {
            srtTmp = this.pssystemid + srtTmp;
        }
        if (this.workflowid != null) {
            srtTmp = this.workflowid + srtTmp;
        }
        return DigestUtils.md5DigestAsHex(srtTmp.getBytes());
	}

	public void setPsdataentityid(String psdataentityid) {
	    this.psdataentityid = psdataentityid;
	}
}
