refactor(training): 重构培训申请相关实体和映射逻辑

main
zhaokai 2026-06-09 15:53:53 +08:00
parent bfa06453c5
commit 62188ae36e
8 changed files with 21 additions and 18 deletions

View File

@ -117,9 +117,6 @@ public class TrainingApplyRecordCO extends ClientObject {
@ApiModelProperty(value = "是否审批")
private Boolean isApproval = true;
private String postName;
private String userIdCard;
}

View File

@ -84,6 +84,9 @@ public class TrainingApplyUserCO extends ClientObject {
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime approvalTime;
private String postName;
//乐观锁
@ApiModelProperty(value = "乐观锁")
private Integer version;

View File

@ -34,7 +34,6 @@ public class CurriculumAddCmd {
private String curriculumIntroduce;
@ApiModelProperty(value = "封面路径url", name = "coverPath", required = true)
@NotEmpty(message = "封面路径url不能为空")
private String coverPath;

View File

@ -79,11 +79,6 @@ public class TrainingApplyRecordDO extends BaseDO {
@TableField(exist = false)
private String entrustProcessId;
private String postName;
private String userIdCard;

View File

@ -84,6 +84,9 @@ public class TrainingApplyUserDO extends BaseDO {
@TableField(exist = false)
private LocalDateTime approvalTime;
@TableField(exist = false)
private String postName;
public TrainingApplyUserDO(String trainingApplyUserId) {
this.trainingApplyUserId = trainingApplyUserId;
}

View File

@ -51,19 +51,14 @@
r.version,
u.name AS apply_user_name,
COALESCE(tau_cnt.apply_user_count, 0) AS apply_user_count,
tap.training_apply_process_id entrust_process_id,
CASE
WHEN ci.type IN (3,4, 5) THEN u.post_name
ELSE p.post_name
END AS post_name as postName,
u.user_id_card as userIdCard
tap.training_apply_process_id entrust_process_id
FROM
training_apply_record r
LEFT JOIN
user u
ON u.id = r.apply_user_id
AND u.delete_enum = 'false'
left join post p on p.id = u.post_id
LEFT JOIN corp_info ci
ON ci.id = r.apply_corpinfo_id
AND ci.delete_enum = 'false'

View File

@ -15,12 +15,20 @@
tau.apply_status as applyStatus,
tau.remarks,
u.name as userName,
tau.id_card as idCard
tau.id_card as idCard,
CASE
WHEN ci.type IN (3,4, 5) THEN u.post_name
ELSE p.post_name
END AS postName
FROM
training_apply_user tau
LEFT JOIN
user u ON tau.user_id = u.id
AND u.delete_enum = 'false'
left join post p on p.id = u.post_id
LEFT JOIN corp_info ci
ON ci.id = u.corpinfo_id
AND ci.delete_enum = 'false'
WHERE
tau.training_apply_record_id = #{trainingApplyRecordId}
AND tau.delete_enum = 'false'

View File

@ -428,7 +428,10 @@
GROUP_CONCAT(DISTINCT p.project_id SEPARATOR ', ') AS project_id,
GROUP_CONCAT(DISTINCT p.project_name SEPARATOR ', ') AS project_name,
u.name,
po.post_name,
CASE
WHEN c.type IN (3,4, 5) THEN u.post_name
ELSE po.post_name
END AS post_name,
d.name dept_name,
u.phone,
u.user_id_card,