// Path: dts-parent/dts-core/src/main/java/org/github/dtsopensource/core/store/help/ActionHelper.java
// public class ActionHelper {
// 
//     private ActionHelper() {
//     }
// 
//     /**
//      * @param actionDO
//      * @return
//      */
//     public static ActionEntity toActionEntity(DtsActionDO actionDO) {
//         if (actionDO == null) {
//             return null;
//         }
//         return new ActionEntity.Builder(actionDO.getActionId()).setAction(actionDO.getAction())
//                 .setActivityId(actionDO.getActivityId()).setContext(actionDO.getContext())
//                 .setProtocol(actionDO.getProtocol()).setService(actionDO.getService())
//                 .setClazzName(actionDO.getClazzName()).setStatus(actionDO.getStatus()).setVersion(actionDO.getVersion())
//                 .build();
//     }
// 
//     /**
//      * @param actionEntity
//      * @return
//      * @throws SequenceException
//      */
//     public static DtsActionDO toDtsActionDO(ActionEntity actionEntity) {
//         if (actionEntity == null) {
//             return new DtsActionDO();
//         }
//         Date now = new Date();
//         DtsActionDO actionDO = new DtsActionDO();
//         actionDO.setAction(actionEntity.getAction());
//         actionDO.setActivityId(actionEntity.getActivityId());
//         actionDO.setActionId(actionEntity.getActionId());
//         actionDO.setContext(JSON.toJSONString(actionEntity.getContext()));
//         actionDO.setProtocol(actionEntity.protocol());
//         actionDO.setService(actionEntity.getService());
//         actionDO.setClazzName(actionEntity.getClazzName());
//         actionDO.setStatus(actionEntity.status());
//         actionDO.setVersion(actionEntity.getVersion());
//         actionDO.setIsDeleted("N");
//         actionDO.setGmtCreated(now);
//         actionDO.setGmtModified(now);
//         actionDO.setCreator("system");
//         actionDO.setModifier("system");
//         return actionDO;
//     }
// 
// }
// 
// Path: dts-parent/dts-server-share/src/main/java/org/github/dtsopensource/server/share/IDTS.java
// public interface IDTS {
// 
//     /**
//      * 获取指定业务活动的action
//      * 
//      * @param activityId
//      * @return
//      */
//     public ResultBase<List<ActionEntity>> getActionEntities(String activityId);
// }
// 
// Path: dts-parent/dts-server-share/src/main/java/org/github/dtsopensource/server/share/ResultBase.java
// @Data
// public class ResultBase<T> implements Serializable {
// 
//     private static final long serialVersionUID = 2297155012372998859L;
// 
//     private DTSResultCode     dtsResultCode;
// 
//     private String            message;
// 
//     private T                 value;
// 
//     /**
//      * @return
//      */
//     public boolean isSucess() {
//         return DTSResultCode.SUCCESS == this.getDtsResultCode();
//     }
// 
//     /**
//      * @param errorMessage
//      */
//     public void addMessage(String errorMessage) {
//         if (message != null && message.trim().length() > 0) {
//             message = message.concat("|").concat(errorMessage);
//         } else {
//             message = errorMessage;
//         }
//     }
// }


import java.util.List;
import org.github.dtsopensource.core.dao.ActionSqlConstance;
import org.github.dtsopensource.core.dao.dataobject.DtsActionDO;
import org.github.dtsopensource.core.dao.rowMapper.DtsActionRowMapper;
import org.github.dtsopensource.core.store.help.ActionHelper;
import org.github.dtsopensource.server.share.DTSResultCode;
import org.github.dtsopensource.server.share.IDTS;
import org.github.dtsopensource.server.share.ResultBase;
import org.github.dtsopensource.server.share.store.entity.ActionEntity;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.transaction.support.TransactionTemplate;
import com.google.common.collect.Lists;
import lombok.extern.slf4j.Slf4j;

package org.github.dtsopensource.core;





/**
 * @author ligaofeng 2016年12月16日 上午11:07:30
 */
@Slf4j
public class DTS implements IDTS {

    protected final JdbcTemplate        jdbcTemplate;

    protected final TransactionTemplate transactionTemplate;

    public DTS(JdbcTemplate jdbcTemplate, TransactionTemplate transactionTemplate) {
        this.jdbcTemplate = jdbcTemplate;
        this.transactionTemplate = transactionTemplate;
    }

    @Override
    public ResultBase<List<ActionEntity>> getActionEntities(String activityId) {

// Path: dts-parent/dts-core/src/main/java/org/github/dtsopensource/core/store/help/ActionHelper.java
// public class ActionHelper {
// 
//     private ActionHelper() {
//     }
// 
//     /**
//      * @param actionDO
//      * @return
//      */
//     public static ActionEntity toActionEntity(DtsActionDO actionDO) {
//         if (actionDO == null) {
//             return null;
//         }
//         return new ActionEntity.Builder(actionDO.getActionId()).setAction(actionDO.getAction())
//                 .setActivityId(actionDO.getActivityId()).setContext(actionDO.getContext())
//                 .setProtocol(actionDO.getProtocol()).setService(actionDO.getService())
//                 .setClazzName(actionDO.getClazzName()).setStatus(actionDO.getStatus()).setVersion(actionDO.getVersion())
//                 .build();
//     }
// 
//     /**
//      * @param actionEntity
//      * @return
//      * @throws SequenceException
//      */
//     public static DtsActionDO toDtsActionDO(ActionEntity actionEntity) {
//         if (actionEntity == null) {
//             return new DtsActionDO();
//         }
//         Date now = new Date();
//         DtsActionDO actionDO = new DtsActionDO();
//         actionDO.setAction(actionEntity.getAction());
//         actionDO.setActivityId(actionEntity.getActivityId());
//         actionDO.setActionId(actionEntity.getActionId());
//         actionDO.setContext(JSON.toJSONString(actionEntity.getContext()));
//         actionDO.setProtocol(actionEntity.protocol());
//         actionDO.setService(actionEntity.getService());
//         actionDO.setClazzName(actionEntity.getClazzName());
//         actionDO.setStatus(actionEntity.status());
//         actionDO.setVersion(actionEntity.getVersion());
//         actionDO.setIsDeleted("N");
//         actionDO.setGmtCreated(now);
//         actionDO.setGmtModified(now);
//         actionDO.setCreator("system");
//         actionDO.setModifier("system");
//         return actionDO;
//     }
// 
// }
// 
// Path: dts-parent/dts-server-share/src/main/java/org/github/dtsopensource/server/share/IDTS.java
// public interface IDTS {
// 
//     /**
//      * 获取指定业务活动的action
//      * 
//      * @param activityId
//      * @return
//      */
//     public ResultBase<List<ActionEntity>> getActionEntities(String activityId);
// }
// 
// Path: dts-parent/dts-server-share/src/main/java/org/github/dtsopensource/server/share/ResultBase.java
// @Data
// public class ResultBase<T> implements Serializable {
// 
//     private static final long serialVersionUID = 2297155012372998859L;
// 
//     private DTSResultCode     dtsResultCode;
// 
//     private String            message;
// 
//     private T                 value;
// 
//     /**
//      * @return
//      */
//     public boolean isSucess() {
//         return DTSResultCode.SUCCESS == this.getDtsResultCode();
//     }
// 
//     /**
//      * @param errorMessage
//      */
//     public void addMessage(String errorMessage) {
//         if (message != null && message.trim().length() > 0) {
//             message = message.concat("|").concat(errorMessage);
//         } else {
//             message = errorMessage;
//         }
//     }
// }


// Path: dts-parent/dts-core/src/main/java/org/github/dtsopensource/core/DTS.java
import java.util.List;
import org.github.dtsopensource.core.dao.ActionSqlConstance;
import org.github.dtsopensource.core.dao.dataobject.DtsActionDO;
import org.github.dtsopensource.core.dao.rowMapper.DtsActionRowMapper;
import org.github.dtsopensource.core.store.help.ActionHelper;
import org.github.dtsopensource.server.share.DTSResultCode;
import org.github.dtsopensource.server.share.IDTS;
import org.github.dtsopensource.server.share.ResultBase;
import org.github.dtsopensource.server.share.store.entity.ActionEntity;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.transaction.support.TransactionTemplate;
import com.google.common.collect.Lists;
import lombok.extern.slf4j.Slf4j;

package org.github.dtsopensource.core;





/**
 * @author ligaofeng 2016年12月16日 上午11:07:30
 */
@Slf4j
public class DTS implements IDTS {

    protected final JdbcTemplate        jdbcTemplate;

    protected final TransactionTemplate transactionTemplate;

    public DTS(JdbcTemplate jdbcTemplate, TransactionTemplate transactionTemplate) {
        this.jdbcTemplate = jdbcTemplate;
        this.transactionTemplate = transactionTemplate;
    }

    @Override
    public ResultBase<List<ActionEntity>> getActionEntities(String activityId) {

        ResultBase<List<ActionEntity>> actionListBase = new ResultBase<List<ActionEntity>>();
