person
parent
a2ceca5d90
commit
64d4625fd3
|
|
@ -2,6 +2,7 @@ package org.qinan.safetyeval.infrastructure.utils;
|
|||
|
||||
import cn.hutool.core.lang.Pair;
|
||||
import cn.hutool.extra.spring.SpringUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import lombok.experimental.UtilityClass;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
|
@ -10,7 +11,9 @@ import org.qinan.safetyeval.client.co.OrgPersonnelCertCapabilityComplianceCheckC
|
|||
import org.qinan.safetyeval.client.co.QualFilingComplianceCheckResultCO;
|
||||
import org.qinan.safetyeval.client.dto.*;
|
||||
import org.qinan.safetyeval.domain.constant.*;
|
||||
import org.qinan.safetyeval.domain.entity.TitleCodeCo;
|
||||
import org.qinan.safetyeval.domain.exception.BizException;
|
||||
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;
|
||||
|
|
@ -52,6 +55,9 @@ public class ComplianceCheckUtil {
|
|||
List<OrgPersonnelCertCapabilityComplianceCheckCO>
|
||||
certCapabilityList = queryOrgPersonnelCertCapability(personnelList);
|
||||
|
||||
// 0.1 查询人员职称信息并回填到 personnelList
|
||||
fillTitleCodeArr(personnelList);
|
||||
|
||||
// 1. 独立法人资格
|
||||
results.add(checkMainQualification(filing));
|
||||
|
||||
|
|
@ -129,6 +135,41 @@ public class ComplianceCheckUtil {
|
|||
return mapper.selectCapabilityByPersonnelIds(sourcePersonnelIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询 org_personnel 的 title_code_arr(职称信息)并回填到备案人员列表。
|
||||
* <p>
|
||||
* 根据 sourcePersonnelId(对应 org_personnel.id)查询 title_code_arr,
|
||||
* 解析 JSON 字符串为 {@link TitleCodeCo} 列表后设置到 personnelList 中。
|
||||
*
|
||||
* @param personnelList 备案人员列表
|
||||
*/
|
||||
private void fillTitleCodeArr(List<QualFilingPersonnelAddCmd> personnelList) {
|
||||
if (CollectionUtils.isEmpty(personnelList)) {
|
||||
return;
|
||||
}
|
||||
List<Long> sourcePersonnelIds = personnelList.stream()
|
||||
.map(QualFilingPersonnelAddCmd::getSourcePersonnelId)
|
||||
.filter(Objects::nonNull)
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
if (sourcePersonnelIds.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
LambdaQueryWrapper<OrgPersonnelDO> wrapper = new LambdaQueryWrapper<OrgPersonnelDO>()
|
||||
.select(OrgPersonnelDO::getId, OrgPersonnelDO::getTitleCodeArr)
|
||||
.in(OrgPersonnelDO::getId, sourcePersonnelIds);
|
||||
List<OrgPersonnelDO> orgPersonnelList = SpringUtil.getBean(OrgPersonnelMapper.class).selectList(wrapper);
|
||||
Map<Long, String> titleCodeArrMap = orgPersonnelList.stream()
|
||||
.filter(p -> p.getTitleCodeArr() != null)
|
||||
.collect(Collectors.toMap(OrgPersonnelDO::getId, OrgPersonnelDO::getTitleCodeArr, (a, b) -> a));
|
||||
for (QualFilingPersonnelAddCmd personnel : personnelList) {
|
||||
String titleCodeArrJson = titleCodeArrMap.get(personnel.getSourcePersonnelId());
|
||||
if (StringUtils.hasText(titleCodeArrJson)) {
|
||||
personnel.setTitleCodeArr(JSONUtil.toList(titleCodeArrJson, TitleCodeCo.class));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 独立法人资格(暂默认通过,标记警告)
|
||||
*/
|
||||
|
|
|
|||
Loading…
Reference in New Issue