廖井涛
2025-12-02 fd2ec4214c6f8456b957c3545e7d67bcdbbb9985
north-glass-erp/src/main/java/com/example/erp/service/pp/ReportService.java
@@ -692,10 +692,27 @@
        return map;
    }
    public Map<String, Object> yieldSv(String selectTime1, String selectTime2, String selectProcesses, Report report) {
    public Map<String, Object> yieldSv(List<String> selectDate, String selectProcesses,String reportTime, Report report) {
        Map<String, Object> map = new HashMap<>();
        map.put("data", reportMapper.yieldMp(selectTime1, selectTime2, selectProcesses, report));
        // 默认时间范围:过去 7 天(日期 + reportTime)
        String startDate = toReportTime(LocalDate.now().minusDays(7).toString(), reportTime);
        String endDate   = toReportTime(LocalDate.now().toString(), reportTime);
        // 如果前端传了时间,就用前端日期 + reportTime
        if (selectDate != null && selectDate.size() == 2) {
            if (selectDate.get(0) != null && !selectDate.get(0).isEmpty()) {
                startDate = toReportTime(selectDate.get(0), reportTime);
            }
            if (selectDate.get(1) != null && !selectDate.get(1).isEmpty()) {
                endDate = toReportTime(selectDate.get(1), reportTime);
            }
        }
        map.put("data", reportMapper.yieldMp(startDate, endDate, selectProcesses, report));
        map.put("process", productionSchedulingMapper.selectProcess());
        List<String> list = new ArrayList<>();
        list.add(startDate);
        list.add(endDate);
        map.put("selectDate",list);
        return map;
    }
@@ -1643,10 +1660,27 @@
        return map;
    }
    public Map<String, Object> yieldProcessSv(String selectTime1, String selectTime2, Report report) {
    public Map<String, Object> yieldProcessSv(List<String> selectDate,String reportTime, Report report) {
        Map<String, Object> map = new HashMap<>();
        map.put("data", reportMapper.yieldProcessMp(selectTime1, selectTime2, report));
        // 默认时间范围:过去 7 天(日期 + reportTime)
        String startDate = toReportTime(LocalDate.now().minusDays(7).toString(), reportTime);
        String endDate   = toReportTime(LocalDate.now().toString(), reportTime);
        // 如果前端传了时间,就用前端日期 + reportTime
        if (selectDate != null && selectDate.size() == 2) {
            if (selectDate.get(0) != null && !selectDate.get(0).isEmpty()) {
                startDate = toReportTime(selectDate.get(0), reportTime);
            }
            if (selectDate.get(1) != null && !selectDate.get(1).isEmpty()) {
                endDate = toReportTime(selectDate.get(1), reportTime);
            }
        }
        map.put("data", reportMapper.yieldProcessMp(startDate, endDate, report));
        map.put("process", productionSchedulingMapper.selectProcess());
        List<String> list = new ArrayList<>();
        list.add(startDate);
        list.add(endDate);
        map.put("selectDate",list);
        return map;
    }