Jelajahi Sumber

完善代码

yuansh 2 bulan lalu
induk
melakukan
39dbb991bb

+ 12 - 3
srm-module-code/src/main/java/org/jeecg/modules/storeCode/controller/StoreOnhandController.java

@@ -78,7 +78,7 @@ public class StoreOnhandController extends JeecgController<StoreOnhand, IStoreOn
                                                     HttpServletRequest req) {
 
 
-        BigDecimal keyspace = BigDecimal.ZERO;
+        BigDecimal keyspace = null;
         if(storeOnhand.getQuantity() !=null){
             keyspace = storeOnhand.getQuantity();
         }
@@ -86,9 +86,18 @@ public class StoreOnhandController extends JeecgController<StoreOnhand, IStoreOn
         QueryWrapper<StoreOnhand> queryWrapper = QueryGenerator.initQueryWrapper(storeOnhand, req.getParameterMap());
         Page<StoreOnhand> page = new Page<StoreOnhand>(pageNo, pageSize);
 
-        if(keyspace.compareTo(BigDecimal.ZERO) !=0 ){
-            queryWrapper.gt("quantity",0);
+        if(keyspace != null){
+
+            if(keyspace.compareTo(BigDecimal.ONE) == 0 ){
+                queryWrapper.gt("quantity",0);
+            }
+
+            if(keyspace.compareTo(BigDecimal.ZERO) == 0 ){
+                queryWrapper.lt("quantity",0.0000000001);
+            }
+
         }
+
         IPage<StoreOnhand> pageList = storeOnhandService.page(page, queryWrapper);
         return Result.OK(pageList);
     }