Commit 9a73969b22a972c1ffe3c4e35f227b17ca040691
1 parent
1568b7c0
首页进日出入库根据时间来
Showing
1 changed file
with
13 additions
and
9 deletions
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/home/service/impl/HomePageViewServiceImpl.java
... | ... | @@ -339,26 +339,30 @@ public class HomePageViewServiceImpl implements HomePageViewService { |
339 | 339 | String today = new SimpleDateFormat("yyyy-MM-dd").format(System.currentTimeMillis() - 1000 * 60 * 60 * 24).toString(); |
340 | 340 | Map<String, Object> map = new HashMap<>(); |
341 | 341 | |
342 | + | |
343 | + | |
342 | 344 | // 今天入库量 |
343 | - LambdaQueryWrapper<TaskDetail> taskDetailLambdaQueryWrapper = Wrappers.lambdaQuery(); | |
344 | - taskDetailLambdaQueryWrapper.select(TaskDetail::getTaskType, TaskDetail::getQty).gt(TaskDetail::getCreateTime, today); | |
345 | - List<TaskDetail> taskDetails = taskDetailServiceImpl.list(taskDetailLambdaQueryWrapper); | |
345 | + LambdaQueryWrapper<InventoryTransaction> inventoryTransactionLambdaQueryWrapper = Wrappers.lambdaQuery(); | |
346 | + inventoryTransactionLambdaQueryWrapper.select(InventoryTransaction::getType,InventoryTransaction::getQty).gt(InventoryTransaction::getCreateTime, today); | |
347 | + List<InventoryTransaction> inventoryTransactions = inventoryTransactionServiceImpl.list(inventoryTransactionLambdaQueryWrapper); | |
346 | 348 | BigDecimal receiptQty = BigDecimal.ZERO; |
347 | 349 | BigDecimal shipmentQty = BigDecimal.ZERO; |
348 | 350 | |
349 | - for (TaskDetail taskDetail : taskDetails) { | |
350 | - if (taskDetail.getTaskType().equals(QuantityConstant.TASK_TYPE_WHOLERECEIPT)) { | |
351 | - receiptQty = receiptQty.add(taskDetail.getQty()); | |
352 | - } else if (taskDetail.getTaskType().equals(QuantityConstant.TASK_TYPE_WHOLESHIPMENT)) { | |
353 | - shipmentQty = shipmentQty.add(taskDetail.getQty()); | |
351 | + for (InventoryTransaction inventoryTransaction : inventoryTransactions) { | |
352 | + if (inventoryTransaction.getType().equals(QuantityConstant.INVENTORY_TRANSACTION_RECEIPT)) { | |
353 | + receiptQty = receiptQty.add(inventoryTransaction.getQty()); | |
354 | + } else if (inventoryTransaction.getType().equals(QuantityConstant.INVENTORY_TRANSACTION_SHIPMENT)) { | |
355 | + shipmentQty = shipmentQty.add(inventoryTransaction.getQty()); | |
354 | 356 | } |
355 | - | |
356 | 357 | } |
357 | 358 | map.put("receiptTotal", receiptQty); |
358 | 359 | map.put("shipmentTotal", shipmentQty); |
359 | 360 | // 今日交易量 |
360 | 361 | map.put("bllCount", receiptQty.add(shipmentQty)); |
361 | 362 | |
363 | + | |
364 | + | |
365 | + | |
362 | 366 | // 库存总数 |
363 | 367 | LambdaQueryWrapper<InventoryHeader> inventoryHeaderLambdaQueryWrapper = Wrappers.lambdaQuery(); |
364 | 368 | inventoryHeaderLambdaQueryWrapper.select(InventoryHeader::getTotalQty); |
... | ... |