Browse Source

[0920] 通道管理增加启动、停止操作

taosj 2 tháng trước cách đây
mục cha
commit
a1b4fe6351

+ 3 - 1
forecast-backend-server/src/main/java/com/ufo/ElectricityServiceApplication.java

@@ -3,12 +3,14 @@ package com.ufo;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
+import org.springframework.scheduling.annotation.EnableScheduling;
 
 /**
  * 启动程序
- * 
+ *
  * @author ufo
  */
+@EnableScheduling
 @SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
 public class ElectricityServiceApplication
 {

+ 9 - 0
forecast-backend-server/src/main/java/com/ufo/module/system/service/ISysDictTypeService.java

@@ -34,6 +34,15 @@ public interface ISysDictTypeService
      */
     public List<SysDictData> selectDictDataByType(String dictType);
 
+
+    /**
+     * 根据字典类型查询字典数据(不使用缓存)
+     * 
+     * @param dictType 字典类型
+     * @return 字典数据集合信息
+     */
+    public List<SysDictData> selectDictDataByTypeWithoutCache(String dictType);
+
     /**
      * 根据字典类型ID查询信息
      * 

+ 5 - 0
forecast-backend-server/src/main/java/com/ufo/module/system/service/impl/SysDictTypeServiceImpl.java

@@ -87,6 +87,11 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService
         return null;
     }
 
+    @Override
+    public List<SysDictData> selectDictDataByTypeWithoutCache(String dictType) {
+        return dictDataMapper.selectDictDataByType(dictType);
+    }
+
     /**
      * 根据字典类型ID查询信息
      * 

+ 65 - 0
forecast-backend-server/src/main/java/com/ufo/project/gatewayapp/controller/ChannelController.java

@@ -0,0 +1,65 @@
+package com.ufo.project.gatewayapp.controller;
+
+import java.util.List;
+
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import com.ufo.base.framework.aspectj.lang.annotation.Log;
+import com.ufo.base.framework.aspectj.lang.enums.BusinessType;
+import com.ufo.base.framework.web.controller.BaseController;
+import com.ufo.base.framework.web.domain.AjaxResult;
+import com.ufo.project.gatewayapp.domain.ChannelStateRequest;
+import com.ufo.project.gatewayapp.domain.ChannelStatus;
+import com.ufo.project.gatewayapp.util.GatewayAppUtils;
+
+/**
+ * 网关通道Controller - 通道状态查询与启停操作
+ *
+ * @author ufo
+ * @date 2026-09-18
+ */
+@RestController
+@RequestMapping("/gatewayapp/channel")
+public class ChannelController extends BaseController
+{
+    /**
+     * 批量查询通道运行状态
+     */
+    @PreAuthorize("@ss.hasPermi('config:stationChannel:query')")
+    @PostMapping("/queryChannelState")
+    public AjaxResult queryChannelState(@RequestBody ChannelStateRequest request)
+    {
+        if (request == null || request.getIds() == null || request.getIds().isEmpty())
+        {
+            return success((Object) null);
+        }
+        List<ChannelStatus> statusList = GatewayAppUtils.queryChannelStatus(request.getIds());
+        return success(statusList);
+    }
+
+    /**
+     * 通道启停操作
+     *
+     * @param id      通道ID
+     * @param command 操作命令 0:停止, 1:启动和重启
+     */
+    @PreAuthorize("@ss.hasPermi('config:stationChannel:edit')")
+    @Log(title = "通道启停", businessType = BusinessType.OTHER)
+    @GetMapping("/controllerChannel")
+    public AjaxResult controllerChannel(@RequestParam(value = "id", required = false) Long id,
+            @RequestParam("command") int command)
+    {
+        if (id == null)
+        {
+            return success();
+        }
+        GatewayAppUtils.operationChannel(id, command);
+        return success();
+    }
+}

+ 25 - 0
forecast-backend-server/src/main/java/com/ufo/project/gatewayapp/domain/ChannelStateRequest.java

@@ -0,0 +1,25 @@
+package com.ufo.project.gatewayapp.domain;
+
+import java.util.List;
+
+/**
+ * 通道状态查询请求对象
+ *
+ * @author ufo
+ * @date 2026-09-18
+ */
+public class ChannelStateRequest
+{
+    /** 通道ID列表 */
+    private List<Long> ids;
+
+    public List<Long> getIds()
+    {
+        return ids;
+    }
+
+    public void setIds(List<Long> ids)
+    {
+        this.ids = ids;
+    }
+}

+ 66 - 0
forecast-backend-server/src/main/java/com/ufo/project/gatewayapp/domain/ChannelStatus.java

@@ -0,0 +1,66 @@
+package com.ufo.project.gatewayapp.domain;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+/**
+ * 网关通道状态对象
+ *
+ * @author ufo
+ * @date 2026-09-18
+ */
+public class ChannelStatus
+{
+    /** 未知 */
+    public static final int STATE_UNKNOWN = -1;
+
+    /** 未运行 */
+    public static final int STATE_STOPPED = 0;
+
+    /** 运行中 */
+    public static final int STATE_RUNNING = 1;
+
+    /** 通道ID */
+    private Long channelId;
+
+    /** 状态(-1未知,0未运行,1运行中) */
+    private Integer state;
+
+    public ChannelStatus()
+    {
+    }
+
+    public ChannelStatus(Long channelId, Integer state)
+    {
+        this.channelId = channelId;
+        this.state = state;
+    }
+
+    public void setChannelId(Long channelId)
+    {
+        this.channelId = channelId;
+    }
+
+    public Long getChannelId()
+    {
+        return channelId;
+    }
+
+    public void setState(Integer state)
+    {
+        this.state = state;
+    }
+
+    public Integer getState()
+    {
+        return state;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("channelId", getChannelId())
+            .append("state", getState())
+            .toString();
+    }
+}

+ 290 - 0
forecast-backend-server/src/main/java/com/ufo/project/gatewayapp/util/GatewayAppUtils.java

@@ -0,0 +1,290 @@
+package com.ufo.project.gatewayapp.util;
+
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+import com.alibaba.fastjson2.JSON;
+import com.alibaba.fastjson2.JSONArray;
+import com.alibaba.fastjson2.JSONObject;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.expression.ExpressionParser;
+import org.springframework.expression.spel.standard.SpelExpressionParser;
+import org.springframework.expression.spel.support.StandardEvaluationContext;
+
+import com.ufo.base.common.exception.ServiceException;
+import com.ufo.base.common.utils.StringUtils;
+import com.ufo.base.common.utils.spring.SpringUtils;
+import com.ufo.module.system.domain.SysDictData;
+import com.ufo.module.system.service.ISysDictTypeService;
+import com.ufo.project.gatewayapp.domain.ChannelStatus;
+
+import cn.hutool.http.Header;
+import cn.hutool.http.HttpRequest;
+import cn.hutool.http.HttpResponse;
+
+/**
+ * 网关服务(GatewayApp)调用工具类
+ *
+ * 读取字典 gateway_app_config 中的JSON配置, 调用网关服务提供的通道状态查询/通道操作接口.
+ *
+ * 配置示例:
+ * <pre>
+ * {
+ *   "baseUrl": "http://xxx",                                        // 网关服务url前缀
+ *   "pointStateUrl": "/biz/point-state/real",                       // 状态查询接口
+ *   "channelStateExpressions": "#iValue != null and #iValue == 1",  // 通道状态判断表达式(SpEL, 变量 #iValue)
+ *   "channelOperationUrl": "/biz/channel/control"                   // 通道操作接口
+ * }
+ * </pre>
+ *
+ * @author ufo
+ * @date 2026-09-18
+ */
+public final class GatewayAppUtils
+{
+    private static final Logger log = LoggerFactory.getLogger(GatewayAppUtils.class);
+
+    /** 网关服务配置项字典类型 */
+    public static final String DICT_TYPE_GATEWAY_APP_CONFIG = "gateway_app_config";
+
+    /** 通道操作命令: 停止 */
+    public static final int COMMAND_STOP = 0;
+
+    /** 通道操作命令: 启动和重启 */
+    public static final int COMMAND_START = 1;
+
+    /** 状态查询测点类型(通道) */
+    private static final String POINT_TYPE_CHANNEL = "CH";
+
+    /** 状态查询设备ID固定值 */
+    private static final long QUERY_DEVICE_ID = -1L;
+
+    /** 请求超时时间(毫秒) */
+    private static final int REQUEST_TIMEOUT_MILLIS = 10000;
+
+    /** 通道状态判断默认表达式 */
+    private static final String DEFAULT_STATE_EXPRESSION = "#iValue != null and #iValue == 1";
+
+    /** SpEL 解析器 */
+    private static final ExpressionParser SPEL_PARSER = new SpelExpressionParser();
+
+    private GatewayAppUtils()
+    {
+    }
+
+    /**
+     * 批量查询通道运行状态
+     *
+     * 调用网关状态查询接口, 逐条按配置表达式判断 item.iValue:
+     * true -> 运行中(1), false -> 未运行(0); 调用失败时全部返回未知(-1).
+     *
+     * @param channelIds 通道ID列表
+     * @return 通道状态列表
+     */
+    public static List<ChannelStatus> queryChannelStatus(List<Long> channelIds)
+    {
+        List<ChannelStatus> statusList = new ArrayList<>();
+        if (channelIds == null || channelIds.isEmpty())
+        {
+            return statusList;
+        }
+        try
+        {
+            GatewayAppConfig config = loadConfig();
+            List<Map<String, Object>> body = new ArrayList<>();
+            for (Long channelId : channelIds)
+            {
+                Map<String, Object> item = new LinkedHashMap<>();
+                item.put("channelId", channelId);
+                item.put("deviceId", QUERY_DEVICE_ID);
+                item.put("pointType", POINT_TYPE_CHANNEL);
+                body.add(item);
+            }
+            log.info("[GatewayAppUtils] 查询通道状态, baseUrl={}, pointStateUrl={}, body={}",
+                    config.getBaseUrl(), config.getPointStateUrl(), JSON.toJSONString(body));
+            String responseText = sendRequest(config.getBaseUrl(), config.getPointStateUrl(), JSON.toJSONString(body));
+            log.info("[GatewayAppUtils] 查询通道状态, responseText={}", responseText);
+            JSONArray array = JSON.parseArray(responseText);
+            if (array == null)
+            {
+                throw new ServiceException("网关服务状态查询返回数据为空");
+            }
+            for (int i = 0; i < array.size(); i++)
+            {
+                JSONObject item = array.getJSONObject(i);
+                Integer ivalue = item.containsKey("ivalue") ? item.getInteger("ivalue") : null;
+                int state = matchState(config.getChannelStateExpressions(), ivalue)
+                        ? ChannelStatus.STATE_RUNNING : ChannelStatus.STATE_STOPPED;
+                statusList.add(new ChannelStatus(item.getLong("channelId"), state));
+            }
+        }
+        catch (Exception e)
+        {
+            log.error("[GatewayAppUtils] 查询通道状态失败, channelIds={}", channelIds, e);
+            statusList.clear();
+            for (Long channelId : channelIds)
+            {
+                statusList.add(new ChannelStatus(channelId, ChannelStatus.STATE_UNKNOWN));
+            }
+        }
+        return statusList;
+    }
+
+    /**
+     * 通道操作(停止/启动和重启)
+     *
+     * @param channelId 通道ID
+     * @param command   操作命令 0:停止, 1:启动和重启
+     */
+    public static void operationChannel(Long channelId, int command)
+    {
+        try
+        {
+            GatewayAppConfig config = loadConfig();
+            Map<String, Object> item = new LinkedHashMap<>();
+            item.put("id", channelId);
+            item.put("command", command);
+            log.info("[GatewayAppUtils] 通道操作, baseUrl={}, channelOperationUrl={}, body={}",
+                    config.getBaseUrl(), config.getChannelOperationUrl(), JSON.toJSONString(item));
+            String responseText = sendRequest(config.getBaseUrl(), config.getChannelOperationUrl(), JSON.toJSONString(item));
+            log.info("[GatewayAppUtils] 通道操作, responseText={}", responseText);
+        }
+        catch (Exception e)
+        {
+            log.error("[GatewayAppUtils] 通道操作失败, channelId={}, command={}", channelId, command, e);
+            throw new ServiceException("调用网关远程服务失败");
+        }
+    }
+
+    /**
+     * POST JSON 请求网关服务, 返回响应体 data (字符串)
+     *
+     * @param baseUrl 网关服务url前缀
+     * @param apiUrl  接口路径
+     * @param bodyStr 请求体JSON字符串
+     * @return response.data (JSON字符串)
+     */
+    private static String sendRequest(String baseUrl, String apiUrl, String bodyStr)
+    {
+        String url = baseUrl + apiUrl;
+        HttpResponse response = HttpRequest.post(url)
+                .header(Header.CONTENT_TYPE, "application/json; charset=UTF-8")
+                .body(bodyStr)
+                .timeout(REQUEST_TIMEOUT_MILLIS)
+                .execute();
+        if (response.getStatus() != 200)
+        {
+            throw new ServiceException("网关服务HTTP状态异常: " + response.getStatus() + ", url=" + url);
+        }
+        JSONObject json = JSON.parseObject(response.body());
+        if (json == null)
+        {
+            throw new ServiceException("网关服务响应解析失败, url=" + url);
+        }
+        Integer code = json.getInteger("code");
+        if (code == null || code != 200)
+        {
+            throw new ServiceException("网关服务返回异常: " + json.getString("msg") + ", url=" + url);
+        }
+        Object data = json.get("data");
+        return data == null ? null : data.toString();
+    }
+
+    /**
+     * 按配置的SpEL表达式判断测点值是否代表运行中, 表达式变量 #iValue 为测点当前值
+     */
+    private static boolean matchState(String expression, Integer iValue)
+    {
+        String expr = StringUtils.isBlank(expression) ? DEFAULT_STATE_EXPRESSION : expression;
+        StandardEvaluationContext context = new StandardEvaluationContext();
+        context.setVariable("ivalue", iValue);
+        Boolean hit = SPEL_PARSER.parseExpression(expr).getValue(context, Boolean.class);
+        log.debug("[GatewayAppUtils] 判断通道状态, expression={}, ivalue={}, result={}", expr, iValue, hit);
+        return Boolean.TRUE.equals(hit);
+    }
+
+    /**
+     * 读取字典 gateway_app_config 并解析为配置对象
+     */
+    private static GatewayAppConfig loadConfig()
+    {
+        List<SysDictData> dictList = SpringUtils.getBean(ISysDictTypeService.class)
+                .selectDictDataByTypeWithoutCache(DICT_TYPE_GATEWAY_APP_CONFIG);
+        if (dictList == null || dictList.isEmpty())
+        {
+            throw new ServiceException("未配置字典项: " + DICT_TYPE_GATEWAY_APP_CONFIG);
+        }
+        String dictValue = dictList.get(0).getDictValue();
+        if (StringUtils.isBlank(dictValue))
+        {
+            throw new ServiceException("字典项值为空: " + DICT_TYPE_GATEWAY_APP_CONFIG);
+        }
+        GatewayAppConfig config = JSON.parseObject(dictValue, GatewayAppConfig.class);
+        if (config == null || StringUtils.isBlank(config.getBaseUrl()))
+        {
+            throw new ServiceException("字典项缺少baseUrl配置: " + DICT_TYPE_GATEWAY_APP_CONFIG);
+        }
+        return config;
+    }
+
+    /**
+     * 字典 gateway_app_config 的网关服务配置
+     */
+    public static class GatewayAppConfig
+    {
+        /** 网关服务url前缀 */
+        private String baseUrl;
+
+        /** 状态查询接口 */
+        private String pointStateUrl;
+
+        /** 通道状态判断表达式(SpEL) */
+        private String channelStateExpressions;
+
+        /** 通道操作接口 */
+        private String channelOperationUrl;
+
+        public String getBaseUrl()
+        {
+            return baseUrl;
+        }
+
+        public void setBaseUrl(String baseUrl)
+        {
+            this.baseUrl = baseUrl;
+        }
+
+        public String getPointStateUrl()
+        {
+            return pointStateUrl;
+        }
+
+        public void setPointStateUrl(String pointStateUrl)
+        {
+            this.pointStateUrl = pointStateUrl;
+        }
+
+        public String getChannelStateExpressions()
+        {
+            return channelStateExpressions;
+        }
+
+        public void setChannelStateExpressions(String channelStateExpressions)
+        {
+            this.channelStateExpressions = channelStateExpressions;
+        }
+
+        public String getChannelOperationUrl()
+        {
+            return channelOperationUrl;
+        }
+
+        public void setChannelOperationUrl(String channelOperationUrl)
+        {
+            this.channelOperationUrl = channelOperationUrl;
+        }
+    }
+}

+ 8 - 0
forecast-backend-vue/src/api/config/channel.js

@@ -19,3 +19,11 @@ export function updateChannel(data) {
 export function delChannel(id) {
   return request({ url: '/config/channel/' + id, method: 'delete' })
 }
+
+export function queryChannelState(data) {
+  return request({ url: '/gatewayapp/channel/queryChannelState', method: 'post', data })
+}
+
+export function controllerChannel(params) {
+  return request({ url: '/gatewayapp/channel/controllerChannel', method: 'get', params })
+}

+ 36 - 1
forecast-backend-vue/src/views/ufo/config/station/StationConfigCrud.vue

@@ -39,6 +39,7 @@
       <a-table :columns="displayColumns" :data-source="rows" :loading="loading" :pagination="pagination" row-key="id" :row-selection="rowSelection" :size="tableConfigStore.size" :scroll="tableScroll" @change="handleTableChange">
         <template #bodyCell="{ column, record }">
           <a-switch v-if="isSwitchColumn(column)" :checked="record[column.dataIndex] === switchCheckedValue(column)" disabled size="small" />
+          <template v-else-if="column.key === 'stateColumn'">{{ stateText(record.state) }}</template>
           <template v-else-if="column.key === 'operation'">
             <TableActionBar :record="record" :has-view="false" :has-edit="true" :has-delete="true">
               <template #edit>
@@ -48,6 +49,10 @@
                 <a-divider type="vertical"/>
                 <a v-hasPermi="[moduleConfig.perm + ':remove']" class="action-btn delete-btn" @click="handleDeleteRecord(record)"><BearJiaIcon icon="delete-outlined"/>删除</a>
               </template>
+              <template v-if="stateActionOf(record)">
+                <a-divider type="vertical"/>
+                <a v-hasPermi="[moduleConfig.perm + ':edit']" class="action-btn" @click="handleRowStateAction(record)"><BearJiaIcon :icon="stateActionOf(record).icon"/>{{ stateActionOf(record).text }}</a>
+              </template>
             </TableActionBar>
           </template>
         </template>
@@ -132,7 +137,8 @@ const columnTitle = (name) => {
 const columns = computed(() => [
   { title: 'ID', dataIndex: 'id', width: 80 },
   ...props.moduleConfig.columns.map((name) => ({ title: columnTitle(name), dataIndex: name, width: 140, ellipsis: true })),
-  { title: '操作', key: 'operation', dataIndex: 'operation', width: 200, fixed: 'right' }
+  ...(props.moduleConfig.stateColumn ? [{ title: props.moduleConfig.stateColumn.title || '状态', dataIndex: 'state', key: 'stateColumn', width: 110 }] : []),
+  { title: '操作', key: 'operation', dataIndex: 'operation', width: props.moduleConfig.stateColumn ? 260 : 200, fixed: 'right' }
 ]);
 const storageKey = 'station-config-columns-' + props.moduleConfig.api;
 const readSavedColumns = () => {
@@ -140,6 +146,7 @@ const readSavedColumns = () => {
     const saved = JSON.parse(localStorage.getItem(storageKey) || 'null');
     if (Array.isArray(saved) && saved.length > 0) {
       const valid = saved.filter((k) => columns.value.some((c) => c.dataIndex === k));
+      if (props.moduleConfig.stateColumn && !valid.includes('state')) valid.push('state');
       if (valid.length > 0) return valid;
     }
   } catch (e) { /* 忽略存储解析错误 */ }
@@ -204,10 +211,38 @@ const handleQuery = async () => {
     pagination.total = res?.total || rows.value.length;
     pagination.current = queryParams.pageNum;
     pagination.pageSize = queryParams.pageSize;
+    if (props.moduleConfig.stateColumn) {
+      const list = rows.value;
+      list.forEach((row) => { row.state = -2; });
+      refreshRowStates(list);
+    }
   } finally {
     loading.value = false;
   }
 };
+const stateText = (state) => props.moduleConfig.stateColumn?.textMap?.[String(state)] ?? '';
+const stateActionOf = (record) => {
+  const actions = props.moduleConfig.stateColumn?.actions;
+  return (actions && actions[String(record.state)]) || null;
+};
+const refreshRowStates = async (list) => {
+  if (!list.length || typeof props.api.queryState !== 'function') return;
+  try {
+    const res = await props.api.queryState({ ids: list.map((row) => row.id) });
+    const states = res?.data || [];
+    const stateMap = new Map(states.map((item) => [String(item.channelId), item.state]));
+    list.forEach((row) => { row.state = stateMap.has(String(row.id)) ? Number(stateMap.get(String(row.id))) : 1; });
+  } catch (e) {
+    list.forEach((row) => { row.state = -1; });
+  }
+};
+const handleRowStateAction = async (record) => {
+  const action = stateActionOf(record);
+  if (!action || typeof props.api.operate !== 'function') return;
+  await props.api.operate({ id: record.id, command: action.command });
+  message.success('操作成功!');
+  refreshRowStates(rows.value);
+};
 const resetQuery = () => {
   Object.keys(queryParams).forEach((key) => { if (!['pageNum', 'pageSize'].includes(key)) queryParams[key] = undefined; });
   queryParams.pageNum = 1;

+ 12 - 12
forecast-backend-vue/src/views/ufo/config/station/channel/index.vue

@@ -1,12 +1,12 @@
-<template>
-  <StationConfigCrud :module-config="moduleConfig" :api="api" />
-</template>
-
-<script setup name="StationChannel">
-import StationConfigCrud from '../StationConfigCrud.vue';
-import { stationConfigModules } from '../moduleConfig';
-import { listChannel, getChannel, addChannel, updateChannel, delChannel } from '@/api/config/channel';
-
-const moduleConfig = stationConfigModules.find((item) => item.key === 'channel');
-const api = { list: listChannel, get: getChannel, add: addChannel, update: updateChannel, del: delChannel };
-</script>
+<template>
+  <StationConfigCrud :module-config="moduleConfig" :api="api" />
+</template>
+
+<script setup name="StationChannel">
+import StationConfigCrud from '../StationConfigCrud.vue';
+import { stationConfigModules } from '../moduleConfig';
+import { listChannel, getChannel, addChannel, updateChannel, delChannel, queryChannelState, controllerChannel } from '@/api/config/channel';
+
+const moduleConfig = stationConfigModules.find((item) => item.key === 'channel');
+const api = { list: listChannel, get: getChannel, add: addChannel, update: updateChannel, del: delChannel, queryState: queryChannelState, operate: controllerChannel };
+</script>

+ 13 - 0
forecast-backend-vue/src/views/ufo/config/station/moduleConfig.js

@@ -227,6 +227,19 @@ export const stationConfigModules = [
     "perm": "config:stationChannel",
     "exportName": "通道配置.xlsx",
     "hasStation": false,
+    "stateColumn": {
+      "title": "通道状态",
+      "textMap": {
+        "-2": "获取中...",
+        "-1": "获取失败",
+        "0": "未启动",
+        "1": "运行中"
+      },
+      "actions": {
+        "0": { "text": "启动", "command": 1, "icon": "play-circle-outlined" },
+        "1": { "text": "停止", "command": 0, "icon": "pause-circle-outlined" }
+      }
+    },
     "fields": [
       [
         "code",

+ 25 - 0
release_note/20260924/20260924_dp.sql

@@ -0,0 +1,25 @@
+-- ============================================================
+-- 任务 2026091801: 增加调用Gateway服务Util
+-- 新增字典配置项: 网关服务配置项 (gateway_app_config)
+-- dict_value 为 JSON:
+--   baseUrl                 网关服务url前缀
+--   pointStateUrl           状态查询接口
+--   channelStateExpressions 通道状态判断表达式(SpEL, 变量 #iValue)
+--   channelOperationUrl     通道操作接口
+-- ============================================================
+
+ALTER TABLE "public"."sys_dict_data" ALTER COLUMN "dict_value" DROP DEFAULT, 
+ALTER COLUMN "dict_value" TYPE character varying(1000) USING "dict_value"::character varying(1000), 
+ALTER COLUMN "dict_value" SET DEFAULT '';
+
+INSERT INTO sys_dict_type (dict_id, dict_name, dict_type, status, create_by, create_time, remark)
+SELECT
+nextval(pg_get_serial_sequence('sys_dict_type', 'dict_id')),
+'网关服务配置项', 'gateway_app_config', '0', 'admin', now(), '网关服务(gatewayapp)地址与接口配置, JSON格式'
+WHERE NOT EXISTS (SELECT 1 FROM sys_dict_type t WHERE t.dict_type = 'gateway_app_config');
+
+INSERT INTO sys_dict_data (dict_code, dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, remark)
+SELECT
+nextval(pg_get_serial_sequence('sys_dict_data', 'dict_code')),
+1, '网关服务配置项', '{"baseUrl":"http://xxx","pointStateUrl":"/biz/point-state/real","channelStateExpressions":"#iValue != null and #iValue == 1","channelOperationUrl":"/biz/channel/control"}', 'gateway_app_config', '', '', 'Y', '0', 'admin', now(), 'JSON: baseUrl/pointStateUrl/channelStateExpressions/channelOperationUrl'
+WHERE NOT EXISTS (SELECT 1 FROM sys_dict_data t WHERE t.dict_type = 'gateway_app_config');