可信空间修改
Showing
33 changed files
with
2975 additions
and
0 deletions
1 | package com.csbr.qingcloud.portal.controller; | ||
2 | |||
3 | import com.alibaba.fastjson.JSONObject; | ||
4 | import com.alibaba.fastjson2.JSON; | ||
5 | import com.csbr.cloud.common.response.CommonRes; | ||
6 | import com.csbr.qingcloud.portal.domain.vo.TdsUserIdentityRQVO; | ||
7 | import com.csbr.qingcloud.portal.enums.TdsDataTypeEnum; | ||
8 | import com.csbr.qingcloud.portal.service.TdsSyncToRegionalNodeCallback; | ||
9 | import com.csbr.qingcloud.portal.service.TdsUserIdentityService; | ||
10 | import csbr.cloud.entity.annotation.SystemLog; | ||
11 | import io.swagger.v3.oas.annotations.Operation; | ||
12 | import io.swagger.v3.oas.annotations.tags.Tag; | ||
13 | import jakarta.annotation.Resource; | ||
14 | import jakarta.validation.Valid; | ||
15 | import org.springframework.web.bind.annotation.*; | ||
16 | |||
17 | /** | ||
18 | * @program: | ||
19 | * @description: 可信空间数据同步控制器 | ||
20 | * @author: xup | ||
21 | * @create: 2025-08-14 13:21 | ||
22 | **/ | ||
23 | @RestController | ||
24 | @RequestMapping("/tds-sync") | ||
25 | @Tag(name = "可信空间数据同步控制器") | ||
26 | public class TdsSyncController { | ||
27 | |||
28 | @Resource | ||
29 | private TdsUserIdentityService tdsUserIdentityService; | ||
30 | |||
31 | @PostMapping("/biz-sync-regional") | ||
32 | @SystemLog(value = "业务节点同步到区域节点") | ||
33 | @Operation(summary = "业务节点同步到区域节点",hidden = true) | ||
34 | public CommonRes<Boolean> bizSyncRegional(@RequestBody JSONObject data, @RequestParam String zqName, | ||
35 | @RequestParam TdsDataTypeEnum dataType) { | ||
36 | switch (dataType){ | ||
37 | case USER ->{ | ||
38 | tdsUserIdentityService.saveTdsUserIdentity(JSON.parseObject(data.toJSONString(),TdsUserIdentityRQVO.class)); | ||
39 | break; | ||
40 | } | ||
41 | } | ||
42 | return CommonRes.success(true); | ||
43 | } | ||
44 | |||
45 | @PostMapping("/regional-sync-biz") | ||
46 | @SystemLog(value = "区域节点同步审批信息") | ||
47 | @Operation(summary = "区域节点同步审批信息",hidden = true) | ||
48 | public CommonRes<Boolean> regionalSyncBiz(@RequestParam String bizGuid, | ||
49 | @RequestParam Integer identityStatus, | ||
50 | @RequestParam String message, | ||
51 | @RequestParam TdsDataTypeEnum dataType) { | ||
52 | switch (dataType){ | ||
53 | case USER ->{ | ||
54 | tdsUserIdentityService.updateTdsUserIdentityStatus(bizGuid,identityStatus,message); | ||
55 | break; | ||
56 | } | ||
57 | } | ||
58 | return CommonRes.success(true); | ||
59 | } | ||
60 | } |
1 | package com.csbr.qingcloud.portal.controller; | ||
2 | |||
3 | import com.baomidou.mybatisplus.autoconfigure.ConfigurationCustomizer; | ||
4 | import com.csbr.cloud.common.response.CommonRes; | ||
5 | import com.csbr.qingcloud.portal.enums.TdsDataTypeEnum; | ||
6 | import com.csbr.qingcloud.portal.service.impl.TdsSyncToRegionalNodeService; | ||
7 | import csbr.cloud.entity.annotation.SystemLog; | ||
8 | import csbr.cloud.entity.domain.base.vo.PageListVO; | ||
9 | import com.csbr.qingcloud.portal.domain.vo.TdsUserIdentityQueryVO; | ||
10 | import com.csbr.qingcloud.portal.domain.vo.TdsUserIdentityRQVO; | ||
11 | import com.csbr.qingcloud.portal.domain.vo.TdsUserIdentityRSVO; | ||
12 | import com.csbr.qingcloud.portal.service.TdsUserIdentityService; | ||
13 | import io.swagger.v3.oas.annotations.Operation; | ||
14 | import io.swagger.v3.oas.annotations.Parameter; | ||
15 | import io.swagger.v3.oas.annotations.tags.Tag; | ||
16 | import jakarta.annotation.Resource; | ||
17 | import jakarta.validation.Valid; | ||
18 | import org.springframework.web.bind.annotation.*; | ||
19 | |||
20 | import java.util.List; | ||
21 | |||
22 | /** | ||
23 | * @program: | ||
24 | * @description: 个人用户身份信息-控制器 | ||
25 | * @author: xup | ||
26 | * @create: 2025-08-14 13:21 | ||
27 | **/ | ||
28 | @RestController | ||
29 | @RequestMapping("/tds-user-identity") | ||
30 | @Tag(name = "个人用户身份信息-控制器") | ||
31 | public class TdsUserIdentityController { | ||
32 | |||
33 | @Resource | ||
34 | private TdsUserIdentityService tdsUserIdentityService; | ||
35 | |||
36 | @Resource | ||
37 | private TdsSyncToRegionalNodeService<TdsUserIdentityRQVO> tdsSyncToRegionalNodeService; | ||
38 | |||
39 | //region 基本操作 | ||
40 | |||
41 | @PostMapping("/save") | ||
42 | @SystemLog(value = "个人用户身份信息-新增") | ||
43 | @Operation(summary = "个人用户身份信息-新增") | ||
44 | public CommonRes<Boolean> saveTdsUserIdentity(@RequestBody @Valid TdsUserIdentityRQVO vo) { | ||
45 | tdsUserIdentityService.saveTdsUserIdentity(vo); | ||
46 | //数据同步到区域/业务节点 | ||
47 | tdsSyncToRegionalNodeService.syncToRegionalNode(TdsDataTypeEnum.USER,vo,tdsUserIdentityService); | ||
48 | return CommonRes.success(true); | ||
49 | } | ||
50 | |||
51 | @PutMapping("/update") | ||
52 | @SystemLog(value = "个人用户身份信息-修改") | ||
53 | @Operation(summary = "个人用户身份信息-修改") | ||
54 | public CommonRes<Boolean> updateTdsUserIdentity(@RequestBody @Valid TdsUserIdentityRQVO vo) { | ||
55 | tdsUserIdentityService.updateTdsUserIdentity(vo); | ||
56 | return CommonRes.success(true); | ||
57 | } | ||
58 | |||
59 | @DeleteMapping("/delete") | ||
60 | @SystemLog(value = "个人用户身份信息-批量删除") | ||
61 | @Operation(summary = "个人用户身份信息-批量删除") | ||
62 | public CommonRes<Boolean> removeByGuids(@RequestBody List<String> guids) { | ||
63 | tdsUserIdentityService.removeByGuids(guids); | ||
64 | return CommonRes.success(true); | ||
65 | } | ||
66 | |||
67 | @PostMapping("/page-list") | ||
68 | @SystemLog(value = "个人用户身份信息-分页") | ||
69 | @Operation(summary = "个人用户身份信息-分页") | ||
70 | public CommonRes<PageListVO<TdsUserIdentityRSVO>> pageList(@RequestBody @Valid TdsUserIdentityQueryVO queryVO) { | ||
71 | PageListVO<TdsUserIdentityRSVO> pageVO = tdsUserIdentityService.pageList(queryVO); | ||
72 | return CommonRes.success(pageVO); | ||
73 | } | ||
74 | |||
75 | @GetMapping("/detail") | ||
76 | @SystemLog(value = "个人用户身份信息-详情") | ||
77 | @Operation( | ||
78 | summary = "个人用户身份信息-详情", | ||
79 | parameters = { | ||
80 | @Parameter(name = "guid", description = "个人用户身份信息唯一标识", required = true)} | ||
81 | ) | ||
82 | public CommonRes<TdsUserIdentityRSVO> getTdsUserIdentityDetail(@RequestParam String guid) { | ||
83 | TdsUserIdentityRSVO vo = tdsUserIdentityService.getTdsUserIdentityDetail(guid); | ||
84 | return CommonRes.success(vo); | ||
85 | } | ||
86 | |||
87 | //endregion | ||
88 | |||
89 | } |
1 | package com.csbr.qingcloud.portal.domain.vo; | ||
2 | |||
3 | import csbr.cloud.entity.domain.base.dto.BasePageDTO; | ||
4 | import io.swagger.v3.oas.annotations.media.Schema; | ||
5 | import lombok.EqualsAndHashCode; | ||
6 | import lombok.Data; | ||
7 | import java.util.Date; | ||
8 | |||
9 | /** | ||
10 | * @program: | ||
11 | * @description: 个人用户附加信息查询参数 | ||
12 | * @author: xup | ||
13 | * @create: 2025-08-14 13:21 | ||
14 | **/ | ||
15 | @EqualsAndHashCode(callSuper = true) | ||
16 | @Data | ||
17 | @Schema(title = "个人用户附加信息查询参数") | ||
18 | public class TdsUserAdditionalQueryVO extends BasePageDTO { | ||
19 | |||
20 | } |
1 | package com.csbr.qingcloud.portal.domain.vo; | ||
2 | |||
3 | import io.swagger.v3.oas.annotations.media.Schema; | ||
4 | import com.fasterxml.jackson.annotation.JsonFormat; | ||
5 | import jakarta.validation.constraints.Size; | ||
6 | import lombok.Data; | ||
7 | import java.util.Date; | ||
8 | |||
9 | /** | ||
10 | * @program: | ||
11 | * @description: 个人用户附加信息新增、修改参数 | ||
12 | * @author: xup | ||
13 | * @create: 2025-08-14 13:21 | ||
14 | **/ | ||
15 | @Data | ||
16 | @Schema(title = "个人用户附加信息新增、修改参数") | ||
17 | public class TdsUserAdditionalRQVO { | ||
18 | |||
19 | /** | ||
20 | * 系统唯一标识 | ||
21 | */ | ||
22 | @Schema(description = "系统唯一标识") | ||
23 | private String guid; | ||
24 | |||
25 | /** | ||
26 | * 用户Guid | ||
27 | */ | ||
28 | @Schema(description = "用户Guid") | ||
29 | private String userGuid; | ||
30 | |||
31 | /** | ||
32 | * 国籍(来之数据字典国籍) | ||
33 | */ | ||
34 | @Schema(description = "国籍(来之数据字典国籍)") | ||
35 | @Size(max = 20, message = "国籍长度超过20") | ||
36 | private String nationalityCode; | ||
37 | |||
38 | /** | ||
39 | * 性别 | ||
40 | */ | ||
41 | @Schema(description = "性别") | ||
42 | @Size(max = 10, message = "性别长度超过10") | ||
43 | private String sex; | ||
44 | |||
45 | /** | ||
46 | * 出生年月 | ||
47 | */ | ||
48 | @Schema(description = "出生年月") | ||
49 | @Size(max = 7, message = "出生年月长度超过7") | ||
50 | private String birthdayMonth; | ||
51 | |||
52 | /** | ||
53 | * 社保卡卡号 | ||
54 | */ | ||
55 | @Schema(description = "社保卡卡号") | ||
56 | @Size(max = 20, message = "社保卡卡号长度超过20") | ||
57 | private String socialSecurityCard; | ||
58 | |||
59 | /** | ||
60 | * 社保卡发放地 | ||
61 | */ | ||
62 | @Schema(description = "社保卡发放地") | ||
63 | @Size(max = 50, message = "社保卡发放地长度超过50") | ||
64 | private String socialSecurityIssuance; | ||
65 | |||
66 | /** | ||
67 | * 支付宝账号 | ||
68 | */ | ||
69 | @Schema(description = "支付宝账号") | ||
70 | @Size(max = 20, message = "支付宝账号长度超过20") | ||
71 | private String alipayAccount; | ||
72 | |||
73 | /** | ||
74 | * 微信账号 | ||
75 | */ | ||
76 | @Schema(description = "微信账号") | ||
77 | @Size(max = 20, message = "微信账号长度超过20") | ||
78 | private String wechatAccount; | ||
79 | |||
80 | /** | ||
81 | * 邮箱 | ||
82 | */ | ||
83 | @Schema(description = "邮箱") | ||
84 | @Size(max = 20, message = "邮箱长度超过20") | ||
85 | private String email; | ||
86 | |||
87 | /** | ||
88 | * 联系地址 | ||
89 | */ | ||
90 | @Schema(description = "联系地址") | ||
91 | @Size(max = 100, message = "联系地址长度超过100") | ||
92 | private String contactAddress; | ||
93 | |||
94 | /** | ||
95 | * 其他 | ||
96 | */ | ||
97 | @Schema(description = "其他") | ||
98 | @Size(max = 100, message = "其他长度超过100") | ||
99 | private String other; | ||
100 | |||
101 | /******** 库表存储属性 需处理 *****/ | ||
102 | |||
103 | /******** 自定义扩展 *****/ | ||
104 | |||
105 | /******** 子对象 *****/ | ||
106 | |||
107 | } |
1 | package com.csbr.qingcloud.portal.domain.vo; | ||
2 | |||
3 | import io.swagger.v3.oas.annotations.media.Schema; | ||
4 | import com.fasterxml.jackson.annotation.JsonFormat; | ||
5 | import lombok.Data; | ||
6 | import java.util.Date; | ||
7 | |||
8 | /** | ||
9 | * @program: | ||
10 | * @description: 个人用户附加信息返回参数 | ||
11 | * @author: xup | ||
12 | * @create: 2025-08-14 13:21 | ||
13 | **/ | ||
14 | @Data | ||
15 | @Schema(title = "个人用户附加信息返回参数") | ||
16 | public class TdsUserAdditionalRSVO { | ||
17 | |||
18 | /** | ||
19 | * 系统唯一标识 | ||
20 | */ | ||
21 | @Schema(description = "系统唯一标识") | ||
22 | private String guid; | ||
23 | |||
24 | /** | ||
25 | * 会员Guid | ||
26 | */ | ||
27 | @Schema(description = "会员Guid") | ||
28 | private String tenantGuid; | ||
29 | |||
30 | /** | ||
31 | * 用户Guid | ||
32 | */ | ||
33 | @Schema(description = "用户Guid") | ||
34 | private String userGuid; | ||
35 | |||
36 | /** | ||
37 | * 国籍(来之数据字典国籍) | ||
38 | */ | ||
39 | @Schema(description = "国籍(来之数据字典国籍)") | ||
40 | private String nationalityCode; | ||
41 | |||
42 | /** | ||
43 | * 性别 | ||
44 | */ | ||
45 | @Schema(description = "性别") | ||
46 | private String sex; | ||
47 | |||
48 | /** | ||
49 | * 出生年月 | ||
50 | */ | ||
51 | @Schema(description = "出生年月") | ||
52 | private String birthdayMonth; | ||
53 | |||
54 | /** | ||
55 | * 社保卡卡号 | ||
56 | */ | ||
57 | @Schema(description = "社保卡卡号") | ||
58 | private String socialSecurityCard; | ||
59 | |||
60 | /** | ||
61 | * 社保卡发放地 | ||
62 | */ | ||
63 | @Schema(description = "社保卡发放地") | ||
64 | private String socialSecurityIssuance; | ||
65 | |||
66 | /** | ||
67 | * 支付宝账号 | ||
68 | */ | ||
69 | @Schema(description = "支付宝账号") | ||
70 | private String alipayAccount; | ||
71 | |||
72 | /** | ||
73 | * 微信账号 | ||
74 | */ | ||
75 | @Schema(description = "微信账号") | ||
76 | private String wechatAccount; | ||
77 | |||
78 | /** | ||
79 | * 邮箱 | ||
80 | */ | ||
81 | @Schema(description = "邮箱") | ||
82 | private String email; | ||
83 | |||
84 | /** | ||
85 | * 联系地址 | ||
86 | */ | ||
87 | @Schema(description = "联系地址") | ||
88 | private String contactAddress; | ||
89 | |||
90 | /** | ||
91 | * 其他 | ||
92 | */ | ||
93 | @Schema(description = "其他") | ||
94 | private String other; | ||
95 | |||
96 | /******** 库表存储属性 需处理 *****/ | ||
97 | |||
98 | /******** 自定义扩展 *****/ | ||
99 | |||
100 | /******** 子对象 *****/ | ||
101 | |||
102 | } |
1 | package com.csbr.qingcloud.portal.domain.vo; | ||
2 | |||
3 | import csbr.cloud.entity.domain.base.dto.BasePageDTO; | ||
4 | import io.swagger.v3.oas.annotations.media.Schema; | ||
5 | import lombok.EqualsAndHashCode; | ||
6 | import lombok.Data; | ||
7 | import java.util.Date; | ||
8 | |||
9 | /** | ||
10 | * @program: | ||
11 | * @description: 个人用户身份信息查询参数 | ||
12 | * @author: xup | ||
13 | * @create: 2025-08-14 13:21 | ||
14 | **/ | ||
15 | @EqualsAndHashCode(callSuper = true) | ||
16 | @Data | ||
17 | @Schema(title = "个人用户身份信息查询参数") | ||
18 | public class TdsUserIdentityQueryVO extends BasePageDTO { | ||
19 | |||
20 | } |
1 | package com.csbr.qingcloud.portal.domain.vo; | ||
2 | |||
3 | import io.swagger.v3.oas.annotations.media.Schema; | ||
4 | import com.fasterxml.jackson.annotation.JsonFormat; | ||
5 | import jakarta.validation.constraints.NotBlank; | ||
6 | import jakarta.validation.constraints.NotNull; | ||
7 | import jakarta.validation.constraints.Size; | ||
8 | import lombok.Data; | ||
9 | import java.util.Date; | ||
10 | |||
11 | /** | ||
12 | * @program: | ||
13 | * @description: 个人用户身份信息新增、修改参数 | ||
14 | * @author: xup | ||
15 | * @create: 2025-08-14 13:21 | ||
16 | **/ | ||
17 | @Data | ||
18 | @Schema(title = "个人用户身份信息新增、修改参数") | ||
19 | public class TdsUserIdentityRQVO { | ||
20 | |||
21 | /** | ||
22 | * 系统唯一标识 | ||
23 | */ | ||
24 | @Schema(description = "系统唯一标识") | ||
25 | private String guid; | ||
26 | |||
27 | /** | ||
28 | * 姓名 | ||
29 | */ | ||
30 | @Schema(description = "姓名") | ||
31 | @Size(max = 50, message = "姓名长度超过50") | ||
32 | @NotBlank(message = "姓名为空。") | ||
33 | private String name; | ||
34 | |||
35 | /** | ||
36 | * 证件类型(来之数据字典证件类型) | ||
37 | */ | ||
38 | @Schema(description = "证件类型(来之数据字典证件类型)") | ||
39 | @Size(max = 20, message = "证件类型长度超过20") | ||
40 | @NotBlank(message = "证件类型为空。") | ||
41 | private String idTypeCode; | ||
42 | |||
43 | /** | ||
44 | * 证件号码 | ||
45 | */ | ||
46 | @Schema(description = "证件号码") | ||
47 | @Size(max = 50, message = "证件号码长度超过50") | ||
48 | @NotBlank(message = "证件号码为空。") | ||
49 | private String idNumber; | ||
50 | |||
51 | /** | ||
52 | * 证件号码有效起始日期 | ||
53 | */ | ||
54 | @Schema(description = "证件号码有效起始日期") | ||
55 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") | ||
56 | @NotNull(message = "证件号码有效起始日期为空。") | ||
57 | private Date idNumberStartTime; | ||
58 | |||
59 | /** | ||
60 | * 证件号码有效截止日期 | ||
61 | */ | ||
62 | @Schema(description = "证件号码有效截止日期") | ||
63 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") | ||
64 | @NotNull(message = "证件号码有效截止日期为空。") | ||
65 | private Date idNumberEndTime; | ||
66 | |||
67 | /** | ||
68 | * 手机号 | ||
69 | */ | ||
70 | @Schema(description = "手机号") | ||
71 | @Size(max = 11, message = "手机号长度超过11") | ||
72 | @NotBlank(message = "手机号为空。") | ||
73 | private String mobile; | ||
74 | |||
75 | /** | ||
76 | * 个人实名认证等级(0 未实名;1 身份证实名核验或社保卡实名核验;2 在实名核验基础上增加人脸识别或其他生物特征核验) | ||
77 | */ | ||
78 | @Schema(description = "个人实名认证等级(0 未实名;1 身份证实名核验或社保卡实名核验;2 在实名核验基础上增加人脸识别或其他生物特征核验)") | ||
79 | private Integer authenticationLevel; | ||
80 | |||
81 | /** | ||
82 | * 个人实名认证方式(1 公安部、人社部实名服务;2 国家政务服务平台实名服务;3 微信、支付宝、通讯运营商等第三方平台) | ||
83 | */ | ||
84 | @Schema(description = "个人实名认证方式(1 公安部、人社部实名服务;2 国家政务服务平台实名服务;3 微信、支付宝、通讯运营商等第三方平台)") | ||
85 | private Integer authenticationMethod; | ||
86 | |||
87 | /** | ||
88 | * 实名认证时间 | ||
89 | */ | ||
90 | @Schema(description = "实名认证时间") | ||
91 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") | ||
92 | private Date authenticationTime; | ||
93 | |||
94 | /** | ||
95 | * 身份状态(0 不可用 ;1 可用) | ||
96 | */ | ||
97 | @Schema(description = "身份状态(0 不可用 ;1 可用)") | ||
98 | private Integer identityStatus =0; | ||
99 | |||
100 | /******** 库表存储属性 需处理 *****/ | ||
101 | |||
102 | /******** 自定义扩展 *****/ | ||
103 | |||
104 | /******** 子对象 *****/ | ||
105 | /** | ||
106 | * 个人用户附加信息 | ||
107 | */ | ||
108 | @Schema(description = "个人用户附加信息") | ||
109 | private TdsUserAdditionalRQVO tdsUserAdditional; | ||
110 | |||
111 | /** | ||
112 | * 个人用户可验信息 | ||
113 | */ | ||
114 | @Schema(description = "个人用户可验信息") | ||
115 | private TdsUserVerifiableRQVO tdsUserVerifiable; | ||
116 | } |
1 | package com.csbr.qingcloud.portal.domain.vo; | ||
2 | |||
3 | import com.fasterxml.jackson.annotation.JsonFormat; | ||
4 | import io.swagger.v3.oas.annotations.media.Schema; | ||
5 | import lombok.Data; | ||
6 | |||
7 | import java.util.Date; | ||
8 | |||
9 | /** | ||
10 | * @program: | ||
11 | * @description: 个人用户身份信息返回参数 | ||
12 | * @author: xup | ||
13 | * @create: 2025-08-14 13:21 | ||
14 | **/ | ||
15 | @Data | ||
16 | @Schema(title = "个人用户身份信息返回参数") | ||
17 | public class TdsUserIdentityRSVO { | ||
18 | |||
19 | /** | ||
20 | * 系统唯一标识 | ||
21 | */ | ||
22 | @Schema(description = "系统唯一标识") | ||
23 | private String guid; | ||
24 | |||
25 | /** | ||
26 | * 姓名 | ||
27 | */ | ||
28 | @Schema(description = "姓名") | ||
29 | private String name; | ||
30 | |||
31 | /** | ||
32 | * 用户身份标识(由区域/行业功能节点生成,唯一标识用户身份) | ||
33 | */ | ||
34 | @Schema(description = "用户身份标识(由区域/行业功能节点生成,唯一标识用户身份)") | ||
35 | private String userIdentity; | ||
36 | |||
37 | /** | ||
38 | * 证件类型(来之数据字典证件类型) | ||
39 | */ | ||
40 | @Schema(description = "证件类型(来之数据字典证件类型)") | ||
41 | private String idTypeCode; | ||
42 | |||
43 | /** | ||
44 | * 证件号码 | ||
45 | */ | ||
46 | @Schema(description = "证件号码") | ||
47 | private String idNumber; | ||
48 | |||
49 | /** | ||
50 | * 证件号码有效起始日期 | ||
51 | */ | ||
52 | @Schema(description = "证件号码有效起始日期") | ||
53 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") | ||
54 | private Date idNumberStartTime; | ||
55 | |||
56 | /** | ||
57 | * 证件号码有效截止日期 | ||
58 | */ | ||
59 | @Schema(description = "证件号码有效截止日期") | ||
60 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") | ||
61 | private Date idNumberEndTime; | ||
62 | |||
63 | /** | ||
64 | * 手机号 | ||
65 | */ | ||
66 | @Schema(description = "手机号") | ||
67 | private String mobile; | ||
68 | |||
69 | /** | ||
70 | * 个人实名认证等级(0 未实名;1 身份证实名核验或社保卡实名核验;2 在实名核验基础上增加人脸识别或其他生物特征核验) | ||
71 | */ | ||
72 | @Schema(description = "个人实名认证等级(0 未实名;1 身份证实名核验或社保卡实名核验;2 在实名核验基础上增加人脸识别或其他生物特征核验)") | ||
73 | private Integer authenticationLevel; | ||
74 | |||
75 | /** | ||
76 | * 个人实名认证方式(1 公安部、人社部实名服务;2 国家政务服务平台实名服务;3 微信、支付宝、通讯运营商等第三方平台) | ||
77 | */ | ||
78 | @Schema(description = "个人实名认证方式(1 公安部、人社部实名服务;2 国家政务服务平台实名服务;3 微信、支付宝、通讯运营商等第三方平台)") | ||
79 | private Integer authenticationMethod; | ||
80 | |||
81 | /** | ||
82 | * 实名认证时间 | ||
83 | */ | ||
84 | @Schema(description = "实名认证时间") | ||
85 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") | ||
86 | private Date authenticationTime; | ||
87 | |||
88 | /** | ||
89 | * 身份状态(0 不可用 ;1 可用) | ||
90 | */ | ||
91 | @Schema(description = "身份状态(0 不可用 ;1 可用)") | ||
92 | private Integer identityStatus; | ||
93 | |||
94 | /******** 库表存储属性 需处理 *****/ | ||
95 | |||
96 | /******** 自定义扩展 *****/ | ||
97 | |||
98 | /******** 子对象 *****/ | ||
99 | /** | ||
100 | * 个人用户附加信息 | ||
101 | */ | ||
102 | @Schema(description = "个人用户附加信息") | ||
103 | private TdsUserAdditionalRSVO tdsUserAdditional; | ||
104 | |||
105 | /** | ||
106 | * 个人用户可验信息 | ||
107 | */ | ||
108 | @Schema(description = "个人用户可验信息") | ||
109 | private TdsUserVerifiableRSVO tdsUserVerifiable; | ||
110 | |||
111 | } |
1 | package com.csbr.qingcloud.portal.domain.vo; | ||
2 | |||
3 | import csbr.cloud.entity.domain.base.dto.BasePageDTO; | ||
4 | import io.swagger.v3.oas.annotations.media.Schema; | ||
5 | import lombok.EqualsAndHashCode; | ||
6 | import lombok.Data; | ||
7 | import java.util.Date; | ||
8 | |||
9 | /** | ||
10 | * @program: | ||
11 | * @description: 个人用户可验信息查询参数 | ||
12 | * @author: xup | ||
13 | * @create: 2025-08-14 13:21 | ||
14 | **/ | ||
15 | @EqualsAndHashCode(callSuper = true) | ||
16 | @Data | ||
17 | @Schema(title = "个人用户可验信息查询参数") | ||
18 | public class TdsUserVerifiableQueryVO extends BasePageDTO { | ||
19 | |||
20 | } |
1 | package com.csbr.qingcloud.portal.domain.vo; | ||
2 | |||
3 | import com.alibaba.fastjson.JSONObject; | ||
4 | import io.swagger.v3.oas.annotations.media.Schema; | ||
5 | import com.fasterxml.jackson.annotation.JsonFormat; | ||
6 | import jakarta.validation.constraints.Size; | ||
7 | import lombok.Data; | ||
8 | import java.util.Date; | ||
9 | import java.util.Map; | ||
10 | |||
11 | /** | ||
12 | * @program: | ||
13 | * @description: 个人用户可验信息新增、修改参数 | ||
14 | * @author: xup | ||
15 | * @create: 2025-08-14 13:21 | ||
16 | **/ | ||
17 | @Data | ||
18 | @Schema(title = "个人用户可验信息新增、修改参数") | ||
19 | public class TdsUserVerifiableRQVO { | ||
20 | |||
21 | /** | ||
22 | * 系统唯一标识 | ||
23 | */ | ||
24 | @Schema(description = "系统唯一标识") | ||
25 | private String guid; | ||
26 | |||
27 | /** | ||
28 | * 用户Guid | ||
29 | */ | ||
30 | @Schema(description = "用户Guid") | ||
31 | private String userGuid; | ||
32 | |||
33 | /** | ||
34 | * 学历/学位证书 | ||
35 | */ | ||
36 | @Schema(description = "学历/学位证书") | ||
37 | private Map<String,Object> bachelorDegreeCertificate; | ||
38 | |||
39 | /** | ||
40 | * 职业资格证书 | ||
41 | */ | ||
42 | @Schema(description = "职业资格证书") | ||
43 | private Map<String,Object> professionalCertificate; | ||
44 | |||
45 | /** | ||
46 | * 信用报告摘要 | ||
47 | */ | ||
48 | @Schema(description = "信用报告摘要") | ||
49 | private Map<String,Object> creditReportSummary; | ||
50 | |||
51 | /** | ||
52 | * 数字作品/知识产权登记 | ||
53 | */ | ||
54 | @Schema(description = "数字作品/知识产权登记") | ||
55 | private Map<String,Object> intellectualPropertyRegistration; | ||
56 | |||
57 | /** | ||
58 | * 授权委托书 | ||
59 | */ | ||
60 | @Schema(description = "授权委托书") | ||
61 | private Map<String,Object> powerOfAttorney; | ||
62 | |||
63 | /** | ||
64 | * 其他第三方认证信息 | ||
65 | */ | ||
66 | @Schema(description = "其他第三方认证信息") | ||
67 | private Map<String,Object> thirdPartyCertification; | ||
68 | |||
69 | /******** 库表存储属性 需处理 *****/ | ||
70 | |||
71 | /******** 自定义扩展 *****/ | ||
72 | |||
73 | /******** 子对象 *****/ | ||
74 | |||
75 | } |
1 | package com.csbr.qingcloud.portal.domain.vo; | ||
2 | |||
3 | import io.swagger.v3.oas.annotations.media.Schema; | ||
4 | import com.fasterxml.jackson.annotation.JsonFormat; | ||
5 | import lombok.Data; | ||
6 | import java.util.Date; | ||
7 | import java.util.Map; | ||
8 | |||
9 | /** | ||
10 | * @program: | ||
11 | * @description: 个人用户可验信息返回参数 | ||
12 | * @author: xup | ||
13 | * @create: 2025-08-14 13:21 | ||
14 | **/ | ||
15 | @Data | ||
16 | @Schema(title = "个人用户可验信息返回参数") | ||
17 | public class TdsUserVerifiableRSVO { | ||
18 | |||
19 | /** | ||
20 | * 系统唯一标识 | ||
21 | */ | ||
22 | @Schema(description = "系统唯一标识") | ||
23 | private String guid; | ||
24 | |||
25 | /** | ||
26 | * 用户Guid | ||
27 | */ | ||
28 | @Schema(description = "用户Guid") | ||
29 | private String userGuid; | ||
30 | |||
31 | /** | ||
32 | * 学历/学位证书 | ||
33 | */ | ||
34 | @Schema(description = "学历/学位证书") | ||
35 | private Map<String,Object> bachelorDegreeCertificate; | ||
36 | |||
37 | /** | ||
38 | * 职业资格证书 | ||
39 | */ | ||
40 | @Schema(description = "职业资格证书") | ||
41 | private Map<String,Object> professionalCertificate; | ||
42 | |||
43 | /** | ||
44 | * 信用报告摘要 | ||
45 | */ | ||
46 | @Schema(description = "信用报告摘要") | ||
47 | private Map<String,Object> creditReportSummary; | ||
48 | |||
49 | /** | ||
50 | * 数字作品/知识产权登记 | ||
51 | */ | ||
52 | @Schema(description = "数字作品/知识产权登记") | ||
53 | private Map<String,Object> intellectualPropertyRegistration; | ||
54 | |||
55 | /** | ||
56 | * 授权委托书 | ||
57 | */ | ||
58 | @Schema(description = "授权委托书") | ||
59 | private Map<String,Object> powerOfAttorney; | ||
60 | |||
61 | /** | ||
62 | * 其他第三方认证信息 | ||
63 | */ | ||
64 | @Schema(description = "其他第三方认证信息") | ||
65 | private Map<String,Object> thirdPartyCertification; | ||
66 | |||
67 | /******** 库表存储属性 需处理 *****/ | ||
68 | |||
69 | /******** 自定义扩展 *****/ | ||
70 | |||
71 | /******** 子对象 *****/ | ||
72 | |||
73 | } |
1 | package com.csbr.qingcloud.portal.mybatis.entity; | ||
2 | |||
3 | import com.baomidou.mybatisplus.annotation.FieldStrategy; | ||
4 | import com.baomidou.mybatisplus.annotation.TableField; | ||
5 | import csbr.cloud.entity.domain.base.dao.BaseDO; | ||
6 | import jdk.jfr.Name; | ||
7 | import lombok.Data; | ||
8 | import lombok.EqualsAndHashCode; | ||
9 | import lombok.experimental.Accessors; | ||
10 | import java.util.Date; | ||
11 | |||
12 | /** | ||
13 | * @program: | ||
14 | * @description: 个人用户附加信息实体 | ||
15 | * @author: xup | ||
16 | * @create: 2025-08-14 13:21 | ||
17 | **/ | ||
18 | @Data | ||
19 | @EqualsAndHashCode(callSuper = true) | ||
20 | @Accessors(chain = true) | ||
21 | @Name("个人用户附加信息") | ||
22 | public class MfTdsUserAdditional extends BaseDO { | ||
23 | |||
24 | /** | ||
25 | * 会员Guid | ||
26 | */ | ||
27 | @Name("会员Guid") | ||
28 | private String tenantGuid; | ||
29 | |||
30 | /** | ||
31 | * 用户Guid | ||
32 | */ | ||
33 | @Name("用户Guid") | ||
34 | private String userGuid; | ||
35 | |||
36 | /** | ||
37 | * 国籍(来之数据字典国籍) | ||
38 | */ | ||
39 | @Name("国籍(来之数据字典国籍)") | ||
40 | private String nationalityCode; | ||
41 | |||
42 | /** | ||
43 | * 性别 | ||
44 | */ | ||
45 | @Name("性别") | ||
46 | private String sex; | ||
47 | |||
48 | /** | ||
49 | * 出生年月 | ||
50 | */ | ||
51 | @Name("出生年月") | ||
52 | private String birthdayMonth; | ||
53 | |||
54 | /** | ||
55 | * 社保卡卡号 | ||
56 | */ | ||
57 | @Name("社保卡卡号") | ||
58 | private String socialSecurityCard; | ||
59 | |||
60 | /** | ||
61 | * 社保卡发放地 | ||
62 | */ | ||
63 | @Name("社保卡发放地") | ||
64 | private String socialSecurityIssuance; | ||
65 | |||
66 | /** | ||
67 | * 支付宝账号 | ||
68 | */ | ||
69 | @Name("支付宝账号") | ||
70 | private String alipayAccount; | ||
71 | |||
72 | /** | ||
73 | * 微信账号 | ||
74 | */ | ||
75 | @Name("微信账号") | ||
76 | private String wechatAccount; | ||
77 | |||
78 | /** | ||
79 | * 邮箱 | ||
80 | */ | ||
81 | @Name("邮箱") | ||
82 | private String email; | ||
83 | |||
84 | /** | ||
85 | * 联系地址 | ||
86 | */ | ||
87 | @Name("联系地址") | ||
88 | private String contactAddress; | ||
89 | |||
90 | /** | ||
91 | * 其他 | ||
92 | */ | ||
93 | @Name("其他") | ||
94 | private String other; | ||
95 | |||
96 | } |
1 | package com.csbr.qingcloud.portal.mybatis.entity; | ||
2 | |||
3 | import com.baomidou.mybatisplus.annotation.FieldStrategy; | ||
4 | import com.baomidou.mybatisplus.annotation.TableField; | ||
5 | import csbr.cloud.entity.domain.base.dao.BaseDO; | ||
6 | import jdk.jfr.Name; | ||
7 | import lombok.Data; | ||
8 | import lombok.EqualsAndHashCode; | ||
9 | import lombok.experimental.Accessors; | ||
10 | import java.util.Date; | ||
11 | |||
12 | /** | ||
13 | * @program: | ||
14 | * @description: 个人用户身份信息实体 | ||
15 | * @author: xup | ||
16 | * @create: 2025-08-14 13:21 | ||
17 | **/ | ||
18 | @Data | ||
19 | @EqualsAndHashCode(callSuper = true) | ||
20 | @Accessors(chain = true) | ||
21 | @Name("个人用户身份信息") | ||
22 | public class MfTdsUserIdentity extends BaseDO { | ||
23 | |||
24 | /** | ||
25 | * 会员Guid | ||
26 | */ | ||
27 | @Name("会员Guid") | ||
28 | private String tenantGuid; | ||
29 | |||
30 | /** | ||
31 | * 姓名 | ||
32 | */ | ||
33 | @Name("姓名") | ||
34 | private String name; | ||
35 | |||
36 | /** | ||
37 | * 用户身份标识(由区域/行业功能节点生成,唯一标识用户身份) | ||
38 | */ | ||
39 | @Name("用户身份标识(由区域/行业功能节点生成,唯一标识用户身份)") | ||
40 | private String userIdentity; | ||
41 | |||
42 | /** | ||
43 | * 证件类型(来之数据字典证件类型) | ||
44 | */ | ||
45 | @Name("证件类型(来之数据字典证件类型)") | ||
46 | private String idTypeCode; | ||
47 | |||
48 | /** | ||
49 | * 证件号码 | ||
50 | */ | ||
51 | @Name("证件号码") | ||
52 | private String idNumber; | ||
53 | |||
54 | /** | ||
55 | * 证件号码有效起始日期 | ||
56 | */ | ||
57 | @Name("证件号码有效起始日期") | ||
58 | private Date idNumberStartTime; | ||
59 | |||
60 | /** | ||
61 | * 证件号码有效截止日期 | ||
62 | */ | ||
63 | @Name("证件号码有效截止日期") | ||
64 | private Date idNumberEndTime; | ||
65 | |||
66 | /** | ||
67 | * 手机号 | ||
68 | */ | ||
69 | @Name("手机号") | ||
70 | private String mobile; | ||
71 | |||
72 | /** | ||
73 | * 个人实名认证等级(0 未实名;1 身份证实名核验或社保卡实名核验;2 在实名核验基础上增加人脸识别或其他生物特征核验) | ||
74 | */ | ||
75 | @Name("个人实名认证等级(0 未实名;1 身份证实名核验或社保卡实名核验;2 在实名核验基础上增加人脸识别或其他生物特征核验)") | ||
76 | private Integer authenticationLevel; | ||
77 | |||
78 | /** | ||
79 | * 个人实名认证方式(1 公安部、人社部实名服务;2 国家政务服务平台实名服务;3 微信、支付宝、通讯运营商等第三方平台) | ||
80 | */ | ||
81 | @Name("个人实名认证方式(1 公安部、人社部实名服务;2 国家政务服务平台实名服务;3 微信、支付宝、通讯运营商等第三方平台)") | ||
82 | private Integer authenticationMethod; | ||
83 | |||
84 | /** | ||
85 | * 实名认证时间 | ||
86 | */ | ||
87 | @Name("实名认证时间") | ||
88 | private Date authenticationTime; | ||
89 | |||
90 | /** | ||
91 | * 身份状态(0 不可用 ;1 可用) | ||
92 | */ | ||
93 | @Name("身份状态(0 不可用 ;1 可用)") | ||
94 | private Integer identityStatus; | ||
95 | |||
96 | } |
1 | package com.csbr.qingcloud.portal.mybatis.entity; | ||
2 | |||
3 | import com.baomidou.mybatisplus.annotation.FieldStrategy; | ||
4 | import com.baomidou.mybatisplus.annotation.TableField; | ||
5 | import csbr.cloud.entity.domain.base.dao.BaseDO; | ||
6 | import jdk.jfr.Name; | ||
7 | import lombok.Data; | ||
8 | import lombok.EqualsAndHashCode; | ||
9 | import lombok.experimental.Accessors; | ||
10 | import java.util.Date; | ||
11 | import java.util.Map; | ||
12 | |||
13 | /** | ||
14 | * @program: | ||
15 | * @description: 个人用户可验信息实体 | ||
16 | * @author: xup | ||
17 | * @create: 2025-08-14 13:21 | ||
18 | **/ | ||
19 | @Data | ||
20 | @EqualsAndHashCode(callSuper = true) | ||
21 | @Accessors(chain = true) | ||
22 | @Name("个人用户可验信息") | ||
23 | public class MfTdsUserVerifiable extends BaseDO { | ||
24 | |||
25 | /** | ||
26 | * 会员Guid | ||
27 | */ | ||
28 | @Name("会员Guid") | ||
29 | private String tenantGuid; | ||
30 | |||
31 | /** | ||
32 | * 用户Guid | ||
33 | */ | ||
34 | @Name("用户Guid") | ||
35 | private String userGuid; | ||
36 | |||
37 | /** | ||
38 | * 学历/学位证书 | ||
39 | */ | ||
40 | @Name("学历/学位证书") | ||
41 | private Map<String,Object> bachelorDegreeCertificate; | ||
42 | |||
43 | /** | ||
44 | * 职业资格证书 | ||
45 | */ | ||
46 | @Name("职业资格证书") | ||
47 | private Map<String,Object> professionalCertificate; | ||
48 | |||
49 | /** | ||
50 | * 信用报告摘要 | ||
51 | */ | ||
52 | @Name("信用报告摘要") | ||
53 | private Map<String,Object> creditReportSummary; | ||
54 | |||
55 | /** | ||
56 | * 数字作品/知识产权登记 | ||
57 | */ | ||
58 | @Name("数字作品/知识产权登记") | ||
59 | private Map<String,Object> intellectualPropertyRegistration; | ||
60 | |||
61 | /** | ||
62 | * 授权委托书 | ||
63 | */ | ||
64 | @Name("授权委托书") | ||
65 | private Map<String,Object> powerOfAttorney; | ||
66 | |||
67 | /** | ||
68 | * 其他第三方认证信息 | ||
69 | */ | ||
70 | @Name("其他第三方认证信息") | ||
71 | private Map<String,Object> thirdPartyCertification; | ||
72 | |||
73 | } |
1 | package com.csbr.qingcloud.portal.mybatis.mapper; | ||
2 | |||
3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ||
4 | import org.apache.ibatis.annotations.Mapper; | ||
5 | import com.csbr.qingcloud.portal.mybatis.entity.MfTdsUserAdditional; | ||
6 | |||
7 | /** | ||
8 | * @program: | ||
9 | * @description: 个人用户附加信息 Mapper 接口 | ||
10 | * @author: xup | ||
11 | * @create: 2025-08-14 13:21 | ||
12 | **/ | ||
13 | @Mapper | ||
14 | public interface MfTdsUserAdditionalMapper extends BaseMapper<MfTdsUserAdditional> { | ||
15 | |||
16 | } |
1 | package com.csbr.qingcloud.portal.mybatis.mapper; | ||
2 | |||
3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ||
4 | import org.apache.ibatis.annotations.Mapper; | ||
5 | import com.csbr.qingcloud.portal.mybatis.entity.MfTdsUserIdentity; | ||
6 | |||
7 | /** | ||
8 | * @program: | ||
9 | * @description: 个人用户身份信息 Mapper 接口 | ||
10 | * @author: xup | ||
11 | * @create: 2025-08-14 13:21 | ||
12 | **/ | ||
13 | @Mapper | ||
14 | public interface MfTdsUserIdentityMapper extends BaseMapper<MfTdsUserIdentity> { | ||
15 | |||
16 | } |
1 | package com.csbr.qingcloud.portal.mybatis.mapper; | ||
2 | |||
3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ||
4 | import org.apache.ibatis.annotations.Mapper; | ||
5 | import com.csbr.qingcloud.portal.mybatis.entity.MfTdsUserVerifiable; | ||
6 | |||
7 | /** | ||
8 | * @program: | ||
9 | * @description: 个人用户可验信息 Mapper 接口 | ||
10 | * @author: xup | ||
11 | * @create: 2025-08-14 13:21 | ||
12 | **/ | ||
13 | @Mapper | ||
14 | public interface MfTdsUserVerifiableMapper extends BaseMapper<MfTdsUserVerifiable> { | ||
15 | |||
16 | } |
1 | package com.csbr.qingcloud.portal.mybatis.service; | ||
2 | |||
3 | import com.csbr.cloud.base.service.CsbrService; | ||
4 | import com.csbr.qingcloud.portal.mybatis.entity.MfTdsUserAdditional; | ||
5 | |||
6 | /** | ||
7 | * @program: | ||
8 | * @description: 个人用户附加信息逻辑层接口 | ||
9 | * @author: xup | ||
10 | * @create: 2025-08-14 13:21 | ||
11 | **/ | ||
12 | public interface MfTdsUserAdditionalService extends CsbrService<MfTdsUserAdditional> { | ||
13 | |||
14 | } |
1 | package com.csbr.qingcloud.portal.mybatis.service; | ||
2 | |||
3 | import com.csbr.cloud.base.service.CsbrService; | ||
4 | import com.csbr.qingcloud.portal.mybatis.entity.MfTdsUserIdentity; | ||
5 | |||
6 | /** | ||
7 | * @program: | ||
8 | * @description: 个人用户身份信息逻辑层接口 | ||
9 | * @author: xup | ||
10 | * @create: 2025-08-14 13:21 | ||
11 | **/ | ||
12 | public interface MfTdsUserIdentityService extends CsbrService<MfTdsUserIdentity> { | ||
13 | |||
14 | } |
1 | package com.csbr.qingcloud.portal.mybatis.service; | ||
2 | |||
3 | import com.csbr.cloud.base.service.CsbrService; | ||
4 | import com.csbr.qingcloud.portal.mybatis.entity.MfTdsUserVerifiable; | ||
5 | |||
6 | /** | ||
7 | * @program: | ||
8 | * @description: 个人用户可验信息逻辑层接口 | ||
9 | * @author: xup | ||
10 | * @create: 2025-08-14 13:21 | ||
11 | **/ | ||
12 | public interface MfTdsUserVerifiableService extends CsbrService<MfTdsUserVerifiable> { | ||
13 | |||
14 | } |
src/main/java/com/csbr/qingcloud/portal/mybatis/service/impl/MfTdsUserAdditionalServiceImpl.java
0 → 100644
1 | package com.csbr.qingcloud.portal.mybatis.service.impl; | ||
2 | |||
3 | import com.csbr.cloud.mybatis.service.impl.CsbrServiceImpl; | ||
4 | import com.csbr.qingcloud.portal.mybatis.mapper.MfTdsUserAdditionalMapper; | ||
5 | import com.csbr.qingcloud.portal.mybatis.entity.MfTdsUserAdditional; | ||
6 | import com.csbr.qingcloud.portal.mybatis.service.MfTdsUserAdditionalService; | ||
7 | import jakarta.annotation.Resource; | ||
8 | import org.springframework.stereotype.Service; | ||
9 | |||
10 | /** | ||
11 | * @program: | ||
12 | * @description: 个人用户附加信息逻辑层接口实现 | ||
13 | * @author: xup | ||
14 | * @create: 2025-08-14 13:21 | ||
15 | **/ | ||
16 | @Service | ||
17 | public class MfTdsUserAdditionalServiceImpl extends CsbrServiceImpl<MfTdsUserAdditionalMapper, MfTdsUserAdditional> implements MfTdsUserAdditionalService { | ||
18 | |||
19 | @Resource | ||
20 | private MfTdsUserAdditionalMapper mfTdsUserAdditionalMapper; | ||
21 | |||
22 | } |
src/main/java/com/csbr/qingcloud/portal/mybatis/service/impl/MfTdsUserIdentityServiceImpl.java
0 → 100644
1 | package com.csbr.qingcloud.portal.mybatis.service.impl; | ||
2 | |||
3 | import com.csbr.cloud.mybatis.service.impl.CsbrServiceImpl; | ||
4 | import com.csbr.qingcloud.portal.mybatis.mapper.MfTdsUserIdentityMapper; | ||
5 | import com.csbr.qingcloud.portal.mybatis.entity.MfTdsUserIdentity; | ||
6 | import com.csbr.qingcloud.portal.mybatis.service.MfTdsUserIdentityService; | ||
7 | import jakarta.annotation.Resource; | ||
8 | import org.springframework.stereotype.Service; | ||
9 | |||
10 | /** | ||
11 | * @program: | ||
12 | * @description: 个人用户身份信息逻辑层接口实现 | ||
13 | * @author: xup | ||
14 | * @create: 2025-08-14 13:21 | ||
15 | **/ | ||
16 | @Service | ||
17 | public class MfTdsUserIdentityServiceImpl extends CsbrServiceImpl<MfTdsUserIdentityMapper, MfTdsUserIdentity> implements MfTdsUserIdentityService { | ||
18 | |||
19 | @Resource | ||
20 | private MfTdsUserIdentityMapper mfTdsUserIdentityMapper; | ||
21 | |||
22 | } |
src/main/java/com/csbr/qingcloud/portal/mybatis/service/impl/MfTdsUserVerifiableServiceImpl.java
0 → 100644
1 | package com.csbr.qingcloud.portal.mybatis.service.impl; | ||
2 | |||
3 | import com.csbr.cloud.mybatis.service.impl.CsbrServiceImpl; | ||
4 | import com.csbr.qingcloud.portal.mybatis.mapper.MfTdsUserVerifiableMapper; | ||
5 | import com.csbr.qingcloud.portal.mybatis.entity.MfTdsUserVerifiable; | ||
6 | import com.csbr.qingcloud.portal.mybatis.service.MfTdsUserVerifiableService; | ||
7 | import jakarta.annotation.Resource; | ||
8 | import org.springframework.stereotype.Service; | ||
9 | |||
10 | /** | ||
11 | * @program: | ||
12 | * @description: 个人用户可验信息逻辑层接口实现 | ||
13 | * @author: xup | ||
14 | * @create: 2025-08-14 13:21 | ||
15 | **/ | ||
16 | @Service | ||
17 | public class MfTdsUserVerifiableServiceImpl extends CsbrServiceImpl<MfTdsUserVerifiableMapper, MfTdsUserVerifiable> implements MfTdsUserVerifiableService { | ||
18 | |||
19 | @Resource | ||
20 | private MfTdsUserVerifiableMapper mfTdsUserVerifiableMapper; | ||
21 | |||
22 | } |
1 | package com.csbr.qingcloud.portal.service; | ||
2 | |||
3 | import csbr.cloud.entity.domain.base.vo.PageListVO; | ||
4 | import com.csbr.qingcloud.portal.domain.vo.TdsUserAdditionalQueryVO; | ||
5 | import com.csbr.qingcloud.portal.domain.vo.TdsUserAdditionalRQVO; | ||
6 | import com.csbr.qingcloud.portal.domain.vo.TdsUserAdditionalRSVO; | ||
7 | |||
8 | import java.util.List; | ||
9 | |||
10 | /** | ||
11 | * @program: | ||
12 | * @description: 个人用户附加信息业务逻辑接口 | ||
13 | * @author: xup | ||
14 | * @create: 2025-08-14 13:21 | ||
15 | **/ | ||
16 | public interface TdsUserAdditionalService { | ||
17 | |||
18 | /** | ||
19 | * 个人用户附加信息分页查询 | ||
20 | * @author xup | ||
21 | * @date 2025-08-14 13:21 | ||
22 | * @param queryVO | ||
23 | * @return com.csbr.cloud.mybatis.entity.PageListVO<com.csbr.qingcloud.portal.domain.vo.TdsUserAdditionalRSVO> | ||
24 | */ | ||
25 | PageListVO<TdsUserAdditionalRSVO> pageList(TdsUserAdditionalQueryVO queryVO); | ||
26 | |||
27 | /** | ||
28 | * 个人用户附加信息获取详情数据 | ||
29 | * @author xup | ||
30 | * @date 2025-08-14 13:21 | ||
31 | * @param guid | ||
32 | * @return com.csbr.qingcloud.portal.domain.vo.TdsUserAdditionalRSVO | ||
33 | */ | ||
34 | TdsUserAdditionalRSVO getTdsUserAdditionalDetail(String guid); | ||
35 | |||
36 | /** | ||
37 | * 个人用户附加信息数据新增 | ||
38 | * @author xup | ||
39 | * @date 2025-08-14 13:21 | ||
40 | * @param rqVO | ||
41 | * @return boolean | ||
42 | */ | ||
43 | void saveTdsUserAdditional(TdsUserAdditionalRQVO rqVO); | ||
44 | |||
45 | /** | ||
46 | * 个人用户附加信息数据修改 | ||
47 | * @author xup | ||
48 | * @date 2025-08-14 13:21 | ||
49 | * @param rqVO | ||
50 | * @return boolean | ||
51 | */ | ||
52 | void updateTdsUserAdditional(TdsUserAdditionalRQVO rqVO); | ||
53 | |||
54 | /** | ||
55 | * 个人用户附加信息数据删除 | ||
56 | * @author xup | ||
57 | * @date 2025-08-14 13:21 | ||
58 | * @param guids | ||
59 | * @return void | ||
60 | */ | ||
61 | void removeByGuids(List<String> guids); | ||
62 | |||
63 | /** | ||
64 | * 个人用户附加信息数据删除、并有相关的处理操作 | ||
65 | * @author xup | ||
66 | * @date 2025-08-14 13:21 | ||
67 | * @param guids | ||
68 | * @return void | ||
69 | */ | ||
70 | void removeHandleByGuids(List<String> guids); | ||
71 | |||
72 | /** | ||
73 | * 通过UserGuid删除附件信息 | ||
74 | * @param userGuids | ||
75 | */ | ||
76 | void removeByUserGuids(List<String> userGuids); | ||
77 | |||
78 | /** | ||
79 | * 个人用户附加信息查询 | ||
80 | * @param userGuid | ||
81 | * @return | ||
82 | */ | ||
83 | TdsUserAdditionalRSVO getTdsUserAdditionalByUserGuid(String userGuid); | ||
84 | } |
1 | package com.csbr.qingcloud.portal.service; | ||
2 | |||
3 | import csbr.cloud.entity.domain.base.vo.PageListVO; | ||
4 | import com.csbr.qingcloud.portal.domain.vo.TdsUserIdentityQueryVO; | ||
5 | import com.csbr.qingcloud.portal.domain.vo.TdsUserIdentityRQVO; | ||
6 | import com.csbr.qingcloud.portal.domain.vo.TdsUserIdentityRSVO; | ||
7 | |||
8 | import java.util.List; | ||
9 | |||
10 | /** | ||
11 | * @program: | ||
12 | * @description: 个人用户身份信息业务逻辑接口 | ||
13 | * @author: xup | ||
14 | * @create: 2025-08-14 13:21 | ||
15 | **/ | ||
16 | public interface TdsUserIdentityService extends TdsSyncToRegionalNodeCallback<TdsUserIdentityRQVO> { | ||
17 | |||
18 | /** | ||
19 | * 个人用户身份信息分页查询 | ||
20 | * @author xup | ||
21 | * @date 2025-08-14 13:21 | ||
22 | * @param queryVO | ||
23 | * @return com.csbr.cloud.mybatis.entity.PageListVO<com.csbr.qingcloud.portal.domain.vo.TdsUserIdentityRSVO> | ||
24 | */ | ||
25 | PageListVO<TdsUserIdentityRSVO> pageList(TdsUserIdentityQueryVO queryVO); | ||
26 | |||
27 | /** | ||
28 | * 个人用户身份信息获取详情数据 | ||
29 | * @author xup | ||
30 | * @date 2025-08-14 13:21 | ||
31 | * @param guid | ||
32 | * @return com.csbr.qingcloud.portal.domain.vo.TdsUserIdentityRSVO | ||
33 | */ | ||
34 | TdsUserIdentityRSVO getTdsUserIdentityDetail(String guid); | ||
35 | |||
36 | /** | ||
37 | * 个人用户身份信息数据新增 | ||
38 | * @author xup | ||
39 | * @date 2025-08-14 13:21 | ||
40 | * @param rqVO | ||
41 | * @return boolean | ||
42 | */ | ||
43 | void saveTdsUserIdentity(TdsUserIdentityRQVO rqVO); | ||
44 | |||
45 | /** | ||
46 | * 个人用户身份信息数据修改 | ||
47 | * @author xup | ||
48 | * @date 2025-08-14 13:21 | ||
49 | * @param rqVO | ||
50 | * @return boolean | ||
51 | */ | ||
52 | void updateTdsUserIdentity(TdsUserIdentityRQVO rqVO); | ||
53 | |||
54 | /** | ||
55 | * 个人用户身份信息数据删除 | ||
56 | * @author xup | ||
57 | * @date 2025-08-14 13:21 | ||
58 | * @param guids | ||
59 | * @return void | ||
60 | */ | ||
61 | void removeByGuids(List<String> guids); | ||
62 | |||
63 | /** | ||
64 | * 个人用户身份信息数据删除、并有相关的处理操作 | ||
65 | * @author xup | ||
66 | * @date 2025-08-14 13:21 | ||
67 | * @param guids | ||
68 | * @return void | ||
69 | */ | ||
70 | void removeHandleByGuids(List<String> guids); | ||
71 | |||
72 | /** | ||
73 | * 认证个人用户身份信息 | ||
74 | * @param bizGuid | ||
75 | * @param identityStatus | ||
76 | * @param message | ||
77 | */ | ||
78 | void updateTdsUserIdentityStatus(String bizGuid, Integer identityStatus, String message); | ||
79 | } |
1 | package com.csbr.qingcloud.portal.service; | ||
2 | |||
3 | import csbr.cloud.entity.domain.base.vo.PageListVO; | ||
4 | import com.csbr.qingcloud.portal.domain.vo.TdsUserVerifiableQueryVO; | ||
5 | import com.csbr.qingcloud.portal.domain.vo.TdsUserVerifiableRQVO; | ||
6 | import com.csbr.qingcloud.portal.domain.vo.TdsUserVerifiableRSVO; | ||
7 | |||
8 | import java.util.List; | ||
9 | |||
10 | /** | ||
11 | * @program: | ||
12 | * @description: 个人用户可验信息业务逻辑接口 | ||
13 | * @author: xup | ||
14 | * @create: 2025-08-14 13:21 | ||
15 | **/ | ||
16 | public interface TdsUserVerifiableService { | ||
17 | |||
18 | /** | ||
19 | * 个人用户可验信息分页查询 | ||
20 | * @author xup | ||
21 | * @date 2025-08-14 13:21 | ||
22 | * @param queryVO | ||
23 | * @return com.csbr.cloud.mybatis.entity.PageListVO<com.csbr.qingcloud.portal.domain.vo.TdsUserVerifiableRSVO> | ||
24 | */ | ||
25 | PageListVO<TdsUserVerifiableRSVO> pageList(TdsUserVerifiableQueryVO queryVO); | ||
26 | |||
27 | /** | ||
28 | * 个人用户可验信息获取详情数据 | ||
29 | * @author xup | ||
30 | * @date 2025-08-14 13:21 | ||
31 | * @param guid | ||
32 | * @return com.csbr.qingcloud.portal.domain.vo.TdsUserVerifiableRSVO | ||
33 | */ | ||
34 | TdsUserVerifiableRSVO getTdsUserVerifiableDetail(String guid); | ||
35 | |||
36 | /** | ||
37 | * 个人用户可验信息数据新增 | ||
38 | * @author xup | ||
39 | * @date 2025-08-14 13:21 | ||
40 | * @param rqVO | ||
41 | * @return boolean | ||
42 | */ | ||
43 | void saveTdsUserVerifiable(TdsUserVerifiableRQVO rqVO); | ||
44 | |||
45 | /** | ||
46 | * 个人用户可验信息数据修改 | ||
47 | * @author xup | ||
48 | * @date 2025-08-14 13:21 | ||
49 | * @param rqVO | ||
50 | * @return boolean | ||
51 | */ | ||
52 | void updateTdsUserVerifiable(TdsUserVerifiableRQVO rqVO); | ||
53 | |||
54 | /** | ||
55 | * 个人用户可验信息数据删除 | ||
56 | * @author xup | ||
57 | * @date 2025-08-14 13:21 | ||
58 | * @param guids | ||
59 | * @return void | ||
60 | */ | ||
61 | void removeByGuids(List<String> guids); | ||
62 | |||
63 | /** | ||
64 | * 个人用户可验信息数据删除、并有相关的处理操作 | ||
65 | * @author xup | ||
66 | * @date 2025-08-14 13:21 | ||
67 | * @param guids | ||
68 | * @return void | ||
69 | */ | ||
70 | void removeHandleByGuids(List<String> guids); | ||
71 | |||
72 | void removeByUserGuids(List<String> userGuids); | ||
73 | |||
74 | /** | ||
75 | * 个人用户可验信息查询 | ||
76 | * @param userGuid | ||
77 | * @return | ||
78 | */ | ||
79 | TdsUserVerifiableRSVO getTdsUserVerifiableByUserGuid(String userGuid); | ||
80 | } |
1 | package com.csbr.qingcloud.portal.service.impl; | ||
2 | |||
3 | import com.alibaba.fastjson.JSON; | ||
4 | import com.alibaba.fastjson.JSONObject; | ||
5 | import com.csbr.cloud.common.enums.SystemError; | ||
6 | import com.csbr.cloud.common.exception.CsbrSystemException; | ||
7 | import com.csbr.cloud.common.response.CommonRes; | ||
8 | import com.csbr.qingcloud.portal.enums.TdsDataTypeEnum; | ||
9 | import com.csbr.qingcloud.portal.service.TdsSyncToRegionalNodeCallback; | ||
10 | import com.csbr.qingcloud.portal.util.ZQConfig; | ||
11 | import jakarta.annotation.Resource; | ||
12 | import lombok.extern.slf4j.Slf4j; | ||
13 | import org.apache.hc.client5.http.config.RequestConfig; | ||
14 | import org.apache.hc.client5.http.impl.classic.CloseableHttpClient; | ||
15 | import org.apache.hc.client5.http.impl.classic.HttpClientBuilder; | ||
16 | import org.apache.hc.core5.util.Timeout; | ||
17 | import org.springframework.beans.factory.annotation.Autowired; | ||
18 | import org.springframework.http.HttpEntity; | ||
19 | import org.springframework.http.HttpHeaders; | ||
20 | import org.springframework.http.MediaType; | ||
21 | import org.springframework.http.client.ClientHttpRequestFactory; | ||
22 | import org.springframework.http.client.HttpComponentsClientHttpRequestFactory; | ||
23 | import org.springframework.scheduling.annotation.Async; | ||
24 | import org.springframework.stereotype.Service; | ||
25 | import org.springframework.web.client.RestTemplate; | ||
26 | |||
27 | /** | ||
28 | * 业务节点同步数据到区域节点服务 | ||
29 | * @param <T> | ||
30 | */ | ||
31 | @Slf4j | ||
32 | @Service | ||
33 | public class TdsSyncToRegionalNodeService<T> { | ||
34 | |||
35 | @Resource | ||
36 | public ZQConfig zqConfig; | ||
37 | |||
38 | @Resource | ||
39 | private RestTemplate restTemplate; | ||
40 | |||
41 | /** | ||
42 | * 业务节点同步数据到区域节点 | ||
43 | * @param dataTypeEnum | ||
44 | * @param data | ||
45 | * @param callback | ||
46 | */ | ||
47 | @Async | ||
48 | public void syncToRegionalNode(TdsDataTypeEnum dataTypeEnum, | ||
49 | T data, | ||
50 | TdsSyncToRegionalNodeCallback<T> callback){ | ||
51 | HttpHeaders headers = new HttpHeaders(); | ||
52 | headers.setContentType(MediaType.APPLICATION_JSON); | ||
53 | headers.set("appKey", zqConfig.getAppKey()); | ||
54 | JSONObject jsonObject = new JSONObject(); | ||
55 | jsonObject.put("data",JSON.parseObject(JSON.toJSONString(data))); | ||
56 | jsonObject.put("dataType",dataTypeEnum); | ||
57 | jsonObject.put("zqName",zqConfig.getZqName()); | ||
58 | HttpEntity<JSONObject> requestEntity = new HttpEntity<>(jsonObject, headers); | ||
59 | restTemplate.setRequestFactory(getFactory()); | ||
60 | CommonRes commonRes = restTemplate.postForObject(zqConfig.getTdsRegionalNodeUrl(), requestEntity, CommonRes.class); | ||
61 | if (!CommonRes.success().getCode().equals(commonRes.getCode())) { | ||
62 | throw new CsbrSystemException(SystemError.ERROR_CODE, commonRes.getMsg()); | ||
63 | } else { | ||
64 | CommonRes commonResData = JSON.parseObject(String.valueOf(commonRes.getData()), CommonRes.class); | ||
65 | if (!CommonRes.success().getCode().equals(commonResData.getCode())) { | ||
66 | throw new CsbrSystemException(SystemError.ERROR_CODE, commonResData.getMsg()); | ||
67 | } | ||
68 | } | ||
69 | callback.onTaskComplete(data); | ||
70 | } | ||
71 | |||
72 | private ClientHttpRequestFactory getFactory() { | ||
73 | RequestConfig config = RequestConfig.custom() | ||
74 | .setConnectTimeout(Timeout.ofSeconds(5000)) // 连接超时 | ||
75 | .setConnectionRequestTimeout(Timeout.ofSeconds(5000)) // 从连接池获取连接的超时时间 | ||
76 | .setResponseTimeout(Timeout.ofSeconds(10000)) // 数据读取超时 | ||
77 | .build(); | ||
78 | |||
79 | CloseableHttpClient httpClient = HttpClientBuilder.create() | ||
80 | .setDefaultRequestConfig(config) | ||
81 | .build(); | ||
82 | |||
83 | return new HttpComponentsClientHttpRequestFactory(httpClient); | ||
84 | } | ||
85 | } |
1 | package com.csbr.qingcloud.portal.service.impl; | ||
2 | |||
3 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | ||
4 | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; | ||
5 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; | ||
6 | import com.csbr.cloud.common.enums.SystemError; | ||
7 | import com.csbr.cloud.common.exception.CsbrSystemException; | ||
8 | import com.csbr.cloud.common.util.CommonUtil; | ||
9 | import com.csbr.cloud.common.util.CsbrBeanUtil; | ||
10 | import com.csbr.cloud.common.util.MessageSourceUtil; | ||
11 | import csbr.cloud.entity.domain.base.vo.PageListVO; | ||
12 | import com.csbr.qingcloud.portal.domain.vo.TdsUserAdditionalQueryVO; | ||
13 | import com.csbr.qingcloud.portal.domain.vo.TdsUserAdditionalRQVO; | ||
14 | import com.csbr.qingcloud.portal.domain.vo.TdsUserAdditionalRSVO; | ||
15 | import com.csbr.qingcloud.portal.mybatis.entity.MfTdsUserAdditional; | ||
16 | import com.csbr.qingcloud.portal.mybatis.service.MfTdsUserAdditionalService; | ||
17 | import com.csbr.qingcloud.portal.service.TdsUserAdditionalService; | ||
18 | import jakarta.annotation.Resource; | ||
19 | import lombok.extern.slf4j.Slf4j; | ||
20 | import org.apache.commons.collections.CollectionUtils; | ||
21 | import org.apache.commons.lang3.ObjectUtils; | ||
22 | import org.apache.commons.lang3.StringUtils; | ||
23 | import org.springframework.stereotype.Service; | ||
24 | import org.springframework.transaction.annotation.Transactional; | ||
25 | |||
26 | import java.util.ArrayList; | ||
27 | import java.util.Collections; | ||
28 | import java.util.List; | ||
29 | |||
30 | /** | ||
31 | * @program: | ||
32 | * @description: 个人用户附加信息业务逻辑实现 | ||
33 | * @author: xup | ||
34 | * @create: 2025-08-14 13:21 | ||
35 | **/ | ||
36 | @Slf4j | ||
37 | @Service | ||
38 | public class TdsUserAdditionalServiceImpl implements TdsUserAdditionalService { | ||
39 | |||
40 | /** | ||
41 | * 功能名称 | ||
42 | */ | ||
43 | private static final String FUNCTION_NAME = "个人用户附加信息"; | ||
44 | |||
45 | @Resource | ||
46 | private MfTdsUserAdditionalService mfTdsUserAdditionalService; | ||
47 | |||
48 | @Resource | ||
49 | private CsbrBeanUtil csbrBeanUtil; | ||
50 | |||
51 | @Resource | ||
52 | private MessageSourceUtil messageSourceUtil; | ||
53 | |||
54 | /** | ||
55 | * 个人用户附加信息分页查询 | ||
56 | * @author xup | ||
57 | * @date 2025-08-14 13:21 | ||
58 | * @param queryVO | ||
59 | * @return com.csbr.cloud.mybatis.entity.PageListVO<com.csbr.qingcloud.portal.domain.vo.TdsUserAdditionalRSVO> | ||
60 | */ | ||
61 | @Override | ||
62 | public PageListVO<TdsUserAdditionalRSVO> pageList(TdsUserAdditionalQueryVO queryVO) { | ||
63 | beforeQuery(queryVO); | ||
64 | LambdaQueryWrapper<MfTdsUserAdditional> queryWrapper = mfTdsUserAdditionalService.csbrQueryWrapper(queryVO, MfTdsUserAdditional.class); | ||
65 | queryWrapper.orderByDesc(MfTdsUserAdditional::getCreateTime); | ||
66 | PageListVO<MfTdsUserAdditional> pageList = mfTdsUserAdditionalService.csbrPageList(queryVO, queryWrapper); | ||
67 | PageListVO<TdsUserAdditionalRSVO> rsPageList = csbrBeanUtil.convert(pageList, PageListVO.class); | ||
68 | afterQuery(pageList, rsPageList); | ||
69 | return rsPageList; | ||
70 | } | ||
71 | |||
72 | /** | ||
73 | * 个人用户附加信息获取详情数据 | ||
74 | * @author xup | ||
75 | * @date 2025-08-14 13:21 | ||
76 | * @param guid | ||
77 | * @return com.csbr.qingcloud.portal.domain.vo.TdsUserAdditionalRSVO | ||
78 | */ | ||
79 | @Override | ||
80 | public TdsUserAdditionalRSVO getTdsUserAdditionalDetail(String guid) { | ||
81 | if (StringUtils.isBlank(guid)) { | ||
82 | // W00012 = {0}:参数[{1}]不能为空! | ||
83 | throw new CsbrSystemException(SystemError.DATA_INPUT_ERROR, messageSourceUtil.getMessage("W00010", | ||
84 | String.format("获取%s详情数据", FUNCTION_NAME), "数据唯一标识")); | ||
85 | } | ||
86 | MfTdsUserAdditional entity = mfTdsUserAdditionalService.getById(guid); | ||
87 | if (entity == null) { | ||
88 | throw new CsbrSystemException(SystemError.DATA_NOT_EXISTS, messageSourceUtil.notExistsToSelectMessage(String.format("获取%s详情数据", FUNCTION_NAME))); | ||
89 | } | ||
90 | return convertToVO(entity); | ||
91 | } | ||
92 | |||
93 | /** | ||
94 | * 个人用户附加信息数据新增 | ||
95 | * @author xup | ||
96 | * @date 2025-08-14 13:21 | ||
97 | * @param rqVO | ||
98 | * @return boolean | ||
99 | */ | ||
100 | @Transactional(rollbackFor = Exception.class) | ||
101 | @Override | ||
102 | public void saveTdsUserAdditional(TdsUserAdditionalRQVO rqVO) { | ||
103 | beforeSave(rqVO); | ||
104 | MfTdsUserAdditional entity = convertToEntity(rqVO); | ||
105 | rqVO.setGuid(entity.getGuid()); | ||
106 | mfTdsUserAdditionalService.csbrAddEntity(entity); | ||
107 | boolean flag = mfTdsUserAdditionalService.save(entity); | ||
108 | if (!flag) { | ||
109 | throw new CsbrSystemException(SystemError.DATA_ADD_ERROR, messageSourceUtil.addMessage(FUNCTION_NAME)); | ||
110 | } | ||
111 | afterSave(rqVO); | ||
112 | } | ||
113 | |||
114 | /** | ||
115 | * 个人用户附加信息数据修改 | ||
116 | * @author xup | ||
117 | * @date 2025-08-14 13:21 | ||
118 | * @param rqVO | ||
119 | * @return boolean | ||
120 | */ | ||
121 | @Transactional(rollbackFor = Exception.class) | ||
122 | @Override | ||
123 | public void updateTdsUserAdditional(TdsUserAdditionalRQVO rqVO) { | ||
124 | // 将修改前数据查出来缓存下来,传入到修改后方法中,用于一些特殊逻辑处理,如某个值变化才进行 | ||
125 | // MfTdsUserAdditional oldEntity = mfTdsUserAdditionalService.getById(rqVO.getGuid()); | ||
126 | MfTdsUserAdditional oldEntity = null; | ||
127 | beforeUpdate(rqVO); | ||
128 | MfTdsUserAdditional entity = convertToEntity(rqVO); | ||
129 | mfTdsUserAdditionalService.csbrUpdateEntity(entity); | ||
130 | boolean flag = mfTdsUserAdditionalService.updateById(entity); | ||
131 | if (!flag) { | ||
132 | throw new CsbrSystemException(SystemError.DATA_UPDATE_ERROR, messageSourceUtil.updateMessage(FUNCTION_NAME)); | ||
133 | } | ||
134 | afterUpdate(rqVO, oldEntity); | ||
135 | } | ||
136 | |||
137 | /** | ||
138 | * 个人用户附加信息数据删除 | ||
139 | * @author xup | ||
140 | * @date 2025-08-14 13:21 | ||
141 | * @param guids | ||
142 | * @return void | ||
143 | */ | ||
144 | @Transactional(rollbackFor = Exception.class) | ||
145 | @Override | ||
146 | public void removeByGuids(List<String> guids) { | ||
147 | if (CollectionUtils.isEmpty(guids)) { | ||
148 | // W00012 = {0}:参数[{1}]不能为空! | ||
149 | throw new CsbrSystemException(SystemError.DATA_INPUT_ERROR, messageSourceUtil.getMessage("W00012", | ||
150 | String.format("删除%s数据", FUNCTION_NAME), "数据唯一标识")); | ||
151 | } | ||
152 | if (!mfTdsUserAdditionalService.isExistsData(guids, MfTdsUserAdditional.class)) { | ||
153 | throw new CsbrSystemException(SystemError.DATA_DEL_ERROR, messageSourceUtil.notExistsToDelMessage(FUNCTION_NAME)); | ||
154 | } | ||
155 | boolean flag = mfTdsUserAdditionalService.removeByIds(guids); | ||
156 | if (!flag) { | ||
157 | throw new CsbrSystemException(SystemError.DATA_DEL_ERROR, messageSourceUtil.delMessage(FUNCTION_NAME)); | ||
158 | } | ||
159 | } | ||
160 | |||
161 | /** | ||
162 | * 个人用户附加信息数据删除、并有相关的处理操作 | ||
163 | * @author xup | ||
164 | * @date 2025-08-14 13:21 | ||
165 | * @param guids | ||
166 | * @return void | ||
167 | */ | ||
168 | @Transactional(rollbackFor = Exception.class) | ||
169 | @Override | ||
170 | public void removeHandleByGuids(List<String> guids) { | ||
171 | if (CollectionUtils.isEmpty(guids)) { | ||
172 | // W00012 = {0}:参数[{1}]不能为空! | ||
173 | throw new CsbrSystemException(SystemError.DATA_INPUT_ERROR, messageSourceUtil.getMessage("W00012", | ||
174 | String.format("删除%s数据", FUNCTION_NAME), "数据唯一标识")); | ||
175 | } | ||
176 | for (String guid : guids) { | ||
177 | MfTdsUserAdditional entity = mfTdsUserAdditionalService.getById(guid); | ||
178 | beforeRemove(entity); | ||
179 | boolean flag = mfTdsUserAdditionalService.removeById(guid); | ||
180 | if (!flag) { | ||
181 | throw new CsbrSystemException(SystemError.DATA_DEL_ERROR, messageSourceUtil.delMessage(FUNCTION_NAME)); | ||
182 | } | ||
183 | afterRemove(entity); | ||
184 | } | ||
185 | } | ||
186 | |||
187 | @Override | ||
188 | public void removeByUserGuids(List<String> userGuids) { | ||
189 | if (CollectionUtils.isEmpty(userGuids)) { | ||
190 | // W00012 = {0}:参数[{1}]不能为空! | ||
191 | throw new CsbrSystemException(SystemError.DATA_INPUT_ERROR, messageSourceUtil.getMessage("W00012", | ||
192 | String.format("删除%s数据", FUNCTION_NAME), "用户Guid")); | ||
193 | } | ||
194 | LambdaUpdateWrapper<MfTdsUserAdditional> removeWrapper = Wrappers.lambdaUpdate(); | ||
195 | removeWrapper.in(MfTdsUserAdditional::getGuid,userGuids); | ||
196 | mfTdsUserAdditionalService.remove(removeWrapper); | ||
197 | } | ||
198 | |||
199 | @Override | ||
200 | public TdsUserAdditionalRSVO getTdsUserAdditionalByUserGuid(String userGuid) { | ||
201 | if (StringUtils.isBlank(userGuid)) { | ||
202 | // W00012 = {0}:参数[{1}]不能为空! | ||
203 | throw new CsbrSystemException(SystemError.DATA_INPUT_ERROR, messageSourceUtil.getMessage("W00010", | ||
204 | String.format("获取%s详情数据", FUNCTION_NAME), "用户Guid")); | ||
205 | } | ||
206 | LambdaQueryWrapper<MfTdsUserAdditional> queryWrapper = Wrappers.lambdaQuery(); | ||
207 | queryWrapper.eq(MfTdsUserAdditional::getUserGuid,userGuid); | ||
208 | List<MfTdsUserAdditional> list = mfTdsUserAdditionalService.list(queryWrapper); | ||
209 | if(ObjectUtils.isEmpty(list)){ | ||
210 | return null; | ||
211 | } | ||
212 | return convertToVO(list.get(0)); | ||
213 | } | ||
214 | |||
215 | /** | ||
216 | * 个人用户附加信息新新增前置处理 | ||
217 | * @author xup | ||
218 | * @date 2025-08-14 13:21 | ||
219 | * @param rqVO | ||
220 | * @return void | ||
221 | */ | ||
222 | private void beforeSave(TdsUserAdditionalRQVO rqVO) { | ||
223 | //region 1.输入基础验证 | ||
224 | //endregion | ||
225 | |||
226 | //region 2.数据验证特殊处理 | ||
227 | //region 2.1.业务合规性验证 | ||
228 | //endregion 2.1.业务合规性验证 | ||
229 | |||
230 | //region 2.2.业务数据验证 | ||
231 | //endregion 2.2.业务数据验证 | ||
232 | |||
233 | //endregion 2.数据验证特殊处理 | ||
234 | |||
235 | //region 3.数据转换处理 | ||
236 | |||
237 | //region 3.1.数据过程转换 | ||
238 | //endregion 3.1.数据过程转换 | ||
239 | |||
240 | //endregion 3.数据转换处理 | ||
241 | |||
242 | //region 4.数据过滤与补充处理 | ||
243 | |||
244 | //endregion 4.数据过滤与补充处理 | ||
245 | |||
246 | //region 5.过程处理 | ||
247 | |||
248 | //region 5.1.计算逻辑处理 | ||
249 | //endregion 5.1.计算逻辑处理 | ||
250 | |||
251 | //region 5.2.业务逻辑处理 | ||
252 | //endregion 5.2.业务逻辑处理 | ||
253 | |||
254 | //endregion 5.过程处理 | ||
255 | } | ||
256 | |||
257 | /** | ||
258 | * 个人用户附加信息新增后置处理 | ||
259 | * @author xup | ||
260 | * @date 2025-08-14 13:21 | ||
261 | * @param rqVO | ||
262 | * @return void | ||
263 | */ | ||
264 | private void afterSave(TdsUserAdditionalRQVO rqVO) { | ||
265 | //region 1.输出特殊转换 | ||
266 | |||
267 | //region 1.1.输出过滤与补充处理 | ||
268 | //endregion 1.1.输出过滤与补充处理 | ||
269 | |||
270 | //endregion 1.输出特殊转换 | ||
271 | } | ||
272 | |||
273 | /** | ||
274 | * 个人用户附加信息修改前置校验、处理 | ||
275 | * @author xup | ||
276 | * @date 2025-08-14 13:21 | ||
277 | * @param rqVO | ||
278 | * @return void | ||
279 | */ | ||
280 | private void beforeUpdate(TdsUserAdditionalRQVO rqVO) { | ||
281 | //region 1.输入基础验证 | ||
282 | if (StringUtils.isBlank(rqVO.getGuid())) { | ||
283 | // W00012 = {0}:参数[{1}]不能为空! | ||
284 | throw new CsbrSystemException(SystemError.DATA_INPUT_ERROR, messageSourceUtil.getMessage("W00010", String.format("修改%s数据",FUNCTION_NAME), "数据唯一标识")); | ||
285 | } | ||
286 | //endregion | ||
287 | |||
288 | //region 2.数据验证特殊处理 | ||
289 | //region 2.1.业务合规性验证 | ||
290 | //endregion 2.1.业务合规性验证 | ||
291 | |||
292 | //region 2.2.业务数据验证 | ||
293 | if (!mfTdsUserAdditionalService.isExistsData(Collections.singletonList(rqVO.getGuid()), MfTdsUserAdditional.class)) { | ||
294 | throw new CsbrSystemException(SystemError.DATA_DEL_ERROR, messageSourceUtil.notExistsToUpdateMessage(FUNCTION_NAME)); | ||
295 | } | ||
296 | //endregion 2.2.业务数据验证 | ||
297 | |||
298 | //endregion 2.数据验证特殊处理 | ||
299 | |||
300 | //region 3.数据转换处理 | ||
301 | |||
302 | //region 3.1.数据过程转换 | ||
303 | //endregion 3.1.数据过程转换 | ||
304 | |||
305 | //endregion 3.数据转换处理 | ||
306 | |||
307 | //region 4.数据过滤与补充处理 | ||
308 | //endregion 4.数据过滤与补充处理 | ||
309 | |||
310 | //region 5.过程处理 | ||
311 | |||
312 | //region 5.1.计算逻辑处理 | ||
313 | //endregion 5.1.计算逻辑处理 | ||
314 | |||
315 | //region 5.2.业务逻辑处理 | ||
316 | //endregion 5.2.业务逻辑处理 | ||
317 | |||
318 | //endregion 5.过程处理 | ||
319 | } | ||
320 | |||
321 | /** | ||
322 | * 个人用户附加信息修改后置处理 | ||
323 | * @author xup | ||
324 | * @date 2025-08-14 13:21 | ||
325 | * @param rqVO | ||
326 | * @param entity | ||
327 | * @return void | ||
328 | */ | ||
329 | protected void afterUpdate(TdsUserAdditionalRQVO rqVO, MfTdsUserAdditional entity) { | ||
330 | //region 1.输出特殊转换 | ||
331 | |||
332 | //region 1.1.输出过滤与补充处理 | ||
333 | //endregion 1.1.输出过滤与补充处理 | ||
334 | |||
335 | //endregion 1.输出特殊转换 | ||
336 | } | ||
337 | |||
338 | |||
339 | /** | ||
340 | * 个人用户附加信息删除前置处理 | ||
341 | * @author xup | ||
342 | * @date 2025-08-14 13:21 | ||
343 | * @param entity | ||
344 | * @return void | ||
345 | */ | ||
346 | private void beforeRemove(MfTdsUserAdditional entity) { | ||
347 | if (entity == null) { | ||
348 | throw new CsbrSystemException(SystemError.DATA_DEL_ERROR, messageSourceUtil.notExistsToDelMessage(FUNCTION_NAME)); | ||
349 | } | ||
350 | } | ||
351 | |||
352 | /** | ||
353 | * 个人用户附加信息删除后置处理 | ||
354 | * @author xup | ||
355 | * @date 2025-08-14 13:21 | ||
356 | * @param entity | ||
357 | * @return void | ||
358 | */ | ||
359 | private void afterRemove(MfTdsUserAdditional entity) { | ||
360 | |||
361 | } | ||
362 | |||
363 | /** | ||
364 | * 个人用户附加信息查询方法前置验证、处理 | ||
365 | * @author xup | ||
366 | * @date 2025-08-14 13:21 | ||
367 | * @param rqQueryVO | ||
368 | * @return void | ||
369 | */ | ||
370 | private void beforeQuery(TdsUserAdditionalQueryVO rqQueryVO) { | ||
371 | |||
372 | } | ||
373 | |||
374 | /** | ||
375 | * 个人用户附加信息查询方法后置数据转换、处理 | ||
376 | * @author xup | ||
377 | * @date 2025-08-14 13:21 | ||
378 | * @param pageList 数据库查询数据 | ||
379 | * @param rsPageList 返回的最终数据 | ||
380 | * @return void | ||
381 | */ | ||
382 | private void afterQuery(PageListVO<MfTdsUserAdditional> pageList, PageListVO<TdsUserAdditionalRSVO> rsPageList) { | ||
383 | if (CollectionUtils.isNotEmpty(pageList.getRecords())) { | ||
384 | rsPageList.setRecords(convertToVO(pageList.getRecords())); | ||
385 | } | ||
386 | // 需要特殊处理数据时使用 | ||
387 | /*if(CollectionUtils.isNotEmpty(pageList.getRecords())){ | ||
388 | List<TdsUserAdditionalRSVO> results = new ArrayList<>(); | ||
389 | for (MfTdsUserAdditional item : pageList.getRecords()){ | ||
390 | TdsUserAdditionalRSVO vo = convertToVO(item); | ||
391 | results.add(vo); | ||
392 | } | ||
393 | rsPageList.setRecords(results); | ||
394 | }*/ | ||
395 | } | ||
396 | |||
397 | //region 辅助操作 | ||
398 | |||
399 | /** | ||
400 | * 个人用户附加信息实体数据转换为视图对象数据(多个) | ||
401 | * @author xup | ||
402 | * @date 2025-08-14 13:21 | ||
403 | * @param entityList 实体数据列表 | ||
404 | * @return java.util.List<com.csbr.qingcloud.portal.domain.vo.TdsUserAdditionalRSVO> 视图对象列表 | ||
405 | */ | ||
406 | private List<TdsUserAdditionalRSVO> convertToVO(List<MfTdsUserAdditional> entityList) { | ||
407 | if (CollectionUtils.isEmpty(entityList)) { | ||
408 | // W00012 = {0}:参数[{1}]不能为空! | ||
409 | throw new CsbrSystemException(SystemError.DATA_INPUT_ERROR, messageSourceUtil.getMessage("W00012", | ||
410 | "实体数据转换为视图对象实体数据", "实体数据")); | ||
411 | } | ||
412 | List<TdsUserAdditionalRSVO> voList = new ArrayList<>(entityList.size()); | ||
413 | for (MfTdsUserAdditional item : entityList) { | ||
414 | TdsUserAdditionalRSVO vo = convertToVO(item); | ||
415 | voList.add(vo); | ||
416 | } | ||
417 | return voList; | ||
418 | } | ||
419 | |||
420 | /** | ||
421 | * 个人用户附加信息实体数据转换为视图对象数据 | ||
422 | * @author xup | ||
423 | * @date 2025-08-14 13:21 | ||
424 | * @param entity | ||
425 | * @return com.csbr.qingcloud.portal.domain.vo.TdsUserAdditionalRSVO | ||
426 | */ | ||
427 | private TdsUserAdditionalRSVO convertToVO(MfTdsUserAdditional entity) { | ||
428 | TdsUserAdditionalRSVO vo = csbrBeanUtil.convert(entity, TdsUserAdditionalRSVO.class); | ||
429 | return vo; | ||
430 | } | ||
431 | |||
432 | /** | ||
433 | * 个人用户附加信息新增、修改和其他情况的参数转换为实体 | ||
434 | * @author xup | ||
435 | * @date 2025-08-14 13:21 | ||
436 | * @param vo | ||
437 | * @return com.csbr.qingcloud.portal.mybatis.entity.MfTdsUserAdditional | ||
438 | */ | ||
439 | private MfTdsUserAdditional convertToEntity(TdsUserAdditionalRQVO vo) { | ||
440 | MfTdsUserAdditional entity = csbrBeanUtil.convert(vo, MfTdsUserAdditional.class); | ||
441 | // 新增时数据默认guid赋值,转换后该guid可能别使用 | ||
442 | if (StringUtils.isBlank(vo.getGuid())) { | ||
443 | entity.setGuid(CommonUtil.newGuid()); | ||
444 | } | ||
445 | return entity; | ||
446 | } | ||
447 | |||
448 | //endregion | ||
449 | |||
450 | } |
1 | package com.csbr.qingcloud.portal.service.impl; | ||
2 | |||
3 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | ||
4 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; | ||
5 | import com.csbr.cloud.common.enums.SystemError; | ||
6 | import com.csbr.cloud.common.exception.CsbrSystemException; | ||
7 | import com.csbr.cloud.common.util.CommonUtil; | ||
8 | import com.csbr.cloud.common.util.CsbrBeanUtil; | ||
9 | import com.csbr.cloud.common.util.MessageSourceUtil; | ||
10 | import com.csbr.qingcloud.portal.service.TdsUserAdditionalService; | ||
11 | import com.csbr.qingcloud.portal.service.TdsUserVerifiableService; | ||
12 | import csbr.cloud.entity.domain.base.vo.PageListVO; | ||
13 | import com.csbr.qingcloud.portal.domain.vo.TdsUserIdentityQueryVO; | ||
14 | import com.csbr.qingcloud.portal.domain.vo.TdsUserIdentityRQVO; | ||
15 | import com.csbr.qingcloud.portal.domain.vo.TdsUserIdentityRSVO; | ||
16 | import com.csbr.qingcloud.portal.mybatis.entity.MfTdsUserIdentity; | ||
17 | import com.csbr.qingcloud.portal.mybatis.service.MfTdsUserIdentityService; | ||
18 | import com.csbr.qingcloud.portal.service.TdsUserIdentityService; | ||
19 | import jakarta.annotation.Resource; | ||
20 | import lombok.extern.slf4j.Slf4j; | ||
21 | import org.apache.commons.collections.CollectionUtils; | ||
22 | import org.apache.commons.lang3.ObjectUtils; | ||
23 | import org.apache.commons.lang3.StringUtils; | ||
24 | import org.springframework.transaction.annotation.Transactional; | ||
25 | |||
26 | import java.util.ArrayList; | ||
27 | import java.util.Collections; | ||
28 | import java.util.List; | ||
29 | |||
30 | /** | ||
31 | * @program: | ||
32 | * @description: 个人用户身份信息业务逻辑实现 | ||
33 | * @author: xup | ||
34 | * @create: 2025-08-14 13:21 | ||
35 | **/ | ||
36 | @Slf4j | ||
37 | public class TdsUserIdentityServiceImpl implements TdsUserIdentityService { | ||
38 | |||
39 | /** | ||
40 | * 功能名称 | ||
41 | */ | ||
42 | private static final String FUNCTION_NAME = "个人用户身份信息"; | ||
43 | |||
44 | @Resource | ||
45 | private MfTdsUserIdentityService mfTdsUserIdentityService; | ||
46 | |||
47 | @Resource | ||
48 | private CsbrBeanUtil csbrBeanUtil; | ||
49 | |||
50 | @Resource | ||
51 | private MessageSourceUtil messageSourceUtil; | ||
52 | |||
53 | @Resource | ||
54 | private TdsUserAdditionalService tdsUserAdditionalService; | ||
55 | |||
56 | @Resource | ||
57 | private TdsUserVerifiableService tdsUserVerifiableService; | ||
58 | |||
59 | /** | ||
60 | * 个人用户身份信息分页查询 | ||
61 | * @author xup | ||
62 | * @date 2025-08-14 13:21 | ||
63 | * @param queryVO | ||
64 | * @return com.csbr.cloud.mybatis.entity.PageListVO<com.csbr.qingcloud.portal.domain.vo.TdsUserIdentityRSVO> | ||
65 | */ | ||
66 | @Override | ||
67 | public PageListVO<TdsUserIdentityRSVO> pageList(TdsUserIdentityQueryVO queryVO) { | ||
68 | beforeQuery(queryVO); | ||
69 | LambdaQueryWrapper<MfTdsUserIdentity> queryWrapper = mfTdsUserIdentityService.csbrQueryWrapper(queryVO, MfTdsUserIdentity.class); | ||
70 | queryWrapper.orderByDesc(MfTdsUserIdentity::getCreateTime); | ||
71 | PageListVO<MfTdsUserIdentity> pageList = mfTdsUserIdentityService.csbrPageList(queryVO, queryWrapper); | ||
72 | PageListVO<TdsUserIdentityRSVO> rsPageList = csbrBeanUtil.convert(pageList, PageListVO.class); | ||
73 | afterQuery(pageList, rsPageList); | ||
74 | return rsPageList; | ||
75 | } | ||
76 | |||
77 | /** | ||
78 | * 个人用户身份信息获取详情数据 | ||
79 | * @author xup | ||
80 | * @date 2025-08-14 13:21 | ||
81 | * @param guid | ||
82 | * @return com.csbr.qingcloud.portal.domain.vo.TdsUserIdentityRSVO | ||
83 | */ | ||
84 | @Override | ||
85 | public TdsUserIdentityRSVO getTdsUserIdentityDetail(String guid) { | ||
86 | if (StringUtils.isBlank(guid)) { | ||
87 | // W00012 = {0}:参数[{1}]不能为空! | ||
88 | throw new CsbrSystemException(SystemError.DATA_INPUT_ERROR, messageSourceUtil.getMessage("W00010", | ||
89 | String.format("获取%s详情数据", FUNCTION_NAME), "数据唯一标识")); | ||
90 | } | ||
91 | MfTdsUserIdentity entity = mfTdsUserIdentityService.getById(guid); | ||
92 | if (entity == null) { | ||
93 | throw new CsbrSystemException(SystemError.DATA_NOT_EXISTS, messageSourceUtil.notExistsToSelectMessage(String.format("获取%s详情数据", FUNCTION_NAME))); | ||
94 | } | ||
95 | TdsUserIdentityRSVO vo = convertToVO(entity); | ||
96 | //补充附件信息和个人用户可验信息 | ||
97 | vo.setTdsUserAdditional(tdsUserAdditionalService.getTdsUserAdditionalByUserGuid(guid)); | ||
98 | vo.setTdsUserVerifiable(tdsUserVerifiableService.getTdsUserVerifiableByUserGuid(guid)); | ||
99 | return vo; | ||
100 | } | ||
101 | |||
102 | /** | ||
103 | * 个人用户身份信息数据新增 | ||
104 | * @author xup | ||
105 | * @date 2025-08-14 13:21 | ||
106 | * @param rqVO | ||
107 | * @return boolean | ||
108 | */ | ||
109 | @Transactional(rollbackFor = Exception.class) | ||
110 | @Override | ||
111 | public void saveTdsUserIdentity(TdsUserIdentityRQVO rqVO) { | ||
112 | beforeSave(rqVO); | ||
113 | MfTdsUserIdentity entity = convertToEntity(rqVO); | ||
114 | rqVO.setGuid(entity.getGuid()); | ||
115 | mfTdsUserIdentityService.csbrAddEntity(entity); | ||
116 | boolean flag = mfTdsUserIdentityService.save(entity); | ||
117 | if (!flag) { | ||
118 | throw new CsbrSystemException(SystemError.DATA_ADD_ERROR, messageSourceUtil.addMessage(FUNCTION_NAME)); | ||
119 | } | ||
120 | afterSave(rqVO); | ||
121 | } | ||
122 | |||
123 | /** | ||
124 | * 个人用户身份信息数据修改 | ||
125 | * @author xup | ||
126 | * @date 2025-08-14 13:21 | ||
127 | * @param rqVO | ||
128 | * @return boolean | ||
129 | */ | ||
130 | @Transactional(rollbackFor = Exception.class) | ||
131 | @Override | ||
132 | public void updateTdsUserIdentity(TdsUserIdentityRQVO rqVO) { | ||
133 | // 将修改前数据查出来缓存下来,传入到修改后方法中,用于一些特殊逻辑处理,如某个值变化才进行 | ||
134 | // MfTdsUserIdentity oldEntity = mfTdsUserIdentityService.getById(rqVO.getGuid()); | ||
135 | MfTdsUserIdentity oldEntity = null; | ||
136 | beforeUpdate(rqVO); | ||
137 | MfTdsUserIdentity entity = convertToEntity(rqVO); | ||
138 | mfTdsUserIdentityService.csbrUpdateEntity(entity); | ||
139 | boolean flag = mfTdsUserIdentityService.updateById(entity); | ||
140 | if (!flag) { | ||
141 | throw new CsbrSystemException(SystemError.DATA_UPDATE_ERROR, messageSourceUtil.updateMessage(FUNCTION_NAME)); | ||
142 | } | ||
143 | afterUpdate(rqVO, oldEntity); | ||
144 | } | ||
145 | |||
146 | /** | ||
147 | * 个人用户身份信息数据删除 | ||
148 | * @author xup | ||
149 | * @date 2025-08-14 13:21 | ||
150 | * @param guids | ||
151 | * @return void | ||
152 | */ | ||
153 | @Transactional(rollbackFor = Exception.class) | ||
154 | @Override | ||
155 | public void removeByGuids(List<String> guids) { | ||
156 | if (CollectionUtils.isEmpty(guids)) { | ||
157 | // W00012 = {0}:参数[{1}]不能为空! | ||
158 | throw new CsbrSystemException(SystemError.DATA_INPUT_ERROR, messageSourceUtil.getMessage("W00012", | ||
159 | String.format("删除%s数据", FUNCTION_NAME), "数据唯一标识")); | ||
160 | } | ||
161 | if (!mfTdsUserIdentityService.isExistsData(guids, MfTdsUserIdentity.class)) { | ||
162 | throw new CsbrSystemException(SystemError.DATA_DEL_ERROR, messageSourceUtil.notExistsToDelMessage(FUNCTION_NAME)); | ||
163 | } | ||
164 | boolean flag = mfTdsUserIdentityService.removeByIds(guids); | ||
165 | if (!flag) { | ||
166 | throw new CsbrSystemException(SystemError.DATA_DEL_ERROR, messageSourceUtil.delMessage(FUNCTION_NAME)); | ||
167 | } | ||
168 | //删除附件信息和验证信息 | ||
169 | tdsUserVerifiableService.removeByUserGuids(guids); | ||
170 | tdsUserAdditionalService.removeByUserGuids(guids); | ||
171 | } | ||
172 | |||
173 | /** | ||
174 | * 个人用户身份信息数据删除、并有相关的处理操作 | ||
175 | * @author xup | ||
176 | * @date 2025-08-14 13:21 | ||
177 | * @param guids | ||
178 | * @return void | ||
179 | */ | ||
180 | @Transactional(rollbackFor = Exception.class) | ||
181 | @Override | ||
182 | public void removeHandleByGuids(List<String> guids) { | ||
183 | if (CollectionUtils.isEmpty(guids)) { | ||
184 | // W00012 = {0}:参数[{1}]不能为空! | ||
185 | throw new CsbrSystemException(SystemError.DATA_INPUT_ERROR, messageSourceUtil.getMessage("W00012", | ||
186 | String.format("删除%s数据", FUNCTION_NAME), "数据唯一标识")); | ||
187 | } | ||
188 | for (String guid : guids) { | ||
189 | MfTdsUserIdentity entity = mfTdsUserIdentityService.getById(guid); | ||
190 | beforeRemove(entity); | ||
191 | boolean flag = mfTdsUserIdentityService.removeById(guid); | ||
192 | if (!flag) { | ||
193 | throw new CsbrSystemException(SystemError.DATA_DEL_ERROR, messageSourceUtil.delMessage(FUNCTION_NAME)); | ||
194 | } | ||
195 | afterRemove(entity); | ||
196 | } | ||
197 | } | ||
198 | |||
199 | @Override | ||
200 | public void updateTdsUserIdentityStatus(String bizGuid, | ||
201 | Integer identityStatus, String message) { | ||
202 | |||
203 | } | ||
204 | |||
205 | /** | ||
206 | * 个人用户身份信息新新增前置处理 | ||
207 | * @author xup | ||
208 | * @date 2025-08-14 13:21 | ||
209 | * @param rqVO | ||
210 | * @return void | ||
211 | */ | ||
212 | private void beforeSave(TdsUserIdentityRQVO rqVO) { | ||
213 | //region 1.输入基础验证 | ||
214 | if(ObjectUtils.isEmpty(rqVO)){ | ||
215 | throw new CsbrSystemException(SystemError.DATA_INPUT_ERROR, String.format("%s参数为空。",FUNCTION_NAME)); | ||
216 | } | ||
217 | //endregion | ||
218 | |||
219 | //region 2.数据验证特殊处理 | ||
220 | //region 2.1.业务合规性验证 | ||
221 | //endregion 2.1.业务合规性验证 | ||
222 | |||
223 | //region 2.2.业务数据验证 | ||
224 | //验证手机号唯一性和证件唯一性 | ||
225 | verifyUniqueness(rqVO); | ||
226 | //endregion 2.2.业务数据验证 | ||
227 | |||
228 | //endregion 2.数据验证特殊处理 | ||
229 | |||
230 | //region 3.数据转换处理 | ||
231 | |||
232 | //region 3.1.数据过程转换 | ||
233 | //endregion 3.1.数据过程转换 | ||
234 | |||
235 | //endregion 3.数据转换处理 | ||
236 | |||
237 | //region 4.数据过滤与补充处理 | ||
238 | |||
239 | //endregion 4.数据过滤与补充处理 | ||
240 | |||
241 | //region 5.过程处理 | ||
242 | |||
243 | //region 5.1.计算逻辑处理 | ||
244 | //endregion 5.1.计算逻辑处理 | ||
245 | |||
246 | //region 5.2.业务逻辑处理 | ||
247 | //endregion 5.2.业务逻辑处理 | ||
248 | |||
249 | //endregion 5.过程处理 | ||
250 | } | ||
251 | |||
252 | /** | ||
253 | * 验证手机号唯一性和证件唯一性 | ||
254 | * @param rqVO | ||
255 | */ | ||
256 | private void verifyUniqueness(TdsUserIdentityRQVO rqVO) { | ||
257 | if(ObjectUtils.isEmpty(rqVO.getIdNumber())){ | ||
258 | throw new CsbrSystemException(SystemError.DATA_INPUT_ERROR,"证件号码为空。"); | ||
259 | } | ||
260 | if(ObjectUtils.isEmpty(rqVO.getMobile())){ | ||
261 | throw new CsbrSystemException(SystemError.DATA_INPUT_ERROR,"手机号为空。"); | ||
262 | } | ||
263 | LambdaQueryWrapper<MfTdsUserIdentity> queryWrapper = Wrappers.lambdaQuery(); | ||
264 | queryWrapper.eq(MfTdsUserIdentity::getIdNumber,rqVO.getIdNumber()) | ||
265 | .or(wrap->wrap.eq(MfTdsUserIdentity::getMobile,rqVO.getMobile())); | ||
266 | if(StringUtils.isNotBlank(rqVO.getGuid())){ | ||
267 | queryWrapper.ne(MfTdsUserIdentity::getGuid,rqVO.getGuid()); | ||
268 | } | ||
269 | List<MfTdsUserIdentity> list = mfTdsUserIdentityService.list(queryWrapper); | ||
270 | if(ObjectUtils.isNotEmpty(list)){ | ||
271 | for (MfTdsUserIdentity mfTdsUserIdentity : list) { | ||
272 | if(rqVO.getIdNumber().equals(mfTdsUserIdentity.getIdNumber())){ | ||
273 | throw new CsbrSystemException(SystemError.DATA_ALREADY_EXISTS,"证件号码重复。"); | ||
274 | } | ||
275 | if(rqVO.getMobile().equals(mfTdsUserIdentity.getMobile())){ | ||
276 | throw new CsbrSystemException(SystemError.DATA_ALREADY_EXISTS,"手机号重复。"); | ||
277 | } | ||
278 | } | ||
279 | } | ||
280 | } | ||
281 | |||
282 | /** | ||
283 | * 个人用户身份信息新增后置处理 | ||
284 | * @author xup | ||
285 | * @date 2025-08-14 13:21 | ||
286 | * @param rqVO | ||
287 | * @return void | ||
288 | */ | ||
289 | private void afterSave(TdsUserIdentityRQVO rqVO) { | ||
290 | //region 1.输出特殊转换 | ||
291 | //region 1.1.输出过滤与补充处理 | ||
292 | //设置userGuid | ||
293 | if(ObjectUtils.isNotEmpty(rqVO.getTdsUserAdditional())){ | ||
294 | rqVO.getTdsUserAdditional().setUserGuid(rqVO.getGuid()); | ||
295 | //保存个人用户附加信息 | ||
296 | tdsUserAdditionalService.saveTdsUserAdditional(rqVO.getTdsUserAdditional()); | ||
297 | } | ||
298 | if(ObjectUtils.isNotEmpty(rqVO.getTdsUserVerifiable())){ | ||
299 | rqVO.getTdsUserVerifiable().setUserGuid(rqVO.getGuid()); | ||
300 | //保存个人用户可验信息 | ||
301 | tdsUserVerifiableService.saveTdsUserVerifiable(rqVO.getTdsUserVerifiable()); | ||
302 | } | ||
303 | //endregion 1.1.输出过滤与补充处理 | ||
304 | //endregion 1.输出特殊转换 | ||
305 | } | ||
306 | |||
307 | /** | ||
308 | * 个人用户身份信息修改前置校验、处理 | ||
309 | * @author xup | ||
310 | * @date 2025-08-14 13:21 | ||
311 | * @param rqVO | ||
312 | * @return void | ||
313 | */ | ||
314 | private void beforeUpdate(TdsUserIdentityRQVO rqVO) { | ||
315 | //region 1.输入基础验证 | ||
316 | if (StringUtils.isBlank(rqVO.getGuid())) { | ||
317 | // W00012 = {0}:参数[{1}]不能为空! | ||
318 | throw new CsbrSystemException(SystemError.DATA_INPUT_ERROR, messageSourceUtil.getMessage("W00010", String.format("修改%s数据",FUNCTION_NAME), "数据唯一标识")); | ||
319 | } | ||
320 | //endregion | ||
321 | |||
322 | //region 2.数据验证特殊处理 | ||
323 | //region 2.1.业务合规性验证 | ||
324 | //endregion 2.1.业务合规性验证 | ||
325 | |||
326 | //region 2.2.业务数据验证 | ||
327 | if (!mfTdsUserIdentityService.isExistsData(Collections.singletonList(rqVO.getGuid()), MfTdsUserIdentity.class)) { | ||
328 | throw new CsbrSystemException(SystemError.DATA_DEL_ERROR, messageSourceUtil.notExistsToUpdateMessage(FUNCTION_NAME)); | ||
329 | } | ||
330 | verifyUniqueness(rqVO); | ||
331 | //endregion 2.2.业务数据验证 | ||
332 | |||
333 | //endregion 2.数据验证特殊处理 | ||
334 | |||
335 | //region 3.数据转换处理 | ||
336 | |||
337 | //region 3.1.数据过程转换 | ||
338 | //endregion 3.1.数据过程转换 | ||
339 | |||
340 | //endregion 3.数据转换处理 | ||
341 | |||
342 | //region 4.数据过滤与补充处理 | ||
343 | //endregion 4.数据过滤与补充处理 | ||
344 | |||
345 | //region 5.过程处理 | ||
346 | |||
347 | //region 5.1.计算逻辑处理 | ||
348 | //endregion 5.1.计算逻辑处理 | ||
349 | |||
350 | //region 5.2.业务逻辑处理 | ||
351 | //endregion 5.2.业务逻辑处理 | ||
352 | |||
353 | //endregion 5.过程处理 | ||
354 | } | ||
355 | |||
356 | /** | ||
357 | * 个人用户身份信息修改后置处理 | ||
358 | * @author xup | ||
359 | * @date 2025-08-14 13:21 | ||
360 | * @param rqVO | ||
361 | * @param entity | ||
362 | * @return void | ||
363 | */ | ||
364 | protected void afterUpdate(TdsUserIdentityRQVO rqVO, MfTdsUserIdentity entity) { | ||
365 | //region 1.输出特殊转换 | ||
366 | |||
367 | //region 1.1.输出过滤与补充处理 | ||
368 | if(ObjectUtils.isNotEmpty(rqVO.getTdsUserAdditional())){ | ||
369 | rqVO.getTdsUserAdditional().setUserGuid(rqVO.getGuid()); | ||
370 | //保存个人用户附加信息 | ||
371 | tdsUserAdditionalService.updateTdsUserAdditional(rqVO.getTdsUserAdditional()); | ||
372 | } | ||
373 | if(ObjectUtils.isNotEmpty(rqVO.getTdsUserVerifiable())){ | ||
374 | rqVO.getTdsUserVerifiable().setUserGuid(rqVO.getGuid()); | ||
375 | //保存个人用户可验信息 | ||
376 | tdsUserVerifiableService.updateTdsUserVerifiable(rqVO.getTdsUserVerifiable()); | ||
377 | } | ||
378 | //endregion 1.1.输出过滤与补充处理 | ||
379 | |||
380 | //endregion 1.输出特殊转换 | ||
381 | } | ||
382 | |||
383 | |||
384 | /** | ||
385 | * 个人用户身份信息删除前置处理 | ||
386 | * @author xup | ||
387 | * @date 2025-08-14 13:21 | ||
388 | * @param entity | ||
389 | * @return void | ||
390 | */ | ||
391 | private void beforeRemove(MfTdsUserIdentity entity) { | ||
392 | if (entity == null) { | ||
393 | throw new CsbrSystemException(SystemError.DATA_DEL_ERROR, messageSourceUtil.notExistsToDelMessage(FUNCTION_NAME)); | ||
394 | } | ||
395 | } | ||
396 | |||
397 | /** | ||
398 | * 个人用户身份信息删除后置处理 | ||
399 | * @author xup | ||
400 | * @date 2025-08-14 13:21 | ||
401 | * @param entity | ||
402 | * @return void | ||
403 | */ | ||
404 | private void afterRemove(MfTdsUserIdentity entity) { | ||
405 | |||
406 | } | ||
407 | |||
408 | /** | ||
409 | * 个人用户身份信息查询方法前置验证、处理 | ||
410 | * @author xup | ||
411 | * @date 2025-08-14 13:21 | ||
412 | * @param rqQueryVO | ||
413 | * @return void | ||
414 | */ | ||
415 | private void beforeQuery(TdsUserIdentityQueryVO rqQueryVO) { | ||
416 | |||
417 | } | ||
418 | |||
419 | /** | ||
420 | * 个人用户身份信息查询方法后置数据转换、处理 | ||
421 | * @author xup | ||
422 | * @date 2025-08-14 13:21 | ||
423 | * @param pageList 数据库查询数据 | ||
424 | * @param rsPageList 返回的最终数据 | ||
425 | * @return void | ||
426 | */ | ||
427 | private void afterQuery(PageListVO<MfTdsUserIdentity> pageList, PageListVO<TdsUserIdentityRSVO> rsPageList) { | ||
428 | if (CollectionUtils.isNotEmpty(pageList.getRecords())) { | ||
429 | rsPageList.setRecords(convertToVO(pageList.getRecords())); | ||
430 | } | ||
431 | // 需要特殊处理数据时使用 | ||
432 | /*if(CollectionUtils.isNotEmpty(pageList.getRecords())){ | ||
433 | List<TdsUserIdentityRSVO> results = new ArrayList<>(); | ||
434 | for (MfTdsUserIdentity item : pageList.getRecords()){ | ||
435 | TdsUserIdentityRSVO vo = convertToVO(item); | ||
436 | results.add(vo); | ||
437 | } | ||
438 | rsPageList.setRecords(results); | ||
439 | }*/ | ||
440 | } | ||
441 | |||
442 | //region 辅助操作 | ||
443 | |||
444 | /** | ||
445 | * 个人用户身份信息实体数据转换为视图对象数据(多个) | ||
446 | * @author xup | ||
447 | * @date 2025-08-14 13:21 | ||
448 | * @param entityList 实体数据列表 | ||
449 | * @return java.util.List<com.csbr.qingcloud.portal.domain.vo.TdsUserIdentityRSVO> 视图对象列表 | ||
450 | */ | ||
451 | private List<TdsUserIdentityRSVO> convertToVO(List<MfTdsUserIdentity> entityList) { | ||
452 | if (CollectionUtils.isEmpty(entityList)) { | ||
453 | // W00012 = {0}:参数[{1}]不能为空! | ||
454 | throw new CsbrSystemException(SystemError.DATA_INPUT_ERROR, messageSourceUtil.getMessage("W00012", | ||
455 | "实体数据转换为视图对象实体数据", "实体数据")); | ||
456 | } | ||
457 | List<TdsUserIdentityRSVO> voList = new ArrayList<>(entityList.size()); | ||
458 | for (MfTdsUserIdentity item : entityList) { | ||
459 | TdsUserIdentityRSVO vo = convertToVO(item); | ||
460 | voList.add(vo); | ||
461 | } | ||
462 | return voList; | ||
463 | } | ||
464 | |||
465 | /** | ||
466 | * 个人用户身份信息实体数据转换为视图对象数据 | ||
467 | * @author xup | ||
468 | * @date 2025-08-14 13:21 | ||
469 | * @param entity | ||
470 | * @return com.csbr.qingcloud.portal.domain.vo.TdsUserIdentityRSVO | ||
471 | */ | ||
472 | private TdsUserIdentityRSVO convertToVO(MfTdsUserIdentity entity) { | ||
473 | TdsUserIdentityRSVO vo = csbrBeanUtil.convert(entity, TdsUserIdentityRSVO.class); | ||
474 | return vo; | ||
475 | } | ||
476 | |||
477 | /** | ||
478 | * 个人用户身份信息新增、修改和其他情况的参数转换为实体 | ||
479 | * @author xup | ||
480 | * @date 2025-08-14 13:21 | ||
481 | * @param vo | ||
482 | * @return com.csbr.qingcloud.portal.mybatis.entity.MfTdsUserIdentity | ||
483 | */ | ||
484 | private MfTdsUserIdentity convertToEntity(TdsUserIdentityRQVO vo) { | ||
485 | MfTdsUserIdentity entity = csbrBeanUtil.convert(vo, MfTdsUserIdentity.class); | ||
486 | // 新增时数据默认guid赋值,转换后该guid可能别使用 | ||
487 | if (StringUtils.isBlank(vo.getGuid())) { | ||
488 | entity.setGuid(CommonUtil.newGuid()); | ||
489 | } | ||
490 | return entity; | ||
491 | } | ||
492 | |||
493 | @Override | ||
494 | public void onTaskComplete(TdsUserIdentityRQVO rqVO) { | ||
495 | |||
496 | } | ||
497 | |||
498 | //endregion | ||
499 | |||
500 | } |
1 | package com.csbr.qingcloud.portal.service.impl; | ||
2 | |||
3 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | ||
4 | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; | ||
5 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; | ||
6 | import com.csbr.cloud.common.enums.SystemError; | ||
7 | import com.csbr.cloud.common.exception.CsbrSystemException; | ||
8 | import com.csbr.cloud.common.util.CommonUtil; | ||
9 | import com.csbr.cloud.common.util.CsbrBeanUtil; | ||
10 | import com.csbr.cloud.common.util.MessageSourceUtil; | ||
11 | import csbr.cloud.entity.domain.base.vo.PageListVO; | ||
12 | import com.csbr.qingcloud.portal.domain.vo.TdsUserVerifiableQueryVO; | ||
13 | import com.csbr.qingcloud.portal.domain.vo.TdsUserVerifiableRQVO; | ||
14 | import com.csbr.qingcloud.portal.domain.vo.TdsUserVerifiableRSVO; | ||
15 | import com.csbr.qingcloud.portal.mybatis.entity.MfTdsUserVerifiable; | ||
16 | import com.csbr.qingcloud.portal.mybatis.service.MfTdsUserVerifiableService; | ||
17 | import com.csbr.qingcloud.portal.service.TdsUserVerifiableService; | ||
18 | import jakarta.annotation.Resource; | ||
19 | import lombok.extern.slf4j.Slf4j; | ||
20 | import org.apache.commons.collections.CollectionUtils; | ||
21 | import org.apache.commons.lang3.ObjectUtils; | ||
22 | import org.apache.commons.lang3.StringUtils; | ||
23 | import org.springframework.stereotype.Service; | ||
24 | import org.springframework.transaction.annotation.Transactional; | ||
25 | |||
26 | import java.util.ArrayList; | ||
27 | import java.util.Collections; | ||
28 | import java.util.List; | ||
29 | |||
30 | /** | ||
31 | * @program: | ||
32 | * @description: 个人用户可验信息业务逻辑实现 | ||
33 | * @author: xup | ||
34 | * @create: 2025-08-14 13:21 | ||
35 | **/ | ||
36 | @Slf4j | ||
37 | @Service | ||
38 | public class TdsUserVerifiableServiceImpl implements TdsUserVerifiableService { | ||
39 | |||
40 | /** | ||
41 | * 功能名称 | ||
42 | */ | ||
43 | private static final String FUNCTION_NAME = "个人用户可验信息"; | ||
44 | |||
45 | @Resource | ||
46 | private MfTdsUserVerifiableService mfTdsUserVerifiableService; | ||
47 | |||
48 | @Resource | ||
49 | private CsbrBeanUtil csbrBeanUtil; | ||
50 | |||
51 | @Resource | ||
52 | private MessageSourceUtil messageSourceUtil; | ||
53 | |||
54 | /** | ||
55 | * 个人用户可验信息分页查询 | ||
56 | * @author xup | ||
57 | * @date 2025-08-14 13:21 | ||
58 | * @param queryVO | ||
59 | * @return com.csbr.cloud.mybatis.entity.PageListVO<com.csbr.qingcloud.portal.domain.vo.TdsUserVerifiableRSVO> | ||
60 | */ | ||
61 | @Override | ||
62 | public PageListVO<TdsUserVerifiableRSVO> pageList(TdsUserVerifiableQueryVO queryVO) { | ||
63 | beforeQuery(queryVO); | ||
64 | LambdaQueryWrapper<MfTdsUserVerifiable> queryWrapper = mfTdsUserVerifiableService.csbrQueryWrapper(queryVO, MfTdsUserVerifiable.class); | ||
65 | queryWrapper.orderByDesc(MfTdsUserVerifiable::getCreateTime); | ||
66 | PageListVO<MfTdsUserVerifiable> pageList = mfTdsUserVerifiableService.csbrPageList(queryVO, queryWrapper); | ||
67 | PageListVO<TdsUserVerifiableRSVO> rsPageList = csbrBeanUtil.convert(pageList, PageListVO.class); | ||
68 | afterQuery(pageList, rsPageList); | ||
69 | return rsPageList; | ||
70 | } | ||
71 | |||
72 | /** | ||
73 | * 个人用户可验信息获取详情数据 | ||
74 | * @author xup | ||
75 | * @date 2025-08-14 13:21 | ||
76 | * @param guid | ||
77 | * @return com.csbr.qingcloud.portal.domain.vo.TdsUserVerifiableRSVO | ||
78 | */ | ||
79 | @Override | ||
80 | public TdsUserVerifiableRSVO getTdsUserVerifiableDetail(String guid) { | ||
81 | if (StringUtils.isBlank(guid)) { | ||
82 | // W00012 = {0}:参数[{1}]不能为空! | ||
83 | throw new CsbrSystemException(SystemError.DATA_INPUT_ERROR, messageSourceUtil.getMessage("W00010", | ||
84 | String.format("获取%s详情数据", FUNCTION_NAME), "数据唯一标识")); | ||
85 | } | ||
86 | MfTdsUserVerifiable entity = mfTdsUserVerifiableService.getById(guid); | ||
87 | if (entity == null) { | ||
88 | throw new CsbrSystemException(SystemError.DATA_NOT_EXISTS, messageSourceUtil.notExistsToSelectMessage(String.format("获取%s详情数据", FUNCTION_NAME))); | ||
89 | } | ||
90 | return convertToVO(entity); | ||
91 | } | ||
92 | |||
93 | /** | ||
94 | * 个人用户可验信息数据新增 | ||
95 | * @author xup | ||
96 | * @date 2025-08-14 13:21 | ||
97 | * @param rqVO | ||
98 | * @return boolean | ||
99 | */ | ||
100 | @Transactional(rollbackFor = Exception.class) | ||
101 | @Override | ||
102 | public void saveTdsUserVerifiable(TdsUserVerifiableRQVO rqVO) { | ||
103 | beforeSave(rqVO); | ||
104 | MfTdsUserVerifiable entity = convertToEntity(rqVO); | ||
105 | rqVO.setGuid(entity.getGuid()); | ||
106 | mfTdsUserVerifiableService.csbrAddEntity(entity); | ||
107 | boolean flag = mfTdsUserVerifiableService.save(entity); | ||
108 | if (!flag) { | ||
109 | throw new CsbrSystemException(SystemError.DATA_ADD_ERROR, messageSourceUtil.addMessage(FUNCTION_NAME)); | ||
110 | } | ||
111 | afterSave(rqVO); | ||
112 | } | ||
113 | |||
114 | /** | ||
115 | * 个人用户可验信息数据修改 | ||
116 | * @author xup | ||
117 | * @date 2025-08-14 13:21 | ||
118 | * @param rqVO | ||
119 | * @return boolean | ||
120 | */ | ||
121 | @Transactional(rollbackFor = Exception.class) | ||
122 | @Override | ||
123 | public void updateTdsUserVerifiable(TdsUserVerifiableRQVO rqVO) { | ||
124 | // 将修改前数据查出来缓存下来,传入到修改后方法中,用于一些特殊逻辑处理,如某个值变化才进行 | ||
125 | // MfTdsUserVerifiable oldEntity = mfTdsUserVerifiableService.getById(rqVO.getGuid()); | ||
126 | MfTdsUserVerifiable oldEntity = null; | ||
127 | beforeUpdate(rqVO); | ||
128 | MfTdsUserVerifiable entity = convertToEntity(rqVO); | ||
129 | mfTdsUserVerifiableService.csbrUpdateEntity(entity); | ||
130 | boolean flag = mfTdsUserVerifiableService.updateById(entity); | ||
131 | if (!flag) { | ||
132 | throw new CsbrSystemException(SystemError.DATA_UPDATE_ERROR, messageSourceUtil.updateMessage(FUNCTION_NAME)); | ||
133 | } | ||
134 | afterUpdate(rqVO, oldEntity); | ||
135 | } | ||
136 | |||
137 | /** | ||
138 | * 个人用户可验信息数据删除 | ||
139 | * @author xup | ||
140 | * @date 2025-08-14 13:21 | ||
141 | * @param guids | ||
142 | * @return void | ||
143 | */ | ||
144 | @Transactional(rollbackFor = Exception.class) | ||
145 | @Override | ||
146 | public void removeByGuids(List<String> guids) { | ||
147 | if (CollectionUtils.isEmpty(guids)) { | ||
148 | // W00012 = {0}:参数[{1}]不能为空! | ||
149 | throw new CsbrSystemException(SystemError.DATA_INPUT_ERROR, messageSourceUtil.getMessage("W00012", | ||
150 | String.format("删除%s数据", FUNCTION_NAME), "数据唯一标识")); | ||
151 | } | ||
152 | if (!mfTdsUserVerifiableService.isExistsData(guids, MfTdsUserVerifiable.class)) { | ||
153 | throw new CsbrSystemException(SystemError.DATA_DEL_ERROR, messageSourceUtil.notExistsToDelMessage(FUNCTION_NAME)); | ||
154 | } | ||
155 | boolean flag = mfTdsUserVerifiableService.removeByIds(guids); | ||
156 | if (!flag) { | ||
157 | throw new CsbrSystemException(SystemError.DATA_DEL_ERROR, messageSourceUtil.delMessage(FUNCTION_NAME)); | ||
158 | } | ||
159 | } | ||
160 | |||
161 | /** | ||
162 | * 个人用户可验信息数据删除、并有相关的处理操作 | ||
163 | * @author xup | ||
164 | * @date 2025-08-14 13:21 | ||
165 | * @param guids | ||
166 | * @return void | ||
167 | */ | ||
168 | @Transactional(rollbackFor = Exception.class) | ||
169 | @Override | ||
170 | public void removeHandleByGuids(List<String> guids) { | ||
171 | if (CollectionUtils.isEmpty(guids)) { | ||
172 | // W00012 = {0}:参数[{1}]不能为空! | ||
173 | throw new CsbrSystemException(SystemError.DATA_INPUT_ERROR, messageSourceUtil.getMessage("W00012", | ||
174 | String.format("删除%s数据", FUNCTION_NAME), "数据唯一标识")); | ||
175 | } | ||
176 | for (String guid : guids) { | ||
177 | MfTdsUserVerifiable entity = mfTdsUserVerifiableService.getById(guid); | ||
178 | beforeRemove(entity); | ||
179 | boolean flag = mfTdsUserVerifiableService.removeById(guid); | ||
180 | if (!flag) { | ||
181 | throw new CsbrSystemException(SystemError.DATA_DEL_ERROR, messageSourceUtil.delMessage(FUNCTION_NAME)); | ||
182 | } | ||
183 | afterRemove(entity); | ||
184 | } | ||
185 | } | ||
186 | |||
187 | @Override | ||
188 | public void removeByUserGuids(List<String> userGuids) { | ||
189 | if (CollectionUtils.isEmpty(userGuids)) { | ||
190 | // W00012 = {0}:参数[{1}]不能为空! | ||
191 | throw new CsbrSystemException(SystemError.DATA_INPUT_ERROR, messageSourceUtil.getMessage("W00012", | ||
192 | String.format("删除%s数据", FUNCTION_NAME), "用户Guids")); | ||
193 | } | ||
194 | LambdaUpdateWrapper<MfTdsUserVerifiable> updateWrapper = Wrappers.lambdaUpdate(); | ||
195 | updateWrapper.in(MfTdsUserVerifiable::getUserGuid,userGuids); | ||
196 | mfTdsUserVerifiableService.remove(updateWrapper); | ||
197 | } | ||
198 | |||
199 | @Override | ||
200 | public TdsUserVerifiableRSVO getTdsUserVerifiableByUserGuid(String userGuid) { | ||
201 | if (StringUtils.isBlank(userGuid)) { | ||
202 | // W00012 = {0}:参数[{1}]不能为空! | ||
203 | throw new CsbrSystemException(SystemError.DATA_INPUT_ERROR, messageSourceUtil.getMessage("W00010", | ||
204 | String.format("获取%s详情数据", FUNCTION_NAME), "用户Guid")); | ||
205 | } | ||
206 | LambdaQueryWrapper<MfTdsUserVerifiable> queryWrapper = Wrappers.lambdaQuery(); | ||
207 | queryWrapper.eq(MfTdsUserVerifiable::getUserGuid,userGuid); | ||
208 | List<MfTdsUserVerifiable> list = mfTdsUserVerifiableService.list(queryWrapper); | ||
209 | if(ObjectUtils.isEmpty(list)){ | ||
210 | return null; | ||
211 | } | ||
212 | return convertToVO(list.get(0)); | ||
213 | } | ||
214 | |||
215 | /** | ||
216 | * 个人用户可验信息新新增前置处理 | ||
217 | * @author xup | ||
218 | * @date 2025-08-14 13:21 | ||
219 | * @param rqVO | ||
220 | * @return void | ||
221 | */ | ||
222 | private void beforeSave(TdsUserVerifiableRQVO rqVO) { | ||
223 | //region 1.输入基础验证 | ||
224 | //endregion | ||
225 | |||
226 | //region 2.数据验证特殊处理 | ||
227 | //region 2.1.业务合规性验证 | ||
228 | //endregion 2.1.业务合规性验证 | ||
229 | |||
230 | //region 2.2.业务数据验证 | ||
231 | //endregion 2.2.业务数据验证 | ||
232 | |||
233 | //endregion 2.数据验证特殊处理 | ||
234 | |||
235 | //region 3.数据转换处理 | ||
236 | |||
237 | //region 3.1.数据过程转换 | ||
238 | //endregion 3.1.数据过程转换 | ||
239 | |||
240 | //endregion 3.数据转换处理 | ||
241 | |||
242 | //region 4.数据过滤与补充处理 | ||
243 | |||
244 | //endregion 4.数据过滤与补充处理 | ||
245 | |||
246 | //region 5.过程处理 | ||
247 | |||
248 | //region 5.1.计算逻辑处理 | ||
249 | //endregion 5.1.计算逻辑处理 | ||
250 | |||
251 | //region 5.2.业务逻辑处理 | ||
252 | //endregion 5.2.业务逻辑处理 | ||
253 | |||
254 | //endregion 5.过程处理 | ||
255 | } | ||
256 | |||
257 | /** | ||
258 | * 个人用户可验信息新增后置处理 | ||
259 | * @author xup | ||
260 | * @date 2025-08-14 13:21 | ||
261 | * @param rqVO | ||
262 | * @return void | ||
263 | */ | ||
264 | private void afterSave(TdsUserVerifiableRQVO rqVO) { | ||
265 | //region 1.输出特殊转换 | ||
266 | |||
267 | //region 1.1.输出过滤与补充处理 | ||
268 | //endregion 1.1.输出过滤与补充处理 | ||
269 | |||
270 | //endregion 1.输出特殊转换 | ||
271 | } | ||
272 | |||
273 | /** | ||
274 | * 个人用户可验信息修改前置校验、处理 | ||
275 | * @author xup | ||
276 | * @date 2025-08-14 13:21 | ||
277 | * @param rqVO | ||
278 | * @return void | ||
279 | */ | ||
280 | private void beforeUpdate(TdsUserVerifiableRQVO rqVO) { | ||
281 | //region 1.输入基础验证 | ||
282 | if (StringUtils.isBlank(rqVO.getGuid())) { | ||
283 | // W00012 = {0}:参数[{1}]不能为空! | ||
284 | throw new CsbrSystemException(SystemError.DATA_INPUT_ERROR, messageSourceUtil.getMessage("W00010", String.format("修改%s数据",FUNCTION_NAME), "数据唯一标识")); | ||
285 | } | ||
286 | //endregion | ||
287 | |||
288 | //region 2.数据验证特殊处理 | ||
289 | //region 2.1.业务合规性验证 | ||
290 | //endregion 2.1.业务合规性验证 | ||
291 | |||
292 | //region 2.2.业务数据验证 | ||
293 | if (!mfTdsUserVerifiableService.isExistsData(Collections.singletonList(rqVO.getGuid()), MfTdsUserVerifiable.class)) { | ||
294 | throw new CsbrSystemException(SystemError.DATA_DEL_ERROR, messageSourceUtil.notExistsToUpdateMessage(FUNCTION_NAME)); | ||
295 | } | ||
296 | //endregion 2.2.业务数据验证 | ||
297 | |||
298 | //endregion 2.数据验证特殊处理 | ||
299 | |||
300 | //region 3.数据转换处理 | ||
301 | |||
302 | //region 3.1.数据过程转换 | ||
303 | //endregion 3.1.数据过程转换 | ||
304 | |||
305 | //endregion 3.数据转换处理 | ||
306 | |||
307 | //region 4.数据过滤与补充处理 | ||
308 | //endregion 4.数据过滤与补充处理 | ||
309 | |||
310 | //region 5.过程处理 | ||
311 | |||
312 | //region 5.1.计算逻辑处理 | ||
313 | //endregion 5.1.计算逻辑处理 | ||
314 | |||
315 | //region 5.2.业务逻辑处理 | ||
316 | //endregion 5.2.业务逻辑处理 | ||
317 | |||
318 | //endregion 5.过程处理 | ||
319 | } | ||
320 | |||
321 | /** | ||
322 | * 个人用户可验信息修改后置处理 | ||
323 | * @author xup | ||
324 | * @date 2025-08-14 13:21 | ||
325 | * @param rqVO | ||
326 | * @param entity | ||
327 | * @return void | ||
328 | */ | ||
329 | protected void afterUpdate(TdsUserVerifiableRQVO rqVO, MfTdsUserVerifiable entity) { | ||
330 | //region 1.输出特殊转换 | ||
331 | |||
332 | //region 1.1.输出过滤与补充处理 | ||
333 | //endregion 1.1.输出过滤与补充处理 | ||
334 | |||
335 | //endregion 1.输出特殊转换 | ||
336 | } | ||
337 | |||
338 | |||
339 | /** | ||
340 | * 个人用户可验信息删除前置处理 | ||
341 | * @author xup | ||
342 | * @date 2025-08-14 13:21 | ||
343 | * @param entity | ||
344 | * @return void | ||
345 | */ | ||
346 | private void beforeRemove(MfTdsUserVerifiable entity) { | ||
347 | if (entity == null) { | ||
348 | throw new CsbrSystemException(SystemError.DATA_DEL_ERROR, messageSourceUtil.notExistsToDelMessage(FUNCTION_NAME)); | ||
349 | } | ||
350 | } | ||
351 | |||
352 | /** | ||
353 | * 个人用户可验信息删除后置处理 | ||
354 | * @author xup | ||
355 | * @date 2025-08-14 13:21 | ||
356 | * @param entity | ||
357 | * @return void | ||
358 | */ | ||
359 | private void afterRemove(MfTdsUserVerifiable entity) { | ||
360 | |||
361 | } | ||
362 | |||
363 | /** | ||
364 | * 个人用户可验信息查询方法前置验证、处理 | ||
365 | * @author xup | ||
366 | * @date 2025-08-14 13:21 | ||
367 | * @param rqQueryVO | ||
368 | * @return void | ||
369 | */ | ||
370 | private void beforeQuery(TdsUserVerifiableQueryVO rqQueryVO) { | ||
371 | |||
372 | } | ||
373 | |||
374 | /** | ||
375 | * 个人用户可验信息查询方法后置数据转换、处理 | ||
376 | * @author xup | ||
377 | * @date 2025-08-14 13:21 | ||
378 | * @param pageList 数据库查询数据 | ||
379 | * @param rsPageList 返回的最终数据 | ||
380 | * @return void | ||
381 | */ | ||
382 | private void afterQuery(PageListVO<MfTdsUserVerifiable> pageList, PageListVO<TdsUserVerifiableRSVO> rsPageList) { | ||
383 | if (CollectionUtils.isNotEmpty(pageList.getRecords())) { | ||
384 | rsPageList.setRecords(convertToVO(pageList.getRecords())); | ||
385 | } | ||
386 | // 需要特殊处理数据时使用 | ||
387 | /*if(CollectionUtils.isNotEmpty(pageList.getRecords())){ | ||
388 | List<TdsUserVerifiableRSVO> results = new ArrayList<>(); | ||
389 | for (MfTdsUserVerifiable item : pageList.getRecords()){ | ||
390 | TdsUserVerifiableRSVO vo = convertToVO(item); | ||
391 | results.add(vo); | ||
392 | } | ||
393 | rsPageList.setRecords(results); | ||
394 | }*/ | ||
395 | } | ||
396 | |||
397 | //region 辅助操作 | ||
398 | |||
399 | /** | ||
400 | * 个人用户可验信息实体数据转换为视图对象数据(多个) | ||
401 | * @author xup | ||
402 | * @date 2025-08-14 13:21 | ||
403 | * @param entityList 实体数据列表 | ||
404 | * @return java.util.List<com.csbr.qingcloud.portal.domain.vo.TdsUserVerifiableRSVO> 视图对象列表 | ||
405 | */ | ||
406 | private List<TdsUserVerifiableRSVO> convertToVO(List<MfTdsUserVerifiable> entityList) { | ||
407 | if (CollectionUtils.isEmpty(entityList)) { | ||
408 | // W00012 = {0}:参数[{1}]不能为空! | ||
409 | throw new CsbrSystemException(SystemError.DATA_INPUT_ERROR, messageSourceUtil.getMessage("W00012", | ||
410 | "实体数据转换为视图对象实体数据", "实体数据")); | ||
411 | } | ||
412 | List<TdsUserVerifiableRSVO> voList = new ArrayList<>(entityList.size()); | ||
413 | for (MfTdsUserVerifiable item : entityList) { | ||
414 | TdsUserVerifiableRSVO vo = convertToVO(item); | ||
415 | voList.add(vo); | ||
416 | } | ||
417 | return voList; | ||
418 | } | ||
419 | |||
420 | /** | ||
421 | * 个人用户可验信息实体数据转换为视图对象数据 | ||
422 | * @author xup | ||
423 | * @date 2025-08-14 13:21 | ||
424 | * @param entity | ||
425 | * @return com.csbr.qingcloud.portal.domain.vo.TdsUserVerifiableRSVO | ||
426 | */ | ||
427 | private TdsUserVerifiableRSVO convertToVO(MfTdsUserVerifiable entity) { | ||
428 | TdsUserVerifiableRSVO vo = csbrBeanUtil.convert(entity, TdsUserVerifiableRSVO.class); | ||
429 | return vo; | ||
430 | } | ||
431 | |||
432 | /** | ||
433 | * 个人用户可验信息新增、修改和其他情况的参数转换为实体 | ||
434 | * @author xup | ||
435 | * @date 2025-08-14 13:21 | ||
436 | * @param vo | ||
437 | * @return com.csbr.qingcloud.portal.mybatis.entity.MfTdsUserVerifiable | ||
438 | */ | ||
439 | private MfTdsUserVerifiable convertToEntity(TdsUserVerifiableRQVO vo) { | ||
440 | MfTdsUserVerifiable entity = csbrBeanUtil.convert(vo, MfTdsUserVerifiable.class); | ||
441 | // 新增时数据默认guid赋值,转换后该guid可能别使用 | ||
442 | if (StringUtils.isBlank(vo.getGuid())) { | ||
443 | entity.setGuid(CommonUtil.newGuid()); | ||
444 | } | ||
445 | return entity; | ||
446 | } | ||
447 | |||
448 | //endregion | ||
449 | |||
450 | } |
... | @@ -4,6 +4,8 @@ import lombok.Data; | ... | @@ -4,6 +4,8 @@ import lombok.Data; |
4 | import org.springframework.boot.context.properties.ConfigurationProperties; | 4 | import org.springframework.boot.context.properties.ConfigurationProperties; |
5 | import org.springframework.stereotype.Component; | 5 | import org.springframework.stereotype.Component; |
6 | 6 | ||
7 | import java.util.Map; | ||
8 | |||
7 | /** | 9 | /** |
8 | * @program: daop-projects | 10 | * @program: daop-projects |
9 | * @description: | 11 | * @description: |
... | @@ -25,4 +27,9 @@ public class ZQConfig { | ... | @@ -25,4 +27,9 @@ public class ZQConfig { |
25 | 27 | ||
26 | private Boolean isMain = false; | 28 | private Boolean isMain = false; |
27 | 29 | ||
30 | /** | ||
31 | * 可信空间区域节点数据同步URL地址 | ||
32 | */ | ||
33 | private String tdsRegionalNodeUrl; | ||
34 | |||
28 | } | 35 | } |
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
-
Please register or sign in to post a comment