update code

dev_xds
haha 2024-08-26 22:39:43 +08:00
parent ef50617d64
commit d8ca3850b2
2 changed files with 5 additions and 2 deletions

View File

@ -40,7 +40,7 @@ public class DevPitmonitSouthsmosDevSpServiceImpl implements IDevPitmonitSouthsm
DevPitmonitSouthsmosDevSp where=new DevPitmonitSouthsmosDevSp();
where.setSpId(spId);
where.setDevId(devId);
List<DevPitmonitSouthsmosDevSp> list=new ArrayList<>();
List<DevPitmonitSouthsmosDevSp> list=selectDevPitmonitSouthsmosDevSpList(where);
return list.size()>0?list.get(0):null;
}

View File

@ -117,7 +117,10 @@ public class DevPitmonitSouthsmosDeviceServiceImpl implements IDevPitmonitSouths
public void addList(List<DevPitmonitSouthsmosDevice> items, SurProjectPitMonitCfg cfg) {
items.forEach(it->{
it.setCfgId(cfg.getId());
insertDevPitmonitSouthsmosDevice(it);
DevPitmonitSouthsmosDevice old= selectDevPitmonitSouthsmosDeviceByDevId(it.getDevId());
if(old==null) {
insertDevPitmonitSouthsmosDevice(it);
}
it.getSpDevices().forEach(item->{
item.setCfgId(cfg.getId());
devSpService.addDevPitmonitSouthsmosDevSp(item);