可信空间连接器入住接口
Showing
4 changed files
with
48 additions
and
23 deletions
| ... | @@ -53,7 +53,12 @@ public class TdsConnectorIdentityController { | ... | @@ -53,7 +53,12 @@ public class TdsConnectorIdentityController { |
| 53 | @SystemLog(value = "连接器身份信息-修改") | 53 | @SystemLog(value = "连接器身份信息-修改") |
| 54 | @Operation(summary = "连接器身份信息-修改") | 54 | @Operation(summary = "连接器身份信息-修改") |
| 55 | public CommonRes<Boolean> updateTdsConnectorIdentity(@RequestBody TdsConnectorIdentityRQVO vo) { | 55 | public CommonRes<Boolean> updateTdsConnectorIdentity(@RequestBody TdsConnectorIdentityRQVO vo) { |
| 56 | tdsConnectorIdentityService.updateTdsConnectorIdentity(vo); | 56 | //变更数据重新提交流程 |
| 57 | if("Y".equals(vo.getIsChangeData()) && vo.getImmediateApprove()){ | ||
| 58 | tdsConnectorIdentityService.changeSaveTdsConnectorIdentity(vo); | ||
| 59 | }else { | ||
| 60 | tdsConnectorIdentityService.updateTdsConnectorIdentity(vo); | ||
| 61 | } | ||
| 57 | return CommonRes.success(true); | 62 | return CommonRes.success(true); |
| 58 | } | 63 | } |
| 59 | 64 | ... | ... |
| ... | @@ -37,5 +37,11 @@ public class TdsConnectorIdentityManagementQueryVO extends FlowBizGuidQueryDTO { | ... | @@ -37,5 +37,11 @@ public class TdsConnectorIdentityManagementQueryVO extends FlowBizGuidQueryDTO { |
| 37 | */ | 37 | */ |
| 38 | @Schema(description = "是否调用查询的判断", hidden = true) | 38 | @Schema(description = "是否调用查询的判断", hidden = true) |
| 39 | private Boolean isNeedQuery; | 39 | private Boolean isNeedQuery; |
| 40 | |||
| 41 | /** | ||
| 42 | * 连接器名称 | ||
| 43 | */ | ||
| 44 | @Schema(description = "连接器名称") | ||
| 45 | private String conName; | ||
| 40 | 46 | ||
| 41 | } | 47 | } | ... | ... |
| ... | @@ -2,6 +2,7 @@ package com.csbr.qingcloud.portal.service.impl; | ... | @@ -2,6 +2,7 @@ package com.csbr.qingcloud.portal.service.impl; |
| 2 | 2 | ||
| 3 | import com.alibaba.fastjson.JSON; | 3 | import com.alibaba.fastjson.JSON; |
| 4 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | 4 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| 5 | import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; | ||
| 5 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; | 6 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| 6 | import com.csbr.cloud.common.enums.SystemError; | 7 | import com.csbr.cloud.common.enums.SystemError; |
| 7 | import com.csbr.cloud.common.enums.WorkFlowBizEnum; | 8 | import com.csbr.cloud.common.enums.WorkFlowBizEnum; |
| ... | @@ -23,6 +24,7 @@ import com.csbr.qingcloud.portal.mybatis.entity.MfTdsConnectorIdentity; | ... | @@ -23,6 +24,7 @@ import com.csbr.qingcloud.portal.mybatis.entity.MfTdsConnectorIdentity; |
| 23 | import com.csbr.qingcloud.portal.mybatis.entity.MfTdsConnectorIdentityManagement; | 24 | import com.csbr.qingcloud.portal.mybatis.entity.MfTdsConnectorIdentityManagement; |
| 24 | import com.csbr.qingcloud.portal.mybatis.service.MfTdsConnectorIdentityManagementService; | 25 | import com.csbr.qingcloud.portal.mybatis.service.MfTdsConnectorIdentityManagementService; |
| 25 | import com.csbr.qingcloud.portal.service.TdsConnectorIdentityManagementService; | 26 | import com.csbr.qingcloud.portal.service.TdsConnectorIdentityManagementService; |
| 27 | import com.csbr.qingcloud.portal.service.TdsConnectorIdentityService; | ||
| 26 | import csbr.cloud.entity.domain.base.vo.PageListVO; | 28 | import csbr.cloud.entity.domain.base.vo.PageListVO; |
| 27 | import csbr.cloud.entity.enums.ApprovalStateEnum; | 29 | import csbr.cloud.entity.enums.ApprovalStateEnum; |
| 28 | import io.seata.spring.annotation.GlobalTransactional; | 30 | import io.seata.spring.annotation.GlobalTransactional; |
| ... | @@ -73,6 +75,9 @@ public class TdsConnectorIdentityManagementServiceImpl extends FlowAbstractImpl | ... | @@ -73,6 +75,9 @@ public class TdsConnectorIdentityManagementServiceImpl extends FlowAbstractImpl |
| 73 | @Value("${csbr.platform-type:''}") | 75 | @Value("${csbr.platform-type:''}") |
| 74 | private String platformType; | 76 | private String platformType; |
| 75 | 77 | ||
| 78 | @Resource | ||
| 79 | private TdsConnectorIdentityService tdsConnectorIdentityService; | ||
| 80 | |||
| 76 | /** | 81 | /** |
| 77 | * 连接器身份管理分页查询 | 82 | * 连接器身份管理分页查询 |
| 78 | * @author xup | 83 | * @author xup |
| ... | @@ -87,6 +92,11 @@ public class TdsConnectorIdentityManagementServiceImpl extends FlowAbstractImpl | ... | @@ -87,6 +92,11 @@ public class TdsConnectorIdentityManagementServiceImpl extends FlowAbstractImpl |
| 87 | LambdaQueryWrapper<MfTdsConnectorIdentityManagement> queryWrapper = mfTdsConnectorIdentityManagementService.csbrQueryWrapper(queryVO, MfTdsConnectorIdentityManagement.class); | 92 | LambdaQueryWrapper<MfTdsConnectorIdentityManagement> queryWrapper = mfTdsConnectorIdentityManagementService.csbrQueryWrapper(queryVO, MfTdsConnectorIdentityManagement.class); |
| 88 | queryWrapper.in(CollectionUtils.isNotEmpty(queryVO.getGuidList()), MfTdsConnectorIdentityManagement::getGuid, | 93 | queryWrapper.in(CollectionUtils.isNotEmpty(queryVO.getGuidList()), MfTdsConnectorIdentityManagement::getGuid, |
| 89 | queryVO.getGuidList()); | 94 | queryVO.getGuidList()); |
| 95 | String existsSql = "select guid from mf_tds_connector_identity a where a.guid=mf_tds_connector_identity_management.connector_guid and is_deleted='N' and is_change_data='N'"; | ||
| 96 | if(StringUtils.isNotBlank(queryVO.getConName())){ | ||
| 97 | existsSql = existsSql+" and connector_name like '%+"+queryVO.getConName()+"+%'"; | ||
| 98 | } | ||
| 99 | queryWrapper.exists(existsSql); | ||
| 90 | queryWrapper.orderByDesc(MfTdsConnectorIdentityManagement::getCreateTime); | 100 | queryWrapper.orderByDesc(MfTdsConnectorIdentityManagement::getCreateTime); |
| 91 | mfTdsConnectorIdentityManagementService.csbrExcludeShardingLambdaQueryWrapper(queryWrapper); | 101 | mfTdsConnectorIdentityManagementService.csbrExcludeShardingLambdaQueryWrapper(queryWrapper); |
| 92 | PageListVO<MfTdsConnectorIdentityManagement> pageList = mfTdsConnectorIdentityManagementService.csbrPageList(queryVO, queryWrapper); | 102 | PageListVO<MfTdsConnectorIdentityManagement> pageList = mfTdsConnectorIdentityManagementService.csbrPageList(queryVO, queryWrapper); |
| ... | @@ -514,29 +524,29 @@ public class TdsConnectorIdentityManagementServiceImpl extends FlowAbstractImpl | ... | @@ -514,29 +524,29 @@ public class TdsConnectorIdentityManagementServiceImpl extends FlowAbstractImpl |
| 514 | * @return void | 524 | * @return void |
| 515 | */ | 525 | */ |
| 516 | private void afterQuery(PageListVO<MfTdsConnectorIdentityManagement> pageList, PageListVO<TdsConnectorIdentityManagementRSVO> rsPageList) { | 526 | private void afterQuery(PageListVO<MfTdsConnectorIdentityManagement> pageList, PageListVO<TdsConnectorIdentityManagementRSVO> rsPageList) { |
| 517 | if (CollectionUtils.isNotEmpty(pageList.getRecords())) { | 527 | // if (CollectionUtils.isNotEmpty(pageList.getRecords())) { |
| 518 | rsPageList.setRecords(convertToVO(pageList.getRecords())); | 528 | // rsPageList.setRecords(convertToVO(pageList.getRecords())); |
| 519 | } | ||
| 520 | // 需要特殊处理数据时使用 | ||
| 521 | // if(CollectionUtils.isNotEmpty(pageList.getRecords())){ | ||
| 522 | // List<TdsConnectorIdentityManagementRSVO> results = new ArrayList<>(); | ||
| 523 | // Set<String> guidSet = CommonUtil.filterSetFiled(pageList.getRecords(), MfTdsConnectorIdentityManagement::getGuid); | ||
| 524 | // Map<String, BizApproveVO> approvalInfoMap = approvalFlowUtil.getApprovalCrossTenantInfoMap(guidSet); | ||
| 525 | // Map<String, MfTdsConnectorIdentity> connectorIdentityMap = tdsConnectorIdentityService.getCrossTenantTdsConnectorIdentitys(guidSet); | ||
| 526 | // for (MfTdsConnectorIdentityManagement item : pageList.getRecords()){ | ||
| 527 | // TdsConnectorIdentityManagementRSVO vo = convertToVO(item,false); | ||
| 528 | // String guid = vo.getGuid(); | ||
| 529 | // if(ObjectUtils.isNotEmpty(approvalInfoMap) && approvalInfoMap.containsKey(guid)) { | ||
| 530 | // vo.setApproveVO(approvalInfoMap.get(guid)); | ||
| 531 | // } | ||
| 532 | // if(ObjectUtils.isNotEmpty(connectorIdentityMap) && connectorIdentityMap.containsKey(guid)) { | ||
| 533 | // vo.setConnectorName(connectorIdentityMap.get(guid).getConnectorName()); | ||
| 534 | // vo.setLegalEntity(connectorIdentityMap.get(guid).getLegalEntity()); | ||
| 535 | // } | ||
| 536 | // results.add(vo); | ||
| 537 | // } | ||
| 538 | // rsPageList.setRecords(results); | ||
| 539 | // } | 529 | // } |
| 530 | // 需要特殊处理数据时使用 | ||
| 531 | if(CollectionUtils.isNotEmpty(pageList.getRecords())){ | ||
| 532 | List<TdsConnectorIdentityManagementRSVO> results = new ArrayList<>(); | ||
| 533 | Set<String> guidSet = CommonUtil.filterSetFiled(pageList.getRecords(), MfTdsConnectorIdentityManagement::getGuid); | ||
| 534 | Map<String, BizApproveVO> approvalInfoMap = approvalFlowUtil.getApprovalCrossTenantInfoMap(guidSet); | ||
| 535 | Map<String, MfTdsConnectorIdentity> connectorIdentityMap = tdsConnectorIdentityService.getCrossTenantTdsConnectorIdentitys(guidSet); | ||
| 536 | for (MfTdsConnectorIdentityManagement item : pageList.getRecords()){ | ||
| 537 | TdsConnectorIdentityManagementRSVO vo = convertToVO(item,false); | ||
| 538 | String guid = vo.getGuid(); | ||
| 539 | if(ObjectUtils.isNotEmpty(approvalInfoMap) && approvalInfoMap.containsKey(guid)) { | ||
| 540 | vo.setApproveVO(approvalInfoMap.get(guid)); | ||
| 541 | } | ||
| 542 | if(ObjectUtils.isNotEmpty(connectorIdentityMap) && connectorIdentityMap.containsKey(guid)) { | ||
| 543 | vo.setConnectorName(connectorIdentityMap.get(guid).getConnectorName()); | ||
| 544 | vo.setLegalEntity(connectorIdentityMap.get(guid).getLegalEntity()); | ||
| 545 | } | ||
| 546 | results.add(vo); | ||
| 547 | } | ||
| 548 | rsPageList.setRecords(results); | ||
| 549 | } | ||
| 540 | } | 550 | } |
| 541 | 551 | ||
| 542 | //region 辅助操作 | 552 | //region 辅助操作 | ... | ... |
| ... | @@ -519,6 +519,10 @@ public class TdsConnectorIdentityServiceImpl extends FlowAbstractImpl implements | ... | @@ -519,6 +519,10 @@ public class TdsConnectorIdentityServiceImpl extends FlowAbstractImpl implements |
| 519 | if(StringUtils.isBlank(rqVO.getSourceBizGuid())){ | 519 | if(StringUtils.isBlank(rqVO.getSourceBizGuid())){ |
| 520 | throw new CsbrSystemException(SystemError.DATA_INPUT_ERROR, String.format("%s参数为空。","原始数据Guid")); | 520 | throw new CsbrSystemException(SystemError.DATA_INPUT_ERROR, String.format("%s参数为空。","原始数据Guid")); |
| 521 | } | 521 | } |
| 522 | String message = validatorUtil.validateRetrunOne(rqVO); | ||
| 523 | if(StringUtils.isNotBlank(message)){ | ||
| 524 | throw new CsbrSystemException(SystemError.DATA_INPUT_ERROR, message); | ||
| 525 | } | ||
| 522 | MfTdsConnectorIdentity tdsConnectorIdentity = mfTdsConnectorIdentityService.getById(rqVO.getSourceBizGuid()); | 526 | MfTdsConnectorIdentity tdsConnectorIdentity = mfTdsConnectorIdentityService.getById(rqVO.getSourceBizGuid()); |
| 523 | if(ObjectUtils.isEmpty(tdsConnectorIdentity)){ | 527 | if(ObjectUtils.isEmpty(tdsConnectorIdentity)){ |
| 524 | throw new CsbrSystemException(SystemError.DATA_NOT_EXISTS,"变更数据不存在。"); | 528 | throw new CsbrSystemException(SystemError.DATA_NOT_EXISTS,"变更数据不存在。"); | ... | ... |
-
Please register or sign in to post a comment