Browse Source

库存可视化看板

oyq28 1 năm trước cách đây
mục cha
commit
808b6cacff

+ 26 - 26
src/main/java/com/imcs/admin/business/service/impl/WInventoryManagementServiceImpl.java

@@ -81,6 +81,12 @@ public class WInventoryManagementServiceImpl extends BaseServiceImpl implements
             LambdaQueryWrapper<WShelfManagement> shelfWrapper= Wrappers.lambdaQuery(WShelfManagement.class).eq(WShelfManagement::getWarehouseManagementId,ware.getId());
             List<WShelfManagement> wShelfManagementList = wShelfManagementDao.selectList(shelfWrapper);
             shelfCount.addAndGet(wShelfManagementList.size());
+            AtomicInteger wareAllCount=new AtomicInteger(0);
+            AtomicInteger wareUserdCount=new AtomicInteger(0);
+            AtomicInteger wareLockCount=new AtomicInteger(0);
+            AtomicInteger warePreReservedCount=new AtomicInteger(0);
+            AtomicInteger wareNullPalletCount=new AtomicInteger(0);
+            AtomicInteger wareUnusedCount=new AtomicInteger(0);
             wShelfManagementList.forEach(shelf->{
 
                 AtomicInteger allCount=new AtomicInteger(0);
@@ -125,16 +131,16 @@ public class WInventoryManagementServiceImpl extends BaseServiceImpl implements
                         if(CollectionUtil.isNotEmpty(wInventoryManagementDetailList)){
                             userdCount.addAndGet(1);
                         }
-                        if(small.getStorageLocationStatus() == Status.LOCKED.getCode()){
+                        if(CollectionUtil.isNotEmpty(wInventoryManagementDetailList) &&small.getStorageLocationStatus() == Status.LOCKED.getCode()){
                             lockCount.addAndGet(1);
                         }
-                        if(small.getStorageLocationStatus() == Status.PRE_RESERVED.getCode()){
+                        if(CollectionUtil.isNotEmpty(wInventoryManagementDetailList) &&small.getStorageLocationStatus() == Status.PRE_RESERVED.getCode()){
                             preReservedCount.addAndGet(1);
                         }
-                        if(small.getStorageLocationStatus() == Status.NULL_PALLET.getCode()){
+                        if(CollectionUtil.isNotEmpty(wInventoryManagementDetailList) &&small.getStorageLocationStatus() == Status.NULL_PALLET.getCode()){
                             nullPalletCount.addAndGet(1);
                         }
-                        if(small.getStorageLocationStatus() == Status.UNUSED.getCode()){
+                        if(CollectionUtil.isNotEmpty(wInventoryManagementDetailList) && small.getStorageLocationStatus() == Status.UNUSED.getCode()){
                             unusedCount.addAndGet(1);
                         }
 
@@ -183,24 +189,24 @@ public class WInventoryManagementServiceImpl extends BaseServiceImpl implements
                 shelf.setPreReservedCount(preReservedCount.get());
                 shelf.setUnuseCount(unusedCount.get());
                 shelf.setNullPalletCount(nullPalletCount.get());
-                /*int used = allStorage.stream().filter(use -> use.getStorageLocationStatus() == Status.USED.getCode()).collect(Collectors.toList()).size();
-                int unused = allStorage.stream().filter(use -> use.getStorageLocationStatus() == Status.UNUSED.getCode()).collect(Collectors.toList()).size();
-                int nullPattet = allStorage.stream().filter(use -> use.getStorageLocationStatus() == Status.NULL_PALLET.getCode()).collect(Collectors.toList()).size();
-                int lock = allStorage.stream().filter(use -> use.getStorageLocationStatus() == Status.LOCKED.getCode()).collect(Collectors.toList()).size();
-                int preReserved = allStorage.stream().filter(use -> use.getStorageLocationStatus() == Status.PRE_RESERVED.getCode()).collect(Collectors.toList()).size();*/
-
-
-                /*shelf.setUseCount(used);
-                shelf.setUnuseCount(unused);
-                shelf.setNullPalletCount(nullPattet);
-                shelf.setLockCount(lock);
-                shelf.setPreReservedCount(preReserved);*/
-
-
-
 
+                wareAllCount.addAndGet(allCount.get());
+                wareUserdCount.addAndGet(userdCount.get());
+                wareLockCount.addAndGet(lockCount.get());
+                warePreReservedCount.addAndGet(preReservedCount.get());
+                wareNullPalletCount.addAndGet(nullPalletCount.get());
+                wareUnusedCount.addAndGet(unusedCount.get());
             });
             map.put("shelfList",wShelfManagementList);
+            map.put("wareCount",wWarehouseManagements.size());//库房数
+            map.put("shelfCount",shelfCount.get());//货架数
+
+            map.put("allCount",wareAllCount.get());//库位数
+            map.put("useCount",wareUserdCount.get());//已占用库位数
+            map.put("unuseCount",wareUnusedCount.get());//空库位数
+            map.put("nullPalletCount",wareNullPalletCount.get());//空托盘占用库位数
+            map.put("lockCount",wareLockCount.get());//锁定库位数
+            map.put("preReservedCount",warePreReservedCount.get());//预占用库位数
         });
         LambdaQueryWrapper<WStorageLocationManagement> allStorageWrapper= Wrappers.lambdaQuery(WStorageLocationManagement.class);
         Long allStorageLocation = wStorageLocationManagementDao.selectCount(allStorageWrapper);
@@ -217,13 +223,7 @@ public class WInventoryManagementServiceImpl extends BaseServiceImpl implements
         LambdaQueryWrapper<WStorageLocationManagement> lockStorageWrapper= Wrappers.lambdaQuery(WStorageLocationManagement.class).eq(WStorageLocationManagement::getStorageLocationStatus, Status.LOCKED.getCode());
         Long lockStorageLocation = wStorageLocationManagementDao.selectCount(lockStorageWrapper);
 
-        map.put("wareCount",wWarehouseManagements.size());//库房数
-        map.put("shelfCount",shelfCount.get());//货架数
-        map.put("allCount",allStorageLocation);//库位数
-        map.put("useCount",useStorageLocation);//已占用库位数
-        map.put("unuseCount",unuseStorageLocation);//空库位数
-        map.put("nullPalletCount",nullPalletStorageLocation);//空托盘占用库位数
-        map.put("lockCount",lockStorageLocation);//锁定库位数
+
 
         return map;
     }

+ 28 - 14
src/main/resources/static/wms/stock/signage.html

@@ -40,9 +40,15 @@
                 </div>
             </el-col>
             <el-col :xs="12" :sm="8" :lg="5">
-                <div class="blockDiv blockBg5">
-                    <h1>{{unuseCount}}<span class="danweiSpan">个</span></h1>
-                    <p>空库位</p>
+                <div class="blockDiv blockBg7">
+                    <h1>{{lockCount}}<span class="danweiSpan">个</span></h1>
+                    <p>锁定库位</p>
+                </div>
+            </el-col>
+            <el-col :xs="12" :sm="8" :lg="5">
+                <div class="blockDiv blockBg8">
+                    <h1>{{preReservedCount}}<span class="danweiSpan">个</span></h1>
+                    <p>预占用</p>
                 </div>
             </el-col>
             <el-col :xs="12" :sm="8" :lg="5">
@@ -52,11 +58,13 @@
                 </div>
             </el-col>
             <el-col :xs="12" :sm="8" :lg="5">
-                <div class="blockDiv blockBg7">
-                    <h1>{{lockCount}}<span class="danweiSpan">个</span></h1>
-                    <p>锁定库位</p>
+                <div class="blockDiv blockBg5">
+                    <h1>{{unuseCount}}<span class="danweiSpan">个</span></h1>
+                    <p>库位</p>
                 </div>
             </el-col>
+
+
         </el-row>
 
         <!-- 货架区域 -->
@@ -139,6 +147,7 @@
                 unuseCount: 0,
                 nullPalletCount: 0,
                 lockCount: 0,
+                preReservedCount: 0,
                 topTongjiData: {"shelvesCount": 0, "storgeCount": 0,"instockCount": 0,"freestockCount": 0,"lockstockCount": 0},
                 dialogVisible: false,
                 migrationResultList: [],
@@ -166,6 +175,7 @@
                         this.unuseCount = response.data.data.unuseCount;
                         this.nullPalletCount = response.data.data.nullPalletCount;
                         this.lockCount = response.data.data.lockCount;
+                        this.preReservedCount = response.data.data.preReservedCount;
                         // 处理响应
                         this.loading = false;
                     })
@@ -282,24 +292,28 @@
         border: 1px solid #8E66E4;
     }
     .blockBg3{
-        background: #3EB64B;
-        border: 1px solid #3EB64B;
-    }
-    .blockBg4{
         background: #0BA6D5;
         border: 1px solid #0BA6D5;
     }
+    .blockBg4{
+        background: #0F79DC;
+        border: 1px solid #0F79DC;
+    }
     .blockBg5{
         background: #E57878;
         border: 1px solid #E57878;
     }
     .blockBg6{
-        background: #E37B3D;
-        border: 1px solid #E37B3D;
+        background: #548EC5;
+        border: 1px solid #548EC5;
     }
     .blockBg7{
-        background: #548EC5;;
-        border: 1px solid #548EC5;;
+        background: #E57878;
+        border: 1px solid #E57878;
+    }
+    .blockBg8{
+        background: rgb(255, 147, 38);
+        border: 1px solid rgb(255, 147, 38);
     }
     .rowCls{
         background: white;