异常消息定时任务处理修改
This commit is contained in:
parent
733a01d1b4
commit
70dcd7add5
|
|
@ -10,6 +10,7 @@ import com.bonus.common.domain.mainDatabase.po.EnterprisePersonnel;
|
|||
import com.bonus.common.domain.mainDatabase.po.ErrorInfo;
|
||||
import com.bonus.common.domain.mainDatabase.po.PersonnelCertificate;
|
||||
import com.bonus.common.domain.mainDatabase.vo.EnterprisePersonnelVo;
|
||||
import com.bonus.common.domain.mainDatabase.vo.EnterpriseVo;
|
||||
import com.bonus.common.utils.CertificateUtil;
|
||||
import com.bonus.common.utils.ValidatorsUtils;
|
||||
import com.bonus.file.service.FileUploadService;
|
||||
|
|
@ -67,7 +68,30 @@ public class PersonnelService {
|
|||
* @date 2025/10/22 16:18
|
||||
*/
|
||||
public List<EnterprisePersonnelVo> getList(EnterprisePersonnelDto dto) {
|
||||
return imdPersonnelService.getList(dto);
|
||||
List<EnterprisePersonnelVo> list = imdPersonnelService.getList(dto);
|
||||
for (EnterprisePersonnelVo vo : list) {
|
||||
// 查询人员相关证件id
|
||||
List<Long> businessIds = imdErrorInfoService.getCertificateIds(vo);
|
||||
ErrorInfo errorQueryDto = createErrorQueryDto(vo,businessIds);
|
||||
// 查询异常消息
|
||||
List<String> errorList = imdErrorInfoService.getErrorInfoByTable(errorQueryDto);
|
||||
vo.setErrorInfos(errorList);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建查询条件
|
||||
* @param vo
|
||||
* @return ErrorInfo
|
||||
* @author cwchen
|
||||
* @date 2025/11/17 13:27
|
||||
*/
|
||||
public static ErrorInfo createErrorQueryDto(EnterprisePersonnelVo vo,List<Long> businessIds){
|
||||
ErrorInfo errorInfo = new ErrorInfo();
|
||||
errorInfo.setSourceTable(TableConstants.TB_PERSONNEL_CERTIFICATE);
|
||||
errorInfo.setBusinessIds(businessIds);
|
||||
return errorInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -119,7 +143,7 @@ public class PersonnelService {
|
|||
item.getPersonnelCertificate().getCertificateType(),
|
||||
item.getPersonnelCertificate().getPersonnelCertificateId(),
|
||||
dto.getEnterpriseId(),
|
||||
TableConstants.TB_ENTERPRISE_PERSONNEL);
|
||||
TableConstants.TB_PERSONNEL_CERTIFICATE);
|
||||
if (Objects.nonNull(errorInfo)) {
|
||||
errorInfos.add(errorInfo);
|
||||
}
|
||||
|
|
@ -217,7 +241,7 @@ public class PersonnelService {
|
|||
item.getPersonnelCertificate().getCertificateType(),
|
||||
item.getPersonnelCertificate().getPersonnelCertificateId(),
|
||||
dto.getEnterpriseId(),
|
||||
TableConstants.TB_ENTERPRISE_PERSONNEL);
|
||||
TableConstants.TB_PERSONNEL_CERTIFICATE);
|
||||
if (Objects.nonNull(errorInfo)) {
|
||||
errorInfos.add(errorInfo);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
package com.bonus.common.domain.mainDatabase.po;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
|
@ -37,6 +39,11 @@ public class ErrorInfo {
|
|||
*/
|
||||
private Long businessId;
|
||||
|
||||
/**
|
||||
* 业务ids
|
||||
*/
|
||||
private List<Long> businessIds;
|
||||
|
||||
/**
|
||||
* 业务类型(字典表配置)
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -54,6 +54,11 @@ public class EnterprisePersonnelVo {
|
|||
*/
|
||||
private String employmentYears;
|
||||
|
||||
/**
|
||||
* 异常信息
|
||||
*/
|
||||
private List<String> errorInfos;
|
||||
|
||||
/**人员详情*/
|
||||
@Data
|
||||
public static class PersonnelDetailVo {
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ public class CertificateUtil {
|
|||
CERTIFICATE_ERROR_MAP.put("constructor_certificate", "【建造师证书】已过期");
|
||||
CERTIFICATE_ERROR_MAP.put("safety_assessment_certificate_b", "【安全考核B证】已过期");
|
||||
CERTIFICATE_ERROR_MAP.put("safety_assessment_certificate_c", "【安全考核C证】已过期");
|
||||
CERTIFICATE_ERROR_MAP.put("professional_title_certificate", "【质检员证】已过期");
|
||||
CERTIFICATE_ERROR_MAP.put("professional_title_certificate", "【职称证】已过期");
|
||||
CERTIFICATE_ERROR_MAP.put("quality_inspector_certificate", "【质检员证】已过期");
|
||||
CERTIFICATE_ERROR_MAP.put("construction_worker_certificate", "【施工员证】已过期");
|
||||
CERTIFICATE_ERROR_MAP.put("materials_officer_certificate", "【材料员证】已过期");
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.bonus.mainDataBase.mapper;
|
||||
|
||||
import com.bonus.common.domain.mainDatabase.po.ErrorInfo;
|
||||
import com.bonus.common.domain.mainDatabase.vo.EnterprisePersonnelVo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
|
|
@ -75,4 +76,13 @@ public interface IMDErrorInfoMapper {
|
|||
* @date 2025/11/17 14:29
|
||||
*/
|
||||
List<ErrorInfo> getErrorInfoByBusiness(@Param("list") List<Long> businessIds,@Param("tableName") String tableName);
|
||||
|
||||
/**
|
||||
* 查询人员相关证件id
|
||||
* @param vo
|
||||
* @return List<Long>
|
||||
* @author cwchen
|
||||
* @date 2025/11/17 15:46
|
||||
*/
|
||||
List<Long> getCertificateIds(EnterprisePersonnelVo vo);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.bonus.mainDataBase.service;
|
||||
|
||||
import com.bonus.common.domain.mainDatabase.po.ErrorInfo;
|
||||
import com.bonus.common.domain.mainDatabase.vo.EnterprisePersonnelVo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
|
@ -73,4 +74,13 @@ public interface IMDErrorInfoService {
|
|||
* @date 2025/11/17 14:28
|
||||
*/
|
||||
List<ErrorInfo> getErrorInfoByBusiness(List<Long> businessIds, String tbEnterprise);
|
||||
|
||||
/**
|
||||
* 查询人员相关证件
|
||||
* @param vo
|
||||
* @return List<Long>
|
||||
* @author cwchen
|
||||
* @date 2025/11/17 15:45
|
||||
*/
|
||||
List<Long> getCertificateIds(EnterprisePersonnelVo vo);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.bonus.mainDataBase.service.impl;
|
||||
|
||||
import com.bonus.common.domain.mainDatabase.po.ErrorInfo;
|
||||
import com.bonus.common.domain.mainDatabase.vo.EnterprisePersonnelVo;
|
||||
import com.bonus.mainDataBase.mapper.IMDErrorInfoMapper;
|
||||
import com.bonus.mainDataBase.service.IMDErrorInfoService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
|
@ -54,4 +55,9 @@ public class MDErrorInfoServiceImpl implements IMDErrorInfoService {
|
|||
public List<ErrorInfo> getErrorInfoByBusiness(List<Long> businessIds, String tableName) {
|
||||
return imdErrorInfoMapper.getErrorInfoByBusiness(businessIds,tableName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Long> getCertificateIds(EnterprisePersonnelVo vo) {
|
||||
return imdErrorInfoMapper.getCertificateIds(vo);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
<if test="enterpriseName!=null and enterpriseName!=''">
|
||||
AND INSTR(te.enterprise_name,#{enterpriseName}) > 0
|
||||
</if>
|
||||
ORDER BY update_time DESC
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
|
||||
<!--查询企业库知识库数量-->
|
||||
|
|
|
|||
|
|
@ -61,7 +61,16 @@
|
|||
|
||||
<!--查询异常消息-->
|
||||
<select id="getErrorInfoByTable" resultType="java.lang.String">
|
||||
SELECT error_content FROM tb_error_info WHERE source_table = #{sourceTable} AND business_id = #{businessId}
|
||||
SELECT error_content FROM tb_error_info WHERE source_table = #{sourceTable}
|
||||
<if test="businessId != null">
|
||||
AND business_id = #{businessId}
|
||||
</if>
|
||||
<if test="businessId == null and businessIds !=null and businessIds.size() > 0">
|
||||
AND business_id IN
|
||||
<foreach collection="businessIds" open="(" close=")" separator="," item="item">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<!--根据业务id和来源表查询已存在的异常消息-->
|
||||
|
|
@ -74,4 +83,9 @@
|
|||
#{item}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<!--查询人员相关证件id-->
|
||||
<select id="getCertificateIds" resultType="java.lang.Long">
|
||||
SELECT personnel_certificate_id FROM tb_personnel_certificate WHERE personnel_id = #{personnelId} AND del_flag = '0'
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -108,11 +108,12 @@
|
|||
<!--企业知识库->技术方案库->技术方案库类别是否重复-->
|
||||
<select id="isRepeat" resultType="java.lang.Integer">
|
||||
<if test="params.technicalSolutionTypeId == null">
|
||||
SELECT COUNT(*) FROM tb_enterprise_technical_solution_type WHERE technical_solution_name = #{params.technicalSolutionName} AND del_flag = '0';
|
||||
SELECT COUNT(*) FROM tb_enterprise_technical_solution_type WHERE technical_solution_name = #{params.technicalSolutionName} AND enterprise_id = #{params.enterpriseId} AND del_flag = '0';
|
||||
</if>
|
||||
<if test="params.technicalSolutionTypeId != null">
|
||||
SELECT COUNT(*) FROM tb_enterprise_technical_solution_type
|
||||
WHERE technical_solution_type_id != #{params.technicalSolutionTypeId}
|
||||
AND enterprise_id = #{params.enterpriseId}
|
||||
AND technical_solution_name = #{params.technicalSolutionName} AND del_flag = '0'
|
||||
</if>
|
||||
</select>
|
||||
|
|
|
|||
Loading…
Reference in New Issue