廖井涛
2025-07-22 7789318b8a9ef6535a0b776c5c0bfe2a8eb98e2b
north-glass-erp/src/main/java/com/example/erp/service/pp/ReportService.java
@@ -5,7 +5,6 @@
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.erp.dto.pp.*;
import com.example.erp.entity.pp.DamageDetails;
import com.example.erp.entity.pp.Report;
import com.example.erp.entity.sd.BasicData;
import com.example.erp.entity.sd.OrderDetail;
@@ -14,17 +13,14 @@
import com.example.erp.mapper.pp.FlowCardMapper;
import com.example.erp.mapper.pp.ProductionSchedulingMapper;
import com.example.erp.mapper.pp.ReportMapper;
import com.example.erp.mapper.pp.ReportingWorkMapper;
import com.example.erp.mapper.sd.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import java.sql.Date;
import java.time.LocalDate;
import java.util.*;
import java.util.concurrent.Executor;
import java.util.function.Function;
import java.util.stream.Collectors;
@@ -42,6 +38,7 @@
    private final OrderDetailMapper orderDetailMapper;
    FlowCardMapper flowCardMapper;
    private ReportingWorkMapper reportingWorkMapper;
    //上工序报工班组
@@ -116,7 +113,11 @@
    }
    public ReportService(ReportMapper reportMapper, OrderProcessDetailMapper orderProcessDetailMapper, ProductionSchedulingMapper productionSchedulingMapper, FlowCardMapper flowCardMapper, OrderGlassDetailMapper orderGlassDetailMapper, BasicDataMapper basicDataMapper, ProductDetailMapper productDetailMapper, OrderDetailMapper orderDetailMapper) {
    public ReportService(ReportMapper reportMapper, OrderProcessDetailMapper orderProcessDetailMapper,
                         ProductionSchedulingMapper productionSchedulingMapper, FlowCardMapper flowCardMapper,
                         OrderGlassDetailMapper orderGlassDetailMapper, BasicDataMapper basicDataMapper,
                         ProductDetailMapper productDetailMapper, OrderDetailMapper orderDetailMapper,
                         ReportingWorkMapper reportingWorkMapper) {
        this.reportMapper = reportMapper;
        this.orderProcessDetailMapper = orderProcessDetailMapper;
        this.productionSchedulingMapper = productionSchedulingMapper;
@@ -125,6 +126,7 @@
        this.basicDataMapper = basicDataMapper;
        this.productDetailMapper = productDetailMapper;
        this.orderDetailMapper = orderDetailMapper;
        this.reportingWorkMapper = reportingWorkMapper;
    }
    //流程卡进度方法
@@ -595,14 +597,30 @@
        if (selectProcesses.equals("全部")){
            selectProcesses="";
        }
        String laminating = "";
        Map<String, Object> map = new HashMap<>();
        List<WorkInProgressDTO> dataList2  =reportMapper.workInProgressMpdataList2(offset, pageSize,orderId, inputProject, selectProcesses, workInProgressDTO);
            List<WorkInProgressDTO> dataList1  =reportMapper.workInProgressMpdataList1(offset, pageSize,orderId, inputProject,  selectProcesses, workInProgressDTO);
            mergeTeamsGroupsName(dataList1, dataList2);
            map.put("data",dataList1);
           // map.put("total" ,reportMapper.workInProgressCombinationOrderFootSum(offset, pageSize,orderId, inputProject, selectProcesses, workInProgressDTO));
        map.put("total" ,reportMapper.workInProgressOrderFootSum(offset, pageSize,orderId, inputProject, selectProcesses, workInProgressDTO));
        // 获取所有工序
        List<String> processList  = reportMapper.selectProcess();
        // 遍历每个工序并调用新方法
        List<Map<String, Object>> resultList = new ArrayList<>();
        if (selectProcesses!=""){
            laminating = reportingWorkMapper.getProcessLaminating(selectProcesses);
            List<Map<String, Object>> singleResult = reportMapper.getWorkInProgressCombination(selectProcesses,laminating,optionVal);
            resultList.addAll(singleResult);
        }else {
            for (String process : processList) {
                //获取报工工序是否为复合工程
                laminating = reportingWorkMapper.getProcessLaminating(process);
                List<Map<String, Object>> singleResult = reportMapper.getWorkInProgressCombination(process,laminating,optionVal);
                if (singleResult != null && !singleResult.isEmpty()) {
                    resultList.addAll(singleResult);
                }
            }
        }
        map.put("data",resultList);
        map.put("process", productionSchedulingMapper.selectProcess());
        return map;
    }