e4bb0d83 by xiaojie

【数据资产】

1、查询附件信息和领域信息
1 parent 05230f48
......@@ -615,15 +615,9 @@ public class EnterpriseServiceImpl extends FlowAbstractImpl implements Enterpris
// 查询附件信息
String guid = enterpriseRSVO.getGuid();
Map<String, List<EnterpriseAttachmentRSVO>> attachmentByEnterpriseGuids = enterpriseAttachmentService.getMapByEnterpriseGuids(Collections.singletonList(guid));
if (ObjectUtils.isNotEmpty(attachmentByEnterpriseGuids) && attachmentByEnterpriseGuids.containsKey(guid)) {
enterpriseRSVO.setAttachmentRSVOS(attachmentByEnterpriseGuids.get(guid));
}
// 查询领域信息
Map<String, List<EnterpriseDomainRSVO>> domainByEnterpriseGuids = enterpriseDomainService.getMapByEnterpriseGuids(Collections.singletonList(guid));
if (ObjectUtils.isNotEmpty(domainByEnterpriseGuids) && domainByEnterpriseGuids.containsKey(guid)) {
enterpriseRSVO.setDomainRSVOS(domainByEnterpriseGuids.get(guid));
}
// 查询变更历史
LambdaQueryWrapper<MfEnterpriseChangeApprove> lambdaQueryWrapper = new LambdaQueryWrapper<>();
......@@ -631,6 +625,12 @@ public class EnterpriseServiceImpl extends FlowAbstractImpl implements Enterpris
lambdaQueryWrapper.orderByDesc(MfEnterpriseChangeApprove::getCreateTime);
List<MfEnterpriseChangeApprove> approveList = mfEnterpriseChangeApproveService.list(lambdaQueryWrapper);
if(CollectionUtils.isEmpty(approveList)){
if (ObjectUtils.isNotEmpty(attachmentByEnterpriseGuids) && attachmentByEnterpriseGuids.containsKey(guid)) {
enterpriseRSVO.setAttachmentRSVOS(attachmentByEnterpriseGuids.get(guid));
}
if (ObjectUtils.isNotEmpty(domainByEnterpriseGuids) && domainByEnterpriseGuids.containsKey(guid)) {
enterpriseRSVO.setDomainRSVOS(domainByEnterpriseGuids.get(guid));
}
return enterpriseRSVO;
}
......@@ -638,8 +638,15 @@ public class EnterpriseServiceImpl extends FlowAbstractImpl implements Enterpris
if ("B".equals(enterpriseRSVO.getBizApproveState())) {
Optional<MfEnterpriseChangeApprove> changeApproveOptFirst = approveList.stream().filter(item -> "2".equals(item.getDataType())).findFirst();
if (changeApproveOptFirst.isPresent()) {
enterpriseRSVO = csbrBeanUtil.convert(changeApproveOptFirst.get(), EnterpriseRSVO.class);
MfEnterpriseChangeApprove mfEnterpriseChangeApprove = changeApproveOptFirst.get();
enterpriseRSVO = csbrBeanUtil.convert(mfEnterpriseChangeApprove, EnterpriseRSVO.class);
enterpriseRSVO.setBizApproveState(mfEnterprise.getBizApproveState());
if (ObjectUtils.isNotEmpty(attachmentByEnterpriseGuids) && attachmentByEnterpriseGuids.containsKey(mfEnterpriseChangeApprove.getSourceGuid())) {
enterpriseRSVO.setAttachmentRSVOS(attachmentByEnterpriseGuids.get(mfEnterpriseChangeApprove.getSourceGuid()));
}
if (ObjectUtils.isNotEmpty(domainByEnterpriseGuids) && domainByEnterpriseGuids.containsKey(mfEnterpriseChangeApprove.getSourceGuid())) {
enterpriseRSVO.setDomainRSVOS(domainByEnterpriseGuids.get(mfEnterpriseChangeApprove.getSourceGuid()));
}
}
}
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!