Browse Source

代码规范和数值类型比较的优化

yuj 7 years ago
parent
commit
54ca5e3992

+ 2 - 2
src/main/java/com/uas/platform/b2c/prod/commodity/service/impl/ProductServiceImpl.java

@@ -454,14 +454,14 @@ public class ProductServiceImpl implements ProductService {
     public Integer setAllProductsByProductIds(String ids, Integer isAll, Integer isStardand) {
         List<Long> prIds;
         try {
-            prIds = JSON.parseArray(ids,Long.class);
+            prIds = JSON.parseArray(ids, Long.class);
         } catch (RuntimeException e) {
             prIds = new ArrayList<>();
         }
 
         //查找物料信息
         User user = SystemSession.getUser();
-        if (isAll != null && isAll.equals(IntegerConstant.YES_SHORT)) {
+        if (IntegerConstant.YES_SHORT.equals(isAll)) {
             prIds = productDao.findPridsByEnuuAndStardand(user.getEnterprise().getUu(), isStardand);
         }
 

+ 13 - 0
src/test/java/com/uas/platform/b2c/javase/collection/ListTest.java

@@ -3,6 +3,7 @@ package com.uas.platform.b2c.javase.collection;
 import org.junit.Test;
 
 import java.util.ArrayList;
+import java.util.Iterator;
 import java.util.List;
 
 public class ListTest {
@@ -35,4 +36,16 @@ public class ListTest {
         System.out.println(list1.equals(list2));
     }
 
+
+    @Test
+    public void Test() {
+        ArrayList<Integer> list = new ArrayList<>();
+        list.add(2);
+        Iterator<Integer> iterator = list.iterator();
+        while (iterator.hasNext()) {
+            Integer integer = iterator.next();
+            if(integer==2)
+                iterator.remove();
+        }
+    }
 }