可信空间连接器入住接口
Showing
6 changed files
with
155 additions
and
22 deletions
| 1 | package com.csbr.qingcloud.portal.controller; | 1 | package com.csbr.qingcloud.portal.controller; |
| 2 | 2 | ||
| 3 | import com.csbr.cloud.common.response.CommonRes; | 3 | import com.csbr.cloud.common.response.CommonRes; |
| 4 | import com.csbr.cloud.workflow.domain.dto.callback.BizCallbackDTO; | ||
| 4 | import csbr.cloud.entity.annotation.SystemLog; | 5 | import csbr.cloud.entity.annotation.SystemLog; |
| 5 | import csbr.cloud.entity.domain.base.vo.PageListVO; | 6 | import csbr.cloud.entity.domain.base.vo.PageListVO; |
| 6 | import com.csbr.qingcloud.portal.domain.vo.TdsConnectorIdentityQueryVO; | 7 | import com.csbr.qingcloud.portal.domain.vo.TdsConnectorIdentityQueryVO; |
| ... | @@ -76,6 +77,13 @@ public class TdsConnectorIdentityController { | ... | @@ -76,6 +77,13 @@ public class TdsConnectorIdentityController { |
| 76 | return CommonRes.success(vo); | 77 | return CommonRes.success(vo); |
| 77 | } | 78 | } |
| 78 | 79 | ||
| 80 | @PostMapping("/callback") | ||
| 81 | @Operation(summary = "流程回调",hidden = true) | ||
| 82 | public CommonRes<Boolean> flowComplete(@RequestBody BizCallbackDTO bizApproveVO) { | ||
| 83 | tdsConnectorIdentityService.flowComplete(bizApproveVO); | ||
| 84 | return CommonRes.success(true); | ||
| 85 | } | ||
| 86 | |||
| 79 | //endregion | 87 | //endregion |
| 80 | 88 | ||
| 81 | } | 89 | } | ... | ... |
| 1 | package com.csbr.qingcloud.portal.domain.vo; | 1 | package com.csbr.qingcloud.portal.domain.vo; |
| 2 | 2 | ||
| 3 | import com.csbr.cloud.mybatis.annotations.LikeQuery; | ||
| 4 | import com.csbr.cloud.mybatis.enums.LikeQueryEnum; | ||
| 5 | import com.csbr.cloud.workflow.domain.dto.appove.FlowBizGuidQueryDTO; | ||
| 3 | import csbr.cloud.entity.domain.base.dto.BasePageDTO; | 6 | import csbr.cloud.entity.domain.base.dto.BasePageDTO; |
| 4 | import io.swagger.v3.oas.annotations.media.Schema; | 7 | import io.swagger.v3.oas.annotations.media.Schema; |
| 5 | import lombok.EqualsAndHashCode; | 8 | import lombok.EqualsAndHashCode; |
| 6 | import lombok.Data; | 9 | import lombok.Data; |
| 7 | import java.util.Date; | 10 | import java.util.Date; |
| 11 | import java.util.List; | ||
| 8 | 12 | ||
| 9 | /** | 13 | /** |
| 10 | * @program: | 14 | * @program: |
| ... | @@ -15,6 +19,25 @@ import java.util.Date; | ... | @@ -15,6 +19,25 @@ import java.util.Date; |
| 15 | @EqualsAndHashCode(callSuper = true) | 19 | @EqualsAndHashCode(callSuper = true) |
| 16 | @Data | 20 | @Data |
| 17 | @Schema(title = "连接器身份信息查询参数") | 21 | @Schema(title = "连接器身份信息查询参数") |
| 18 | public class TdsConnectorIdentityQueryVO extends BasePageDTO { | 22 | public class TdsConnectorIdentityQueryVO extends FlowBizGuidQueryDTO { |
| 19 | 23 | ||
| 24 | /** | ||
| 25 | * 接入连接器名称 | ||
| 26 | */ | ||
| 27 | @Schema(description = "接入连接器名称") | ||
| 28 | @LikeQuery(type = LikeQueryEnum.ALL) | ||
| 29 | private String connectorName; | ||
| 30 | |||
| 31 | /** | ||
| 32 | * 是否调用查询的判断 | ||
| 33 | */ | ||
| 34 | @Schema(description = "是否调用查询的判断", hidden = true) | ||
| 35 | private Boolean isNeedQuery; | ||
| 36 | |||
| 37 | /** | ||
| 38 | * 数据唯一标识【List集合】 | ||
| 39 | */ | ||
| 40 | @Schema(description = "数据唯一标识", hidden = true) | ||
| 41 | private List<String> guidList; | ||
| 42 | |||
| 20 | } | 43 | } | ... | ... |
| 1 | package com.csbr.qingcloud.portal.domain.vo; | 1 | package com.csbr.qingcloud.portal.domain.vo; |
| 2 | 2 | ||
| 3 | import com.csbr.cloud.workflow.domain.vo.appove.FlowRQBaseVO; | ||
| 3 | import io.swagger.v3.oas.annotations.media.Schema; | 4 | import io.swagger.v3.oas.annotations.media.Schema; |
| 4 | import com.fasterxml.jackson.annotation.JsonFormat; | 5 | import com.fasterxml.jackson.annotation.JsonFormat; |
| 5 | import jakarta.validation.constraints.NotBlank; | 6 | import jakarta.validation.constraints.NotBlank; |
| ... | @@ -18,7 +19,7 @@ import java.util.Map; | ... | @@ -18,7 +19,7 @@ import java.util.Map; |
| 18 | **/ | 19 | **/ |
| 19 | @Data | 20 | @Data |
| 20 | @Schema(title = "连接器身份信息新增、修改参数") | 21 | @Schema(title = "连接器身份信息新增、修改参数") |
| 21 | public class TdsConnectorIdentityRQVO { | 22 | public class TdsConnectorIdentityRQVO extends FlowRQBaseVO { |
| 22 | 23 | ||
| 23 | /** | 24 | /** |
| 24 | * 系统唯一标识 | 25 | * 系统唯一标识 |
| ... | @@ -89,6 +90,12 @@ public class TdsConnectorIdentityRQVO { | ... | @@ -89,6 +90,12 @@ public class TdsConnectorIdentityRQVO { |
| 89 | @Schema(description = "凭证颁发日期") | 90 | @Schema(description = "凭证颁发日期") |
| 90 | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") | 91 | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| 91 | private Date credentialTime; | 92 | private Date credentialTime; |
| 93 | |||
| 94 | /** | ||
| 95 | * 业务审批状态 | ||
| 96 | */ | ||
| 97 | @Schema(description = "业务审批状态") | ||
| 98 | private String bizApproveState; | ||
| 92 | 99 | ||
| 93 | /******** 库表存储属性 需处理 *****/ | 100 | /******** 库表存储属性 需处理 *****/ |
| 94 | 101 | ... | ... |
| ... | @@ -81,4 +81,10 @@ public class MfTdsConnectorIdentity extends BaseDO { | ... | @@ -81,4 +81,10 @@ public class MfTdsConnectorIdentity extends BaseDO { |
| 81 | @Name("凭证颁发日期") | 81 | @Name("凭证颁发日期") |
| 82 | private Date credentialTime; | 82 | private Date credentialTime; |
| 83 | 83 | ||
| 84 | /** | ||
| 85 | * 业务审批状态【N 草稿中,A 审批中,Y 已通过,R 驳回,C 已撤销,D 已废弃; 默认 N】 | ||
| 86 | */ | ||
| 87 | @Name("业务审批状态") | ||
| 88 | private String bizApproveState; | ||
| 89 | |||
| 84 | } | 90 | } | ... | ... |
| 1 | package com.csbr.qingcloud.portal.service; | 1 | package com.csbr.qingcloud.portal.service; |
| 2 | 2 | ||
| 3 | import com.csbr.cloud.workflow.domain.dto.callback.BizCallbackDTO; | ||
| 4 | import com.csbr.cloud.workflow.domain.vo.appove.FlowRQBaseVO; | ||
| 3 | import csbr.cloud.entity.domain.base.vo.PageListVO; | 5 | import csbr.cloud.entity.domain.base.vo.PageListVO; |
| 4 | import com.csbr.qingcloud.portal.domain.vo.TdsConnectorIdentityQueryVO; | 6 | import com.csbr.qingcloud.portal.domain.vo.TdsConnectorIdentityQueryVO; |
| 5 | import com.csbr.qingcloud.portal.domain.vo.TdsConnectorIdentityRQVO; | 7 | import com.csbr.qingcloud.portal.domain.vo.TdsConnectorIdentityRQVO; |
| ... | @@ -37,19 +39,19 @@ public interface TdsConnectorIdentityService { | ... | @@ -37,19 +39,19 @@ public interface TdsConnectorIdentityService { |
| 37 | * 连接器身份信息数据新增 | 39 | * 连接器身份信息数据新增 |
| 38 | * @author xup | 40 | * @author xup |
| 39 | * @date 2025-08-20 15:13 | 41 | * @date 2025-08-20 15:13 |
| 40 | * @param rqVO | 42 | * @param flowBaseVO |
| 41 | * @return boolean | 43 | * @return boolean |
| 42 | */ | 44 | */ |
| 43 | void saveTdsConnectorIdentity(TdsConnectorIdentityRQVO rqVO); | 45 | void saveTdsConnectorIdentity(FlowRQBaseVO flowBaseVO); |
| 44 | 46 | ||
| 45 | /** | 47 | /** |
| 46 | * 连接器身份信息数据修改 | 48 | * 连接器身份信息数据修改 |
| 47 | * @author xup | 49 | * @author xup |
| 48 | * @date 2025-08-20 15:13 | 50 | * @date 2025-08-20 15:13 |
| 49 | * @param rqVO | 51 | * @param flowBaseVO |
| 50 | * @return boolean | 52 | * @return boolean |
| 51 | */ | 53 | */ |
| 52 | void updateTdsConnectorIdentity(TdsConnectorIdentityRQVO rqVO); | 54 | void updateTdsConnectorIdentity(FlowRQBaseVO flowBaseVO); |
| 53 | 55 | ||
| 54 | /** | 56 | /** |
| 55 | * 连接器身份信息数据删除 | 57 | * 连接器身份信息数据删除 |
| ... | @@ -68,5 +70,10 @@ public interface TdsConnectorIdentityService { | ... | @@ -68,5 +70,10 @@ public interface TdsConnectorIdentityService { |
| 68 | * @return void | 70 | * @return void |
| 69 | */ | 71 | */ |
| 70 | void removeHandleByGuids(List<String> guids); | 72 | void removeHandleByGuids(List<String> guids); |
| 71 | 73 | ||
| 74 | /** | ||
| 75 | * 流程回调 | ||
| 76 | * @param bizApproveVO | ||
| 77 | */ | ||
| 78 | void flowComplete(BizCallbackDTO bizApproveVO); | ||
| 72 | } | 79 | } | ... | ... |
| 1 | package com.csbr.qingcloud.portal.service.impl; | 1 | package com.csbr.qingcloud.portal.service.impl; |
| 2 | 2 | ||
| 3 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | 3 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| 4 | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; | ||
| 4 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; | 5 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| 5 | import com.csbr.cloud.common.enums.SystemError; | 6 | import com.csbr.cloud.common.enums.SystemError; |
| 7 | import com.csbr.cloud.common.enums.WorkFlowBizEnum; | ||
| 6 | import com.csbr.cloud.common.exception.CsbrSystemException; | 8 | import com.csbr.cloud.common.exception.CsbrSystemException; |
| 7 | import com.csbr.cloud.common.util.CommonUtil; | 9 | import com.csbr.cloud.common.util.CommonUtil; |
| 8 | import com.csbr.cloud.common.util.CsbrBeanUtil; | 10 | import com.csbr.cloud.common.util.CsbrBeanUtil; |
| 9 | import com.csbr.cloud.common.util.MessageSourceUtil; | 11 | import com.csbr.cloud.common.util.MessageSourceUtil; |
| 12 | import com.csbr.cloud.mybatis.util.BizCommonRedisUtil; | ||
| 13 | import com.csbr.cloud.workflow.domain.dto.appove.AddApprovalDTO; | ||
| 14 | import com.csbr.cloud.workflow.domain.dto.callback.BizCallbackDTO; | ||
| 15 | import com.csbr.cloud.workflow.domain.vo.appove.FlowRQBaseVO; | ||
| 16 | import com.csbr.cloud.workflow.util.ApprovalFlowUtil; | ||
| 17 | import com.csbr.cloud.workflow.util.FlowAbstractImpl; | ||
| 10 | import com.csbr.qingcloud.portal.domain.vo.*; | 18 | import com.csbr.qingcloud.portal.domain.vo.*; |
| 11 | import com.csbr.qingcloud.portal.service.TdsConnectorAdditionalService; | 19 | import com.csbr.qingcloud.portal.service.TdsConnectorAdditionalService; |
| 12 | import com.csbr.qingcloud.portal.service.TdsConnectorVerifiableService; | 20 | import com.csbr.qingcloud.portal.service.TdsConnectorVerifiableService; |
| ... | @@ -14,6 +22,8 @@ import csbr.cloud.entity.domain.base.vo.PageListVO; | ... | @@ -14,6 +22,8 @@ import csbr.cloud.entity.domain.base.vo.PageListVO; |
| 14 | import com.csbr.qingcloud.portal.mybatis.entity.MfTdsConnectorIdentity; | 22 | import com.csbr.qingcloud.portal.mybatis.entity.MfTdsConnectorIdentity; |
| 15 | import com.csbr.qingcloud.portal.mybatis.service.MfTdsConnectorIdentityService; | 23 | import com.csbr.qingcloud.portal.mybatis.service.MfTdsConnectorIdentityService; |
| 16 | import com.csbr.qingcloud.portal.service.TdsConnectorIdentityService; | 24 | import com.csbr.qingcloud.portal.service.TdsConnectorIdentityService; |
| 25 | import csbr.cloud.entity.enums.ApprovalStateEnum; | ||
| 26 | import io.seata.spring.annotation.GlobalTransactional; | ||
| 17 | import jakarta.annotation.Resource; | 27 | import jakarta.annotation.Resource; |
| 18 | import lombok.extern.slf4j.Slf4j; | 28 | import lombok.extern.slf4j.Slf4j; |
| 19 | import org.apache.commons.collections.CollectionUtils; | 29 | import org.apache.commons.collections.CollectionUtils; |
| ... | @@ -23,6 +33,7 @@ import org.springframework.stereotype.Service; | ... | @@ -23,6 +33,7 @@ import org.springframework.stereotype.Service; |
| 23 | import org.springframework.transaction.annotation.Transactional; | 33 | import org.springframework.transaction.annotation.Transactional; |
| 24 | 34 | ||
| 25 | import java.util.ArrayList; | 35 | import java.util.ArrayList; |
| 36 | import java.util.Arrays; | ||
| 26 | import java.util.Collections; | 37 | import java.util.Collections; |
| 27 | import java.util.List; | 38 | import java.util.List; |
| 28 | 39 | ||
| ... | @@ -34,8 +45,14 @@ import java.util.List; | ... | @@ -34,8 +45,14 @@ import java.util.List; |
| 34 | **/ | 45 | **/ |
| 35 | @Slf4j | 46 | @Slf4j |
| 36 | @Service | 47 | @Service |
| 37 | public class TdsConnectorIdentityServiceImpl implements TdsConnectorIdentityService { | 48 | public class TdsConnectorIdentityServiceImpl extends FlowAbstractImpl implements TdsConnectorIdentityService { |
| 38 | 49 | ||
| 50 | /** | ||
| 51 | * 流程类型 | ||
| 52 | */ | ||
| 53 | private static final String FLOW_TYPE = WorkFlowBizEnum.TDS_CONNECTOR.getValue(); | ||
| 54 | |||
| 55 | private static final String SysFuncCode = "TDSCONNECTOR"; | ||
| 39 | /** | 56 | /** |
| 40 | * 功能名称 | 57 | * 功能名称 |
| 41 | */ | 58 | */ |
| ... | @@ -56,6 +73,12 @@ public class TdsConnectorIdentityServiceImpl implements TdsConnectorIdentityServ | ... | @@ -56,6 +73,12 @@ public class TdsConnectorIdentityServiceImpl implements TdsConnectorIdentityServ |
| 56 | @Resource | 73 | @Resource |
| 57 | private TdsConnectorAdditionalService tdsConnectorAdditionalService; | 74 | private TdsConnectorAdditionalService tdsConnectorAdditionalService; |
| 58 | 75 | ||
| 76 | @Resource | ||
| 77 | private ApprovalFlowUtil approvalFlowUtil; | ||
| 78 | |||
| 79 | @Resource | ||
| 80 | private BizCommonRedisUtil bizCommonRedisUtil; | ||
| 81 | |||
| 59 | /** | 82 | /** |
| 60 | * 连接器身份信息分页查询 | 83 | * 连接器身份信息分页查询 |
| 61 | * @author xup | 84 | * @author xup |
| ... | @@ -66,12 +89,17 @@ public class TdsConnectorIdentityServiceImpl implements TdsConnectorIdentityServ | ... | @@ -66,12 +89,17 @@ public class TdsConnectorIdentityServiceImpl implements TdsConnectorIdentityServ |
| 66 | @Override | 89 | @Override |
| 67 | public PageListVO<TdsConnectorIdentityRSVO> pageList(TdsConnectorIdentityQueryVO queryVO) { | 90 | public PageListVO<TdsConnectorIdentityRSVO> pageList(TdsConnectorIdentityQueryVO queryVO) { |
| 68 | beforeQuery(queryVO); | 91 | beforeQuery(queryVO); |
| 69 | LambdaQueryWrapper<MfTdsConnectorIdentity> queryWrapper = mfTdsConnectorIdentityService.csbrQueryWrapper(queryVO, MfTdsConnectorIdentity.class); | 92 | if (queryVO.getIsNeedQuery()) { |
| 70 | queryWrapper.orderByDesc(MfTdsConnectorIdentity::getCreateTime); | 93 | LambdaQueryWrapper<MfTdsConnectorIdentity> queryWrapper = mfTdsConnectorIdentityService.csbrQueryWrapper(queryVO, MfTdsConnectorIdentity.class); |
| 71 | PageListVO<MfTdsConnectorIdentity> pageList = mfTdsConnectorIdentityService.csbrPageList(queryVO, queryWrapper); | 94 | queryWrapper.in(CollectionUtils.isNotEmpty(queryVO.getGuidList()), MfTdsConnectorIdentity::getGuid, |
| 72 | PageListVO<TdsConnectorIdentityRSVO> rsPageList = csbrBeanUtil.convert(pageList, PageListVO.class); | 95 | queryVO.getGuidList()); |
| 73 | afterQuery(pageList, rsPageList); | 96 | queryWrapper.orderByDesc(MfTdsConnectorIdentity::getCreateTime); |
| 74 | return rsPageList; | 97 | PageListVO<MfTdsConnectorIdentity> pageList = mfTdsConnectorIdentityService.csbrPageList(queryVO, queryWrapper); |
| 98 | PageListVO<TdsConnectorIdentityRSVO> rsPageList = csbrBeanUtil.convert(pageList, PageListVO.class); | ||
| 99 | afterQuery(pageList, rsPageList); | ||
| 100 | return rsPageList; | ||
| 101 | } | ||
| 102 | return new PageListVO<>(); | ||
| 75 | } | 103 | } |
| 76 | 104 | ||
| 77 | /** | 105 | /** |
| ... | @@ -103,16 +131,20 @@ public class TdsConnectorIdentityServiceImpl implements TdsConnectorIdentityServ | ... | @@ -103,16 +131,20 @@ public class TdsConnectorIdentityServiceImpl implements TdsConnectorIdentityServ |
| 103 | * 连接器身份信息数据新增 | 131 | * 连接器身份信息数据新增 |
| 104 | * @author xup | 132 | * @author xup |
| 105 | * @date 2025-08-20 15:13 | 133 | * @date 2025-08-20 15:13 |
| 106 | * @param rqVO | 134 | * @param flowBaseVO |
| 107 | * @return boolean | 135 | * @return boolean |
| 108 | */ | 136 | */ |
| 109 | @Transactional(rollbackFor = Exception.class) | 137 | @GlobalTransactional(rollbackFor = Exception.class) |
| 110 | @Override | 138 | @Override |
| 111 | public void saveTdsConnectorIdentity(TdsConnectorIdentityRQVO rqVO) { | 139 | public void saveTdsConnectorIdentity(FlowRQBaseVO flowBaseVO) { |
| 140 | TdsConnectorIdentityRQVO rqVO = (TdsConnectorIdentityRQVO) flowBaseVO; | ||
| 112 | beforeSave(rqVO); | 141 | beforeSave(rqVO); |
| 113 | MfTdsConnectorIdentity entity = convertToEntity(rqVO); | 142 | MfTdsConnectorIdentity entity = convertToEntity(rqVO); |
| 114 | rqVO.setGuid(entity.getGuid()); | 143 | rqVO.setGuid(entity.getGuid()); |
| 115 | mfTdsConnectorIdentityService.csbrAddEntity(entity); | 144 | mfTdsConnectorIdentityService.csbrAddEntity(entity); |
| 145 | // 发起审批流程或保存草稿 | ||
| 146 | AddApprovalDTO approvalDTO = getAddApprovalDTO(entity); | ||
| 147 | super.startWorkFlow(rqVO, approvalDTO, entity::setBizApproveState); | ||
| 116 | boolean flag = mfTdsConnectorIdentityService.save(entity); | 148 | boolean flag = mfTdsConnectorIdentityService.save(entity); |
| 117 | if (!flag) { | 149 | if (!flag) { |
| 118 | throw new CsbrSystemException(SystemError.DATA_ADD_ERROR, messageSourceUtil.addMessage(FUNCTION_NAME)); | 150 | throw new CsbrSystemException(SystemError.DATA_ADD_ERROR, messageSourceUtil.addMessage(FUNCTION_NAME)); |
| ... | @@ -121,21 +153,49 @@ public class TdsConnectorIdentityServiceImpl implements TdsConnectorIdentityServ | ... | @@ -121,21 +153,49 @@ public class TdsConnectorIdentityServiceImpl implements TdsConnectorIdentityServ |
| 121 | } | 153 | } |
| 122 | 154 | ||
| 123 | /** | 155 | /** |
| 156 | * 获取发起流程参数 | ||
| 157 | * @author xup | ||
| 158 | * @date 2024-12-30 13:43 | ||
| 159 | * @param entity | ||
| 160 | * @return com.csbr.cloud.workflow.domain.dto.appove.AddApprovalDTO | ||
| 161 | */ | ||
| 162 | private AddApprovalDTO getAddApprovalDTO(MfTdsConnectorIdentity entity) { | ||
| 163 | AddApprovalDTO approvalDTO = new AddApprovalDTO(FLOW_TYPE, entity.getGuid()); | ||
| 164 | approvalDTO.setFuncCode(SysFuncCode); | ||
| 165 | // 流程消息中的变量替换参数 | ||
| 166 | String msParam = String.format("%s,%s",bizCommonRedisUtil.getTenantName(entity.getTenantGuid()),null); | ||
| 167 | approvalDTO.setFlowMessageBody(msParam); | ||
| 168 | //设置跳转参数 | ||
| 169 | approvalDTO.setUrlParam(String.format("guid=%s&damGuid=%s&groundingGuid=%s&serviceTenantGuid=%s",entity.getGuid(),null,null,entity.getTenantGuid())); | ||
| 170 | // 流程列表数据核心param参数处理 | ||
| 171 | approvalDTO.setParam1(null); | ||
| 172 | approvalDTO.setParam2(null); | ||
| 173 | approvalDTO.setParam3(null); | ||
| 174 | approvalDTO.setParam4(null); | ||
| 175 | |||
| 176 | return approvalDTO; | ||
| 177 | } | ||
| 178 | |||
| 179 | /** | ||
| 124 | * 连接器身份信息数据修改 | 180 | * 连接器身份信息数据修改 |
| 125 | * @author xup | 181 | * @author xup |
| 126 | * @date 2025-08-20 15:13 | 182 | * @date 2025-08-20 15:13 |
| 127 | * @param rqVO | 183 | * @param flowBaseVO |
| 128 | * @return boolean | 184 | * @return boolean |
| 129 | */ | 185 | */ |
| 130 | @Transactional(rollbackFor = Exception.class) | 186 | @Transactional(rollbackFor = Exception.class) |
| 131 | @Override | 187 | @Override |
| 132 | public void updateTdsConnectorIdentity(TdsConnectorIdentityRQVO rqVO) { | 188 | public void updateTdsConnectorIdentity(FlowRQBaseVO flowBaseVO) { |
| 133 | // 将修改前数据查出来缓存下来,传入到修改后方法中,用于一些特殊逻辑处理,如某个值变化才进行 | 189 | // 将修改前数据查出来缓存下来,传入到修改后方法中,用于一些特殊逻辑处理,如某个值变化才进行 |
| 134 | // MfTdsConnectorIdentity oldEntity = mfTdsConnectorIdentityService.getById(rqVO.getGuid()); | 190 | // MfTdsConnectorIdentity oldEntity = mfTdsConnectorIdentityService.getById(rqVO.getGuid()); |
| 191 | TdsConnectorIdentityRQVO rqVO = (TdsConnectorIdentityRQVO) flowBaseVO; | ||
| 135 | MfTdsConnectorIdentity oldEntity = null; | 192 | MfTdsConnectorIdentity oldEntity = null; |
| 136 | beforeUpdate(rqVO); | 193 | beforeUpdate(rqVO); |
| 137 | MfTdsConnectorIdentity entity = convertToEntity(rqVO); | 194 | MfTdsConnectorIdentity entity = convertToEntity(rqVO); |
| 138 | mfTdsConnectorIdentityService.csbrUpdateEntity(entity); | 195 | mfTdsConnectorIdentityService.csbrUpdateEntity(entity); |
| 196 | // 发起审批流程或保存草稿 | ||
| 197 | AddApprovalDTO approvalDTO = getAddApprovalDTO(entity); | ||
| 198 | super.restartWorkFlow(rqVO,oldEntity.getBizApproveState(),approvalDTO,this::saveTdsConnectorIdentity,entity::setBizApproveState); | ||
| 139 | boolean flag = mfTdsConnectorIdentityService.updateById(entity); | 199 | boolean flag = mfTdsConnectorIdentityService.updateById(entity); |
| 140 | if (!flag) { | 200 | if (!flag) { |
| 141 | throw new CsbrSystemException(SystemError.DATA_UPDATE_ERROR, messageSourceUtil.updateMessage(FUNCTION_NAME)); | 201 | throw new CsbrSystemException(SystemError.DATA_UPDATE_ERROR, messageSourceUtil.updateMessage(FUNCTION_NAME)); |
| ... | @@ -196,6 +256,19 @@ public class TdsConnectorIdentityServiceImpl implements TdsConnectorIdentityServ | ... | @@ -196,6 +256,19 @@ public class TdsConnectorIdentityServiceImpl implements TdsConnectorIdentityServ |
| 196 | } | 256 | } |
| 197 | } | 257 | } |
| 198 | 258 | ||
| 259 | @Override | ||
| 260 | public void flowComplete(BizCallbackDTO bizApproveVO) { | ||
| 261 | MfTdsConnectorIdentity entity = mfTdsConnectorIdentityService.getById(bizApproveVO.getBizGuid()); | ||
| 262 | if (entity == null) { | ||
| 263 | throw new CsbrSystemException(SystemError.DATA_NOT_EXISTS, messageSourceUtil.notExistsToSelectMessage(FUNCTION_NAME)); | ||
| 264 | } | ||
| 265 | // 同步更新审批状态 | ||
| 266 | LambdaUpdateWrapper<MfTdsConnectorIdentity> updateWrapper = mfTdsConnectorIdentityService.csbrUpdateWrapper(MfTdsConnectorIdentity.class); | ||
| 267 | updateWrapper.set(MfTdsConnectorIdentity::getBizApproveState, bizApproveVO.getApprovalState()); | ||
| 268 | updateWrapper.eq(MfTdsConnectorIdentity::getGuid, bizApproveVO.getBizGuid()); | ||
| 269 | mfTdsConnectorIdentityService.update(updateWrapper); | ||
| 270 | } | ||
| 271 | |||
| 199 | /** | 272 | /** |
| 200 | * 连接器身份信息新新增前置处理 | 273 | * 连接器身份信息新新增前置处理 |
| 201 | * @author xup | 274 | * @author xup |
| ... | @@ -399,7 +472,16 @@ public class TdsConnectorIdentityServiceImpl implements TdsConnectorIdentityServ | ... | @@ -399,7 +472,16 @@ public class TdsConnectorIdentityServiceImpl implements TdsConnectorIdentityServ |
| 399 | * @return void | 472 | * @return void |
| 400 | */ | 473 | */ |
| 401 | private void beforeQuery(TdsConnectorIdentityQueryVO rqQueryVO) { | 474 | private void beforeQuery(TdsConnectorIdentityQueryVO rqQueryVO) { |
| 402 | 475 | rqQueryVO.setIsNeedQuery(true); | |
| 476 | if (approvalFlowUtil.isQueryBizGuid(rqQueryVO)) { | ||
| 477 | rqQueryVO.setFlowType(FLOW_TYPE); | ||
| 478 | List<String> bizGuidList = approvalFlowUtil.getApprovalCrossTenantBizGuids(rqQueryVO); | ||
| 479 | if (CollectionUtils.isEmpty(bizGuidList)) { | ||
| 480 | rqQueryVO.setIsNeedQuery(false); | ||
| 481 | } else { | ||
| 482 | rqQueryVO.setGuidList(bizGuidList); | ||
| 483 | } | ||
| 484 | } | ||
| 403 | } | 485 | } |
| 404 | 486 | ||
| 405 | /** | 487 | /** | ... | ... |
-
Please register or sign in to post a comment