可信空间连接器入住接口
Showing
11 changed files
with
93 additions
and
45 deletions
| ... | @@ -84,6 +84,13 @@ public class TdsConnectorIdentityController { | ... | @@ -84,6 +84,13 @@ public class TdsConnectorIdentityController { |
| 84 | return CommonRes.success(true); | 84 | return CommonRes.success(true); |
| 85 | } | 85 | } |
| 86 | 86 | ||
| 87 | @GetMapping("/get-effective-connector") | ||
| 88 | @SystemLog(value = "连接器身份信息-查询有效的连接器信息") | ||
| 89 | public CommonRes<TdsConnectorIdentityRSVO> getEffectiveConnector() { | ||
| 90 | TdsConnectorIdentityRSVO vo = tdsConnectorIdentityService.getEffectiveConnector(); | ||
| 91 | return CommonRes.success(vo); | ||
| 92 | } | ||
| 93 | |||
| 87 | //endregion | 94 | //endregion |
| 88 | 95 | ||
| 89 | } | 96 | } | ... | ... |
| 1 | package com.csbr.qingcloud.portal.domain.vo; | 1 | 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 io.swagger.v3.oas.annotations.media.Schema; | 5 | import io.swagger.v3.oas.annotations.media.Schema; |
| 5 | import com.fasterxml.jackson.annotation.JsonFormat; | 6 | import com.fasterxml.jackson.annotation.JsonFormat; |
| 6 | import lombok.Data; | 7 | import lombok.Data; |
| ... | @@ -35,6 +36,14 @@ public class TdsConnectorIdentityManagementRSVO { | ... | @@ -35,6 +36,14 @@ public class TdsConnectorIdentityManagementRSVO { |
| 35 | @Schema(description = "使用场景(数据字典使用场景)") | 36 | @Schema(description = "使用场景(数据字典使用场景)") |
| 36 | private String useScenariosCode; | 37 | private String useScenariosCode; |
| 37 | 38 | ||
| 39 | |||
| 40 | /** | ||
| 41 | * 使用场景名称 | ||
| 42 | */ | ||
| 43 | @Schema(description = "使用场景") | ||
| 44 | @SystemParamsDict(dictTypeName = "可信空间使用场景",codeFieldName = "useScenariosCode") | ||
| 45 | private String useScenariosName; | ||
| 46 | |||
| 38 | /** | 47 | /** |
| 39 | * 期望效期 | 48 | * 期望效期 |
| 40 | */ | 49 | */ | ... | ... |
| ... | @@ -3,6 +3,7 @@ package com.csbr.qingcloud.portal.mybatis.entity; | ... | @@ -3,6 +3,7 @@ package com.csbr.qingcloud.portal.mybatis.entity; |
| 3 | import com.baomidou.mybatisplus.annotation.FieldStrategy; | 3 | import com.baomidou.mybatisplus.annotation.FieldStrategy; |
| 4 | import com.baomidou.mybatisplus.annotation.TableField; | 4 | import com.baomidou.mybatisplus.annotation.TableField; |
| 5 | import csbr.cloud.entity.domain.base.dao.BaseDO; | 5 | import csbr.cloud.entity.domain.base.dao.BaseDO; |
| 6 | import csbr.cloud.entity.domain.base.dao.BaseShardingDO; | ||
| 6 | import jdk.jfr.Name; | 7 | import jdk.jfr.Name; |
| 7 | import lombok.Data; | 8 | import lombok.Data; |
| 8 | import lombok.EqualsAndHashCode; | 9 | import lombok.EqualsAndHashCode; |
| ... | @@ -19,13 +20,7 @@ import java.util.Date; | ... | @@ -19,13 +20,7 @@ import java.util.Date; |
| 19 | @EqualsAndHashCode(callSuper = true) | 20 | @EqualsAndHashCode(callSuper = true) |
| 20 | @Accessors(chain = true) | 21 | @Accessors(chain = true) |
| 21 | @Name("连接器附加信息") | 22 | @Name("连接器附加信息") |
| 22 | public class MfTdsConnectorAdditional extends BaseDO { | 23 | public class MfTdsConnectorAdditional extends BaseShardingDO { |
| 23 | |||
| 24 | /** | ||
| 25 | * 会员Guid | ||
| 26 | */ | ||
| 27 | @Name("会员Guid") | ||
| 28 | private String tenantGuid; | ||
| 29 | 24 | ||
| 30 | /** | 25 | /** |
| 31 | * 连接器Guid | 26 | * 连接器Guid | ... | ... |
| ... | @@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.annotation.TableField; | ... | @@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.annotation.TableField; |
| 6 | import com.baomidou.mybatisplus.annotation.TableName; | 6 | import com.baomidou.mybatisplus.annotation.TableName; |
| 7 | import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler; | 7 | import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler; |
| 8 | import csbr.cloud.entity.domain.base.dao.BaseDO; | 8 | import csbr.cloud.entity.domain.base.dao.BaseDO; |
| 9 | import csbr.cloud.entity.domain.base.dao.BaseShardingDO; | ||
| 9 | import jdk.jfr.Name; | 10 | import jdk.jfr.Name; |
| 10 | import lombok.Data; | 11 | import lombok.Data; |
| 11 | import lombok.EqualsAndHashCode; | 12 | import lombok.EqualsAndHashCode; |
| ... | @@ -24,13 +25,7 @@ import java.util.List; | ... | @@ -24,13 +25,7 @@ import java.util.List; |
| 24 | @Accessors(chain = true) | 25 | @Accessors(chain = true) |
| 25 | @Name("连接器身份信息") | 26 | @Name("连接器身份信息") |
| 26 | @TableName(autoResultMap = true) | 27 | @TableName(autoResultMap = true) |
| 27 | public class MfTdsConnectorIdentity extends BaseDO { | 28 | public class MfTdsConnectorIdentity extends BaseShardingDO { |
| 28 | |||
| 29 | /** | ||
| 30 | * 会员Guid | ||
| 31 | */ | ||
| 32 | @Name("会员Guid") | ||
| 33 | private String tenantGuid; | ||
| 34 | 29 | ||
| 35 | /** | 30 | /** |
| 36 | * 接入连接器名称 | 31 | * 接入连接器名称 |
| ... | @@ -80,6 +75,7 @@ public class MfTdsConnectorIdentity extends BaseDO { | ... | @@ -80,6 +75,7 @@ public class MfTdsConnectorIdentity extends BaseDO { |
| 80 | * 可信身份凭证 | 75 | * 可信身份凭证 |
| 81 | */ | 76 | */ |
| 82 | @Name("可信身份凭证") | 77 | @Name("可信身份凭证") |
| 78 | @TableField(typeHandler = FastjsonTypeHandler.class) | ||
| 83 | private JSONArray trustedIdentityCredential; | 79 | private JSONArray trustedIdentityCredential; |
| 84 | 80 | ||
| 85 | /** | 81 | /** | ... | ... |
| ... | @@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.annotation.TableField; | ... | @@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.annotation.TableField; |
| 5 | import com.baomidou.mybatisplus.annotation.TableName; | 5 | import com.baomidou.mybatisplus.annotation.TableName; |
| 6 | import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler; | 6 | import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler; |
| 7 | import csbr.cloud.entity.domain.base.dao.BaseDO; | 7 | import csbr.cloud.entity.domain.base.dao.BaseDO; |
| 8 | import csbr.cloud.entity.domain.base.dao.BaseShardingDO; | ||
| 8 | import jdk.jfr.Name; | 9 | import jdk.jfr.Name; |
| 9 | import lombok.Data; | 10 | import lombok.Data; |
| 10 | import lombok.EqualsAndHashCode; | 11 | import lombok.EqualsAndHashCode; |
| ... | @@ -22,7 +23,7 @@ import java.util.Date; | ... | @@ -22,7 +23,7 @@ import java.util.Date; |
| 22 | @Accessors(chain = true) | 23 | @Accessors(chain = true) |
| 23 | @Name("连接器身份管理") | 24 | @Name("连接器身份管理") |
| 24 | @TableName(autoResultMap = true) | 25 | @TableName(autoResultMap = true) |
| 25 | public class MfTdsConnectorIdentityManagement extends BaseDO { | 26 | public class MfTdsConnectorIdentityManagement extends BaseShardingDO { |
| 26 | 27 | ||
| 27 | /** | 28 | /** |
| 28 | * 节点Guid | 29 | * 节点Guid | ... | ... |
| ... | @@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.annotation.TableName; | ... | @@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.annotation.TableName; |
| 7 | import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler; | 7 | import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler; |
| 8 | import com.fasterxml.jackson.annotation.JsonFormat; | 8 | import com.fasterxml.jackson.annotation.JsonFormat; |
| 9 | import csbr.cloud.entity.domain.base.dao.BaseDO; | 9 | import csbr.cloud.entity.domain.base.dao.BaseDO; |
| 10 | import csbr.cloud.entity.domain.base.dao.BaseShardingDO; | ||
| 10 | import io.swagger.v3.oas.annotations.media.Schema; | 11 | import io.swagger.v3.oas.annotations.media.Schema; |
| 11 | import jakarta.validation.constraints.NotNull; | 12 | import jakarta.validation.constraints.NotNull; |
| 12 | import jdk.jfr.Name; | 13 | import jdk.jfr.Name; |
| ... | @@ -27,13 +28,7 @@ import java.util.Map; | ... | @@ -27,13 +28,7 @@ import java.util.Map; |
| 27 | @Accessors(chain = true) | 28 | @Accessors(chain = true) |
| 28 | @Name("连接器可验信息") | 29 | @Name("连接器可验信息") |
| 29 | @TableName(autoResultMap = true) | 30 | @TableName(autoResultMap = true) |
| 30 | public class MfTdsConnectorVerifiable extends BaseDO { | 31 | public class MfTdsConnectorVerifiable extends BaseShardingDO { |
| 31 | |||
| 32 | /** | ||
| 33 | * 会员Guid | ||
| 34 | */ | ||
| 35 | @Name("会员Guid") | ||
| 36 | private String tenantGuid; | ||
| 37 | 32 | ||
| 38 | /** | 33 | /** |
| 39 | * 连接器Guid | 34 | * 连接器Guid | ... | ... |
| ... | @@ -76,4 +76,10 @@ public interface TdsConnectorIdentityService { | ... | @@ -76,4 +76,10 @@ public interface TdsConnectorIdentityService { |
| 76 | * @param bizApproveVO | 76 | * @param bizApproveVO |
| 77 | */ | 77 | */ |
| 78 | void flowComplete(BizCallbackDTO bizApproveVO); | 78 | void flowComplete(BizCallbackDTO bizApproveVO); |
| 79 | |||
| 80 | /** | ||
| 81 | * 查询有效的连接器信息 | ||
| 82 | * @return | ||
| 83 | */ | ||
| 84 | TdsConnectorIdentityRSVO getEffectiveConnector(); | ||
| 79 | } | 85 | } | ... | ... |
| ... | @@ -202,7 +202,7 @@ public class TdsConnectorAdditionalServiceImpl implements TdsConnectorAdditional | ... | @@ -202,7 +202,7 @@ public class TdsConnectorAdditionalServiceImpl implements TdsConnectorAdditional |
| 202 | if(ObjectUtils.isEmpty(connectorGuids)){ | 202 | if(ObjectUtils.isEmpty(connectorGuids)){ |
| 203 | return; | 203 | return; |
| 204 | } | 204 | } |
| 205 | LambdaUpdateWrapper<MfTdsConnectorAdditional> removeWrapper = Wrappers.lambdaUpdate(); | 205 | LambdaUpdateWrapper<MfTdsConnectorAdditional> removeWrapper = mfTdsConnectorAdditionalService.csbrUpdateWrapper(MfTdsConnectorAdditional.class); |
| 206 | removeWrapper.in(MfTdsConnectorAdditional::getConnectorGuid,connectorGuids); | 206 | removeWrapper.in(MfTdsConnectorAdditional::getConnectorGuid,connectorGuids); |
| 207 | mfTdsConnectorAdditionalService.remove(removeWrapper); | 207 | mfTdsConnectorAdditionalService.remove(removeWrapper); |
| 208 | } | 208 | } | ... | ... |
| 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.Wrapper; | ||
| 3 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | 4 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| 4 | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; | 5 | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| 6 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; | ||
| 5 | import com.csbr.cloud.common.enums.SystemError; | 7 | import com.csbr.cloud.common.enums.SystemError; |
| 6 | import com.csbr.cloud.common.enums.WorkFlowBizEnum; | 8 | import com.csbr.cloud.common.enums.WorkFlowBizEnum; |
| 7 | import com.csbr.qingcloud.portal.domain.vo.TdsConnectorIdentityManagementVoucherRQVO; | 9 | import com.csbr.qingcloud.portal.domain.vo.TdsConnectorIdentityManagementVoucherRQVO; |
| ... | @@ -27,6 +29,7 @@ import jakarta.annotation.Resource; | ... | @@ -27,6 +29,7 @@ import jakarta.annotation.Resource; |
| 27 | import lombok.extern.slf4j.Slf4j; | 29 | import lombok.extern.slf4j.Slf4j; |
| 28 | import org.apache.commons.collections.CollectionUtils; | 30 | import org.apache.commons.collections.CollectionUtils; |
| 29 | import org.apache.commons.lang3.StringUtils; | 31 | import org.apache.commons.lang3.StringUtils; |
| 32 | import org.springframework.beans.factory.annotation.Value; | ||
| 30 | import org.springframework.stereotype.Service; | 33 | import org.springframework.stereotype.Service; |
| 31 | import io.seata.spring.annotation.GlobalTransactional; | 34 | import io.seata.spring.annotation.GlobalTransactional; |
| 32 | import org.springframework.transaction.annotation.Transactional; | 35 | import org.springframework.transaction.annotation.Transactional; |
| ... | @@ -67,6 +70,9 @@ public class TdsConnectorIdentityManagementServiceImpl extends FlowAbstractImpl | ... | @@ -67,6 +70,9 @@ public class TdsConnectorIdentityManagementServiceImpl extends FlowAbstractImpl |
| 67 | @Resource | 70 | @Resource |
| 68 | private MessageSourceUtil messageSourceUtil; | 71 | private MessageSourceUtil messageSourceUtil; |
| 69 | 72 | ||
| 73 | @Value("${csbr.platform-type:''}") | ||
| 74 | private String platformType; | ||
| 75 | |||
| 70 | /** | 76 | /** |
| 71 | * 连接器身份管理分页查询 | 77 | * 连接器身份管理分页查询 |
| 72 | * @author xup | 78 | * @author xup |
| ... | @@ -82,6 +88,7 @@ public class TdsConnectorIdentityManagementServiceImpl extends FlowAbstractImpl | ... | @@ -82,6 +88,7 @@ public class TdsConnectorIdentityManagementServiceImpl extends FlowAbstractImpl |
| 82 | queryWrapper.in(CollectionUtils.isNotEmpty(queryVO.getGuidList()), MfTdsConnectorIdentityManagement::getGuid, | 88 | queryWrapper.in(CollectionUtils.isNotEmpty(queryVO.getGuidList()), MfTdsConnectorIdentityManagement::getGuid, |
| 83 | queryVO.getGuidList()); | 89 | queryVO.getGuidList()); |
| 84 | queryWrapper.orderByDesc(MfTdsConnectorIdentityManagement::getCreateTime); | 90 | queryWrapper.orderByDesc(MfTdsConnectorIdentityManagement::getCreateTime); |
| 91 | mfTdsConnectorIdentityManagementService.csbrExcludeShardingLambdaQueryWrapper(queryWrapper); | ||
| 85 | PageListVO<MfTdsConnectorIdentityManagement> pageList = mfTdsConnectorIdentityManagementService.csbrPageList(queryVO, queryWrapper); | 92 | PageListVO<MfTdsConnectorIdentityManagement> pageList = mfTdsConnectorIdentityManagementService.csbrPageList(queryVO, queryWrapper); |
| 86 | PageListVO<TdsConnectorIdentityManagementRSVO> rsPageList = csbrBeanUtil.convert(pageList, PageListVO.class); | 93 | PageListVO<TdsConnectorIdentityManagementRSVO> rsPageList = csbrBeanUtil.convert(pageList, PageListVO.class); |
| 87 | afterQuery(pageList, rsPageList); | 94 | afterQuery(pageList, rsPageList); |
| ... | @@ -241,14 +248,8 @@ public class TdsConnectorIdentityManagementServiceImpl extends FlowAbstractImpl | ... | @@ -241,14 +248,8 @@ public class TdsConnectorIdentityManagementServiceImpl extends FlowAbstractImpl |
| 241 | if (ApprovalStateEnum.PASSED.getValue().equals(dto.getApprovalState())) { | 248 | if (ApprovalStateEnum.PASSED.getValue().equals(dto.getApprovalState())) { |
| 242 | // todo | 249 | // todo |
| 243 | } | 250 | } |
| 244 | // 同步更新审批状态 | 251 | entity.setBizApproveState(dto.getApprovalState()); |
| 245 | LambdaUpdateWrapper<MfTdsConnectorIdentityManagement> updateWrapper = mfTdsConnectorIdentityManagementService.csbrUpdateWrapper(MfTdsConnectorIdentityManagement.class); | 252 | mfTdsConnectorIdentityManagementService.updateById(entity); |
| 246 | updateWrapper.set(MfTdsConnectorIdentityManagement::getBizApproveState, dto.getApprovalState()); | ||
| 247 | updateWrapper.eq(MfTdsConnectorIdentityManagement::getGuid, dto.getBizGuid()); | ||
| 248 | boolean flag = mfTdsConnectorIdentityManagementService.update(updateWrapper); | ||
| 249 | if (!flag) { | ||
| 250 | throw new CsbrSystemException(SystemError.DATA_UPDATE_ERROR, messageSourceUtil.updateMessage(String.format("%s的业务审批状态", FUNCTION_NAME))); | ||
| 251 | } | ||
| 252 | } | 253 | } |
| 253 | 254 | ||
| 254 | @Override | 255 | @Override |
| ... | @@ -301,6 +302,9 @@ public class TdsConnectorIdentityManagementServiceImpl extends FlowAbstractImpl | ... | @@ -301,6 +302,9 @@ public class TdsConnectorIdentityManagementServiceImpl extends FlowAbstractImpl |
| 301 | 302 | ||
| 302 | //region 2.数据验证特殊处理 | 303 | //region 2.数据验证特殊处理 |
| 303 | //region 2.1.业务合规性验证 | 304 | //region 2.1.业务合规性验证 |
| 305 | if("ZQ".equals(platformType)) { | ||
| 306 | verifyDuplication(rqVO); | ||
| 307 | } | ||
| 304 | //endregion 2.1.业务合规性验证 | 308 | //endregion 2.1.业务合规性验证 |
| 305 | 309 | ||
| 306 | //region 2.2.业务数据验证 | 310 | //region 2.2.业务数据验证 |
| ... | @@ -331,6 +335,29 @@ public class TdsConnectorIdentityManagementServiceImpl extends FlowAbstractImpl | ... | @@ -331,6 +335,29 @@ public class TdsConnectorIdentityManagementServiceImpl extends FlowAbstractImpl |
| 331 | } | 335 | } |
| 332 | 336 | ||
| 333 | /** | 337 | /** |
| 338 | * 验证重复 | ||
| 339 | * @param rqVO | ||
| 340 | */ | ||
| 341 | private void verifyDuplication(TdsConnectorIdentityManagementRQVO rqVO) { | ||
| 342 | //验证统一使用场景下是否存在没过期的 | ||
| 343 | //1、验证重复 | ||
| 344 | LambdaQueryWrapper<MfTdsConnectorIdentityManagement> queryWrapper = Wrappers.lambdaQuery(MfTdsConnectorIdentityManagement.class); | ||
| 345 | if(StringUtils.isNotBlank(rqVO.getGuid())){ | ||
| 346 | queryWrapper.ne(MfTdsConnectorIdentityManagement::getGuid,rqVO.getGuid()); | ||
| 347 | } | ||
| 348 | //排除驳回、撤回的数据 | ||
| 349 | queryWrapper.notIn(MfTdsConnectorIdentityManagement::getBizApproveState,ApprovalStateEnum.CANCEL.getValue(), | ||
| 350 | ApprovalStateEnum.REJECT.getValue()); | ||
| 351 | //根据使用场景查询 | ||
| 352 | queryWrapper.eq(MfTdsConnectorIdentityManagement::getUseScenariosCode,rqVO.getUseScenariosCode()); | ||
| 353 | //期望效期有效的 | ||
| 354 | queryWrapper.gt(MfTdsConnectorIdentityManagement::getExpirationTime,new Date()); | ||
| 355 | if(mfTdsConnectorIdentityManagementService.count(queryWrapper)>0){ | ||
| 356 | throw new CsbrSystemException(SystemError.DATA_ALREADY_EXISTS,"该连接器的使用场景已经存在。"); | ||
| 357 | } | ||
| 358 | } | ||
| 359 | |||
| 360 | /** | ||
| 334 | * 连接器身份管理新增后置处理 | 361 | * 连接器身份管理新增后置处理 |
| 335 | * @author xup | 362 | * @author xup |
| 336 | * @date 2025-09-23 17:35 | 363 | * @date 2025-09-23 17:35 |
| ... | @@ -457,7 +484,7 @@ public class TdsConnectorIdentityManagementServiceImpl extends FlowAbstractImpl | ... | @@ -457,7 +484,7 @@ public class TdsConnectorIdentityManagementServiceImpl extends FlowAbstractImpl |
| 457 | rqQueryVO.setIsNeedQuery(true); | 484 | rqQueryVO.setIsNeedQuery(true); |
| 458 | if (approvalFlowUtil.isQueryBizGuid(rqQueryVO)) { | 485 | if (approvalFlowUtil.isQueryBizGuid(rqQueryVO)) { |
| 459 | rqQueryVO.setFlowType(FLOW_TYPE); | 486 | rqQueryVO.setFlowType(FLOW_TYPE); |
| 460 | List<String> bizGuidList = approvalFlowUtil.getApprovalBizGuids(rqQueryVO); | 487 | List<String> bizGuidList = approvalFlowUtil.getApprovalCrossTenantBizGuids(rqQueryVO); |
| 461 | if (CollectionUtils.isEmpty(bizGuidList)) { | 488 | if (CollectionUtils.isEmpty(bizGuidList)) { |
| 462 | rqQueryVO.setIsNeedQuery(false); | 489 | rqQueryVO.setIsNeedQuery(false); |
| 463 | } else { | 490 | } else { | ... | ... |
| ... | @@ -29,6 +29,7 @@ import lombok.extern.slf4j.Slf4j; | ... | @@ -29,6 +29,7 @@ import lombok.extern.slf4j.Slf4j; |
| 29 | import org.apache.commons.collections.CollectionUtils; | 29 | import org.apache.commons.collections.CollectionUtils; |
| 30 | import org.apache.commons.lang3.ObjectUtils; | 30 | import org.apache.commons.lang3.ObjectUtils; |
| 31 | import org.apache.commons.lang3.StringUtils; | 31 | import org.apache.commons.lang3.StringUtils; |
| 32 | import org.springframework.beans.factory.annotation.Value; | ||
| 32 | import org.springframework.stereotype.Service; | 33 | import org.springframework.stereotype.Service; |
| 33 | import org.springframework.transaction.annotation.Transactional; | 34 | import org.springframework.transaction.annotation.Transactional; |
| 34 | 35 | ||
| ... | @@ -79,6 +80,9 @@ public class TdsConnectorIdentityServiceImpl extends FlowAbstractImpl implements | ... | @@ -79,6 +80,9 @@ public class TdsConnectorIdentityServiceImpl extends FlowAbstractImpl implements |
| 79 | @Resource | 80 | @Resource |
| 80 | private BizCommonRedisUtil bizCommonRedisUtil; | 81 | private BizCommonRedisUtil bizCommonRedisUtil; |
| 81 | 82 | ||
| 83 | @Value("${csbr.platform-type:''}") | ||
| 84 | private String platformType; | ||
| 85 | |||
| 82 | /** | 86 | /** |
| 83 | * 连接器身份信息分页查询 | 87 | * 连接器身份信息分页查询 |
| 84 | * @author xup | 88 | * @author xup |
| ... | @@ -94,6 +98,7 @@ public class TdsConnectorIdentityServiceImpl extends FlowAbstractImpl implements | ... | @@ -94,6 +98,7 @@ public class TdsConnectorIdentityServiceImpl extends FlowAbstractImpl implements |
| 94 | queryWrapper.in(CollectionUtils.isNotEmpty(queryVO.getGuidList()), MfTdsConnectorIdentity::getGuid, | 98 | queryWrapper.in(CollectionUtils.isNotEmpty(queryVO.getGuidList()), MfTdsConnectorIdentity::getGuid, |
| 95 | queryVO.getGuidList()); | 99 | queryVO.getGuidList()); |
| 96 | queryWrapper.orderByDesc(MfTdsConnectorIdentity::getCreateTime); | 100 | queryWrapper.orderByDesc(MfTdsConnectorIdentity::getCreateTime); |
| 101 | mfTdsConnectorIdentityService.csbrExcludeShardingLambdaQueryWrapper(queryWrapper); | ||
| 97 | PageListVO<MfTdsConnectorIdentity> pageList = mfTdsConnectorIdentityService.csbrPageList(queryVO, queryWrapper); | 102 | PageListVO<MfTdsConnectorIdentity> pageList = mfTdsConnectorIdentityService.csbrPageList(queryVO, queryWrapper); |
| 98 | PageListVO<TdsConnectorIdentityRSVO> rsPageList = csbrBeanUtil.convert(pageList, PageListVO.class); | 103 | PageListVO<TdsConnectorIdentityRSVO> rsPageList = csbrBeanUtil.convert(pageList, PageListVO.class); |
| 99 | afterQuery(pageList, rsPageList); | 104 | afterQuery(pageList, rsPageList); |
| ... | @@ -263,10 +268,19 @@ public class TdsConnectorIdentityServiceImpl extends FlowAbstractImpl implements | ... | @@ -263,10 +268,19 @@ public class TdsConnectorIdentityServiceImpl extends FlowAbstractImpl implements |
| 263 | throw new CsbrSystemException(SystemError.DATA_NOT_EXISTS, messageSourceUtil.notExistsToSelectMessage(FUNCTION_NAME)); | 268 | throw new CsbrSystemException(SystemError.DATA_NOT_EXISTS, messageSourceUtil.notExistsToSelectMessage(FUNCTION_NAME)); |
| 264 | } | 269 | } |
| 265 | // 同步更新审批状态 | 270 | // 同步更新审批状态 |
| 266 | LambdaUpdateWrapper<MfTdsConnectorIdentity> updateWrapper = mfTdsConnectorIdentityService.csbrUpdateWrapper(MfTdsConnectorIdentity.class); | 271 | entity.setBizApproveState(bizApproveVO.getApprovalState()); |
| 267 | updateWrapper.set(MfTdsConnectorIdentity::getBizApproveState, bizApproveVO.getApprovalState()); | 272 | mfTdsConnectorIdentityService.updateById(entity); |
| 268 | updateWrapper.eq(MfTdsConnectorIdentity::getGuid, bizApproveVO.getBizGuid()); | 273 | } |
| 269 | mfTdsConnectorIdentityService.update(updateWrapper); | 274 | |
| 275 | @Override | ||
| 276 | public TdsConnectorIdentityRSVO getEffectiveConnector() { | ||
| 277 | LambdaQueryWrapper<MfTdsConnectorIdentity> queryWrapper = Wrappers.lambdaQuery(); | ||
| 278 | queryWrapper.eq(MfTdsConnectorIdentity::getBizApproveState,ApprovalStateEnum.PASSED.getValue()); | ||
| 279 | List<MfTdsConnectorIdentity> list = mfTdsConnectorIdentityService.list(queryWrapper); | ||
| 280 | if(ObjectUtils.isNotEmpty(list)){ | ||
| 281 | return convertToVO(list.get(0)); | ||
| 282 | } | ||
| 283 | return null; | ||
| 270 | } | 284 | } |
| 271 | 285 | ||
| 272 | /** | 286 | /** |
| ... | @@ -289,7 +303,9 @@ public class TdsConnectorIdentityServiceImpl extends FlowAbstractImpl implements | ... | @@ -289,7 +303,9 @@ public class TdsConnectorIdentityServiceImpl extends FlowAbstractImpl implements |
| 289 | 303 | ||
| 290 | //region 2.2.业务数据验证 | 304 | //region 2.2.业务数据验证 |
| 291 | //验证接入连接器名称唯一性 | 305 | //验证接入连接器名称唯一性 |
| 306 | if("ZQ".equals(platformType)) { | ||
| 292 | verifyUniqueness(rqVO); | 307 | verifyUniqueness(rqVO); |
| 308 | } | ||
| 293 | //endregion 2.数据验证特殊处理 | 309 | //endregion 2.数据验证特殊处理 |
| 294 | 310 | ||
| 295 | //region 3.数据转换处理 | 311 | //region 3.数据转换处理 |
| ... | @@ -315,17 +331,15 @@ public class TdsConnectorIdentityServiceImpl extends FlowAbstractImpl implements | ... | @@ -315,17 +331,15 @@ public class TdsConnectorIdentityServiceImpl extends FlowAbstractImpl implements |
| 315 | } | 331 | } |
| 316 | 332 | ||
| 317 | /** | 333 | /** |
| 318 | * 验证接入连接器名称唯一性 | 334 | * 验证是否已经存在连接器 |
| 319 | * @param rqVO | 335 | * @param rqVO |
| 320 | */ | 336 | */ |
| 321 | private void verifyUniqueness(TdsConnectorIdentityRQVO rqVO) { | 337 | private void verifyUniqueness(TdsConnectorIdentityRQVO rqVO) { |
| 338 | //1、验证是否已经存在连接器 | ||
| 322 | LambdaQueryWrapper<MfTdsConnectorIdentity> queryWrapper = Wrappers.lambdaQuery(); | 339 | LambdaQueryWrapper<MfTdsConnectorIdentity> queryWrapper = Wrappers.lambdaQuery(); |
| 323 | if(StringUtils.isNotBlank(rqVO.getGuid())){ | 340 | queryWrapper.notIn(MfTdsConnectorIdentity::getBizApproveState,ApprovalStateEnum.CANCEL.getValue(),ApprovalStateEnum.REJECT.getValue()); |
| 324 | queryWrapper.ne(MfTdsConnectorIdentity::getGuid,rqVO.getGuid()); | ||
| 325 | } | ||
| 326 | queryWrapper.eq(MfTdsConnectorIdentity::getConnectorName,rqVO.getConnectorName()); | ||
| 327 | if(mfTdsConnectorIdentityService.count(queryWrapper)>0){ | 341 | if(mfTdsConnectorIdentityService.count(queryWrapper)>0){ |
| 328 | throw new CsbrSystemException(SystemError.DATA_ALREADY_EXISTS,"接入连接器名称已经存在。"); | 342 | throw new CsbrSystemException(SystemError.DATA_ALREADY_EXISTS,"该企业下已经存在连接器,无法新增。"); |
| 329 | } | 343 | } |
| 330 | } | 344 | } |
| 331 | 345 | ||
| ... | @@ -379,8 +393,6 @@ public class TdsConnectorIdentityServiceImpl extends FlowAbstractImpl implements | ... | @@ -379,8 +393,6 @@ public class TdsConnectorIdentityServiceImpl extends FlowAbstractImpl implements |
| 379 | //endregion 2.2.业务数据验证 | 393 | //endregion 2.2.业务数据验证 |
| 380 | 394 | ||
| 381 | //endregion 2.数据验证特殊处理 | 395 | //endregion 2.数据验证特殊处理 |
| 382 | //验证接入连接器名称唯一性 | ||
| 383 | verifyUniqueness(rqVO); | ||
| 384 | //region 3.数据转换处理 | 396 | //region 3.数据转换处理 |
| 385 | 397 | ||
| 386 | //region 3.1.数据过程转换 | 398 | //region 3.1.数据过程转换 | ... | ... |
| ... | @@ -202,7 +202,7 @@ public class TdsConnectorVerifiableServiceImpl implements TdsConnectorVerifiable | ... | @@ -202,7 +202,7 @@ public class TdsConnectorVerifiableServiceImpl implements TdsConnectorVerifiable |
| 202 | if(ObjectUtils.isEmpty(connectorGuids)){ | 202 | if(ObjectUtils.isEmpty(connectorGuids)){ |
| 203 | return; | 203 | return; |
| 204 | } | 204 | } |
| 205 | LambdaUpdateWrapper<MfTdsConnectorVerifiable> removeWrapper = Wrappers.lambdaUpdate(); | 205 | LambdaUpdateWrapper<MfTdsConnectorVerifiable> removeWrapper = mfTdsConnectorVerifiableService.csbrUpdateWrapper(MfTdsConnectorVerifiable.class); |
| 206 | removeWrapper.in(MfTdsConnectorVerifiable::getConnectorGuid,connectorGuids); | 206 | removeWrapper.in(MfTdsConnectorVerifiable::getConnectorGuid,connectorGuids); |
| 207 | mfTdsConnectorVerifiableService.remove(removeWrapper); | 207 | mfTdsConnectorVerifiableService.remove(removeWrapper); |
| 208 | } | 208 | } | ... | ... |
-
Please register or sign in to post a comment