便携式接入优化

This commit is contained in:
xy
2024-10-16 10:33:36 +08:00
parent 0745ad2fba
commit b904565982
3 changed files with 20 additions and 5 deletions

View File

@@ -36,6 +36,12 @@ public interface ICsEquipmentDeliveryService extends IService<CsEquipmentDeliver
*/ */
void updateRunStatusBynDid(String nDid,Integer id); void updateRunStatusBynDid(String nDid,Integer id);
/**
* 根据网关id修改设备当前流程
* @param nDid 网关id
*/
void updateProcessBynDid(String nDid,Integer processId);
/** /**
* 根据ndid查询装置信息 * 根据ndid查询装置信息
* @param nDid * @param nDid

View File

@@ -438,9 +438,11 @@ public class CsDeviceServiceImpl implements ICsDeviceService {
csDevModelRelationService.addDevModelRelation(csDevModelRelationAddParm); csDevModelRelationService.addDevModelRelation(csDevModelRelationAddParm);
//5.发起自动接入请求 //5.发起自动接入请求
devAccessAskTemplate(nDid,version,1); devAccessAskTemplate(nDid,version,1);
//6.存储日志 //6.修改流程,便携式设备接入成功即为实际环境
csEquipmentDeliveryService.updateProcessBynDid(nDid,4);
//7.存储日志
csLogsFeignClient.addUserLog(logDto); csLogsFeignClient.addUserLog(logDto);
//7.存储设备调试日志表 //8.存储设备调试日志表
CsEquipmentProcessPO csEquipmentProcess = new CsEquipmentProcessPO(); CsEquipmentProcessPO csEquipmentProcess = new CsEquipmentProcessPO();
csEquipmentProcess.setDevId(nDid); csEquipmentProcess.setDevId(nDid);
csEquipmentProcess.setOperator(RequestUtil.getUserIndex()); csEquipmentProcess.setOperator(RequestUtil.getUserIndex());
@@ -449,7 +451,7 @@ public class CsDeviceServiceImpl implements ICsDeviceService {
csEquipmentProcess.setProcess(4); csEquipmentProcess.setProcess(4);
csEquipmentProcess.setStatus(1); csEquipmentProcess.setStatus(1);
processFeignClient.add(csEquipmentProcess); processFeignClient.add(csEquipmentProcess);
//8.删除redis监测点模板信息 //9.删除redis监测点模板信息
redisUtil.delete(AppRedisKey.MODEL + nDid); redisUtil.delete(AppRedisKey.MODEL + nDid);
redisUtil.delete(AppRedisKey.LINE + nDid); redisUtil.delete(AppRedisKey.LINE + nDid);
//判断接入状态 //判断接入状态

View File

@@ -28,9 +28,9 @@ import java.util.Objects;
public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliveryMapper, CsEquipmentDeliveryPO> implements ICsEquipmentDeliveryService { public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliveryMapper, CsEquipmentDeliveryPO> implements ICsEquipmentDeliveryService {
@Override @Override
public void updateStatusBynDid(String nDId,Integer status) { public void updateStatusBynDid(String nDid,Integer status) {
LambdaUpdateWrapper<CsEquipmentDeliveryPO> lambdaUpdateWrapper = new LambdaUpdateWrapper<>(); LambdaUpdateWrapper<CsEquipmentDeliveryPO> lambdaUpdateWrapper = new LambdaUpdateWrapper<>();
lambdaUpdateWrapper.set(CsEquipmentDeliveryPO::getStatus,status).eq(CsEquipmentDeliveryPO::getNdid,nDId); lambdaUpdateWrapper.set(CsEquipmentDeliveryPO::getStatus,status).eq(CsEquipmentDeliveryPO::getNdid,nDid);
this.update(lambdaUpdateWrapper); this.update(lambdaUpdateWrapper);
} }
@@ -48,6 +48,13 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
this.update(lambdaUpdateWrapper); this.update(lambdaUpdateWrapper);
} }
@Override
public void updateProcessBynDid(String nDid, Integer processId) {
LambdaUpdateWrapper<CsEquipmentDeliveryPO> lambdaUpdateWrapper = new LambdaUpdateWrapper<>();
lambdaUpdateWrapper.set(CsEquipmentDeliveryPO::getProcess,processId).eq(CsEquipmentDeliveryPO::getNdid,nDid);
this.update(lambdaUpdateWrapper);
}
@Override @Override
public CsEquipmentDeliveryVO queryEquipmentBynDid(String nDid) { public CsEquipmentDeliveryVO queryEquipmentBynDid(String nDid) {
CsEquipmentDeliveryVO result = new CsEquipmentDeliveryVO(); CsEquipmentDeliveryVO result = new CsEquipmentDeliveryVO();