Pārlūkot izejas kodu

Merge branch 'lcy' of http://47.107.53.207:3000/traineeCoder001/Bailian-Al

JensionDzero 1 gadu atpakaļ
vecāks
revīzija
47d6814d8d

+ 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);