| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.transaction.interceptor.TransactionAspectSupport; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | import java.util.ArrayList; |
| | |
| | | |
| | | } |
| | | |
| | | public Object appGetStockList() { |
| | | List<MaterialInventory> materialInventoryList = materialInventoryMapper.selectGetStockList(); |
| | | Map<String, Object> totalSum = new HashMap<>(); |
| | | Integer inventoryQuantity = 0; |
| | | Integer availableQuantity = 0; |
| | | Double totalArea = 0.00; |
| | | for (MaterialInventory materialInventory : materialInventoryList) { |
| | | inventoryQuantity += materialInventory.getInventoryQuantity(); |
| | | availableQuantity += materialInventory.getAvailableQuantity(); |
| | | totalArea += materialInventory.getTotalArea(); |
| | | } |
| | | DecimalFormat df = new DecimalFormat("#.00"); |
| | | totalSum.put("inventoryQuantity",inventoryQuantity); |
| | | totalSum.put("availableQuantity",availableQuantity); |
| | | totalSum.put("totalArea", df.format(totalArea)); |
| | | |
| | | |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("glassStock", materialInventoryList); |
| | | map.put("totalSum", totalSum); |
| | | return map; |
| | | } |
| | | } |