package jnpf.flowable.service.impl; import jnpf.base.service.SuperServiceImpl; import jnpf.constant.MsgCode; import jnpf.exception.WorkFlowException; import jnpf.flowable.entity.EventLogEntity; import jnpf.flowable.entity.OperatorEntity; import jnpf.flowable.entity.RejectDataEntity; import jnpf.flowable.entity.TaskEntity; import jnpf.flowable.mapper.RejectDataMapper; import jnpf.flowable.service.RejectDataService; import jnpf.util.JsonUtil; import jnpf.util.RandomUtil; import org.springframework.stereotype.Service; import java.util.List; /** * 类的描述 * * @author JNPF@YinMai Info. Co., Ltd * @version 5.0.x * @since 2024/5/8 18:08 */ @Service public class RejectDataServiceImpl extends SuperServiceImpl implements RejectDataService { @Override public RejectDataEntity getInfo(String id) throws WorkFlowException { RejectDataEntity entity = this.getById(id); if (entity == null) { throw new WorkFlowException(MsgCode.FA001.get()); } return entity; } @Override public RejectDataEntity create(TaskEntity taskEntity, List operatorEntityList, List eventLogList, String nodeCode) { RejectDataEntity entity = new RejectDataEntity(); entity.setId(RandomUtil.uuId()); entity.setTaskJson(JsonUtil.getObjectToString(taskEntity)); entity.setOperatorJson(JsonUtil.getObjectToString(operatorEntityList)); entity.setEventLogJson(JsonUtil.getObjectToString(eventLogList)); entity.setNodeCode(nodeCode); this.save(entity); return entity; } }