f13afe9d by xiaojie

【数据资产】

企业认证修改领域和附件信息
1 parent 4e555e65
......@@ -89,10 +89,11 @@ public interface EnterpriseAttachmentService {
/**
* 批量新增开发主体附件信息
* @param attachmentRQVOS
* @param enterprise
* @param guid
* @param tenantGuid
* @param isRequired
*/
void batchSave(List<EnterpriseAttachmentRQVO> attachmentRQVOS, MfEnterprise enterprise, Boolean isRequired);
void batchSave(List<EnterpriseAttachmentRQVO> attachmentRQVOS, String guid, String tenantGuid, Boolean isRequired);
/**
* 删除开发主体附件信息
......@@ -103,10 +104,11 @@ public interface EnterpriseAttachmentService {
/**
* 批量修改开发主体附件信息
* @param attachmentRQVOS
* @param enterprise
* @param guid
* @param tenantGuid
* @param isRequired
*/
void batchUpdate(List<EnterpriseAttachmentRQVO> attachmentRQVOS, MfEnterprise enterprise, Boolean isRequired);
void batchUpdate(List<EnterpriseAttachmentRQVO> attachmentRQVOS, String guid, String tenantGuid, Boolean isRequired);
/**
* 根据企业认证guid查询附件信息
......
......@@ -280,12 +280,12 @@ public class EnterpriseAttachmentServiceImpl implements EnterpriseAttachmentServ
@Override
@Transactional
public void batchSave(List<EnterpriseAttachmentRQVO> attachmentRQVOS, MfEnterprise enterprise, Boolean isRequired) {
public void batchSave(List<EnterpriseAttachmentRQVO> attachmentRQVOS, String guid, String tenantGuid, Boolean isRequired) {
if (ObjectUtils.isNotEmpty(attachmentRQVOS)) {
List<MfEnterpriseAttachment> attachmentList = new ArrayList<>();
for (EnterpriseAttachmentRQVO attachmentRQVO : attachmentRQVOS) {
attachmentRQVO.setEnterpriseGuid(enterprise.getGuid());
attachmentRQVO.setTenantGuid(enterprise.getTenantGuid());
attachmentRQVO.setEnterpriseGuid(guid);
attachmentRQVO.setTenantGuid(tenantGuid);
// 获取文件大小
// 下载文件流
String fileUrl = attachmentRQVO.getFileUrl();
......@@ -324,12 +324,12 @@ public class EnterpriseAttachmentServiceImpl implements EnterpriseAttachmentServ
@Override
@Transactional
public void batchUpdate(List<EnterpriseAttachmentRQVO> attachmentRQVOS, MfEnterprise enterprise, Boolean isRequired) {
public void batchUpdate(List<EnterpriseAttachmentRQVO> attachmentRQVOS, String guid, String tenantGuid, Boolean isRequired) {
// 删除开发主体附件信息
removeByEnterpriseGuids(Collections.singletonList(enterprise.getGuid()));
removeByEnterpriseGuids(Collections.singletonList(guid));
// 批量新增开发主体附件信息
batchSave(attachmentRQVOS, enterprise, isRequired);
batchSave(attachmentRQVOS, guid, tenantGuid, isRequired);
}
@Override
......
......@@ -34,6 +34,7 @@ import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import java.util.*;
......@@ -61,6 +62,9 @@ public class EnterpriseChangeApproveServiceImpl implements EnterpriseChangeAppro
@Autowired
private InvokeUtil invokeUtil;
@Value("${enterpriseAttachment.isRequired:true}")
private Boolean isRequired;
@Resource
private MfEnterpriseChangeApproveService mfEnterpriseChangeApproveService;
......@@ -113,6 +117,12 @@ public class EnterpriseChangeApproveServiceImpl implements EnterpriseChangeAppro
entity.setGuid(vo.getGuid());
mfEnterpriseChangeApproveService.save(entity);
// 保存新数据的附件和领域数据
List<EnterpriseAttachmentRQVO> attachmentRQVOS = beanVO.getAttachmentRQVOS();
enterpriseAttachmentService.batchSave(attachmentRQVOS, entity.getGuid(), entity.getTenantGuid(), isRequired);
List<EnterpriseDomainRQVO> domainRQVOS = beanVO.getDomainRQVOS();
enterpriseDomainService.batchSave(domainRQVOS, entity.getGuid());
//保存原数据
beanVO = JSON.parseObject(vo.getOldBizDataJson(),EnterpriseRQVO.class);
entity = csbrBeanUtil.convert(beanVO,MfEnterpriseChangeApprove.class);
......@@ -122,6 +132,12 @@ public class EnterpriseChangeApproveServiceImpl implements EnterpriseChangeAppro
entity.setTenantGuid(tenantGuid);
mfEnterpriseChangeApproveService.save(entity);
// 保存旧数据的附件和领域数据
List<EnterpriseAttachmentRQVO> attachmentRQVOSOld = beanVO.getAttachmentRQVOS();
enterpriseAttachmentService.batchSave(attachmentRQVOSOld, entity.getGuid(), entity.getTenantGuid(), isRequired);
List<EnterpriseDomainRQVO> domainRQVOSOld = beanVO.getDomainRQVOS();
enterpriseDomainService.batchSave(domainRQVOSOld, entity.getGuid());
log.info("========entity, {}", entity);
MfEnterprise bean = mfEnterpriseService.getById(entity.getSourceGuid());
bean.setBizApproveState("B");
......@@ -151,7 +167,21 @@ public class EnterpriseChangeApproveServiceImpl implements EnterpriseChangeAppro
vo.setGuid(bean.getGuid());
vo.setApproveGuid(bean.getApproveGuid());
vo.setSourceGuid(bean.getSourceGuid());
vo.setBizDataJson(convertToVO(bean));
if (ObjectUtils.isNotEmpty(bean)) {
EnterpriseRSVO enterpriseRSVO = csbrBeanUtil.convert(bean, EnterpriseRSVO.class);
// 查询附件信息
Map<String, List<EnterpriseAttachmentRSVO>> attachmentByEnterpriseGuids = enterpriseAttachmentService.getMapByEnterpriseGuids(Collections.singletonList(enterpriseRSVO.getGuid()));
if (ObjectUtils.isNotEmpty(attachmentByEnterpriseGuids) && attachmentByEnterpriseGuids.containsKey(enterpriseRSVO.getGuid())) {
enterpriseRSVO.setAttachmentRSVOS(attachmentByEnterpriseGuids.get(enterpriseRSVO.getGuid()));
}
// 查询领域信息
Map<String, List<EnterpriseDomainRSVO>> domainByEnterpriseGuids = enterpriseDomainService.getMapByEnterpriseGuids(Collections.singletonList(enterpriseRSVO.getGuid()));
if (ObjectUtils.isNotEmpty(domainByEnterpriseGuids) && domainByEnterpriseGuids.containsKey(enterpriseRSVO.getGuid())) {
enterpriseRSVO.setDomainRSVOS(domainByEnterpriseGuids.get(enterpriseRSVO.getGuid()));
}
vo.setBizDataJson(JSON.toJSONString(enterpriseRSVO));
}
//取原数据
queryWrapper = new LambdaQueryWrapper<>();
......@@ -159,7 +189,19 @@ public class EnterpriseChangeApproveServiceImpl implements EnterpriseChangeAppro
queryWrapper.eq(MfEnterpriseChangeApprove::getDataType,"1");
tempList = mfEnterpriseChangeApproveService.list(queryWrapper);
if(CollectionUtils.isNotEmpty(tempList)){
vo.setOldBizDataJson(convertToVO(tempList.get(0)));
EnterpriseRSVO enterpriseRSVO = csbrBeanUtil.convert(tempList.get(0), EnterpriseRSVO.class);
// 查询附件信息
Map<String, List<EnterpriseAttachmentRSVO>> attachmentByEnterpriseGuids = enterpriseAttachmentService.getMapByEnterpriseGuids(Collections.singletonList(enterpriseRSVO.getGuid()));
if (ObjectUtils.isNotEmpty(attachmentByEnterpriseGuids) && attachmentByEnterpriseGuids.containsKey(enterpriseRSVO.getGuid())) {
enterpriseRSVO.setAttachmentRSVOS(attachmentByEnterpriseGuids.get(enterpriseRSVO.getGuid()));
}
// 查询领域信息
Map<String, List<EnterpriseDomainRSVO>> domainByEnterpriseGuids = enterpriseDomainService.getMapByEnterpriseGuids(Collections.singletonList(enterpriseRSVO.getGuid()));
if (ObjectUtils.isNotEmpty(domainByEnterpriseGuids) && domainByEnterpriseGuids.containsKey(enterpriseRSVO.getGuid())) {
enterpriseRSVO.setDomainRSVOS(domainByEnterpriseGuids.get(enterpriseRSVO.getGuid()));
}
vo.setOldBizDataJson(JSON.toJSONString(enterpriseRSVO));
}
return vo;
......@@ -189,6 +231,21 @@ public class EnterpriseChangeApproveServiceImpl implements EnterpriseChangeAppro
vo.setBizApproveState("Y");
mfEnterpriseService.updateById(vo);
// 修改附件和领域数据
Map<String, List<EnterpriseAttachmentRSVO>> attachmentByEnterpriseGuids = enterpriseAttachmentService.getMapByEnterpriseGuids(Collections.singletonList(entity.getGuid()));
if (ObjectUtils.isNotEmpty(attachmentByEnterpriseGuids) && attachmentByEnterpriseGuids.containsKey(entity.getGuid())) {
List<EnterpriseAttachmentRSVO> attachmentRSVOS = attachmentByEnterpriseGuids.get(entity.getGuid());
List<EnterpriseAttachmentRQVO> attachmentRQVOS = csbrBeanUtil.convert(attachmentRSVOS, EnterpriseAttachmentRQVO.class);
enterpriseAttachmentService.batchUpdate(attachmentRQVOS, entity.getSourceGuid(), entity.getTenantGuid(), isRequired);
}
Map<String, List<EnterpriseDomainRSVO>> domainByEnterpriseGuids = enterpriseDomainService.getMapByEnterpriseGuids(Collections.singletonList(entity.getGuid()));
if (ObjectUtils.isNotEmpty(domainByEnterpriseGuids) && domainByEnterpriseGuids.containsKey(entity.getGuid())) {
List<EnterpriseDomainRSVO> domainRSVOS = domainByEnterpriseGuids.get(entity.getGuid());
List<EnterpriseDomainRQVO> domainRQVOS = csbrBeanUtil.convert(domainRSVOS, EnterpriseDomainRQVO.class);
enterpriseDomainService.batchUpdate(domainRQVOS, entity.getSourceGuid());
}
//同步更新会员表
enterpriseService.updateTenant(vo);
}
......@@ -214,6 +271,10 @@ public class EnterpriseChangeApproveServiceImpl implements EnterpriseChangeAppro
}
mfEnterpriseChangeApproveService.removeById(guid);
// 删除领域和附件信息
enterpriseAttachmentService.removeByEnterpriseGuids(Collections.singletonList(entity.getGuid()));
enterpriseDomainService.removeByEnterpriseGuids(Collections.singletonList(entity.getGuid()));
// 修改企业认证审批状态
LambdaQueryWrapper<MfEnterpriseChangeApprove> lambdaQueryWrapper = Wrappers.lambdaQuery(MfEnterpriseChangeApprove.class);
lambdaQueryWrapper.eq(MfEnterpriseChangeApprove::getSourceGuid, entity.getSourceGuid());
......@@ -269,6 +330,21 @@ public class EnterpriseChangeApproveServiceImpl implements EnterpriseChangeAppro
vo.setCrossPlatformApproveState("Y");
mfEnterpriseService.updateById(vo);
// 修改附件和领域数据
Map<String, List<EnterpriseAttachmentRSVO>> attachmentByEnterpriseGuids = enterpriseAttachmentService.getMapByEnterpriseGuids(Collections.singletonList(entity.getGuid()));
if (ObjectUtils.isNotEmpty(attachmentByEnterpriseGuids) && attachmentByEnterpriseGuids.containsKey(entity.getGuid())) {
List<EnterpriseAttachmentRSVO> attachmentRSVOS = attachmentByEnterpriseGuids.get(entity.getGuid());
List<EnterpriseAttachmentRQVO> attachmentRQVOS = csbrBeanUtil.convert(attachmentRSVOS, EnterpriseAttachmentRQVO.class);
enterpriseAttachmentService.batchUpdate(attachmentRQVOS, entity.getSourceGuid(), entity.getTenantGuid(), isRequired);
}
Map<String, List<EnterpriseDomainRSVO>> domainByEnterpriseGuids = enterpriseDomainService.getMapByEnterpriseGuids(Collections.singletonList(entity.getGuid()));
if (ObjectUtils.isNotEmpty(domainByEnterpriseGuids) && domainByEnterpriseGuids.containsKey(entity.getGuid())) {
List<EnterpriseDomainRSVO> domainRSVOS = domainByEnterpriseGuids.get(entity.getGuid());
List<EnterpriseDomainRQVO> domainRQVOS = csbrBeanUtil.convert(domainRSVOS, EnterpriseDomainRQVO.class);
enterpriseDomainService.batchUpdate(domainRQVOS, entity.getSourceGuid());
}
//同步更新会员表
enterpriseService.updateTenant(vo);
}
......
......@@ -641,11 +641,15 @@ public class EnterpriseServiceImpl extends FlowAbstractImpl implements Enterpris
enterpriseRSVO = csbrBeanUtil.convert(mfEnterpriseChangeApprove, EnterpriseRSVO.class);
enterpriseRSVO.setBizApproveState(mfEnterprise.getBizApproveState());
if (ObjectUtils.isNotEmpty(attachmentByEnterpriseGuids) && attachmentByEnterpriseGuids.containsKey(mfEnterpriseChangeApprove.getSourceGuid())) {
enterpriseRSVO.setAttachmentRSVOS(attachmentByEnterpriseGuids.get(mfEnterpriseChangeApprove.getSourceGuid()));
attachmentByEnterpriseGuids = enterpriseAttachmentService.getMapByEnterpriseGuids(Collections.singletonList(mfEnterpriseChangeApprove.getGuid()));
// 查询领域信息
domainByEnterpriseGuids = enterpriseDomainService.getMapByEnterpriseGuids(Collections.singletonList(mfEnterpriseChangeApprove.getGuid()));
if (ObjectUtils.isNotEmpty(attachmentByEnterpriseGuids) && attachmentByEnterpriseGuids.containsKey(mfEnterpriseChangeApprove.getGuid())) {
enterpriseRSVO.setAttachmentRSVOS(attachmentByEnterpriseGuids.get(mfEnterpriseChangeApprove.getGuid()));
}
if (ObjectUtils.isNotEmpty(domainByEnterpriseGuids) && domainByEnterpriseGuids.containsKey(mfEnterpriseChangeApprove.getSourceGuid())) {
enterpriseRSVO.setDomainRSVOS(domainByEnterpriseGuids.get(mfEnterpriseChangeApprove.getSourceGuid()));
if (ObjectUtils.isNotEmpty(domainByEnterpriseGuids) && domainByEnterpriseGuids.containsKey(mfEnterpriseChangeApprove.getGuid())) {
enterpriseRSVO.setDomainRSVOS(domainByEnterpriseGuids.get(mfEnterpriseChangeApprove.getGuid()));
}
}
}
......@@ -889,7 +893,7 @@ public class EnterpriseServiceImpl extends FlowAbstractImpl implements Enterpris
// 新增附件信息
List<EnterpriseAttachmentRQVO> attachmentRQVOS = rqVO.getAttachmentRQVOS();
enterpriseAttachmentService.batchSave(attachmentRQVOS, entity, isRequired);
enterpriseAttachmentService.batchSave(attachmentRQVOS, entity.getGuid(), entity.getTenantGuid(), isRequired);
// 新增领域信息
List<EnterpriseDomainRQVO> domainRQVOS = rqVO.getDomainRQVOS();
......@@ -967,7 +971,7 @@ public class EnterpriseServiceImpl extends FlowAbstractImpl implements Enterpris
// 新增附件信息
List<EnterpriseAttachmentRQVO> attachmentRQVOS = rqVO.getAttachmentRQVOS();
enterpriseAttachmentService.batchUpdate(attachmentRQVOS, entity, isRequired);
enterpriseAttachmentService.batchUpdate(attachmentRQVOS, entity.getGuid(), entity.getTenantGuid(), isRequired);
// 新增领域信息
List<EnterpriseDomainRQVO> domainRQVOS = rqVO.getDomainRQVOS();
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!