MQTT通讯联调

This commit is contained in:
2023-08-09 20:31:51 +08:00
parent b32cf6c486
commit 123fdf4f04
12 changed files with 70 additions and 16 deletions

View File

@@ -4,7 +4,6 @@ import com.njcn.common.pojo.constant.ServerInfo;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.csdevice.api.fallback.EquipmentFeignClientFallbackFactory;
import com.njcn.csdevice.pojo.dto.CsEquipmentDeliveryDTO;
import com.njcn.csdevice.pojo.po.CsEquipmentDeliveryPO;
import com.njcn.csdevice.pojo.vo.CsEquipmentDeliveryVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
@@ -25,4 +24,7 @@ public interface EquipmentFeignClient {
HttpResult<Boolean> updateStatusBynDid(@RequestParam("nDId") String nDid,@RequestParam("status") Integer status);
@PostMapping("/queryEquipmentById")
HttpResult<List<CsEquipmentDeliveryDTO>> queryDeviceById(@RequestParam("ids") List<String> ids);
@PostMapping("/updateSoftInfoBynDid")
HttpResult<Boolean> updateSoftInfoBynDid(@RequestParam("nDId") String nDid,@RequestParam("id") String id);
}

View File

@@ -5,7 +5,6 @@ import com.njcn.common.pojo.exception.BusinessException;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.csdevice.api.EquipmentFeignClient;
import com.njcn.csdevice.pojo.dto.CsEquipmentDeliveryDTO;
import com.njcn.csdevice.pojo.po.CsEquipmentDeliveryPO;
import com.njcn.csdevice.pojo.vo.CsEquipmentDeliveryVO;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
@@ -47,6 +46,12 @@ public class EquipmentFeignClientFallbackFactory implements FallbackFactory<Equi
log.error("{}异常,降级处理,异常为:{}","查询出厂设备详情",cause.toString());
throw new BusinessException(finalExceptionEnum);
}
@Override
public HttpResult<Boolean> updateSoftInfoBynDid(String nDid, String id) {
log.error("{}异常,降级处理,异常为:{}","根据网关id调整软件信息",cause.toString());
throw new BusinessException(finalExceptionEnum);
}
};
}
}

View File

@@ -1,7 +1,5 @@
package com.njcn.csdevice.enums;
import lombok.Getter;
/**
* Description:
* Date: 2023/8/7 19:27【需求编号】
@@ -24,4 +22,12 @@ public interface DeviceOperate {
String DELETE_1 ="设备删除";
String CANCELSHARE ="取消分享";
String JUDGE_ONLINE = "校验设备在线情况";
String DEVICE_REGISTER = "设备注册";
String DEVICE_ACCESS = "设备接入";
}

View File

@@ -51,9 +51,6 @@ public class CsDevModelAddParm {
@ApiModelProperty(value = "装置模板文件路径")
private String filePath;
@ApiModelProperty(value = "系统软件表Id")
private String softInfoId;
@ApiModelProperty(value = "模板类型(0:治理类型 1:电能质量类型)")
private Integer type;
}

View File

@@ -113,4 +113,10 @@ public class CsEquipmentDeliveryAddParm{
@ApiModelProperty(value="装置接入方式")
private String devAccessMethod;
/**
* 软件信息表id
*/
@ApiModelProperty(value="软件信息")
private String softinfoId;
}

View File

@@ -117,4 +117,10 @@ public class CsEquipmentDeliveryAuditParm {
@TableField(value = "run_status")
private Integer runStatus;
/**
* 软件信息表id
*/
@ApiModelProperty(value="软件信息")
private String softinfoId;
}

View File

@@ -68,16 +68,12 @@ public class CsDevModelPO extends BaseEntity {
@TableField(value = "file_path")
private String filePath;
/**
* 状态(0删除 1正常)
*/
@TableField(value = "status")
private String status;
@TableField(value = "soft_info_id")
private String softInfoId;
@TableField(value = "type")
@ApiModelProperty("模板类型(0:治理类型 1:电能质量类型)")
private Integer type;

View File

@@ -126,5 +126,11 @@ public class CsEquipmentDeliveryPO extends BaseEntity {
@TableField(value = "run_status")
private Integer runStatus;
/**
* 设备软件信息id
*/
@TableField(value = "softinfo_id")
private String softinfoId;
}

View File

@@ -7,8 +7,6 @@ import com.baomidou.mybatisplus.annotation.TableName;
import com.njcn.db.bo.BaseEntity;
import lombok.Data;
import java.math.BigDecimal;
/**
*
* Description:
@@ -48,19 +46,19 @@ public class CsLinePO extends BaseEntity {
* 电压等级
*/
@TableField(value = "vol_grade")
private String volGrade;
private Double volGrade;
/**
* PT变比
*/
@TableField(value = "pt_ratio")
private BigDecimal ptRatio;
private Double ptRatio;
/**
* CT变比
*/
@TableField(value = "ct_ratio")
private BigDecimal ctRatio;
private Double ctRatio;
/**
* 状态(0删除 1正常)
@@ -68,5 +66,11 @@ public class CsLinePO extends BaseEntity {
@TableField(value = "`status`")
private Integer status;
/**
* 接线方式(0-星型 1-角型 2-V型)
*/
@TableField(value = "conType")
private Integer conType;
}

View File

@@ -165,4 +165,17 @@ public class EquipmentDeliveryController extends BaseController {
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, vo, methodDescribe);
}
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/updateSoftInfoBynDid")
@ApiOperation("根据网关id调整软件信息")
@ApiImplicitParams({
@ApiImplicitParam(name = "nDId", value = "网关id", required = true),
@ApiImplicitParam(name = "id", value = "软件信息id", required = true)
})
public HttpResult<Boolean> updateSoftInfoBynDid(@RequestParam("nDId") String nDid,@RequestParam("id") String id){
String methodDescribe = getMethodDescribe("updateSoftInfoBynDid");
csEquipmentDeliveryService.updateSoftInfoBynDid(nDid,id);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
}
}

View File

@@ -76,4 +76,10 @@ public interface CsEquipmentDeliveryService extends IService<CsEquipmentDelivery
* @return
*/
DeviceManagerVO getDeviceData(String deviceId,String type,String lineId);
/**
* 根据网关id修改软件信息
* @param nDid 网关id
*/
void updateSoftInfoBynDid(String nDid,String id);
}

View File

@@ -254,4 +254,11 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
return deviceManagerVo;
}
@Override
public void updateSoftInfoBynDid(String nDid, String id) {
LambdaUpdateWrapper<CsEquipmentDeliveryPO> lambdaUpdateWrapper = new LambdaUpdateWrapper<>();
lambdaUpdateWrapper.set(CsEquipmentDeliveryPO::getSoftinfoId,id).eq(CsEquipmentDeliveryPO::getNdid,nDid);
this.update(lambdaUpdateWrapper);
}
}