Commit 5edaf980 authored by tianbo's avatar tianbo

refactor(jg): 优化超设计使用年限消息发送功能

- 添加日志记录,增加对发送消息内容的记录 - 修复日志打印错误信息时的格式问题
parent e88a06fd
...@@ -730,12 +730,14 @@ public class JgOverDesignServiceLifeServiceImpl extends BaseService<JgOverDesign ...@@ -730,12 +730,14 @@ public class JgOverDesignServiceLifeServiceImpl extends BaseService<JgOverDesign
* @param equipmentLists 设备信息 * @param equipmentLists 设备信息
*/ */
private void sendOverDesignMessage(List<Map<String, Object>> equipmentLists) { private void sendOverDesignMessage(List<Map<String, Object>> equipmentLists) {
log.info("发送超设计使用年限原始消息equipmentLists---->{}", equipmentLists);
JSONArray jsonArray = JSON.parseArray(JSON.toJSONString(equipmentLists)); JSONArray jsonArray = JSON.parseArray(JSON.toJSONString(equipmentLists));
log.info("发送超设计使用年限原始消息jsonArray---->{}", jsonArray);
if (CollectionUtil.isNotEmpty(jsonArray)) { if (CollectionUtil.isNotEmpty(jsonArray)) {
try { try {
emqKeeper.getMqttClient().publish(SafetyProblemTypeEnum.SJNXDJ.getTopic(), jsonArray.toString().getBytes(StandardCharsets.UTF_8), 2, false); emqKeeper.getMqttClient().publish(SafetyProblemTypeEnum.SJNXDJ.getTopic(), jsonArray.toString().getBytes(StandardCharsets.UTF_8), 2, false);
} catch (MqttException e) { } catch (MqttException e) {
log.error("发送超设计使用年限消息失败---->{}" + e.getMessage()); log.error("发送超设计使用年限消息失败---->{}", e.getMessage());
throw new RuntimeException(e); throw new RuntimeException(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