656bd622 by 肖初晴

【DAOP-1.0】企业认证

【功能点】测试问题处理
1 parent 803e665b
......@@ -17,6 +17,8 @@ import java.util.Date;
@Schema(title = "企业信息新增、修改参数")
public class EnterpriseRQVO extends FlowRQBaseVO {
@Schema(description = "会员GUID")
private String tenantGuid;
/**
* 公司名称
*/
......
......@@ -24,6 +24,9 @@ public class EnterpriseRSVO {
@Schema(description = "系统唯一标识")
private String guid;
@Schema(description = "会员GUID")
private String tenantGuid;
/**
* 公司名称
*/
......
......@@ -21,7 +21,10 @@ public interface PersonelFeign {
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);
CommonRes<String> updateTenant(@RequestBody TenantRQVO vo);
@PutMapping(value = "/tenant/change-update", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE)
CommonRes<Boolean> changeUpdate(@RequestBody TenantRQVO vo);
@GetMapping(value = "/tenant/get-all-tenant-guid-name-map", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE)
CommonRes<Map<String, String>> getAllTenantGuidNameMap();
......
......@@ -22,6 +22,9 @@ import java.util.Date;
@Name("企业信息")
public class MfEnterprise extends BaseDO {
@Name("会员GUID")
private String tenantGuid;
/**
* 公司名称
*/
......
......@@ -22,6 +22,9 @@ import java.util.Date;
@Name("企业信息变更审批")
public class MfEnterpriseChangeApprove extends BaseDO {
@Name("会员GUID")
private String tenantGuid;
/**
* 公司名称
*/
......
......@@ -2,6 +2,7 @@ package com.csbr.qingcloud.portal.service;
import com.csbr.cloud.workflow.domain.dto.appove.FlowUpdateStateDTO;
import com.csbr.qingcloud.portal.domain.vo.*;
import com.csbr.qingcloud.portal.mybatis.entity.MfEnterprise;
import csbr.cloud.entity.domain.base.vo.PageListVO;
import com.csbr.cloud.workflow.domain.dto.callback.BizCallbackDTO;
import com.csbr.cloud.workflow.domain.vo.appove.FlowRQBaseVO;
......@@ -79,4 +80,6 @@ public interface EnterpriseService {
/** 将此账号提交的数据需求迁移到新的企业 */
void moveOldData(TenantRQVO vo);
/** 更新会员信息 */
void updateTenant(MfEnterprise vo);
}
......
......@@ -139,29 +139,10 @@ public class EnterpriseChangeApproveServiceImpl implements EnterpriseChangeAppro
mfEnterpriseService.updateById(vo);
//同步更新会员表
TenantRQVO tenantVO = csbrBeanUtil.convert(vo,TenantRQVO.class);
tenantVO.setGuid(getTenantGuid(vo.getTenantName()));
tenantVO.setPersonIncharge(vo.getJuridicalPerson());
tenantVO.setTenantName(vo.getTenantName());
tenantVO.setRegisteredCapital(vo.getRegisteredCapital());
tenantVO.setRegistrationDate(DateUtil.getDateToLocal(vo.getRegistrationDate()));
tenantVO.setBankTaxNo(vo.getBankTaxNo());
tenantVO.setBusinessLicenseScope(vo.getBusinessLicenseScope());
tenantVO.setPersonIncharge(vo.getJuridicalPerson());
tenantVO.setContacts(vo.getContacts());
tenantVO.setContactTel(vo.getContactTel());
personelFeign.updateTenant(tenantVO);
enterpriseService.updateTenant(vo);
}
private String getTenantGuid(String name){
Map<String,String> map = personelFeign.getAllTenantGuidNameMap().getData();
for(String guid : map.keySet()){
if(map.get(guid).equals(name)){
return guid;
}
}
return null;
}
/** 转换数据 */
private String convertToVO(MfEnterpriseChangeApprove entity){
......
......@@ -28,6 +28,7 @@ import com.csbr.qingcloud.portal.mybatis.service.MfEnterpriseChangeApproveServic
import com.csbr.qingcloud.portal.mybatis.service.MfEnterpriseService;
import com.csbr.qingcloud.portal.service.EnterpriseService;
import com.csbr.qingcloud.portal.util.ChangeInfoUtil;
import com.csbr.qingcloud.portal.util.DateUtil;
import csbr.cloud.entity.domain.base.vo.PageListVO;
import csbr.cloud.entity.domain.user.UserInfo;
import csbr.cloud.entity.enums.ApprovalStateEnum;
......@@ -42,6 +43,7 @@ import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* @program: D:/git/ms-data-circulation-portal-service
......@@ -320,6 +322,8 @@ public class EnterpriseServiceImpl extends FlowAbstractImpl implements Enterpris
throw new CsbrSystemException(SystemError.DATA_UPDATE_ERROR, messageSourceUtil.updateMessage(String.format("%s的业务审批状态", FUNCTION_NAME)));
}
if (ApprovalStateEnum.PASSED.getValue().equals(dto.getApprovalState())) {
String tenantName = personelFeign.getAllTenantGuidNameMap().getData().get(entity.getTenantGuid());
if("非认证会员".equals(tenantName)){
//删除原帐号并新增正式会员
TenantRQVO vo = csbrBeanUtil.convert(entity,TenantRQVO.class);
vo.setTenantType(null);
......@@ -328,6 +332,10 @@ public class EnterpriseServiceImpl extends FlowAbstractImpl implements Enterpris
vo.setBizState("Y");
personelFeign.authTenant(vo).getData();
}
else{
updateTenant(entity);
}
}
}
......@@ -358,33 +366,36 @@ public class EnterpriseServiceImpl extends FlowAbstractImpl implements Enterpris
mfDemandService.removeByIds(list);
}
/** 仅更新会员本表信息 */
@Override
public Boolean check(EnterpriseRQVO vo) {
//非认证会员才需要检查会员名称等数据
StaffRSVO staff = getCurStaff();
if("非认证会员".equals(staff.getTenantName())){
TenantRQVO tenant = csbrBeanUtil.convert(vo,TenantRQVO.class);
personelFeign.checkTenant(tenant);
}
return true;
public void updateTenant(MfEnterprise vo) {
//同步更新会员表
TenantRQVO tenantVO = csbrBeanUtil.convert(vo,TenantRQVO.class);
tenantVO.setGuid(vo.getTenantGuid());
tenantVO.setPersonIncharge(vo.getJuridicalPerson());
tenantVO.setTenantName(vo.getTenantName());
tenantVO.setRegisteredCapital(vo.getRegisteredCapital());
tenantVO.setRegistrationDate(DateUtil.getDateToLocal(vo.getRegistrationDate()));
tenantVO.setBankTaxNo(vo.getBankTaxNo());
tenantVO.setBusinessLicenseScope(vo.getBusinessLicenseScope());
tenantVO.setPersonIncharge(vo.getJuridicalPerson());
tenantVO.setContacts(vo.getContacts());
tenantVO.setContactTel(vo.getContactTel());
personelFeign.changeUpdate(tenantVO);
}
private StaffRSVO getCurStaff(){
UserInfo userInfo = UserContextHolder.get();
StaffRSVO staffVO = personelFeign.getByUserGuid(userInfo.getUserId()).getData();
return staffVO;
}
private void checkUser(String logonUser){
UserQueryDTO dto = new UserQueryDTO();
dto.setLogonUser(logonUser);
List<UserVO> userList = userFeign.getUserSomeInfo(dto).getData().getRecords();
if(CollectionUtils.isNotEmpty(userList)){
StaffRSVO staffVO = personelFeign.getByUserGuid(userList.get(0).getGuid()).getData();
if(staffVO != null && StringUtils.isNotBlank(staffVO.getIsAdmin()) && "Y".equals(staffVO.getIsAdmin())){
throw new CsbrUserException(UserError.VALIDATE_CODE_ERROR, "账号已存在!");
@Override
public Boolean check(EnterpriseRQVO vo) {
String tenantName = personelFeign.getAllTenantGuidNameMap().getData().get(vo.getTenantGuid());
TenantRQVO tenant = csbrBeanUtil.convert(vo,TenantRQVO.class);
if("非认证会员".equals(tenantName)){
tenant.setGuid(null);
}
else{
tenant.setGuid(vo.getTenantGuid());
}
personelFeign.checkTenant(tenant);
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!