过滤非叶子节点
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user