dev-tmp1
luotaiqian 2026-08-19 15:44:24 +08:00
parent 143297a0d9
commit 76789c1917
15 changed files with 38 additions and 81 deletions

View File

@ -1278,7 +1278,7 @@ create table org_personnel
employment_status_name varchar(50) null comment '就职状态名称',
person_type_code varchar(32) default '1' null comment '人员类型编码(1基础人员2专职评价师)',
person_type_name varchar(50) default '基础人员' null comment '人员类型名称',
qual_scope varchar(500) null comment '资质范围',
is_cert_complete tinyint(1) default 1 not null comment '证书文件是否完善(1是0否)',
professional_level_code varchar(32) null comment '职业等级编码',
professional_level_name varchar(200) null comment '职业等级名称',
evaluator_cert_no varchar(100) null comment '安全评价师证书编号',

View File

@ -167,7 +167,7 @@ components:
employmentStatusName: { type: string }
personTypeCode: { type: string }
personTypeName: { type: string }
qualScope: { type: string }
isCertComplete: { type: boolean, description: 证书文件是否完善(1是0否) }
professionalLevelCode: { type: string }
professionalLevelName: { type: string }
evaluatorCertNo: { type: string }

View File

@ -0,0 +1,13 @@
-- =====================================================================
-- 变更说明:
-- 1. org_personnel 表将 qual_scope(资质范围, varchar(500)) 删除,
-- 原人员业务范围字段已废弃
-- 2. org_personnel 表新增 is_cert_complete(证书文件是否完善, tinyint(1)
-- 默认1: 1是0否),实体/DO/CO 等使用 Boolean 类型承接
-- 变更时间: 2026-08-19
-- =====================================================================
ALTER TABLE `org_personnel`
DROP COLUMN `qual_scope`,
ADD COLUMN `is_cert_complete` tinyint(1) DEFAULT 1 NOT NULL COMMENT '证书文件是否完善(1是0否)' AFTER `person_type_code`;

View File

@ -181,7 +181,6 @@ public class OrgPersonnelExcelImporter {
*/
private int saveRows(List<OrgPersonnelImportRow> rows, Long orgId, Set<String> existingAccounts
, List<OrgPersonnelImportErrorCO> errors) {
int successCount = 0;
for (OrgPersonnelImportRow row : rows) {
String account = trim(row.getBasic().getAccount());
@ -199,8 +198,8 @@ public class OrgPersonnelExcelImporter {
continue;
}
List<OrgPersonnelCertDO> personnelCertEntities = buildOrgPersonnelCert(row, errors);
Long userId = addUserIfAbsentAndAppendRole(personnelEntity);
personnelEntity.setIsCertComplete(false);
personnelEntity.setId(userId);
transactionTemplate.execute(status -> {

View File

@ -83,7 +83,6 @@ public class QualFilingOrgPersonnelImporter {
entity.setEducationName(source.getEducationName());
entity.setGraduateSchool(source.getGraduateSchool());
entity.setMajor(source.getMajor());
entity.setQualScope(source.getQualScope());
entity.setPublications(source.getPublications());
if (StringUtils.hasText(source.getEvaluatorCertNo())) {
entity.setProfessionalLevelCert(source.getEvaluatorCertNo());

View File

@ -82,8 +82,8 @@ public class OrgPersonnelCO {
@ApiModelProperty(value = "人员类型编码(1基础人员2专职评价师)")
private String personTypeCode;
@ApiModelProperty(value = "资质范围")
private String qualScope;
@ApiModelProperty(value = "证书文件是否完善(1是0否)")
private Boolean isCertComplete;
@ApiModelProperty(value = "评价师证书编号")
private String evaluatorCertNo;

View File

@ -90,9 +90,8 @@ public class OrgPersonnelAddCmd {
@ApiModelProperty(value = "人员类型编码(1基础人员2专职评价师)")
private String personTypeCode;
@Size(max = 500, message = "资质范围长度不能超过500个字符")
@ApiModelProperty(value = "资质范围")
private String qualScope;
@ApiModelProperty(value = "证书文件是否完善(1是0否)")
private Boolean isCertComplete;
@Size(max = 100, message = "证书编号长度不能超过100个字符")
@ApiModelProperty(value = "安全评价师证书编号")

View File

@ -91,9 +91,8 @@ public class OrgPersonnelModifyCmd {
@ApiModelProperty(value = "人员类型编码(1基础人员2专职评价师)")
private String personTypeCode;
@Size(max = 500, message = "资质范围长度不能超过500个字符")
@ApiModelProperty(value = "资质范围")
private String qualScope;
@ApiModelProperty(value = "证书文件是否完善(1是0否)")
private Boolean isCertComplete;
@Size(max = 100, message = "证书编号长度不能超过100个字符")
@ApiModelProperty(value = "安全评价师证书编号")

View File

@ -76,8 +76,8 @@ public class OrgPersonnelEntity {
/** 人员类型编码 */
private String personTypeCode;
/** 资质范围 */
private String qualScope;
/** 证书文件是否完善 */
private Boolean isCertComplete;
/** 安全评价师证书编号 */
private String evaluatorCertNo;

View File

@ -39,7 +39,7 @@ public class OrgPersonnelDO {
private Integer employmentStatusCode;
private String employmentStatusName;
private String personTypeCode;
private String qualScope;
private Boolean isCertComplete;
private String evaluatorCertNo;
private String educationTypeCode;
private String educationTypeName;

View File

@ -26,10 +26,10 @@ public interface OrgPersonnelMapper extends BaseMapper<OrgPersonnelDO> {
List<OrgPersonnelDeptCountDO> countPersonGroupByDept(@Param("orgId") Long orgId);
/**
* id qual_scope
* id is_cert_complete
*
* @param ids idorg_personnel.id
* @return
* @return
*/
List<OrgPersonnelLeaderCountDO> countLeaderFlags(@Param("ids") List<Long> ids);

View File

@ -11,9 +11,9 @@ import lombok.Data;
public class OrgPersonnelLeaderCountDO {
/**
*
*
*/
private String qualScope;
private Boolean isCertComplete;
/**
*

View File

@ -31,7 +31,7 @@ public class OrgPersonnelRawRepository {
+ "gender_code = ?, gender_name = ?, birth_date = ?, id_card_no = ?, "
+ "current_address = ?, office_address = ?, education_code = ?, education_name = ?, "
+ "graduate_school = ?, major = ?, employment_status_code = ?, employment_status_name = ?, "
+ "person_type_code = ?, qual_scope = ?, "
+ "person_type_code = ?, is_cert_complete = ?, "
+ "evaluator_cert_no = ?, "
+ "education_type_code = ?, education_type_name = ?, education_level_code = ?, education_level_name = ?, "
+ "title_code_arr = ?, register_engineer_flag = ?, publications = ?, ability_declaration = ?, "
@ -57,7 +57,7 @@ public class OrgPersonnelRawRepository {
dataObject.getEmploymentStatusCode(),
dataObject.getEmploymentStatusName(),
dataObject.getPersonTypeCode(),
dataObject.getQualScope(),
dataObject.getIsCertComplete(),
dataObject.getEvaluatorCertNo(),
dataObject.getEducationTypeCode(),
dataObject.getEducationTypeName(),
@ -111,7 +111,7 @@ public class OrgPersonnelRawRepository {
}
row.setEmploymentStatusName(rs.getString("employment_status_name"));
row.setPersonTypeCode(rs.getString("person_type_code"));
row.setQualScope(rs.getString("qual_scope"));
row.setIsCertComplete(rs.getBoolean("is_cert_complete"));
row.setEvaluatorCertNo(rs.getString("evaluator_cert_no"));
row.setEducationTypeCode(rs.getString("education_type_code"));
row.setEducationTypeName(rs.getString("education_type_name"));

View File

@ -23,7 +23,6 @@ import org.qinan.safetyeval.infrastructure.dataobject.OrgPersonnelDO;
import org.qinan.safetyeval.infrastructure.mapper.OrgPersonnelCertMapper;
import org.qinan.safetyeval.infrastructure.mapper.OrgPersonnelMapper;
import org.qinan.safetyeval.infrastructure.persistence.domainobject.IndustryProfessionalStandardsDO;
import org.qinan.safetyeval.infrastructure.persistence.domainobject.OrgPersonnelLeaderCountDO;
import org.qinan.safetyeval.infrastructure.persistence.mapper.IndustryProfessionalStandardsMapper;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
@ -352,60 +351,9 @@ public class ComplianceCheckUtil {
*/
private QualFilingComplianceCheckResultCO checkKeyPosition(QualFilingAddCmd filing,
List<QualFilingPersonnelAddCmd> personnelList) {
if (true) {
// todo 暂时无法判定因为 人员去掉了业务范围 ;后面填报资质的时候需要修改
return buildResult(QualFilingComplianceCheckEnum.KEY_POSITION, QualFilingComplianceCheckEnum.STATUS_PASS,
"满足条件");
}
// 提取所有来源人员id对应 org_personnel.id
List<Long> sourcePersonnelIds = personnelList.stream()
.map(QualFilingPersonnelAddCmd::getSourcePersonnelId)
.filter(Objects::nonNull)
.distinct()
.collect(Collectors.toList());
// 通过 SpringUtil 获取 OrgPersonnelMapper按业务范围qual_scope分组统计负责人数量
OrgPersonnelMapper orgPersonnelMapper = SpringUtil.getBean(OrgPersonnelMapper.class);
List<OrgPersonnelLeaderCountDO> countDOList = orgPersonnelMapper.countLeaderFlags(sourcePersonnelIds);
// 以业务范围为维度每个业务分别判断至少1名技术负责人、1名过程控制负责人
List<String> businessScope = filing.getBusinessScope();
Map<String, OrgPersonnelLeaderCountDO> countByScope = countDOList == null ? Collections.emptyMap()
: countDOList.stream()
.collect(Collectors.toMap(OrgPersonnelLeaderCountDO::getQualScope
, c -> c, (a, b) -> a));
boolean pass = true;
StringBuilder currentValue = new StringBuilder();
for (String scope : businessScope) {
OrgPersonnelLeaderCountDO countDO = countByScope.get(scope);
int technicalDirectorCount = countDO != null && countDO.getTechnicalDirectorCount() != null
? countDO.getTechnicalDirectorCount() : 0;
int processControlLeaderCount = countDO != null && countDO.getProcessControlLeaderCount() != null
? countDO.getProcessControlLeaderCount() : 0;
boolean scopePass = technicalDirectorCount >= 1 && processControlLeaderCount >= 1;
if (!scopePass) {
pass = false;
}
if (currentValue.length() > 0) {
currentValue.append("");
}
IndustryEnum industryEnum = IndustryEnum.ofCode(scope);
if (industryEnum != null) {
scope = industryEnum.getValue();
} else {
scope = "未知行业范围";
}
currentValue.append("业务[").append(scope).append("] 技术负责人 ")
.append(technicalDirectorCount).append("/1过程控制负责人 ")
.append(processControlLeaderCount).append("/1");
}
return buildResult(QualFilingComplianceCheckEnum.KEY_POSITION,
pass ? QualFilingComplianceCheckEnum.STATUS_PASS : QualFilingComplianceCheckEnum.STATUS_FAIL,
currentValue.toString());
// todo 暂时无法判定因为 人员去掉了业务范围;后面填报资质的时候需要修改
return buildResult(QualFilingComplianceCheckEnum.KEY_POSITION, QualFilingComplianceCheckEnum.STATUS_PASS,
"满足条件");
}
/**

View File

@ -51,10 +51,10 @@
GROUP BY dept_id
</select>
<!-- 根据人员id列表统计技术负责人和过程控制负责人数量业务范围分组) -->
<!-- 根据人员id列表统计技术负责人和过程控制负责人数量证书文件是否完善分组) -->
<select id="countLeaderFlags" resultType="org.qinan.safetyeval.infrastructure.persistence.domainobject.OrgPersonnelLeaderCountDO">
SELECT
qual_scope,
is_cert_complete,
COUNT(CASE WHEN technical_director_flag = 1 THEN 1 END) AS technical_director_count,
COUNT(CASE WHEN process_control_leader_flag = 1 THEN 1 END) AS process_control_leader_count
FROM org_personnel
@ -63,7 +63,7 @@
<foreach collection="ids" item="id" open="(" separator="," close=")">
#{id}
</foreach>
GROUP BY qual_scope
GROUP BY is_cert_complete
</select>
<!-- 根据人员id列表查询专业能力code关联 basic_discipline_major -->