doum
3 天以前 7ae1456345209704248fd184e0218b0c0f677a84
最新版本541200007最新版本541200007
已修改3个文件
39 ■■■■ 文件已修改
admin/src/components/business/OperaDeviceDuanluqiWindow.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_admin/src/main/java/com/doumee/api/business/JiandaoyunCloudController.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/DeviceServiceImpl.java 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin/src/components/business/OperaDeviceDuanluqiWindow.vue
@@ -35,7 +35,8 @@
            2.控制开关序号:系统根据配置规则,判断开关当前空闲中进行【自动分闸】,多个用英文逗号隔开,如 1,2;<br>
            3.自动分闸规则:针对控制开关序号的配置,定时检测【空闲时长】内满足开关电流值都在【空闲电流阈值】范围内,则进行自动分闸控制;<br>
            4.空闲时长: 请设置至少空闲时长大于等于300秒(5分钟)。<br>
            5.如需远程控制开关,请正确填写下述全部参数信息。
            5.修改重启: 修改配置参数后,返回列表页,点击重启【启用】,是参数生效!<br>
            6.如需远程控制开关,请正确填写下述全部参数信息。
          </p>
          <div style="display: flex">
            <el-form-item label="全部开关序号" prop="channelNo" style="display: inline-block;width:300px;">
server/visits/dmvisit_admin/src/main/java/com/doumee/api/business/JiandaoyunCloudController.java
@@ -167,8 +167,8 @@
        String url = "https://lcdp.ahyc.com.cn:30443/api/v1/automation/tenant/61b6fb6080e9de2aa1df94d7/hooks/6954aca3cdf86954d2657433fb470ca1aabd108246925eca";
        JSONObject object = new JSONObject();
        object.put("status",0);
        object.put("username","20251104160000" );
        object.put("info", "这是备注");
        object.put("username","15345690849" );
        object.put("info", "这是备注111");
        String result = HttpsUtil.postJson(url,JSONObject.toJSONString(object));
        System.out.println(result);
    }
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/DeviceServiceImpl.java
@@ -118,7 +118,32 @@
        if(device.getDoorNameObj()!=null && Constants.equalsInteger(device.getType(),Constants.DEVICE_TYPE.duanluqi)){
            device.setDoorName(JSONObject.toJSONString(device.getDoorNameObj()));
        }
        Device model = deviceMapper.selectById(device.getId());
        if(model ==null){
            throw  new BusinessException(ResponseStatus.DATA_EMPTY);
        }
        if(Constants.equalsInteger(model.getType(),Constants.DEVICE_TYPE.duanluqi)){
            //如果是斷路器
            if( Constants.equalsInteger(model.getIsUsed(),Constants.ZERO)
                    && StringUtils.equals(device.getDoorName(),model.getDoorName())){
                //如果配置参数发生了变化,设置状态未启用
                device.setIsUsed(Constants.ONE);
                try {
                    MqttClient mqttClient = MqttClientCache.clientMapCache.get("device"+device.getId());
                    if(mqttClient !=null){
                        if(mqttClient.isConnected()){
                            mqttClient.disconnect();
                        }
                        mqttClient.close();
                        MqttClientCache.clientMapCache.remove("device"+device.getId());
                    }
                }catch (Exception e){
                    log.error("==============端口mqtt链接失败:"+model.getName()+e.getMessage());
                }
            }
        }
        deviceMapper.updateById(device);
    }
    @Override
@@ -349,12 +374,13 @@
            //如果系统不用了,端口mqtt连接
            try {
                mqttClient = mqttBizService.unsubscribe(mqttClient,config  ,topics);
                if(mqttClient ==null){
                    throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(),"建立连接失败!");
                }
                if(mqttClient !=null){
                if(mqttClient.isConnected()){
                    mqttClient.disconnect();
                }
                    mqttClient.close();
                    MqttClientCache.clientMapCache.remove("device"+param.getId());
                }
            }catch (Exception e){
                log.error("==============端口mqtt链接失败:"+model.getName()+e.getMessage());
            }