Commit c5b1ea169265c24257593bd157fe7a36d2d87e70

Authored by yangfei
1 parent 8085d483ea

处理自定义高危为空的情况,不返回前端

Showing 2 changed files with 22 additions and 4 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/AntenatalExaminationResult.java View file @ c5b1ea1
... ... @@ -8,6 +8,7 @@
8 8 import com.lyms.platform.pojo.AntenatalExaminationModel;
9 9 import scala.actors.threadpool.Arrays;
10 10  
  11 +import java.util.Iterator;
11 12 import java.util.List;
12 13 import java.util.Map;
13 14  
14 15  
15 16  
... ... @@ -374,14 +375,22 @@
374 375 if (StringUtils.isNotEmpty(destModel.getOtherRisk()) && !"{}".equals(destModel.getOtherRisk()) && !"[]".equals(destModel.getOtherRisk())) {
375 376 if (destModel.getOtherRisk().startsWith("[") && destModel.getOtherRisk().endsWith("]")) {
376 377 List<Map> list2 = JsonUtil.toList(destModel.getOtherRisk(), Map.class);
377   - for (Map map : list2) {
  378 + Iterator<Map> listIterator = list2.iterator();
  379 + while (listIterator.hasNext()){
  380 + Map map = listIterator.next();
378 381 suppleOtherHigh(map);
  382 + if(map.isEmpty()){
  383 + listIterator.remove();
  384 + }
379 385 }
380 386 setOtherRisk(list2);
381 387 } else if(org.apache.commons.lang.StringUtils.isNotEmpty(destModel.getOtherRisk())){
382 388 Map map = JsonUtil.str2Obj(destModel.getOtherRisk(), Map.class);
383 389 suppleOtherHigh(map);
384   - setOtherRisk(Arrays.asList(new Object[]{map}));
  390 + if(!map.isEmpty()){
  391 + setOtherRisk(Arrays.asList(new Object[]{map}));
  392 + }
  393 +
385 394 }
386 395 }
387 396 } catch (Exception e) {
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/AntexChuResult.java View file @ c5b1ea1
... ... @@ -9,6 +9,7 @@
9 9 import com.lyms.platform.pojo.AntExChuModel;
10 10 import scala.actors.threadpool.Arrays;
11 11  
  12 +import java.util.Iterator;
12 13 import java.util.List;
13 14 import java.util.Map;
14 15  
15 16  
16 17  
... ... @@ -1403,14 +1404,22 @@
1403 1404 if (StringUtils.isNotEmpty(antExChuModel.getOtherHighRisk()) && !"{}".equals(antExChuModel.getOtherHighRisk()) && !"[]".equals(antExChuModel.getOtherHighRisk())) {
1404 1405 if (antExChuModel.getOtherHighRisk().startsWith("[") && antExChuModel.getOtherHighRisk().endsWith("]")) {
1405 1406 List<Map> list2 = JsonUtil.toList(antExChuModel.getOtherHighRisk(), Map.class);
1406   - for (Map map : list2) {
  1407 +
  1408 + Iterator<Map> listIterator = list2.iterator();
  1409 + while (listIterator.hasNext()){
  1410 + Map map = listIterator.next();
1407 1411 suppleOtherHigh(map);
  1412 + if(map.isEmpty()){
  1413 + listIterator.remove();
  1414 + }
1408 1415 }
1409 1416 setOtherHighRisk(list2);
1410 1417 } else {
1411 1418 Map map = JsonUtil.str2Obj(antExChuModel.getOtherHighRisk(), Map.class);
1412 1419 suppleOtherHigh(map);
1413   - setOtherHighRisk(Arrays.asList(new Object[]{map}));
  1420 + if(!map.isEmpty()){
  1421 + setOtherHighRisk(Arrays.asList(new Object[]{map}));
  1422 + }
1414 1423 }
1415 1424 }
1416 1425