c30319ae by 肖初晴

【DAOP-1.0】数据需求

【功能点】测试问题处理
1 parent 88b62c20
......@@ -18,7 +18,7 @@ import java.util.Map;
public interface PersonelFeign {
@PostMapping(value = "/tenant/auth", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE)
CommonRes<Boolean> authTenant(@RequestBody TenantRQVO vo);
CommonRes<TenantRQVO> authTenant(@RequestBody TenantRQVO vo);
@PutMapping(value = "/tenant/update", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE)
CommonRes<Boolean> updateTenant(@RequestBody TenantRQVO vo);
......
......@@ -7,7 +7,9 @@ import com.csbr.cloud.common.enums.SystemError;
import com.csbr.cloud.common.enums.WorkFlowBizEnum;
import com.csbr.qingcloud.portal.domain.vo.*;
import com.csbr.qingcloud.portal.feign.PersonelFeign;
import com.csbr.qingcloud.portal.mybatis.entity.MfDemand;
import com.csbr.qingcloud.portal.mybatis.entity.MfEnterpriseChangeApprove;
import com.csbr.qingcloud.portal.mybatis.service.MfDemandService;
import com.csbr.qingcloud.portal.mybatis.service.MfEnterpriseChangeApproveService;
import com.csbr.qingcloud.portal.service.EnterpriseChangeApproveService;
import com.csbr.qingcloud.portal.util.ObjectUtil;
......@@ -71,6 +73,9 @@ public class EnterpriseServiceImpl extends FlowAbstractImpl implements Enterpris
@Resource
private MfEnterpriseChangeApproveService mfEnterpriseChangeApproveService;
@Resource
private MfDemandService mfDemandService;
/**
* 企业信息分页查询
* @author xcq
......@@ -353,9 +358,13 @@ public class EnterpriseServiceImpl extends FlowAbstractImpl implements Enterpris
//删除原帐号并新增正式会员
TenantRQVO vo = csbrBeanUtil.convert(entity,TenantRQVO.class);
vo.setTenantType(null);
vo.setGuid(CommonUtil.newGuid());
vo.setPersonIncharge(entity.getJuridicalPerson());
vo.setBizState("Y");
personelFeign.authTenant(vo);
vo = personelFeign.authTenant(vo).getData();
//将此账号提交的数据需求迁移到新的企业
moveDemand(entity,vo);
}
// 同步更新审批状态
LambdaUpdateWrapper<MfEnterprise> updateWrapper = mfEnterpriseService.csbrUpdateWrapper(MfEnterprise.class);
......@@ -367,6 +376,28 @@ public class EnterpriseServiceImpl extends FlowAbstractImpl implements Enterpris
}
}
/** 将此账号提交的数据需求迁移到新的企业 */
private void moveDemand(MfEnterprise entity,TenantRQVO vo){
LambdaQueryWrapper<MfDemand> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(MfDemand::getCreateUserId, entity.getCreateUserId());
mfDemandService.csbrExcludeShardingLambdaQueryWrapper(queryWrapper);
List<MfDemand> list = mfDemandService.list(queryWrapper);
if(CollectionUtils.isEmpty(list)){
return;
}
List<MfDemand> newList = new ArrayList<>();
for(MfDemand item : list){
MfDemand newItem = csbrBeanUtil.convert(item,MfDemand.class,true);
newItem.setGuid(CommonUtil.newGuid());
newItem.setTenantGuid(vo.getGuid());
newItem.setShardingFlag(vo.getShardingFlag());
newList.add(newItem);
}
mfDemandService.saveBatch(newList);
mfDemandService.removeByIds(list);
}
@Override
public Boolean check(EnterpriseRQVO vo) {
return true;
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!