refactor(access): 优化设备访问逻辑并移除调试输出

- 移除 AccessApplicationRunner 中的调试打印语句
- 移除 AutoAccessTimer 中的调试打印语句
- 为 CsDevModelServiceImpl 添加非空检查避免空列表操作
- 更新 IDeviceDeliveryService 接口注释说明获取条件为启用且未删除的装置
This commit is contained in:
xy
2026-06-11 15:17:08 +08:00
parent 73fc8805d8
commit 1eb2db4f40
4 changed files with 9 additions and 8 deletions

View File

@@ -90,7 +90,7 @@ public class AccessApplicationRunner implements ApplicationRunner {
if (CollUtil.isNotEmpty(list)) {
try {
list.forEach(item->{
System.out.println(Thread.currentThread().getName() + ": reboot : nDid : " + item.getNdid());
//System.out.println(Thread.currentThread().getName() + ": reboot : nDid : " + item.getNdid());
//判断设备类型 便携式设备需要特殊处理 未注册的要先注册、再接入;已注册的直接重新接入
String code = dictTreeFeignClient.queryById(item.getDevType()).getData().getCode();
if (Objects.equals(code, DicDataEnum.PORTABLE.getCode()) && Objects.equals(item.getStatus(),1)) {

View File

@@ -138,7 +138,7 @@ public class AutoAccessTimer implements ApplicationRunner {
}
private void processSingleDevice(CsEquipmentDeliveryPO item) {
System.out.println(Thread.currentThread().getName() + ": auto : nDid : " + item.getNdid());
//System.out.println(Thread.currentThread().getName() + ": auto : nDid : " + item.getNdid());
String code = dictTreeFeignClient.queryById(item.getDevType()).getData().getCode();
if (Objects.equals(code, DicDataEnum.PORTABLE.getCode()) && Objects.equals(item.getStatus(), 1)) {
log.info("设备 {} 需要手动注册、接入", item.getNdid());

View File

@@ -61,7 +61,7 @@ public interface ICsEquipmentDeliveryService extends IService<CsEquipmentDeliver
void devResetFactory(DeviceStatusParam param);
/**
* 获取启用并且客户端在线的装置
* 获取启用并且未删除的装置
*/
List<CsEquipmentDeliveryPO> getOnlineDev();

View File

@@ -128,12 +128,13 @@ public class CsDevModelServiceImpl implements ICsDevModelService {
.filter(item -> Objects.equals(item.getDevAccessMethod(),"CLD"))
.map(CsEquipmentDeliveryPO::getId)
.collect(Collectors.toList());
devModelRelationFeignClient.updateDataByList(devList,csDevModelPo.getId());
Object object = redisUtil.getObjectByKey("setId:" + csDevModelPo.getId());
if (ObjectUtil.isNotNull(object)) {
csLineFeignClient.updateDataByList(devList,csDevModelPo.getId(),object.toString());
if (ObjectUtil.isNotEmpty(devList)) {
devModelRelationFeignClient.updateDataByList(devList,csDevModelPo.getId());
Object object = redisUtil.getObjectByKey("setId:" + csDevModelPo.getId());
if (ObjectUtil.isNotNull(object)) {
csLineFeignClient.updateDataByList(devList,csDevModelPo.getId(),object.toString());
}
}
}
}
//5.清空模板缓存