微调
This commit is contained in:
@@ -452,7 +452,7 @@ public class PqDevServiceImpl extends ServiceImpl<PqDevMapper, PqDev> implements
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = {Exception.class})
|
// @Transactional(rollbackFor = {Exception.class})
|
||||||
public boolean documented(List<String> ids) {
|
public boolean documented(List<String> ids) {
|
||||||
if (CollUtil.isNotEmpty(ids)) {
|
if (CollUtil.isNotEmpty(ids)) {
|
||||||
for (String id : ids) {
|
for (String id : ids) {
|
||||||
@@ -515,6 +515,20 @@ public class PqDevServiceImpl extends ServiceImpl<PqDevMapper, PqDev> implements
|
|||||||
.set(PqDev::getCheckTime, LocalDateTime.now())
|
.set(PqDev::getCheckTime, LocalDateTime.now())
|
||||||
.set(PqDev::getReportState, DevReportStateEnum.NOT_GENERATED.getValue())
|
.set(PqDev::getReportState, DevReportStateEnum.NOT_GENERATED.getValue())
|
||||||
.eq(PqDev::getId, pqDev.getId()));
|
.eq(PqDev::getId, pqDev.getId()));
|
||||||
|
|
||||||
|
if (pqDev.getCheckState().equals(CheckStateEnum.DOCUMENTED.getValue())) {
|
||||||
|
// 判断计划下所有设备是否都已归档,如果是则将计划改为已完成
|
||||||
|
// 查询该计划下所有设备的检测状态,是否有不为归档的
|
||||||
|
LambdaQueryWrapper<PqDev> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.eq(PqDev::getPlanId, pqDev.getPlanId())
|
||||||
|
.eq(PqDev::getState, DataStateEnum.ENABLE.getCode())
|
||||||
|
.ne(PqDev::getCheckState, CheckStateEnum.DOCUMENTED.getValue());
|
||||||
|
int count = this.count(queryWrapper);
|
||||||
|
if (count == 0) {
|
||||||
|
// 如果非归档状态的设备数量为0,则更新计划已完成
|
||||||
|
this.baseMapper.finishPlan(pqDev.getPlanId());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user