diff --git a/imt-server/imt-module-data/imt-module-data-biz/src/main/java/com/inspur/module/data/mqtt/MyMqttCallback.java b/imt-server/imt-module-data/imt-module-data-biz/src/main/java/com/inspur/module/data/mqtt/MyMqttCallback.java index 08a5307..bb9e234 100644 --- a/imt-server/imt-module-data/imt-module-data-biz/src/main/java/com/inspur/module/data/mqtt/MyMqttCallback.java +++ b/imt-server/imt-module-data/imt-module-data-biz/src/main/java/com/inspur/module/data/mqtt/MyMqttCallback.java @@ -210,6 +210,9 @@ public class MyMqttCallback implements MqttCallback { } private void process(String measurement,String equipId,Map mapping,Map msg) { + if(mapping == null){ + return; + } InfluxDBService influxDBService = SpringUtils.getBean(InfluxDBService.class); AlarmRulesApi alarmRulesApi = SpringUtils.getBean(AlarmRulesApi.class); Map fields = new HashMap<>(); diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/admin/gatewayinfo/GatewayCardParamsController.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/admin/gatewayinfo/GatewayCardParamsController.java index 342c8f0..905da82 100644 --- a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/admin/gatewayinfo/GatewayCardParamsController.java +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/admin/gatewayinfo/GatewayCardParamsController.java @@ -90,6 +90,15 @@ public class GatewayCardParamsController { return success(BeanUtils.toBean(pageResult, GatewayCardParamsRespVO.class)); } + @GetMapping("/getByCardId") + @Operation(summary = "获得机床网关采集卡参数") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('imt:gateway-info:create')") + public CommonResult> getGatewayCardParamsByCardId(@RequestParam("cardId") String cardId) { + List gatewayCardParams = gatewayCardParamsService.getGatewayCardParamsByCardId(cardId); + return success(BeanUtils.toBean(gatewayCardParams, GatewayCardParamsRespVO.class)); + } + @GetMapping("/export-excel") @Operation(summary = "导出机床网关采集卡参数 Excel") @PreAuthorize("@ss.hasPermission('imt:gateway-info:create')") diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/gatewayinfo/GatewayCardInfoServiceImpl.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/gatewayinfo/GatewayCardInfoServiceImpl.java index 37a561b..7a1a68a 100644 --- a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/gatewayinfo/GatewayCardInfoServiceImpl.java +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/gatewayinfo/GatewayCardInfoServiceImpl.java @@ -41,7 +41,7 @@ public class GatewayCardInfoServiceImpl implements GatewayCardInfoService { @Override public void updateGatewayCardInfo(GatewayCardInfoSaveReqVO updateReqVO) { // 校验存在 - validateGatewayCardInfoExists(updateReqVO.getGatewayId()); + validateGatewayCardInfoExists(updateReqVO.getCardId()); // 更新 GatewayCardInfoDO updateObj = BeanUtils.toBean(updateReqVO, GatewayCardInfoDO.class); gatewayCardInfoMapper.updateById(updateObj); diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/gatewayinfo/GatewayCardParamsService.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/gatewayinfo/GatewayCardParamsService.java index 6dce615..b73f1b9 100644 --- a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/gatewayinfo/GatewayCardParamsService.java +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/gatewayinfo/GatewayCardParamsService.java @@ -62,4 +62,8 @@ public interface GatewayCardParamsService { */ PageResult getGatewayCardParamsPage(GatewayCardParamsPageReqVO pageReqVO); + /** + * 根据采集卡id查询参数列表 + */ + List getGatewayCardParamsByCardId(String cardId); } \ No newline at end of file diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/gatewayinfo/GatewayCardParamsServiceImpl.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/gatewayinfo/GatewayCardParamsServiceImpl.java index 4d04dee..873e428 100644 --- a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/gatewayinfo/GatewayCardParamsServiceImpl.java +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/gatewayinfo/GatewayCardParamsServiceImpl.java @@ -94,4 +94,12 @@ public class GatewayCardParamsServiceImpl implements GatewayCardParamsService { return gatewayCardParamsMapper.selectPage(pageReqVO); } + /** + * 根据采集卡id查询参数列表 + */ + @Override + public List getGatewayCardParamsByCardId(String cardId){ + return gatewayCardParamsMapper.selectList("cardId",cardId); + } + } \ No newline at end of file diff --git a/imt-ui/src/api/system/gatewayinfo/params.js b/imt-ui/src/api/system/gatewayinfo/params.js index 667ed08..6be744a 100644 --- a/imt-ui/src/api/system/gatewayinfo/params.js +++ b/imt-ui/src/api/system/gatewayinfo/params.js @@ -43,6 +43,14 @@ export function getGatewayCardParams(id) { }); } +// 获得机床网关采集卡参数 +export function getGatewayCardParams(id) { + return request({ + url: "/imt/gateway-card-params/get?id=" + id, + method: "get", + }); +} + // 获得机床网关采集卡参数分页 export function getGatewayCardParamsPage(params) { return request({ diff --git a/imt-ui/src/views/system/gatewayinfo/GatewayCardForm.vue b/imt-ui/src/views/system/gatewayinfo/GatewayCardForm.vue index 8670072..9744ef0 100644 --- a/imt-ui/src/views/system/gatewayinfo/GatewayCardForm.vue +++ b/imt-ui/src/views/system/gatewayinfo/GatewayCardForm.vue @@ -369,6 +369,7 @@ export default { this.formLoading = true; try { const res = await GatewayCardInfoApi.getGatewayCardInfo(id); + // const paramsRes = await GatewayCardParamsApi.getGatewayCardParams(); this.formData = res.data; this.dialogTitle = "修改机床网关采集卡信息"; } finally { diff --git a/imt-ui/src/views/system/gatewayinfo/index.vue b/imt-ui/src/views/system/gatewayinfo/index.vue index 2eb9a4b..62f5964 100644 --- a/imt-ui/src/views/system/gatewayinfo/index.vue +++ b/imt-ui/src/views/system/gatewayinfo/index.vue @@ -168,7 +168,7 @@ icon="el-icon-edit" @click="openCardForm(scope.row.cardId,scope.row)" v-hasPermi="['imt:gateway-info:create']" - >修改 + >采集卡信息修改