可信空间连接器入住接口
Showing
10 changed files
with
1032 additions
and
0 deletions
src/main/java/com/csbr/qingcloud/portal/controller/TdsConnectorIdentityManagementController.java
0 → 100644
| 1 | package com.csbr.qingcloud.portal.controller; | ||
| 2 | |||
| 3 | import com.csbr.cloud.common.response.CommonRes; | ||
| 4 | import csbr.cloud.entity.annotation.SystemLog; | ||
| 5 | import csbr.cloud.entity.domain.base.vo.PageListVO; | ||
| 6 | import com.csbr.cloud.workflow.domain.dto.callback.BizCallbackDTO; | ||
| 7 | import com.csbr.qingcloud.portal.domain.vo.TdsConnectorIdentityManagementQueryVO; | ||
| 8 | import com.csbr.qingcloud.portal.domain.vo.TdsConnectorIdentityManagementRQVO; | ||
| 9 | import com.csbr.qingcloud.portal.domain.vo.TdsConnectorIdentityManagementRSVO; | ||
| 10 | import com.csbr.qingcloud.portal.service.TdsConnectorIdentityManagementService; | ||
| 11 | import io.swagger.v3.oas.annotations.Operation; | ||
| 12 | import io.swagger.v3.oas.annotations.Parameter; | ||
| 13 | import io.swagger.v3.oas.annotations.tags.Tag; | ||
| 14 | import jakarta.annotation.Resource; | ||
| 15 | import jakarta.validation.Valid; | ||
| 16 | import org.springframework.web.bind.annotation.*; | ||
| 17 | |||
| 18 | import java.util.List; | ||
| 19 | |||
| 20 | /** | ||
| 21 | * @program: | ||
| 22 | * @description: 连接器身份管理-控制器 | ||
| 23 | * @author: xup | ||
| 24 | * @create: 2025-09-23 17:35 | ||
| 25 | **/ | ||
| 26 | @RestController | ||
| 27 | @RequestMapping("/tds-connector-identity-management") | ||
| 28 | @Tag(name = "连接器身份管理-控制器") | ||
| 29 | public class TdsConnectorIdentityManagementController { | ||
| 30 | |||
| 31 | @Resource | ||
| 32 | private TdsConnectorIdentityManagementService tdsConnectorIdentityManagementService; | ||
| 33 | |||
| 34 | //region 基本操作 | ||
| 35 | |||
| 36 | @PostMapping("/save") | ||
| 37 | @SystemLog(value = "连接器身份管理-新增") | ||
| 38 | @Operation(summary = "连接器身份管理-新增") | ||
| 39 | public CommonRes<Boolean> saveTdsConnectorIdentityManagement(@RequestBody @Valid TdsConnectorIdentityManagementRQVO vo) { | ||
| 40 | tdsConnectorIdentityManagementService.saveTdsConnectorIdentityManagement(vo); | ||
| 41 | return CommonRes.success(true); | ||
| 42 | } | ||
| 43 | |||
| 44 | @PutMapping("/update") | ||
| 45 | @SystemLog(value = "连接器身份管理-修改") | ||
| 46 | @Operation(summary = "连接器身份管理-修改") | ||
| 47 | public CommonRes<Boolean> updateTdsConnectorIdentityManagement(@RequestBody @Valid TdsConnectorIdentityManagementRQVO vo) { | ||
| 48 | tdsConnectorIdentityManagementService.updateTdsConnectorIdentityManagement(vo); | ||
| 49 | return CommonRes.success(true); | ||
| 50 | } | ||
| 51 | |||
| 52 | @DeleteMapping("/delete") | ||
| 53 | @SystemLog(value = "连接器身份管理-批量删除") | ||
| 54 | @Operation(summary = "连接器身份管理-批量删除") | ||
| 55 | public CommonRes<Boolean> removeByGuids(@RequestBody List<String> guids) { | ||
| 56 | tdsConnectorIdentityManagementService.removeByGuids(guids); | ||
| 57 | return CommonRes.success(true); | ||
| 58 | } | ||
| 59 | |||
| 60 | @PostMapping("/page-list") | ||
| 61 | @SystemLog(value = "连接器身份管理-分页") | ||
| 62 | @Operation(summary = "连接器身份管理-分页") | ||
| 63 | public CommonRes<PageListVO<TdsConnectorIdentityManagementRSVO>> pageList(@RequestBody @Valid TdsConnectorIdentityManagementQueryVO queryVO) { | ||
| 64 | PageListVO<TdsConnectorIdentityManagementRSVO> pageVO = tdsConnectorIdentityManagementService.pageList(queryVO); | ||
| 65 | return CommonRes.success(pageVO); | ||
| 66 | } | ||
| 67 | |||
| 68 | @GetMapping("/detail") | ||
| 69 | @SystemLog(value = "连接器身份管理-详情") | ||
| 70 | @Operation( | ||
| 71 | summary = "连接器身份管理-详情", | ||
| 72 | parameters = { | ||
| 73 | @Parameter(name = "guid", description = "连接器身份管理唯一标识", required = true)} | ||
| 74 | ) | ||
| 75 | public CommonRes<TdsConnectorIdentityManagementRSVO> getTdsConnectorIdentityManagementDetail(@RequestParam String guid) { | ||
| 76 | TdsConnectorIdentityManagementRSVO vo = tdsConnectorIdentityManagementService.getTdsConnectorIdentityManagementDetail(guid); | ||
| 77 | return CommonRes.success(vo); | ||
| 78 | } | ||
| 79 | |||
| 80 | @PostMapping("/flow-call-back") | ||
| 81 | @SystemLog(value = "连接器身份管理-流程结束后进行业务回调") | ||
| 82 | @Operation(summary = "连接器身份管理-流程结束后进行业务回调", hidden = true) | ||
| 83 | public CommonRes<Boolean> flowCallBack(@RequestBody @Valid BizCallbackDTO dto) { | ||
| 84 | tdsConnectorIdentityManagementService.flowCallBack(dto); | ||
| 85 | return CommonRes.success(true); | ||
| 86 | } | ||
| 87 | |||
| 88 | //endregion | ||
| 89 | |||
| 90 | } |
src/main/java/com/csbr/qingcloud/portal/domain/vo/TdsConnectorIdentityManagementQueryVO.java
0 → 100644
| 1 | package com.csbr.qingcloud.portal.domain.vo; | ||
| 2 | |||
| 3 | import com.csbr.cloud.workflow.domain.dto.appove.FlowBizGuidQueryDTO; | ||
| 4 | import io.swagger.v3.oas.annotations.media.Schema; | ||
| 5 | import lombok.EqualsAndHashCode; | ||
| 6 | import lombok.Data; | ||
| 7 | import java.util.Date; | ||
| 8 | import java.util.List; | ||
| 9 | |||
| 10 | /** | ||
| 11 | * @program: | ||
| 12 | * @description: 连接器身份管理查询参数 | ||
| 13 | * @author: xup | ||
| 14 | * @create: 2025-09-23 17:35 | ||
| 15 | **/ | ||
| 16 | @EqualsAndHashCode(callSuper = true) | ||
| 17 | @Data | ||
| 18 | @Schema(title = "连接器身份管理查询参数") | ||
| 19 | public class TdsConnectorIdentityManagementQueryVO extends FlowBizGuidQueryDTO { | ||
| 20 | |||
| 21 | /** | ||
| 22 | * 业务审批状态【N 草稿中,A 审批中,Y 已通过,R 驳回,C 已撤销,D 已废弃】 | ||
| 23 | */ | ||
| 24 | @Schema(description = "业务审批状态【N 草稿中,A 审批中,Y 已通过,R 驳回,C 已撤销,D 已废弃】") | ||
| 25 | private String bizApproveState; | ||
| 26 | |||
| 27 | /******** 自定义扩展 *****/ | ||
| 28 | |||
| 29 | /** | ||
| 30 | * 数据唯一标识【List集合】 | ||
| 31 | */ | ||
| 32 | @Schema(description = "数据唯一标识", hidden = true) | ||
| 33 | private List<String> guidList; | ||
| 34 | |||
| 35 | /** | ||
| 36 | * 是否调用查询的判断 | ||
| 37 | */ | ||
| 38 | @Schema(description = "是否调用查询的判断", hidden = true) | ||
| 39 | private Boolean isNeedQuery; | ||
| 40 | |||
| 41 | } |
src/main/java/com/csbr/qingcloud/portal/domain/vo/TdsConnectorIdentityManagementRQVO.java
0 → 100644
| 1 | package com.csbr.qingcloud.portal.domain.vo; | ||
| 2 | |||
| 3 | import com.csbr.cloud.workflow.domain.vo.appove.FlowRQBaseVO; | ||
| 4 | import io.swagger.v3.oas.annotations.media.Schema; | ||
| 5 | import com.fasterxml.jackson.annotation.JsonFormat; | ||
| 6 | import jakarta.validation.constraints.NotBlank; | ||
| 7 | import jakarta.validation.constraints.NotNull; | ||
| 8 | import lombok.Data; | ||
| 9 | import java.util.Date; | ||
| 10 | |||
| 11 | /** | ||
| 12 | * @program: | ||
| 13 | * @description: 连接器身份管理新增、修改参数 | ||
| 14 | * @author: xup | ||
| 15 | * @create: 2025-09-23 17:35 | ||
| 16 | **/ | ||
| 17 | @Data | ||
| 18 | @Schema(title = "连接器身份管理新增、修改参数") | ||
| 19 | public class TdsConnectorIdentityManagementRQVO extends FlowRQBaseVO { | ||
| 20 | |||
| 21 | /** | ||
| 22 | * 连接器Guid | ||
| 23 | */ | ||
| 24 | @Schema(description = "连接器Guid") | ||
| 25 | @NotBlank(message = "连接器Guid为空。") | ||
| 26 | private String connectorGuid; | ||
| 27 | |||
| 28 | /** | ||
| 29 | * 使用场景(数据字典使用场景) | ||
| 30 | */ | ||
| 31 | @Schema(description = "使用场景(数据字典使用场景)") | ||
| 32 | @NotBlank(message = "使用场景为空。") | ||
| 33 | private String useScenariosCode; | ||
| 34 | |||
| 35 | /** | ||
| 36 | * 期望效期 | ||
| 37 | */ | ||
| 38 | @Schema(description = "期望效期") | ||
| 39 | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") | ||
| 40 | @NotNull(message = "期望效期为空。") | ||
| 41 | private Date expirationTime; | ||
| 42 | |||
| 43 | /** | ||
| 44 | * 申请是由 | ||
| 45 | */ | ||
| 46 | @Schema(description = "申请是由") | ||
| 47 | private String applicationReason; | ||
| 48 | |||
| 49 | /** | ||
| 50 | * Key标识私钥 | ||
| 51 | */ | ||
| 52 | @Schema(description = "Key标识私钥") | ||
| 53 | private String privatekey; | ||
| 54 | |||
| 55 | /** | ||
| 56 | * 凭证证书 | ||
| 57 | */ | ||
| 58 | @Schema(description = "凭证证书") | ||
| 59 | private String certificate; | ||
| 60 | |||
| 61 | /** | ||
| 62 | * 凭证有效期 | ||
| 63 | */ | ||
| 64 | @Schema(description = "凭证有效期") | ||
| 65 | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") | ||
| 66 | private Date voucherExpirationTime; | ||
| 67 | |||
| 68 | /** | ||
| 69 | * 业务审批状态 | ||
| 70 | */ | ||
| 71 | @Schema(description = "业务审批状态") | ||
| 72 | private String bizApproveState; | ||
| 73 | |||
| 74 | /******** 库表存储属性 需处理 *****/ | ||
| 75 | |||
| 76 | /******** 自定义扩展 *****/ | ||
| 77 | |||
| 78 | /******** 子对象 *****/ | ||
| 79 | |||
| 80 | } |
src/main/java/com/csbr/qingcloud/portal/domain/vo/TdsConnectorIdentityManagementRSVO.java
0 → 100644
| 1 | package com.csbr.qingcloud.portal.domain.vo; | ||
| 2 | |||
| 3 | import io.swagger.v3.oas.annotations.media.Schema; | ||
| 4 | import com.fasterxml.jackson.annotation.JsonFormat; | ||
| 5 | import lombok.Data; | ||
| 6 | import com.csbr.cloud.workflow.domain.vo.appove.BizApproveVO; | ||
| 7 | import java.util.Date; | ||
| 8 | |||
| 9 | /** | ||
| 10 | * @program: | ||
| 11 | * @description: 连接器身份管理返回参数 | ||
| 12 | * @author: xup | ||
| 13 | * @create: 2025-09-23 17:35 | ||
| 14 | **/ | ||
| 15 | @Data | ||
| 16 | @Schema(title = "连接器身份管理返回参数") | ||
| 17 | public class TdsConnectorIdentityManagementRSVO { | ||
| 18 | |||
| 19 | /** | ||
| 20 | * 系统唯一标识 | ||
| 21 | */ | ||
| 22 | @Schema(description = "系统唯一标识") | ||
| 23 | private String guid; | ||
| 24 | |||
| 25 | /** | ||
| 26 | * 专区Guid | ||
| 27 | */ | ||
| 28 | @Schema(description = "专区Guid") | ||
| 29 | private String zqGuid; | ||
| 30 | |||
| 31 | /** | ||
| 32 | * 使用场景(数据字典使用场景) | ||
| 33 | */ | ||
| 34 | @Schema(description = "使用场景(数据字典使用场景)") | ||
| 35 | private String useScenariosCode; | ||
| 36 | |||
| 37 | /** | ||
| 38 | * 期望效期 | ||
| 39 | */ | ||
| 40 | @Schema(description = "期望效期") | ||
| 41 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") | ||
| 42 | private Date expirationTime; | ||
| 43 | |||
| 44 | /** | ||
| 45 | * 申请是由 | ||
| 46 | */ | ||
| 47 | @Schema(description = "申请是由") | ||
| 48 | private String applicationReason; | ||
| 49 | |||
| 50 | /** | ||
| 51 | * Key标识私钥 | ||
| 52 | */ | ||
| 53 | @Schema(description = "Key标识私钥") | ||
| 54 | private String privatekey; | ||
| 55 | |||
| 56 | /** | ||
| 57 | * 凭证证书 | ||
| 58 | */ | ||
| 59 | @Schema(description = "凭证证书") | ||
| 60 | private String certificate; | ||
| 61 | |||
| 62 | /** | ||
| 63 | * 凭证有效期 | ||
| 64 | */ | ||
| 65 | @Schema(description = "凭证有效期") | ||
| 66 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") | ||
| 67 | private Date voucherExpirationTime; | ||
| 68 | |||
| 69 | /** | ||
| 70 | * 业务审批状态 | ||
| 71 | */ | ||
| 72 | @Schema(description = "业务审批状态") | ||
| 73 | private String bizApproveState; | ||
| 74 | |||
| 75 | /******** 库表存储属性 需处理 *****/ | ||
| 76 | |||
| 77 | /******** 自定义扩展 *****/ | ||
| 78 | |||
| 79 | /** | ||
| 80 | * 审批信息 | ||
| 81 | */ | ||
| 82 | @Schema(description = "审批信息") | ||
| 83 | private BizApproveVO approveVO; | ||
| 84 | |||
| 85 | /******** 子对象 *****/ | ||
| 86 | |||
| 87 | } |
src/main/java/com/csbr/qingcloud/portal/mybatis/entity/MfTdsConnectorIdentityManagement.java
0 → 100644
| 1 | package com.csbr.qingcloud.portal.mybatis.entity; | ||
| 2 | |||
| 3 | import csbr.cloud.entity.domain.base.dao.BaseDO; | ||
| 4 | import jdk.jfr.Name; | ||
| 5 | import lombok.Data; | ||
| 6 | import lombok.EqualsAndHashCode; | ||
| 7 | import lombok.experimental.Accessors; | ||
| 8 | import java.util.Date; | ||
| 9 | |||
| 10 | /** | ||
| 11 | * @program: | ||
| 12 | * @description: 连接器身份管理实体 | ||
| 13 | * @author: xup | ||
| 14 | * @create: 2025-09-23 17:35 | ||
| 15 | **/ | ||
| 16 | @Data | ||
| 17 | @EqualsAndHashCode(callSuper = true) | ||
| 18 | @Accessors(chain = true) | ||
| 19 | @Name("连接器身份管理") | ||
| 20 | public class MfTdsConnectorIdentityManagement extends BaseDO { | ||
| 21 | |||
| 22 | /** | ||
| 23 | * 专区Guid | ||
| 24 | */ | ||
| 25 | @Name("专区Guid") | ||
| 26 | private String zqGuid; | ||
| 27 | |||
| 28 | /** | ||
| 29 | * 使用场景(数据字典使用场景) | ||
| 30 | */ | ||
| 31 | @Name("使用场景(数据字典使用场景)") | ||
| 32 | private String useScenariosCode; | ||
| 33 | |||
| 34 | /** | ||
| 35 | * 期望效期 | ||
| 36 | */ | ||
| 37 | @Name("期望效期") | ||
| 38 | private Date expirationTime; | ||
| 39 | |||
| 40 | /** | ||
| 41 | * 申请是由 | ||
| 42 | */ | ||
| 43 | @Name("申请是由") | ||
| 44 | private String applicationReason; | ||
| 45 | |||
| 46 | /** | ||
| 47 | * Key标识私钥 | ||
| 48 | */ | ||
| 49 | @Name("Key标识私钥") | ||
| 50 | private String privatekey; | ||
| 51 | |||
| 52 | /** | ||
| 53 | * 凭证证书 | ||
| 54 | */ | ||
| 55 | @Name("凭证证书") | ||
| 56 | private String certificate; | ||
| 57 | |||
| 58 | /** | ||
| 59 | * 凭证有效期 | ||
| 60 | */ | ||
| 61 | @Name("凭证有效期") | ||
| 62 | private Date voucherExpirationTime; | ||
| 63 | |||
| 64 | /** | ||
| 65 | * 业务审批状态 | ||
| 66 | */ | ||
| 67 | @Name("业务审批状态") | ||
| 68 | private String bizApproveState; | ||
| 69 | |||
| 70 | } |
src/main/java/com/csbr/qingcloud/portal/mybatis/mapper/MfTdsConnectorIdentityManagementMapper.java
0 → 100644
| 1 | package com.csbr.qingcloud.portal.mybatis.mapper; | ||
| 2 | |||
| 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ||
| 4 | import org.apache.ibatis.annotations.Mapper; | ||
| 5 | import com.csbr.qingcloud.portal.mybatis.entity.MfTdsConnectorIdentityManagement; | ||
| 6 | |||
| 7 | /** | ||
| 8 | * @program: | ||
| 9 | * @description: 连接器身份管理 Mapper 接口 | ||
| 10 | * @author: xup | ||
| 11 | * @create: 2025-09-23 17:35 | ||
| 12 | **/ | ||
| 13 | @Mapper | ||
| 14 | public interface MfTdsConnectorIdentityManagementMapper extends BaseMapper<MfTdsConnectorIdentityManagement> { | ||
| 15 | |||
| 16 | } |
src/main/java/com/csbr/qingcloud/portal/mybatis/service/MfTdsConnectorIdentityManagementService.java
0 → 100644
| 1 | package com.csbr.qingcloud.portal.mybatis.service; | ||
| 2 | |||
| 3 | import com.csbr.cloud.base.service.CsbrService; | ||
| 4 | import com.csbr.qingcloud.portal.mybatis.entity.MfTdsConnectorIdentityManagement; | ||
| 5 | |||
| 6 | /** | ||
| 7 | * @program: | ||
| 8 | * @description: 连接器身份管理逻辑层接口 | ||
| 9 | * @author: xup | ||
| 10 | * @create: 2025-09-23 17:35 | ||
| 11 | **/ | ||
| 12 | public interface MfTdsConnectorIdentityManagementService extends CsbrService<MfTdsConnectorIdentityManagement> { | ||
| 13 | |||
| 14 | } |
| 1 | package com.csbr.qingcloud.portal.mybatis.service.impl; | ||
| 2 | |||
| 3 | import com.csbr.cloud.mybatis.service.impl.CsbrServiceImpl; | ||
| 4 | import com.csbr.qingcloud.portal.mybatis.mapper.MfTdsConnectorIdentityManagementMapper; | ||
| 5 | import com.csbr.qingcloud.portal.mybatis.entity.MfTdsConnectorIdentityManagement; | ||
| 6 | import com.csbr.qingcloud.portal.mybatis.service.MfTdsConnectorIdentityManagementService; | ||
| 7 | import jakarta.annotation.Resource; | ||
| 8 | import org.springframework.stereotype.Service; | ||
| 9 | |||
| 10 | /** | ||
| 11 | * @program: | ||
| 12 | * @description: 连接器身份管理逻辑层接口实现 | ||
| 13 | * @author: xup | ||
| 14 | * @create: 2025-09-23 17:35 | ||
| 15 | **/ | ||
| 16 | @Service | ||
| 17 | public class MfTdsConnectorIdentityManagementServiceImpl extends CsbrServiceImpl<MfTdsConnectorIdentityManagementMapper, MfTdsConnectorIdentityManagement> implements MfTdsConnectorIdentityManagementService { | ||
| 18 | |||
| 19 | @Resource | ||
| 20 | private MfTdsConnectorIdentityManagementMapper mfTdsConnectorIdentityManagementMapper; | ||
| 21 | |||
| 22 | } |
src/main/java/com/csbr/qingcloud/portal/service/TdsConnectorIdentityManagementService.java
0 → 100644
| 1 | package com.csbr.qingcloud.portal.service; | ||
| 2 | |||
| 3 | import csbr.cloud.entity.domain.base.vo.PageListVO; | ||
| 4 | import com.csbr.cloud.workflow.domain.dto.callback.BizCallbackDTO; | ||
| 5 | import com.csbr.cloud.workflow.domain.vo.appove.FlowRQBaseVO; | ||
| 6 | import com.csbr.qingcloud.portal.domain.vo.TdsConnectorIdentityManagementQueryVO; | ||
| 7 | import com.csbr.qingcloud.portal.domain.vo.TdsConnectorIdentityManagementRSVO; | ||
| 8 | |||
| 9 | import java.util.List; | ||
| 10 | |||
| 11 | /** | ||
| 12 | * @program: | ||
| 13 | * @description: 连接器身份管理业务逻辑接口 | ||
| 14 | * @author: xup | ||
| 15 | * @create: 2025-09-23 17:35 | ||
| 16 | **/ | ||
| 17 | public interface TdsConnectorIdentityManagementService { | ||
| 18 | |||
| 19 | /** | ||
| 20 | * 连接器身份管理分页查询 | ||
| 21 | * @author xup | ||
| 22 | * @date 2025-09-23 17:35 | ||
| 23 | * @param queryVO | ||
| 24 | * @return com.csbr.cloud.mybatis.entity.PageListVO<com.csbr.qingcloud.portal.domain.vo.TdsConnectorIdentityManagementRSVO> | ||
| 25 | */ | ||
| 26 | PageListVO<TdsConnectorIdentityManagementRSVO> pageList(TdsConnectorIdentityManagementQueryVO queryVO); | ||
| 27 | |||
| 28 | /** | ||
| 29 | * 连接器身份管理获取详情数据 | ||
| 30 | * @author xup | ||
| 31 | * @date 2025-09-23 17:35 | ||
| 32 | * @param guid | ||
| 33 | * @return com.csbr.qingcloud.portal.domain.vo.TdsConnectorIdentityManagementRSVO | ||
| 34 | */ | ||
| 35 | TdsConnectorIdentityManagementRSVO getTdsConnectorIdentityManagementDetail(String guid); | ||
| 36 | |||
| 37 | /** | ||
| 38 | * 连接器身份管理数据新增 | ||
| 39 | * @author xup | ||
| 40 | * @date 2025-09-23 17:35 | ||
| 41 | * @param flowBaseVO | ||
| 42 | * @return void | ||
| 43 | */ | ||
| 44 | void saveTdsConnectorIdentityManagement(FlowRQBaseVO flowBaseVO); | ||
| 45 | |||
| 46 | /** | ||
| 47 | * 连接器身份管理数据修改 | ||
| 48 | * @author xup | ||
| 49 | * @date 2025-09-23 17:35 | ||
| 50 | * @param flowBaseVO | ||
| 51 | * @return void | ||
| 52 | */ | ||
| 53 | void updateTdsConnectorIdentityManagement(FlowRQBaseVO flowBaseVO); | ||
| 54 | |||
| 55 | /** | ||
| 56 | * 连接器身份管理数据删除、并有相关的处理操作 | ||
| 57 | * @author xup | ||
| 58 | * @date 2025-09-23 17:35 | ||
| 59 | * @param guids | ||
| 60 | * @return void | ||
| 61 | */ | ||
| 62 | void removeByGuids(List<String> guids); | ||
| 63 | |||
| 64 | /** | ||
| 65 | * 流程结束后进行业务回调 | ||
| 66 | * @author xup | ||
| 67 | * @date 2025-09-23 17:35 | ||
| 68 | * @param dto | ||
| 69 | * @return void | ||
| 70 | */ | ||
| 71 | void flowCallBack(BizCallbackDTO dto); | ||
| 72 | |||
| 73 | } |
src/main/java/com/csbr/qingcloud/portal/service/impl/TdsConnectorIdentityManagementServiceImpl.java
0 → 100644
| 1 | package com.csbr.qingcloud.portal.service.impl; | ||
| 2 | |||
| 3 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | ||
| 4 | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; | ||
| 5 | import com.csbr.cloud.common.enums.SystemError; | ||
| 6 | import com.csbr.cloud.common.enums.WorkFlowBizEnum; | ||
| 7 | import csbr.cloud.entity.enums.ApprovalStateEnum; | ||
| 8 | import com.csbr.cloud.common.exception.CsbrSystemException; | ||
| 9 | import com.csbr.cloud.common.util.CommonUtil; | ||
| 10 | import com.csbr.cloud.common.util.CsbrBeanUtil; | ||
| 11 | import com.csbr.cloud.workflow.util.ApprovalFlowUtil; | ||
| 12 | import com.csbr.cloud.workflow.util.FlowAbstractImpl; | ||
| 13 | import com.csbr.cloud.common.util.MessageSourceUtil; | ||
| 14 | import csbr.cloud.entity.domain.base.vo.PageListVO; | ||
| 15 | import com.csbr.cloud.workflow.domain.vo.appove.FlowRQBaseVO; | ||
| 16 | import com.csbr.cloud.workflow.domain.vo.appove.BizApproveVO; | ||
| 17 | import com.csbr.cloud.workflow.domain.dto.appove.AddApprovalDTO; | ||
| 18 | import com.csbr.cloud.workflow.domain.dto.callback.BizCallbackDTO; | ||
| 19 | import com.csbr.qingcloud.portal.domain.vo.TdsConnectorIdentityManagementQueryVO; | ||
| 20 | import com.csbr.qingcloud.portal.domain.vo.TdsConnectorIdentityManagementRQVO; | ||
| 21 | import com.csbr.qingcloud.portal.domain.vo.TdsConnectorIdentityManagementRSVO; | ||
| 22 | import com.csbr.qingcloud.portal.mybatis.entity.MfTdsConnectorIdentityManagement; | ||
| 23 | import com.csbr.qingcloud.portal.mybatis.service.MfTdsConnectorIdentityManagementService; | ||
| 24 | import com.csbr.qingcloud.portal.service.TdsConnectorIdentityManagementService; | ||
| 25 | import jakarta.annotation.Resource; | ||
| 26 | import lombok.extern.slf4j.Slf4j; | ||
| 27 | import org.apache.commons.collections.CollectionUtils; | ||
| 28 | import org.apache.commons.lang3.StringUtils; | ||
| 29 | import org.springframework.stereotype.Service; | ||
| 30 | import io.seata.spring.annotation.GlobalTransactional; | ||
| 31 | import org.springframework.transaction.annotation.Transactional; | ||
| 32 | |||
| 33 | import java.util.*; | ||
| 34 | |||
| 35 | /** | ||
| 36 | * @program: | ||
| 37 | * @description: 连接器身份管理业务逻辑实现 | ||
| 38 | * @author: xup | ||
| 39 | * @create: 2025-09-23 17:35 | ||
| 40 | **/ | ||
| 41 | @Slf4j | ||
| 42 | @Service | ||
| 43 | public class TdsConnectorIdentityManagementServiceImpl extends FlowAbstractImpl implements TdsConnectorIdentityManagementService { | ||
| 44 | |||
| 45 | /** | ||
| 46 | * 功能名称 | ||
| 47 | */ | ||
| 48 | private static final String FUNCTION_NAME = "连接器身份管理"; | ||
| 49 | |||
| 50 | /** | ||
| 51 | * 流程类型 | ||
| 52 | */ | ||
| 53 | private static final String FLOW_TYPE = WorkFlowBizEnum.TDS_NODE_CONNECTOR_IDENTITY.getValue(); | ||
| 54 | |||
| 55 | private static final String SysFuncCode = "TDS_NODE_CONNECTOR_IDENTITY"; | ||
| 56 | |||
| 57 | @Resource | ||
| 58 | private MfTdsConnectorIdentityManagementService mfTdsConnectorIdentityManagementService; | ||
| 59 | |||
| 60 | @Resource | ||
| 61 | private CsbrBeanUtil csbrBeanUtil; | ||
| 62 | |||
| 63 | @Resource | ||
| 64 | private ApprovalFlowUtil approvalFlowUtil; | ||
| 65 | |||
| 66 | @Resource | ||
| 67 | private MessageSourceUtil messageSourceUtil; | ||
| 68 | |||
| 69 | /** | ||
| 70 | * 连接器身份管理分页查询 | ||
| 71 | * @author xup | ||
| 72 | * @date 2025-09-23 17:35 | ||
| 73 | * @param queryVO | ||
| 74 | * @return com.csbr.cloud.mybatis.entity.PageListVO<com.csbr.qingcloud.portal.domain.vo.TdsConnectorIdentityManagementRSVO> | ||
| 75 | */ | ||
| 76 | @Override | ||
| 77 | public PageListVO<TdsConnectorIdentityManagementRSVO> pageList(TdsConnectorIdentityManagementQueryVO queryVO) { | ||
| 78 | beforeQuery(queryVO); | ||
| 79 | if (queryVO.getIsNeedQuery()) { | ||
| 80 | LambdaQueryWrapper<MfTdsConnectorIdentityManagement> queryWrapper = mfTdsConnectorIdentityManagementService.csbrQueryWrapper(queryVO, MfTdsConnectorIdentityManagement.class); | ||
| 81 | queryWrapper.in(CollectionUtils.isNotEmpty(queryVO.getGuidList()), MfTdsConnectorIdentityManagement::getGuid, | ||
| 82 | queryVO.getGuidList()); | ||
| 83 | queryWrapper.orderByDesc(MfTdsConnectorIdentityManagement::getCreateTime); | ||
| 84 | PageListVO<MfTdsConnectorIdentityManagement> pageList = mfTdsConnectorIdentityManagementService.csbrPageList(queryVO, queryWrapper); | ||
| 85 | PageListVO<TdsConnectorIdentityManagementRSVO> rsPageList = csbrBeanUtil.convert(pageList, PageListVO.class); | ||
| 86 | afterQuery(pageList, rsPageList); | ||
| 87 | return rsPageList; | ||
| 88 | } | ||
| 89 | return new PageListVO<>(); | ||
| 90 | } | ||
| 91 | |||
| 92 | /** | ||
| 93 | * 连接器身份管理获取详情数据 | ||
| 94 | * @author xup | ||
| 95 | * @date 2025-09-23 17:35 | ||
| 96 | * @param guid | ||
| 97 | * @return com.csbr.qingcloud.portal.domain.vo.TdsConnectorIdentityManagementRSVO | ||
| 98 | */ | ||
| 99 | @Override | ||
| 100 | public TdsConnectorIdentityManagementRSVO getTdsConnectorIdentityManagementDetail(String guid) { | ||
| 101 | if (StringUtils.isBlank(guid)) { | ||
| 102 | // W00012 = {0}:参数[{1}]不能为空! | ||
| 103 | throw new CsbrSystemException(SystemError.DATA_INPUT_ERROR, messageSourceUtil.getMessage("W00010", | ||
| 104 | String.format("获取%s详情数据", FUNCTION_NAME), "数据唯一标识")); | ||
| 105 | } | ||
| 106 | MfTdsConnectorIdentityManagement entity = mfTdsConnectorIdentityManagementService.getById(guid); | ||
| 107 | if (entity == null) { | ||
| 108 | throw new CsbrSystemException(SystemError.DATA_NOT_EXISTS, messageSourceUtil.notExistsToSelectMessage(String.format("获取%s详情数据", FUNCTION_NAME))); | ||
| 109 | } | ||
| 110 | return convertToVO(entity, true); | ||
| 111 | } | ||
| 112 | |||
| 113 | /** | ||
| 114 | * 连接器身份管理数据新增 | ||
| 115 | * @author xup | ||
| 116 | * @date 2025-09-23 17:35 | ||
| 117 | * @param flowBaseVO | ||
| 118 | * @return void | ||
| 119 | */ | ||
| 120 | @GlobalTransactional(rollbackFor = Exception.class) | ||
| 121 | @Transactional(rollbackFor = Exception.class) | ||
| 122 | @Override | ||
| 123 | public void saveTdsConnectorIdentityManagement(FlowRQBaseVO flowBaseVO) { | ||
| 124 | TdsConnectorIdentityManagementRQVO rqVO = (TdsConnectorIdentityManagementRQVO) flowBaseVO; | ||
| 125 | beforeSave(rqVO); | ||
| 126 | MfTdsConnectorIdentityManagement entity = convertToEntity(rqVO); | ||
| 127 | // 发起审批流程或保存草稿 | ||
| 128 | AddApprovalDTO approvalDTO = getAddApprovalDTO(entity); | ||
| 129 | super.startWorkFlow(rqVO, approvalDTO, entity::setBizApproveState); | ||
| 130 | // 业务数据保存 | ||
| 131 | boolean flag = mfTdsConnectorIdentityManagementService.save(entity); | ||
| 132 | if (!flag) { | ||
| 133 | throw new CsbrSystemException(SystemError.DATA_ADD_ERROR, rqVO.getImmediateApprove() ? | ||
| 134 | messageSourceUtil.submitMessage(FUNCTION_NAME) : messageSourceUtil.addMessage(FUNCTION_NAME)); | ||
| 135 | } | ||
| 136 | afterSave(entity, rqVO); | ||
| 137 | } | ||
| 138 | |||
| 139 | /** | ||
| 140 | * 连接器身份管理数据修改 | ||
| 141 | * @author xup | ||
| 142 | * @date 2025-09-23 17:35 | ||
| 143 | * @param flowBaseVO | ||
| 144 | * @return void | ||
| 145 | */ | ||
| 146 | @GlobalTransactional(rollbackFor = Exception.class) | ||
| 147 | @Transactional(rollbackFor = Exception.class) | ||
| 148 | @Override | ||
| 149 | public void updateTdsConnectorIdentityManagement(FlowRQBaseVO flowBaseVO) { | ||
| 150 | TdsConnectorIdentityManagementRQVO rqVO = (TdsConnectorIdentityManagementRQVO) flowBaseVO; | ||
| 151 | // 将修改前数据查出来缓存下来,传入到修改后方法中,用于一些特殊逻辑处理,如某个值变化才进行 | ||
| 152 | // MfTdsConnectorIdentityManagement oldEntity = mfTdsConnectorIdentityManagementService.getById(rqVO.getGuid()); | ||
| 153 | beforeUpdate(rqVO); | ||
| 154 | MfTdsConnectorIdentityManagement entity = convertToEntity(rqVO); | ||
| 155 | // 发起审批流程或保存草稿 | ||
| 156 | AddApprovalDTO approvalDTO = getAddApprovalDTO(entity); | ||
| 157 | super.startOrRestartWorkFlow(rqVO, rqVO.getBizApproveState(), approvalDTO, entity::setBizApproveState); | ||
| 158 | if (rqVO.getIsRestart()) { | ||
| 159 | // 重新提交 | ||
| 160 | againSubmitFlow(entity, rqVO, approvalDTO); | ||
| 161 | } else { | ||
| 162 | // 修改业务数据 | ||
| 163 | boolean flag = mfTdsConnectorIdentityManagementService.updateById(entity); | ||
| 164 | if (!flag) { | ||
| 165 | throw new CsbrSystemException(SystemError.DATA_UPDATE_ERROR, rqVO.getImmediateApprove() ? | ||
| 166 | messageSourceUtil.submitMessage(FUNCTION_NAME) : messageSourceUtil.updateMessage(FUNCTION_NAME)); | ||
| 167 | } | ||
| 168 | afterUpdate(entity, rqVO); | ||
| 169 | } | ||
| 170 | } | ||
| 171 | |||
| 172 | /** | ||
| 173 | * 重新提交连接器身份管理 | ||
| 174 | * @author xup | ||
| 175 | * @date 2025-09-23 17:35 | ||
| 176 | * @param entity | ||
| 177 | * @param rqVO | ||
| 178 | * @param approvalDTO | ||
| 179 | * @return void | ||
| 180 | */ | ||
| 181 | private void againSubmitFlow(MfTdsConnectorIdentityManagement entity, TdsConnectorIdentityManagementRQVO rqVO, AddApprovalDTO approvalDTO) { | ||
| 182 | // 重新提交的数据重置相关字段 | ||
| 183 | entity.setGuid(CommonUtil.newGuid()); | ||
| 184 | entity.setBizApproveState(ApprovalStateEnum.CHECKING.getValue()); | ||
| 185 | mfTdsConnectorIdentityManagementService.csbrBaseEntity(entity); | ||
| 186 | // 保存新数据 | ||
| 187 | boolean flag = mfTdsConnectorIdentityManagementService.save(entity); | ||
| 188 | if (!flag) { | ||
| 189 | throw new CsbrSystemException(SystemError.DATA_ADD_ERROR, messageSourceUtil.addMessage(String.format("重新提交%s",FUNCTION_NAME))); | ||
| 190 | } | ||
| 191 | // 发起新的流程 | ||
| 192 | approvalDTO.setBizGuid(entity.getGuid()); | ||
| 193 | approvalFlowUtil.addApproval(approvalDTO); | ||
| 194 | afterSave(entity, rqVO); | ||
| 195 | } | ||
| 196 | |||
| 197 | /** | ||
| 198 | * 连接器身份管理数据删除、并有相关的处理操作 | ||
| 199 | * @author xup | ||
| 200 | * @date 2025-09-23 17:35 | ||
| 201 | * @param guids | ||
| 202 | * @return void | ||
| 203 | */ | ||
| 204 | @GlobalTransactional(rollbackFor = Exception.class) | ||
| 205 | @Transactional(rollbackFor = Exception.class) | ||
| 206 | @Override | ||
| 207 | public void removeByGuids(List<String> guids) { | ||
| 208 | if (CollectionUtils.isEmpty(guids)) { | ||
| 209 | // W00012 = {0}:参数[{1}]不能为空! | ||
| 210 | throw new CsbrSystemException(SystemError.DATA_INPUT_ERROR, messageSourceUtil.getMessage("W00012", | ||
| 211 | String.format("删除%s数据", FUNCTION_NAME), "数据唯一标识")); | ||
| 212 | } | ||
| 213 | for (String guid : guids) { | ||
| 214 | MfTdsConnectorIdentityManagement entity = mfTdsConnectorIdentityManagementService.getById(guid); | ||
| 215 | beforeRemove(entity); | ||
| 216 | boolean flag = mfTdsConnectorIdentityManagementService.removeById(guid); | ||
| 217 | if (!flag) { | ||
| 218 | throw new CsbrSystemException(SystemError.DATA_DEL_ERROR, messageSourceUtil.delMessage(FUNCTION_NAME)); | ||
| 219 | } | ||
| 220 | afterRemove(entity); | ||
| 221 | } | ||
| 222 | // 删除流程数据 | ||
| 223 | approvalFlowUtil.removeApproveByBizGuids(guids); | ||
| 224 | } | ||
| 225 | |||
| 226 | /** | ||
| 227 | * 流程结束后进行业务回调 | ||
| 228 | * @author xup | ||
| 229 | * @date 2025-09-23 17:35 | ||
| 230 | * @param dto | ||
| 231 | * @return void | ||
| 232 | */ | ||
| 233 | @Transactional(rollbackFor = Exception.class) | ||
| 234 | @Override | ||
| 235 | public void flowCallBack(BizCallbackDTO dto) { | ||
| 236 | MfTdsConnectorIdentityManagement entity = mfTdsConnectorIdentityManagementService.getById(dto.getBizGuid()); | ||
| 237 | if (entity == null) { | ||
| 238 | throw new CsbrSystemException(SystemError.DATA_NOT_EXISTS, messageSourceUtil.notExistsToSelectMessage(FUNCTION_NAME)); | ||
| 239 | } | ||
| 240 | if (ApprovalStateEnum.PASSED.getValue().equals(dto.getApprovalState())) { | ||
| 241 | // todo | ||
| 242 | } | ||
| 243 | // 同步更新审批状态 | ||
| 244 | LambdaUpdateWrapper<MfTdsConnectorIdentityManagement> updateWrapper = mfTdsConnectorIdentityManagementService.csbrUpdateWrapper(MfTdsConnectorIdentityManagement.class); | ||
| 245 | updateWrapper.set(MfTdsConnectorIdentityManagement::getBizApproveState, dto.getApprovalState()); | ||
| 246 | updateWrapper.eq(MfTdsConnectorIdentityManagement::getGuid, dto.getBizGuid()); | ||
| 247 | boolean flag = mfTdsConnectorIdentityManagementService.update(updateWrapper); | ||
| 248 | if (!flag) { | ||
| 249 | throw new CsbrSystemException(SystemError.DATA_UPDATE_ERROR, messageSourceUtil.updateMessage(String.format("%s的业务审批状态", FUNCTION_NAME))); | ||
| 250 | } | ||
| 251 | } | ||
| 252 | |||
| 253 | /** | ||
| 254 | * 获取发起流程参数 | ||
| 255 | * @author xup | ||
| 256 | * @date 2025-09-23 17:35 | ||
| 257 | * @param entity | ||
| 258 | * @return com.csbr.cloud.workflow.domain.dto.appove.AddApprovalDTO | ||
| 259 | */ | ||
| 260 | private AddApprovalDTO getAddApprovalDTO(MfTdsConnectorIdentityManagement entity) { | ||
| 261 | AddApprovalDTO approvalDTO = new AddApprovalDTO(FLOW_TYPE, entity.getGuid()); | ||
| 262 | // todo | ||
| 263 | approvalDTO.setFuncCode(SysFuncCode); | ||
| 264 | // 流程消息中的变量替换参数 | ||
| 265 | approvalDTO.setFlowMessageBody(null); | ||
| 266 | // 流程列表数据核心param参数处理 | ||
| 267 | approvalDTO.setParam1(null); | ||
| 268 | approvalDTO.setParam2(null); | ||
| 269 | approvalDTO.setParam3(null); | ||
| 270 | approvalDTO.setParam4(null); | ||
| 271 | |||
| 272 | return approvalDTO; | ||
| 273 | } | ||
| 274 | |||
| 275 | /** | ||
| 276 | * 连接器身份管理新新增前置处理 | ||
| 277 | * @author xup | ||
| 278 | * @date 2025-09-23 17:35 | ||
| 279 | * @param rqVO | ||
| 280 | * @return void | ||
| 281 | */ | ||
| 282 | private void beforeSave(TdsConnectorIdentityManagementRQVO rqVO) { | ||
| 283 | //region 1.输入基础验证 | ||
| 284 | //endregion | ||
| 285 | |||
| 286 | //region 2.数据验证特殊处理 | ||
| 287 | //region 2.1.业务合规性验证 | ||
| 288 | //endregion 2.1.业务合规性验证 | ||
| 289 | |||
| 290 | //region 2.2.业务数据验证 | ||
| 291 | //endregion 2.2.业务数据验证 | ||
| 292 | |||
| 293 | //endregion 2.数据验证特殊处理 | ||
| 294 | |||
| 295 | //region 3.数据转换处理 | ||
| 296 | |||
| 297 | //region 3.1.数据过程转换 | ||
| 298 | //endregion 3.1.数据过程转换 | ||
| 299 | |||
| 300 | //endregion 3.数据转换处理 | ||
| 301 | |||
| 302 | //region 4.数据过滤与补充处理 | ||
| 303 | |||
| 304 | //endregion 4.数据过滤与补充处理 | ||
| 305 | |||
| 306 | //region 5.过程处理 | ||
| 307 | |||
| 308 | //region 5.1.计算逻辑处理 | ||
| 309 | //endregion 5.1.计算逻辑处理 | ||
| 310 | |||
| 311 | //region 5.2.业务逻辑处理 | ||
| 312 | //endregion 5.2.业务逻辑处理 | ||
| 313 | |||
| 314 | //endregion 5.过程处理 | ||
| 315 | } | ||
| 316 | |||
| 317 | /** | ||
| 318 | * 连接器身份管理新增后置处理 | ||
| 319 | * @author xup | ||
| 320 | * @date 2025-09-23 17:35 | ||
| 321 | * @param entity | ||
| 322 | * @param rqVO | ||
| 323 | * @return void | ||
| 324 | */ | ||
| 325 | private void afterSave(MfTdsConnectorIdentityManagement entity, TdsConnectorIdentityManagementRQVO rqVO) { | ||
| 326 | //region 1.输出特殊转换 | ||
| 327 | |||
| 328 | //region 1.1.输出过滤与补充处理 | ||
| 329 | //endregion 1.1.输出过滤与补充处理 | ||
| 330 | |||
| 331 | //endregion 1.输出特殊转换 | ||
| 332 | } | ||
| 333 | |||
| 334 | /** | ||
| 335 | * 连接器身份管理修改前置校验、处理 | ||
| 336 | * @author xup | ||
| 337 | * @date 2025-09-23 17:35 | ||
| 338 | * @param rqVO | ||
| 339 | * @return void | ||
| 340 | */ | ||
| 341 | private void beforeUpdate(TdsConnectorIdentityManagementRQVO rqVO) { | ||
| 342 | //region 1.输入基础验证 | ||
| 343 | if (StringUtils.isBlank(rqVO.getGuid())) { | ||
| 344 | // W00012 = {0}:参数[{1}]不能为空! | ||
| 345 | throw new CsbrSystemException(SystemError.DATA_INPUT_ERROR, messageSourceUtil.getMessage("W00010", String.format("修改%s数据",FUNCTION_NAME), "数据唯一标识")); | ||
| 346 | } | ||
| 347 | //endregion | ||
| 348 | |||
| 349 | //region 2.数据验证特殊处理 | ||
| 350 | //region 2.1.业务合规性验证 | ||
| 351 | //endregion 2.1.业务合规性验证 | ||
| 352 | |||
| 353 | //region 2.2.业务数据验证 | ||
| 354 | LambdaQueryWrapper<MfTdsConnectorIdentityManagement> queryWrapper = new LambdaQueryWrapper<>(); | ||
| 355 | queryWrapper.eq(MfTdsConnectorIdentityManagement::getGuid, rqVO.getGuid()); | ||
| 356 | queryWrapper.select(MfTdsConnectorIdentityManagement::getGuid, MfTdsConnectorIdentityManagement::getBizApproveState); | ||
| 357 | MfTdsConnectorIdentityManagement entity = mfTdsConnectorIdentityManagementService.getOne(queryWrapper); | ||
| 358 | if (entity == null) { | ||
| 359 | throw new CsbrSystemException(SystemError.DATA_NOT_EXISTS, messageSourceUtil.notExistsToUpdateMessage(FUNCTION_NAME)); | ||
| 360 | } | ||
| 361 | //endregion 2.2.业务数据验证 | ||
| 362 | |||
| 363 | //endregion 2.数据验证特殊处理 | ||
| 364 | |||
| 365 | //region 3.数据转换处理 | ||
| 366 | |||
| 367 | //region 3.1.数据过程转换 | ||
| 368 | rqVO.setBizApproveState(entity.getBizApproveState()); | ||
| 369 | //endregion 3.1.数据过程转换 | ||
| 370 | |||
| 371 | //endregion 3.数据转换处理 | ||
| 372 | |||
| 373 | //region 4.数据过滤与补充处理 | ||
| 374 | //endregion 4.数据过滤与补充处理 | ||
| 375 | |||
| 376 | //region 5.过程处理 | ||
| 377 | |||
| 378 | //region 5.1.计算逻辑处理 | ||
| 379 | //endregion 5.1.计算逻辑处理 | ||
| 380 | |||
| 381 | //region 5.2.业务逻辑处理 | ||
| 382 | //endregion 5.2.业务逻辑处理 | ||
| 383 | |||
| 384 | //endregion 5.过程处理 | ||
| 385 | } | ||
| 386 | |||
| 387 | /** | ||
| 388 | * 连接器身份管理修改后置处理 | ||
| 389 | * @author xup | ||
| 390 | * @date 2025-09-23 17:35 | ||
| 391 | * @param entity | ||
| 392 | * @param rqVO | ||
| 393 | * @return void | ||
| 394 | */ | ||
| 395 | protected void afterUpdate(MfTdsConnectorIdentityManagement entity, TdsConnectorIdentityManagementRQVO rqVO) { | ||
| 396 | //region 1.输出特殊转换 | ||
| 397 | |||
| 398 | //region 1.1.输出过滤与补充处理 | ||
| 399 | //endregion 1.1.输出过滤与补充处理 | ||
| 400 | |||
| 401 | //endregion 1.输出特殊转换 | ||
| 402 | } | ||
| 403 | |||
| 404 | |||
| 405 | /** | ||
| 406 | * 连接器身份管理删除前置处理 | ||
| 407 | * @author xup | ||
| 408 | * @date 2025-09-23 17:35 | ||
| 409 | * @param entity | ||
| 410 | * @return void | ||
| 411 | */ | ||
| 412 | private void beforeRemove(MfTdsConnectorIdentityManagement entity) { | ||
| 413 | if (entity == null) { | ||
| 414 | throw new CsbrSystemException(SystemError.DATA_DEL_ERROR, messageSourceUtil.notExistsToDelMessage(FUNCTION_NAME)); | ||
| 415 | } | ||
| 416 | if (ApprovalStateEnum.CHECKING.getValue().equals(entity.getBizApproveState()) || | ||
| 417 | ApprovalStateEnum.PASSED.getValue().equals(entity.getBizApproveState())) { | ||
| 418 | throw new CsbrSystemException(SystemError.DATA_DEL_ERROR, "审批中和审批通过的数据不能删除!"); | ||
| 419 | } | ||
| 420 | } | ||
| 421 | |||
| 422 | /** | ||
| 423 | * 连接器身份管理删除后置处理 | ||
| 424 | * @author xup | ||
| 425 | * @date 2025-09-23 17:35 | ||
| 426 | * @param entity | ||
| 427 | * @return void | ||
| 428 | */ | ||
| 429 | private void afterRemove(MfTdsConnectorIdentityManagement entity) { | ||
| 430 | |||
| 431 | } | ||
| 432 | |||
| 433 | /** | ||
| 434 | * 连接器身份管理查询方法前置验证、处理 | ||
| 435 | * @author xup | ||
| 436 | * @date 2025-09-23 17:35 | ||
| 437 | * @param rqQueryVO | ||
| 438 | * @return void | ||
| 439 | */ | ||
| 440 | private void beforeQuery(TdsConnectorIdentityManagementQueryVO rqQueryVO) { | ||
| 441 | rqQueryVO.setIsNeedQuery(true); | ||
| 442 | if (approvalFlowUtil.isQueryBizGuid(rqQueryVO)) { | ||
| 443 | rqQueryVO.setFlowType(FLOW_TYPE); | ||
| 444 | List<String> bizGuidList = approvalFlowUtil.getApprovalBizGuids(rqQueryVO); | ||
| 445 | if (CollectionUtils.isEmpty(bizGuidList)) { | ||
| 446 | rqQueryVO.setIsNeedQuery(false); | ||
| 447 | } else { | ||
| 448 | rqQueryVO.setGuidList(bizGuidList); | ||
| 449 | } | ||
| 450 | } | ||
| 451 | } | ||
| 452 | |||
| 453 | /** | ||
| 454 | * 连接器身份管理查询方法后置数据转换、处理 | ||
| 455 | * @author xup | ||
| 456 | * @date 2025-09-23 17:35 | ||
| 457 | * @param pageList 数据库查询数据 | ||
| 458 | * @param rsPageList 返回的最终数据 | ||
| 459 | * @return void | ||
| 460 | */ | ||
| 461 | private void afterQuery(PageListVO<MfTdsConnectorIdentityManagement> pageList, PageListVO<TdsConnectorIdentityManagementRSVO> rsPageList) { | ||
| 462 | if (CollectionUtils.isNotEmpty(pageList.getRecords())) { | ||
| 463 | rsPageList.setRecords(convertToVO(pageList.getRecords())); | ||
| 464 | } | ||
| 465 | // 需要特殊处理数据时使用 | ||
| 466 | /*if(CollectionUtils.isNotEmpty(pageList.getRecords())){ | ||
| 467 | List<TdsConnectorIdentityManagementRSVO> results = new ArrayList<>(); | ||
| 468 | for (MfTdsConnectorIdentityManagement item : pageList.getRecords()){ | ||
| 469 | TdsConnectorIdentityManagementRSVO vo = convertToVO(item); | ||
| 470 | results.add(vo); | ||
| 471 | } | ||
| 472 | rsPageList.setRecords(results); | ||
| 473 | }*/ | ||
| 474 | } | ||
| 475 | |||
| 476 | //region 辅助操作 | ||
| 477 | |||
| 478 | /** | ||
| 479 | * 连接器身份管理实体数据转换为视图对象数据(多个) | ||
| 480 | * @author xup | ||
| 481 | * @date 2025-09-23 17:35 | ||
| 482 | * @param entityList 实体数据列表 | ||
| 483 | * @return java.util.List<com.csbr.qingcloud.portal.domain.vo.TdsConnectorIdentityManagementRSVO> 视图对象列表 | ||
| 484 | */ | ||
| 485 | private List<TdsConnectorIdentityManagementRSVO> convertToVO(List<MfTdsConnectorIdentityManagement> entityList) { | ||
| 486 | if (CollectionUtils.isEmpty(entityList)) { | ||
| 487 | // W00012 = {0}:参数[{1}]不能为空! | ||
| 488 | throw new CsbrSystemException(SystemError.DATA_INPUT_ERROR, messageSourceUtil.getMessage("W00012", | ||
| 489 | "实体数据转换为视图对象实体数据", "实体数据")); | ||
| 490 | } | ||
| 491 | Set<String> guidSet = CommonUtil.filterSetFiled(entityList, MfTdsConnectorIdentityManagement::getGuid); | ||
| 492 | Map<String, BizApproveVO> approvalInfoMap = approvalFlowUtil.getApprovalInfoMap(guidSet); | ||
| 493 | List<TdsConnectorIdentityManagementRSVO> voList = new ArrayList<>(entityList.size()); | ||
| 494 | for (MfTdsConnectorIdentityManagement item : entityList) { | ||
| 495 | TdsConnectorIdentityManagementRSVO vo = convertToVO(item, false); | ||
| 496 | if (approvalInfoMap != null && approvalInfoMap.containsKey(item.getGuid())) { | ||
| 497 | vo.setApproveVO(approvalInfoMap.get(item.getGuid())); | ||
| 498 | } | ||
| 499 | voList.add(vo); | ||
| 500 | } | ||
| 501 | return voList; | ||
| 502 | } | ||
| 503 | |||
| 504 | /** | ||
| 505 | * 连接器身份管理实体数据转换为视图对象数据 | ||
| 506 | * @author xup | ||
| 507 | * @date 2025-09-23 17:35 | ||
| 508 | * @param entity | ||
| 509 | * @param isDetail | ||
| 510 | * @return com.csbr.qingcloud.portal.domain.vo.TdsConnectorIdentityManagementRSVO | ||
| 511 | */ | ||
| 512 | private TdsConnectorIdentityManagementRSVO convertToVO(MfTdsConnectorIdentityManagement entity, boolean isDetail) { | ||
| 513 | TdsConnectorIdentityManagementRSVO vo = csbrBeanUtil.convert(entity, TdsConnectorIdentityManagementRSVO.class); | ||
| 514 | if (isDetail) { | ||
| 515 | //流程数据处理 | ||
| 516 | vo.setApproveVO(approvalFlowUtil.getApprovalInfo(entity.getGuid())); | ||
| 517 | } | ||
| 518 | return vo; | ||
| 519 | } | ||
| 520 | |||
| 521 | /** | ||
| 522 | * 连接器身份管理新增、修改和其他情况的参数转换为实体 | ||
| 523 | * @author xup | ||
| 524 | * @date 2025-09-23 17:35 | ||
| 525 | * @param vo | ||
| 526 | * @return com.csbr.qingcloud.portal.mybatis.entity.MfTdsConnectorIdentityManagement | ||
| 527 | */ | ||
| 528 | private MfTdsConnectorIdentityManagement convertToEntity(TdsConnectorIdentityManagementRQVO vo) { | ||
| 529 | MfTdsConnectorIdentityManagement entity = csbrBeanUtil.convert(vo, MfTdsConnectorIdentityManagement.class); | ||
| 530 | // 新增时数据默认guid赋值,转换后该guid可能别使用 | ||
| 531 | if (StringUtils.isBlank(vo.getGuid())) { | ||
| 532 | entity.setGuid(CommonUtil.newGuid()); | ||
| 533 | } | ||
| 534 | return entity; | ||
| 535 | } | ||
| 536 | |||
| 537 | //endregion | ||
| 538 | |||
| 539 | } |
-
Please register or sign in to post a comment