【DAOP-1.0】企业认证
【功能点】测试问题处理
Showing
8 changed files
with
65 additions
and
56 deletions
... | @@ -16,7 +16,9 @@ import java.util.Date; | ... | @@ -16,7 +16,9 @@ import java.util.Date; |
16 | @Data | 16 | @Data |
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 | */ | ... | ... |
... | @@ -23,7 +23,10 @@ public class EnterpriseRSVO { | ... | @@ -23,7 +23,10 @@ public class EnterpriseRSVO { |
23 | */ | 23 | */ |
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(); | ... | ... |
... | @@ -21,7 +21,10 @@ import java.util.Date; | ... | @@ -21,7 +21,10 @@ import java.util.Date; |
21 | @Accessors(chain = true) | 21 | @Accessors(chain = true) |
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 | */ | ... | ... |
... | @@ -21,7 +21,10 @@ import java.util.Date; | ... | @@ -21,7 +21,10 @@ import java.util.Date; |
21 | @Accessors(chain = true) | 21 | @Accessors(chain = true) |
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,13 +322,19 @@ public class EnterpriseServiceImpl extends FlowAbstractImpl implements Enterpris | ... | @@ -320,13 +322,19 @@ 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())) { |
323 | //删除原帐号并新增正式会员 | 325 | String tenantName = personelFeign.getAllTenantGuidNameMap().getData().get(entity.getTenantGuid()); |
324 | TenantRQVO vo = csbrBeanUtil.convert(entity,TenantRQVO.class); | 326 | if("非认证会员".equals(tenantName)){ |
325 | vo.setTenantType(null); | 327 | //删除原帐号并新增正式会员 |
326 | vo.setBizGuid(dto.getBizGuid()); | 328 | TenantRQVO vo = csbrBeanUtil.convert(entity,TenantRQVO.class); |
327 | vo.setPersonIncharge(entity.getJuridicalPerson()); | 329 | vo.setTenantType(null); |
328 | vo.setBizState("Y"); | 330 | vo.setBizGuid(dto.getBizGuid()); |
329 | personelFeign.authTenant(vo).getData(); | 331 | vo.setPersonIncharge(entity.getJuridicalPerson()); |
332 | vo.setBizState("Y"); | ||
333 | personelFeign.authTenant(vo).getData(); | ||
334 | } | ||
335 | else{ | ||
336 | updateTenant(entity); | ||
337 | } | ||
330 | } | 338 | } |
331 | 339 | ||
332 | } | 340 | } |
... | @@ -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())); |
370 | } | 379 | tenantVO.setBankTaxNo(vo.getBankTaxNo()); |
371 | 380 | tenantVO.setBusinessLicenseScope(vo.getBusinessLicenseScope()); | |
372 | private StaffRSVO getCurStaff(){ | 381 | tenantVO.setPersonIncharge(vo.getJuridicalPerson()); |
373 | UserInfo userInfo = UserContextHolder.get(); | 382 | tenantVO.setContacts(vo.getContacts()); |
374 | StaffRSVO staffVO = personelFeign.getByUserGuid(userInfo.getUserId()).getData(); | 383 | tenantVO.setContactTel(vo.getContactTel()); |
375 | return staffVO; | 384 | personelFeign.changeUpdate(tenantVO); |
376 | } | 385 | } |
377 | 386 | ||
378 | private void checkUser(String logonUser){ | 387 | @Override |
379 | UserQueryDTO dto = new UserQueryDTO(); | 388 | public Boolean check(EnterpriseRQVO vo) { |
380 | dto.setLogonUser(logonUser); | 389 | String tenantName = personelFeign.getAllTenantGuidNameMap().getData().get(vo.getTenantGuid()); |
381 | List<UserVO> userList = userFeign.getUserSomeInfo(dto).getData().getRecords(); | 390 | TenantRQVO tenant = csbrBeanUtil.convert(vo,TenantRQVO.class); |
382 | if(CollectionUtils.isNotEmpty(userList)){ | 391 | if("非认证会员".equals(tenantName)){ |
383 | StaffRSVO staffVO = personelFeign.getByUserGuid(userList.get(0).getGuid()).getData(); | 392 | tenant.setGuid(null); |
384 | if(staffVO != null && StringUtils.isNotBlank(staffVO.getIsAdmin()) && "Y".equals(staffVO.getIsAdmin())){ | 393 | } |
385 | throw new CsbrUserException(UserError.VALIDATE_CODE_ERROR, "账号已存在!"); | 394 | else{ |
386 | } | 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