Pu Zhibing
2024-09-20 a146097a15d719c60af3cdeb4de1f21aa7b5ca8d
ruoyi-service/ruoyi-integration/src/main/java/com/ruoyi/integration/rocket/produce/EnhanceProduce.java
@@ -2,6 +2,8 @@
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.ruoyi.integration.api.model.ErrorMessage;
import com.ruoyi.integration.api.model.ParameterSetting;
import com.ruoyi.integration.iotda.constant.SendTagConstant;
import com.ruoyi.integration.rocket.model.*;
import com.ruoyi.integration.rocket.util.RocketMQEnhanceTemplate;
@@ -54,6 +56,16 @@
        message.setSource(SendTagConstant.END_CHARGE);
        return rocketMQEnhanceTemplate.send(TOPIC+SendTagConstant.END_CHARGE, SendTagConstant.END_CHARGE, message);
    }
    /**
     * 错误报文
     */
    public SendResult errorMessageMessage(ErrorMessageMessage message) {
        // 设置业务key
        message.setKey(UUID.randomUUID().toString());
        // 设置消息来源,便于查询
        message.setSource(SendTagConstant.ERROR_MESSAGE);
        return rocketMQEnhanceTemplate.send(TOPIC+SendTagConstant.ERROR_MESSAGE, SendTagConstant.ERROR_MESSAGE, message);
    }
    /**
     * 计费模型验证请求
@@ -98,6 +110,16 @@
        message.setSource(SendTagConstant.CHARGING_HANDSHAKE);
        return rocketMQEnhanceTemplate.send(TOPIC+SendTagConstant.CHARGING_HANDSHAKE, SendTagConstant.CHARGING_HANDSHAKE, message);
    }
    /**
     * 参数设置
     */
    public SendResult parameterSettingMessage(ParameterSettingMessage message) {
        // 设置业务key
        message.setKey(UUID.randomUUID().toString());
        // 设置消息来源,便于查询
        message.setSource(SendTagConstant.PARAMETER_SETTING);
        return rocketMQEnhanceTemplate.send(TOPIC+SendTagConstant.PARAMETER_SETTING, SendTagConstant.PARAMETER_SETTING, message);
    }
    /**
     * 充电阶段BMS中止