Commit fff3c83c authored by suhuiguang's avatar suhuiguang

feat(jyjc): 技术参数调整

1.锅炉增加技术参数 2.结果接收同步调整
parent e1349b45
...@@ -7,8 +7,8 @@ import com.yeejoin.amos.boot.module.jyjc.biz.event.listener.service.InspectionRe ...@@ -7,8 +7,8 @@ import com.yeejoin.amos.boot.module.jyjc.biz.event.listener.service.InspectionRe
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.transaction.event.TransactionalEventListener;
import javax.annotation.PostConstruct; import javax.annotation.PostConstruct;
import java.util.concurrent.BlockingQueue; import java.util.concurrent.BlockingQueue;
...@@ -22,7 +22,7 @@ import java.util.concurrent.LinkedBlockingQueue; ...@@ -22,7 +22,7 @@ import java.util.concurrent.LinkedBlockingQueue;
@Component @Component
@Slf4j @Slf4j
@RequiredArgsConstructor @RequiredArgsConstructor
public class InspectionDetectionSaveToDbEventListener implements ApplicationListener<InspectionDetectionSaveToDbEvent> { public class InspectionDetectionSaveToDbEventListener {
@Value("${inspect.info.save.thread.number:3}") @Value("${inspect.info.save.thread.number:3}")
private int threadNumber; private int threadNumber;
...@@ -32,7 +32,7 @@ public class InspectionDetectionSaveToDbEventListener implements ApplicationList ...@@ -32,7 +32,7 @@ public class InspectionDetectionSaveToDbEventListener implements ApplicationList
private final InspectionResultProcessor updateService; private final InspectionResultProcessor updateService;
@Override @TransactionalEventListener(value = InspectionDetectionSaveToDbEvent.class)
public void onApplicationEvent(InspectionDetectionSaveToDbEvent event) { public void onApplicationEvent(InspectionDetectionSaveToDbEvent event) {
log.info("收到检验检测信息插入或者更新消息:{}", JSONObject.toJSONString(event.getJyjcInspectionResultList())); log.info("收到检验检测信息插入或者更新消息:{}", JSONObject.toJSONString(event.getJyjcInspectionResultList()));
blockingQueue.addAll(event.getJyjcInspectionResultList()); blockingQueue.addAll(event.getJyjcInspectionResultList());
......
...@@ -60,9 +60,10 @@ public class SingleEquipResultDataProcessor implements SupportableResultDataProc ...@@ -60,9 +60,10 @@ public class SingleEquipResultDataProcessor implements SupportableResultDataProc
public void process(JyjcInspectionResult jyjcInspectionResult) { public void process(JyjcInspectionResult jyjcInspectionResult) {
IdxBizJgInspectionDetectionInfo info = new IdxBizJgInspectionDetectionInfo(); IdxBizJgInspectionDetectionInfo info = new IdxBizJgInspectionDetectionInfo();
QueryWrapper<IdxBizJgInspectionDetectionInfo> wrapper = new QueryWrapper<>(); QueryWrapper<IdxBizJgInspectionDetectionInfo> wrapper = new QueryWrapper<>();
wrapper.lambda().eq(IdxBizJgInspectionDetectionInfo::getInspectReportNo, jyjcInspectionResult.getSequenceNbr()); wrapper.lambda().eq(IdxBizJgInspectionDetectionInfo::getResultSeq, jyjcInspectionResult.getSequenceNbr());
List<IdxBizJgInspectionDetectionInfo> list = inspectionDetectionInfoMapper.selectList(wrapper); List<IdxBizJgInspectionDetectionInfo> list = inspectionDetectionInfoMapper.selectList(wrapper);
String record; String record;
//1.检验信息插入或者高新
if (CollectionUtils.isEmpty(list)) { if (CollectionUtils.isEmpty(list)) {
fillInspectionFields(jyjcInspectionResult, info); fillInspectionFields(jyjcInspectionResult, info);
info.setSequenceNbr(sequence.nextId() + ""); info.setSequenceNbr(sequence.nextId() + "");
...@@ -76,6 +77,8 @@ public class SingleEquipResultDataProcessor implements SupportableResultDataProc ...@@ -76,6 +77,8 @@ public class SingleEquipResultDataProcessor implements SupportableResultDataProc
record = info.getRecord(); record = info.getRecord();
bizEmqPublisher.sendInspectionMsgAfterSave(info, "update"); bizEmqPublisher.sendInspectionMsgAfterSave(info, "update");
} }
// 2.设备技术参数更新
inspectionResultService.updateTechParam(jyjcInspectionResult.getSequenceNbr(), record);
// 3.更新使用信息表最新的检验信息 // 3.更新使用信息表最新的检验信息
useInfoMapper.updateByRecord(jyjcInspectionResult.getEquipUnicode(), jyjcInspectionResult.getNextInspectionDate(), jyjcInspectionResult.getInspectionType(), jyjcInspectionResult.getApplicationNo()); useInfoMapper.updateByRecord(jyjcInspectionResult.getEquipUnicode(), jyjcInspectionResult.getNextInspectionDate(), jyjcInspectionResult.getInspectionType(), jyjcInspectionResult.getApplicationNo());
// 4.es更新下次检验日期 // 4.es更新下次检验日期
...@@ -95,6 +98,7 @@ public class SingleEquipResultDataProcessor implements SupportableResultDataProc ...@@ -95,6 +98,7 @@ public class SingleEquipResultDataProcessor implements SupportableResultDataProc
info.setProblemRemark(jyjcInspectionResult.getNonConformance()); info.setProblemRemark(jyjcInspectionResult.getNonConformance());
info.setNextInspectDate(jyjcInspectionResult.getNextInspectionDate()); info.setNextInspectDate(jyjcInspectionResult.getNextInspectionDate());
info.setSequenceCode(jyjcInspectionResult.getEquipUnicode()); info.setSequenceCode(jyjcInspectionResult.getEquipUnicode());
info.setResultSeq(jyjcInspectionResult.getSequenceNbr() + "");
info.setInspectOrgCode(jyjcInspectionResult.getInspectionUnitCode()); info.setInspectOrgCode(jyjcInspectionResult.getInspectionUnitCode());
info.setInspectReportNo(jyjcInspectionResult.getResultNo()); info.setInspectReportNo(jyjcInspectionResult.getResultNo());
info.setRecDate(new Date()); info.setRecDate(new Date());
......
...@@ -437,8 +437,8 @@ public class CommonServiceImpl { ...@@ -437,8 +437,8 @@ public class CommonServiceImpl {
info.setInspectStaffCode(model.getInspector()); info.setInspectStaffCode(model.getInspector());
info.setInspectReport(jybgFile.getAttachmentUrl()); info.setInspectReport(jybgFile.getAttachmentUrl());
info.setInspectConclusion(model.getInspectionConclusion()); info.setInspectConclusion(model.getInspectionConclusion());
// json字段暂时注释 info.setResultSeq(model.getSequenceNbr() + "");
// info.setProblemRemark(model.getNonConformance()); info.setProblemRemark(model.getNonConformance());
info.setNextInspectDate(model.getNextInspectionDate()); info.setNextInspectDate(model.getNextInspectionDate());
info.setSequenceCode(record); info.setSequenceCode(record);
info.setInspectOrgCode(model.getInspectionUnitCode()); info.setInspectOrgCode(model.getInspectionUnitCode());
......
...@@ -380,21 +380,7 @@ public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionR ...@@ -380,21 +380,7 @@ public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionR
} else { } else {
// 台套逻辑: 单条更新技术参数、检验信息更新或者插入、使用信息更新(数据库及es) // 台套逻辑: 单条更新技术参数、检验信息更新或者插入、使用信息更新(数据库及es)
// 1.动态更新技术参数 // 1.动态更新技术参数
List<DynamicColumnDto> columns = new ArrayList<>(); updateTechParam(model.getSequenceNbr(), model.getEquipUnicode());
JyjcInspectionResultParam param = iJyjcInspectionResultParamService.getOneParamByResultSeq(model.getSequenceNbr());
if (param != null) {
if (!ObjectUtils.isEmpty(param.getParamJson())) {
JSONObject paramObj = JSON.parseObject(param.getParamJson());
paramObj.forEach((k, v) -> {
DynamicColumnDto columnDto = new DynamicColumnDto();
columnDto.setColumnName(String.format("\"%s\"", StrUtil.toUnderlineCase(k).toUpperCase()));
columnDto.setColumnValue(v == null ? null : String.valueOf(v));
columns.add(columnDto);
});
String tableName = this.getTableName(param.getParamType());
jgCommonMapper.updateTechParamDynamic(tableName, model.getEquipUnicode(), columns);
}
}
// 2.检验信息更新或者插入 // 2.检验信息更新或者插入
IdxBizJgInspectionDetectionInfo info = new IdxBizJgInspectionDetectionInfo(); IdxBizJgInspectionDetectionInfo info = new IdxBizJgInspectionDetectionInfo();
QueryWrapper<IdxBizJgInspectionDetectionInfo> wrapper = new QueryWrapper<>(); QueryWrapper<IdxBizJgInspectionDetectionInfo> wrapper = new QueryWrapper<>();
...@@ -422,6 +408,24 @@ public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionR ...@@ -422,6 +408,24 @@ public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionR
return records; return records;
} }
public void updateTechParam(Long resultSeq, String record) {
List<DynamicColumnDto> columns = new ArrayList<>();
JyjcInspectionResultParam param = iJyjcInspectionResultParamService.getOneParamByResultSeq(resultSeq);
if (param != null) {
if (!ObjectUtils.isEmpty(param.getParamJson())) {
JSONObject paramObj = JSON.parseObject(param.getParamJson());
paramObj.forEach((k, v) -> {
DynamicColumnDto columnDto = new DynamicColumnDto();
columnDto.setColumnName(String.format("\"%s\"", StrUtil.toUnderlineCase(k).toUpperCase()));
columnDto.setColumnValue(v == null ? null : String.valueOf(v));
columns.add(columnDto);
});
String tableName = this.getTableName(param.getParamType());
jgCommonMapper.updateTechParamDynamic(tableName, record, columns);
}
}
}
private String getTableName(String paramType) { private String getTableName(String paramType) {
return String.format("\"%s\"", StrUtil.toUnderlineCase(paramType)); return String.format("\"%s\"", StrUtil.toUnderlineCase(paramType));
} }
......
...@@ -189,4 +189,36 @@ public class IdxBizJgTechParamsBoiler extends TzsBaseEntity { ...@@ -189,4 +189,36 @@ public class IdxBizJgTechParamsBoiler extends TzsBaseEntity {
@TableField(value = "\"SAFETY_ACCESSORIES_AND_RELATED_DEVICES\"") @TableField(value = "\"SAFETY_ACCESSORIES_AND_RELATED_DEVICES\"")
private String safetyAccessoriesAndRelatedDevices; private String safetyAccessoriesAndRelatedDevices;
/**
*安全阀校验报告编号
*/
@TableField("\"SAFETY_VALVE_VERIFICATION_REPORT_NO\"")
private String safetyValveVerificationReportNo;
/**
*安全阀整定压力
*/
@TableField("\"SAFETY_VALVE_SETTING_PRESSURE\"")
private String safetyValveSettingPressure;
/**
*水处理定期检验报告编号
*/
@TableField("\"WATER_TREATMENT_REGULAR_INSPECTION_REPORT_NO\"")
private String waterTreatmentRegularInspectionReportNo;
/**
*水处理定期检验结论
*/
@TableField("\"WATER_TREATMENT_REGULAR_INSPECTION_RESULT\"")
private String waterTreatmentRegularInspectionResult;
/**
*能效测试报告编号
*/
@TableField("\"ENERGY_EFFICIENCY_TEST_REPORT_NO\"")
private String energyEfficiencyTestReportNo;
} }
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