RejectDataServiceImpl.java 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. package jnpf.flowable.service.impl;
  2. import jnpf.base.service.SuperServiceImpl;
  3. import jnpf.constant.MsgCode;
  4. import jnpf.exception.WorkFlowException;
  5. import jnpf.flowable.entity.EventLogEntity;
  6. import jnpf.flowable.entity.OperatorEntity;
  7. import jnpf.flowable.entity.RejectDataEntity;
  8. import jnpf.flowable.entity.TaskEntity;
  9. import jnpf.flowable.mapper.RejectDataMapper;
  10. import jnpf.flowable.service.RejectDataService;
  11. import jnpf.util.JsonUtil;
  12. import jnpf.util.RandomUtil;
  13. import org.springframework.stereotype.Service;
  14. import java.util.List;
  15. /**
  16. * 类的描述
  17. *
  18. * @author JNPF@YinMai Info. Co., Ltd
  19. * @version 5.0.x
  20. * @since 2024/5/8 18:08
  21. */
  22. @Service
  23. public class RejectDataServiceImpl extends SuperServiceImpl<RejectDataMapper, RejectDataEntity> implements RejectDataService {
  24. @Override
  25. public RejectDataEntity getInfo(String id) throws WorkFlowException {
  26. RejectDataEntity entity = this.getById(id);
  27. if (entity == null) {
  28. throw new WorkFlowException(MsgCode.FA001.get());
  29. }
  30. return entity;
  31. }
  32. @Override
  33. public RejectDataEntity create(TaskEntity taskEntity, List<OperatorEntity> operatorEntityList, List<EventLogEntity> eventLogList, String nodeCode) {
  34. RejectDataEntity entity = new RejectDataEntity();
  35. entity.setId(RandomUtil.uuId());
  36. entity.setTaskJson(JsonUtil.getObjectToString(taskEntity));
  37. entity.setOperatorJson(JsonUtil.getObjectToString(operatorEntityList));
  38. entity.setEventLogJson(JsonUtil.getObjectToString(eventLogList));
  39. entity.setNodeCode(nodeCode);
  40. this.save(entity);
  41. return entity;
  42. }
  43. }