可信空间连接器入住接口
Showing
13 changed files
with
251 additions
and
42 deletions
| ... | @@ -36,7 +36,7 @@ public class TdsConnectorIdentityController { | ... | @@ -36,7 +36,7 @@ public class TdsConnectorIdentityController { |
| 36 | @PostMapping("/save") | 36 | @PostMapping("/save") |
| 37 | @SystemLog(value = "连接器身份信息-新增") | 37 | @SystemLog(value = "连接器身份信息-新增") |
| 38 | @Operation(summary = "连接器身份信息-新增") | 38 | @Operation(summary = "连接器身份信息-新增") |
| 39 | public CommonRes<Boolean> saveTdsConnectorIdentity(@RequestBody @Valid TdsConnectorIdentityRQVO vo) { | 39 | public CommonRes<Boolean> saveTdsConnectorIdentity(@RequestBody TdsConnectorIdentityRQVO vo) { |
| 40 | tdsConnectorIdentityService.saveTdsConnectorIdentity(vo); | 40 | tdsConnectorIdentityService.saveTdsConnectorIdentity(vo); |
| 41 | return CommonRes.success(true); | 41 | return CommonRes.success(true); |
| 42 | } | 42 | } |
| ... | @@ -44,7 +44,7 @@ public class TdsConnectorIdentityController { | ... | @@ -44,7 +44,7 @@ public class TdsConnectorIdentityController { |
| 44 | @PutMapping("/update") | 44 | @PutMapping("/update") |
| 45 | @SystemLog(value = "连接器身份信息-修改") | 45 | @SystemLog(value = "连接器身份信息-修改") |
| 46 | @Operation(summary = "连接器身份信息-修改") | 46 | @Operation(summary = "连接器身份信息-修改") |
| 47 | public CommonRes<Boolean> updateTdsConnectorIdentity(@RequestBody @Valid TdsConnectorIdentityRQVO vo) { | 47 | public CommonRes<Boolean> updateTdsConnectorIdentity(@RequestBody TdsConnectorIdentityRQVO vo) { |
| 48 | tdsConnectorIdentityService.updateTdsConnectorIdentity(vo); | 48 | tdsConnectorIdentityService.updateTdsConnectorIdentity(vo); |
| 49 | return CommonRes.success(true); | 49 | return CommonRes.success(true); |
| 50 | } | 50 | } |
| ... | @@ -77,7 +77,7 @@ public class TdsConnectorIdentityController { | ... | @@ -77,7 +77,7 @@ public class TdsConnectorIdentityController { |
| 77 | return CommonRes.success(vo); | 77 | return CommonRes.success(vo); |
| 78 | } | 78 | } |
| 79 | 79 | ||
| 80 | @PostMapping("/callback") | 80 | @PostMapping("/flow-call-back") |
| 81 | @Operation(summary = "流程回调",hidden = true) | 81 | @Operation(summary = "流程回调",hidden = true) |
| 82 | public CommonRes<Boolean> flowComplete(@RequestBody BizCallbackDTO bizApproveVO) { | 82 | public CommonRes<Boolean> flowComplete(@RequestBody BizCallbackDTO bizApproveVO) { |
| 83 | tdsConnectorIdentityService.flowComplete(bizApproveVO); | 83 | tdsConnectorIdentityService.flowComplete(bizApproveVO); |
| ... | @@ -91,6 +91,12 @@ public class TdsConnectorIdentityController { | ... | @@ -91,6 +91,12 @@ public class TdsConnectorIdentityController { |
| 91 | return CommonRes.success(vo); | 91 | return CommonRes.success(vo); |
| 92 | } | 92 | } |
| 93 | 93 | ||
| 94 | @GetMapping("/check-connector") | ||
| 95 | @SystemLog(value = "连接器身份信息-检查连接器是否已经存在") | ||
| 96 | public CommonRes<Boolean> checkConnector() { | ||
| 97 | Boolean vo = tdsConnectorIdentityService.verifyUniqueness(null); | ||
| 98 | return CommonRes.success(vo); | ||
| 99 | } | ||
| 94 | //endregion | 100 | //endregion |
| 95 | 101 | ||
| 96 | } | 102 | } | ... | ... |
| ... | @@ -35,7 +35,7 @@ public class TdsConnectorAdditionalRQVO { | ... | @@ -35,7 +35,7 @@ public class TdsConnectorAdditionalRQVO { |
| 35 | */ | 35 | */ |
| 36 | @Schema(description = "可验证身份签发单位") | 36 | @Schema(description = "可验证身份签发单位") |
| 37 | @Size(max = 100, message = "可验证身份签发单位长度超过100") | 37 | @Size(max = 100, message = "可验证身份签发单位长度超过100") |
| 38 | @NotBlank(message = "可验证身份签发单位为空。") | 38 | // @NotBlank(message = "可验证身份签发单位为空。") |
| 39 | private String identityIssuingUnit; | 39 | private String identityIssuingUnit; |
| 40 | 40 | ||
| 41 | /** | 41 | /** |
| ... | @@ -84,6 +84,12 @@ public class TdsConnectorAdditionalRQVO { | ... | @@ -84,6 +84,12 @@ public class TdsConnectorAdditionalRQVO { |
| 84 | @Size(max = 50, message = "设备MAC地址长度超过50") | 84 | @Size(max = 50, message = "设备MAC地址长度超过50") |
| 85 | @NotBlank(message = "设备MAC地址为空。") | 85 | @NotBlank(message = "设备MAC地址为空。") |
| 86 | private String deviceMacAddress; | 86 | private String deviceMacAddress; |
| 87 | |||
| 88 | /** | ||
| 89 | * 业务审批状态 | ||
| 90 | */ | ||
| 91 | @Schema(description = "业务审批状态") | ||
| 92 | private String bizApproveState; | ||
| 87 | 93 | ||
| 88 | /******** 库表存储属性 需处理 *****/ | 94 | /******** 库表存储属性 需处理 *****/ |
| 89 | 95 | ... | ... |
| ... | @@ -24,6 +24,26 @@ public class TdsConnectorIdentityManagementRQVO extends FlowRQBaseVO { | ... | @@ -24,6 +24,26 @@ public class TdsConnectorIdentityManagementRQVO extends FlowRQBaseVO { |
| 24 | @Schema(description = "连接器Guid") | 24 | @Schema(description = "连接器Guid") |
| 25 | @NotBlank(message = "连接器Guid为空。") | 25 | @NotBlank(message = "连接器Guid为空。") |
| 26 | private String connectorGuid; | 26 | private String connectorGuid; |
| 27 | |||
| 28 | /** | ||
| 29 | * 连接器名称 | ||
| 30 | */ | ||
| 31 | @Schema(description = "连接器名称") | ||
| 32 | @NotBlank(message = "连接器名称为空。") | ||
| 33 | private String connectorName; | ||
| 34 | |||
| 35 | /** | ||
| 36 | * 接入连接器身份标识(由区域/行业功能节点下发,唯一标识连接器身份) | ||
| 37 | */ | ||
| 38 | @Schema(description = "接入连接器身份标识(由区域/行业功能节点下发,唯一标识连接器身份)") | ||
| 39 | private String connectorIdentity; | ||
| 40 | |||
| 41 | /** | ||
| 42 | * 所属法人或其他组织名称 | ||
| 43 | */ | ||
| 44 | @Schema(description = "所属法人或其他组织名称") | ||
| 45 | @NotBlank(message = "所属法人或其他组织名称为空。") | ||
| 46 | private String legalEntity; | ||
| 27 | 47 | ||
| 28 | /** | 48 | /** |
| 29 | * 使用场景(数据字典使用场景) | 49 | * 使用场景(数据字典使用场景) | ... | ... |
| ... | @@ -2,8 +2,10 @@ package com.csbr.qingcloud.portal.domain.vo; | ... | @@ -2,8 +2,10 @@ package com.csbr.qingcloud.portal.domain.vo; |
| 2 | 2 | ||
| 3 | import com.alibaba.fastjson.JSONArray; | 3 | import com.alibaba.fastjson.JSONArray; |
| 4 | import com.csbr.cloud.common.annotations.SystemParamsDict; | 4 | import com.csbr.cloud.common.annotations.SystemParamsDict; |
| 5 | import csbr.cloud.entity.domain.base.vo.BaseVO; | ||
| 5 | import io.swagger.v3.oas.annotations.media.Schema; | 6 | import io.swagger.v3.oas.annotations.media.Schema; |
| 6 | import com.fasterxml.jackson.annotation.JsonFormat; | 7 | import com.fasterxml.jackson.annotation.JsonFormat; |
| 8 | import jakarta.validation.constraints.NotBlank; | ||
| 7 | import lombok.Data; | 9 | import lombok.Data; |
| 8 | import com.csbr.cloud.workflow.domain.vo.appove.BizApproveVO; | 10 | import com.csbr.cloud.workflow.domain.vo.appove.BizApproveVO; |
| 9 | import java.util.Date; | 11 | import java.util.Date; |
| ... | @@ -16,19 +18,37 @@ import java.util.Date; | ... | @@ -16,19 +18,37 @@ import java.util.Date; |
| 16 | **/ | 18 | **/ |
| 17 | @Data | 19 | @Data |
| 18 | @Schema(title = "连接器身份管理返回参数") | 20 | @Schema(title = "连接器身份管理返回参数") |
| 19 | public class TdsConnectorIdentityManagementRSVO { | 21 | public class TdsConnectorIdentityManagementRSVO extends BaseVO { |
| 20 | 22 | ||
| 21 | /** | 23 | /** |
| 22 | * 系统唯一标识 | 24 | * 系统唯一标识 |
| 23 | */ | 25 | */ |
| 24 | @Schema(description = "系统唯一标识") | 26 | @Schema(description = "系统唯一标识") |
| 25 | private String guid; | 27 | private String guid; |
| 26 | 28 | ||
| 29 | /** | ||
| 30 | * 连接器Guid | ||
| 31 | */ | ||
| 32 | @Schema(description = "连接器Guid") | ||
| 33 | private String connectorGuid; | ||
| 34 | |||
| 35 | /** | ||
| 36 | * 连接器名称 | ||
| 37 | */ | ||
| 38 | @Schema(description = "连接器名称") | ||
| 39 | private String connectorName; | ||
| 40 | |||
| 41 | /** | ||
| 42 | * 接入连接器身份标识(由区域/行业功能节点下发,唯一标识连接器身份) | ||
| 43 | */ | ||
| 44 | @Schema(description = "接入连接器身份标识(由区域/行业功能节点下发,唯一标识连接器身份)") | ||
| 45 | private String connectorIdentity; | ||
| 46 | |||
| 27 | /** | 47 | /** |
| 28 | * 节点Guid | 48 | * 所属法人或其他组织名称 |
| 29 | */ | 49 | */ |
| 30 | @Schema(description = "节点Guid") | 50 | @Schema(description = "所属法人或其他组织名称") |
| 31 | private String zqGuid; | 51 | private String legalEntity; |
| 32 | 52 | ||
| 33 | /** | 53 | /** |
| 34 | * 使用场景(数据字典使用场景) | 54 | * 使用场景(数据字典使用场景) |
| ... | @@ -38,7 +58,7 @@ public class TdsConnectorIdentityManagementRSVO { | ... | @@ -38,7 +58,7 @@ public class TdsConnectorIdentityManagementRSVO { |
| 38 | 58 | ||
| 39 | 59 | ||
| 40 | /** | 60 | /** |
| 41 | * 使用场景名称git push origin | 61 | * 使用场景名称 |
| 42 | */ | 62 | */ |
| 43 | @Schema(description = "使用场景") | 63 | @Schema(description = "使用场景") |
| 44 | @SystemParamsDict(dictTypeName = "可信空间使用场景",codeFieldName = "useScenariosCode") | 64 | @SystemParamsDict(dictTypeName = "可信空间使用场景",codeFieldName = "useScenariosCode") |
| ... | @@ -49,7 +69,7 @@ public class TdsConnectorIdentityManagementRSVO { | ... | @@ -49,7 +69,7 @@ public class TdsConnectorIdentityManagementRSVO { |
| 49 | * 期望效期 | 69 | * 期望效期 |
| 50 | */ | 70 | */ |
| 51 | @Schema(description = "期望效期") | 71 | @Schema(description = "期望效期") |
| 52 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") | 72 | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| 53 | private Date expirationTime; | 73 | private Date expirationTime; |
| 54 | 74 | ||
| 55 | /** | 75 | /** | ... | ... |
| 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.BizApproveVO; | ||
| 4 | import csbr.cloud.entity.domain.base.vo.BaseVO; | ||
| 3 | import io.swagger.v3.oas.annotations.media.Schema; | 5 | import io.swagger.v3.oas.annotations.media.Schema; |
| 4 | import com.fasterxml.jackson.annotation.JsonFormat; | 6 | import com.fasterxml.jackson.annotation.JsonFormat; |
| 5 | import lombok.Data; | 7 | import lombok.Data; |
| ... | @@ -15,7 +17,7 @@ import java.util.Map; | ... | @@ -15,7 +17,7 @@ import java.util.Map; |
| 15 | **/ | 17 | **/ |
| 16 | @Data | 18 | @Data |
| 17 | @Schema(title = "连接器身份信息返回参数") | 19 | @Schema(title = "连接器身份信息返回参数") |
| 18 | public class TdsConnectorIdentityRSVO { | 20 | public class TdsConnectorIdentityRSVO extends BaseVO { |
| 19 | 21 | ||
| 20 | /** | 22 | /** |
| 21 | * 系统唯一标识 | 23 | * 系统唯一标识 |
| ... | @@ -88,4 +90,10 @@ public class TdsConnectorIdentityRSVO { | ... | @@ -88,4 +90,10 @@ public class TdsConnectorIdentityRSVO { |
| 88 | 90 | ||
| 89 | @Schema(description = "连接器可验信息返回参数") | 91 | @Schema(description = "连接器可验信息返回参数") |
| 90 | private TdsConnectorVerifiableRSVO tdsConnectorVerifiable; | 92 | private TdsConnectorVerifiableRSVO tdsConnectorVerifiable; |
| 93 | |||
| 94 | /** | ||
| 95 | * 审批信息 | ||
| 96 | */ | ||
| 97 | @Schema(description = "审批信息") | ||
| 98 | private BizApproveVO approveVO; | ||
| 91 | } | 99 | } | ... | ... |
| ... | @@ -109,6 +109,12 @@ public class TdsConnectorVerifiableRQVO { | ... | @@ -109,6 +109,12 @@ public class TdsConnectorVerifiableRQVO { |
| 109 | @Schema(description = "第三方认证声明") | 109 | @Schema(description = "第三方认证声明") |
| 110 | @NotNull(message = "第三方认证声明为空。") | 110 | @NotNull(message = "第三方认证声明为空。") |
| 111 | private JSONArray thirdPartyCertification; | 111 | private JSONArray thirdPartyCertification; |
| 112 | |||
| 113 | /** | ||
| 114 | * 业务审批状态 | ||
| 115 | */ | ||
| 116 | @Schema(description = "业务审批状态") | ||
| 117 | private String bizApproveState; | ||
| 112 | 118 | ||
| 113 | /******** 库表存储属性 需处理 *****/ | 119 | /******** 库表存储属性 需处理 *****/ |
| 114 | 120 | ... | ... |
| ... | @@ -84,6 +84,9 @@ public class MfTdsConnectorIdentity extends BaseShardingDO { | ... | @@ -84,6 +84,9 @@ public class MfTdsConnectorIdentity extends BaseShardingDO { |
| 84 | @Name("凭证颁发日期") | 84 | @Name("凭证颁发日期") |
| 85 | private Date credentialTime; | 85 | private Date credentialTime; |
| 86 | 86 | ||
| 87 | @Name("主平台同步状态(Y 成功 E 失败)") | ||
| 88 | private String crossPlatformApproveState; | ||
| 89 | |||
| 87 | /** | 90 | /** |
| 88 | * 业务审批状态【N 草稿中,A 审批中,Y 已通过,R 驳回,C 已撤销,D 已废弃; 默认 N】 | 91 | * 业务审批状态【N 草稿中,A 审批中,Y 已通过,R 驳回,C 已撤销,D 已废弃; 默认 N】 |
| 89 | */ | 92 | */ | ... | ... |
| ... | @@ -24,12 +24,25 @@ import java.util.Date; | ... | @@ -24,12 +24,25 @@ import java.util.Date; |
| 24 | @Name("连接器身份管理") | 24 | @Name("连接器身份管理") |
| 25 | @TableName(autoResultMap = true) | 25 | @TableName(autoResultMap = true) |
| 26 | public class MfTdsConnectorIdentityManagement extends BaseShardingDO { | 26 | public class MfTdsConnectorIdentityManagement extends BaseShardingDO { |
| 27 | 27 | ||
| 28 | /** | 28 | /** |
| 29 | * 节点Guid | 29 | * 接入连接器Guid |
| 30 | */ | 30 | */ |
| 31 | @Name("节点Guid") | 31 | @Name("接入连接器Guid") |
| 32 | private String zqGuid; | 32 | private String connectorGuid; |
| 33 | |||
| 34 | /** | ||
| 35 | * 接入连接器名称 | ||
| 36 | */ | ||
| 37 | @Name("接入连接器名称") | ||
| 38 | private String connectorName; | ||
| 39 | |||
| 40 | |||
| 41 | /** | ||
| 42 | * 接入连接器身份标识(由区域/行业功能节点下发,唯一标识连接器身份) | ||
| 43 | */ | ||
| 44 | @Name("接入连接器身份标识(由区域/行业功能节点下发,唯一标识连接器身份)") | ||
| 45 | private String connectorIdentity; | ||
| 33 | 46 | ||
| 34 | /** | 47 | /** |
| 35 | * 使用场景(数据字典使用场景) | 48 | * 使用场景(数据字典使用场景) |
| ... | @@ -74,4 +87,10 @@ public class MfTdsConnectorIdentityManagement extends BaseShardingDO { | ... | @@ -74,4 +87,10 @@ public class MfTdsConnectorIdentityManagement extends BaseShardingDO { |
| 74 | @Name("业务审批状态") | 87 | @Name("业务审批状态") |
| 75 | private String bizApproveState; | 88 | private String bizApproveState; |
| 76 | 89 | ||
| 90 | /** | ||
| 91 | * 所属法人或其他组织名称 | ||
| 92 | */ | ||
| 93 | @Name("所属法人或其他组织名称") | ||
| 94 | private String legalEntity; | ||
| 95 | |||
| 77 | } | 96 | } | ... | ... |
| ... | @@ -2,12 +2,15 @@ package com.csbr.qingcloud.portal.service; | ... | @@ -2,12 +2,15 @@ package com.csbr.qingcloud.portal.service; |
| 2 | 2 | ||
| 3 | import com.csbr.cloud.workflow.domain.dto.callback.BizCallbackDTO; | 3 | import com.csbr.cloud.workflow.domain.dto.callback.BizCallbackDTO; |
| 4 | import com.csbr.cloud.workflow.domain.vo.appove.FlowRQBaseVO; | 4 | import com.csbr.cloud.workflow.domain.vo.appove.FlowRQBaseVO; |
| 5 | import com.csbr.qingcloud.portal.mybatis.entity.MfTdsConnectorIdentity; | ||
| 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; |
| 7 | import com.csbr.qingcloud.portal.domain.vo.TdsConnectorIdentityRQVO; | 8 | import com.csbr.qingcloud.portal.domain.vo.TdsConnectorIdentityRQVO; |
| 8 | import com.csbr.qingcloud.portal.domain.vo.TdsConnectorIdentityRSVO; | 9 | import com.csbr.qingcloud.portal.domain.vo.TdsConnectorIdentityRSVO; |
| 9 | 10 | ||
| 10 | import java.util.List; | 11 | import java.util.List; |
| 12 | import java.util.Map; | ||
| 13 | import java.util.Set; | ||
| 11 | 14 | ||
| 12 | /** | 15 | /** |
| 13 | * @program: | 16 | * @program: |
| ... | @@ -82,4 +85,13 @@ public interface TdsConnectorIdentityService { | ... | @@ -82,4 +85,13 @@ public interface TdsConnectorIdentityService { |
| 82 | * @return | 85 | * @return |
| 83 | */ | 86 | */ |
| 84 | TdsConnectorIdentityRSVO getEffectiveConnector(); | 87 | TdsConnectorIdentityRSVO getEffectiveConnector(); |
| 88 | |||
| 89 | /** | ||
| 90 | * 查询连接器信息 | ||
| 91 | * @param guidSet | ||
| 92 | * @return | ||
| 93 | */ | ||
| 94 | Map<String, MfTdsConnectorIdentity> getCrossTenantTdsConnectorIdentitys(Set<String> guidSet); | ||
| 95 | |||
| 96 | Boolean verifyUniqueness(TdsConnectorIdentityRQVO rqVO); | ||
| 85 | } | 97 | } | ... | ... |
| ... | @@ -8,6 +8,7 @@ import com.csbr.cloud.common.exception.CsbrSystemException; | ... | @@ -8,6 +8,7 @@ import com.csbr.cloud.common.exception.CsbrSystemException; |
| 8 | import com.csbr.cloud.common.util.CommonUtil; | 8 | import com.csbr.cloud.common.util.CommonUtil; |
| 9 | import com.csbr.cloud.common.util.CsbrBeanUtil; | 9 | import com.csbr.cloud.common.util.CsbrBeanUtil; |
| 10 | import com.csbr.cloud.common.util.MessageSourceUtil; | 10 | import com.csbr.cloud.common.util.MessageSourceUtil; |
| 11 | import com.csbr.cloud.mybatis.util.ValidatorUtil; | ||
| 11 | import com.csbr.qingcloud.portal.domain.vo.TdsConnectorAdditionalQueryVO; | 12 | import com.csbr.qingcloud.portal.domain.vo.TdsConnectorAdditionalQueryVO; |
| 12 | import com.csbr.qingcloud.portal.domain.vo.TdsConnectorAdditionalRQVO; | 13 | import com.csbr.qingcloud.portal.domain.vo.TdsConnectorAdditionalRQVO; |
| 13 | import com.csbr.qingcloud.portal.domain.vo.TdsConnectorAdditionalRSVO; | 14 | import com.csbr.qingcloud.portal.domain.vo.TdsConnectorAdditionalRSVO; |
| ... | @@ -15,6 +16,7 @@ import com.csbr.qingcloud.portal.mybatis.entity.MfTdsConnectorAdditional; | ... | @@ -15,6 +16,7 @@ import com.csbr.qingcloud.portal.mybatis.entity.MfTdsConnectorAdditional; |
| 15 | import com.csbr.qingcloud.portal.mybatis.service.MfTdsConnectorAdditionalService; | 16 | import com.csbr.qingcloud.portal.mybatis.service.MfTdsConnectorAdditionalService; |
| 16 | import com.csbr.qingcloud.portal.service.TdsConnectorAdditionalService; | 17 | import com.csbr.qingcloud.portal.service.TdsConnectorAdditionalService; |
| 17 | import csbr.cloud.entity.domain.base.vo.PageListVO; | 18 | import csbr.cloud.entity.domain.base.vo.PageListVO; |
| 19 | import csbr.cloud.entity.enums.ApprovalStateEnum; | ||
| 18 | import jakarta.annotation.Resource; | 20 | import jakarta.annotation.Resource; |
| 19 | import lombok.extern.slf4j.Slf4j; | 21 | import lombok.extern.slf4j.Slf4j; |
| 20 | import org.apache.commons.collections.CollectionUtils; | 22 | import org.apache.commons.collections.CollectionUtils; |
| ... | @@ -51,6 +53,9 @@ public class TdsConnectorAdditionalServiceImpl implements TdsConnectorAdditional | ... | @@ -51,6 +53,9 @@ public class TdsConnectorAdditionalServiceImpl implements TdsConnectorAdditional |
| 51 | @Resource | 53 | @Resource |
| 52 | private MessageSourceUtil messageSourceUtil; | 54 | private MessageSourceUtil messageSourceUtil; |
| 53 | 55 | ||
| 56 | @Resource | ||
| 57 | private ValidatorUtil validatorUtil; | ||
| 58 | |||
| 54 | /** | 59 | /** |
| 55 | * 连接器附加信息分页查询 | 60 | * 连接器附加信息分页查询 |
| 56 | * @author xup | 61 | * @author xup |
| ... | @@ -216,6 +221,16 @@ public class TdsConnectorAdditionalServiceImpl implements TdsConnectorAdditional | ... | @@ -216,6 +221,16 @@ public class TdsConnectorAdditionalServiceImpl implements TdsConnectorAdditional |
| 216 | */ | 221 | */ |
| 217 | private void beforeSave(TdsConnectorAdditionalRQVO rqVO) { | 222 | private void beforeSave(TdsConnectorAdditionalRQVO rqVO) { |
| 218 | //region 1.输入基础验证 | 223 | //region 1.输入基础验证 |
| 224 | if(ObjectUtils.isEmpty(rqVO)){ | ||
| 225 | throw new CsbrSystemException(SystemError.DATA_INPUT_ERROR, String.format("%s参数为空。",FUNCTION_NAME)); | ||
| 226 | } | ||
| 227 | //判断是否是草稿 | ||
| 228 | if(!ApprovalStateEnum.DRAFT.getValue().equals(rqVO.getBizApproveState())){ | ||
| 229 | String message = validatorUtil.validateRetrunOne(rqVO); | ||
| 230 | if(StringUtils.isNotBlank(message)){ | ||
| 231 | throw new CsbrSystemException(SystemError.DATA_INPUT_ERROR,message); | ||
| 232 | } | ||
| 233 | } | ||
| 219 | //endregion | 234 | //endregion |
| 220 | 235 | ||
| 221 | //region 2.数据验证特殊处理 | 236 | //region 2.数据验证特殊处理 |
| ... | @@ -278,6 +293,13 @@ public class TdsConnectorAdditionalServiceImpl implements TdsConnectorAdditional | ... | @@ -278,6 +293,13 @@ public class TdsConnectorAdditionalServiceImpl implements TdsConnectorAdditional |
| 278 | // W00012 = {0}:参数[{1}]不能为空! | 293 | // W00012 = {0}:参数[{1}]不能为空! |
| 279 | throw new CsbrSystemException(SystemError.DATA_INPUT_ERROR, messageSourceUtil.getMessage("W00010", String.format("修改%s数据",FUNCTION_NAME), "数据唯一标识")); | 294 | throw new CsbrSystemException(SystemError.DATA_INPUT_ERROR, messageSourceUtil.getMessage("W00010", String.format("修改%s数据",FUNCTION_NAME), "数据唯一标识")); |
| 280 | } | 295 | } |
| 296 | //判断是否是草稿 | ||
| 297 | if(!ApprovalStateEnum.DRAFT.getValue().equals(rqVO.getBizApproveState())){ | ||
| 298 | String message = validatorUtil.validateRetrunOne(rqVO); | ||
| 299 | if(StringUtils.isNotBlank(message)){ | ||
| 300 | throw new CsbrSystemException(SystemError.DATA_INPUT_ERROR,message); | ||
| 301 | } | ||
| 302 | } | ||
| 281 | //endregion | 303 | //endregion |
| 282 | 304 | ||
| 283 | //region 2.数据验证特殊处理 | 305 | //region 2.数据验证特殊处理 | ... | ... |
| ... | @@ -7,6 +7,8 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; | ... | @@ -7,6 +7,8 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| 7 | import com.csbr.cloud.common.enums.SystemError; | 7 | import com.csbr.cloud.common.enums.SystemError; |
| 8 | import com.csbr.cloud.common.enums.WorkFlowBizEnum; | 8 | import com.csbr.cloud.common.enums.WorkFlowBizEnum; |
| 9 | import com.csbr.qingcloud.portal.domain.vo.TdsConnectorIdentityManagementVoucherRQVO; | 9 | import com.csbr.qingcloud.portal.domain.vo.TdsConnectorIdentityManagementVoucherRQVO; |
| 10 | import com.csbr.qingcloud.portal.mybatis.entity.MfTdsConnectorIdentity; | ||
| 11 | import com.csbr.qingcloud.portal.service.TdsConnectorIdentityService; | ||
| 10 | import csbr.cloud.entity.enums.ApprovalStateEnum; | 12 | import csbr.cloud.entity.enums.ApprovalStateEnum; |
| 11 | import com.csbr.cloud.common.exception.CsbrSystemException; | 13 | import com.csbr.cloud.common.exception.CsbrSystemException; |
| 12 | import com.csbr.cloud.common.util.CommonUtil; | 14 | import com.csbr.cloud.common.util.CommonUtil; |
| ... | @@ -28,6 +30,7 @@ import com.csbr.qingcloud.portal.service.TdsConnectorIdentityManagementService; | ... | @@ -28,6 +30,7 @@ import com.csbr.qingcloud.portal.service.TdsConnectorIdentityManagementService; |
| 28 | import jakarta.annotation.Resource; | 30 | import jakarta.annotation.Resource; |
| 29 | import lombok.extern.slf4j.Slf4j; | 31 | import lombok.extern.slf4j.Slf4j; |
| 30 | import org.apache.commons.collections.CollectionUtils; | 32 | import org.apache.commons.collections.CollectionUtils; |
| 33 | import org.apache.commons.lang3.ObjectUtils; | ||
| 31 | import org.apache.commons.lang3.StringUtils; | 34 | import org.apache.commons.lang3.StringUtils; |
| 32 | import org.springframework.beans.factory.annotation.Value; | 35 | import org.springframework.beans.factory.annotation.Value; |
| 33 | import org.springframework.stereotype.Service; | 36 | import org.springframework.stereotype.Service; |
| ... | @@ -73,6 +76,9 @@ public class TdsConnectorIdentityManagementServiceImpl extends FlowAbstractImpl | ... | @@ -73,6 +76,9 @@ public class TdsConnectorIdentityManagementServiceImpl extends FlowAbstractImpl |
| 73 | @Value("${csbr.platform-type:''}") | 76 | @Value("${csbr.platform-type:''}") |
| 74 | private String platformType; | 77 | private String platformType; |
| 75 | 78 | ||
| 79 | @Resource | ||
| 80 | private TdsConnectorIdentityService tdsConnectorIdentityService; | ||
| 81 | |||
| 76 | /** | 82 | /** |
| 77 | * 连接器身份管理分页查询 | 83 | * 连接器身份管理分页查询 |
| 78 | * @author xup | 84 | * @author xup |
| ... | @@ -115,7 +121,8 @@ public class TdsConnectorIdentityManagementServiceImpl extends FlowAbstractImpl | ... | @@ -115,7 +121,8 @@ public class TdsConnectorIdentityManagementServiceImpl extends FlowAbstractImpl |
| 115 | if (entity == null) { | 121 | if (entity == null) { |
| 116 | throw new CsbrSystemException(SystemError.DATA_NOT_EXISTS, messageSourceUtil.notExistsToSelectMessage(String.format("获取%s详情数据", FUNCTION_NAME))); | 122 | throw new CsbrSystemException(SystemError.DATA_NOT_EXISTS, messageSourceUtil.notExistsToSelectMessage(String.format("获取%s详情数据", FUNCTION_NAME))); |
| 117 | } | 123 | } |
| 118 | return convertToVO(entity, true); | 124 | TdsConnectorIdentityManagementRSVO vo = convertToVO(entity, true); |
| 125 | return vo; | ||
| 119 | } | 126 | } |
| 120 | 127 | ||
| 121 | /** | 128 | /** |
| ... | @@ -125,7 +132,7 @@ public class TdsConnectorIdentityManagementServiceImpl extends FlowAbstractImpl | ... | @@ -125,7 +132,7 @@ public class TdsConnectorIdentityManagementServiceImpl extends FlowAbstractImpl |
| 125 | * @param flowBaseVO | 132 | * @param flowBaseVO |
| 126 | * @return void | 133 | * @return void |
| 127 | */ | 134 | */ |
| 128 | @GlobalTransactional(rollbackFor = Exception.class) | 135 | // @GlobalTransactional(rollbackFor = Exception.class) |
| 129 | @Transactional(rollbackFor = Exception.class) | 136 | @Transactional(rollbackFor = Exception.class) |
| 130 | @Override | 137 | @Override |
| 131 | public void saveTdsConnectorIdentityManagement(FlowRQBaseVO flowBaseVO) { | 138 | public void saveTdsConnectorIdentityManagement(FlowRQBaseVO flowBaseVO) { |
| ... | @@ -151,7 +158,7 @@ public class TdsConnectorIdentityManagementServiceImpl extends FlowAbstractImpl | ... | @@ -151,7 +158,7 @@ public class TdsConnectorIdentityManagementServiceImpl extends FlowAbstractImpl |
| 151 | * @param flowBaseVO | 158 | * @param flowBaseVO |
| 152 | * @return void | 159 | * @return void |
| 153 | */ | 160 | */ |
| 154 | @GlobalTransactional(rollbackFor = Exception.class) | 161 | // @GlobalTransactional(rollbackFor = Exception.class) |
| 155 | @Transactional(rollbackFor = Exception.class) | 162 | @Transactional(rollbackFor = Exception.class) |
| 156 | @Override | 163 | @Override |
| 157 | public void updateTdsConnectorIdentityManagement(FlowRQBaseVO flowBaseVO) { | 164 | public void updateTdsConnectorIdentityManagement(FlowRQBaseVO flowBaseVO) { |
| ... | @@ -506,14 +513,25 @@ public class TdsConnectorIdentityManagementServiceImpl extends FlowAbstractImpl | ... | @@ -506,14 +513,25 @@ public class TdsConnectorIdentityManagementServiceImpl extends FlowAbstractImpl |
| 506 | rsPageList.setRecords(convertToVO(pageList.getRecords())); | 513 | rsPageList.setRecords(convertToVO(pageList.getRecords())); |
| 507 | } | 514 | } |
| 508 | // 需要特殊处理数据时使用 | 515 | // 需要特殊处理数据时使用 |
| 509 | /*if(CollectionUtils.isNotEmpty(pageList.getRecords())){ | 516 | // if(CollectionUtils.isNotEmpty(pageList.getRecords())){ |
| 510 | List<TdsConnectorIdentityManagementRSVO> results = new ArrayList<>(); | 517 | // List<TdsConnectorIdentityManagementRSVO> results = new ArrayList<>(); |
| 511 | for (MfTdsConnectorIdentityManagement item : pageList.getRecords()){ | 518 | // Set<String> guidSet = CommonUtil.filterSetFiled(pageList.getRecords(), MfTdsConnectorIdentityManagement::getGuid); |
| 512 | TdsConnectorIdentityManagementRSVO vo = convertToVO(item); | 519 | // Map<String, BizApproveVO> approvalInfoMap = approvalFlowUtil.getApprovalCrossTenantInfoMap(guidSet); |
| 513 | results.add(vo); | 520 | // Map<String, MfTdsConnectorIdentity> connectorIdentityMap = tdsConnectorIdentityService.getCrossTenantTdsConnectorIdentitys(guidSet); |
| 514 | } | 521 | // for (MfTdsConnectorIdentityManagement item : pageList.getRecords()){ |
| 515 | rsPageList.setRecords(results); | 522 | // TdsConnectorIdentityManagementRSVO vo = convertToVO(item,false); |
| 516 | }*/ | 523 | // String guid = vo.getGuid(); |
| 524 | // if(ObjectUtils.isNotEmpty(approvalInfoMap) && approvalInfoMap.containsKey(guid)) { | ||
| 525 | // vo.setApproveVO(approvalInfoMap.get(guid)); | ||
| 526 | // } | ||
| 527 | // if(ObjectUtils.isNotEmpty(connectorIdentityMap) && connectorIdentityMap.containsKey(guid)) { | ||
| 528 | // vo.setConnectorName(connectorIdentityMap.get(guid).getConnectorName()); | ||
| 529 | // vo.setLegalEntity(connectorIdentityMap.get(guid).getLegalEntity()); | ||
| 530 | // } | ||
| 531 | // results.add(vo); | ||
| 532 | // } | ||
| 533 | // rsPageList.setRecords(results); | ||
| 534 | // } | ||
| 517 | } | 535 | } |
| 518 | 536 | ||
| 519 | //region 辅助操作 | 537 | //region 辅助操作 | ... | ... |
| 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; | ||
| 5 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; | 4 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| 6 | import com.csbr.cloud.common.enums.SystemError; | 5 | import com.csbr.cloud.common.enums.SystemError; |
| 7 | import com.csbr.cloud.common.enums.WorkFlowBizEnum; | 6 | import com.csbr.cloud.common.enums.WorkFlowBizEnum; |
| ... | @@ -10,8 +9,10 @@ import com.csbr.cloud.common.util.CommonUtil; | ... | @@ -10,8 +9,10 @@ import com.csbr.cloud.common.util.CommonUtil; |
| 10 | import com.csbr.cloud.common.util.CsbrBeanUtil; | 9 | import com.csbr.cloud.common.util.CsbrBeanUtil; |
| 11 | import com.csbr.cloud.common.util.MessageSourceUtil; | 10 | import com.csbr.cloud.common.util.MessageSourceUtil; |
| 12 | import com.csbr.cloud.mybatis.util.BizCommonRedisUtil; | 11 | import com.csbr.cloud.mybatis.util.BizCommonRedisUtil; |
| 12 | import com.csbr.cloud.mybatis.util.ValidatorUtil; | ||
| 13 | import com.csbr.cloud.workflow.domain.dto.appove.AddApprovalDTO; | 13 | import com.csbr.cloud.workflow.domain.dto.appove.AddApprovalDTO; |
| 14 | import com.csbr.cloud.workflow.domain.dto.callback.BizCallbackDTO; | 14 | import com.csbr.cloud.workflow.domain.dto.callback.BizCallbackDTO; |
| 15 | import com.csbr.cloud.workflow.domain.vo.appove.BizApproveVO; | ||
| 15 | import com.csbr.cloud.workflow.domain.vo.appove.FlowRQBaseVO; | 16 | import com.csbr.cloud.workflow.domain.vo.appove.FlowRQBaseVO; |
| 16 | import com.csbr.cloud.workflow.util.ApprovalFlowUtil; | 17 | import com.csbr.cloud.workflow.util.ApprovalFlowUtil; |
| 17 | import com.csbr.cloud.workflow.util.FlowAbstractImpl; | 18 | import com.csbr.cloud.workflow.util.FlowAbstractImpl; |
| ... | @@ -23,7 +24,6 @@ import com.csbr.qingcloud.portal.mybatis.entity.MfTdsConnectorIdentity; | ... | @@ -23,7 +24,6 @@ import com.csbr.qingcloud.portal.mybatis.entity.MfTdsConnectorIdentity; |
| 23 | import com.csbr.qingcloud.portal.mybatis.service.MfTdsConnectorIdentityService; | 24 | import com.csbr.qingcloud.portal.mybatis.service.MfTdsConnectorIdentityService; |
| 24 | import com.csbr.qingcloud.portal.service.TdsConnectorIdentityService; | 25 | import com.csbr.qingcloud.portal.service.TdsConnectorIdentityService; |
| 25 | import csbr.cloud.entity.enums.ApprovalStateEnum; | 26 | import csbr.cloud.entity.enums.ApprovalStateEnum; |
| 26 | import io.seata.spring.annotation.GlobalTransactional; | ||
| 27 | import jakarta.annotation.Resource; | 27 | import jakarta.annotation.Resource; |
| 28 | import lombok.extern.slf4j.Slf4j; | 28 | import lombok.extern.slf4j.Slf4j; |
| 29 | import org.apache.commons.collections.CollectionUtils; | 29 | import org.apache.commons.collections.CollectionUtils; |
| ... | @@ -33,10 +33,9 @@ import org.springframework.beans.factory.annotation.Value; | ... | @@ -33,10 +33,9 @@ import org.springframework.beans.factory.annotation.Value; |
| 33 | import org.springframework.stereotype.Service; | 33 | import org.springframework.stereotype.Service; |
| 34 | import org.springframework.transaction.annotation.Transactional; | 34 | import org.springframework.transaction.annotation.Transactional; |
| 35 | 35 | ||
| 36 | import java.util.ArrayList; | 36 | import java.util.*; |
| 37 | import java.util.Arrays; | 37 | import java.util.function.Function; |
| 38 | import java.util.Collections; | 38 | import java.util.stream.Collectors; |
| 39 | import java.util.List; | ||
| 40 | 39 | ||
| 41 | /** | 40 | /** |
| 42 | * @program: | 41 | * @program: |
| ... | @@ -83,6 +82,9 @@ public class TdsConnectorIdentityServiceImpl extends FlowAbstractImpl implements | ... | @@ -83,6 +82,9 @@ public class TdsConnectorIdentityServiceImpl extends FlowAbstractImpl implements |
| 83 | @Value("${csbr.platform-type:''}") | 82 | @Value("${csbr.platform-type:''}") |
| 84 | private String platformType; | 83 | private String platformType; |
| 85 | 84 | ||
| 85 | @Resource | ||
| 86 | private ValidatorUtil validatorUtil; | ||
| 87 | |||
| 86 | /** | 88 | /** |
| 87 | * 连接器身份信息分页查询 | 89 | * 连接器身份信息分页查询 |
| 88 | * @author xup | 90 | * @author xup |
| ... | @@ -126,6 +128,7 @@ public class TdsConnectorIdentityServiceImpl extends FlowAbstractImpl implements | ... | @@ -126,6 +128,7 @@ public class TdsConnectorIdentityServiceImpl extends FlowAbstractImpl implements |
| 126 | throw new CsbrSystemException(SystemError.DATA_NOT_EXISTS, messageSourceUtil.notExistsToSelectMessage(String.format("获取%s详情数据", FUNCTION_NAME))); | 128 | throw new CsbrSystemException(SystemError.DATA_NOT_EXISTS, messageSourceUtil.notExistsToSelectMessage(String.format("获取%s详情数据", FUNCTION_NAME))); |
| 127 | } | 129 | } |
| 128 | TdsConnectorIdentityRSVO vo = convertToVO(entity); | 130 | TdsConnectorIdentityRSVO vo = convertToVO(entity); |
| 131 | vo.setApproveVO(approvalFlowUtil.getApprovalCrossTenantInfo(guid)); | ||
| 129 | //查询附件信息和验证信息 | 132 | //查询附件信息和验证信息 |
| 130 | vo.setTdsConnectorAdditional(tdsConnectorAdditionalService.getTdsConnectorAdditionalByConnectorGuid(vo.getGuid())); | 133 | vo.setTdsConnectorAdditional(tdsConnectorAdditionalService.getTdsConnectorAdditionalByConnectorGuid(vo.getGuid())); |
| 131 | vo.setTdsConnectorVerifiable(tdsConnectorVerifiableService.getTdsConnectorVerifiableByConnectorGuid(vo.getGuid())); | 134 | vo.setTdsConnectorVerifiable(tdsConnectorVerifiableService.getTdsConnectorVerifiableByConnectorGuid(vo.getGuid())); |
| ... | @@ -139,7 +142,8 @@ public class TdsConnectorIdentityServiceImpl extends FlowAbstractImpl implements | ... | @@ -139,7 +142,8 @@ public class TdsConnectorIdentityServiceImpl extends FlowAbstractImpl implements |
| 139 | * @param flowBaseVO | 142 | * @param flowBaseVO |
| 140 | * @return boolean | 143 | * @return boolean |
| 141 | */ | 144 | */ |
| 142 | @GlobalTransactional(rollbackFor = Exception.class) | 145 | // @GlobalTransactional(rollbackFor = Exception.class) |
| 146 | @Transactional(rollbackFor = Exception.class) | ||
| 143 | @Override | 147 | @Override |
| 144 | public void saveTdsConnectorIdentity(FlowRQBaseVO flowBaseVO) { | 148 | public void saveTdsConnectorIdentity(FlowRQBaseVO flowBaseVO) { |
| 145 | TdsConnectorIdentityRQVO rqVO = (TdsConnectorIdentityRQVO) flowBaseVO; | 149 | TdsConnectorIdentityRQVO rqVO = (TdsConnectorIdentityRQVO) flowBaseVO; |
| ... | @@ -194,8 +198,8 @@ public class TdsConnectorIdentityServiceImpl extends FlowAbstractImpl implements | ... | @@ -194,8 +198,8 @@ public class TdsConnectorIdentityServiceImpl extends FlowAbstractImpl implements |
| 194 | // 将修改前数据查出来缓存下来,传入到修改后方法中,用于一些特殊逻辑处理,如某个值变化才进行 | 198 | // 将修改前数据查出来缓存下来,传入到修改后方法中,用于一些特殊逻辑处理,如某个值变化才进行 |
| 195 | // MfTdsConnectorIdentity oldEntity = mfTdsConnectorIdentityService.getById(rqVO.getGuid()); | 199 | // MfTdsConnectorIdentity oldEntity = mfTdsConnectorIdentityService.getById(rqVO.getGuid()); |
| 196 | TdsConnectorIdentityRQVO rqVO = (TdsConnectorIdentityRQVO) flowBaseVO; | 200 | TdsConnectorIdentityRQVO rqVO = (TdsConnectorIdentityRQVO) flowBaseVO; |
| 197 | MfTdsConnectorIdentity oldEntity = null; | ||
| 198 | beforeUpdate(rqVO); | 201 | beforeUpdate(rqVO); |
| 202 | MfTdsConnectorIdentity oldEntity = mfTdsConnectorIdentityService.getById(rqVO.getGuid()); | ||
| 199 | MfTdsConnectorIdentity entity = convertToEntity(rqVO); | 203 | MfTdsConnectorIdentity entity = convertToEntity(rqVO); |
| 200 | mfTdsConnectorIdentityService.csbrUpdateEntity(entity); | 204 | mfTdsConnectorIdentityService.csbrUpdateEntity(entity); |
| 201 | // 发起审批流程或保存草稿 | 205 | // 发起审批流程或保存草稿 |
| ... | @@ -283,6 +287,17 @@ public class TdsConnectorIdentityServiceImpl extends FlowAbstractImpl implements | ... | @@ -283,6 +287,17 @@ public class TdsConnectorIdentityServiceImpl extends FlowAbstractImpl implements |
| 283 | return null; | 287 | return null; |
| 284 | } | 288 | } |
| 285 | 289 | ||
| 290 | @Override | ||
| 291 | public Map<String, MfTdsConnectorIdentity> getCrossTenantTdsConnectorIdentitys(Set<String> guidSet) { | ||
| 292 | if(ObjectUtils.isEmpty(guidSet)){ | ||
| 293 | return new HashMap<>(); | ||
| 294 | } | ||
| 295 | LambdaQueryWrapper<MfTdsConnectorIdentity> queryWrapper = Wrappers.lambdaQuery(MfTdsConnectorIdentity.class); | ||
| 296 | queryWrapper.in(MfTdsConnectorIdentity::getGuid,guidSet); | ||
| 297 | mfTdsConnectorIdentityService.csbrExcludeShardingLambdaQueryWrapper(queryWrapper); | ||
| 298 | return mfTdsConnectorIdentityService.list(queryWrapper).stream().collect(Collectors.toMap(MfTdsConnectorIdentity::getGuid, Function.identity())); | ||
| 299 | } | ||
| 300 | |||
| 286 | /** | 301 | /** |
| 287 | * 连接器身份信息新新增前置处理 | 302 | * 连接器身份信息新新增前置处理 |
| 288 | * @author xup | 303 | * @author xup |
| ... | @@ -295,6 +310,17 @@ public class TdsConnectorIdentityServiceImpl extends FlowAbstractImpl implements | ... | @@ -295,6 +310,17 @@ public class TdsConnectorIdentityServiceImpl extends FlowAbstractImpl implements |
| 295 | if(ObjectUtils.isEmpty(rqVO)){ | 310 | if(ObjectUtils.isEmpty(rqVO)){ |
| 296 | throw new CsbrSystemException(SystemError.DATA_INPUT_ERROR, String.format("%s参数为空。",FUNCTION_NAME)); | 311 | throw new CsbrSystemException(SystemError.DATA_INPUT_ERROR, String.format("%s参数为空。",FUNCTION_NAME)); |
| 297 | } | 312 | } |
| 313 | //验证接入连接器名称 | ||
| 314 | if(StringUtils.isBlank(rqVO.getConnectorName())){ | ||
| 315 | throw new CsbrSystemException(SystemError.DATA_INPUT_ERROR,"接入连接器名称为空。"); | ||
| 316 | } | ||
| 317 | //判断是否是草稿 | ||
| 318 | if(!ApprovalStateEnum.DRAFT.getValue().equals(rqVO.getBizApproveState())){ | ||
| 319 | String message = validatorUtil.validateRetrunOne(rqVO); | ||
| 320 | if(StringUtils.isNotBlank(message)){ | ||
| 321 | throw new CsbrSystemException(SystemError.DATA_INPUT_ERROR,message); | ||
| 322 | } | ||
| 323 | } | ||
| 298 | //endregion | 324 | //endregion |
| 299 | 325 | ||
| 300 | //region 2.数据验证特殊处理 | 326 | //region 2.数据验证特殊处理 |
| ... | @@ -304,7 +330,9 @@ public class TdsConnectorIdentityServiceImpl extends FlowAbstractImpl implements | ... | @@ -304,7 +330,9 @@ public class TdsConnectorIdentityServiceImpl extends FlowAbstractImpl implements |
| 304 | //region 2.2.业务数据验证 | 330 | //region 2.2.业务数据验证 |
| 305 | //验证接入连接器名称唯一性 | 331 | //验证接入连接器名称唯一性 |
| 306 | if("ZQ".equals(platformType)) { | 332 | if("ZQ".equals(platformType)) { |
| 307 | verifyUniqueness(rqVO); | 333 | if(verifyUniqueness(rqVO)){ |
| 334 | throw new CsbrSystemException(SystemError.DATA_ALREADY_EXISTS,"该企业下已经存在连接器,无法新增。"); | ||
| 335 | } | ||
| 308 | } | 336 | } |
| 309 | //endregion 2.数据验证特殊处理 | 337 | //endregion 2.数据验证特殊处理 |
| 310 | 338 | ||
| ... | @@ -334,13 +362,12 @@ public class TdsConnectorIdentityServiceImpl extends FlowAbstractImpl implements | ... | @@ -334,13 +362,12 @@ public class TdsConnectorIdentityServiceImpl extends FlowAbstractImpl implements |
| 334 | * 验证是否已经存在连接器 | 362 | * 验证是否已经存在连接器 |
| 335 | * @param rqVO | 363 | * @param rqVO |
| 336 | */ | 364 | */ |
| 337 | private void verifyUniqueness(TdsConnectorIdentityRQVO rqVO) { | 365 | @Override |
| 366 | public Boolean verifyUniqueness(TdsConnectorIdentityRQVO rqVO) { | ||
| 338 | //1、验证是否已经存在连接器 | 367 | //1、验证是否已经存在连接器 |
| 339 | LambdaQueryWrapper<MfTdsConnectorIdentity> queryWrapper = Wrappers.lambdaQuery(); | 368 | LambdaQueryWrapper<MfTdsConnectorIdentity> queryWrapper = Wrappers.lambdaQuery(); |
| 340 | queryWrapper.notIn(MfTdsConnectorIdentity::getBizApproveState,ApprovalStateEnum.CANCEL.getValue(),ApprovalStateEnum.REJECT.getValue()); | 369 | queryWrapper.notIn(MfTdsConnectorIdentity::getBizApproveState,ApprovalStateEnum.CANCEL.getValue(),ApprovalStateEnum.REJECT.getValue(),ApprovalStateEnum.DISABLE.getValue()); |
| 341 | if(mfTdsConnectorIdentityService.count(queryWrapper)>0){ | 370 | return mfTdsConnectorIdentityService.count(queryWrapper)>0; |
| 342 | throw new CsbrSystemException(SystemError.DATA_ALREADY_EXISTS,"该企业下已经存在连接器,无法新增。"); | ||
| 343 | } | ||
| 344 | } | 371 | } |
| 345 | 372 | ||
| 346 | /** | 373 | /** |
| ... | @@ -356,10 +383,12 @@ public class TdsConnectorIdentityServiceImpl extends FlowAbstractImpl implements | ... | @@ -356,10 +383,12 @@ public class TdsConnectorIdentityServiceImpl extends FlowAbstractImpl implements |
| 356 | //region 1.1.输出过滤与补充处理 | 383 | //region 1.1.输出过滤与补充处理 |
| 357 | if(ObjectUtils.isNotEmpty(rqVO.getTdsConnectorAdditional())){ | 384 | if(ObjectUtils.isNotEmpty(rqVO.getTdsConnectorAdditional())){ |
| 358 | rqVO.getTdsConnectorAdditional().setConnectorGuid(rqVO.getGuid()); | 385 | rqVO.getTdsConnectorAdditional().setConnectorGuid(rqVO.getGuid()); |
| 386 | rqVO.getTdsConnectorAdditional().setBizApproveState(rqVO.getBizApproveState()); | ||
| 359 | tdsConnectorAdditionalService.saveTdsConnectorAdditional(rqVO.getTdsConnectorAdditional()); | 387 | tdsConnectorAdditionalService.saveTdsConnectorAdditional(rqVO.getTdsConnectorAdditional()); |
| 360 | } | 388 | } |
| 361 | if(ObjectUtils.isNotEmpty(rqVO.getTdsConnectorVerifiable())){ | 389 | if(ObjectUtils.isNotEmpty(rqVO.getTdsConnectorVerifiable())){ |
| 362 | rqVO.getTdsConnectorVerifiable().setConnectorGuid(rqVO.getGuid()); | 390 | rqVO.getTdsConnectorVerifiable().setConnectorGuid(rqVO.getGuid()); |
| 391 | rqVO.getTdsConnectorAdditional().setConnectorGuid(rqVO.getBizApproveState()); | ||
| 363 | tdsConnectorVerifiableService.saveTdsConnectorVerifiable(rqVO.getTdsConnectorVerifiable()); | 392 | tdsConnectorVerifiableService.saveTdsConnectorVerifiable(rqVO.getTdsConnectorVerifiable()); |
| 364 | } | 393 | } |
| 365 | //endregion 1.1.输出过滤与补充处理 | 394 | //endregion 1.1.输出过滤与补充处理 |
| ... | @@ -380,6 +409,17 @@ public class TdsConnectorIdentityServiceImpl extends FlowAbstractImpl implements | ... | @@ -380,6 +409,17 @@ public class TdsConnectorIdentityServiceImpl extends FlowAbstractImpl implements |
| 380 | // W00012 = {0}:参数[{1}]不能为空! | 409 | // W00012 = {0}:参数[{1}]不能为空! |
| 381 | throw new CsbrSystemException(SystemError.DATA_INPUT_ERROR, messageSourceUtil.getMessage("W00010", String.format("修改%s数据",FUNCTION_NAME), "数据唯一标识")); | 410 | throw new CsbrSystemException(SystemError.DATA_INPUT_ERROR, messageSourceUtil.getMessage("W00010", String.format("修改%s数据",FUNCTION_NAME), "数据唯一标识")); |
| 382 | } | 411 | } |
| 412 | //验证接入连接器名称 | ||
| 413 | if(StringUtils.isBlank(rqVO.getConnectorName())){ | ||
| 414 | throw new CsbrSystemException(SystemError.DATA_INPUT_ERROR,"接入连接器名称为空。"); | ||
| 415 | } | ||
| 416 | //判断是否是草稿 | ||
| 417 | if(!ApprovalStateEnum.DRAFT.getValue().equals(rqVO.getBizApproveState())){ | ||
| 418 | String message = validatorUtil.validateRetrunOne(rqVO); | ||
| 419 | if(StringUtils.isNotBlank(message)){ | ||
| 420 | throw new CsbrSystemException(SystemError.DATA_INPUT_ERROR,message); | ||
| 421 | } | ||
| 422 | } | ||
| 383 | //endregion | 423 | //endregion |
| 384 | 424 | ||
| 385 | //region 2.数据验证特殊处理 | 425 | //region 2.数据验证特殊处理 |
| ... | @@ -429,6 +469,7 @@ public class TdsConnectorIdentityServiceImpl extends FlowAbstractImpl implements | ... | @@ -429,6 +469,7 @@ public class TdsConnectorIdentityServiceImpl extends FlowAbstractImpl implements |
| 429 | TdsConnectorAdditionalRQVO tdsConnectorAdditional = rqVO.getTdsConnectorAdditional(); | 469 | TdsConnectorAdditionalRQVO tdsConnectorAdditional = rqVO.getTdsConnectorAdditional(); |
| 430 | if(ObjectUtils.isNotEmpty(tdsConnectorAdditional)){ | 470 | if(ObjectUtils.isNotEmpty(tdsConnectorAdditional)){ |
| 431 | tdsConnectorAdditional.setConnectorGuid(rqVO.getGuid()); | 471 | tdsConnectorAdditional.setConnectorGuid(rqVO.getGuid()); |
| 472 | tdsConnectorAdditional.setBizApproveState(rqVO.getBizApproveState()); | ||
| 432 | if(StringUtils.isNotBlank(tdsConnectorAdditional.getGuid())){ | 473 | if(StringUtils.isNotBlank(tdsConnectorAdditional.getGuid())){ |
| 433 | tdsConnectorAdditionalService.updateTdsConnectorAdditional(tdsConnectorAdditional); | 474 | tdsConnectorAdditionalService.updateTdsConnectorAdditional(tdsConnectorAdditional); |
| 434 | }else { | 475 | }else { |
| ... | @@ -438,6 +479,7 @@ public class TdsConnectorIdentityServiceImpl extends FlowAbstractImpl implements | ... | @@ -438,6 +479,7 @@ public class TdsConnectorIdentityServiceImpl extends FlowAbstractImpl implements |
| 438 | TdsConnectorVerifiableRQVO tdsConnectorVerifiable = rqVO.getTdsConnectorVerifiable(); | 479 | TdsConnectorVerifiableRQVO tdsConnectorVerifiable = rqVO.getTdsConnectorVerifiable(); |
| 439 | if(ObjectUtils.isNotEmpty(tdsConnectorVerifiable)){ | 480 | if(ObjectUtils.isNotEmpty(tdsConnectorVerifiable)){ |
| 440 | tdsConnectorVerifiable.setConnectorGuid(rqVO.getGuid()); | 481 | tdsConnectorVerifiable.setConnectorGuid(rqVO.getGuid()); |
| 482 | tdsConnectorVerifiable.setBizApproveState(rqVO.getBizApproveState()); | ||
| 441 | if(StringUtils.isNotBlank(tdsConnectorVerifiable.getGuid())){ | 483 | if(StringUtils.isNotBlank(tdsConnectorVerifiable.getGuid())){ |
| 442 | tdsConnectorVerifiableService.updateTdsConnectorVerifiable(tdsConnectorVerifiable); | 484 | tdsConnectorVerifiableService.updateTdsConnectorVerifiable(tdsConnectorVerifiable); |
| 443 | }else{ | 485 | }else{ |
| ... | @@ -535,8 +577,12 @@ public class TdsConnectorIdentityServiceImpl extends FlowAbstractImpl implements | ... | @@ -535,8 +577,12 @@ public class TdsConnectorIdentityServiceImpl extends FlowAbstractImpl implements |
| 535 | "实体数据转换为视图对象实体数据", "实体数据")); | 577 | "实体数据转换为视图对象实体数据", "实体数据")); |
| 536 | } | 578 | } |
| 537 | List<TdsConnectorIdentityRSVO> voList = new ArrayList<>(entityList.size()); | 579 | List<TdsConnectorIdentityRSVO> voList = new ArrayList<>(entityList.size()); |
| 580 | Map<String, BizApproveVO> approvalCrossTenantInfoMap = approvalFlowUtil.getApprovalCrossTenantInfoMap(entityList.stream().map(MfTdsConnectorIdentity::getGuid).collect(Collectors.toSet())); | ||
| 538 | for (MfTdsConnectorIdentity item : entityList) { | 581 | for (MfTdsConnectorIdentity item : entityList) { |
| 539 | TdsConnectorIdentityRSVO vo = convertToVO(item); | 582 | TdsConnectorIdentityRSVO vo = convertToVO(item); |
| 583 | if(ObjectUtils.isNotEmpty(approvalCrossTenantInfoMap) && approvalCrossTenantInfoMap.containsKey(vo.getGuid())){ | ||
| 584 | vo.setApproveVO(approvalCrossTenantInfoMap.get(vo.getGuid())); | ||
| 585 | } | ||
| 540 | voList.add(vo); | 586 | voList.add(vo); |
| 541 | } | 587 | } |
| 542 | return voList; | 588 | return voList; | ... | ... |
| ... | @@ -8,6 +8,7 @@ import com.csbr.cloud.common.exception.CsbrSystemException; | ... | @@ -8,6 +8,7 @@ import com.csbr.cloud.common.exception.CsbrSystemException; |
| 8 | import com.csbr.cloud.common.util.CommonUtil; | 8 | import com.csbr.cloud.common.util.CommonUtil; |
| 9 | import com.csbr.cloud.common.util.CsbrBeanUtil; | 9 | import com.csbr.cloud.common.util.CsbrBeanUtil; |
| 10 | import com.csbr.cloud.common.util.MessageSourceUtil; | 10 | import com.csbr.cloud.common.util.MessageSourceUtil; |
| 11 | import com.csbr.cloud.mybatis.util.ValidatorUtil; | ||
| 11 | import com.csbr.qingcloud.portal.domain.vo.TdsConnectorVerifiableQueryVO; | 12 | import com.csbr.qingcloud.portal.domain.vo.TdsConnectorVerifiableQueryVO; |
| 12 | import com.csbr.qingcloud.portal.domain.vo.TdsConnectorVerifiableRQVO; | 13 | import com.csbr.qingcloud.portal.domain.vo.TdsConnectorVerifiableRQVO; |
| 13 | import com.csbr.qingcloud.portal.domain.vo.TdsConnectorVerifiableRSVO; | 14 | import com.csbr.qingcloud.portal.domain.vo.TdsConnectorVerifiableRSVO; |
| ... | @@ -15,6 +16,7 @@ import com.csbr.qingcloud.portal.mybatis.entity.MfTdsConnectorVerifiable; | ... | @@ -15,6 +16,7 @@ import com.csbr.qingcloud.portal.mybatis.entity.MfTdsConnectorVerifiable; |
| 15 | import com.csbr.qingcloud.portal.mybatis.service.MfTdsConnectorVerifiableService; | 16 | import com.csbr.qingcloud.portal.mybatis.service.MfTdsConnectorVerifiableService; |
| 16 | import com.csbr.qingcloud.portal.service.TdsConnectorVerifiableService; | 17 | import com.csbr.qingcloud.portal.service.TdsConnectorVerifiableService; |
| 17 | import csbr.cloud.entity.domain.base.vo.PageListVO; | 18 | import csbr.cloud.entity.domain.base.vo.PageListVO; |
| 19 | import csbr.cloud.entity.enums.ApprovalStateEnum; | ||
| 18 | import jakarta.annotation.Resource; | 20 | import jakarta.annotation.Resource; |
| 19 | import lombok.extern.slf4j.Slf4j; | 21 | import lombok.extern.slf4j.Slf4j; |
| 20 | import org.apache.commons.collections.CollectionUtils; | 22 | import org.apache.commons.collections.CollectionUtils; |
| ... | @@ -51,6 +53,9 @@ public class TdsConnectorVerifiableServiceImpl implements TdsConnectorVerifiable | ... | @@ -51,6 +53,9 @@ public class TdsConnectorVerifiableServiceImpl implements TdsConnectorVerifiable |
| 51 | @Resource | 53 | @Resource |
| 52 | private MessageSourceUtil messageSourceUtil; | 54 | private MessageSourceUtil messageSourceUtil; |
| 53 | 55 | ||
| 56 | @Resource | ||
| 57 | private ValidatorUtil validatorUtil; | ||
| 58 | |||
| 54 | /** | 59 | /** |
| 55 | * 连接器可验信息分页查询 | 60 | * 连接器可验信息分页查询 |
| 56 | * @author xup | 61 | * @author xup |
| ... | @@ -216,6 +221,16 @@ public class TdsConnectorVerifiableServiceImpl implements TdsConnectorVerifiable | ... | @@ -216,6 +221,16 @@ public class TdsConnectorVerifiableServiceImpl implements TdsConnectorVerifiable |
| 216 | */ | 221 | */ |
| 217 | private void beforeSave(TdsConnectorVerifiableRQVO rqVO) { | 222 | private void beforeSave(TdsConnectorVerifiableRQVO rqVO) { |
| 218 | //region 1.输入基础验证 | 223 | //region 1.输入基础验证 |
| 224 | if(ObjectUtils.isEmpty(rqVO)){ | ||
| 225 | throw new CsbrSystemException(SystemError.DATA_INPUT_ERROR, String.format("%s参数为空。",FUNCTION_NAME)); | ||
| 226 | } | ||
| 227 | //判断是否是草稿 | ||
| 228 | if(!ApprovalStateEnum.DRAFT.getValue().equals(rqVO.getBizApproveState())){ | ||
| 229 | String message = validatorUtil.validateRetrunOne(rqVO); | ||
| 230 | if(StringUtils.isNotBlank(message)){ | ||
| 231 | throw new CsbrSystemException(SystemError.DATA_INPUT_ERROR,message); | ||
| 232 | } | ||
| 233 | } | ||
| 219 | //endregion | 234 | //endregion |
| 220 | 235 | ||
| 221 | //region 2.数据验证特殊处理 | 236 | //region 2.数据验证特殊处理 |
| ... | @@ -278,6 +293,14 @@ public class TdsConnectorVerifiableServiceImpl implements TdsConnectorVerifiable | ... | @@ -278,6 +293,14 @@ public class TdsConnectorVerifiableServiceImpl implements TdsConnectorVerifiable |
| 278 | // W00012 = {0}:参数[{1}]不能为空! | 293 | // W00012 = {0}:参数[{1}]不能为空! |
| 279 | throw new CsbrSystemException(SystemError.DATA_INPUT_ERROR, messageSourceUtil.getMessage("W00010", String.format("修改%s数据",FUNCTION_NAME), "数据唯一标识")); | 294 | throw new CsbrSystemException(SystemError.DATA_INPUT_ERROR, messageSourceUtil.getMessage("W00010", String.format("修改%s数据",FUNCTION_NAME), "数据唯一标识")); |
| 280 | } | 295 | } |
| 296 | |||
| 297 | //判断是否是草稿 | ||
| 298 | if(!ApprovalStateEnum.DRAFT.getValue().equals(rqVO.getBizApproveState())){ | ||
| 299 | String message = validatorUtil.validateRetrunOne(rqVO); | ||
| 300 | if(StringUtils.isNotBlank(message)){ | ||
| 301 | throw new CsbrSystemException(SystemError.DATA_INPUT_ERROR,message); | ||
| 302 | } | ||
| 303 | } | ||
| 281 | //endregion | 304 | //endregion |
| 282 | 305 | ||
| 283 | //region 2.数据验证特殊处理 | 306 | //region 2.数据验证特殊处理 | ... | ... |
-
Please register or sign in to post a comment