Преглед на файлове

[Feature] 工单增加 挂起、激活、终止 操作 V1.1

AA преди 7 месеца
родител
ревизия
c67d801e6f

+ 55 - 4
dcuc-auth-api/src/main/java/com/dragoninfo/dcuc/auth/auth/facade/IAuthApplyFacade.java

@@ -1,26 +1,41 @@
 package com.dragoninfo.dcuc.auth.auth.facade;
 
-import com.dragoninfo.dcuc.auth.auth.dto.*;
+import com.dragoninfo.dcuc.auth.auth.dto.AppFunApplyUpdateDTO;
+import com.dragoninfo.dcuc.auth.auth.dto.AppFunAuthApplyDTO;
+import com.dragoninfo.dcuc.auth.auth.dto.AppFunAuthResourceDTO;
+import com.dragoninfo.dcuc.auth.auth.dto.ApprovalSuggestionDTO;
+import com.dragoninfo.dcuc.auth.auth.dto.FlowDefineInfoDTO;
+import com.dragoninfo.dcuc.auth.auth.dto.FunApplyDetailDTO;
+import com.dragoninfo.dcuc.auth.auth.dto.ProcessNodeDTO;
+import com.dragoninfo.dcuc.auth.auth.dto.ProcessPicDTO;
+import com.dragoninfo.dcuc.auth.auth.dto.ProcessStatusDTO;
+import com.dragoninfo.dcuc.auth.auth.dto.WorkFlowPageViewDTO;
 import com.dragoninfo.dcuc.auth.auth.vo.RedListRiskLogVo;
 import com.dragonsoft.duceap.base.entity.http.ResponseDTO;
 import com.dragonsoft.duceap.base.entity.http.ResponseStatus;
 import com.dragonsoft.duceap.base.entity.search.SearchDTO;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.data.domain.Page;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestParam;
 
 import java.util.List;
 
 /**
  * 权限申请api
+ *
  * @author mazq
  * @date 2021/7/8
  */
-@FeignClient(name = "dcuc-auth",path = "/dcuc/auth/selfAuthApplyFacade")
+@FeignClient(name = "dcuc-auth", path = "/dcuc/auth/selfAuthApplyFacade")
 public interface IAuthApplyFacade {
 
     /**
      * 应用功能权限申请
+     *
      * @param authApplyDTO
      * @return
      */
@@ -29,6 +44,7 @@ public interface IAuthApplyFacade {
 
     /**
      * 应用功能权限申请详情
+     *
      * @param applyOrdNo
      * @param needFlowInfo
      * @return
@@ -39,6 +55,7 @@ public interface IAuthApplyFacade {
 
     /**
      * 应用功能权限申请工单修改
+     *
      * @param updateDTO
      * @return
      */
@@ -48,6 +65,7 @@ public interface IAuthApplyFacade {
     /**
      * 通用
      * 权限申请单列表
+     *
      * @param searchDTO
      * @return
      */
@@ -57,15 +75,41 @@ public interface IAuthApplyFacade {
     /**
      * 通用
      * 工单撤销
+     *
      * @param applyOrdNo
      * @return
      */
     @GetMapping("authApplyCancel")
     ResponseStatus authApplyCancel(@RequestParam("applyOrdNo") String applyOrdNo);
 
+    // 20241101 add status start
+
+    /**
+     * 通用
+     * 工单挂起
+     */
+    @GetMapping("authApplySuspend")
+    ResponseStatus authApplySuspend(@RequestParam("applyOrdNo") String applyOrdNo);
+
+    /**
+     * 通用
+     * 工单激活
+     */
+    @GetMapping("authApplyActivate")
+    ResponseStatus authApplyActivate(@RequestParam("applyOrdNo") String applyOrdNo);
+
+    /**
+     * 通用
+     * 工单终止
+     */
+    @GetMapping("authApplyStop")
+    ResponseStatus authApplyStop(@RequestParam("applyOrdNo") String applyOrdNo);
+    // 20241101 add status end
+
     /**
      * 通用
      * 工单删除
+     *
      * @param applyOrdNo
      * @return
      */
@@ -74,6 +118,7 @@ public interface IAuthApplyFacade {
 
     /**
      * 根据工作流审批单号获取审批意见
+     *
      * @param applyOrdNo
      * @return
      */
@@ -82,6 +127,7 @@ public interface IAuthApplyFacade {
 
     /**
      * 根据工作流审批单号获取流程状态
+     *
      * @param applyOrdNo
      * @return
      */
@@ -90,6 +136,7 @@ public interface IAuthApplyFacade {
 
     /**
      * 根据工作流审批单号获取流程图
+     *
      * @param applyOrdNo
      * @return
      */
@@ -98,8 +145,9 @@ public interface IAuthApplyFacade {
 
     /**
      * 查询流程状图节点详情
+     *
      * @param applyOrdNo
-     * @param nodeKey 节点标识
+     * @param nodeKey    节点标识
      * @param nodeStatus 节点状态
      * @return
      */
@@ -110,6 +158,7 @@ public interface IAuthApplyFacade {
 
     /**
      * 查询流程定义
+     *
      * @param applyType
      * @return
      */
@@ -118,6 +167,7 @@ public interface IAuthApplyFacade {
 
     /**
      * 自助申请
+     *
      * @param resourceInfos
      * @return
      */
@@ -126,6 +176,7 @@ public interface IAuthApplyFacade {
 
     /**
      * 权限申请命中红名单风险日志
+     *
      * @param searchDTO
      * @return
      */

+ 21 - 0
dcuc-auth-model/src/main/java/com/dragoninfo/dcuc/auth/auth/dto/WorkFlowPageViewDTO.java

@@ -52,6 +52,21 @@ public class WorkFlowPageViewDTO {
      */
     private Boolean showRecall;
 
+    /**
+     * 是否可挂起
+     */
+    private Boolean showSuspend;
+
+    /**
+     * 是否可激活
+     */
+    private Boolean showActivate;
+
+    /**
+     * 是否可终止
+     */
+    private Boolean showStop;
+
     /**
      * 是否可退回
      */
@@ -62,5 +77,11 @@ public class WorkFlowPageViewDTO {
      */
     private Boolean showEdit;
 
+    /**
+     * 流程状态
+     * todo: 临时用,需修改
+     */
+    private String flowStatus;
+
 
 }

+ 2 - 1
dcuc-auth-model/src/main/java/com/dragoninfo/dcuc/auth/auth/dto/zerotrust/approval/FlowOperateManageReqDto.java

@@ -1,5 +1,6 @@
 package com.dragoninfo.dcuc.auth.auth.dto.zerotrust.approval;
 
+import com.dragoninfo.dcuc.auth.auth.enumresources.WorkFlowActionTypeEnum;
 import lombok.Data;
 
 import javax.validation.constraints.NotBlank;
@@ -27,7 +28,7 @@ public class FlowOperateManageReqDto {
 
     /**
      * 操作类型
-     * @see com.dragoninfo.dcuc.auth.auth.enumresources.zerotrust.approval.FlowActionTypeEnum
+     * @see WorkFlowActionTypeEnum
      */
     @NotBlank
     private String actionType;

+ 12 - 4
dcuc-auth-model/src/main/java/com/dragoninfo/dcuc/auth/auth/enumresources/zerotrust/approval/FlowActionTypeEnum.java → dcuc-auth-model/src/main/java/com/dragoninfo/dcuc/auth/auth/enumresources/WorkFlowActionTypeEnum.java

@@ -1,4 +1,4 @@
-package com.dragoninfo.dcuc.auth.auth.enumresources.zerotrust.approval;
+package com.dragoninfo.dcuc.auth.auth.enumresources;
 
 import com.dragonsoft.duceap.base.enums.ICodeEnum;
 
@@ -8,7 +8,7 @@ import com.dragonsoft.duceap.base.enums.ICodeEnum;
  * @author mazq
  * @date 2023/4/4
  */
-public enum FlowActionTypeEnum implements ICodeEnum {
+public enum WorkFlowActionTypeEnum implements ICodeEnum {
     /**
      * 撤销
      */
@@ -16,7 +16,11 @@ public enum FlowActionTypeEnum implements ICodeEnum {
     /**
      * 挂起
      */
-    HANG_UP("挂起", "02"),
+    SUSPEND("挂起", "02"),
+    /**
+     * 挂起
+     */
+    ACTIVATE("激活", "05"),
     /**
      * 冻结
      */
@@ -25,12 +29,16 @@ public enum FlowActionTypeEnum implements ICodeEnum {
      * 终止
      */
     STOP("终止", "04"),
+    /**
+     * 删除
+     */
+    DELETE("删除", "06"),
     ;
     private String label;
 
     private String value;
 
-    FlowActionTypeEnum(String label, String value) {
+    WorkFlowActionTypeEnum(String label, String value) {
         this.label = label;
         this.value = value;
     }

+ 22 - 2
dcuc-auth-model/src/main/java/com/dragoninfo/dcuc/auth/auth/enumresources/WorkFlowStatusEnum.java

@@ -30,6 +30,16 @@ public enum WorkFlowStatusEnum {
      */
     CANCEL("3", "撤销"),
 
+    /**
+     * 挂起
+     */
+    SUSPEND("7", "挂起"),
+
+    /**
+     * 终止
+     */
+    STOP("8", "终止"),
+
     /**
      * 同意
      */
@@ -38,7 +48,8 @@ public enum WorkFlowStatusEnum {
     /**
      * 不同意(流程走完)
      */
-    FAIL("5","不同意");
+    FAIL("5", "不同意"),
+    ;
 
     private String label;
     private String value;
@@ -64,9 +75,18 @@ public enum WorkFlowStatusEnum {
         this.value = value;
     }
 
+    public static WorkFlowStatusEnum value(String value) {
+        for (WorkFlowStatusEnum item : WorkFlowStatusEnum.values()) {
+            if (item.getValue().equals(value)) {
+                return item;
+            }
+        }
+        throw new RuntimeException("不支持的工作流状态");
+    }
+
     public static WorkFlowStatusEnum getStatusByApproveResult(String result) {
         ApproveResultEnum approveResultEnum = ApproveResultEnum.getByValue(result);
-        switch (approveResultEnum){
+        switch (approveResultEnum) {
             case BACK:
                 return WorkFlowStatusEnum.ROLL_BACK;
             case RECALL:

+ 33 - 8
dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/business/IAuthApplyBusiness.java

@@ -1,6 +1,17 @@
 package com.dragoninfo.dcuc.auth.auth.business;
 
-import com.dragoninfo.dcuc.auth.auth.dto.*;
+import com.dragoninfo.dcuc.auth.auth.dto.AppFunApplyUpdateDTO;
+import com.dragoninfo.dcuc.auth.auth.dto.AppFunAuthApplyDTO;
+import com.dragoninfo.dcuc.auth.auth.dto.AppFunAuthResourceDTO;
+import com.dragoninfo.dcuc.auth.auth.dto.ApprovalSuggestionDTO;
+import com.dragoninfo.dcuc.auth.auth.dto.FlowDefineInfoDTO;
+import com.dragoninfo.dcuc.auth.auth.dto.FunApplyDetailDTO;
+import com.dragoninfo.dcuc.auth.auth.dto.ProcessNodeDTO;
+import com.dragoninfo.dcuc.auth.auth.dto.ProcessOperateDTO;
+import com.dragoninfo.dcuc.auth.auth.dto.ProcessPicDTO;
+import com.dragoninfo.dcuc.auth.auth.dto.ProcessStatusDTO;
+import com.dragoninfo.dcuc.auth.auth.dto.WorkFlowPageViewDTO;
+import com.dragoninfo.dcuc.auth.auth.enumresources.WorkFlowActionTypeEnum;
 import com.dragoninfo.dcuc.auth.auth.vo.RedListRiskLogVo;
 import com.dragonsoft.duceap.base.entity.http.ResponseDTO;
 import com.dragonsoft.duceap.base.entity.http.ResponseStatus;
@@ -17,15 +28,15 @@ public interface IAuthApplyBusiness {
 
     /**
      * 应用功能权限申请
+     *
      * @param authApplyDTO
      * @return
      */
     ResponseStatus funApplySave(AppFunAuthApplyDTO authApplyDTO);
 
-
-
     /**
      * 应用功能权限申请详情
+     *
      * @param id
      * @param needFlowInfo
      * @return
@@ -34,6 +45,7 @@ public interface IAuthApplyBusiness {
 
     /**
      * 应用功能权限申请修改
+     *
      * @param updateDTO
      * @return
      */
@@ -42,22 +54,27 @@ public interface IAuthApplyBusiness {
     /**
      * 通用
      * 权限申请列表查询
+     *
      * @param searchDTO
      * @return
      */
     Page<WorkFlowPageViewDTO> authApplySearch(SearchDTO searchDTO);
 
     /**
-     * 通用
-     * 工单撤销
-     * @param applyOrdNo
-     * @return
+     * 工单相关操作
+     * 撤销 挂起 激活 终止 删除
+     *
+     * @param actionType 操作类型
+     * @param api        work flow api url
+     * @param applyOrdNo 工单号
+     * @return 操作结果
      */
-    ResponseStatus authApplyCancel(String applyOrdNo);
+    ResponseStatus handleWorkFlowAction(WorkFlowActionTypeEnum actionType, String api, String applyOrdNo);
 
     /**
      * 通用
      * 工单删除
+     *
      * @param id
      * @return
      */
@@ -65,6 +82,7 @@ public interface IAuthApplyBusiness {
 
     /**
      * 查询审批流程意见
+     *
      * @param applyOrdNo
      * @return
      */
@@ -72,6 +90,7 @@ public interface IAuthApplyBusiness {
 
     /**
      * 根据工作流审批单号获取流程状态
+     *
      * @param applyOrdNo
      * @return
      */
@@ -79,6 +98,7 @@ public interface IAuthApplyBusiness {
 
     /**
      * 根据工作流审批单号获取流程图
+     *
      * @param applyOrdNo
      * @return
      */
@@ -86,6 +106,7 @@ public interface IAuthApplyBusiness {
 
     /**
      * 查询流程可操作类型
+     *
      * @param applyOrdNoList
      * @return
      */
@@ -93,6 +114,7 @@ public interface IAuthApplyBusiness {
 
     /**
      * 查看流程图节点详情
+     *
      * @param applyOrdNo
      * @param nodeKey
      * @param nodeStatus
@@ -102,6 +124,7 @@ public interface IAuthApplyBusiness {
 
     /**
      * 查询流程定义
+     *
      * @param applyType
      * @return
      */
@@ -109,6 +132,7 @@ public interface IAuthApplyBusiness {
 
     /**
      * 权限自助申请红名单校验
+     *
      * @param resourceInfos
      * @return
      */
@@ -116,6 +140,7 @@ public interface IAuthApplyBusiness {
 
     /**
      * 权限申请命中红名单风险日志
+     *
      * @param searchDTO
      * @return
      */

+ 194 - 139
dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/business/impl/AuthApplyBusiness.java

@@ -9,12 +9,37 @@ import com.dragoninfo.dcuc.app.entity.ApplyInfo;
 import com.dragoninfo.dcuc.app.facade.IApplyInfoFacade;
 import com.dragoninfo.dcuc.auth.auth.business.IAuthApplyBusiness;
 import com.dragoninfo.dcuc.auth.auth.constance.AuthFlowOpeCons;
-import com.dragoninfo.dcuc.auth.auth.dto.*;
-import com.dragoninfo.dcuc.auth.auth.entity.*;
+import com.dragoninfo.dcuc.auth.auth.dto.AppFunApplyUpdateDTO;
+import com.dragoninfo.dcuc.auth.auth.dto.AppFunAuthApplyDTO;
+import com.dragoninfo.dcuc.auth.auth.dto.AppFunAuthResourceDTO;
+import com.dragoninfo.dcuc.auth.auth.dto.AppFunInfoDTO;
+import com.dragoninfo.dcuc.auth.auth.dto.ApprovalPageViewDTO;
+import com.dragoninfo.dcuc.auth.auth.dto.ApprovalSuggestionDTO;
+import com.dragoninfo.dcuc.auth.auth.dto.ApprovalWorkFlowDTO;
+import com.dragoninfo.dcuc.auth.auth.dto.FlowDefineInfoDTO;
+import com.dragoninfo.dcuc.auth.auth.dto.FunApplyDetailDTO;
+import com.dragoninfo.dcuc.auth.auth.dto.ProcessNodeDTO;
+import com.dragoninfo.dcuc.auth.auth.dto.ProcessOperateDTO;
+import com.dragoninfo.dcuc.auth.auth.dto.ProcessPicDTO;
+import com.dragoninfo.dcuc.auth.auth.dto.ProcessStatusDTO;
+import com.dragoninfo.dcuc.auth.auth.dto.RedListCheckEventDto;
+import com.dragoninfo.dcuc.auth.auth.dto.ResourceInfoDTO;
+import com.dragoninfo.dcuc.auth.auth.dto.WorkFlowDTO;
+import com.dragoninfo.dcuc.auth.auth.dto.WorkFlowPageViewDTO;
+import com.dragoninfo.dcuc.auth.auth.entity.AppFunApplyContent;
+import com.dragoninfo.dcuc.auth.auth.entity.AppFunAuthResult;
+import com.dragoninfo.dcuc.auth.auth.entity.AppFunInfo;
+import com.dragoninfo.dcuc.auth.auth.entity.RedListRiskLog;
+import com.dragoninfo.dcuc.auth.auth.entity.WorkFlow;
+import com.dragoninfo.dcuc.auth.auth.enumresources.WorkFlowActionTypeEnum;
 import com.dragoninfo.dcuc.auth.auth.enumresources.WorkFlowPermissionTypeEnum;
 import com.dragoninfo.dcuc.auth.auth.enumresources.WorkFlowStatusEnum;
 import com.dragoninfo.dcuc.auth.auth.event.RedListCheckEvent;
-import com.dragoninfo.dcuc.auth.auth.service.*;
+import com.dragoninfo.dcuc.auth.auth.service.IAppFunApplyContentService;
+import com.dragoninfo.dcuc.auth.auth.service.IAppFunAuthResultService;
+import com.dragoninfo.dcuc.auth.auth.service.IAppFunInfoService;
+import com.dragoninfo.dcuc.auth.auth.service.IRedListRiskLogService;
+import com.dragoninfo.dcuc.auth.auth.service.IWorkFlowService;
 import com.dragoninfo.dcuc.auth.auth.vo.RedListRiskLogVo;
 import com.dragoninfo.dcuc.auth.config.DcucAuthApprovalConfig;
 import com.dragoninfo.dcuc.auth.config.DcucAuthConfig;
@@ -40,6 +65,7 @@ import com.dragoninfo.duceap.core.response.Result;
 import com.dragonsoft.duceap.base.entity.http.ResponseDTO;
 import com.dragonsoft.duceap.base.entity.http.ResponseStatus;
 import com.dragonsoft.duceap.base.entity.search.SearchDTO;
+import com.dragonsoft.duceap.base.enums.BooleanEnum;
 import com.dragonsoft.duceap.base.utils.UserContextUtils;
 import com.dragonsoft.duceap.commons.util.UUIDUtils;
 import com.dragonsoft.duceap.commons.util.string.StringUtils;
@@ -68,11 +94,18 @@ import org.springframework.web.context.request.ServletRequestAttributes;
 
 import javax.servlet.http.HttpServletRequest;
 import java.text.SimpleDateFormat;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Optional;
+import java.util.Set;
 import java.util.stream.Collectors;
 
 /**
  * 权限自主申请业务组合类
+ *
  * @author mazq
  * @date 2021/7/8
  */
@@ -124,37 +157,37 @@ public class AuthApplyBusiness implements IAuthApplyBusiness {
         List<AppFunAuthResourceDTO> delResourceInfos = authApplyDTO.getDelResourceInfos();
 
         AuthUserInfo userInfo = userInfoService.findByIdcard(applicantIdcard);
-        if(null == userInfo) {
+        if (null == userInfo) {
             return ResponseStatus.fail("用户身份证号错误");
         }
-        if(CollectionUtils.isEmpty(resourceInfos) && CollectionUtils.isEmpty(delResourceInfos)) {
+        if (CollectionUtils.isEmpty(resourceInfos) && CollectionUtils.isEmpty(delResourceInfos)) {
             return ResponseStatus.fail("申请单内容为空");
         }
         List<AppFunAuthResourceDTO> list = fillResourceInfo(resourceInfos, delResourceInfos, userInfo);
 
         String applyType = AuthApplyTypeEnum.APP_FUN_AUTH.getValue();
         String operateType = workFlowDTO.getOperateType();
-        if(AuthFlowOpeCons.SAVE.equals(operateType)) {
+        if (AuthFlowOpeCons.SAVE.equals(operateType)) {
             workFlowDTO.setFlowStatus(WorkFlowStatusEnum.SAVING.getValue());
         } else {
             workFlowDTO.setFlowStatus(WorkFlowStatusEnum.APPLYING.getValue());
         }
         workFlowDTO.setApplyType(applyType);
-        workFlowDTO.setMessageId(UUIDUtils.getUUID()+ StrUtil.COLON + applyType);
+        workFlowDTO.setMessageId(UUIDUtils.getUUID() + StrUtil.COLON + applyType);
         workFlowDTO.setApplyAppCode(authConfig.getAppCode());
 
-        //保存工单
+        // 保存工单
         WorkFlow workFlow = workFlowService.saveWorkFlow(workFlowDTO);
 
-        //保存授权相关信息
+        // 保存授权相关信息
         funAuthApplyService.saveAuthApplyDetail(workFlow, list);
 
         String url = authConfig.getApprovalCenterUrl();
         String api = ApprovalApiConstance.APPROVAL_CREATE_API;
         url = Joiner.on("").join(url, api);
         ResponseDTO status = funApplyPushToApproval(url, HttpPost.METHOD_NAME, authApplyDTO, list);
-        //推送不成功删除工单
-        if(!ResponseStatus.SUCCESS_CODE.equals(status.getStatusCode())){
+        // 推送不成功删除工单
+        if (!ResponseStatus.SUCCESS_CODE.equals(status.getStatusCode())) {
             workFlowService.delById(workFlow.getId());
         } else {
             String applicantOrdNo = status.getResult().toString();
@@ -180,15 +213,15 @@ public class AuthApplyBusiness implements IAuthApplyBusiness {
                                                          List<AppFunAuthResourceDTO> delResourceInfos,
                                                          AuthUserInfo userInfo) {
         List<AppFunAuthResourceDTO> list = new ArrayList<>();
-        if(CollectionUtils.isNotEmpty(resourceInfos)) {
-            resourceInfos.forEach(e->{
+        if (CollectionUtils.isNotEmpty(resourceInfos)) {
+            resourceInfos.forEach(e -> {
                 e.setUserId(userInfo.getId());
                 e.setOperateType(AuthorizeTypeEnum.GNSQ.getValue());
             });
             list.addAll(resourceInfos);
         }
-        if(CollectionUtils.isNotEmpty(delResourceInfos)) {
-            delResourceInfos.forEach(e->{
+        if (CollectionUtils.isNotEmpty(delResourceInfos)) {
+            delResourceInfos.forEach(e -> {
                 e.setUserId(userInfo.getId());
                 e.setOperateType(AuthorizeTypeEnum.GNXQ.getValue());
             });
@@ -199,7 +232,7 @@ public class AuthApplyBusiness implements IAuthApplyBusiness {
     }
 
     private void setAppNameAndFunName(List<AppFunAuthResourceDTO> list) {
-        if(CollectionUtils.isEmpty(list)) {
+        if (CollectionUtils.isEmpty(list)) {
             return;
         }
         List<String> appIds = list.stream()
@@ -217,12 +250,12 @@ public class AuthApplyBusiness implements IAuthApplyBusiness {
         for (AppFunAuthResourceDTO resourceDTO : list) {
             String appId = resourceDTO.getAppId();
             ApplyInfo applyInfo = appIdMap.get(appId);
-            if(null == applyInfo) {
+            if (null == applyInfo) {
                 continue;
             }
             String funId = resourceDTO.getFunId();
             AppFunInfo funInfo = funInfoMap.get(funId);
-            if(null == funInfo) {
+            if (null == funInfo) {
                 continue;
             }
             resourceDTO.setAppCode(applyInfo.getApplyCode());
@@ -235,41 +268,47 @@ public class AuthApplyBusiness implements IAuthApplyBusiness {
     @Override
     public Page<WorkFlowPageViewDTO> authApplySearch(SearchDTO searchDTO) {
         Searchable searchable = Searchable.toSearchable(searchDTO);
-        //查询审批中心获取审批单列表
+        // 查询审批中心获取审批单列表
         Result<List<WorkFlowPageViewDTO>> result = getApprovalList(searchable);
-        if(!ResponseStatus.SUCCESS_CODE.equals(result.getResult())) {
+        if (!ResponseStatus.SUCCESS_CODE.equals(result.getResult())) {
             return new PageImpl<>(new ArrayList<>(), searchable.getPage(), 0L);
         }
-        //查询列表中申请单的可操作类型
+        // 查询列表中申请单的可操作类型
         List<WorkFlowPageViewDTO> content = result.getContent();
-        if(CollectionUtils.isEmpty(content)) {
+        if (CollectionUtils.isEmpty(content)) {
             return new PageImpl<>(new ArrayList<>(), searchable.getPage(), 0L);
         }
         List<String> applyOrdNos = content.stream()
                 .map(WorkFlowPageViewDTO::getApplyOrdNo).distinct()
                 .collect(Collectors.toList());
         List<ProcessOperateDTO> operateTypeList = processOperateType(applyOrdNos);
-        operateTypeList.forEach(item->{
+        operateTypeList.forEach(item -> {
             Boolean showBack = item.getShowBack();
-            if(null == showBack) {
+            if (null == showBack) {
                 item.setShowBack(false);
             }
             Boolean showEdit = item.getShowEdit();
-            if(null == showEdit) {
+            if (null == showEdit) {
                 item.setShowEdit(false);
             }
             Boolean showRecall = item.getShowRecall();
-            if(null == showRecall) {
+            if (null == showRecall) {
                 item.setShowRecall(false);
             }
         });
+
         Map<String, ProcessOperateDTO> operateDTOMap = operateTypeList
                 .stream()
                 .collect(Collectors.toMap(ProcessOperateDTO::getApproveNo, item -> item, (old, last) -> last));
-        content.forEach(item->{
+
+        List<WorkFlow> workFlowList = getWorkFlowList(applyOrdNos);
+        Map<String, WorkFlow> workFlowMap = workFlowList.stream()
+                .collect(Collectors.toMap(WorkFlow::getApplicantOrdNo, e -> e, (old, last) -> last));
+
+        content.forEach(item -> {
             String applyOrdNo = item.getApplyOrdNo();
             ProcessOperateDTO operateDTO = operateDTOMap.get(applyOrdNo);
-            if(null == operateDTO) {
+            if (null == operateDTO) {
                 item.setShowRecall(false);
                 item.setShowEdit(false);
                 item.setShowBack(false);
@@ -278,12 +317,41 @@ public class AuthApplyBusiness implements IAuthApplyBusiness {
                 item.setShowBack(operateDTO.getShowBack());
                 item.setShowEdit(operateDTO.getShowEdit());
             }
+
+            WorkFlow workFlow = workFlowMap.get(applyOrdNo);
+            WorkFlowStatusEnum flowStatusEnum = WorkFlowStatusEnum.value(workFlow.getFlowStatus());
+            item.setFlowStatus(flowStatusEnum.getValue());
+            if (WorkFlowStatusEnum.SUSPEND.equals(flowStatusEnum)) {
+                item.setShowSuspend(false);
+                item.setShowActivate(true);
+                item.setShowRecall(false);
+                item.setShowStop(false);
+            } else if (WorkFlowStatusEnum.CANCEL.equals(flowStatusEnum)) {
+                item.setShowSuspend(false);
+                item.setShowActivate(false);
+                item.setShowRecall(false);
+                item.setShowStop(false);
+            } else if (WorkFlowStatusEnum.APPLYING.equals(flowStatusEnum)) {
+                item.setShowSuspend(true);
+                item.setShowActivate(false);
+                item.setShowRecall(true);
+                item.setShowStop(true);
+                item.setShowEdit(false);
+            }
         });
         return new PageImpl<>(content, searchable.getPage(), result.getTotalElements());
     }
 
+    public List<WorkFlow> getWorkFlowList(List<String> applyOrdNos) {
+        Searchable workFlowSearchable = Searchable.newSearchable();
+        workFlowSearchable.addSearchFilter("applicantOrdNo", SearchOperator.in, applyOrdNos);
+        workFlowSearchable.addSearchFilter("deleted", SearchOperator.eq, BooleanEnum.FALSE.getValue());
+        return workFlowService.search(workFlowSearchable);
+    }
+
     /**
      * 从审批中心获取申请单列表
+     *
      * @param searchable
      * @return
      */
@@ -294,31 +362,32 @@ public class AuthApplyBusiness implements IAuthApplyBusiness {
         String pageSearUrl = Joiner.on("").join(url, api);
         List<Header> headers = getApprovalHeaders();
         String responseJson = HttpUtil.postJSON(pageSearUrl, JSON.toJSONString(apiSearchReq), headers, null);
-        if(StringUtils.isBlank(responseJson)) {
-            return Result.fail(ResponseStatus.FAIL_CODE,"", new ArrayList<>());
+        if (StringUtils.isBlank(responseJson)) {
+            return Result.fail(ResponseStatus.FAIL_CODE, "", new ArrayList<>());
         }
         ApiResult result = JSON.parseObject(responseJson, ApiResult.class);
         JSONObject jsonObject = (JSONObject) result.getResult();
         Integer total = jsonObject.getInteger("total");
-        if(null == total) {
+        if (null == total) {
             total = 0;
         }
         JSONArray jsonArray = jsonObject.getJSONArray("content");
-        List<ApprovalPageViewDTO> content = JSON.parseObject(jsonArray.toJSONString(), new TypeReference<List<ApprovalPageViewDTO>>(){{}});
+        List<ApprovalPageViewDTO> content = JSON.parseObject(jsonArray.toJSONString(), new TypeReference<List<ApprovalPageViewDTO>>() {{
+        }});
         List<WorkFlowPageViewDTO> collect = Optional
                 .ofNullable(content)
                 .orElse(new ArrayList<>())
                 .stream()
                 .map(item -> {
-            WorkFlowPageViewDTO viewDTO = new WorkFlowPageViewDTO();
-            viewDTO.setApplyType(item.getFlowType());
-            viewDTO.setCreateTime(item.getCreateTime());
-            viewDTO.setDealOperator(item.getUnOperateUsers());
-            viewDTO.setFlowTitle(item.getProcessTitle());
-            viewDTO.setTaskName(item.getTaskName());
-            viewDTO.setApplyOrdNo(item.getApproveNo());
-            return viewDTO;
-        }).collect(Collectors.toList());
+                    WorkFlowPageViewDTO viewDTO = new WorkFlowPageViewDTO();
+                    viewDTO.setApplyType(item.getFlowType());
+                    viewDTO.setCreateTime(item.getCreateTime());
+                    viewDTO.setDealOperator(item.getUnOperateUsers());
+                    viewDTO.setFlowTitle(item.getProcessTitle());
+                    viewDTO.setTaskName(item.getTaskName());
+                    viewDTO.setApplyOrdNo(item.getApproveNo());
+                    return viewDTO;
+                }).collect(Collectors.toList());
         return Result.success(Long.valueOf(total), collect);
     }
 
@@ -333,21 +402,21 @@ public class AuthApplyBusiness implements IAuthApplyBusiness {
         Map<String, SearchParam> filters = new HashMap<>();
         ApiSearchReq apiSearchReq = new ApiSearchReq();
 
-        if(flowTitle != null) {
+        if (flowTitle != null) {
             SearchParam searchParam = new SearchParam();
             searchParam.setOperator(SearchOperator.like.name());
             searchParam.setValue(flowTitle.getValue());
             filters.put("processTitle", searchParam);
         }
 
-        if(applyType != null) {
+        if (applyType != null) {
             SearchParam searchParam = new SearchParam();
             searchParam.setOperator(SearchOperator.eq.name());
             searchParam.setValue(applyType.getValue());
             filters.put("flowType", searchParam);
         }
 
-        if(createTimeGe != null && createTimeLe != null) {
+        if (createTimeGe != null && createTimeLe != null) {
             SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
             SearchParam searchParam = new SearchParam();
             searchParam.setOperator(SearchOperator.rangeDate.name());
@@ -358,7 +427,7 @@ public class AuthApplyBusiness implements IAuthApplyBusiness {
             String[] arr = new String[]{geTimeStr, leTimeStr};
             searchParam.setValue(arr);
             filters.put("createTime", searchParam);
-        } else if(createTimeGe != null) {
+        } else if (createTimeGe != null) {
             SearchParam searchParam = new SearchParam();
             searchParam.setOperator(SearchOperator.ge.name());
             Object value = createTimeGe.getValue();
@@ -366,7 +435,7 @@ public class AuthApplyBusiness implements IAuthApplyBusiness {
             String timeStr = format.format(value);
             searchParam.setValue(timeStr);
             filters.put("createTime", searchParam);
-        } else if(createTimeLe != null) {
+        } else if (createTimeLe != null) {
             SearchParam searchParam = new SearchParam();
             searchParam.setOperator(SearchOperator.le.name());
             Object value = createTimeLe.getValue();
@@ -384,35 +453,38 @@ public class AuthApplyBusiness implements IAuthApplyBusiness {
 
         apiSearchReq.setFilters(filters);
         ApiPageReq apiPageReq = new ApiPageReq();
-        apiPageReq.setFrom(pageNumber+1);
+        apiPageReq.setFrom(pageNumber + 1);
         apiPageReq.setSize(pageSize);
         apiSearchReq.setPage(apiPageReq);
         return apiSearchReq;
     }
 
-
     @Override
-    public ResponseStatus authApplyCancel(String applyOrdNo) {
+    public ResponseStatus handleWorkFlowAction(WorkFlowActionTypeEnum actionType, String api, String applyOrdNo) {
         WorkFlow workFlow = workFlowService.getByApplyOrdNo(applyOrdNo);
-        if(null == workFlow) {
+        if (null == workFlow) {
             return ResponseStatus.fail("工单不存在");
         }
-        ResponseStatus status = approvalWorkFlowCancel(applyOrdNo);
-        if(!ResponseStatus.SUCCESS_CODE.equals(status.getStatusCode())) {
+        String url = getApprovalUrl(applyOrdNo, api);
+        List<Header> headers = getApprovalHeaders();
+        String result = HttpUtil.put(url, null, headers);
+        log.info("approvalWorkFlow{} result:{}", actionType.getLabel(), result);
+        ResponseStatus status = JSON.parseObject(result, ResponseStatus.class);
+        if (!ResponseStatus.SUCCESS_CODE.equals(status.getStatusCode())) {
             return status;
         }
-        workFlowService.cancelWorkFlow(workFlow.getId());
+        workFlowService.updateWorkFlowByAction(actionType, workFlow.getId());
         return ResponseStatus.success();
     }
 
     @Override
     public ResponseStatus authApplyDelete(String applyOrdNo) {
         WorkFlow workFlow = workFlowService.getByApplyOrdNo(applyOrdNo);
-        if(null == workFlow) {
+        if (null == workFlow) {
             return ResponseStatus.fail("工单不存在");
         }
         ResponseStatus status = approvalWorkFlowDelete(workFlow);
-        if(!ResponseStatus.SUCCESS_CODE.equals(status.getStatusCode())) {
+        if (!ResponseStatus.SUCCESS_CODE.equals(status.getStatusCode())) {
             return status;
         }
         workFlowService.delById(workFlow.getId());
@@ -425,13 +497,13 @@ public class AuthApplyBusiness implements IAuthApplyBusiness {
         String suggestUrl = getApprovalUrl(applyOrdNo, ApprovalApiConstance.APPROVAL_SUGGEST_API);
         List<Header> headers = getApprovalHeaders();
         String get = HttpUtil.get(suggestUrl, null, headers);
-        if(StringUtils.isBlank(get)) {
+        if (StringUtils.isBlank(get)) {
             return new ArrayList<>();
         }
         ApiResult apiResult = JSON.parseObject(get, ApiResult.class);
         String statusCode = apiResult.getStatusCode();
-        if(!ResponseStatus.SUCCESS_CODE.equals(statusCode)) {
-            return  new ArrayList<>();
+        if (!ResponseStatus.SUCCESS_CODE.equals(statusCode)) {
+            return new ArrayList<>();
         }
         Object result = apiResult.getResult();
         String str = JSON.toJSONString(result);
@@ -445,12 +517,12 @@ public class AuthApplyBusiness implements IAuthApplyBusiness {
         String statusUrl = getApprovalUrl(applyOrdNo, ApprovalApiConstance.APPROVAL_STATUS_API);
         List<Header> headers = getApprovalHeaders();
         String get = HttpUtil.get(statusUrl, null, headers);
-        if(StringUtils.isBlank(get)) {
+        if (StringUtils.isBlank(get)) {
             return new ArrayList<>();
         }
         ApiResult apiResult = JSON.parseObject(get, ApiResult.class);
         String statusCode = apiResult.getStatusCode();
-        if(!ResponseStatus.SUCCESS_CODE.equals(statusCode)) {
+        if (!ResponseStatus.SUCCESS_CODE.equals(statusCode)) {
             return new ArrayList<>();
         }
         Object result = apiResult.getResult();
@@ -464,13 +536,13 @@ public class AuthApplyBusiness implements IAuthApplyBusiness {
         String picUrl = getApprovalUrl(applyOrdNo, ApprovalApiConstance.APPROVAL_PIC_API);
         List<Header> headers = getApprovalHeaders();
         String get = HttpUtil.get(picUrl, null, headers);
-        if(StringUtils.isBlank(get)) {
+        if (StringUtils.isBlank(get)) {
             return new ProcessPicDTO();
         }
         ApiResult apiResult = JSON.parseObject(get, ApiResult.class);
         String statusCode = apiResult.getStatusCode();
-        if(!ResponseStatus.SUCCESS_CODE.equals(statusCode)) {
-            return  new ProcessPicDTO();
+        if (!ResponseStatus.SUCCESS_CODE.equals(statusCode)) {
+            return new ProcessPicDTO();
         }
         Object result = apiResult.getResult();
         String str = JSON.toJSONString(result);
@@ -495,24 +567,25 @@ public class AuthApplyBusiness implements IAuthApplyBusiness {
         apiSearchReq.setFilters(searchFilterMap);
 
         String url = authConfig.getApprovalCenterUrl();
-        String api =  ApprovalApiConstance.APPROVAL_OPERATE_API;
+        String api = ApprovalApiConstance.APPROVAL_OPERATE_API;
         url = Joiner.on("").join(url, api);
         List<Header> headers = getApprovalHeaders();
         String post = HttpUtil.postJSON(url, JSON.toJSONString(apiSearchReq), headers, null);
 
-        if(StringUtils.isBlank(post)) {
+        if (StringUtils.isBlank(post)) {
             return new ArrayList<>();
         }
 
         ApiResult apiResult = JSON.parseObject(post, ApiResult.class);
         String statusCode = apiResult.getStatusCode();
-        if(!ResponseStatus.SUCCESS_CODE.equals(statusCode)) {
-            return  new ArrayList<>();
+        if (!ResponseStatus.SUCCESS_CODE.equals(statusCode)) {
+            return new ArrayList<>();
         }
 
         Object result = apiResult.getResult();
         String str = JSON.toJSONString(result);
-        return JSON.parseObject(str, new TypeReference<List<ProcessOperateDTO>>(){{}});
+        return JSON.parseObject(str, new TypeReference<List<ProcessOperateDTO>>() {{
+        }});
 
     }
 
@@ -523,16 +596,16 @@ public class AuthApplyBusiness implements IAuthApplyBusiness {
         api = api.replace("{approveNo}", applyOrdNo)
                 .replace("{nodeKey}", nodeKey)
                 .replace("{nodeStatus}", nodeStatus);
-        url = Joiner.on("").join(url,api);
+        url = Joiner.on("").join(url, api);
         List<Header> headers = getApprovalHeaders();
         String get = HttpUtil.get(url, null, headers);
-        if(StringUtils.isBlank(get)) {
+        if (StringUtils.isBlank(get)) {
             return new ProcessNodeDTO();
         }
         ApiResult apiResult = JSON.parseObject(get, ApiResult.class);
         String statusCode = apiResult.getStatusCode();
-        if(!ResponseStatus.SUCCESS_CODE.equals(statusCode)) {
-            return  new ProcessNodeDTO();
+        if (!ResponseStatus.SUCCESS_CODE.equals(statusCode)) {
+            return new ProcessNodeDTO();
         }
         Object result = apiResult.getResult();
         String str = JSON.toJSONString(result);
@@ -542,9 +615,9 @@ public class AuthApplyBusiness implements IAuthApplyBusiness {
     @Override
     public ResponseDTO<FlowDefineInfoDTO> getFlowDefineInfo(String applyType) {
         String businessCode;
-        if(SelfAuthApplyTypeEnum.APP_FUN_AUTH.getValue().equals(applyType)) {
+        if (SelfAuthApplyTypeEnum.APP_FUN_AUTH.getValue().equals(applyType)) {
             businessCode = approvalConfig.getFunAuthBusCode();
-        } else if(SelfAuthApplyTypeEnum.SERVICE_AUTH.getValue().equals(applyType)) {
+        } else if (SelfAuthApplyTypeEnum.SERVICE_AUTH.getValue().equals(applyType)) {
             businessCode = approvalConfig.getServiceAuthBusCode();
         } else {
             businessCode = approvalConfig.getDataAuthBusCode();
@@ -552,16 +625,16 @@ public class AuthApplyBusiness implements IAuthApplyBusiness {
         String url = authConfig.getApprovalCenterUrl();
         String api = ApprovalApiConstance.APPROVAL_DEFINE_API;
         api = api.replace("{businessCode}", businessCode);
-        url = Joiner.on("").join(url,api);
+        url = Joiner.on("").join(url, api);
         List<Header> headers = getApprovalHeaders();
         String get = HttpUtil.get(url, null, headers);
-        if(StringUtils.isBlank(get)) {
-            return ResponseDTO.fail(ResponseStatus.FAIL_CODE,"get flow defination error", null);
+        if (StringUtils.isBlank(get)) {
+            return ResponseDTO.fail(ResponseStatus.FAIL_CODE, "get flow defination error", null);
         }
         ApiResult apiResult = JSON.parseObject(get, ApiResult.class);
         String statusCode = apiResult.getStatusCode();
-        if(!ResponseStatus.SUCCESS_CODE.equals(statusCode)) {
-            return  ResponseDTO.fail(ResponseStatus.FAIL_CODE,"get flow defination error", null);
+        if (!ResponseStatus.SUCCESS_CODE.equals(statusCode)) {
+            return ResponseDTO.fail(ResponseStatus.FAIL_CODE, "get flow defination error", null);
         }
         Object result = apiResult.getResult();
         String str = JSON.toJSONString(result);
@@ -592,7 +665,7 @@ public class AuthApplyBusiness implements IAuthApplyBusiness {
         searchable.addSort(Sort.Direction.DESC, "logSendTime");
         Page<RedListRiskLog> page = redListRiskLogService.pageSearch(searchable);
         if (page.isEmpty()) {
-            return new PageImpl<>(new ArrayList<>(), searchable.getPage(),0L);
+            return new PageImpl<>(new ArrayList<>(), searchable.getPage(), 0L);
         }
         List<RedListRiskLog> content = page.getContent();
         List<RedListRiskLogVo> collect = content.stream().map(e -> {
@@ -611,43 +684,26 @@ public class AuthApplyBusiness implements IAuthApplyBusiness {
 
     /**
      * 删除审批中心工单
+     *
      * @param workFlow
      * @return
      */
     private ResponseStatus approvalWorkFlowDelete(WorkFlow workFlow) {
-        String url = authConfig.getApprovalCenterUrl();
-        String api = ApprovalApiConstance.APPROVAL_DELETE_API;
-        api = api.replace("{approveNo}", workFlow.getApplicantOrdNo());
-        String deleteUrl = Joiner.on("").join(url, api);
+        String deleteUrl = getApprovalUrl(workFlow.getApplicantOrdNo(), ApprovalApiConstance.APPROVAL_DELETE_API);
         List<Header> headers = getApprovalHeaders();
         String delete = HttpUtil.delete(deleteUrl, null, headers);
-        if(StringUtils.isBlank(delete)) {
+        if (StringUtils.isBlank(delete)) {
             return ResponseStatus.fail("approvalWorkFlowDelete fail");
         }
         log.info("approvalWorkFlowDelete result:{}", delete);
-        ResponseStatus status = JSON.parseObject(delete, ResponseStatus.class);
-        return status;
-    }
-
-    /**
-     * 撤销审批中心工单
-     * @param applyOrdNo
-     * @return
-     */
-    private ResponseStatus approvalWorkFlowCancel(String applyOrdNo) {
-        String api = ApprovalApiConstance.APPROVAL_CANCEL_API;
-        String cancelUrl = getApprovalUrl(applyOrdNo, api);
-        List<Header> headers = getApprovalHeaders();
-        String put = HttpUtil.put(cancelUrl, null, headers);
-        log.info("approvalWorkFlowCancel result:{}", put);
-        return JSON.parseObject(put, ResponseStatus.class);
+        return JSON.parseObject(delete, ResponseStatus.class);
     }
 
     @Override
     public FunApplyDetailDTO funApplyDetail(String applyOrdNo, Boolean needFlowInfo) {
         FunApplyDetailDTO detailDTO = new FunApplyDetailDTO();
         WorkFlow workFlow = workFlowService.getByApplyOrdNo(applyOrdNo);
-        if(null == workFlow) {
+        if (null == workFlow) {
             return detailDTO;
         }
         WorkFlowDTO workFlowDTO = new WorkFlowDTO();
@@ -665,7 +721,7 @@ public class AuthApplyBusiness implements IAuthApplyBusiness {
         }).collect(Collectors.toList());
         detailDTO.setResourceInfos(collect);
 
-        //查询授权申请已通过的功能菜单
+        // 查询授权申请已通过的功能菜单
         List<AppFunAuthResult> authResults = funAuthResultService.getAppFunAuthResults(contentList.get(0).getUserId());
         Set<String> existFunIds = Optional.ofNullable(authResults).orElse(new ArrayList<>())
                 .stream()
@@ -677,22 +733,22 @@ public class AuthApplyBusiness implements IAuthApplyBusiness {
         List<AppFunAuthResourceDTO> addList = map.get(AuthorizeTypeEnum.GNSQ.getValue());
         List<AppFunAuthResourceDTO> delList = map.get(AuthorizeTypeEnum.GNXQ.getValue());
 
-        //前端要求返回空数组
-        if(CollectionUtils.isNotEmpty(addList)) {
-            addList = addList.stream().filter(e->!existFunIds.contains(e.getFunId())).collect(Collectors.toList());
+        // 前端要求返回空数组
+        if (CollectionUtils.isNotEmpty(addList)) {
+            addList = addList.stream().filter(e -> !existFunIds.contains(e.getFunId())).collect(Collectors.toList());
             detailDTO.setResourceInfos(addList);
         } else {
             detailDTO.setResourceInfos(new ArrayList<>());
         }
 
-        if(CollectionUtils.isNotEmpty(delList)) {
-            delList = delList.stream().filter(e->existFunIds.contains(e.getFunId())).collect(Collectors.toList());
+        if (CollectionUtils.isNotEmpty(delList)) {
+            delList = delList.stream().filter(e -> existFunIds.contains(e.getFunId())).collect(Collectors.toList());
             detailDTO.setDelResourceInfos(delList);
         } else {
             detailDTO.setDelResourceInfos(new ArrayList<>());
         }
 
-        if(CollectionUtils.isNotEmpty(existFunIds)) {
+        if (CollectionUtils.isNotEmpty(existFunIds)) {
             List<String> funIds = new ArrayList<>(existFunIds);
             List<AppFunInfoDTO> funInfos = appFunInfoService.getByIds(funIds);
             Map<String, AppFunInfoDTO> funInfoDTOMap = funInfos.stream()
@@ -707,10 +763,10 @@ public class AuthApplyBusiness implements IAuthApplyBusiness {
                         AppFunInfoDTO funInfoDTO = funInfoDTOMap.get(funId);
                         String appId = e.getAppId();
                         ApplyInfo applyInfo = appInfoMap.get(appId);
-                        if(null == applyInfo) {
+                        if (null == applyInfo) {
                             return null;
                         }
-                        if(null == funInfoDTO) {
+                        if (null == funInfoDTO) {
                             return null;
                         }
                         AppFunAuthResourceDTO resourceDTO = new AppFunAuthResourceDTO();
@@ -730,19 +786,19 @@ public class AuthApplyBusiness implements IAuthApplyBusiness {
     public ResponseStatus funApplyUpdate(AppFunApplyUpdateDTO updateDTO) {
         String applyOrdNo = updateDTO.getApplyOrdNo();
         WorkFlow workFlow = workFlowService.getByApplyOrdNo(applyOrdNo);
-        if(null == workFlow) {
+        if (null == workFlow) {
             return ResponseStatus.fail("工单不存在");
         }
 
         String applicantIdcard = workFlow.getApplicantIdcard();
         AuthUserInfo userInfo = userInfoService.findByIdcard(applicantIdcard);
-        if(null == userInfo) {
+        if (null == userInfo) {
             return ResponseStatus.fail("用户身份证号错误");
         }
 
         List<AppFunAuthResourceDTO> resourceInfos = updateDTO.getResourceInfos();
         List<AppFunAuthResourceDTO> delResourceInfos = updateDTO.getDelResourceInfos();
-        if(CollectionUtils.isEmpty(resourceInfos) && CollectionUtils.isEmpty(delResourceInfos)) {
+        if (CollectionUtils.isEmpty(resourceInfos) && CollectionUtils.isEmpty(delResourceInfos)) {
             return ResponseStatus.fail("申请单内容为空");
         }
 
@@ -760,7 +816,7 @@ public class AuthApplyBusiness implements IAuthApplyBusiness {
         }
         String operateType = updateDTO.getOperateType();
         workFlow.setOperateType(operateType);
-        if(AuthFlowOpeCons.SAVE.equals(operateType)) {
+        if (AuthFlowOpeCons.SAVE.equals(operateType)) {
             workFlow.setFlowStatus(WorkFlowStatusEnum.SAVING.getValue());
         } else {
             workFlow.setFlowStatus(WorkFlowStatusEnum.APPLYING.getValue());
@@ -777,10 +833,10 @@ public class AuthApplyBusiness implements IAuthApplyBusiness {
         url = Joiner.on("").join(url, api);
 
         ResponseDTO responseDTO = funApplyPushToApproval(url, HttpPut.METHOD_NAME, appFunAuthApplyDTO, updateList);
-        if(ResponseStatus.SUCCESS_CODE.equals(responseDTO.getStatusCode())){
-            //更新工单
+        if (ResponseStatus.SUCCESS_CODE.equals(responseDTO.getStatusCode())) {
+            // 更新工单
             workFlowService.update(workFlow);
-            //更新申请内容
+            // 更新申请内容
             funAuthApplyService.updateAuthApplyDetail(workFlow, updateList);
             return ResponseStatus.success();
         } else {
@@ -812,12 +868,11 @@ public class AuthApplyBusiness implements IAuthApplyBusiness {
         ResourceInfoDTO resourceInfoDTO = new ResourceInfoDTO();
         resourceInfoDTO.setVisitorName(applicantName);
         resourceInfoDTO.setVisitorCode(applicantIdcard);
-        //拼接funCodes和appCode成json数组
+        // 拼接funCodes和appCode成json数组
         setAddAndCancelResourceInfo(contentList, resourceInfoDTO);
         approvalWorkFlowDTO.setResourceInfo(resourceInfoDTO);
     }
 
-
     private void setAddAndCancelResourceInfo(List<AppFunAuthResourceDTO> contentList, ResourceInfoDTO resourceInfoDTO) {
         Map<String, List<AppFunAuthResourceDTO>> collect = contentList
                 .stream()
@@ -850,7 +905,7 @@ public class AuthApplyBusiness implements IAuthApplyBusiness {
                         .map(AppFunAuthResourceDTO::getFunName)
                         .collect(Collectors.toList());
                 nameJson.put("functionName", functionNameList);
-                if(AuthorizeTypeEnum.GNSQ.getValue().equals(operateType)) {
+                if (AuthorizeTypeEnum.GNSQ.getValue().equals(operateType)) {
                     addCodeArray.add(codeJson);
                     addNameArray.add(nameJson);
                 } else {
@@ -859,11 +914,11 @@ public class AuthApplyBusiness implements IAuthApplyBusiness {
                 }
             }
         }
-        if(addCodeArray.size() >0) {
+        if (addCodeArray.size() > 0) {
             resourceInfoDTO.setVisitResourceCode(addCodeArray.toJSONString());
             resourceInfoDTO.setVisitResourceName(addNameArray.toJSONString());
         }
-        if(delCodeArray.size() >0) {
+        if (delCodeArray.size() > 0) {
             resourceInfoDTO.setRemoveVisitResourceCode(delCodeArray.toJSONString());
             resourceInfoDTO.setRemoveVisitResourceName(delNameArray.toJSONString());
         }
@@ -877,24 +932,22 @@ public class AuthApplyBusiness implements IAuthApplyBusiness {
         approvalWorkFlowDTO.setApproveNo(workFlowDTO.getApplicantOrdNo());
     }
 
-
     private ResponseDTO dealPush(String url, String methodName, ApprovalWorkFlowDTO approvalWorkFlowDTO) {
         ResponseDTO status;
         try {
             log.info("-------pushToApprovalCenter START---------------");
             status = pushToApproval(url, methodName, approvalWorkFlowDTO);
             log.info("-------pushToApprovalCenter END---------------");
-            if(!ResponseStatus.SUCCESS_CODE.equals(status.getStatusCode())) {
-                status = new ResponseDTO(ResponseStatus.FAIL_CODE,"approve service faild :"+status.getMessage(), null);
+            if (!ResponseStatus.SUCCESS_CODE.equals(status.getStatusCode())) {
+                status = new ResponseDTO(ResponseStatus.FAIL_CODE, "approve service faild :" + status.getMessage(), null);
             }
         } catch (Exception e) {
             log.error("work flow push error.", e);
-            status = new ResponseDTO(ResponseStatus.FAIL_CODE,"push to work flow error", null);
+            status = new ResponseDTO(ResponseStatus.FAIL_CODE, "push to work flow error", null);
         }
         return status;
     }
 
-
     private ResponseDTO pushToApproval(String url, String methodName, ApprovalWorkFlowDTO approvalWorkFlowDTO) {
         List<Header> headers = getApprovalHeaders();
         log.info("approval center push url:{}, flowType:{}",
@@ -902,14 +955,14 @@ public class AuthApplyBusiness implements IAuthApplyBusiness {
                 approvalWorkFlowDTO.getFlowType());
         String body = JSON.toJSONString(approvalWorkFlowDTO);
         String response = "";
-        if(HttpPost.METHOD_NAME.equals(methodName)) {
+        if (HttpPost.METHOD_NAME.equals(methodName)) {
             response = HttpUtil.postJSON(url, body, headers, null);
         }
-        if(HttpPut.METHOD_NAME.equals(methodName)) {
+        if (HttpPut.METHOD_NAME.equals(methodName)) {
             response = HttpUtil.putJson(url, body, headers, null);
         }
-        if(StringUtils.isBlank(response)) {
-            return new ResponseDTO(ResponseStatus.FAIL_CODE,"push to approve service failed", null);
+        if (StringUtils.isBlank(response)) {
+            return new ResponseDTO(ResponseStatus.FAIL_CODE, "push to approve service failed", null);
         }
 
         log.info("approval center push result:{}", response);
@@ -919,6 +972,7 @@ public class AuthApplyBusiness implements IAuthApplyBusiness {
     /**
      * 总线调用方式
      * 授权推送工单到审批服务
+     *
      * @param approvalWorkFlowDTO
      * @return
      */
@@ -934,8 +988,8 @@ public class AuthApplyBusiness implements IAuthApplyBusiness {
         log.info("work flow request body:{}", postBody);
 
         String response = HttpUtil.postJSON(approvalConfig.getWorkflowUrl(), postBody, headers, null);
-        if(org.apache.commons.lang3.StringUtils.isBlank(response)) {
-            return new ResponseDTO(ResponseStatus.FAIL_CODE,"push to approve service failed", null);
+        if (org.apache.commons.lang3.StringUtils.isBlank(response)) {
+            return new ResponseDTO(ResponseStatus.FAIL_CODE, "push to approve service failed", null);
         }
 
         log.info("work flow push result:{}", response);
@@ -944,6 +998,7 @@ public class AuthApplyBusiness implements IAuthApplyBusiness {
 
     /**
      * 获取通过总线调用审批中心请求头
+     *
      * @return
      */
     private List<Header> getBusApprovalHeaders() {
@@ -952,7 +1007,7 @@ public class AuthApplyBusiness implements IAuthApplyBusiness {
         ServletRequestAttributes servletRequestAttributes = (ServletRequestAttributes) requestAttributes;
         HttpServletRequest request = servletRequestAttributes.getRequest();
         String userToken = request.getHeader(Constants.USER_TOKEN);
-        String appToken  = request.getHeader(Constants.APP_TOKEN);
+        String appToken = request.getHeader(Constants.APP_TOKEN);
         if (StrUtil.isNotBlank(userToken)) {
             Header userTokenHead = new BasicHeader(Constants.BUS_SRE_TOKEN, userToken);
             headers.add(userTokenHead);
@@ -963,7 +1018,7 @@ public class AuthApplyBusiness implements IAuthApplyBusiness {
         }
 
         String idcard = UserContextUtils.getCurrentUser().getIdcard();
-        BasicHeader busSreIdcardHeader = new BasicHeader(Constants.BUS_SRE_IDCARD , idcard);
+        BasicHeader busSreIdcardHeader = new BasicHeader(Constants.BUS_SRE_IDCARD, idcard);
         BasicHeader busSraIdHeader = new BasicHeader("bus_sra_id", approvalConfig.getBusSraId());
         BasicHeader busServiceIdHeader = new BasicHeader("bus_service_id", approvalConfig.getBusServiceId());
         BasicHeader busServiceFuncHeader = new BasicHeader("bus_service_func", approvalConfig.getBusServiceFunc());
@@ -975,9 +1030,9 @@ public class AuthApplyBusiness implements IAuthApplyBusiness {
         return headers;
     }
 
-
     /**
      * 获取调用审批中心请求头
+     *
      * @return
      */
     private List<Header> getApprovalHeaders() {
@@ -988,7 +1043,7 @@ public class AuthApplyBusiness implements IAuthApplyBusiness {
         String userToken = request.getHeader(Constants.USER_TOKEN);
         String appToken = request.getHeader(Constants.APP_TOKEN);
         log.info("getApprovalHeaders userToken:{}, appToken:{}", userToken, appToken);
-        if(StringUtils.isNotBlank(userToken) && StringUtils.isNotBlank(appToken)) {
+        if (StringUtils.isNotBlank(userToken) && StringUtils.isNotBlank(appToken)) {
             BasicHeader appTokenHeader = new BasicHeader(Constants.APP_TOKEN, appToken);
             BasicHeader userTokenHeader = new BasicHeader(Constants.USER_TOKEN, userToken);
             headers.add(appTokenHeader);

+ 35 - 6
dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/facade/AuthApplyFacade.java

@@ -1,8 +1,19 @@
 package com.dragoninfo.dcuc.auth.auth.facade;
 
 import com.dragoninfo.dcuc.auth.auth.business.IAuthApplyBusiness;
-import com.dragoninfo.dcuc.auth.auth.dto.*;
+import com.dragoninfo.dcuc.auth.auth.dto.AppFunApplyUpdateDTO;
+import com.dragoninfo.dcuc.auth.auth.dto.AppFunAuthApplyDTO;
+import com.dragoninfo.dcuc.auth.auth.dto.AppFunAuthResourceDTO;
+import com.dragoninfo.dcuc.auth.auth.dto.ApprovalSuggestionDTO;
+import com.dragoninfo.dcuc.auth.auth.dto.FlowDefineInfoDTO;
+import com.dragoninfo.dcuc.auth.auth.dto.FunApplyDetailDTO;
+import com.dragoninfo.dcuc.auth.auth.dto.ProcessNodeDTO;
+import com.dragoninfo.dcuc.auth.auth.dto.ProcessPicDTO;
+import com.dragoninfo.dcuc.auth.auth.dto.ProcessStatusDTO;
+import com.dragoninfo.dcuc.auth.auth.dto.WorkFlowPageViewDTO;
+import com.dragoninfo.dcuc.auth.auth.enumresources.WorkFlowActionTypeEnum;
 import com.dragoninfo.dcuc.auth.auth.vo.RedListRiskLogVo;
+import com.dragoninfo.dcuc.auth.constance.ApprovalApiConstance;
 import com.dragonsoft.duceap.base.entity.http.ResponseDTO;
 import com.dragonsoft.duceap.base.entity.http.ResponseStatus;
 import com.dragonsoft.duceap.base.entity.search.SearchDTO;
@@ -24,18 +35,17 @@ public class AuthApplyFacade implements IAuthApplyFacade {
     @Autowired
     IAuthApplyBusiness authApplyBusiness;
 
-
     @Override
     public ResponseStatus funApplySave(AppFunAuthApplyDTO authApplyDTO) {
-       return authApplyBusiness.funApplySave(authApplyDTO);
+        return authApplyBusiness.funApplySave(authApplyDTO);
     }
 
     @Override
     public FunApplyDetailDTO funApplyDetail(String applyOrdNo, Boolean needFlowInfo) {
-        if(null == needFlowInfo) {
+        if (null == needFlowInfo) {
             needFlowInfo = false;
         }
-       return authApplyBusiness.funApplyDetail(applyOrdNo, needFlowInfo);
+        return authApplyBusiness.funApplyDetail(applyOrdNo, needFlowInfo);
     }
 
     @Override
@@ -50,7 +60,26 @@ public class AuthApplyFacade implements IAuthApplyFacade {
 
     @Override
     public ResponseStatus authApplyCancel(String applyOrdNo) {
-        return authApplyBusiness.authApplyCancel(applyOrdNo);
+        return authApplyBusiness.handleWorkFlowAction(
+                WorkFlowActionTypeEnum.CANCEL, ApprovalApiConstance.APPROVAL_CANCEL_API, applyOrdNo);
+    }
+
+    @Override
+    public ResponseStatus authApplySuspend(String applyOrdNo) {
+        return authApplyBusiness.handleWorkFlowAction(
+                WorkFlowActionTypeEnum.SUSPEND, ApprovalApiConstance.APPROVAL_SUSPEND_API, applyOrdNo);
+    }
+
+    @Override
+    public ResponseStatus authApplyActivate(String applyOrdNo) {
+        return authApplyBusiness.handleWorkFlowAction(
+                WorkFlowActionTypeEnum.ACTIVATE, ApprovalApiConstance.APPROVAL_ACTIVATE_API, applyOrdNo);
+    }
+
+    @Override
+    public ResponseStatus authApplyStop(String applyOrdNo) {
+        return authApplyBusiness.handleWorkFlowAction(
+                WorkFlowActionTypeEnum.STOP, ApprovalApiConstance.APPROVAL_REDO_API, applyOrdNo);
     }
 
     @Override

+ 2 - 6
dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/service/IWorkFlowService.java

@@ -2,6 +2,7 @@ package com.dragoninfo.dcuc.auth.auth.service;
 
 import com.dragoninfo.dcuc.auth.auth.dto.WorkFlowDTO;
 import com.dragoninfo.dcuc.auth.auth.entity.WorkFlow;
+import com.dragoninfo.dcuc.auth.auth.enumresources.WorkFlowActionTypeEnum;
 import com.dragonsoft.duceap.core.search.Searchable;
 import org.springframework.data.domain.Page;
 
@@ -54,12 +55,7 @@ public interface IWorkFlowService {
      */
     WorkFlow getById(String id);
 
-    /**
-     * 撤销
-     * @param id
-     * @return
-     */
-    Boolean cancelWorkFlow(String id);
+    Boolean updateWorkFlowByAction(WorkFlowActionTypeEnum actionType, String id);
 
     /**
      * 根据审批单号获取工单

+ 36 - 11
dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/service/impl/WorkFlowServiceImpl.java

@@ -3,16 +3,15 @@ package com.dragoninfo.dcuc.auth.auth.service.impl;
 import com.dragoninfo.dcuc.auth.auth.dto.WorkFlowDTO;
 import com.dragoninfo.dcuc.auth.auth.entity.WorkFlow;
 import com.dragoninfo.dcuc.auth.auth.enumresources.WorkFlowStatusEnum;
+import com.dragoninfo.dcuc.auth.auth.enumresources.WorkFlowActionTypeEnum;
 import com.dragoninfo.dcuc.auth.auth.repo.WorkFlowRepository;
+import com.dragoninfo.dcuc.auth.auth.service.IAppFunApplyContentService;
 import com.dragoninfo.dcuc.auth.auth.service.IWorkFlowService;
-import com.dragoninfo.dcuc.auth.config.DcucAuthApprovalConfig;
-import com.dragoninfo.dcuc.auth.config.DcucAuthConfig;
 import com.dragonsoft.duceap.base.enums.BooleanEnum;
 import com.dragonsoft.duceap.core.search.Searchable;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.BeanUtils;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.domain.Example;
 import org.springframework.data.domain.Page;
 import org.springframework.stereotype.Service;
@@ -28,8 +27,14 @@ import java.util.List;
 @Service
 public class WorkFlowServiceImpl implements IWorkFlowService {
 
-    @Autowired
-    private WorkFlowRepository workFlowRepository;
+    private final WorkFlowRepository workFlowRepository;
+
+    private final IAppFunApplyContentService funAuthApplyService;
+
+    public WorkFlowServiceImpl(WorkFlowRepository workFlowRepository, IAppFunApplyContentService funAuthApplyService) {
+        this.workFlowRepository = workFlowRepository;
+        this.funAuthApplyService = funAuthApplyService;
+    }
 
     @Override
     public WorkFlow saveWorkFlow(WorkFlowDTO dto) {
@@ -41,7 +46,7 @@ public class WorkFlowServiceImpl implements IWorkFlowService {
 
     @Override
     public WorkFlow getByMessageId(String messageId) {
-        if(StringUtils.isBlank(messageId)) {
+        if (StringUtils.isBlank(messageId)) {
             return null;
         }
         WorkFlow query = new WorkFlow();
@@ -74,14 +79,35 @@ public class WorkFlowServiceImpl implements IWorkFlowService {
 
     @Transactional(rollbackFor = RuntimeException.class)
     @Override
-    public Boolean cancelWorkFlow(String id) {
-       int i = workFlowRepository.updateStatus(id,WorkFlowStatusEnum.CANCEL.getValue());
-       return i>0;
+    public Boolean updateWorkFlowByAction(WorkFlowActionTypeEnum actionType, String id) {
+        int i = 0;
+        switch (actionType) {
+            case CANCEL:
+                i = workFlowRepository.updateStatus(id, WorkFlowStatusEnum.CANCEL.getValue());
+                break;
+            case SUSPEND:
+                i = workFlowRepository.updateStatus(id, WorkFlowStatusEnum.SUSPEND.getValue());
+                break;
+            case ACTIVATE:
+                i = workFlowRepository.updateStatus(id, WorkFlowStatusEnum.APPLYING.getValue());
+                break;
+            case STOP:
+                i = workFlowRepository.updateStatus(id, WorkFlowStatusEnum.STOP.getValue());
+                break;
+            case DELETE:
+                delById(id);
+                funAuthApplyService.delByAuthApplyId(id);
+                i = 1;
+                break;
+            default:
+                break;
+        }
+        return i > 0;
     }
 
     @Override
     public WorkFlow getByApplyOrdNo(String applyOrdNo) {
-        if(StringUtils.isBlank(applyOrdNo)) {
+        if (StringUtils.isBlank(applyOrdNo)) {
             return null;
         }
         WorkFlow query = new WorkFlow();
@@ -94,5 +120,4 @@ public class WorkFlowServiceImpl implements IWorkFlowService {
     public List<WorkFlow> search(Searchable searchable) {
         return workFlowRepository.findAll(searchable);
     }
-
 }

+ 2 - 1
dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/business/impl/zerotrust/ZeroTrustApprovalBusinessImpl.java

@@ -10,6 +10,7 @@ import com.dragoninfo.dcuc.auth.api.vo.zerotrust.ZeroTrustMessageRespVO;
 import com.dragoninfo.dcuc.auth.auth.constance.zerotrust.approval.ApprovalConstance;
 import com.dragoninfo.dcuc.auth.auth.dto.zerotrust.approval.*;
 import com.dragoninfo.dcuc.auth.auth.entity.zerotrust.ApprovalResult;
+import com.dragoninfo.dcuc.auth.auth.enumresources.WorkFlowActionTypeEnum;
 import com.dragoninfo.dcuc.auth.auth.enumresources.zerotrust.approval.*;
 import com.dragoninfo.dcuc.auth.auth.service.zerotrust.IApprovalResultService;
 import com.dragoninfo.dcuc.auth.auth.vo.zerotrust.approval.ApprovalCallBackReqVO;
@@ -238,7 +239,7 @@ public class ZeroTrustApprovalBusinessImpl implements IZeroTrustApprovalBusiness
         FlowOperateManageReqDto flowOperateManageReqDto = new FlowOperateManageReqDto();
         flowOperateManageReqDto.setAppTokenId(appTokenId);
         flowOperateManageReqDto.setProcessInstId(processInstId);
-        flowOperateManageReqDto.setActionType(FlowActionTypeEnum.CANCEL.getValue());
+        flowOperateManageReqDto.setActionType(WorkFlowActionTypeEnum.CANCEL.getValue());
         return approveRemoteCallBusiness.flowManage(flowOperateManageReqDto);
     }
 

+ 15 - 0
dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/constance/ApprovalApiConstance.java

@@ -23,6 +23,21 @@ public class ApprovalApiConstance {
      * 审批单撤销api
      */
     public static final String APPROVAL_CANCEL_API = "/approve-core/api/v2/approves/{approveNo}/recall";
+
+    //20241101 add status start
+    /**
+     * 审批单挂起api
+     */
+    public static final String APPROVAL_SUSPEND_API = "/approve-core/api/v2/approves/{approveNo}/suspend";
+    /**
+     * 审批单激活api
+     */
+    public static final String APPROVAL_ACTIVATE_API = "/approve-core/api/v2/approves/{approveNo}/activate";
+    /**
+     * 审批单终止api
+     */
+    public static final String APPROVAL_REDO_API = "/approve-core/api/v2/approves/{approveNo}/redo";
+    //20241101 add status end
     /**
      * 审批单删除api
      */