feat(ed-data): 新增ED数据管理和设备版本功能

- 重命名crcInfo字段为crc
- 添加findByCondition和addEdDataFirst接口方法
- 在CsEdDataController中实现新接口
- 在CsEdDataFeignClient中添加对应feign接口
- 实现CsEdDataQueryParm参数类并添加相关字段
- 扩展CsEdDataService服务接口
- 实现CsEdDataServiceImpl中的业务逻辑
- 修改CsEquipmentDeliveryServiceImpl增强设备管理功能
- 更新CsEquipmentDeliveryVO添加前置进程号字段
- 优化CsUpgradeLogs数据结构和相关接口
- 重构DataTaskServiceImpl中的通知消息内容
- 调整DevVersionVO中的版本日期格式和添加crc字段
This commit is contained in:
xy
2026-07-17 13:43:07 +08:00
parent a07a0fe6ed
commit dbfd6e2b52
17 changed files with 221 additions and 33 deletions

View File

@@ -1,14 +1,23 @@
package com.njcn.csdevice.api;
import com.njcn.common.pojo.annotation.OperateInfo;
import com.njcn.common.pojo.constant.ServerInfo;
import com.njcn.common.pojo.enums.common.LogEnum;
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.common.utils.HttpResultUtil;
import com.njcn.csdevice.api.fallback.CsEdDataFeignClientFallbackFactory;
import com.njcn.csdevice.pojo.param.CsEdDataAddParm;
import com.njcn.csdevice.pojo.param.CsEdDataQueryParm;
import com.njcn.csdevice.pojo.po.CsEdDataPO;
import com.njcn.csdevice.pojo.vo.CsEdDataVO;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
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.RequestParam;
import java.util.List;
@@ -27,4 +36,12 @@ public interface CsEdDataFeignClient {
@GetMapping("/getById")
HttpResult<CsEdDataPO> getById(@RequestParam("id") String id);
@GetMapping("/addEdDataFirst")
@ApiOperation("首次录入版本信息")
HttpResult<CsEdDataPO> addEdDataFirst(@RequestBody CsEdDataAddParm param);
@GetMapping("/findByCondition")
@ApiOperation("根据条件查询是否存在数据")
HttpResult<CsEdDataPO> findByCondition(@RequestBody CsEdDataQueryParm param);
}

View File

@@ -4,19 +4,23 @@ import com.njcn.common.pojo.constant.ServerInfo;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.csdevice.api.fallback.CsUpgradeLogsClientFallbackFactory;
import com.njcn.csdevice.pojo.po.CsUpgradeLogs;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
/**
* @author caozehui
* @data 2026-04-23
*/
@FeignClient(value = ServerInfo.CS_DEVICE_BOOT, path = "/csUpgradeLogs", fallbackFactory = CsUpgradeLogsClientFallbackFactory.class,contextId = "csSoftInfo")
@FeignClient(value = ServerInfo.CS_DEVICE_BOOT, path = "/csUpgradeLogs", fallbackFactory = CsUpgradeLogsClientFallbackFactory.class,contextId = "csUpgradeLogs")
public interface CsUpgradeLogsFeignClient {
@PostMapping("/add")
HttpResult add(@RequestBody CsUpgradeLogs csUpgradeLogs);
@PostMapping("/update")
@ApiOperation("修改升级日志")
HttpResult<Boolean> update(@RequestParam("devId") String devId, @RequestParam("code") String code, @RequestParam("result") Integer result);
}

View File

@@ -4,6 +4,8 @@ import com.njcn.common.pojo.enums.response.CommonResponseEnum;
import com.njcn.common.pojo.exception.BusinessException;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.csdevice.api.CsEdDataFeignClient;
import com.njcn.csdevice.pojo.param.CsEdDataAddParm;
import com.njcn.csdevice.pojo.param.CsEdDataQueryParm;
import com.njcn.csdevice.pojo.po.CsEdDataPO;
import com.njcn.csdevice.pojo.vo.CsEdDataVO;
import feign.hystrix.FallbackFactory;
@@ -45,6 +47,18 @@ public class CsEdDataFeignClientFallbackFactory implements FallbackFactory<CsEdD
log.error("{}异常,降级处理,异常为:{}","根据id获取装置类型",cause.toString());
throw new BusinessException(finalExceptionEnum);
}
@Override
public HttpResult<CsEdDataPO> addEdDataFirst(CsEdDataAddParm param) {
log.error("{}异常,降级处理,异常为:{}","首次录入版本信息",cause.toString());
throw new BusinessException(finalExceptionEnum);
}
@Override
public HttpResult<CsEdDataPO> findByCondition(CsEdDataQueryParm param) {
log.error("{}异常,降级处理,异常为:{}","根据条件查询是否存在数据",cause.toString());
throw new BusinessException(finalExceptionEnum);
}
};
}
}

View File

@@ -31,6 +31,12 @@ public class CsUpgradeLogsClientFallbackFactory implements FallbackFactory<CsUpg
log.error("{}异常,降级处理,异常为:{}", "新增升级日志异常", cause.toString());
throw new BusinessException(finalExceptionEnum);
}
@Override
public HttpResult<Boolean> update(String devId, String code, Integer result) {
log.error("{}异常,降级处理,异常为:{}", "修改升级日志", cause.toString());
throw new BusinessException(finalExceptionEnum);
}
};
}
}

View File

@@ -72,7 +72,7 @@ public class CsEdDataAddParm {
private String versionType;
@ApiModelProperty(value = "crc信息")
private String crcInfo;
private String crc;
@ApiModelProperty(value = ".bin文件")
@NotNull(message="文件不能为空!")

View File

@@ -7,6 +7,7 @@ import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.time.LocalDate;
/**
*
@@ -52,7 +53,17 @@ public class CsEdDataQueryParm {
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
private String versionendDate;
@ApiModelProperty(value = "版本号")
private String versionNo;
@ApiModelProperty(value = "协议版本号")
private String versionAgreement;
@ApiModelProperty(value = "版本日期")
@DateTimeFormat(pattern="yyyy-MM-dd")
private LocalDate versionDate;
@ApiModelProperty(value = "校验码")
private String crc;
}

View File

@@ -30,7 +30,18 @@ public class CsUpgradeLogs {
private String versionNo;
/**
* 升级结果(0:失败 1:成功)
* 前置返回的code编码如果升级失败能知道是什么原因
*/
@TableField(value = "code")
private String code;
/**
* 当前状态
* (0:失败
* 1:成功
* 2:升级中
* 3:升级指令下发但是没有收到前置响应
* )
*/
private Integer result;

View File

@@ -94,6 +94,9 @@ public class CsEquipmentDeliveryVO extends BaseEntity {
@ApiModelProperty(value="前置服务器id")
private String nodeId ;
@ApiModelProperty(value="前置进程号")
private Integer nodeProcess ;
@ApiModelProperty(value="所属工程id")
private String associatedEngineering;

View File

@@ -33,7 +33,7 @@ public class DevVersionVO {
/**
* 版本日期
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd")
private LocalDateTime versionDate;
/**
@@ -51,6 +51,11 @@ public class DevVersionVO {
*/
private String icd;
/**
* crc校验码
*/
private String crc;
/**
* 所属工程