代码调整
This commit is contained in:
@@ -1897,11 +1897,14 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
deviceBakLambdaQueryWrapper.eq(DeviceBak::getDevId, oracleTerminalExcel.getDeviceId());
|
||||
List<DeviceBak> deviceBaks = deviceBakService.list(deviceBakLambdaQueryWrapper);
|
||||
List<String> devIds = deviceBaks.stream().map(DeviceBak::getId).collect(Collectors.toList());
|
||||
LambdaQueryWrapper<Line> devLambda = new LambdaQueryWrapper<>();
|
||||
devLambda.in(Line::getId, devIds)
|
||||
.orderByAsc(Line::getCreateTime)
|
||||
.eq(Line::getState, DataStateEnum.ENABLE.getCode());
|
||||
List<Line> devList = lineMapper.selectList(devLambda);
|
||||
List<Line> devList = new ArrayList<>();
|
||||
if(!CollectionUtil.isEmpty(devIds)){
|
||||
LambdaQueryWrapper<Line> devLambda = new LambdaQueryWrapper<>();
|
||||
devLambda.in(Line::getId, devIds)
|
||||
.orderByAsc(Line::getCreateTime)
|
||||
.eq(Line::getState, DataStateEnum.ENABLE.getCode());
|
||||
devList = lineMapper.selectList(devLambda);
|
||||
}
|
||||
if (CollectionUtil.isEmpty(deviceBaks) || CollectionUtil.isEmpty(devList)) {
|
||||
temp = assembleLine(deviceName, LineBaseEnum.DEVICE_LEVEL.getCode(), pids.get(LineBaseEnum.SUB_LEVEL.getCode()), pids);
|
||||
this.baseMapper.insert(temp);
|
||||
@@ -2040,11 +2043,14 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
lineBakLambdaQueryWrapper.eq(LineBak::getLineId, oracleTerminalExcel.getId());
|
||||
List<LineBak> lineBaks = lineBakService.list(lineBakLambdaQueryWrapper);
|
||||
List<String> lineIds = lineBaks.stream().map(LineBak::getId).collect(Collectors.toList());
|
||||
LambdaQueryWrapper<Line> devLambda = new LambdaQueryWrapper<>();
|
||||
devLambda.in(Line::getId, lineIds)
|
||||
.orderByAsc(Line::getCreateTime)
|
||||
.eq(Line::getState, DataStateEnum.ENABLE.getCode());
|
||||
List<Line> lineList = lineMapper.selectList(devLambda);
|
||||
List<Line> lineList = new ArrayList<>();
|
||||
if(CollectionUtil.isNotEmpty(lineIds)){
|
||||
LambdaQueryWrapper<Line> devLambda = new LambdaQueryWrapper<>();
|
||||
devLambda.in(Line::getId, lineIds)
|
||||
.orderByAsc(Line::getCreateTime)
|
||||
.eq(Line::getState, DataStateEnum.ENABLE.getCode());
|
||||
lineList = lineMapper.selectList(devLambda);
|
||||
}
|
||||
if (CollectionUtil.isEmpty(lineBaks) || CollectionUtil.isEmpty(lineList)) {
|
||||
temp = assembleLine(lineName, LineBaseEnum.LINE_LEVEL.getCode(), pids.get(LineBaseEnum.SUB_V_LEVEL.getCode()), pids);
|
||||
this.baseMapper.insert(temp);
|
||||
|
||||
Reference in New Issue
Block a user