瀏覽代碼

修复网点数量和覆盖城市数转换时判断出现的问题

云殇忆 1 年之前
父節點
當前提交
dd7ab0a963
共有 1 個文件被更改,包括 12 次插入4 次删除
  1. 12 4
      benyun-core/src/main/java/com/benyun/core/service/impl/BrandServiceImpl.java

+ 12 - 4
benyun-core/src/main/java/com/benyun/core/service/impl/BrandServiceImpl.java

@@ -253,12 +253,20 @@ public class BrandServiceImpl implements BrandService {
         Integer coverDown = null;
         Integer coverUp = null;
         if (body.getWdCount() != null){
-            countDown = Integer.parseInt(body.getWdCount().get(0));
-            countUp = Integer.parseInt(body.getWdCount().get(1));
+            if (body.getWdCount().size() == 1)
+                countDown = Integer.parseInt(body.getWdCount().get(0));
+            else if (body.getWdCount().size() >= 2){
+                countDown = Integer.parseInt(body.getWdCount().get(0));
+                countUp = Integer.parseInt(body.getWdCount().get(1));
+            }
         }
         if (body.getCoverCityCount() != null){
-            coverDown = Integer.parseInt(body.getCoverCityCount().get(0));
-            coverUp = Integer.parseInt(body.getCoverCityCount().get(1));
+            if (body.getCoverCityCount().size() == 1){
+                coverDown = Integer.parseInt(body.getCoverCityCount().get(0));
+            }else if (body.getCoverCityCount().size() >= 2){
+                coverDown = Integer.parseInt(body.getCoverCityCount().get(0));
+                coverUp = Integer.parseInt(body.getCoverCityCount().get(1));
+            }
         }
 //        System.out.println(countDown+","+countUp);
 //        System.out.println(coverDown+","+coverUp);