|
|
|
@ -57,10 +57,16 @@ public class PhysicalToolManageServiceImpl implements PhysicalToolManageService
|
|
|
|
|
ConfigPhysicalTool configPhysicalTool = configPhysicalToolService.getById(id);
|
|
|
|
|
PhysicalToolVO bean = BeanUtil.toBean(configPhysicalTool, PhysicalToolVO.class);
|
|
|
|
|
List<DefaultPhysicalIndicator> list = defaultPhysicalIndicatorService.lambdaQuery().eq(DefaultPhysicalIndicator::getItemId, id).list();
|
|
|
|
|
if (CollUtil.isNotEmpty(list)) {
|
|
|
|
|
bean.setDefaultPhysicalIndicatorList(list);
|
|
|
|
|
// 如果需要检查位
|
|
|
|
|
if (configPhysicalTool.getRequireLocation() == 1) {
|
|
|
|
|
if (CollUtil.isNotEmpty(list)) {
|
|
|
|
|
bean.setDefaultPhysicalIndicatorList(list);
|
|
|
|
|
} else {
|
|
|
|
|
bean.setDefaultPhysicalIndicatorList(new ArrayList<>());
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
bean.setDefaultPhysicalIndicatorList(new ArrayList<>());
|
|
|
|
|
// 如果不需要检查位
|
|
|
|
|
list.stream().findFirst().ifPresent(bean::setNoLocationDefaultPhysicalIndicator);
|
|
|
|
|
}
|
|
|
|
|
return bean;
|
|
|
|
|
}
|
|
|
|
|