|
@@ -12,6 +12,7 @@ import com.fasterxml.jackson.databind.node.JsonNodeFactory;
|
|
|
import com.fasterxml.jackson.databind.node.ObjectNode;
|
|
|
import com.google.common.collect.Sets;
|
|
|
import com.persagy.dmp.basic.model.QueryCriteria;
|
|
|
+import com.persagy.dmp.common.constant.CommonConstant;
|
|
|
import com.persagy.dmp.common.context.AppContext;
|
|
|
import com.persagy.dmp.common.helper.SpringHelper;
|
|
|
import com.persagy.dmp.common.model.entity.BaseEntity;
|
|
@@ -76,7 +77,7 @@ public class AdmSpaceServiceImpl extends AbstractAdmBaseServiceImpl<AdmSpace> im
|
|
|
|
|
|
@Override
|
|
|
public List<AdmSpace> doInsertExt(InstanceUrlParam context, Class<AdmSpace> clazz, List<AdmSpace> voList) {
|
|
|
- Map<String, AdmSpace> spaceMapByFlId = CollUtil.fieldValueMap(voList, "floorId");
|
|
|
+ Map<String, List<AdmSpace>> spaceMapByFlId = voList.stream().collect(Collectors.groupingBy(AdmSpace::getFloorId));
|
|
|
//查询空间中floorId 对应的floor
|
|
|
List<ObjectNode> floors = queryFloorsByFloorIds(context, spaceMapByFlId.keySet());
|
|
|
if(CollUtil.isNotEmpty(floors)){
|
|
@@ -572,16 +573,25 @@ public class AdmSpaceServiceImpl extends AbstractAdmBaseServiceImpl<AdmSpace> im
|
|
|
* @param floorList
|
|
|
* @return
|
|
|
*/
|
|
|
- private List<AdmSpace> processHeight(Map<String, AdmSpace> spaceMapByFlId, List<ObjectNode> floorList){
|
|
|
- List<AdmSpace> resultList = new ArrayList<AdmSpace>();
|
|
|
+ private List<AdmSpace> processHeight(Map<String, List<AdmSpace>> spaceMapByFlId, List<ObjectNode> floorList){
|
|
|
+ List<AdmSpace> resultList = new ArrayList<>();
|
|
|
floorList.forEach(node -> {
|
|
|
try {
|
|
|
- if(node.has("height")){
|
|
|
+ if (!node.has("id")
|
|
|
+ || !node.get("id").isTextual()){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ List<AdmSpace> spaces = spaceMapByFlId.get(node.get("id").asText());
|
|
|
+ if (CollUtil.isEmpty(spaces)){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if(node.has("height")){
|
|
|
String height = node.get("height").asText();
|
|
|
if (StrUtil.isNotBlank(height)) {
|
|
|
- AdmSpace admSpace = spaceMapByFlId.get(node.get("id").asText());
|
|
|
- admSpace.setHeight(Float.parseFloat(height));
|
|
|
- resultList.add(admSpace);
|
|
|
+ for (AdmSpace admSpace : spaces) {
|
|
|
+ admSpace.setHeight(Float.parseFloat(height));
|
|
|
+ resultList.add(admSpace);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
} catch (Exception e) {}
|