xuhy
2024-08-23 3e261beffdab4bfd58ebcf723496e7f78c618e44
ruoyi-service/ruoyi-integration/src/main/java/com/ruoyi/integration/iotda/utils/tools/MessageUtil.java
@@ -26,6 +26,30 @@
    private PlatformConfirmationChargingService platformConfirmationChargingService;
    @Autowired
    private PlatformStartChargingService platformStartChargingService;
    @Autowired
    private PlatformStopChargingService platformStopChargingService;
    @Autowired
    private ConfirmTransactionRecordService confirmTransactionRecordService;
    @Autowired
    private UpdateBalanceService updateBalanceService;
    @Autowired
    private SynchronizeOfflineCardService synchronizeOfflineCardService;
    @Autowired
    private ClearOfflineCardService clearOfflineCardService;
    @Autowired
    private QueryOfflineCardService queryOfflineCardService;
    @Autowired
    private WorkingParameterSettingService workingParameterSettingService;
    @Autowired
    private TimingSettingService timingSettingService;
    @Autowired
    private SetupBillingModelService setupBillingModelService;
    @Autowired
    private OpenOrCloseGroundLockService openOrCloseGroundLockService;
    @Autowired
    private PlatformRestartService platformRestartService;
    @Autowired
    private PlatformRemoteUpdateService platformRemoteUpdateService;
    /**
     * 登录认证应答
@@ -107,7 +131,123 @@
        return getMessageJsonString(platformStartCharging, ServiceIdConstant.PLATFORM_START_CHARGING);
    }
    /**
     * 运营平台远程停机
     * @param platformStopCharging 实体对象
     * @return
     */
    public String platformStopCharging(PlatformStopCharging platformStopCharging){
        platformStopChargingService.create(platformStopCharging);
        return getMessageJsonString(platformStopCharging, ServiceIdConstant.PLATFORM_STOP_CHARGING);
    }
    /**
     * 交易记录确认
     * @param confirmTransactionRecord 实体对象
     * @return
     */
    public String confirmTransactionRecord(ConfirmTransactionRecord confirmTransactionRecord){
        confirmTransactionRecordService.create(confirmTransactionRecord);
        return getMessageJsonString(confirmTransactionRecord, ServiceIdConstant.CONFIRM_TRANSACTION_RECORD);
    }
    /**
     * 远程账户余额更新
     * @param updateBalance 实体对象
     * @return
     */
    public String updateBalance(UpdateBalance updateBalance){
        updateBalanceService.create(updateBalance);
        return getMessageJsonString(updateBalance, ServiceIdConstant.UPDATE_BALANCE);
    }
    /**
     * 离线卡数据同步
     * @param synchronizeOfflineCard 实体对象
     * @return
     */
    public String synchronizeOfflineCard(SynchronizeOfflineCard synchronizeOfflineCard){
        synchronizeOfflineCardService.create(synchronizeOfflineCard);
        return getMessageJsonString(synchronizeOfflineCard, ServiceIdConstant.SYNCHRONIZE_OFFLINE_CARD);
    }
    /**
     * 离线卡数据清除
     * @param clearOfflineCard 实体对象
     * @return
     */
    public String clearOfflineCard(ClearOfflineCard clearOfflineCard){
        clearOfflineCardService.create(clearOfflineCard);
        return getMessageJsonString(clearOfflineCard, ServiceIdConstant.CLEAR_OFFLINE_CARD);
    }
    /**
     * 离线卡数据查询
     * @param queryOfflineCard 实体对象
     * @return
     */
    public String queryOfflineCard(QueryOfflineCard queryOfflineCard){
        queryOfflineCardService.create(queryOfflineCard);
        return getMessageJsonString(queryOfflineCard, ServiceIdConstant.QUERY_OFFLINE_CARD);
    }
    /**
     * 充电桩工作参数设置
     * @param workingParameterSetting 实体对象
     * @return
     */
    public String workingParameterSetting(WorkingParameterSetting workingParameterSetting){
        workingParameterSettingService.create(workingParameterSetting);
        return getMessageJsonString(workingParameterSetting, ServiceIdConstant.WORKING_PARAMETER_SETTING);
    }
    /**
     * 对时设置
     * @param timingSetting 实体对象
     * @return
     */
    public String timingSetting(TimingSetting timingSetting){
        timingSettingService.create(timingSetting);
        return getMessageJsonString(timingSetting, ServiceIdConstant.TIMING_SETTING);
    }
    /**
     * 计费模型设置
     * @param setupBillingModel 实体对象
     * @return
     */
    public String setupBillingModel(SetupBillingModel setupBillingModel){
        setupBillingModelService.create(setupBillingModel);
        return getMessageJsonString(setupBillingModel, ServiceIdConstant.SETUP_BILLING_MODEL);
    }
    /**
     * 遥控地锁升锁与降锁命令 (下行)
     * @param openOrCloseGroundLock 实体对象
     * @return
     */
    public String openOrCloseGroundLock(OpenOrCloseGroundLock openOrCloseGroundLock){
        openOrCloseGroundLockService.create(openOrCloseGroundLock);
        return getMessageJsonString(openOrCloseGroundLock, ServiceIdConstant.OPEN_OR_CLOSE_GROUND_LOCK);
    }
    /**
     * 远程重启
     * @param platformRestart 实体对象
     * @return
     */
    public String platformRestart(PlatformRestart platformRestart){
        platformRestartService.create(platformRestart);
        return getMessageJsonString(platformRestart, ServiceIdConstant.PLATFORM_RESTART);
    }
    /**
     * 远程更新
     * @param platformRemoteUpdate 实体对象
     * @return
     */
    public String platformRemoteUpdate(PlatformRemoteUpdate platformRemoteUpdate){
        platformRemoteUpdateService.create(platformRemoteUpdate);
        return getMessageJsonString(platformRemoteUpdate, ServiceIdConstant.PLATFORM_REMOTE_UPDATE);
    }
    /**
     * 统一封装消息