Commit a2f3a42b authored by suhuiguang's avatar suhuiguang

1.检验检验过滤技术参数核对

2.安全追溯检验结果信息发送
parent a5d7fe7e
package com.yeejoin.amos.api.openapi.face.orm.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.math.BigDecimal;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.typroject.tyboot.core.rdbms.orm.entity.BaseEntity;
import com.yeejoin.amos.api.openapi.face.orm.entity.AbstractBaseEntity;
import java.math.BigDecimal;
/**
* 安全追溯-锅炉
*
......@@ -28,9 +24,9 @@ public class EquipTechParamBoiler extends AbstractEquipBaseEntity {
/**
* * $column.comments
* */
*/
@TableField(value ="\"SUPERVISORY_CODE\"")
@TableField(value = "\"SUPERVISORY_CODE\"")
private String supervisoryCode;
/**
* * $column.comments
......@@ -39,166 +35,166 @@ public class EquipTechParamBoiler extends AbstractEquipBaseEntity {
/**
* * $column.comments
* */
*/
@TableField(value ="\"INSTANCE_ID\"")
@TableField(value = "\"INSTANCE_ID\"")
private String instanceId;
/**
* * $column.comments
* */
*/
@TableField(value ="\"STATUS\"")
@TableField(value = "\"STATUS\"")
private String status;
/**
* * 设备等级
* */
*/
@TableField(value ="\"DEVICE_LEVEL\"")
@TableField(value = "\"DEVICE_LEVEL\"")
private String deviceLevel;
/**
* * 额定蒸发量(热功率)
* */
*/
@TableField(value ="\"RATED_EVAPORATION_CAPACITY_THERMAL_POWER\"")
@TableField(value = "\"RATED_EVAPORATION_CAPACITY_THERMAL_POWER\"")
private BigDecimal ratedEvaporationCapacityThermalPower;
/**
* * 额定工作压力
* */
*/
@TableField(value ="\"RATED_WORKING_PRESSURE\"")
@TableField(value = "\"RATED_WORKING_PRESSURE\"")
private BigDecimal ratedWorkingPressure;
/**
* * 额定工作温度
* */
*/
@TableField(value ="\"RATED_OPERATING_TEMPERATURE\"")
@TableField(value = "\"RATED_OPERATING_TEMPERATURE\"")
private BigDecimal ratedOperatingTemperature;
/**
* * 设计热效率
* */
*/
@TableField(value ="\"DESIGN_THERMAL_EFFICIENCY\"")
@TableField(value = "\"DESIGN_THERMAL_EFFICIENCY\"")
private BigDecimal designThermalEfficiency;
/**
* * 给水温度
* */
*/
@TableField(value ="\"FEEDWATER_TEMPERATURE\"")
@TableField(value = "\"FEEDWATER_TEMPERATURE\"")
private BigDecimal feedwaterTemperature;
/**
* * 额定出/回水(油)温度
* */
*/
@TableField(value ="\"RATED_OUTLET_RETURN_WATER_OIL_TEMPERATURE\"")
@TableField(value = "\"RATED_OUTLET_RETURN_WATER_OIL_TEMPERATURE\"")
private BigDecimal ratedOutletReturnWaterOilTemperature;
/**
* * 锅炉本体水(油)容积
* */
*/
@TableField(value ="\"WATER_OIL_VOLUME_OF_BOILER_PROPER\"")
@TableField(value = "\"WATER_OIL_VOLUME_OF_BOILER_PROPER\"")
private BigDecimal waterOilVolumeOfBoilerProper;
/**
* * 整装锅炉本体液压试验介质/压力
* */
*/
@TableField(value ="\"HYDRAULIC_TEST_MEDIUM_PRESSURE_OF_PACKAGED_BOILER_BODY\"")
@TableField(value = "\"HYDRAULIC_TEST_MEDIUM_PRESSURE_OF_PACKAGED_BOILER_BODY\"")
private BigDecimal hydraulicTestMediumPressureOfPackagedBoilerBody;
/**
* * 再热器进(出)口温度
* */
*/
@TableField(value ="\"INLET_OUTLET_TEMPERATURE_OF_REHEATER\"")
@TableField(value = "\"INLET_OUTLET_TEMPERATURE_OF_REHEATER\"")
private BigDecimal inletOutletTemperatureOfReheater;
/**
* * 再热器进(出)口压力
* */
*/
@TableField(value ="\"REHEATER_INLET_OUTLET_PRESSURE\"")
@TableField(value = "\"REHEATER_INLET_OUTLET_PRESSURE\"")
private BigDecimal reheaterInletOutletPressure;
/**
* * 再热蒸汽流量
* */
*/
@TableField(value ="\"REHEAT_STEAM_FLOW\"")
@TableField(value = "\"REHEAT_STEAM_FLOW\"")
private BigDecimal reheatSteamFlow;
/**
* * 燃料(热源)种类
* */
*/
@TableField(value ="\"FUEL_TYPE\"")
@TableField(value = "\"FUEL_TYPE\"")
private String fuelType;
/**
* * 受压部件名称
* */
*/
@TableField(value ="\"NAME_OF_PRESSURE_PARTS\"")
@TableField(value = "\"NAME_OF_PRESSURE_PARTS\"")
private String nameOfPressureParts;
/**
* * 受压部件材料
* */
*/
@TableField(value ="\"MATERIAL_OF_PRESSURE_PARTS\"")
@TableField(value = "\"MATERIAL_OF_PRESSURE_PARTS\"")
private String materialOfPressureParts;
/**
* * 受压部件壁厚
* */
*/
@TableField(value ="\"WALL_THICKNESS_OF_PRESSURE_PARTS\"")
@TableField(value = "\"WALL_THICKNESS_OF_PRESSURE_PARTS\"")
private BigDecimal wallThicknessOfPressureParts;
/**
* * 受压部件无损检测方法
* */
*/
@TableField(value ="\"NON_DESTRUCTIVE_TESTING_METHODS_FOR_PRESSURE_PARTS\"")
@TableField(value = "\"NON_DESTRUCTIVE_TESTING_METHODS_FOR_PRESSURE_PARTS\"")
private String nonDestructiveTestingMethodsForPressureParts;
/**
* * 受压部件无损检测比例
* */
*/
@TableField(value ="\"PROPORTION_OF_NDT_FOR_PRESSURE_PARTS\"")
@TableField(value = "\"PROPORTION_OF_NDT_FOR_PRESSURE_PARTS\"")
private BigDecimal proportionOfNdtForPressureParts;
/**
* * 受压部件热处理温度
* */
*/
@TableField(value ="\"HEAT_TREATMENT_TEMPERATURE_OF_PRESSURE_PARTS\"")
@TableField(value = "\"HEAT_TREATMENT_TEMPERATURE_OF_PRESSURE_PARTS\"")
private BigDecimal heatTreatmentTemperatureOfPressureParts;
/**
* * 受压部件热处理时间
* */
*/
@TableField(value ="\"HEAT_TREATMENT_TIME_OF_PRESSURE_PARTS\"")
@TableField(value = "\"HEAT_TREATMENT_TIME_OF_PRESSURE_PARTS\"")
private BigDecimal heatTreatmentTimeOfPressureParts;
/**
* * 受压部件水(耐)压试验介质
* */
*/
@TableField(value ="\"HYDROSTATIC_TEST_MEDIUM\"")
@TableField(value = "\"HYDROSTATIC_TEST_MEDIUM\"")
private String hydrostaticTestMedium;
/**
* * 受压部件水(耐)压试验压力
* */
*/
@TableField(value ="\"HYDROSTATIC_TEST_PRESSURE\"")
@TableField(value = "\"HYDROSTATIC_TEST_PRESSURE\"")
private BigDecimal hydrostaticTestPressure;
/**
* * 燃烧方式
* */
*/
@TableField(value ="\"COMBUSTION_MODE\"")
@TableField(value = "\"COMBUSTION_MODE\"")
private String combustionMode;
/**
* * 有机热载体锅炉气密试验介质/压力
* */
*/
@TableField(value ="\"GL_AIRTIGHT_TEST\"")
@TableField(value = "\"GL_AIRTIGHT_TEST\"")
private BigDecimal glAirtightTest;
/**
* * 安装附件与有关装置
* */
*/
@TableField(value ="\"SAFETY_ACCESSORIES_AND_RELATED_DEVICES\"")
@TableField(value = "\"SAFETY_ACCESSORIES_AND_RELATED_DEVICES\"")
private String safetyAccessoriesAndRelatedDevices;
}
......@@ -143,12 +143,6 @@ public class InspectionApplicationPushEventListener implements ApplicationListen
}
}
private List<String> getCanDealInspectionType() {
List<String> canDealInspectionTypes = new ArrayList<>(JDJY_ARRAY);
canDealInspectionTypes.addAll(DSJ_ARRAY);
return canDealInspectionTypes;
}
private void pushData2Kafka(String dockingUnitCode, JyjcInspectionApplicationPushLog pushLog) {
// 发送kafka指定的主题
String topic = String.format(INSPECTION_APPLICATION_PUSH_TOPIC, dockingUnitCode);
......@@ -171,6 +165,12 @@ public class InspectionApplicationPushEventListener implements ApplicationListen
return pushLog;
}
private List<String> getCanDealInspectionType() {
List<String> canDealInspectionTypes = new ArrayList<>(JDJY_ARRAY);
canDealInspectionTypes.addAll(DSJ_ARRAY);
return canDealInspectionTypes;
}
private String buildData(long traceId, JyjcInspectionApplicationModel applicationModel) {
InspectionApplicationPushData pushData = new InspectionApplicationPushData();
BeanUtil.copyProperties(applicationModel, pushData);
......
......@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Sequence;
import com.yeejoin.amos.boot.module.jyjc.api.entity.JyjcInspectionResult;
import com.yeejoin.amos.boot.module.jyjc.biz.event.InspectionDetectionSaveToDbEvent;
import com.yeejoin.amos.boot.module.jyjc.biz.event.publisher.BizEmqPublisher;
import com.yeejoin.amos.boot.module.jyjc.biz.service.impl.CommonserviceImpl;
import com.yeejoin.amos.boot.module.ymt.api.entity.InspectionDetectionInfo;
import com.yeejoin.amos.boot.module.ymt.api.entity.TzsUserInfo;
......@@ -44,8 +45,14 @@ public class InspectionDetectionSaveToDbEventListener implements ApplicationList
@Autowired
InspectionDetectionInfoMapper inspectionDetectionInfoMapper;
@Autowired
BizEmqPublisher bizEmqPublisher;
private BlockingQueue<JyjcInspectionResult> blockingQueue = new LinkedBlockingQueue<>();
@Override
public void onApplicationEvent(InspectionDetectionSaveToDbEvent event) {
log.info("收到检验检测信息插入或者更新消息:{}", JSONObject.toJSONString(event.getJyjcInspectionResultList()));
......@@ -65,13 +72,15 @@ public class InspectionDetectionSaveToDbEventListener implements ApplicationList
wrapper.lambda().eq(InspectionDetectionInfo::getInspectReportNo, jyjcInspectionResult.getResultNo());
List<InspectionDetectionInfo> list = inspectionDetectionInfoMapper.selectList(wrapper);
if (CollectionUtils.isEmpty(list)) {
extracted(jyjcInspectionResult, info);
fillInspectionFields(jyjcInspectionResult, info);
info.setSequenceNbr(sequence.nextId() + "");
inspectionDetectionInfoMapper.insert(info);
bizEmqPublisher.sendInspectionMsgAfterSave(info, "insert");
} else {
info = list.get(0);
extracted(jyjcInspectionResult, info);
fillInspectionFields(jyjcInspectionResult, info);
inspectionDetectionInfoMapper.updateById(info);
bizEmqPublisher.sendInspectionMsgAfterSave(info, "update");
}
} catch (Exception e) {
log.error(e.getMessage(), e);
......@@ -82,7 +91,11 @@ public class InspectionDetectionSaveToDbEventListener implements ApplicationList
}
}
private void extracted(JyjcInspectionResult jyjcInspectionResult, InspectionDetectionInfo info) {
private void fillInspectionFields(JyjcInspectionResult jyjcInspectionResult, InspectionDetectionInfo info) {
info.setInspectOrgName(jyjcInspectionResult.getInspectionTypeName());
info.setInspectType(jyjcInspectionResult.getInspectionType());
info.setRecord(jyjcInspectionResult.getEquipUnicode());
......
package com.yeejoin.amos.boot.module.jyjc.biz.event.publisher;
import com.alibaba.fastjson.JSON;
import com.yeejoin.amos.boot.module.ymt.api.entity.InspectionDetectionInfo;
import lombok.extern.slf4j.Slf4j;
import org.eclipse.paho.client.mqttv3.MqttException;
import org.springframework.stereotype.Component;
import org.typroject.tyboot.component.emq.EmqKeeper;
/**
* @author Administrator
*/
@Component
@Slf4j
public class BizEmqPublisher {
private EmqKeeper emqKeeper;
public BizEmqPublisher(EmqKeeper emqKeeper) {
this.emqKeeper = emqKeeper;
}
/**
* 检验检测结果入库消息
*/
private static final String INSPECTION_DETECTION_SAVE_TO_DB_TOPIC_PREFIX = "safetyProblemTracing/jy/bj";
public void sendInspectionMsgAfterSave(InspectionDetectionInfo info, String type) {
try {
emqKeeper.getMqttClient().publish(this.buildSave2DbEmqTopic(type), JSON.toJSONBytes(info), 2, false);
} catch (MqttException e) {
log.error("发送检验检测信息入库消息失败", e);
}
}
private String buildSave2DbEmqTopic(String type) {
return String.format("%s/%s", INSPECTION_DETECTION_SAVE_TO_DB_TOPIC_PREFIX, type);
}
}
......@@ -14,7 +14,7 @@ import com.yeejoin.amos.boot.module.jyjc.api.mapper.JyjcBaseMapper;
import com.yeejoin.amos.boot.module.jyjc.api.model.TaskModelDto;
import com.yeejoin.amos.boot.module.jyjc.api.model.WorkflowResultDto;
import com.yeejoin.amos.boot.module.jyjc.biz.service.impl.CmWorkflowServiceImpl;
import com.yeejoin.amos.boot.module.jyjc.biz.utils.JsonUtils;
import com.yeejoin.amos.boot.module.jyjc.biz.util.JsonUtils;
import com.yeejoin.amos.boot.module.ymt.api.enums.FlowStatusEnum;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.systemctl.Systemctl;
......
......@@ -6,7 +6,7 @@ import com.yeejoin.amos.boot.module.jyjc.api.entity.JyjcInspectionResultParam;
import com.yeejoin.amos.boot.module.jyjc.api.mapper.JyjcInspectionResultParamMapper;
import com.yeejoin.amos.boot.module.jyjc.api.service.IJyjcInspectionResultParamService;
import com.yeejoin.amos.boot.module.jyjc.api.model.JyjcInspectionResultParamModel;
import com.yeejoin.amos.boot.module.jyjc.biz.utils.JsonUtils;
import com.yeejoin.amos.boot.module.jyjc.biz.util.JsonUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.io.Resource;
import org.springframework.util.ObjectUtils;
......
......@@ -26,8 +26,9 @@ import com.yeejoin.amos.boot.module.jyjc.api.service.IJyjcInspectionResultParamS
import com.yeejoin.amos.boot.module.jyjc.api.service.IJyjcInspectionResultService;
import com.yeejoin.amos.boot.module.jyjc.biz.event.InspectionDetectionSaveToDbEvent;
import com.yeejoin.amos.boot.module.jyjc.biz.event.UseInfoSaveToDbEvent;
import com.yeejoin.amos.boot.module.jyjc.biz.event.publisher.BizEmqPublisher;
import com.yeejoin.amos.boot.module.jyjc.biz.event.publisher.EventPublisher;
import com.yeejoin.amos.boot.module.jyjc.biz.utils.JsonUtils;
import com.yeejoin.amos.boot.module.jyjc.biz.util.JsonUtils;
import com.yeejoin.amos.boot.module.ymt.api.entity.InspectionDetectionInfo;
import com.yeejoin.amos.boot.module.ymt.api.entity.TzsUserInfo;
import com.yeejoin.amos.boot.module.ymt.api.enums.EquipmentClassifityEnum;
......@@ -108,6 +109,9 @@ public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionR
@Autowired
EventPublisher eventPublisher;
@Autowired
BizEmqPublisher bizEmqPublisher;
/**
* 检验检测单位分页查询
*/
......@@ -264,10 +268,14 @@ public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionR
extracted(model, info, jybgFile);
info.setSequenceNbr(sequence.nextId() + "");
inspectionDetectionInfoMapper.insert(info);
// 对方不查询库 所以无事务操作
bizEmqPublisher.sendInspectionMsgAfterSave(info, "insert");
} else {
info = list.get(0);
extracted(model, info, jybgFile);
inspectionDetectionInfoMapper.updateById(info);
// 对方不查询库 所以无事务操作
bizEmqPublisher.sendInspectionMsgAfterSave(info, "update");
}
//更新使用信息表
useInfoMapper.updateByRecord(model.getEquipUnicode(), model.getNextInspectionDate(), model.getInspectionType(), model.getApplicationNo());
......
package com.yeejoin.amos.boot.module.jyjc.biz.util;
/**
* @author Administrator
*/
public class JyjcConstant {
/**
* 技术参数json类型字段
*/
public static final String[] TECH_PARAM_JSON_FIELDS = {"safetyAccessoriesAndRelatedDevices", "gasCylinderAccessories"};
}
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