过滤非叶子节点

This commit is contained in:
zhangchenbiao
2023-07-20 16:16:47 +08:00
parent 1bf5889662
commit 2c77668631
5 changed files with 38 additions and 3 deletions

View File

@@ -79,13 +79,16 @@ public class InspectionSettingServiceImpl implements InspectionSettingService {
if(CollectionUtils.isNotEmpty(inspectionUserSetting)){
throw new ServiceException(ErrorCodeEnum.INSPECTION_USER_OCCUPY);
}
List<Long> openAreaMappingIds = hyOpenAreaInfoDAO.filterLeafNode(param.getOpenAreaMappingIds());
if(CollectionUtils.isEmpty(openAreaMappingIds)){
throw new ServiceException(ErrorCodeEnum.OPEN_AREA_NULL);
}
HyInspectionSettingDO inspectionSetting = new HyInspectionSettingDO();
inspectionSetting.setInspectionUserId(param.getInspectionUserId());
inspectionSetting.setZoneName(param.getZoneName());
inspectionSetting.setCreateUserId(userId);
inspectionSetting.setCreateTime(new Date());
Long inspectionSettingId = hyInspectionSettingDAO.addInspectionSetting(inspectionSetting);
List<Long> openAreaMappingIds = param.getOpenAreaMappingIds();
hyInspectionSettingMappingDAO.addInspectionSettingMapping(inspectionSettingId, openAreaMappingIds);
return inspectionSettingId;
}
@@ -97,6 +100,10 @@ public class InspectionSettingServiceImpl implements InspectionSettingService {
if(CollectionUtils.isNotEmpty(inspectionUserSetting)){
throw new ServiceException(ErrorCodeEnum.INSPECTION_USER_OCCUPY);
}
List<Long> openAreaMappingIds = hyOpenAreaInfoDAO.filterLeafNode(param.getOpenAreaMappingIds());
if(CollectionUtils.isEmpty(openAreaMappingIds)){
throw new ServiceException(ErrorCodeEnum.OPEN_AREA_NULL);
}
HyInspectionSettingDO inspectionSetting = new HyInspectionSettingDO();
inspectionSetting.setId(param.getInspectionSettingId());
inspectionSetting.setInspectionUserId(param.getInspectionUserId());
@@ -104,7 +111,6 @@ public class InspectionSettingServiceImpl implements InspectionSettingService {
inspectionSetting.setUpdateUserId(userId);
inspectionSetting.setUpdateTime(new Date());
hyInspectionSettingDAO.updateInspectionSetting(inspectionSetting);
List<Long> openAreaMappingIds = param.getOpenAreaMappingIds();
return hyInspectionSettingMappingDAO.updateInspectionSettingMapping(param.getInspectionSettingId(), openAreaMappingIds);
}