【DAOP-1.0】企业认证
【功能点】测试问题处理
Showing
4 changed files
with
196 additions
and
0 deletions
1 | package com.csbr.qingcloud.portal.domain.vo; | ||
2 | |||
3 | import com.csbr.cloud.mybatis.annotations.LikeQuery; | ||
4 | import com.csbr.cloud.mybatis.enums.LikeQueryEnum; | ||
5 | import csbr.cloud.entity.domain.base.dto.BasePageDTO; | ||
6 | import io.swagger.v3.oas.annotations.media.Schema; | ||
7 | import jakarta.validation.constraints.Pattern; | ||
8 | import lombok.Data; | ||
9 | |||
10 | import java.util.List; | ||
11 | |||
12 | /** | ||
13 | * @program: common-admin-platform-auth-service | ||
14 | * @description: 用户查询参数 | ||
15 | * @author: yio | ||
16 | * @create: 2020-07-28 13:47 | ||
17 | **/ | ||
18 | @Data | ||
19 | @Schema(name = "用户查询参数") | ||
20 | public class UserQueryDTO extends BasePageDTO { | ||
21 | /** 系统唯一标识 */ | ||
22 | @Schema(name = "guid",title = "系统唯一标识") | ||
23 | private String guid; | ||
24 | |||
25 | /** 锁定(Y 是;N 否) */ | ||
26 | @Schema(name = "guid",title = "锁定(Y 是;N 否)") | ||
27 | @Pattern(regexp = "^Y|N$", message = "锁定应该为Y、N中的值。") | ||
28 | private String isLocked; | ||
29 | |||
30 | /** 登录账号 */ | ||
31 | @Schema(name = "guid",title = "登录账号") | ||
32 | @LikeQuery(type = LikeQueryEnum.ALL) | ||
33 | private String logonUser; | ||
34 | |||
35 | /** 登录账号(多个) */ | ||
36 | @Schema(name = "guid",title = "登录账号(多个)") | ||
37 | private List<String> logonUserList; | ||
38 | |||
39 | /** 手机号 */ | ||
40 | @Schema(name = "guid",title = "手机号") | ||
41 | @LikeQuery(type = LikeQueryEnum.ALL) | ||
42 | private String mobileNo; | ||
43 | |||
44 | /** 手机号 */ | ||
45 | @Schema(name = "guid",title = "手机号(多个)") | ||
46 | @LikeQuery(type = LikeQueryEnum.ALL) | ||
47 | private List<String> mobileNoList; | ||
48 | |||
49 | /** 姓名 */ | ||
50 | @Schema(name = "guid",title = "姓名") | ||
51 | @LikeQuery(type = LikeQueryEnum.ALL) | ||
52 | private String name; | ||
53 | |||
54 | /** 平台GUID */ | ||
55 | @Schema(name = "guid",title = "平台GUID") | ||
56 | private String platformGuid; | ||
57 | |||
58 | /** 业务状态(Y 有效;S 停用) */ | ||
59 | @Schema(name = "guid",title = "业务状态(Y 有效;S 停用)") | ||
60 | @Pattern(regexp = "^Y|S$", message = "业务状态应该为Y、S中的值。") | ||
61 | private String bizState; | ||
62 | |||
63 | } |
1 | package com.csbr.qingcloud.portal.domain.vo; | ||
2 | |||
3 | import com.baomidou.mybatisplus.annotation.TableLogic; | ||
4 | import io.swagger.v3.oas.annotations.media.Schema; | ||
5 | import lombok.Data; | ||
6 | |||
7 | import java.sql.Timestamp; | ||
8 | |||
9 | /** | ||
10 | * @program: common-admin-platform-auth-service | ||
11 | * @description: 获取用户查询的返回值对象 | ||
12 | * @author: yio | ||
13 | * @create: 2020-07-28 14:46 | ||
14 | **/ | ||
15 | @Data | ||
16 | @Schema(name = "获取用户查询的返回值对象") | ||
17 | public class UserVO { | ||
18 | |||
19 | /** 业务状态(Y 有效;S 停用) */ | ||
20 | @Schema(name = "guid",title = "业务状态(Y 有效;S 停用)") | ||
21 | private String bizState; | ||
22 | |||
23 | /** 创建时间 */ | ||
24 | @Schema(name = "guid",title = "创建时间") | ||
25 | private Timestamp createTime; | ||
26 | |||
27 | /** 创建人 */ | ||
28 | @Schema(name = "guid",title = "创建人") | ||
29 | private String createUserId; | ||
30 | |||
31 | /** 创建人姓名 */ | ||
32 | @Schema(name = "guid",title = "创建人姓名") | ||
33 | private String createUserName; | ||
34 | |||
35 | /** 系统唯一标识 */ | ||
36 | @Schema(name = "guid",title = "系统唯一标识") | ||
37 | private String guid; | ||
38 | |||
39 | /** 是否删除(null 是;N 否 默认 N) */ | ||
40 | @Schema(name = "guid",title = "是否删除(Y 是;N 否 默认 N)") | ||
41 | @TableLogic | ||
42 | private String isDeleted; | ||
43 | |||
44 | /** 锁定(Y 是;N 否) */ | ||
45 | @Schema(name = "guid",title = "锁定(Y 是;N 否)") | ||
46 | private String isLocked; | ||
47 | |||
48 | /** 最后登录时间 */ | ||
49 | @Schema(name = "guid",title = "最后登录时间") | ||
50 | private Timestamp lastLoginTime; | ||
51 | |||
52 | /** 登录失败次数 */ | ||
53 | @Schema(name = "guid",title = "登录失败次数") | ||
54 | private Integer loginErrorCount; | ||
55 | |||
56 | /** 登录账号 */ | ||
57 | @Schema(name = "guid",title = "登录账号") | ||
58 | private String logonUser; | ||
59 | |||
60 | /** 手机号 */ | ||
61 | @Schema(name = "guid",title = "手机号") | ||
62 | private String mobileNo; | ||
63 | |||
64 | /** 姓名 */ | ||
65 | @Schema(name = "guid",title = "姓名") | ||
66 | private String name; | ||
67 | |||
68 | /** 平台GUID */ | ||
69 | @Schema(name = "guid",title = "平台GUID") | ||
70 | private String platformGuid; | ||
71 | |||
72 | /** 密码 */ | ||
73 | @Schema(name = "guid",title = "密码") | ||
74 | private String pwd; | ||
75 | |||
76 | /** 修改时间 */ | ||
77 | @Schema(name = "guid",title = "修改时间") | ||
78 | private Timestamp updateTime; | ||
79 | |||
80 | /** 修改人 */ | ||
81 | @Schema(name = "guid",title = "修改人") | ||
82 | private String updateUserId; | ||
83 | |||
84 | /** 修改姓名 */ | ||
85 | @Schema(name = "guid",title = "修改姓名") | ||
86 | private String updateUserName; | ||
87 | |||
88 | @Schema(name = "guid",title = "微信授权认证的unionId") | ||
89 | private String unionId; | ||
90 | } |
1 | package com.csbr.qingcloud.portal.feign; | ||
2 | |||
3 | import com.csbr.cloud.common.config.FastCallFeignConfiguration; | ||
4 | import com.csbr.cloud.common.response.CommonRes; | ||
5 | import com.csbr.qingcloud.portal.domain.vo.UserQueryDTO; | ||
6 | import com.csbr.qingcloud.portal.domain.vo.UserVO; | ||
7 | import csbr.cloud.entity.domain.base.vo.PageListVO; | ||
8 | import org.springframework.cloud.openfeign.FeignClient; | ||
9 | import org.springframework.http.MediaType; | ||
10 | import org.springframework.web.bind.annotation.*; | ||
11 | import java.util.List; | ||
12 | |||
13 | /** | ||
14 | * @author Xiaocq | ||
15 | */ | ||
16 | @FeignClient(value = "ms-daop-user-service", configuration = FastCallFeignConfiguration.class) | ||
17 | public interface UserFeign { | ||
18 | |||
19 | @PostMapping(value = "/user/data/get-some-info", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) | ||
20 | CommonRes<PageListVO<UserVO>> getUserSomeInfo(@RequestBody UserQueryDTO dto); | ||
21 | |||
22 | /** | ||
23 | * 通过手机查用户 | ||
24 | */ | ||
25 | @PostMapping(value = "/user/data/get/mobile", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) | ||
26 | CommonRes<List<UserVO>> getUserByMobileOrIdCode(@RequestBody UserQueryDTO dto); | ||
27 | |||
28 | } |
... | @@ -4,9 +4,12 @@ import com.alibaba.fastjson.JSON; | ... | @@ -4,9 +4,12 @@ import com.alibaba.fastjson.JSON; |
4 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | 4 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
5 | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; | 5 | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
6 | import com.csbr.cloud.common.enums.SystemError; | 6 | import com.csbr.cloud.common.enums.SystemError; |
7 | import com.csbr.cloud.common.enums.UserError; | ||
7 | import com.csbr.cloud.common.enums.WorkFlowBizEnum; | 8 | import com.csbr.cloud.common.enums.WorkFlowBizEnum; |
9 | import com.csbr.cloud.common.exception.CsbrUserException; | ||
8 | import com.csbr.qingcloud.portal.domain.vo.*; | 10 | import com.csbr.qingcloud.portal.domain.vo.*; |
9 | import com.csbr.qingcloud.portal.feign.PersonelFeign; | 11 | import com.csbr.qingcloud.portal.feign.PersonelFeign; |
12 | import com.csbr.qingcloud.portal.feign.UserFeign; | ||
10 | import com.csbr.qingcloud.portal.mybatis.entity.MfDemand; | 13 | import com.csbr.qingcloud.portal.mybatis.entity.MfDemand; |
11 | import com.csbr.qingcloud.portal.mybatis.entity.MfEnterpriseChangeApprove; | 14 | import com.csbr.qingcloud.portal.mybatis.entity.MfEnterpriseChangeApprove; |
12 | import com.csbr.qingcloud.portal.mybatis.service.MfDemandService; | 15 | import com.csbr.qingcloud.portal.mybatis.service.MfDemandService; |
... | @@ -76,6 +79,9 @@ public class EnterpriseServiceImpl extends FlowAbstractImpl implements Enterpris | ... | @@ -76,6 +79,9 @@ public class EnterpriseServiceImpl extends FlowAbstractImpl implements Enterpris |
76 | @Resource | 79 | @Resource |
77 | private MfDemandService mfDemandService; | 80 | private MfDemandService mfDemandService; |
78 | 81 | ||
82 | @Resource | ||
83 | private UserFeign userFeign; | ||
84 | |||
79 | /** | 85 | /** |
80 | * 企业信息分页查询 | 86 | * 企业信息分页查询 |
81 | * @author xcq | 87 | * @author xcq |
... | @@ -446,6 +452,13 @@ public class EnterpriseServiceImpl extends FlowAbstractImpl implements Enterpris | ... | @@ -446,6 +452,13 @@ public class EnterpriseServiceImpl extends FlowAbstractImpl implements Enterpris |
446 | 452 | ||
447 | @Override | 453 | @Override |
448 | public Boolean check(EnterpriseRQVO vo) { | 454 | public Boolean check(EnterpriseRQVO vo) { |
455 | //检查管理员账号 | ||
456 | UserQueryDTO dto = new UserQueryDTO(); | ||
457 | dto.setLogonUser(vo.getLogonUser()); | ||
458 | List<UserVO> userList = userFeign.getUserSomeInfo(dto).getData().getRecords(); | ||
459 | if(CollectionUtils.isNotEmpty(userList)){ | ||
460 | throw new CsbrUserException(UserError.VALIDATE_CODE_ERROR, "账号管理人手机号已存在!"); | ||
461 | } | ||
449 | return true; | 462 | return true; |
450 | } | 463 | } |
451 | 464 | ||
... | @@ -480,6 +493,7 @@ public class EnterpriseServiceImpl extends FlowAbstractImpl implements Enterpris | ... | @@ -480,6 +493,7 @@ public class EnterpriseServiceImpl extends FlowAbstractImpl implements Enterpris |
480 | */ | 493 | */ |
481 | private void beforeSave(EnterpriseRQVO rqVO) { | 494 | private void beforeSave(EnterpriseRQVO rqVO) { |
482 | //region 1.输入基础验证 | 495 | //region 1.输入基础验证 |
496 | check(rqVO); | ||
483 | //endregion | 497 | //endregion |
484 | 498 | ||
485 | //region 2.数据验证特殊处理 | 499 | //region 2.数据验证特殊处理 |
... | @@ -539,6 +553,7 @@ public class EnterpriseServiceImpl extends FlowAbstractImpl implements Enterpris | ... | @@ -539,6 +553,7 @@ public class EnterpriseServiceImpl extends FlowAbstractImpl implements Enterpris |
539 | */ | 553 | */ |
540 | private void beforeUpdate(EnterpriseRQVO rqVO) { | 554 | private void beforeUpdate(EnterpriseRQVO rqVO) { |
541 | //region 1.输入基础验证 | 555 | //region 1.输入基础验证 |
556 | check(rqVO); | ||
542 | if (StringUtils.isBlank(rqVO.getGuid())) { | 557 | if (StringUtils.isBlank(rqVO.getGuid())) { |
543 | // W00012 = {0}:参数[{1}]不能为空! | 558 | // W00012 = {0}:参数[{1}]不能为空! |
544 | throw new CsbrSystemException(SystemError.DATA_INPUT_ERROR, messageSourceUtil.getMessage("W00010", String.format("修改%s数据",FUNCTION_NAME), "数据唯一标识")); | 559 | throw new CsbrSystemException(SystemError.DATA_INPUT_ERROR, messageSourceUtil.getMessage("W00010", String.format("修改%s数据",FUNCTION_NAME), "数据唯一标识")); | ... | ... |
-
Please register or sign in to post a comment