Commit 03c71331 authored by suhuiguang's avatar suhuiguang

feat(综合搜索):实体类创建

1.人员、企业、设备 2.技术参数整理
parent 74cfb15f
......@@ -22,7 +22,7 @@ public class BoilerTechParamsDefine implements ITechParamDefine {
private String ratedEvaporationCapacityThermalPower;
@TechnicalParameter(key = "ratedWorkingPressure", label = "额定工作压力", type = TechnicalParameter.ParamType.BIG_DECIMAL)
@TechnicalParameter(key = "ratedWorkingPressure", label = "额定工作压力", type = TechnicalParameter.ParamType.STRING)
private String ratedWorkingPressure;
......
......@@ -4,6 +4,7 @@ import com.yeejoin.amos.boot.biz.common.annotation.TechnicalParameter;
import com.yeejoin.amos.boot.module.common.api.dto.TechParamItem;
import lombok.Data;
import lombok.experimental.Accessors;
import lombok.extern.slf4j.Slf4j;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.DateFormat;
import org.springframework.data.elasticsearch.annotations.Document;
......@@ -22,6 +23,7 @@ import java.util.List;
*/
@Data
@Accessors(chain = true)
@Slf4j
@Document(indexName = "idx_biz_equipment_info")
public class ESEquipmentInfo {
......@@ -418,7 +420,7 @@ public class ESEquipmentInfo {
break;
}
} catch (Exception e) {
this.strValue = "CONV_ERROR:" + value;
log.error("CONV_ERROR", e);
}
}
......
package com.yeejoin.amos.boot.module.common.biz.service.impl;
import com.yeejoin.amos.boot.module.common.api.dao.ESEquipmentCategory;
import com.yeejoin.amos.boot.module.common.api.dto.ESEquipmentCategoryDto;
import lombok.RequiredArgsConstructor;
import org.springframework.data.elasticsearch.core.ElasticsearchOperations;
import org.springframework.stereotype.Service;
@Service
@RequiredArgsConstructor
public class EquipmentCategoryService {
private final ESEquipmentCategory equipmentCategoryDao;
private final ElasticsearchOperations elasticsearchOperations;
public ESEquipmentCategoryDto saveWithImmediateRefresh(ESEquipmentCategoryDto dto) {
ESEquipmentCategoryDto saved = equipmentCategoryDao.save(dto);
// 手动触发索引刷新
elasticsearchOperations.indexOps(ESEquipmentCategoryDto.class).refresh();
return saved;
}
}
......@@ -1512,16 +1512,16 @@ public class DataHandlerServiceImpl {
.select(IdxBizJgFactoryInfo::getRecord, IdxBizJgFactoryInfo::getProduceUnitCreditCode));
IdxBizJgInspectionDetectionInfo inspectionDetectionInfo = iIdxBizJgInspectionDetectionInfoService.queryNewestDetailByRecord(record);
IdxBizJgMaintenanceRecordInfo lastMaintenanceRecordInfo = maintenanceRecordInfoService.queryNewestDetailByRecord(record);
esEquipmentInfo.setINSPECT_DATE(inspectionDetectionInfo != null ? inspectionDetectionInfo.getInspectDate() : null);
esEquipmentInfo.setNEXT_INSPECT_DATE(inspectionDetectionInfo != null ? inspectionDetectionInfo.getNextInspectDate() : null);
esEquipmentInfo.setINSPECT_DATE(inspectionDetectionInfo.getSequenceNbr() != null ? inspectionDetectionInfo.getInspectDate() : null);
esEquipmentInfo.setNEXT_INSPECT_DATE(inspectionDetectionInfo.getSequenceNbr() != null ? inspectionDetectionInfo.getNextInspectDate() : null);
esEquipmentInfo.setDesignUnitCreditCode(designInfo.getDesignUnitCreditCode());
esEquipmentInfo.setMAINTAIN_UNIT(lastMaintenanceRecordInfo.getMeUnitCreditCode());
esEquipmentInfo.setMAINTAIN_UNIT_NAME(lastMaintenanceRecordInfo.getMeUnitName());
esEquipmentInfo.setDesignUnitName(designInfo.getDesignUnitName());
esEquipmentInfo.setCreateDate(useInfo.getCreateDate());
esEquipmentInfo.setProduceUnitCreditCode(factoryInfo.getProduceUnitCreditCode());
esEquipmentInfo.setInspections(Collections.singletonList(BeanUtil.copyProperties(inspectionDetectionInfo, ESEquipmentInfo.Inspection.class)));
esEquipmentInfo.setMaintenances(Collections.singletonList(BeanUtil.copyProperties(lastMaintenanceRecordInfo, ESEquipmentInfo.Maintenance.class)));
esEquipmentInfo.setInspections(inspectionDetectionInfo.getSequenceNbr() != null ? Collections.singletonList(BeanUtil.copyProperties(inspectionDetectionInfo, ESEquipmentInfo.Inspection.class)) : new ArrayList<>());
esEquipmentInfo.setMaintenances(lastMaintenanceRecordInfo.getSequenceNbr() != null ? Collections.singletonList(BeanUtil.copyProperties(lastMaintenanceRecordInfo, ESEquipmentInfo.Maintenance.class)) : new ArrayList<>());
esEquipmentInfo.setTechParams(this.buildTechParamByEquList(record, categoryEs.getEQU_LIST_CODE()));
} catch (Exception e) {
// 异常数据跳过
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment