update code
parent
ef50617d64
commit
d8ca3850b2
|
@ -40,7 +40,7 @@ public class DevPitmonitSouthsmosDevSpServiceImpl implements IDevPitmonitSouthsm
|
||||||
DevPitmonitSouthsmosDevSp where=new DevPitmonitSouthsmosDevSp();
|
DevPitmonitSouthsmosDevSp where=new DevPitmonitSouthsmosDevSp();
|
||||||
where.setSpId(spId);
|
where.setSpId(spId);
|
||||||
where.setDevId(devId);
|
where.setDevId(devId);
|
||||||
List<DevPitmonitSouthsmosDevSp> list=new ArrayList<>();
|
List<DevPitmonitSouthsmosDevSp> list=selectDevPitmonitSouthsmosDevSpList(where);
|
||||||
return list.size()>0?list.get(0):null;
|
return list.size()>0?list.get(0):null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -117,7 +117,10 @@ public class DevPitmonitSouthsmosDeviceServiceImpl implements IDevPitmonitSouths
|
||||||
public void addList(List<DevPitmonitSouthsmosDevice> items, SurProjectPitMonitCfg cfg) {
|
public void addList(List<DevPitmonitSouthsmosDevice> items, SurProjectPitMonitCfg cfg) {
|
||||||
items.forEach(it->{
|
items.forEach(it->{
|
||||||
it.setCfgId(cfg.getId());
|
it.setCfgId(cfg.getId());
|
||||||
insertDevPitmonitSouthsmosDevice(it);
|
DevPitmonitSouthsmosDevice old= selectDevPitmonitSouthsmosDeviceByDevId(it.getDevId());
|
||||||
|
if(old==null) {
|
||||||
|
insertDevPitmonitSouthsmosDevice(it);
|
||||||
|
}
|
||||||
it.getSpDevices().forEach(item->{
|
it.getSpDevices().forEach(item->{
|
||||||
item.setCfgId(cfg.getId());
|
item.setCfgId(cfg.getId());
|
||||||
devSpService.addDevPitmonitSouthsmosDevSp(item);
|
devSpService.addDevPitmonitSouthsmosDevSp(item);
|
||||||
|
|
Loading…
Reference in New Issue