test
parent
143297a0d9
commit
76789c1917
|
|
@ -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 '安全评价师证书编号',
|
||||
|
|
|
|||
|
|
@ -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 }
|
||||
|
|
|
|||
|
|
@ -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`;
|
||||
|
||||
|
|
@ -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 -> {
|
||||
|
|
|
|||
|
|
@ -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());
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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 = "安全评价师证书编号")
|
||||
|
|
|
|||
|
|
@ -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 = "安全评价师证书编号")
|
||||
|
|
|
|||
|
|
@ -76,8 +76,8 @@ public class OrgPersonnelEntity {
|
|||
/** 人员类型编码 */
|
||||
private String personTypeCode;
|
||||
|
||||
/** 资质范围 */
|
||||
private String qualScope;
|
||||
/** 证书文件是否完善 */
|
||||
private Boolean isCertComplete;
|
||||
|
||||
/** 安全评价师证书编号 */
|
||||
private String evaluatorCertNo;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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 人员id列表(org_personnel.id)
|
||||
* @return 负责人标志位统计结果列表,每个业务范围一条记录
|
||||
* @return 负责人标志位统计结果列表,每个证书完善状态一条记录
|
||||
*/
|
||||
List<OrgPersonnelLeaderCountDO> countLeaderFlags(@Param("ids") List<Long> ids);
|
||||
|
||||
|
|
|
|||
|
|
@ -11,9 +11,9 @@ import lombok.Data;
|
|||
public class OrgPersonnelLeaderCountDO {
|
||||
|
||||
/**
|
||||
* 业务范围(资质范围)
|
||||
* 证书文件是否完善
|
||||
*/
|
||||
private String qualScope;
|
||||
private Boolean isCertComplete;
|
||||
|
||||
/**
|
||||
* 技术负责人数量
|
||||
|
|
|
|||
|
|
@ -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"));
|
||||
|
|
|
|||
|
|
@ -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,62 +351,11 @@ public class ComplianceCheckUtil {
|
|||
*/
|
||||
private QualFilingComplianceCheckResultCO checkKeyPosition(QualFilingAddCmd filing,
|
||||
List<QualFilingPersonnelAddCmd> personnelList) {
|
||||
if (true) {
|
||||
// todo 暂时无法判定因为 人员去掉了业务范围 ;后面填报资质的时候需要修改
|
||||
// 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());
|
||||
}
|
||||
|
||||
/**
|
||||
* 承诺书/网站/报告查询:是否存在承诺书数据且信息公开链接已填写
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -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) -->
|
||||
|
|
|
|||
Loading…
Reference in New Issue