【DAOP-1.0】企业认证
【功能点】新增接口
Showing
10 changed files
with
1329 additions
and
0 deletions
1 | package com.csbr.qingcloud.portal.controller; | ||
2 | |||
3 | import com.csbr.cloud.common.response.CommonRes; | ||
4 | import csbr.cloud.entity.annotation.SystemLog; | ||
5 | import csbr.cloud.entity.domain.base.vo.PageListVO; | ||
6 | import com.csbr.cloud.workflow.domain.dto.callback.BizCallbackDTO; | ||
7 | import com.csbr.qingcloud.portal.domain.vo.EnterpriseQueryVO; | ||
8 | import com.csbr.qingcloud.portal.domain.vo.EnterpriseRQVO; | ||
9 | import com.csbr.qingcloud.portal.domain.vo.EnterpriseRSVO; | ||
10 | import com.csbr.qingcloud.portal.service.EnterpriseService; | ||
11 | import io.swagger.v3.oas.annotations.Operation; | ||
12 | import io.swagger.v3.oas.annotations.Parameter; | ||
13 | import io.swagger.v3.oas.annotations.tags.Tag; | ||
14 | import jakarta.annotation.Resource; | ||
15 | import jakarta.validation.Valid; | ||
16 | import org.springframework.web.bind.annotation.*; | ||
17 | |||
18 | import java.util.List; | ||
19 | |||
20 | /** | ||
21 | * @program: D:/git/ms-data-circulation-portal-service | ||
22 | * @description: 企业信息-控制器 | ||
23 | * @author: xcq | ||
24 | * @create: 2024-12-26 16:18 | ||
25 | **/ | ||
26 | @RestController | ||
27 | @RequestMapping("/enterprise") | ||
28 | @Tag(name = "企业信息-控制器") | ||
29 | public class EnterpriseController { | ||
30 | |||
31 | @Resource | ||
32 | private EnterpriseService enterpriseService; | ||
33 | |||
34 | //region 基本操作 | ||
35 | |||
36 | @PostMapping("/save") | ||
37 | @SystemLog(value = "企业信息-新增") | ||
38 | @Operation(summary = "企业信息-新增") | ||
39 | public CommonRes<Boolean> saveEnterprise(@RequestBody @Valid EnterpriseRQVO vo) { | ||
40 | enterpriseService.saveEnterprise(vo); | ||
41 | return CommonRes.success(true); | ||
42 | } | ||
43 | |||
44 | @PutMapping("/update") | ||
45 | @SystemLog(value = "企业信息-修改") | ||
46 | @Operation(summary = "企业信息-修改") | ||
47 | public CommonRes<Boolean> updateEnterprise(@RequestBody @Valid EnterpriseRQVO vo) { | ||
48 | enterpriseService.updateEnterprise(vo); | ||
49 | return CommonRes.success(true); | ||
50 | } | ||
51 | |||
52 | @DeleteMapping("/delete") | ||
53 | @SystemLog(value = "企业信息-批量删除") | ||
54 | @Operation(summary = "企业信息-批量删除") | ||
55 | public CommonRes<Boolean> removeByGuids(@RequestBody List<String> guids) { | ||
56 | enterpriseService.removeByGuids(guids); | ||
57 | return CommonRes.success(true); | ||
58 | } | ||
59 | |||
60 | @PostMapping("/page-list") | ||
61 | @SystemLog(value = "企业信息-分页") | ||
62 | @Operation(summary = "企业信息-分页") | ||
63 | public CommonRes<PageListVO<EnterpriseRSVO>> pageList(@RequestBody @Valid EnterpriseQueryVO queryVO) { | ||
64 | PageListVO<EnterpriseRSVO> pageVO = enterpriseService.pageList(queryVO); | ||
65 | return CommonRes.success(pageVO); | ||
66 | } | ||
67 | |||
68 | @GetMapping("/detail") | ||
69 | @SystemLog(value = "企业信息-详情") | ||
70 | @Operation( | ||
71 | summary = "企业信息-详情", | ||
72 | parameters = { | ||
73 | @Parameter(name = "guid", description = "企业信息唯一标识", required = true)} | ||
74 | ) | ||
75 | public CommonRes<EnterpriseRSVO> getEnterpriseDetail(@RequestParam String guid) { | ||
76 | EnterpriseRSVO vo = enterpriseService.getEnterpriseDetail(guid); | ||
77 | return CommonRes.success(vo); | ||
78 | } | ||
79 | |||
80 | @PostMapping("/flow-call-back") | ||
81 | @SystemLog(value = "企业信息-流程结束后进行业务回调") | ||
82 | @Operation(summary = "企业信息-流程结束后进行业务回调", hidden = true) | ||
83 | public CommonRes<Boolean> flowCallBack(@RequestBody @Valid BizCallbackDTO dto) { | ||
84 | enterpriseService.flowCallBack(dto); | ||
85 | return CommonRes.success(true); | ||
86 | } | ||
87 | |||
88 | //endregion | ||
89 | |||
90 | } |
1 | package com.csbr.qingcloud.portal.domain.vo; | ||
2 | |||
3 | import com.csbr.cloud.workflow.domain.dto.appove.FlowBizGuidQueryDTO; | ||
4 | import io.swagger.v3.oas.annotations.media.Schema; | ||
5 | import lombok.EqualsAndHashCode; | ||
6 | import lombok.Data; | ||
7 | import java.math.BigDecimal; | ||
8 | import java.util.Date; | ||
9 | import java.util.List; | ||
10 | |||
11 | /** | ||
12 | * @program: D:/git/ms-data-circulation-portal-service | ||
13 | * @description: 企业信息查询参数 | ||
14 | * @author: xcq | ||
15 | * @create: 2024-12-26 16:18 | ||
16 | **/ | ||
17 | @EqualsAndHashCode(callSuper = true) | ||
18 | @Data | ||
19 | @Schema(title = "企业信息查询参数") | ||
20 | public class EnterpriseQueryVO extends FlowBizGuidQueryDTO { | ||
21 | |||
22 | /** | ||
23 | * 业务审批状态【N 草稿中,A 审批中,Y 已通过,R 驳回,C 已撤销,D 已废弃】 | ||
24 | */ | ||
25 | @Schema(description = "业务审批状态【N 草稿中,A 审批中,Y 已通过,R 驳回,C 已撤销,D 已废弃】") | ||
26 | private String bizApproveState; | ||
27 | |||
28 | /******** 自定义扩展 *****/ | ||
29 | |||
30 | /** | ||
31 | * 数据唯一标识【List集合】 | ||
32 | */ | ||
33 | @Schema(description = "数据唯一标识", hidden = true) | ||
34 | private List<String> guidList; | ||
35 | |||
36 | /** | ||
37 | * 是否调用查询的判断 | ||
38 | */ | ||
39 | @Schema(description = "是否调用查询的判断", hidden = true) | ||
40 | private Boolean isNeedQuery; | ||
41 | |||
42 | } |
1 | package com.csbr.qingcloud.portal.domain.vo; | ||
2 | |||
3 | import com.csbr.cloud.workflow.domain.vo.appove.FlowRQBaseVO; | ||
4 | import io.swagger.v3.oas.annotations.media.Schema; | ||
5 | import com.fasterxml.jackson.annotation.JsonFormat; | ||
6 | import lombok.Data; | ||
7 | import java.math.BigDecimal; | ||
8 | import java.util.Date; | ||
9 | |||
10 | /** | ||
11 | * @program: D:/git/ms-data-circulation-portal-service | ||
12 | * @description: 企业信息新增、修改参数 | ||
13 | * @author: xcq | ||
14 | * @create: 2024-12-26 16:18 | ||
15 | **/ | ||
16 | @Data | ||
17 | @Schema(title = "企业信息新增、修改参数") | ||
18 | public class EnterpriseRQVO extends FlowRQBaseVO { | ||
19 | |||
20 | /** | ||
21 | * 公司名称 | ||
22 | */ | ||
23 | @Schema(description = "公司名称") | ||
24 | private String tenantName; | ||
25 | |||
26 | /** | ||
27 | * 统一社会信用代码 | ||
28 | */ | ||
29 | @Schema(description = "统一社会信用代码") | ||
30 | private String socialCreditCode; | ||
31 | |||
32 | /** | ||
33 | * 企业类型【选择平台字典【公司类型】的选项】 | ||
34 | */ | ||
35 | @Schema(description = "企业类型【选择平台字典【公司类型】的选项】") | ||
36 | private String tenantType; | ||
37 | |||
38 | /** | ||
39 | * 注册日期 | ||
40 | */ | ||
41 | @Schema(description = "注册日期") | ||
42 | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") | ||
43 | private Date registrationDate; | ||
44 | |||
45 | /** | ||
46 | * 注册资本【(万元)】 | ||
47 | */ | ||
48 | @Schema(description = "注册资本【(万元)】") | ||
49 | private BigDecimal registeredCapital; | ||
50 | |||
51 | /** | ||
52 | * 税号 | ||
53 | */ | ||
54 | @Schema(description = "税号") | ||
55 | private String bankTaxNo; | ||
56 | |||
57 | /** | ||
58 | * 省 | ||
59 | */ | ||
60 | @Schema(description = "省") | ||
61 | private String province; | ||
62 | |||
63 | /** | ||
64 | * 市 | ||
65 | */ | ||
66 | @Schema(description = "市") | ||
67 | private String city; | ||
68 | |||
69 | /** | ||
70 | * 区 | ||
71 | */ | ||
72 | @Schema(description = "区") | ||
73 | private String district; | ||
74 | |||
75 | /** | ||
76 | * 营业期限【1 长期有效;2 自定义】 | ||
77 | */ | ||
78 | @Schema(description = "营业期限【1 长期有效;2 自定义】") | ||
79 | private String businessLicenseTerm; | ||
80 | |||
81 | /** | ||
82 | * 营业开始日期 | ||
83 | */ | ||
84 | @Schema(description = "营业开始日期") | ||
85 | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") | ||
86 | private Date businessLicenseStartDate; | ||
87 | |||
88 | /** | ||
89 | * 营业结束日期 | ||
90 | */ | ||
91 | @Schema(description = "营业结束日期") | ||
92 | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") | ||
93 | private Date businessLicenseEndDate; | ||
94 | |||
95 | /** | ||
96 | * 营业执照 | ||
97 | */ | ||
98 | @Schema(description = "营业执照") | ||
99 | private String businessLicenseJson; | ||
100 | |||
101 | /** | ||
102 | * 营业执照经营范围 | ||
103 | */ | ||
104 | @Schema(description = "营业执照经营范围") | ||
105 | private String businessLicenseScope; | ||
106 | |||
107 | /** | ||
108 | * 公司法人 | ||
109 | */ | ||
110 | @Schema(description = "公司法人") | ||
111 | private String juridicalPerson; | ||
112 | |||
113 | /** | ||
114 | * 法人证件类型 | ||
115 | */ | ||
116 | @Schema(description = "法人证件类型") | ||
117 | private String juridicalPersonIdType; | ||
118 | |||
119 | /** | ||
120 | * 法人证件号 | ||
121 | */ | ||
122 | @Schema(description = "法人证件号") | ||
123 | private String juridicalPersonId; | ||
124 | |||
125 | /** | ||
126 | * 法人证件照 | ||
127 | */ | ||
128 | @Schema(description = "法人证件照") | ||
129 | private String juridicalPersonIdPhotoJson; | ||
130 | |||
131 | /** | ||
132 | * 登录账号 | ||
133 | */ | ||
134 | @Schema(description = "登录账号") | ||
135 | private String logonUser; | ||
136 | |||
137 | /** | ||
138 | * 联系人 | ||
139 | */ | ||
140 | @Schema(description = "联系人") | ||
141 | private String contacts; | ||
142 | |||
143 | /** | ||
144 | * 联系人电话 | ||
145 | */ | ||
146 | @Schema(description = "联系人电话") | ||
147 | private String contactTel; | ||
148 | |||
149 | /** | ||
150 | * 管理员证件号 | ||
151 | */ | ||
152 | @Schema(description = "管理员证件号") | ||
153 | private String managerPersonId; | ||
154 | |||
155 | /** | ||
156 | * 管理员证件照 | ||
157 | */ | ||
158 | @Schema(description = "管理员证件照") | ||
159 | private String managerPersonIdPhotoJson; | ||
160 | |||
161 | /** | ||
162 | * 授权委托书 | ||
163 | */ | ||
164 | @Schema(description = "授权委托书") | ||
165 | private String authorizationLetter; | ||
166 | |||
167 | /** | ||
168 | * 业务审批状态【N 草稿中,A 审批中,Y 已通过,R 驳回,C 已撤销,D 已废弃; 默认 N】 | ||
169 | */ | ||
170 | @Schema(description = "业务审批状态【N 草稿中,A 审批中,Y 已通过,R 驳回,C 已撤销,D 已废弃; 默认 N】") | ||
171 | private String bizApproveState; | ||
172 | |||
173 | /******** 库表存储属性 需处理 *****/ | ||
174 | |||
175 | /******** 自定义扩展 *****/ | ||
176 | |||
177 | /******** 子对象 *****/ | ||
178 | |||
179 | } |
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 com.csbr.cloud.workflow.domain.vo.appove.BizApproveVO; | ||
7 | import java.math.BigDecimal; | ||
8 | import java.util.Date; | ||
9 | |||
10 | /** | ||
11 | * @program: D:/git/ms-data-circulation-portal-service | ||
12 | * @description: 企业信息返回参数 | ||
13 | * @author: xcq | ||
14 | * @create: 2024-12-26 16:18 | ||
15 | **/ | ||
16 | @Data | ||
17 | @Schema(title = "企业信息返回参数") | ||
18 | public class EnterpriseRSVO { | ||
19 | |||
20 | /** | ||
21 | * 系统唯一标识 | ||
22 | */ | ||
23 | @Schema(description = "系统唯一标识") | ||
24 | private String guid; | ||
25 | |||
26 | /** | ||
27 | * 公司名称 | ||
28 | */ | ||
29 | @Schema(description = "公司名称") | ||
30 | private String tenantName; | ||
31 | |||
32 | /** | ||
33 | * 统一社会信用代码 | ||
34 | */ | ||
35 | @Schema(description = "统一社会信用代码") | ||
36 | private String socialCreditCode; | ||
37 | |||
38 | /** | ||
39 | * 企业类型【选择平台字典【公司类型】的选项】 | ||
40 | */ | ||
41 | @Schema(description = "企业类型【选择平台字典【公司类型】的选项】") | ||
42 | private String tenantType; | ||
43 | |||
44 | /** | ||
45 | * 注册日期 | ||
46 | */ | ||
47 | @Schema(description = "注册日期") | ||
48 | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") | ||
49 | private Date registrationDate; | ||
50 | |||
51 | /** | ||
52 | * 注册资本【(万元)】 | ||
53 | */ | ||
54 | @Schema(description = "注册资本【(万元)】") | ||
55 | private BigDecimal registeredCapital; | ||
56 | |||
57 | /** | ||
58 | * 税号 | ||
59 | */ | ||
60 | @Schema(description = "税号") | ||
61 | private String bankTaxNo; | ||
62 | |||
63 | /** | ||
64 | * 省 | ||
65 | */ | ||
66 | @Schema(description = "省") | ||
67 | private String province; | ||
68 | |||
69 | /** | ||
70 | * 市 | ||
71 | */ | ||
72 | @Schema(description = "市") | ||
73 | private String city; | ||
74 | |||
75 | /** | ||
76 | * 区 | ||
77 | */ | ||
78 | @Schema(description = "区") | ||
79 | private String district; | ||
80 | |||
81 | /** | ||
82 | * 营业期限【1 长期有效;2 自定义】 | ||
83 | */ | ||
84 | @Schema(description = "营业期限【1 长期有效;2 自定义】") | ||
85 | private String businessLicenseTerm; | ||
86 | |||
87 | /** | ||
88 | * 营业开始日期 | ||
89 | */ | ||
90 | @Schema(description = "营业开始日期") | ||
91 | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") | ||
92 | private Date businessLicenseStartDate; | ||
93 | |||
94 | /** | ||
95 | * 营业结束日期 | ||
96 | */ | ||
97 | @Schema(description = "营业结束日期") | ||
98 | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") | ||
99 | private Date businessLicenseEndDate; | ||
100 | |||
101 | /** | ||
102 | * 营业执照 | ||
103 | */ | ||
104 | @Schema(description = "营业执照") | ||
105 | private String businessLicenseJson; | ||
106 | |||
107 | /** | ||
108 | * 营业执照经营范围 | ||
109 | */ | ||
110 | @Schema(description = "营业执照经营范围") | ||
111 | private String businessLicenseScope; | ||
112 | |||
113 | /** | ||
114 | * 公司法人 | ||
115 | */ | ||
116 | @Schema(description = "公司法人") | ||
117 | private String juridicalPerson; | ||
118 | |||
119 | /** | ||
120 | * 法人证件类型 | ||
121 | */ | ||
122 | @Schema(description = "法人证件类型") | ||
123 | private String juridicalPersonIdType; | ||
124 | |||
125 | /** | ||
126 | * 法人证件号 | ||
127 | */ | ||
128 | @Schema(description = "法人证件号") | ||
129 | private String juridicalPersonId; | ||
130 | |||
131 | /** | ||
132 | * 法人证件照 | ||
133 | */ | ||
134 | @Schema(description = "法人证件照") | ||
135 | private String juridicalPersonIdPhotoJson; | ||
136 | |||
137 | /** | ||
138 | * 登录账号 | ||
139 | */ | ||
140 | @Schema(description = "登录账号") | ||
141 | private String logonUser; | ||
142 | |||
143 | /** | ||
144 | * 联系人 | ||
145 | */ | ||
146 | @Schema(description = "联系人") | ||
147 | private String contacts; | ||
148 | |||
149 | /** | ||
150 | * 联系人电话 | ||
151 | */ | ||
152 | @Schema(description = "联系人电话") | ||
153 | private String contactTel; | ||
154 | |||
155 | /** | ||
156 | * 管理员证件号 | ||
157 | */ | ||
158 | @Schema(description = "管理员证件号") | ||
159 | private String managerPersonId; | ||
160 | |||
161 | /** | ||
162 | * 管理员证件照 | ||
163 | */ | ||
164 | @Schema(description = "管理员证件照") | ||
165 | private String managerPersonIdPhotoJson; | ||
166 | |||
167 | /** | ||
168 | * 授权委托书 | ||
169 | */ | ||
170 | @Schema(description = "授权委托书") | ||
171 | private String authorizationLetter; | ||
172 | |||
173 | /** | ||
174 | * 业务审批状态【N 草稿中,A 审批中,Y 已通过,R 驳回,C 已撤销,D 已废弃; 默认 N】 | ||
175 | */ | ||
176 | @Schema(description = "业务审批状态【N 草稿中,A 审批中,Y 已通过,R 驳回,C 已撤销,D 已废弃; 默认 N】") | ||
177 | private String bizApproveState; | ||
178 | |||
179 | /******** 库表存储属性 需处理 *****/ | ||
180 | |||
181 | /******** 自定义扩展 *****/ | ||
182 | |||
183 | /** | ||
184 | * 审批信息 | ||
185 | */ | ||
186 | @Schema(description = "审批信息") | ||
187 | private BizApproveVO approveVO; | ||
188 | |||
189 | /******** 子对象 *****/ | ||
190 | |||
191 | } |
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.math.BigDecimal; | ||
11 | import java.util.Date; | ||
12 | |||
13 | /** | ||
14 | * @program: D:/git/ms-data-circulation-portal-service | ||
15 | * @description: 企业信息实体 | ||
16 | * @author: xcq | ||
17 | * @create: 2024-12-26 16:18 | ||
18 | **/ | ||
19 | @Data | ||
20 | @EqualsAndHashCode(callSuper = true) | ||
21 | @Accessors(chain = true) | ||
22 | @Name("企业信息") | ||
23 | public class MfEnterprise extends BaseDO { | ||
24 | |||
25 | /** | ||
26 | * 公司名称 | ||
27 | */ | ||
28 | @Name("公司名称") | ||
29 | private String tenantName; | ||
30 | |||
31 | /** | ||
32 | * 统一社会信用代码 | ||
33 | */ | ||
34 | @Name("统一社会信用代码") | ||
35 | private String socialCreditCode; | ||
36 | |||
37 | /** | ||
38 | * 企业类型【选择平台字典【公司类型】的选项】 | ||
39 | */ | ||
40 | @Name("企业类型【选择平台字典【公司类型】的选项】") | ||
41 | private String tenantType; | ||
42 | |||
43 | /** | ||
44 | * 注册日期 | ||
45 | */ | ||
46 | @Name("注册日期") | ||
47 | private Date registrationDate; | ||
48 | |||
49 | /** | ||
50 | * 注册资本【(万元)】 | ||
51 | */ | ||
52 | @Name("注册资本【(万元)】") | ||
53 | private BigDecimal registeredCapital; | ||
54 | |||
55 | /** | ||
56 | * 税号 | ||
57 | */ | ||
58 | @Name("税号") | ||
59 | private String bankTaxNo; | ||
60 | |||
61 | /** | ||
62 | * 省 | ||
63 | */ | ||
64 | @Name("省") | ||
65 | private String province; | ||
66 | |||
67 | /** | ||
68 | * 市 | ||
69 | */ | ||
70 | @Name("市") | ||
71 | private String city; | ||
72 | |||
73 | /** | ||
74 | * 区 | ||
75 | */ | ||
76 | @Name("区") | ||
77 | private String district; | ||
78 | |||
79 | /** | ||
80 | * 营业期限【1 长期有效;2 自定义】 | ||
81 | */ | ||
82 | @Name("营业期限【1 长期有效;2 自定义】") | ||
83 | private String businessLicenseTerm; | ||
84 | |||
85 | /** | ||
86 | * 营业开始日期 | ||
87 | */ | ||
88 | @Name("营业开始日期") | ||
89 | private Date businessLicenseStartDate; | ||
90 | |||
91 | /** | ||
92 | * 营业结束日期 | ||
93 | */ | ||
94 | @Name("营业结束日期") | ||
95 | private Date businessLicenseEndDate; | ||
96 | |||
97 | /** | ||
98 | * 营业执照 | ||
99 | */ | ||
100 | @Name("营业执照") | ||
101 | @TableField(updateStrategy = FieldStrategy.ALWAYS) | ||
102 | private String businessLicenseJson; | ||
103 | |||
104 | /** | ||
105 | * 营业执照经营范围 | ||
106 | */ | ||
107 | @Name("营业执照经营范围") | ||
108 | private String businessLicenseScope; | ||
109 | |||
110 | /** | ||
111 | * 公司法人 | ||
112 | */ | ||
113 | @Name("公司法人") | ||
114 | private String juridicalPerson; | ||
115 | |||
116 | /** | ||
117 | * 法人证件类型 | ||
118 | */ | ||
119 | @Name("法人证件类型") | ||
120 | private String juridicalPersonIdType; | ||
121 | |||
122 | /** | ||
123 | * 法人证件号 | ||
124 | */ | ||
125 | @Name("法人证件号") | ||
126 | private String juridicalPersonId; | ||
127 | |||
128 | /** | ||
129 | * 法人证件照 | ||
130 | */ | ||
131 | @Name("法人证件照") | ||
132 | @TableField(updateStrategy = FieldStrategy.ALWAYS) | ||
133 | private String juridicalPersonIdPhotoJson; | ||
134 | |||
135 | /** | ||
136 | * 登录账号 | ||
137 | */ | ||
138 | @Name("登录账号") | ||
139 | private String logonUser; | ||
140 | |||
141 | /** | ||
142 | * 联系人 | ||
143 | */ | ||
144 | @Name("联系人") | ||
145 | private String contacts; | ||
146 | |||
147 | /** | ||
148 | * 联系人电话 | ||
149 | */ | ||
150 | @Name("联系人电话") | ||
151 | private String contactTel; | ||
152 | |||
153 | /** | ||
154 | * 管理员证件号 | ||
155 | */ | ||
156 | @Name("管理员证件号") | ||
157 | private String managerPersonId; | ||
158 | |||
159 | /** | ||
160 | * 管理员证件照 | ||
161 | */ | ||
162 | @Name("管理员证件照") | ||
163 | @TableField(updateStrategy = FieldStrategy.ALWAYS) | ||
164 | private String managerPersonIdPhotoJson; | ||
165 | |||
166 | /** | ||
167 | * 授权委托书 | ||
168 | */ | ||
169 | @Name("授权委托书") | ||
170 | private String authorizationLetter; | ||
171 | |||
172 | /** | ||
173 | * 业务审批状态【N 草稿中,A 审批中,Y 已通过,R 驳回,C 已撤销,D 已废弃; 默认 N】 | ||
174 | */ | ||
175 | @Name("业务审批状态【N 草稿中,A 审批中,Y 已通过,R 驳回,C 已撤销,D 已废弃; 默认 N】") | ||
176 | private String bizApproveState; | ||
177 | |||
178 | } |
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.MfEnterprise; | ||
6 | |||
7 | /** | ||
8 | * @program: D:/git/ms-data-circulation-portal-service | ||
9 | * @description: 企业信息 Mapper 接口 | ||
10 | * @author: xcq | ||
11 | * @create: 2024-12-26 16:18 | ||
12 | **/ | ||
13 | @Mapper | ||
14 | public interface MfEnterpriseMapper extends BaseMapper<MfEnterprise> { | ||
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.MfEnterprise; | ||
5 | |||
6 | /** | ||
7 | * @program: D:/git/ms-data-circulation-portal-service | ||
8 | * @description: 企业信息逻辑层接口 | ||
9 | * @author: xcq | ||
10 | * @create: 2024-12-26 16:18 | ||
11 | **/ | ||
12 | public interface MfEnterpriseService extends CsbrService<MfEnterprise> { | ||
13 | |||
14 | } |
src/main/java/com/csbr/qingcloud/portal/mybatis/service/impl/MfEnterpriseServiceImpl.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.MfEnterpriseMapper; | ||
5 | import com.csbr.qingcloud.portal.mybatis.entity.MfEnterprise; | ||
6 | import com.csbr.qingcloud.portal.mybatis.service.MfEnterpriseService; | ||
7 | import jakarta.annotation.Resource; | ||
8 | import org.springframework.stereotype.Service; | ||
9 | |||
10 | /** | ||
11 | * @program: D:/git/ms-data-circulation-portal-service | ||
12 | * @description: 企业信息逻辑层接口实现 | ||
13 | * @author: xcq | ||
14 | * @create: 2024-12-26 16:18 | ||
15 | **/ | ||
16 | @Service | ||
17 | public class MfEnterpriseServiceImpl extends CsbrServiceImpl<MfEnterpriseMapper, MfEnterprise> implements MfEnterpriseService { | ||
18 | |||
19 | @Resource | ||
20 | private MfEnterpriseMapper mfEnterpriseMapper; | ||
21 | |||
22 | } |
1 | package com.csbr.qingcloud.portal.service; | ||
2 | |||
3 | import csbr.cloud.entity.domain.base.vo.PageListVO; | ||
4 | import com.csbr.cloud.workflow.domain.dto.callback.BizCallbackDTO; | ||
5 | import com.csbr.cloud.workflow.domain.vo.appove.FlowRQBaseVO; | ||
6 | import com.csbr.qingcloud.portal.domain.vo.EnterpriseQueryVO; | ||
7 | import com.csbr.qingcloud.portal.domain.vo.EnterpriseRSVO; | ||
8 | |||
9 | import java.util.List; | ||
10 | |||
11 | /** | ||
12 | * @program: D:/git/ms-data-circulation-portal-service | ||
13 | * @description: 企业信息业务逻辑接口 | ||
14 | * @author: xcq | ||
15 | * @create: 2024-12-26 16:18 | ||
16 | **/ | ||
17 | public interface EnterpriseService { | ||
18 | |||
19 | /** | ||
20 | * 企业信息分页查询 | ||
21 | * @author xcq | ||
22 | * @date 2024-12-26 16:18 | ||
23 | * @param queryVO | ||
24 | * @return com.csbr.cloud.mybatis.entity.PageListVO<com.csbr.qingcloud.portal.domain.vo.EnterpriseRSVO> | ||
25 | */ | ||
26 | PageListVO<EnterpriseRSVO> pageList(EnterpriseQueryVO queryVO); | ||
27 | |||
28 | /** | ||
29 | * 企业信息获取详情数据 | ||
30 | * @author xcq | ||
31 | * @date 2024-12-26 16:18 | ||
32 | * @param guid | ||
33 | * @return com.csbr.qingcloud.portal.domain.vo.EnterpriseRSVO | ||
34 | */ | ||
35 | EnterpriseRSVO getEnterpriseDetail(String guid); | ||
36 | |||
37 | /** | ||
38 | * 企业信息数据新增 | ||
39 | * @author xcq | ||
40 | * @date 2024-12-26 16:18 | ||
41 | * @param flowBaseVO | ||
42 | * @return void | ||
43 | */ | ||
44 | void saveEnterprise(FlowRQBaseVO flowBaseVO); | ||
45 | |||
46 | /** | ||
47 | * 企业信息数据修改 | ||
48 | * @author xcq | ||
49 | * @date 2024-12-26 16:18 | ||
50 | * @param flowBaseVO | ||
51 | * @return void | ||
52 | */ | ||
53 | void updateEnterprise(FlowRQBaseVO flowBaseVO); | ||
54 | |||
55 | /** | ||
56 | * 企业信息数据删除、并有相关的处理操作 | ||
57 | * @author xcq | ||
58 | * @date 2024-12-26 16:18 | ||
59 | * @param guids | ||
60 | * @return void | ||
61 | */ | ||
62 | void removeByGuids(List<String> guids); | ||
63 | |||
64 | /** | ||
65 | * 流程结束后进行业务回调 | ||
66 | * @author xcq | ||
67 | * @date 2024-12-26 16:18 | ||
68 | * @param dto | ||
69 | * @return void | ||
70 | */ | ||
71 | void flowCallBack(BizCallbackDTO dto); | ||
72 | |||
73 | } |
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.csbr.cloud.common.enums.SystemError; | ||
6 | import com.csbr.cloud.common.enums.WorkFlowBizEnum; | ||
7 | import csbr.cloud.entity.enums.ApprovalStateEnum; | ||
8 | import com.csbr.cloud.common.exception.CsbrSystemException; | ||
9 | import com.csbr.cloud.common.util.CommonUtil; | ||
10 | import com.csbr.cloud.common.util.CsbrBeanUtil; | ||
11 | import com.csbr.cloud.workflow.util.ApprovalFlowUtil; | ||
12 | import com.csbr.cloud.workflow.util.FlowAbstractImpl; | ||
13 | import com.csbr.cloud.common.util.MessageSourceUtil; | ||
14 | import csbr.cloud.entity.domain.base.vo.PageListVO; | ||
15 | import com.csbr.cloud.workflow.domain.vo.appove.FlowRQBaseVO; | ||
16 | import com.csbr.cloud.workflow.domain.dto.appove.AddApprovalDTO; | ||
17 | import com.csbr.cloud.workflow.domain.dto.callback.BizCallbackDTO; | ||
18 | import com.csbr.qingcloud.portal.domain.vo.EnterpriseQueryVO; | ||
19 | import com.csbr.qingcloud.portal.domain.vo.EnterpriseRQVO; | ||
20 | import com.csbr.qingcloud.portal.domain.vo.EnterpriseRSVO; | ||
21 | import com.csbr.qingcloud.portal.mybatis.entity.MfEnterprise; | ||
22 | import com.csbr.qingcloud.portal.mybatis.service.MfEnterpriseService; | ||
23 | import com.csbr.qingcloud.portal.service.EnterpriseService; | ||
24 | import jakarta.annotation.Resource; | ||
25 | import lombok.extern.slf4j.Slf4j; | ||
26 | import org.apache.commons.collections.CollectionUtils; | ||
27 | import org.apache.commons.lang3.StringUtils; | ||
28 | import org.springframework.stereotype.Service; | ||
29 | import io.seata.spring.annotation.GlobalTransactional; | ||
30 | import org.springframework.transaction.annotation.Transactional; | ||
31 | |||
32 | import java.util.ArrayList; | ||
33 | import java.util.Collections; | ||
34 | import java.util.List; | ||
35 | |||
36 | /** | ||
37 | * @program: D:/git/ms-data-circulation-portal-service | ||
38 | * @description: 企业信息业务逻辑实现 | ||
39 | * @author: xcq | ||
40 | * @create: 2024-12-26 16:18 | ||
41 | **/ | ||
42 | @Slf4j | ||
43 | @Service | ||
44 | public class EnterpriseServiceImpl extends FlowAbstractImpl implements EnterpriseService { | ||
45 | |||
46 | /** | ||
47 | * 功能名称 | ||
48 | */ | ||
49 | private static final String FUNCTION_NAME = "企业信息"; | ||
50 | |||
51 | @Resource | ||
52 | private MfEnterpriseService mfEnterpriseService; | ||
53 | |||
54 | @Resource | ||
55 | private CsbrBeanUtil csbrBeanUtil; | ||
56 | |||
57 | @Resource | ||
58 | private ApprovalFlowUtil approvalFlowUtil; | ||
59 | |||
60 | @Resource | ||
61 | private MessageSourceUtil messageSourceUtil; | ||
62 | |||
63 | /** | ||
64 | * 企业信息分页查询 | ||
65 | * @author xcq | ||
66 | * @date 2024-12-26 16:18 | ||
67 | * @param queryVO | ||
68 | * @return com.csbr.cloud.mybatis.entity.PageListVO<com.csbr.qingcloud.portal.domain.vo.EnterpriseRSVO> | ||
69 | */ | ||
70 | @Override | ||
71 | public PageListVO<EnterpriseRSVO> pageList(EnterpriseQueryVO queryVO) { | ||
72 | beforeQuery(queryVO); | ||
73 | if (queryVO.getIsNeedQuery()) { | ||
74 | LambdaQueryWrapper<MfEnterprise> queryWrapper = mfEnterpriseService.csbrQueryWrapper(queryVO, MfEnterprise.class); | ||
75 | queryWrapper.in(CollectionUtils.isNotEmpty(queryVO.getGuidList()), MfEnterprise::getGuid, | ||
76 | queryVO.getGuidList()); | ||
77 | queryWrapper.orderByDesc(MfEnterprise::getCreateTime); | ||
78 | PageListVO<MfEnterprise> pageList = mfEnterpriseService.csbrPageList(queryVO, queryWrapper); | ||
79 | PageListVO<EnterpriseRSVO> rsPageList = csbrBeanUtil.convert(pageList, PageListVO.class); | ||
80 | afterQuery(pageList, rsPageList); | ||
81 | return rsPageList; | ||
82 | } | ||
83 | return new PageListVO<>(); | ||
84 | } | ||
85 | |||
86 | /** | ||
87 | * 企业信息获取详情数据 | ||
88 | * @author xcq | ||
89 | * @date 2024-12-26 16:18 | ||
90 | * @param guid | ||
91 | * @return com.csbr.qingcloud.portal.domain.vo.EnterpriseRSVO | ||
92 | */ | ||
93 | @Override | ||
94 | public EnterpriseRSVO getEnterpriseDetail(String guid) { | ||
95 | if (StringUtils.isBlank(guid)) { | ||
96 | // W00012 = {0}:参数[{1}]不能为空! | ||
97 | throw new CsbrSystemException(SystemError.DATA_INPUT_ERROR, messageSourceUtil.getMessage("W00010", | ||
98 | String.format("获取%s详情数据", FUNCTION_NAME), "数据唯一标识")); | ||
99 | } | ||
100 | MfEnterprise entity = mfEnterpriseService.getById(guid); | ||
101 | if (entity == null) { | ||
102 | throw new CsbrSystemException(SystemError.DATA_NOT_EXISTS, messageSourceUtil.notExistsToSelectMessage(String.format("获取%s详情数据", FUNCTION_NAME))); | ||
103 | } | ||
104 | return convertToVO(entity); | ||
105 | } | ||
106 | |||
107 | /** | ||
108 | * 企业信息数据新增 | ||
109 | * @author xcq | ||
110 | * @date 2024-12-26 16:18 | ||
111 | * @param flowBaseVO | ||
112 | * @return void | ||
113 | */ | ||
114 | @GlobalTransactional(rollbackFor = Exception.class) | ||
115 | @Transactional(rollbackFor = Exception.class) | ||
116 | @Override | ||
117 | public void saveEnterprise(FlowRQBaseVO flowBaseVO) { | ||
118 | EnterpriseRQVO rqVO = (EnterpriseRQVO) flowBaseVO; | ||
119 | beforeSave(rqVO); | ||
120 | MfEnterprise entity = convertToEntity(rqVO); | ||
121 | // 发起审批流程或保存草稿 | ||
122 | AddApprovalDTO approvalDTO = getAddApprovalDTO(entity); | ||
123 | super.startWorkFlow(rqVO, approvalDTO, entity::setBizApproveState); | ||
124 | // 业务数据保存 | ||
125 | boolean flag = mfEnterpriseService.save(entity); | ||
126 | if (!flag) { | ||
127 | throw new CsbrSystemException(SystemError.DATA_ADD_ERROR, rqVO.getImmediateApprove() ? | ||
128 | messageSourceUtil.submitMessage(FUNCTION_NAME) : messageSourceUtil.addMessage(FUNCTION_NAME)); | ||
129 | } | ||
130 | afterSave(entity, rqVO); | ||
131 | } | ||
132 | |||
133 | /** | ||
134 | * 企业信息数据修改 | ||
135 | * @author xcq | ||
136 | * @date 2024-12-26 16:18 | ||
137 | * @param flowBaseVO | ||
138 | * @return void | ||
139 | */ | ||
140 | @GlobalTransactional(rollbackFor = Exception.class) | ||
141 | @Transactional(rollbackFor = Exception.class) | ||
142 | @Override | ||
143 | public void updateEnterprise(FlowRQBaseVO flowBaseVO) { | ||
144 | EnterpriseRQVO rqVO = (EnterpriseRQVO) flowBaseVO; | ||
145 | // 将修改前数据查出来缓存下来,传入到修改后方法中,用于一些特殊逻辑处理,如某个值变化才进行 | ||
146 | // MfEnterprise oldEntity = mfEnterpriseService.getById(rqVO.getGuid()); | ||
147 | beforeUpdate(rqVO); | ||
148 | MfEnterprise entity = convertToEntity(rqVO); | ||
149 | // 发起审批流程或保存草稿 | ||
150 | AddApprovalDTO approvalDTO = getAddApprovalDTO(entity); | ||
151 | super.startOrRestartWorkFlow(rqVO, rqVO.getBizApproveState(), approvalDTO, entity::setBizApproveState); | ||
152 | if (rqVO.getIsRestart()) { | ||
153 | // 重新提交 | ||
154 | againSubmitFlow(entity, rqVO, approvalDTO); | ||
155 | } else { | ||
156 | // 修改业务数据 | ||
157 | boolean flag = mfEnterpriseService.updateById(entity); | ||
158 | if (!flag) { | ||
159 | throw new CsbrSystemException(SystemError.DATA_UPDATE_ERROR, rqVO.getImmediateApprove() ? | ||
160 | messageSourceUtil.submitMessage(FUNCTION_NAME) : messageSourceUtil.updateMessage(FUNCTION_NAME)); | ||
161 | } | ||
162 | afterUpdate(entity, rqVO); | ||
163 | } | ||
164 | } | ||
165 | |||
166 | /** | ||
167 | * 重新提交企业信息 | ||
168 | * @author xcq | ||
169 | * @date 2024-12-26 16:18 | ||
170 | * @param entity | ||
171 | * @param rqVO | ||
172 | * @param approvalDTO | ||
173 | * @return void | ||
174 | */ | ||
175 | private void againSubmitFlow(MfEnterprise entity, EnterpriseRQVO rqVO, AddApprovalDTO approvalDTO) { | ||
176 | // 重新提交的数据重置相关字段 | ||
177 | entity.setGuid(CommonUtil.newGuid()); | ||
178 | mfEnterpriseService.csbrBaseEntity(entity); | ||
179 | // 保存新数据 | ||
180 | boolean flag = mfEnterpriseService.save(entity); | ||
181 | if (!flag) { | ||
182 | throw new CsbrSystemException(SystemError.DATA_ADD_ERROR, messageSourceUtil.addMessage(String.format("重新提交%s",FUNCTION_NAME))); | ||
183 | } | ||
184 | // 发起新的流程 | ||
185 | approvalDTO.setGuid(entity.getGuid()); | ||
186 | approvalFlowUtil.addApproval(approvalDTO); | ||
187 | afterSave(entity, rqVO); | ||
188 | } | ||
189 | |||
190 | /** | ||
191 | * 企业信息数据删除、并有相关的处理操作 | ||
192 | * @author xcq | ||
193 | * @date 2024-12-26 16:18 | ||
194 | * @param guids | ||
195 | * @return void | ||
196 | */ | ||
197 | @GlobalTransactional(rollbackFor = Exception.class) | ||
198 | @Transactional(rollbackFor = Exception.class) | ||
199 | @Override | ||
200 | public void removeByGuids(List<String> guids) { | ||
201 | if (CollectionUtils.isEmpty(guids)) { | ||
202 | // W00012 = {0}:参数[{1}]不能为空! | ||
203 | throw new CsbrSystemException(SystemError.DATA_INPUT_ERROR, messageSourceUtil.getMessage("W00012", | ||
204 | String.format("删除%s数据", FUNCTION_NAME), "数据唯一标识")); | ||
205 | } | ||
206 | for (String guid : guids) { | ||
207 | MfEnterprise entity = mfEnterpriseService.getById(guid); | ||
208 | beforeRemove(entity); | ||
209 | boolean flag = mfEnterpriseService.removeById(guid); | ||
210 | if (!flag) { | ||
211 | throw new CsbrSystemException(SystemError.DATA_DEL_ERROR, messageSourceUtil.delMessage(FUNCTION_NAME)); | ||
212 | } | ||
213 | afterRemove(entity); | ||
214 | } | ||
215 | // 删除流程数据 | ||
216 | approvalFlowUtil.removeApproveByBizGuids(guids); | ||
217 | } | ||
218 | |||
219 | /** | ||
220 | * 流程结束后进行业务回调 | ||
221 | * @author xcq | ||
222 | * @date 2024-12-26 16:18 | ||
223 | * @param dto | ||
224 | * @return void | ||
225 | */ | ||
226 | @Transactional(rollbackFor = Exception.class) | ||
227 | @Override | ||
228 | public void flowCallBack(BizCallbackDTO dto) { | ||
229 | MfEnterprise entity = mfEnterpriseService.getById(dto.getBizGuid()); | ||
230 | if (entity == null) { | ||
231 | throw new CsbrSystemException(SystemError.DATA_NOT_EXISTS, messageSourceUtil.notExistsToSelectMessage(FUNCTION_NAME)); | ||
232 | } | ||
233 | if (ApprovalStateEnum.PASSED.getValue().equals(dto.getApprovalState())) { | ||
234 | // todo | ||
235 | } | ||
236 | // 同步更新审批状态 | ||
237 | LambdaUpdateWrapper<MfEnterprise> updateWrapper = mfEnterpriseService.csbrUpdateWrapper(MfEnterprise.class); | ||
238 | updateWrapper.set(MfEnterprise::getBizApproveState, dto.getApprovalState()); | ||
239 | updateWrapper.eq(MfEnterprise::getGuid, dto.getBizGuid()); | ||
240 | boolean flag = mfEnterpriseService.update(updateWrapper); | ||
241 | if (!flag) { | ||
242 | throw new CsbrSystemException(SystemError.DATA_UPDATE_ERROR, messageSourceUtil.updateMessage(String.format("%s的业务审批状态", FUNCTION_NAME))); | ||
243 | } | ||
244 | } | ||
245 | |||
246 | /** | ||
247 | * 获取发起流程参数 | ||
248 | * @author xcq | ||
249 | * @date 2024-12-26 16:18 | ||
250 | * @param entity | ||
251 | * @return com.csbr.cloud.workflow.domain.dto.appove.AddApprovalDTO | ||
252 | */ | ||
253 | private AddApprovalDTO getAddApprovalDTO(MfEnterprise entity) { | ||
254 | AddApprovalDTO approvalDTO = new AddApprovalDTO(WorkFlowBizEnum.ENTERPRISE_APPLY.getValue(), entity.getGuid()); | ||
255 | // todo | ||
256 | approvalDTO.setFuncCode("QYRZ"); | ||
257 | // 流程消息中的变量替换参数 | ||
258 | approvalDTO.setFlowMessageBody(null); | ||
259 | // 流程列表数据核心param参数处理 | ||
260 | approvalDTO.setParam1(null); | ||
261 | approvalDTO.setParam2(null); | ||
262 | approvalDTO.setParam3(null); | ||
263 | approvalDTO.setParam4(null); | ||
264 | |||
265 | return approvalDTO; | ||
266 | } | ||
267 | |||
268 | /** | ||
269 | * 企业信息新新增前置处理 | ||
270 | * @author xcq | ||
271 | * @date 2024-12-26 16:18 | ||
272 | * @param rqVO | ||
273 | * @return void | ||
274 | */ | ||
275 | private void beforeSave(EnterpriseRQVO rqVO) { | ||
276 | //region 1.输入基础验证 | ||
277 | //endregion | ||
278 | |||
279 | //region 2.数据验证特殊处理 | ||
280 | //region 2.1.业务合规性验证 | ||
281 | //endregion 2.1.业务合规性验证 | ||
282 | |||
283 | //region 2.2.业务数据验证 | ||
284 | //endregion 2.2.业务数据验证 | ||
285 | |||
286 | //endregion 2.数据验证特殊处理 | ||
287 | |||
288 | //region 3.数据转换处理 | ||
289 | |||
290 | //region 3.1.数据过程转换 | ||
291 | //endregion 3.1.数据过程转换 | ||
292 | |||
293 | //endregion 3.数据转换处理 | ||
294 | |||
295 | //region 4.数据过滤与补充处理 | ||
296 | |||
297 | //endregion 4.数据过滤与补充处理 | ||
298 | |||
299 | //region 5.过程处理 | ||
300 | |||
301 | //region 5.1.计算逻辑处理 | ||
302 | //endregion 5.1.计算逻辑处理 | ||
303 | |||
304 | //region 5.2.业务逻辑处理 | ||
305 | //endregion 5.2.业务逻辑处理 | ||
306 | |||
307 | //endregion 5.过程处理 | ||
308 | } | ||
309 | |||
310 | /** | ||
311 | * 企业信息新增后置处理 | ||
312 | * @author xcq | ||
313 | * @date 2024-12-26 16:18 | ||
314 | * @param entity | ||
315 | * @param rqVO | ||
316 | * @return void | ||
317 | */ | ||
318 | private void afterSave(MfEnterprise entity, EnterpriseRQVO rqVO) { | ||
319 | //region 1.输出特殊转换 | ||
320 | |||
321 | //region 1.1.输出过滤与补充处理 | ||
322 | //endregion 1.1.输出过滤与补充处理 | ||
323 | |||
324 | //endregion 1.输出特殊转换 | ||
325 | } | ||
326 | |||
327 | /** | ||
328 | * 企业信息修改前置校验、处理 | ||
329 | * @author xcq | ||
330 | * @date 2024-12-26 16:18 | ||
331 | * @param rqVO | ||
332 | * @return void | ||
333 | */ | ||
334 | private void beforeUpdate(EnterpriseRQVO rqVO) { | ||
335 | //region 1.输入基础验证 | ||
336 | if (StringUtils.isBlank(rqVO.getGuid())) { | ||
337 | // W00012 = {0}:参数[{1}]不能为空! | ||
338 | throw new CsbrSystemException(SystemError.DATA_INPUT_ERROR, messageSourceUtil.getMessage("W00010", String.format("修改%s数据",FUNCTION_NAME), "数据唯一标识")); | ||
339 | } | ||
340 | //endregion | ||
341 | |||
342 | //region 2.数据验证特殊处理 | ||
343 | //region 2.1.业务合规性验证 | ||
344 | //endregion 2.1.业务合规性验证 | ||
345 | |||
346 | //region 2.2.业务数据验证 | ||
347 | LambdaQueryWrapper<MfEnterprise> queryWrapper = new LambdaQueryWrapper<>(); | ||
348 | queryWrapper.eq(MfEnterprise::getGuid, rqVO.getGuid()); | ||
349 | queryWrapper.select(MfEnterprise::getGuid, MfEnterprise::getBizApproveState); | ||
350 | MfEnterprise entity = mfEnterpriseService.getOne(queryWrapper); | ||
351 | if (entity == null) { | ||
352 | throw new CsbrSystemException(SystemError.DATA_NOT_EXISTS, messageSourceUtil.notExistsToUpdateMessage(FUNCTION_NAME)); | ||
353 | } | ||
354 | //endregion 2.2.业务数据验证 | ||
355 | |||
356 | //endregion 2.数据验证特殊处理 | ||
357 | |||
358 | //region 3.数据转换处理 | ||
359 | |||
360 | //region 3.1.数据过程转换 | ||
361 | rqVO.setBizApproveState(entity.getBizApproveState()); | ||
362 | //endregion 3.1.数据过程转换 | ||
363 | |||
364 | //endregion 3.数据转换处理 | ||
365 | |||
366 | //region 4.数据过滤与补充处理 | ||
367 | //endregion 4.数据过滤与补充处理 | ||
368 | |||
369 | //region 5.过程处理 | ||
370 | |||
371 | //region 5.1.计算逻辑处理 | ||
372 | //endregion 5.1.计算逻辑处理 | ||
373 | |||
374 | //region 5.2.业务逻辑处理 | ||
375 | //endregion 5.2.业务逻辑处理 | ||
376 | |||
377 | //endregion 5.过程处理 | ||
378 | } | ||
379 | |||
380 | /** | ||
381 | * 企业信息修改后置处理 | ||
382 | * @author xcq | ||
383 | * @date 2024-12-26 16:18 | ||
384 | * @param entity | ||
385 | * @param rqVO | ||
386 | * @return void | ||
387 | */ | ||
388 | protected void afterUpdate(MfEnterprise entity, EnterpriseRQVO rqVO) { | ||
389 | //region 1.输出特殊转换 | ||
390 | |||
391 | //region 1.1.输出过滤与补充处理 | ||
392 | //endregion 1.1.输出过滤与补充处理 | ||
393 | |||
394 | //endregion 1.输出特殊转换 | ||
395 | } | ||
396 | |||
397 | |||
398 | /** | ||
399 | * 企业信息删除前置处理 | ||
400 | * @author xcq | ||
401 | * @date 2024-12-26 16:18 | ||
402 | * @param entity | ||
403 | * @return void | ||
404 | */ | ||
405 | private void beforeRemove(MfEnterprise entity) { | ||
406 | if (entity == null) { | ||
407 | throw new CsbrSystemException(SystemError.DATA_DEL_ERROR, messageSourceUtil.notExistsToDelMessage(FUNCTION_NAME)); | ||
408 | } | ||
409 | if (ApprovalStateEnum.CHECKING.getValue().equals(entity.getBizApproveState()) || | ||
410 | ApprovalStateEnum.PASSED.getValue().equals(entity.getBizApproveState())) { | ||
411 | throw new CsbrSystemException(SystemError.DATA_DEL_ERROR, "审批中和审批通过的数据不能删除!"); | ||
412 | } | ||
413 | } | ||
414 | |||
415 | /** | ||
416 | * 企业信息删除后置处理 | ||
417 | * @author xcq | ||
418 | * @date 2024-12-26 16:18 | ||
419 | * @param entity | ||
420 | * @return void | ||
421 | */ | ||
422 | private void afterRemove(MfEnterprise entity) { | ||
423 | |||
424 | } | ||
425 | |||
426 | /** | ||
427 | * 企业信息查询方法前置验证、处理 | ||
428 | * @author xcq | ||
429 | * @date 2024-12-26 16:18 | ||
430 | * @param rqQueryVO | ||
431 | * @return void | ||
432 | */ | ||
433 | private void beforeQuery(EnterpriseQueryVO rqQueryVO) { | ||
434 | rqQueryVO.setIsNeedQuery(true); | ||
435 | if (approvalFlowUtil.isQueryBizGuid(rqQueryVO)) { | ||
436 | rqQueryVO.setFlowType(WorkFlowBizEnum.ENTERPRISE_APPLY.getValue()); | ||
437 | List<String> bizGuidList = approvalFlowUtil.getApprovalBizGuids(rqQueryVO); | ||
438 | if (CollectionUtils.isEmpty(bizGuidList)) { | ||
439 | rqQueryVO.setIsNeedQuery(false); | ||
440 | } else { | ||
441 | rqQueryVO.setGuidList(bizGuidList); | ||
442 | } | ||
443 | } | ||
444 | } | ||
445 | |||
446 | /** | ||
447 | * 企业信息查询方法后置数据转换、处理 | ||
448 | * @author xcq | ||
449 | * @date 2024-12-26 16:18 | ||
450 | * @param pageList 数据库查询数据 | ||
451 | * @param rsPageList 返回的最终数据 | ||
452 | * @return void | ||
453 | */ | ||
454 | private void afterQuery(PageListVO<MfEnterprise> pageList, PageListVO<EnterpriseRSVO> rsPageList) { | ||
455 | if (CollectionUtils.isNotEmpty(pageList.getRecords())) { | ||
456 | rsPageList.setRecords(convertToVO(pageList.getRecords())); | ||
457 | } | ||
458 | // 需要特殊处理数据时使用 | ||
459 | /*if(CollectionUtils.isNotEmpty(pageList.getRecords())){ | ||
460 | List<EnterpriseRSVO> results = new ArrayList<>(); | ||
461 | for (MfEnterprise item : pageList.getRecords()){ | ||
462 | EnterpriseRSVO vo = convertToVO(item); | ||
463 | results.add(vo); | ||
464 | } | ||
465 | rsPageList.setRecords(results); | ||
466 | }*/ | ||
467 | } | ||
468 | |||
469 | //region 辅助操作 | ||
470 | |||
471 | /** | ||
472 | * 企业信息实体数据转换为视图对象数据(多个) | ||
473 | * @author xcq | ||
474 | * @date 2024-12-26 16:18 | ||
475 | * @param entityList 实体数据列表 | ||
476 | * @return java.util.List<com.csbr.qingcloud.portal.domain.vo.EnterpriseRSVO> 视图对象列表 | ||
477 | */ | ||
478 | private List<EnterpriseRSVO> convertToVO(List<MfEnterprise> entityList) { | ||
479 | if (CollectionUtils.isEmpty(entityList)) { | ||
480 | // W00012 = {0}:参数[{1}]不能为空! | ||
481 | throw new CsbrSystemException(SystemError.DATA_INPUT_ERROR, messageSourceUtil.getMessage("W00012", | ||
482 | "实体数据转换为视图对象实体数据", "实体数据")); | ||
483 | } | ||
484 | List<EnterpriseRSVO> voList = new ArrayList<>(entityList.size()); | ||
485 | for (MfEnterprise item : entityList) { | ||
486 | EnterpriseRSVO vo = convertToVO(item); | ||
487 | voList.add(vo); | ||
488 | } | ||
489 | return voList; | ||
490 | } | ||
491 | |||
492 | /** | ||
493 | * 企业信息实体数据转换为视图对象数据 | ||
494 | * @author xcq | ||
495 | * @date 2024-12-26 16:18 | ||
496 | * @param entity | ||
497 | * @return com.csbr.qingcloud.portal.domain.vo.EnterpriseRSVO | ||
498 | */ | ||
499 | private EnterpriseRSVO convertToVO(MfEnterprise entity) { | ||
500 | EnterpriseRSVO vo = csbrBeanUtil.convert(entity, EnterpriseRSVO.class); | ||
501 | //流程数据处理 | ||
502 | vo.setApproveVO(approvalFlowUtil.getApprovalInfo(entity.getGuid())); | ||
503 | return vo; | ||
504 | } | ||
505 | |||
506 | /** | ||
507 | * 企业信息新增、修改和其他情况的参数转换为实体 | ||
508 | * @author xcq | ||
509 | * @date 2024-12-26 16:18 | ||
510 | * @param vo | ||
511 | * @return com.csbr.qingcloud.portal.mybatis.entity.MfEnterprise | ||
512 | */ | ||
513 | private MfEnterprise convertToEntity(EnterpriseRQVO vo) { | ||
514 | MfEnterprise entity = csbrBeanUtil.convert(vo, MfEnterprise.class); | ||
515 | // 新增时数据默认guid赋值,转换后该guid可能别使用 | ||
516 | if (StringUtils.isBlank(vo.getGuid())) { | ||
517 | entity.setGuid(CommonUtil.newGuid()); | ||
518 | } | ||
519 | return entity; | ||
520 | } | ||
521 | |||
522 | //endregion | ||
523 | |||
524 | } |
-
Please register or sign in to post a comment