guoyujie
2025-11-05 4c004d622851642c2b40fb77d50fe31af680f90c
app部分接口
3个文件已修改
28 ■■■■ 已修改文件
north-glass-erp/src/main/java/com/example/erp/service/mm/MaterialInventoryService.java 26 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/service/sd/OrderService.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/resources/mapper/mm/MaterialInventory.xml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/service/mm/MaterialInventoryService.java
@@ -1,23 +1,14 @@
package com.example.erp.service.mm;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.dynamic.datasource.annotation.DS;
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;
import com.example.erp.entity.sd.DeliveryDetail;
import com.example.erp.entity.sd.OrderDetail;
import com.example.erp.entity.sd.OrderProcessDetail;
import com.example.erp.entity.userInfo.Log;
import com.example.erp.entity.userInfo.SysError;
import com.example.erp.exception.ServiceException;
import com.example.erp.mapper.mm.BasicWarehouseTypeMapper;
import com.example.erp.mapper.mm.MaterialInventoryMapper;
import com.example.erp.mapper.mm.MaterialLogMapper;
@@ -29,8 +20,6 @@
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;
@@ -38,6 +27,9 @@
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.util.*;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors;
@Service
@@ -1317,12 +1309,20 @@
    }
    public Object appGetStockList() {
        List<MaterialInventory> materialInventoryList = materialInventoryMapper.selectGetStockList();
        ExecutorService executor = Executors.newFixedThreadPool(2);
        AtomicReference<List<MaterialInventory>> materialInventoryList = new AtomicReference<>(new ArrayList<MaterialInventory>());
        executor.execute(() -> {
            materialInventoryList.set(materialInventoryMapper.selectGetStockList());
        });
        List<Object> list = new ArrayList<>();
        executor.shutdown();
        Map<String, Object> totalSum  = new HashMap<>();
        Integer inventoryQuantity = 0;
        Integer availableQuantity = 0;
        Double totalArea = 0.00;
        for (MaterialInventory materialInventory : materialInventoryList) {
        for (MaterialInventory materialInventory : materialInventoryList.get()) {
            inventoryQuantity += materialInventory.getInventoryQuantity();
            availableQuantity += materialInventory.getAvailableQuantity();
            totalArea += materialInventory.getTotalArea();
north-glass-erp/src/main/java/com/example/erp/service/sd/OrderService.java
@@ -1061,6 +1061,7 @@
        totalSum.put("perimeter", df.format(perimeter));
        totalSum.put("count", list.size());
        Map<String,Object> map = new HashMap<>();
        map.put("data",list);
        map.put("date",date);
north-glass-erp/src/main/resources/mapper/mm/MaterialInventory.xml
@@ -1393,6 +1393,7 @@
        left join mm.material_store ms
            on mi.material_code=ms.id
        where inventory_quantity>0
        and mi.inventory_organization = '原片库'
        order by mi.id desc
    </select>