chenlu
2025-10-30 174cc2a8aa52f00334e0e9a3a0ea91b2e3e7acd3
north-glass-erp/src/main/java/com/example/erp/service/mm/MaterialInventoryService.java
@@ -8,6 +8,7 @@
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.example.erp.common.Constants;
import com.example.erp.dto.mm.FinishedOperateLogDTO;
import com.example.erp.dto.mm.MaterialLogDTO;
import com.example.erp.entity.mm.*;
import com.example.erp.entity.pp.*;
import com.example.erp.entity.sd.Delivery;
@@ -28,6 +29,7 @@
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;
@@ -875,8 +877,15 @@
        return map;
    }
    public List<MaterialLog> exportMaterialLogReport(List<LocalDate> dates, String type) {
        return materialInventoryMapper.exportMaterialLogReport(dates,type);
    public List<MaterialLogDTO> exportMaterialLogReport(List<LocalDate> dates, String type) {
        if(type.equals("物料出库")){
            return materialInventoryMapper.exportMaterialLogReport(dates,type);
        }else if(type.equals("优化出库")){
            return materialInventoryMapper.exportMaterialLogOptimizeOutboundReport(dates,type);
        }else{
            return materialInventoryMapper.exportMaterialLogReports(dates,type);
        }
    }
@@ -1307,4 +1316,26 @@
    }
    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;
    }
}