代码优化

This commit is contained in:
xy
2025-01-13 16:39:20 +08:00
parent f9926d16f8
commit 52d2dda01c

View File

@@ -371,6 +371,7 @@ public class CsDeviceServiceImpl implements ICsDeviceService {
}
@Override
//@Transactional(rollbackFor = Exception.class)
public String wlDevRegister(String nDid) {
String result = "fail";
// 设备状态判断
@@ -386,7 +387,7 @@ public class CsDeviceServiceImpl implements ICsDeviceService {
logDto.setOperate("便携式设备"+nDid+"注册、接入");
logDto.setResult(1);
try {
Thread.sleep(2000);
Thread.sleep(5000);
//获取版本
String version = csTopicService.getVersion(nDid);
CsEquipmentDeliveryVO vo = equipmentFeignClient.queryEquipmentByndid(nDid).getData();
@@ -400,7 +401,7 @@ public class CsDeviceServiceImpl implements ICsDeviceService {
csLedgerParam.setSort(0);
csLedgerService.addLedgerTree(csLedgerParam);
//2.根据模板获取监测点个数,插入监测点表
Thread.sleep(2000);
Thread.sleep(5000);
List<CsModelDto> modelList = channelObjectUtil.objectToList(redisUtil.getObjectByKey(AppRedisKey.MODEL + nDid),CsModelDto.class);
if (CollUtil.isEmpty(modelList)) {
throwExceptionAndLog(AccessResponseEnum.MODEL_ERROR, logDto);
@@ -439,7 +440,7 @@ public class CsDeviceServiceImpl implements ICsDeviceService {
csDevModelRelationAddParm.setDid(modelList.get(0).getDid());
csDevModelRelationService.addDevModelRelation(csDevModelRelationAddParm);
//5.发起自动接入请求
Thread.sleep(2000);
Thread.sleep(5000);
devAccessAskTemplate(nDid,version,1);
//6.修改流程,便携式设备接入成功即为实际环境
csEquipmentDeliveryService.updateProcessBynDid(nDid,4);