Merge remote-tracking branch 'origin/dev-tmp1' into dev-tmp1
commit
5391ec6bf6
|
|
@ -133,4 +133,10 @@ public class QualFilingController {
|
||||||
return qualFilingApi.checkItem(id);
|
return qualFilingApi.checkItem(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation("查看是否能新增资质")
|
||||||
|
@GetMapping("/checkNewQual")
|
||||||
|
public SingleResponse<Boolean> checkNewQual() {
|
||||||
|
return qualFilingApi.checkNewQual();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -116,6 +116,7 @@ public class OrgEquipmentExecutor implements OrgEquipmentApi {
|
||||||
domainQuery.setInstrumentType(query.getInstrumentType());
|
domainQuery.setInstrumentType(query.getInstrumentType());
|
||||||
domainQuery.setDeviceType(query.getDeviceType());
|
domainQuery.setDeviceType(query.getDeviceType());
|
||||||
domainQuery.setEnableFlag(query.getEnableFlag());
|
domainQuery.setEnableFlag(query.getEnableFlag());
|
||||||
|
domainQuery.setIndustryCode(query.getIndustryCode());
|
||||||
|
|
||||||
PageResult<OrgEquipmentEntity> pageResult = orgEquipmentDomainService.page(domainQuery);
|
PageResult<OrgEquipmentEntity> pageResult = orgEquipmentDomainService.page(domainQuery);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -241,14 +241,11 @@ public class OrgPersonnelExecutor implements OrgPersonnelApi {
|
||||||
PageResult<OrgPersonnelEntity> pageResult = orgPersonnelDomainService.page(domainQuery);
|
PageResult<OrgPersonnelEntity> pageResult = orgPersonnelDomainService.page(domainQuery);
|
||||||
|
|
||||||
List<OrgPersonnelCO> records = pageResult.getRecords().stream()
|
List<OrgPersonnelCO> records = pageResult.getRecords().stream()
|
||||||
.map(entity -> {
|
.map(orgPersonnelConvertor::toCO)
|
||||||
OrgPersonnelCO co = orgPersonnelConvertor.toCO(entity);
|
|
||||||
enrich(co);
|
|
||||||
return co;
|
|
||||||
})
|
|
||||||
.collect(java.util.stream.Collectors.toList());
|
.collect(java.util.stream.Collectors.toList());
|
||||||
|
if (orgPersonnelViewEnricher != null) {
|
||||||
fillCertsBatch(records);
|
orgPersonnelViewEnricher.enrichPersonnelBatch(records);
|
||||||
|
}
|
||||||
|
|
||||||
return PageResponse.of(records, pageResult.getTotal());
|
return PageResponse.of(records, pageResult.getTotal());
|
||||||
}
|
}
|
||||||
|
|
@ -398,42 +395,6 @@ public class OrgPersonnelExecutor implements OrgPersonnelApi {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量查询证书并填充到CO列表中,一次查询后按人员分组分别设置注安证书和评价师证书
|
|
||||||
*/
|
|
||||||
private void fillCertsBatch(List<OrgPersonnelCO> records) {
|
|
||||||
if (orgPersonnelCertDomainService == null || CollectionUtils.isEmpty(records)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
List<Long> personnelIds = records.stream()
|
|
||||||
.map(OrgPersonnelCO::getId)
|
|
||||||
.filter(Objects::nonNull)
|
|
||||||
.collect(Collectors.toList());
|
|
||||||
if (CollectionUtils.isEmpty(personnelIds)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
List<OrgPersonnelCertEntity> certs = orgPersonnelCertDomainService.listByPersonnelIds(personnelIds);
|
|
||||||
if (CollectionUtils.isEmpty(certs)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
Map<Long, List<OrgPersonnelCertEntity>> certMap = certs.stream()
|
|
||||||
.collect(Collectors.groupingBy(OrgPersonnelCertEntity::getPersonnelId));
|
|
||||||
for (OrgPersonnelCO co : records) {
|
|
||||||
List<OrgPersonnelCertEntity> personCerts = certMap.get(co.getId());
|
|
||||||
if (CollectionUtils.isEmpty(personCerts)) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
for (OrgPersonnelCertEntity cert : personCerts) {
|
|
||||||
OrgPersonnelCertCO certCO = orgPersonnelCertConvertor.entityToCO(cert);
|
|
||||||
if (CertTypeCodeEnum.REGISTERED_SAFETY_ENGINEER.getCode().equals(cert.getCertTypeCode())) {
|
|
||||||
co.setRegisteredSafetyEngineerCert(certCO);
|
|
||||||
} else if (CertTypeCodeEnum.EVALUATOR.getCode().equals(cert.getCertTypeCode())) {
|
|
||||||
co.setEvaluatorCert(certCO);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SingleResponse<OrgPersonnelCO> updateOriginFace(OrgPersonnelUpdateOriginFaceCmd cmd) {
|
public SingleResponse<OrgPersonnelCO> updateOriginFace(OrgPersonnelUpdateOriginFaceCmd cmd) {
|
||||||
OrgPersonnelEntity existing = orgPersonnelDomainService.get(cmd.getId());
|
OrgPersonnelEntity existing = orgPersonnelDomainService.get(cmd.getId());
|
||||||
|
|
|
||||||
|
|
@ -304,6 +304,14 @@ public class QualFilingExecutor implements QualFilingApi {
|
||||||
return SingleResponse.success(ComplianceCheckUtil.complianceCheck(cmdSync, false));
|
return SingleResponse.success(ComplianceCheckUtil.complianceCheck(cmdSync, false));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public SingleResponse<Boolean> checkNewQual() {
|
||||||
|
boolean exists = qualFilingMapper.exists(new LambdaQueryWrapper<QualFilingDO>()
|
||||||
|
.eq(QualFilingDO::getOrgId, ThreadLocalUserInfoAdapter.getOrgId())
|
||||||
|
.eq(QualFilingDO::getDeleteEnum, BooleanQAEnum.FALSE.getValue()));
|
||||||
|
return SingleResponse.success(!exists);
|
||||||
|
}
|
||||||
|
|
||||||
private QualFilingCO toLegacyCO(QualFilingEntity entity) {
|
private QualFilingCO toLegacyCO(QualFilingEntity entity) {
|
||||||
if (entity == null) {
|
if (entity == null) {
|
||||||
return null;
|
return null;
|
||||||
|
|
|
||||||
|
|
@ -1,25 +1,39 @@
|
||||||
package org.qinan.safetyeval.app.support;
|
package org.qinan.safetyeval.app.support;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import org.qinan.safetyeval.client.co.OrgPersonnelCO;
|
import org.qinan.safetyeval.client.co.OrgPersonnelCO;
|
||||||
|
import org.qinan.safetyeval.client.co.OrgPersonnelCertCO;
|
||||||
import org.qinan.safetyeval.client.co.OrgResignApplyCO;
|
import org.qinan.safetyeval.client.co.OrgResignApplyCO;
|
||||||
|
import org.qinan.safetyeval.domain.constant.CertTypeCodeEnum;
|
||||||
|
import org.qinan.safetyeval.domain.constant.basic.IndustryEnum;
|
||||||
|
import org.qinan.safetyeval.domain.constant.basic.ProfessionalCapabilityEnum;
|
||||||
import org.qinan.safetyeval.domain.entity.*;
|
import org.qinan.safetyeval.domain.entity.*;
|
||||||
import org.qinan.safetyeval.domain.gateway.*;
|
import org.qinan.safetyeval.domain.gateway.*;
|
||||||
import org.qinan.safetyeval.domain.major.gateway.BasicDisciplineMajorGateway;
|
import org.qinan.safetyeval.domain.major.gateway.BasicDisciplineMajorGateway;
|
||||||
import org.qinan.safetyeval.domain.major.model.BasicDisciplineMajorE;
|
import org.qinan.safetyeval.domain.major.model.BasicDisciplineMajorE;
|
||||||
import org.qinan.safetyeval.domain.query.OrgPersonnelCertQuery;
|
import org.qinan.safetyeval.domain.query.OrgPersonnelCertQuery;
|
||||||
import org.qinan.safetyeval.domain.query.PageResult;
|
import org.qinan.safetyeval.domain.query.PageResult;
|
||||||
import org.qinan.safetyeval.domain.constant.basic.IndustryEnum;
|
|
||||||
import org.qinan.safetyeval.domain.constant.basic.ProfessionalCapabilityEnum;
|
|
||||||
import org.qinan.safetyeval.domain.standards.gateway.IndustryProfessionalStandardsGateway;
|
import org.qinan.safetyeval.domain.standards.gateway.IndustryProfessionalStandardsGateway;
|
||||||
import org.qinan.safetyeval.domain.standards.model.IndustryProfessionalStandardsE;
|
import org.qinan.safetyeval.domain.standards.model.IndustryProfessionalStandardsE;
|
||||||
|
import org.qinan.safetyeval.infrastructure.convertor.OrgPersonnelCertConvertor;
|
||||||
|
import org.qinan.safetyeval.infrastructure.dataobject.OrgDepartmentDO;
|
||||||
|
import org.qinan.safetyeval.infrastructure.dataobject.OrgPersonnelChangeDO;
|
||||||
|
import org.qinan.safetyeval.infrastructure.dataobject.OrgPositionDO;
|
||||||
|
import org.qinan.safetyeval.infrastructure.dataobject.OrgResignApplyDO;
|
||||||
|
import org.qinan.safetyeval.infrastructure.mapper.OrgDepartmentMapper;
|
||||||
|
import org.qinan.safetyeval.infrastructure.mapper.OrgPersonnelChangeMapper;
|
||||||
|
import org.qinan.safetyeval.infrastructure.mapper.OrgPositionMapper;
|
||||||
|
import org.qinan.safetyeval.infrastructure.mapper.OrgResignApplyMapper;
|
||||||
|
import org.qinan.safetyeval.infrastructure.persistence.domainobject.BasicDisciplineMajorDO;
|
||||||
|
import org.qinan.safetyeval.infrastructure.persistence.domainobject.IndustryProfessionalStandardsDO;
|
||||||
|
import org.qinan.safetyeval.infrastructure.persistence.mapper.BasicDisciplineMajorMapper;
|
||||||
|
import org.qinan.safetyeval.infrastructure.persistence.mapper.IndustryProfessionalStandardsMapper;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.util.CollectionUtils;
|
||||||
import org.springframework.util.StringUtils;
|
import org.springframework.util.StringUtils;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.*;
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Objects;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -28,6 +42,8 @@ import java.util.stream.Collectors;
|
||||||
@Component
|
@Component
|
||||||
public class OrgPersonnelViewEnricher {
|
public class OrgPersonnelViewEnricher {
|
||||||
|
|
||||||
|
private static final int CERT_DISPLAY_LIMIT = 200;
|
||||||
|
|
||||||
@Autowired(required = false)
|
@Autowired(required = false)
|
||||||
private OrgDepartmentGateway orgDepartmentGateway;
|
private OrgDepartmentGateway orgDepartmentGateway;
|
||||||
|
|
||||||
|
|
@ -52,6 +68,27 @@ public class OrgPersonnelViewEnricher {
|
||||||
@Autowired(required = false)
|
@Autowired(required = false)
|
||||||
private IndustryProfessionalStandardsGateway industryProfessionalStandardsGateway;
|
private IndustryProfessionalStandardsGateway industryProfessionalStandardsGateway;
|
||||||
|
|
||||||
|
@Autowired(required = false)
|
||||||
|
private OrgDepartmentMapper orgDepartmentMapper;
|
||||||
|
|
||||||
|
@Autowired(required = false)
|
||||||
|
private OrgPositionMapper orgPositionMapper;
|
||||||
|
|
||||||
|
@Autowired(required = false)
|
||||||
|
private BasicDisciplineMajorMapper basicDisciplineMajorMapper;
|
||||||
|
|
||||||
|
@Autowired(required = false)
|
||||||
|
private OrgPersonnelChangeMapper orgPersonnelChangeMapper;
|
||||||
|
|
||||||
|
@Autowired(required = false)
|
||||||
|
private OrgResignApplyMapper orgResignApplyMapper;
|
||||||
|
|
||||||
|
@Autowired(required = false)
|
||||||
|
private IndustryProfessionalStandardsMapper industryProfessionalStandardsMapper;
|
||||||
|
|
||||||
|
@Autowired(required = false)
|
||||||
|
private OrgPersonnelCertConvertor orgPersonnelCertConvertor;
|
||||||
|
|
||||||
public void enrichPersonnel(OrgPersonnelCO co) {
|
public void enrichPersonnel(OrgPersonnelCO co) {
|
||||||
if (co == null) {
|
if (co == null) {
|
||||||
return;
|
return;
|
||||||
|
|
@ -77,57 +114,274 @@ public class OrgPersonnelViewEnricher {
|
||||||
OrgPersonnelCertQuery certQuery = new OrgPersonnelCertQuery();
|
OrgPersonnelCertQuery certQuery = new OrgPersonnelCertQuery();
|
||||||
certQuery.setPersonnelId(co.getId());
|
certQuery.setPersonnelId(co.getId());
|
||||||
certQuery.setPageNum(1L);
|
certQuery.setPageNum(1L);
|
||||||
certQuery.setPageSize(200L);
|
certQuery.setPageSize((long) CERT_DISPLAY_LIMIT);
|
||||||
PageResult<OrgPersonnelCertEntity> certPage = orgPersonnelCertGateway.page(certQuery);
|
PageResult<OrgPersonnelCertEntity> certPage = orgPersonnelCertGateway.page(certQuery);
|
||||||
String certNames = certPage.getRecords().stream()
|
applyCertDisplayFields(co, certPage.getRecords());
|
||||||
.map(OrgPersonnelCertEntity::getCertName)
|
|
||||||
.filter(StringUtils::hasText)
|
|
||||||
.collect(Collectors.joining("、"));
|
|
||||||
co.setCertNames(certNames);
|
|
||||||
// 构建能力汇总: "专业范围:专业能力;专业范围:专业能力"
|
|
||||||
// 当 professionalCapabilityCode 为空时,尝试通过 industryProfessionalStandardsId 查标准表获取
|
|
||||||
List<OrgPersonnelCertEntity> records = certPage.getRecords();
|
|
||||||
Map<Long, String> standardsCodeCache = new HashMap<>();
|
|
||||||
if (industryProfessionalStandardsGateway != null) {
|
|
||||||
records.stream()
|
|
||||||
.filter(c -> !StringUtils.hasText(c.getProfessionalCapabilityCode())
|
|
||||||
&& c.getIndustryProfessionalStandardsId() != null)
|
|
||||||
.map(OrgPersonnelCertEntity::getIndustryProfessionalStandardsId)
|
|
||||||
.distinct()
|
|
||||||
.forEach(sid -> {
|
|
||||||
IndustryProfessionalStandardsE standards = industryProfessionalStandardsGateway.getById(sid);
|
|
||||||
if (standards != null && StringUtils.hasText(standards.getProfessionalCapabilityCode())) {
|
|
||||||
standardsCodeCache.put(sid, standards.getProfessionalCapabilityCode());
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
String abilityNames = records.stream()
|
|
||||||
.filter(c -> StringUtils.hasText(c.getBusinessScope()))
|
|
||||||
.map(c -> {
|
|
||||||
String code = c.getProfessionalCapabilityCode();
|
|
||||||
if (!StringUtils.hasText(code) && standardsCodeCache.containsKey(c.getIndustryProfessionalStandardsId())) {
|
|
||||||
code = standardsCodeCache.get(c.getIndustryProfessionalStandardsId());
|
|
||||||
}
|
|
||||||
if (!StringUtils.hasText(code)) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
// 转换 code 为中文名称
|
|
||||||
IndustryEnum industryEnum = IndustryEnum.ofCode(c.getBusinessScope());
|
|
||||||
String scopeName = industryEnum != null ? industryEnum.getValue() : c.getBusinessScope();
|
|
||||||
ProfessionalCapabilityEnum capEnum = ProfessionalCapabilityEnum.ofCode(code);
|
|
||||||
String capName = capEnum != null ? capEnum.getValue() : code;
|
|
||||||
return scopeName + ":" + capName;
|
|
||||||
})
|
|
||||||
.filter(Objects::nonNull)
|
|
||||||
.collect(Collectors.joining(";"));
|
|
||||||
co.setAbilityNames(abilityNames);
|
|
||||||
}
|
}
|
||||||
enrichChangeSummary(co);
|
enrichChangeSummary(co);
|
||||||
}
|
}
|
||||||
if (co.getEmploymentStatusCode() == null) {
|
applyEmploymentDefault(co);
|
||||||
co.setEmploymentStatusCode(1);
|
}
|
||||||
co.setEmploymentStatusName("在职");
|
|
||||||
|
/**
|
||||||
|
* 分页列表批量 enrich,结果与逐条 {@link #enrichPersonnel(OrgPersonnelCO)} + 证书批量填充等价。
|
||||||
|
*/
|
||||||
|
public void enrichPersonnelBatch(List<OrgPersonnelCO> records) {
|
||||||
|
if (CollectionUtils.isEmpty(records)) {
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Set<Long> deptIds = new HashSet<>();
|
||||||
|
Set<Long> postIds = new HashSet<>();
|
||||||
|
Set<Long> majorIds = new HashSet<>();
|
||||||
|
List<Long> personnelIds = new ArrayList<>();
|
||||||
|
for (OrgPersonnelCO co : records) {
|
||||||
|
if (co == null) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (co.getDeptId() != null) {
|
||||||
|
deptIds.add(co.getDeptId());
|
||||||
|
}
|
||||||
|
if (co.getPostId() != null) {
|
||||||
|
postIds.add(co.getPostId());
|
||||||
|
}
|
||||||
|
if (co.getBasicDisciplineMajorId() != null) {
|
||||||
|
majorIds.add(co.getBasicDisciplineMajorId());
|
||||||
|
}
|
||||||
|
if (co.getId() != null) {
|
||||||
|
personnelIds.add(co.getId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<Long, String> deptNameMap = loadDeptNameMap(deptIds);
|
||||||
|
Map<Long, String> postNameMap = loadPostNameMap(postIds);
|
||||||
|
Map<Long, String> majorNameMap = loadMajorNameMap(majorIds);
|
||||||
|
Map<Long, List<OrgPersonnelCertEntity>> certMap = loadCertMap(personnelIds);
|
||||||
|
Map<Long, Integer> changeCountMap = loadChangeCountMap(personnelIds);
|
||||||
|
Map<Long, List<OrgResignApplyEntity>> resignMap = loadResignMap(personnelIds);
|
||||||
|
Map<Long, String> standardsCodeCache = buildStandardsCodeCacheBatch(certMap.values().stream()
|
||||||
|
.flatMap(Collection::stream)
|
||||||
|
.collect(Collectors.toList()));
|
||||||
|
|
||||||
|
for (OrgPersonnelCO co : records) {
|
||||||
|
if (co == null) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (co.getDeptId() != null) {
|
||||||
|
co.setDeptName(deptNameMap.get(co.getDeptId()));
|
||||||
|
}
|
||||||
|
if (co.getPostId() != null) {
|
||||||
|
co.setPostName(postNameMap.get(co.getPostId()));
|
||||||
|
}
|
||||||
|
if (co.getBasicDisciplineMajorId() != null) {
|
||||||
|
co.setBasicDisciplineMajorName(majorNameMap.get(co.getBasicDisciplineMajorId()));
|
||||||
|
}
|
||||||
|
if (co.getId() != null) {
|
||||||
|
List<OrgPersonnelCertEntity> personCerts = certMap.getOrDefault(co.getId(), Collections.emptyList());
|
||||||
|
applyCertDisplayFields(co, limitCertsForDisplay(personCerts), standardsCodeCache);
|
||||||
|
applyNestedCerts(co, personCerts);
|
||||||
|
co.setChangeCount(changeCountMap.getOrDefault(co.getId(), 0));
|
||||||
|
applyResignDisplay(co, resignMap.get(co.getId()));
|
||||||
|
}
|
||||||
|
applyEmploymentDefault(co);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void applyCertDisplayFields(OrgPersonnelCO co, List<OrgPersonnelCertEntity> records) {
|
||||||
|
applyCertDisplayFields(co, records, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void applyCertDisplayFields(OrgPersonnelCO co, List<OrgPersonnelCertEntity> records,
|
||||||
|
Map<Long, String> standardsCodeCache) {
|
||||||
|
if (CollectionUtils.isEmpty(records)) {
|
||||||
|
co.setCertNames("");
|
||||||
|
co.setAbilityNames("");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
co.setCertNames(buildCertNames(records));
|
||||||
|
if (standardsCodeCache == null) {
|
||||||
|
standardsCodeCache = buildStandardsCodeCache(records);
|
||||||
|
}
|
||||||
|
co.setAbilityNames(buildAbilityNames(records, standardsCodeCache));
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<OrgPersonnelCertEntity> limitCertsForDisplay(List<OrgPersonnelCertEntity> certs) {
|
||||||
|
if (CollectionUtils.isEmpty(certs)) {
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
if (certs.size() <= CERT_DISPLAY_LIMIT) {
|
||||||
|
return certs;
|
||||||
|
}
|
||||||
|
return new ArrayList<>(certs.subList(0, CERT_DISPLAY_LIMIT));
|
||||||
|
}
|
||||||
|
|
||||||
|
private String buildCertNames(List<OrgPersonnelCertEntity> records) {
|
||||||
|
return records.stream()
|
||||||
|
.map(OrgPersonnelCertEntity::getCertName)
|
||||||
|
.filter(StringUtils::hasText)
|
||||||
|
.collect(Collectors.joining("、"));
|
||||||
|
}
|
||||||
|
|
||||||
|
private Map<Long, String> buildStandardsCodeCache(List<OrgPersonnelCertEntity> records) {
|
||||||
|
Map<Long, String> standardsCodeCache = new HashMap<>();
|
||||||
|
if (industryProfessionalStandardsGateway == null) {
|
||||||
|
return standardsCodeCache;
|
||||||
|
}
|
||||||
|
records.stream()
|
||||||
|
.filter(c -> !StringUtils.hasText(c.getProfessionalCapabilityCode())
|
||||||
|
&& c.getIndustryProfessionalStandardsId() != null)
|
||||||
|
.map(OrgPersonnelCertEntity::getIndustryProfessionalStandardsId)
|
||||||
|
.distinct()
|
||||||
|
.forEach(sid -> {
|
||||||
|
IndustryProfessionalStandardsE standards = industryProfessionalStandardsGateway.getById(sid);
|
||||||
|
if (standards != null && StringUtils.hasText(standards.getProfessionalCapabilityCode())) {
|
||||||
|
standardsCodeCache.put(sid, standards.getProfessionalCapabilityCode());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return standardsCodeCache;
|
||||||
|
}
|
||||||
|
|
||||||
|
private String buildAbilityNames(List<OrgPersonnelCertEntity> records, Map<Long, String> standardsCodeCache) {
|
||||||
|
return records.stream()
|
||||||
|
.filter(c -> StringUtils.hasText(c.getBusinessScope()))
|
||||||
|
.map(c -> {
|
||||||
|
String code = c.getProfessionalCapabilityCode();
|
||||||
|
if (!StringUtils.hasText(code) && standardsCodeCache.containsKey(c.getIndustryProfessionalStandardsId())) {
|
||||||
|
code = standardsCodeCache.get(c.getIndustryProfessionalStandardsId());
|
||||||
|
}
|
||||||
|
if (!StringUtils.hasText(code)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
IndustryEnum industryEnum = IndustryEnum.ofCode(c.getBusinessScope());
|
||||||
|
String scopeName = industryEnum != null ? industryEnum.getValue() : c.getBusinessScope();
|
||||||
|
ProfessionalCapabilityEnum capEnum = ProfessionalCapabilityEnum.ofCode(code);
|
||||||
|
String capName = capEnum != null ? capEnum.getValue() : code;
|
||||||
|
return scopeName + ":" + capName;
|
||||||
|
})
|
||||||
|
.filter(Objects::nonNull)
|
||||||
|
.collect(Collectors.joining(";"));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void applyNestedCerts(OrgPersonnelCO co, List<OrgPersonnelCertEntity> personCerts) {
|
||||||
|
if (orgPersonnelCertConvertor == null || CollectionUtils.isEmpty(personCerts)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
for (OrgPersonnelCertEntity cert : personCerts) {
|
||||||
|
OrgPersonnelCertCO certCO = orgPersonnelCertConvertor.entityToCO(cert);
|
||||||
|
if (CertTypeCodeEnum.REGISTERED_SAFETY_ENGINEER.getCode().equals(cert.getCertTypeCode())) {
|
||||||
|
co.setRegisteredSafetyEngineerCert(certCO);
|
||||||
|
} else if (CertTypeCodeEnum.EVALUATOR.getCode().equals(cert.getCertTypeCode())) {
|
||||||
|
co.setEvaluatorCert(certCO);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private Map<Long, String> loadDeptNameMap(Set<Long> deptIds) {
|
||||||
|
if (CollectionUtils.isEmpty(deptIds) || orgDepartmentMapper == null) {
|
||||||
|
return Collections.emptyMap();
|
||||||
|
}
|
||||||
|
return orgDepartmentMapper.selectBatchIds(deptIds).stream()
|
||||||
|
.filter(Objects::nonNull)
|
||||||
|
.collect(Collectors.toMap(OrgDepartmentDO::getId, OrgDepartmentDO::getDeptName, (a, b) -> a));
|
||||||
|
}
|
||||||
|
|
||||||
|
private Map<Long, String> loadPostNameMap(Set<Long> postIds) {
|
||||||
|
if (CollectionUtils.isEmpty(postIds) || orgPositionMapper == null) {
|
||||||
|
return Collections.emptyMap();
|
||||||
|
}
|
||||||
|
return orgPositionMapper.selectBatchIds(postIds).stream()
|
||||||
|
.filter(Objects::nonNull)
|
||||||
|
.collect(Collectors.toMap(OrgPositionDO::getId, OrgPositionDO::getPositionName, (a, b) -> a));
|
||||||
|
}
|
||||||
|
|
||||||
|
private Map<Long, String> loadMajorNameMap(Set<Long> majorIds) {
|
||||||
|
if (CollectionUtils.isEmpty(majorIds) || basicDisciplineMajorMapper == null) {
|
||||||
|
return Collections.emptyMap();
|
||||||
|
}
|
||||||
|
return basicDisciplineMajorMapper.selectBatchIds(majorIds).stream()
|
||||||
|
.filter(Objects::nonNull)
|
||||||
|
.collect(Collectors.toMap(BasicDisciplineMajorDO::getId, BasicDisciplineMajorDO::getProfessionalName, (a, b) -> a));
|
||||||
|
}
|
||||||
|
|
||||||
|
private Map<Long, List<OrgPersonnelCertEntity>> loadCertMap(List<Long> personnelIds) {
|
||||||
|
if (CollectionUtils.isEmpty(personnelIds) || orgPersonnelCertGateway == null) {
|
||||||
|
return Collections.emptyMap();
|
||||||
|
}
|
||||||
|
List<OrgPersonnelCertEntity> certs = orgPersonnelCertGateway.listByPersonnelIds(personnelIds);
|
||||||
|
if (CollectionUtils.isEmpty(certs)) {
|
||||||
|
return Collections.emptyMap();
|
||||||
|
}
|
||||||
|
return certs.stream().collect(Collectors.groupingBy(OrgPersonnelCertEntity::getPersonnelId));
|
||||||
|
}
|
||||||
|
|
||||||
|
private Map<Long, Integer> loadChangeCountMap(List<Long> personnelIds) {
|
||||||
|
if (CollectionUtils.isEmpty(personnelIds) || orgPersonnelChangeMapper == null) {
|
||||||
|
return Collections.emptyMap();
|
||||||
|
}
|
||||||
|
LambdaQueryWrapper<OrgPersonnelChangeDO> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
wrapper.select(OrgPersonnelChangeDO::getPersonnelId);
|
||||||
|
wrapper.in(OrgPersonnelChangeDO::getPersonnelId, personnelIds);
|
||||||
|
wrapper.eq(OrgPersonnelChangeDO::getDeleteEnum, "false");
|
||||||
|
List<OrgPersonnelChangeDO> changes = orgPersonnelChangeMapper.selectList(wrapper);
|
||||||
|
if (CollectionUtils.isEmpty(changes)) {
|
||||||
|
return Collections.emptyMap();
|
||||||
|
}
|
||||||
|
return changes.stream()
|
||||||
|
.collect(Collectors.groupingBy(OrgPersonnelChangeDO::getPersonnelId,
|
||||||
|
Collectors.collectingAndThen(Collectors.counting(), Long::intValue)));
|
||||||
|
}
|
||||||
|
|
||||||
|
private Map<Long, List<OrgResignApplyEntity>> loadResignMap(List<Long> personnelIds) {
|
||||||
|
if (CollectionUtils.isEmpty(personnelIds) || orgResignApplyMapper == null) {
|
||||||
|
return Collections.emptyMap();
|
||||||
|
}
|
||||||
|
LambdaQueryWrapper<OrgResignApplyDO> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
wrapper.in(OrgResignApplyDO::getPersonnelId, personnelIds);
|
||||||
|
wrapper.eq(OrgResignApplyDO::getDeleteEnum, "false");
|
||||||
|
wrapper.orderByDesc(OrgResignApplyDO::getApplyTime);
|
||||||
|
wrapper.orderByDesc(OrgResignApplyDO::getId);
|
||||||
|
List<OrgResignApplyDO> applies = orgResignApplyMapper.selectList(wrapper);
|
||||||
|
if (CollectionUtils.isEmpty(applies)) {
|
||||||
|
return Collections.emptyMap();
|
||||||
|
}
|
||||||
|
Map<Long, List<OrgResignApplyEntity>> result = new LinkedHashMap<>();
|
||||||
|
for (OrgResignApplyDO apply : applies) {
|
||||||
|
result.computeIfAbsent(apply.getPersonnelId(), key -> new ArrayList<>()).add(toResignEntity(apply));
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
private OrgResignApplyEntity toResignEntity(OrgResignApplyDO dataObject) {
|
||||||
|
OrgResignApplyEntity entity = new OrgResignApplyEntity();
|
||||||
|
entity.setId(dataObject.getId());
|
||||||
|
entity.setPersonnelId(dataObject.getPersonnelId());
|
||||||
|
entity.setAuditStatusCode(dataObject.getAuditStatusCode());
|
||||||
|
return entity;
|
||||||
|
}
|
||||||
|
|
||||||
|
private Map<Long, String> buildStandardsCodeCacheBatch(List<OrgPersonnelCertEntity> allCerts) {
|
||||||
|
Map<Long, String> standardsCodeCache = new HashMap<>();
|
||||||
|
if (CollectionUtils.isEmpty(allCerts) || industryProfessionalStandardsMapper == null) {
|
||||||
|
return standardsCodeCache;
|
||||||
|
}
|
||||||
|
Set<Long> standardsIds = allCerts.stream()
|
||||||
|
.filter(c -> !StringUtils.hasText(c.getProfessionalCapabilityCode())
|
||||||
|
&& c.getIndustryProfessionalStandardsId() != null)
|
||||||
|
.map(OrgPersonnelCertEntity::getIndustryProfessionalStandardsId)
|
||||||
|
.collect(Collectors.toSet());
|
||||||
|
if (CollectionUtils.isEmpty(standardsIds)) {
|
||||||
|
return standardsCodeCache;
|
||||||
|
}
|
||||||
|
List<IndustryProfessionalStandardsDO> standardsList = industryProfessionalStandardsMapper.selectBatchIds(standardsIds);
|
||||||
|
if (CollectionUtils.isEmpty(standardsList)) {
|
||||||
|
return standardsCodeCache;
|
||||||
|
}
|
||||||
|
for (IndustryProfessionalStandardsDO standards : standardsList) {
|
||||||
|
if (standards != null && StringUtils.hasText(standards.getProfessionalCapabilityCode())) {
|
||||||
|
standardsCodeCache.put(standards.getId(), standards.getProfessionalCapabilityCode());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return standardsCodeCache;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void enrichChangeSummary(OrgPersonnelCO co) {
|
private void enrichChangeSummary(OrgPersonnelCO co) {
|
||||||
|
|
@ -135,6 +389,10 @@ public class OrgPersonnelViewEnricher {
|
||||||
co.setChangeCount(changes != null ? changes.size() : 0);
|
co.setChangeCount(changes != null ? changes.size() : 0);
|
||||||
|
|
||||||
List<OrgResignApplyEntity> applies = orgResignApplyGateway != null ? orgResignApplyGateway.listByPersonnelId(co.getId()) : null;
|
List<OrgResignApplyEntity> applies = orgResignApplyGateway != null ? orgResignApplyGateway.listByPersonnelId(co.getId()) : null;
|
||||||
|
applyResignDisplay(co, applies);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void applyResignDisplay(OrgPersonnelCO co, List<OrgResignApplyEntity> applies) {
|
||||||
if (applies == null || applies.isEmpty()) {
|
if (applies == null || applies.isEmpty()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -146,6 +404,13 @@ public class OrgPersonnelViewEnricher {
|
||||||
co.setResignAuditStatus(displayApply.getAuditStatusCode() != null ? displayApply.getAuditStatusCode() : 0);
|
co.setResignAuditStatus(displayApply.getAuditStatusCode() != null ? displayApply.getAuditStatusCode() : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void applyEmploymentDefault(OrgPersonnelCO co) {
|
||||||
|
if (co.getEmploymentStatusCode() == null) {
|
||||||
|
co.setEmploymentStatusCode(1);
|
||||||
|
co.setEmploymentStatusName("在职");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void enrichResignApply(OrgResignApplyCO co) {
|
public void enrichResignApply(OrgResignApplyCO co) {
|
||||||
if (co == null) {
|
if (co == null) {
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
|
|
@ -50,4 +50,6 @@ public interface QualFilingApi {
|
||||||
SingleResponse<QualFilingStatisticsCO> qualificationMonitoringPageStatistics();
|
SingleResponse<QualFilingStatisticsCO> qualificationMonitoringPageStatistics();
|
||||||
|
|
||||||
SingleResponse<List<QualFilingComplianceCheckResultCO>> checkItem(Long id);
|
SingleResponse<List<QualFilingComplianceCheckResultCO>> checkItem(Long id);
|
||||||
|
|
||||||
|
SingleResponse<Boolean> checkNewQual();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -27,4 +27,7 @@ public class OrgEquipmentPageQuery extends BasePageQuery {
|
||||||
|
|
||||||
@ApiModelProperty(value = "启用标识(1启用2禁用)")
|
@ApiModelProperty(value = "启用标识(1启用2禁用)")
|
||||||
private Long enableFlag;
|
private Long enableFlag;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "行业code")
|
||||||
|
private String industryCode;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,9 @@ package org.qinan.safetyeval.client.dto;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import javax.validation.constraints.Size;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 资质审核记录新增命令
|
* 资质审核记录新增命令
|
||||||
*
|
*
|
||||||
|
|
@ -11,21 +14,31 @@ import lombok.Data;
|
||||||
@Data
|
@Data
|
||||||
public class QualFilingReviewAddCmd {
|
public class QualFilingReviewAddCmd {
|
||||||
|
|
||||||
|
// 与库表 filing_id bigint NOT NULL 对齐
|
||||||
@ApiModelProperty(value = "备案申请id")
|
@ApiModelProperty(value = "备案申请id")
|
||||||
|
@NotNull(message = "备案申请id不能为空")
|
||||||
private Long filingId;
|
private Long filingId;
|
||||||
|
|
||||||
|
// 与库表 review_result varchar(32) 对齐
|
||||||
@ApiModelProperty(value = "审核结果(1通过2待定3不通过)")
|
@ApiModelProperty(value = "审核结果(1通过2待定3不通过)")
|
||||||
|
@Size(max = 32, message = "审核结果不能超过32字")
|
||||||
private String reviewResult;
|
private String reviewResult;
|
||||||
|
|
||||||
|
// 与库表 review_result_remark varchar(255) 对齐
|
||||||
@ApiModelProperty(value = "审核结果文字描述")
|
@ApiModelProperty(value = "审核结果文字描述")
|
||||||
|
@Size(max = 255, message = "审核结果文字描述不能超过255字")
|
||||||
private String reviewResultRemark;
|
private String reviewResultRemark;
|
||||||
|
|
||||||
@ApiModelProperty(value = "专家id")
|
@ApiModelProperty(value = "专家id")
|
||||||
private Long filingExpertId;
|
private Long filingExpertId;
|
||||||
|
|
||||||
|
// 与库表 filing_expert_name varchar(255) 对齐
|
||||||
@ApiModelProperty(value = "专家名称")
|
@ApiModelProperty(value = "专家名称")
|
||||||
|
@Size(max = 255, message = "专家名称不能超过255字")
|
||||||
private String filingExpertName;
|
private String filingExpertName;
|
||||||
|
|
||||||
|
// 与库表 review_opinion varchar(512) 对齐
|
||||||
@ApiModelProperty(value = "综合审核意见")
|
@ApiModelProperty(value = "综合审核意见")
|
||||||
|
@Size(max = 512, message = "综合审核意见不能超过512字")
|
||||||
private String reviewOpinion;
|
private String reviewOpinion;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package org.qinan.safetyeval.domain.query;
|
package org.qinan.safetyeval.domain.query;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -33,4 +34,7 @@ public class OrgEquipmentQuery {
|
||||||
|
|
||||||
/** 设备状态 */
|
/** 设备状态 */
|
||||||
private Long enableFlag;
|
private Long enableFlag;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "行业code")
|
||||||
|
private String industryCode;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -45,8 +45,8 @@ public class QualFilingDO extends BaseDO {
|
||||||
private Long originFilingId;
|
private Long originFilingId;
|
||||||
private String rejectReason;
|
private String rejectReason;
|
||||||
private Long filingReviewId;
|
private Long filingReviewId;
|
||||||
private java.time.LocalDateTime submitTime;
|
private LocalDateTime submitTime;
|
||||||
private java.time.LocalDateTime approveTime;
|
private LocalDateTime approveTime;
|
||||||
private Integer filingStatusCode;
|
private Integer filingStatusCode;
|
||||||
private String filingStatusName;
|
private String filingStatusName;
|
||||||
private Integer applyTypeCode;
|
private Integer applyTypeCode;
|
||||||
|
|
|
||||||
|
|
@ -82,6 +82,9 @@ public class OrgEquipmentGatewayImpl implements OrgEquipmentGateway {
|
||||||
if (query.getEnableFlag() != null) {
|
if (query.getEnableFlag() != null) {
|
||||||
wrapper.eq(OrgEquipmentDO::getEnableFlag, query.getEnableFlag());
|
wrapper.eq(OrgEquipmentDO::getEnableFlag, query.getEnableFlag());
|
||||||
}
|
}
|
||||||
|
if (StringUtils.hasText(query.getIndustryCode())) {
|
||||||
|
wrapper.eq(OrgEquipmentDO::getIndustryCode, query.getIndustryCode());
|
||||||
|
}
|
||||||
|
|
||||||
Page<OrgEquipmentDO> page = new Page<>(query.getPageNum(), query.getPageSize());
|
Page<OrgEquipmentDO> page = new Page<>(query.getPageNum(), query.getPageSize());
|
||||||
IPage<OrgEquipmentDO> result = orgEquipmentMapper.selectPage(page, wrapper);
|
IPage<OrgEquipmentDO> result = orgEquipmentMapper.selectPage(page, wrapper);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue