From a001fd5963b2be7bbf05f6c13d44f8b50d351696 Mon Sep 17 00:00:00 2001 From: wangliwen Date: Thu, 14 Jul 2022 10:41:47 +0800 Subject: [PATCH] =?UTF-8?q?=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../activiti/dto/ProcessInstanceDTO.java | 11 ++++ .../activiti/service/ActHistoryService.java | 12 ++++ .../entity/TDemandCommentEntityDelFlag.java | 61 +++++++++++++++++++ 3 files changed, 84 insertions(+) create mode 100644 renren-admin/src/main/java/io/renren/modules/demandComment/entity/TDemandCommentEntityDelFlag.java diff --git a/renren-admin/src/main/java/io/renren/modules/activiti/dto/ProcessInstanceDTO.java b/renren-admin/src/main/java/io/renren/modules/activiti/dto/ProcessInstanceDTO.java index 46bf6fdd..1bacdbc4 100644 --- a/renren-admin/src/main/java/io/renren/modules/activiti/dto/ProcessInstanceDTO.java +++ b/renren-admin/src/main/java/io/renren/modules/activiti/dto/ProcessInstanceDTO.java @@ -77,4 +77,15 @@ public class ProcessInstanceDTO { @ApiModelProperty(value = "流程直接被终止?") private Boolean termination = Boolean.FALSE; + + + @ApiModelProperty(value = "需求情况") + private Integer demandFlag; + @ApiModelProperty(value = "需求情况") + private String demandFlagTip; + + @ApiModelProperty(value = "评论情况") + private Integer demandCommentFlag; + @ApiModelProperty(value = "评论情况") + private String demandCommentFlagTip; } diff --git a/renren-admin/src/main/java/io/renren/modules/activiti/service/ActHistoryService.java b/renren-admin/src/main/java/io/renren/modules/activiti/service/ActHistoryService.java index 0f5d8955..07120ed4 100644 --- a/renren-admin/src/main/java/io/renren/modules/activiti/service/ActHistoryService.java +++ b/renren-admin/src/main/java/io/renren/modules/activiti/service/ActHistoryService.java @@ -5,8 +5,10 @@ import io.renren.common.page.PageData; import io.renren.modules.activiti.dto.ProcessInstanceDTO; import io.renren.modules.activiti.dto.TaskDTO; import io.renren.modules.demanData.dto.TDemandDataDTO; +import io.renren.modules.demanData.entity.TDemandDataEntityFlag; import io.renren.modules.demanData.service.TDemandDataService; import io.renren.modules.demandComment.dto.TDemandCommentDTO; +import io.renren.modules.demandComment.entity.TDemandCommentEntityDelFlag; import io.renren.modules.demandComment.service.TDemandCommentService; import io.renren.modules.processForm.dto.TAbilityApplicationDTO; import io.renren.modules.processForm.service.TAbilityApplicationService; @@ -316,11 +318,21 @@ public class ActHistoryService { if (tDemandCommentDTO != null) { dto.setName("发表需求评论"); dto.setResourceId(null); + dto.setDemandCommentFlag(tDemandCommentDTO.getDelFlag()); + Optional tDemandCommentEntityDelFlag = Optional.ofNullable(TDemandCommentEntityDelFlag.getByFlag(tDemandCommentDTO.getDelFlag())); + if (tDemandCommentEntityDelFlag.isPresent()) { + dto.setDemandCommentFlagTip(tDemandCommentEntityDelFlag.get().getTip()); + } } else { TDemandDataDTO tDemandDataDTO = tDemandDataService.get(Long.valueOf(dto.getBusinessKey())); if (tDemandDataDTO != null) { dto.setName(tDemandDataDTO.getDemandSubject()); dto.setResourceId(null); + dto.setDemandFlag(tDemandDataDTO.getFlag()); + Optional tDemandCommentEntityDelFlag = Optional.ofNullable(TDemandDataEntityFlag.getByFlag(tDemandDataDTO.getFlag())); + if (tDemandCommentEntityDelFlag.isPresent()) { + dto.setDemandFlagTip(tDemandCommentEntityDelFlag.get().getTip()); + } } } } diff --git a/renren-admin/src/main/java/io/renren/modules/demandComment/entity/TDemandCommentEntityDelFlag.java b/renren-admin/src/main/java/io/renren/modules/demandComment/entity/TDemandCommentEntityDelFlag.java new file mode 100644 index 00000000..e57cc2bc --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/demandComment/entity/TDemandCommentEntityDelFlag.java @@ -0,0 +1,61 @@ +package io.renren.modules.demandComment.entity; + + +import java.util.Arrays; + +/** + * ResourceEntity del_flag 枚举 + */ +public enum TDemandCommentEntityDelFlag { + + /** + * 正常 + */ + NORMAL(0, "正常"), + /** + * 已删除 + */ + DELETED(1, "已删除"), + /** + * 上架待审核 + */ + PENDING_REVIEW(2, "待审核"), + /** + * 上架审核中 + */ + UNDER_REVIEW(3, "审核中"), + /** + * 其他 + */ + OTHER(9, "其他"); + + private int flag; + private String tip; + + TDemandCommentEntityDelFlag(int flag, String tip) { + this.flag = flag; + this.tip = tip; + } + + public static TDemandCommentEntityDelFlag getByFlag(int flag) { + TDemandCommentEntityDelFlag[] index = TDemandCommentEntityDelFlag.values(); + return Arrays.asList(index).stream().filter(index_ -> index_.flag == flag).findAny().orElse(TDemandCommentEntityDelFlag.OTHER); + } + + + public int getFlag() { + return flag; + } + + public void setFlag(int flag) { + this.flag = flag; + } + + public String getTip() { + return tip; + } + + public void setTip(String tip) { + this.tip = tip; + } +}