Commit 897d1a08 authored by 鲁鸿波's avatar 鲁鸿波

安全风险分析bug

parent 177ea358
...@@ -59,6 +59,11 @@ public class THazardAssessmentServiceImpl extends SuperServiceImpl<THazardAssess ...@@ -59,6 +59,11 @@ public class THazardAssessmentServiceImpl extends SuperServiceImpl<THazardAssess
THazardAssessment tHazardAssessment = null; THazardAssessment tHazardAssessment = null;
final int MAX_ATTEMPTS = 5; final int MAX_ATTEMPTS = 5;
int count = this.count(
new LambdaQueryWrapper<THazardAssessment>()
.eq(THazardAssessment::getWorkTypeId, typeId)
.eq(THazardAssessment::getPlanId, planId));
if(count>1){
if (StringUtils.isEmpty(completeTime)) { if (StringUtils.isEmpty(completeTime)) {
// 构建不含时间条件的查询 // 构建不含时间条件的查询
tHazardAssessment = this.getOne( tHazardAssessment = this.getOne(
...@@ -98,6 +103,13 @@ public class THazardAssessmentServiceImpl extends SuperServiceImpl<THazardAssess ...@@ -98,6 +103,13 @@ public class THazardAssessmentServiceImpl extends SuperServiceImpl<THazardAssess
} }
} }
} }
}else{
tHazardAssessment = this.getOne(
new LambdaQueryWrapper<THazardAssessment>()
.eq(THazardAssessment::getWorkTypeId, typeId)
.eq(THazardAssessment::getPlanId, planId)
);
}
if(tHazardAssessment == null){ if(tHazardAssessment == null){
return null; return null;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment