【DAOP-1.0】企业认证
【功能点】测试问题处理
Showing
8 changed files
with
53 additions
and
44 deletions
... | @@ -17,6 +17,8 @@ import java.util.Date; | ... | @@ -17,6 +17,8 @@ import java.util.Date; |
17 | @Schema(title = "企业信息新增、修改参数") | 17 | @Schema(title = "企业信息新增、修改参数") |
18 | public class EnterpriseRQVO extends FlowRQBaseVO { | 18 | public class EnterpriseRQVO extends FlowRQBaseVO { |
19 | 19 | ||
20 | @Schema(description = "会员GUID") | ||
21 | private String tenantGuid; | ||
20 | /** | 22 | /** |
21 | * 公司名称 | 23 | * 公司名称 |
22 | */ | 24 | */ | ... | ... |
... | @@ -24,6 +24,9 @@ public class EnterpriseRSVO { | ... | @@ -24,6 +24,9 @@ public class EnterpriseRSVO { |
24 | @Schema(description = "系统唯一标识") | 24 | @Schema(description = "系统唯一标识") |
25 | private String guid; | 25 | private String guid; |
26 | 26 | ||
27 | @Schema(description = "会员GUID") | ||
28 | private String tenantGuid; | ||
29 | |||
27 | /** | 30 | /** |
28 | * 公司名称 | 31 | * 公司名称 |
29 | */ | 32 | */ | ... | ... |
... | @@ -21,7 +21,10 @@ public interface PersonelFeign { | ... | @@ -21,7 +21,10 @@ public interface PersonelFeign { |
21 | CommonRes<TenantRQVO> authTenant(@RequestBody TenantRQVO vo); | 21 | CommonRes<TenantRQVO> authTenant(@RequestBody TenantRQVO vo); |
22 | 22 | ||
23 | @PutMapping(value = "/tenant/update", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) | 23 | @PutMapping(value = "/tenant/update", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) |
24 | CommonRes<Boolean> updateTenant(@RequestBody TenantRQVO vo); | 24 | CommonRes<String> updateTenant(@RequestBody TenantRQVO vo); |
25 | |||
26 | @PutMapping(value = "/tenant/change-update", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) | ||
27 | CommonRes<Boolean> changeUpdate(@RequestBody TenantRQVO vo); | ||
25 | 28 | ||
26 | @GetMapping(value = "/tenant/get-all-tenant-guid-name-map", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) | 29 | @GetMapping(value = "/tenant/get-all-tenant-guid-name-map", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) |
27 | CommonRes<Map<String, String>> getAllTenantGuidNameMap(); | 30 | CommonRes<Map<String, String>> getAllTenantGuidNameMap(); | ... | ... |
... | @@ -22,6 +22,9 @@ import java.util.Date; | ... | @@ -22,6 +22,9 @@ import java.util.Date; |
22 | @Name("企业信息") | 22 | @Name("企业信息") |
23 | public class MfEnterprise extends BaseDO { | 23 | public class MfEnterprise extends BaseDO { |
24 | 24 | ||
25 | @Name("会员GUID") | ||
26 | private String tenantGuid; | ||
27 | |||
25 | /** | 28 | /** |
26 | * 公司名称 | 29 | * 公司名称 |
27 | */ | 30 | */ | ... | ... |
... | @@ -22,6 +22,9 @@ import java.util.Date; | ... | @@ -22,6 +22,9 @@ import java.util.Date; |
22 | @Name("企业信息变更审批") | 22 | @Name("企业信息变更审批") |
23 | public class MfEnterpriseChangeApprove extends BaseDO { | 23 | public class MfEnterpriseChangeApprove extends BaseDO { |
24 | 24 | ||
25 | @Name("会员GUID") | ||
26 | private String tenantGuid; | ||
27 | |||
25 | /** | 28 | /** |
26 | * 公司名称 | 29 | * 公司名称 |
27 | */ | 30 | */ | ... | ... |
... | @@ -2,6 +2,7 @@ package com.csbr.qingcloud.portal.service; | ... | @@ -2,6 +2,7 @@ package com.csbr.qingcloud.portal.service; |
2 | 2 | ||
3 | import com.csbr.cloud.workflow.domain.dto.appove.FlowUpdateStateDTO; | 3 | import com.csbr.cloud.workflow.domain.dto.appove.FlowUpdateStateDTO; |
4 | import com.csbr.qingcloud.portal.domain.vo.*; | 4 | import com.csbr.qingcloud.portal.domain.vo.*; |
5 | import com.csbr.qingcloud.portal.mybatis.entity.MfEnterprise; | ||
5 | import csbr.cloud.entity.domain.base.vo.PageListVO; | 6 | import csbr.cloud.entity.domain.base.vo.PageListVO; |
6 | import com.csbr.cloud.workflow.domain.dto.callback.BizCallbackDTO; | 7 | import com.csbr.cloud.workflow.domain.dto.callback.BizCallbackDTO; |
7 | import com.csbr.cloud.workflow.domain.vo.appove.FlowRQBaseVO; | 8 | import com.csbr.cloud.workflow.domain.vo.appove.FlowRQBaseVO; |
... | @@ -79,4 +80,6 @@ public interface EnterpriseService { | ... | @@ -79,4 +80,6 @@ public interface EnterpriseService { |
79 | /** 将此账号提交的数据需求迁移到新的企业 */ | 80 | /** 将此账号提交的数据需求迁移到新的企业 */ |
80 | void moveOldData(TenantRQVO vo); | 81 | void moveOldData(TenantRQVO vo); |
81 | 82 | ||
83 | /** 更新会员信息 */ | ||
84 | void updateTenant(MfEnterprise vo); | ||
82 | } | 85 | } | ... | ... |
... | @@ -139,29 +139,10 @@ public class EnterpriseChangeApproveServiceImpl implements EnterpriseChangeAppro | ... | @@ -139,29 +139,10 @@ public class EnterpriseChangeApproveServiceImpl implements EnterpriseChangeAppro |
139 | mfEnterpriseService.updateById(vo); | 139 | mfEnterpriseService.updateById(vo); |
140 | 140 | ||
141 | //同步更新会员表 | 141 | //同步更新会员表 |
142 | TenantRQVO tenantVO = csbrBeanUtil.convert(vo,TenantRQVO.class); | 142 | enterpriseService.updateTenant(vo); |
143 | tenantVO.setGuid(getTenantGuid(vo.getTenantName())); | ||
144 | tenantVO.setPersonIncharge(vo.getJuridicalPerson()); | ||
145 | tenantVO.setTenantName(vo.getTenantName()); | ||
146 | tenantVO.setRegisteredCapital(vo.getRegisteredCapital()); | ||
147 | tenantVO.setRegistrationDate(DateUtil.getDateToLocal(vo.getRegistrationDate())); | ||
148 | tenantVO.setBankTaxNo(vo.getBankTaxNo()); | ||
149 | tenantVO.setBusinessLicenseScope(vo.getBusinessLicenseScope()); | ||
150 | tenantVO.setPersonIncharge(vo.getJuridicalPerson()); | ||
151 | tenantVO.setContacts(vo.getContacts()); | ||
152 | tenantVO.setContactTel(vo.getContactTel()); | ||
153 | personelFeign.updateTenant(tenantVO); | ||
154 | } | 143 | } |
155 | 144 | ||
156 | private String getTenantGuid(String name){ | 145 | |
157 | Map<String,String> map = personelFeign.getAllTenantGuidNameMap().getData(); | ||
158 | for(String guid : map.keySet()){ | ||
159 | if(map.get(guid).equals(name)){ | ||
160 | return guid; | ||
161 | } | ||
162 | } | ||
163 | return null; | ||
164 | } | ||
165 | 146 | ||
166 | /** 转换数据 */ | 147 | /** 转换数据 */ |
167 | private String convertToVO(MfEnterpriseChangeApprove entity){ | 148 | private String convertToVO(MfEnterpriseChangeApprove entity){ | ... | ... |
... | @@ -28,6 +28,7 @@ import com.csbr.qingcloud.portal.mybatis.service.MfEnterpriseChangeApproveServic | ... | @@ -28,6 +28,7 @@ import com.csbr.qingcloud.portal.mybatis.service.MfEnterpriseChangeApproveServic |
28 | import com.csbr.qingcloud.portal.mybatis.service.MfEnterpriseService; | 28 | import com.csbr.qingcloud.portal.mybatis.service.MfEnterpriseService; |
29 | import com.csbr.qingcloud.portal.service.EnterpriseService; | 29 | import com.csbr.qingcloud.portal.service.EnterpriseService; |
30 | import com.csbr.qingcloud.portal.util.ChangeInfoUtil; | 30 | import com.csbr.qingcloud.portal.util.ChangeInfoUtil; |
31 | import com.csbr.qingcloud.portal.util.DateUtil; | ||
31 | import csbr.cloud.entity.domain.base.vo.PageListVO; | 32 | import csbr.cloud.entity.domain.base.vo.PageListVO; |
32 | import csbr.cloud.entity.domain.user.UserInfo; | 33 | import csbr.cloud.entity.domain.user.UserInfo; |
33 | import csbr.cloud.entity.enums.ApprovalStateEnum; | 34 | import csbr.cloud.entity.enums.ApprovalStateEnum; |
... | @@ -42,6 +43,7 @@ import org.springframework.transaction.annotation.Transactional; | ... | @@ -42,6 +43,7 @@ import org.springframework.transaction.annotation.Transactional; |
42 | import java.util.ArrayList; | 43 | import java.util.ArrayList; |
43 | import java.util.Date; | 44 | import java.util.Date; |
44 | import java.util.List; | 45 | import java.util.List; |
46 | import java.util.Map; | ||
45 | 47 | ||
46 | /** | 48 | /** |
47 | * @program: D:/git/ms-data-circulation-portal-service | 49 | * @program: D:/git/ms-data-circulation-portal-service |
... | @@ -320,6 +322,8 @@ public class EnterpriseServiceImpl extends FlowAbstractImpl implements Enterpris | ... | @@ -320,6 +322,8 @@ public class EnterpriseServiceImpl extends FlowAbstractImpl implements Enterpris |
320 | throw new CsbrSystemException(SystemError.DATA_UPDATE_ERROR, messageSourceUtil.updateMessage(String.format("%s的业务审批状态", FUNCTION_NAME))); | 322 | throw new CsbrSystemException(SystemError.DATA_UPDATE_ERROR, messageSourceUtil.updateMessage(String.format("%s的业务审批状态", FUNCTION_NAME))); |
321 | } | 323 | } |
322 | if (ApprovalStateEnum.PASSED.getValue().equals(dto.getApprovalState())) { | 324 | if (ApprovalStateEnum.PASSED.getValue().equals(dto.getApprovalState())) { |
325 | String tenantName = personelFeign.getAllTenantGuidNameMap().getData().get(entity.getTenantGuid()); | ||
326 | if("非认证会员".equals(tenantName)){ | ||
323 | //删除原帐号并新增正式会员 | 327 | //删除原帐号并新增正式会员 |
324 | TenantRQVO vo = csbrBeanUtil.convert(entity,TenantRQVO.class); | 328 | TenantRQVO vo = csbrBeanUtil.convert(entity,TenantRQVO.class); |
325 | vo.setTenantType(null); | 329 | vo.setTenantType(null); |
... | @@ -328,6 +332,10 @@ public class EnterpriseServiceImpl extends FlowAbstractImpl implements Enterpris | ... | @@ -328,6 +332,10 @@ public class EnterpriseServiceImpl extends FlowAbstractImpl implements Enterpris |
328 | vo.setBizState("Y"); | 332 | vo.setBizState("Y"); |
329 | personelFeign.authTenant(vo).getData(); | 333 | personelFeign.authTenant(vo).getData(); |
330 | } | 334 | } |
335 | else{ | ||
336 | updateTenant(entity); | ||
337 | } | ||
338 | } | ||
331 | 339 | ||
332 | } | 340 | } |
333 | 341 | ||
... | @@ -358,33 +366,36 @@ public class EnterpriseServiceImpl extends FlowAbstractImpl implements Enterpris | ... | @@ -358,33 +366,36 @@ public class EnterpriseServiceImpl extends FlowAbstractImpl implements Enterpris |
358 | mfDemandService.removeByIds(list); | 366 | mfDemandService.removeByIds(list); |
359 | } | 367 | } |
360 | 368 | ||
369 | /** 仅更新会员本表信息 */ | ||
361 | @Override | 370 | @Override |
362 | public Boolean check(EnterpriseRQVO vo) { | 371 | public void updateTenant(MfEnterprise vo) { |
363 | //非认证会员才需要检查会员名称等数据 | 372 | //同步更新会员表 |
364 | StaffRSVO staff = getCurStaff(); | 373 | TenantRQVO tenantVO = csbrBeanUtil.convert(vo,TenantRQVO.class); |
365 | if("非认证会员".equals(staff.getTenantName())){ | 374 | tenantVO.setGuid(vo.getTenantGuid()); |
366 | TenantRQVO tenant = csbrBeanUtil.convert(vo,TenantRQVO.class); | 375 | tenantVO.setPersonIncharge(vo.getJuridicalPerson()); |
367 | personelFeign.checkTenant(tenant); | 376 | tenantVO.setTenantName(vo.getTenantName()); |
368 | } | 377 | tenantVO.setRegisteredCapital(vo.getRegisteredCapital()); |
369 | return true; | 378 | tenantVO.setRegistrationDate(DateUtil.getDateToLocal(vo.getRegistrationDate())); |
379 | tenantVO.setBankTaxNo(vo.getBankTaxNo()); | ||
380 | tenantVO.setBusinessLicenseScope(vo.getBusinessLicenseScope()); | ||
381 | tenantVO.setPersonIncharge(vo.getJuridicalPerson()); | ||
382 | tenantVO.setContacts(vo.getContacts()); | ||
383 | tenantVO.setContactTel(vo.getContactTel()); | ||
384 | personelFeign.changeUpdate(tenantVO); | ||
370 | } | 385 | } |
371 | 386 | ||
372 | private StaffRSVO getCurStaff(){ | 387 | @Override |
373 | UserInfo userInfo = UserContextHolder.get(); | 388 | public Boolean check(EnterpriseRQVO vo) { |
374 | StaffRSVO staffVO = personelFeign.getByUserGuid(userInfo.getUserId()).getData(); | 389 | String tenantName = personelFeign.getAllTenantGuidNameMap().getData().get(vo.getTenantGuid()); |
375 | return staffVO; | 390 | TenantRQVO tenant = csbrBeanUtil.convert(vo,TenantRQVO.class); |
376 | } | 391 | if("非认证会员".equals(tenantName)){ |
377 | 392 | tenant.setGuid(null); | |
378 | private void checkUser(String logonUser){ | ||
379 | UserQueryDTO dto = new UserQueryDTO(); | ||
380 | dto.setLogonUser(logonUser); | ||
381 | List<UserVO> userList = userFeign.getUserSomeInfo(dto).getData().getRecords(); | ||
382 | if(CollectionUtils.isNotEmpty(userList)){ | ||
383 | StaffRSVO staffVO = personelFeign.getByUserGuid(userList.get(0).getGuid()).getData(); | ||
384 | if(staffVO != null && StringUtils.isNotBlank(staffVO.getIsAdmin()) && "Y".equals(staffVO.getIsAdmin())){ | ||
385 | throw new CsbrUserException(UserError.VALIDATE_CODE_ERROR, "账号已存在!"); | ||
386 | } | 393 | } |
394 | else{ | ||
395 | tenant.setGuid(vo.getTenantGuid()); | ||
387 | } | 396 | } |
397 | personelFeign.checkTenant(tenant); | ||
398 | return true; | ||
388 | } | 399 | } |
389 | 400 | ||
390 | /** | 401 | /** | ... | ... |
-
Please register or sign in to post a comment