完善设备检测完成后,修改计划的检测结果状态接口
This commit is contained in:
@@ -27,5 +27,7 @@ public interface PqDevMapper extends MPJBaseMapper<PqDev> {
|
||||
void updateReportState(@Param("id")String id);
|
||||
|
||||
void updatePlanCheckResult(@Param("planId")String planId, @Param("checkResult")Integer checkResult);
|
||||
|
||||
void updatePlanTestState(@Param("planId")String planId, @Param("testState")Integer testState);
|
||||
}
|
||||
|
||||
|
||||
@@ -61,6 +61,10 @@
|
||||
update ad_plan set Result = #{checkResult} where id = #{planId}
|
||||
</update>
|
||||
|
||||
<update id="updatePlanTestState">
|
||||
update ad_plan set Test_State = #{testState} where id = #{planId}
|
||||
</update>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
||||
|
||||
@@ -593,14 +593,21 @@ public class PqDevServiceImpl extends ServiceImpl<PqDevMapper, PqDev> implements
|
||||
.eq(PqDev::getState, DataStateEnum.ENABLE.getCode());
|
||||
List<PqDev> pqDevList = this.list(queryWrapper);
|
||||
if (CollUtil.isNotEmpty(pqDevList)) {
|
||||
Set<Integer> checkResultSet = pqDevList.stream().map(PqDev::getCheckResult).collect(Collectors.toSet());
|
||||
if (checkResultSet.contains(CheckResultEnum.UNCHECKED.getValue())) {
|
||||
this.baseMapper.updatePlanCheckResult(pqDev.getPlanId(), CheckResultEnum.UNCHECKED.getValue());
|
||||
} else if (checkResultSet.contains(CheckResultEnum.NOT_ACCORD.getValue())) {
|
||||
Set<Integer> set = pqDevList.stream().map(PqDev::getCheckResult).collect(Collectors.toSet());
|
||||
if (set.contains(CheckResultEnum.NOT_ACCORD.getValue())) {
|
||||
this.baseMapper.updatePlanCheckResult(pqDev.getPlanId(), CheckResultEnum.NOT_ACCORD.getValue());
|
||||
} else if (set.contains(CheckResultEnum.UNCHECKED.getValue())) {
|
||||
this.baseMapper.updatePlanCheckResult(pqDev.getPlanId(), CheckResultEnum.UNCHECKED.getValue());
|
||||
} else {
|
||||
this.baseMapper.updatePlanCheckResult(pqDev.getPlanId(), CheckResultEnum.ACCORD.getValue());
|
||||
}
|
||||
|
||||
// set = pqDevList.stream().map(PqDev::getCheckState).collect(Collectors.toSet());
|
||||
// if (set.contains(CheckStateEnum.UNCHECKED.getValue())) {
|
||||
// this.baseMapper.updatePlanTestState(pqDev.getPlanId(), CheckStateEnum.UNCHECKED.getValue());
|
||||
// } else {
|
||||
// this.baseMapper.updatePlanTestState(pqDev.getPlanId(), CheckStateEnum.CHECKED.getValue());
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user