|
@@ -11,6 +11,7 @@ import java.util.stream.Collectors;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
|
+import org.apache.commons.lang.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
@@ -85,13 +86,15 @@ public class AdmSpaceServiceImpl extends AbstractAdmBaseServiceImpl<AdmSpace> im
|
|
|
|
|
|
@Override
|
|
|
public List<AdmSpace> doInsertExt(InstanceUrlParam context, Class<AdmSpace> clazz, List<AdmSpace> voList) {
|
|
|
- Map<String, List<AdmSpace>> spaceMapByFlId = voList.stream().collect(Collectors.groupingBy(AdmSpace::getFloorId));
|
|
|
+ Map<String, List<AdmSpace>> spaceMapByFlId = voList.stream().filter(admSpace -> StringUtils.isNotEmpty(admSpace.getFloorId())).collect(Collectors.groupingBy(AdmSpace::getFloorId));
|
|
|
//查询空间中floorId 对应的floor
|
|
|
- List<ObjectNode> floors = queryFloorsByFloorIds(context, spaceMapByFlId.keySet());
|
|
|
- if(CollUtil.isNotEmpty(floors)){
|
|
|
- //ArrayList<AdmFloor> floorList = CollUtil.newArrayList(JSONUtil.toList(floors.getData().toString(),AdmFloor.class));
|
|
|
- //space.height = floor.infos.height
|
|
|
- voList = processHeight(spaceMapByFlId, floors);
|
|
|
+ if(CollUtil.isNotEmpty(spaceMapByFlId)){
|
|
|
+ List<ObjectNode> floors = queryFloorsByFloorIds(context, spaceMapByFlId.keySet());
|
|
|
+ if(CollUtil.isNotEmpty(floors)){
|
|
|
+ //ArrayList<AdmFloor> floorList = CollUtil.newArrayList(JSONUtil.toList(floors.getData().toString(),AdmFloor.class));
|
|
|
+ //space.height = floor.infos.height
|
|
|
+ voList = processHeight(spaceMapByFlId, floors);
|
|
|
+ }
|
|
|
}
|
|
|
//插入空间
|
|
|
List<AdmSpace> vosR = doInsert(context, clazz, voList);
|