guoyujie
1 天以前 91b61fe723df498d62c596372521d426299f0f8b
north-glass-erp/src/main/java/com/example/erp/service/pp/ReportService.java
@@ -3,9 +3,7 @@
import com.baomidou.dynamic.datasource.annotation.DS;
import com.example.erp.dto.pp.DamageReportDTO;
import com.example.erp.dto.pp.ScheduleProductionScheduleDTO;
import com.example.erp.dto.pp.TeamOutputDTO;
import com.example.erp.dto.pp.*;
import com.example.erp.entity.pp.DamageDetails;
import com.example.erp.entity.pp.Report;
import com.example.erp.mapper.pp.ProductionSchedulingMapper;
@@ -88,7 +86,12 @@
            getRowCount.forEach(row -> {
                Map<String, Integer> getRow = new HashMap<>();
                // { row: 0, col: 1, rowspan: 3, colspan: 0},
                getRow.put("row", row.get("RowNum"));
                Object rowNumObj = row.get("RowNum");
                if (rowNumObj instanceof Double) {
                    getRow.put("row", ((Double) rowNumObj).intValue());
                } else if (rowNumObj instanceof Integer) {
                    getRow.put("row", (Integer) rowNumObj);
                }
                getRow.put("col", col);
                getRow.put("rowspan", row.get("rowCount"));
                getRow.put("colspan", 0);
@@ -102,7 +105,7 @@
        return map;
    }
    public Map<String, Object> crossProcessBreakingSv(Integer pageNum, Integer pageSize, List<String> selectDate, DamageDetails damageDetails) {
    public Map<String, Object> crossProcessBreakingSv(Integer pageNum, Integer pageSize, List<String> selectDate, CrossProcessBreakingDTO crossProcessBreakingDTO) {
        Integer offset = (pageNum - 1) * pageSize;
        String endDate = LocalDate.now().toString();
        String startDate = LocalDate.now().minusDays(15).toString();
@@ -115,18 +118,17 @@
            }
        }
        Map<String, Object> map = new HashMap<>();
        map.put("data", reportMapper.getProcessBreaking(offset, pageSize, startDate, endDate, damageDetails));
        map.put("total", reportMapper.getProcessBreakingTotal(offset, pageSize, startDate, endDate, damageDetails));
        map.put("data", reportMapper.getProcessBreaking(offset, pageSize, startDate, endDate, crossProcessBreakingDTO));
        map.put("total", reportMapper.getProcessBreakingTotal(offset, pageSize, startDate, endDate, crossProcessBreakingDTO));
        List<String> list = new ArrayList<>();
        list.add(startDate);
        list.add(endDate);
        map.put("selectDate", list);
//        map.put("total",orderMapper.getPageTotal(offset, pageSize, startDate, endDate, orderDetail));
        return map;
    }
    public Map<String, Object> workInProgressSv(Date selectTime1, Date selectTime2, String orderId, String inputProject, String selectProcesses, String optionVal, Report report) {
    public Map<String, Object> workInProgressSv(Integer pageNum, Integer pageSize, String orderId, String inputProject, String selectProcesses, String optionVal, WorkInProgressDTO workInProgressDTO) {
        Integer offset = (pageNum - 1) * pageSize;
        if ("null".equals(orderId)) {
            orderId = "";
        }
@@ -140,16 +142,23 @@
        Map<String, Object> map = new HashMap<>();
        if (optionVal.equals("1")){
            /* 根据销售单号汇总*/
            map.put("data", reportMapper.workInProgressOrderMp(selectTime1, selectTime2, orderId, inputProject, selectProcesses, report));
            map.put("data", reportMapper.workInProgressOrderMp(offset, pageSize, orderId, inputProject, selectProcesses, workInProgressDTO));
           // map.put("total", reportMapper.workInProgressOrderTotal(offset, pageSize, orderId, inputProject, selectProcesses, workInProgressDTO));
            map.put("total" ,reportMapper.workInProgressOrderFootSum(offset, pageSize,orderId, inputProject, selectProcesses, workInProgressDTO));
        }else if(optionVal.equals("2")){
            /* 根流程卡号汇总*/
            map.put("data", reportMapper.workInProgressProcessMp(selectTime1, selectTime2, orderId, inputProject, selectProcesses, report));
            map.put("data", reportMapper.workInProgressProcessMp(offset, pageSize, orderId, inputProject, selectProcesses, workInProgressDTO));
           // map.put("total", reportMapper.workInProgressProcessTotal(offset, pageSize, orderId, inputProject, selectProcesses, workInProgressDTO));
            map.put("total" ,reportMapper.workInProgressOrderFootSum(offset, pageSize,orderId, inputProject, selectProcesses, workInProgressDTO));
        } else if (optionVal.equals("3")) {
        } else {
            //没有选择分组
            map.put("data", reportMapper.workInProgressMp(offset, pageSize, orderId, inputProject, selectProcesses, workInProgressDTO));
            //map.put("total", reportMapper.workInProgressTotal(offset, pageSize, orderId, inputProject, selectProcesses, workInProgressDTO));
            map.put("total" ,reportMapper.workInProgressOrderFootSum(offset, pageSize,orderId, inputProject, selectProcesses, workInProgressDTO));
            map.put("data", reportMapper.workInProgressMp(selectTime1, selectTime2, orderId, inputProject, selectProcesses, report));
        }
        map.put("process", productionSchedulingMapper.selectProcess());
        return map;
@@ -165,6 +174,8 @@
        Map<String, Object> map = new HashMap<>();
        map.put("data", reportMapper.processToBeCompletedMp(selectTime1, selectTime2, orderId, inputProject, selectProcesses, report));
        map.put("process", productionSchedulingMapper.selectProcess());
        map.put("footSum" ,reportMapper.processToBeCompletedFootSum(selectTime1, selectTime2, orderId, inputProject, selectProcesses, report));
        return map;
    }
@@ -173,6 +184,7 @@
        Map<String, Object> map = new HashMap<>();
        map.put("data", reportMapper.selectDamageReportMp(offset, pageSize, selectTime1, selectTime2, damageReportDTO));
        map.put("total", reportMapper.getDamageReportPageTotal(offset, pageSize, selectTime1, selectTime2, damageReportDTO));
        map.put("footSum" ,reportMapper.damageReportFootSum(selectTime1, selectTime2, damageReportDTO));
        return map;
    }
@@ -339,6 +351,12 @@
        return map;
    }
    public Map<String, Object> orderReportingWorks(Date selectTime1, Date selectTime2, Report report) {
        Map<String, Object> map = new HashMap<>();
        map.put("data", reportMapper.orderReportingWorks(selectTime1, selectTime2, report));
        return map;
    }
    public Map<String, Object> rawMaterialRequisitionSv(Date selectTime1, Date selectTime2, Report report) {
        Map<String, Object> map = new HashMap<>();
        map.put("data", reportMapper.rawMaterialRequisitionMp(selectTime1, selectTime2, report));
@@ -350,7 +368,10 @@
    }
    public List exportDamageReportSv(List<LocalDate> dates) {
        if (dates != null && dates.size() > 1) {
            dates.set(1, dates.get(1).plusDays(1)); // 将第二个日期加一天
        }
        System.out.println(dates);
        return reportMapper.exportDamageReportMp(dates);
    }
@@ -373,7 +394,6 @@
    }
    public List exportWorkInProgressSv(Map<String, Object> dates) {
        List<LocalDate> date= (List<LocalDate>) dates.get("date");
        String process= (String) dates.get("processes");
        String inputVal= (String) dates.get("inputVal");
        String project= (String) dates.get("project");
@@ -383,7 +403,7 @@
        if ("null".equals(project)) {
            project = "";
        }
        return reportMapper.exportWorkInProgressMp(date,process,inputVal,project);
        return reportMapper.exportWorkInProgressMp(process,inputVal,project);
    }
    public List exportTaskCompletionStatusSv(Map<String, Object> dates) {
@@ -405,11 +425,16 @@
    }
    public Map<String, Object> teamOutputSv(Integer pageNum, Integer pageSize, Date selectTime1, Date selectTime2, String selectProcesses, TeamOutputDTO teamOutputDTO) {
        if (selectProcesses.equals("全部")){
            selectProcesses="";
        }
        Integer offset = (pageNum - 1) * pageSize;
        Map<String, Object> map = new HashMap<>();
        map.put("data", reportMapper.teamOutputMp(offset, pageSize, selectTime1, selectTime2,selectProcesses, teamOutputDTO));
        String laminating = reportMapper.getLaminating(selectProcesses);
        map.put("data", reportMapper.teamOutputMp(offset, pageSize, selectTime1, selectTime2,selectProcesses,laminating, teamOutputDTO));
        map.put("process", productionSchedulingMapper.selectProcess());
        map.put("total", reportMapper.teamOutputPageTotal(offset, pageSize, selectTime1, selectTime2,selectProcesses, teamOutputDTO));
        map.put("total", reportMapper.teamOutputPageTotal(offset, pageSize, selectTime1, selectTime2,selectProcesses,laminating, teamOutputDTO));
        map.put("footSum" ,reportMapper.teamOutputFootSum(selectTime1, selectTime2,selectProcesses,laminating, teamOutputDTO));
        return map;
    }
@@ -427,4 +452,14 @@
        String process= (String) dates.get("processes");
        return reportMapper.exportScheduleReportMp(date,process);
    }
    public List exportTeamOutputSv(Map<String, Object> dates) {
        List<LocalDate> date= (List<LocalDate>) dates.get("date");
        String process= (String) dates.get("processes");
        if (process.equals("全部")){
            process="";
        }
        String laminating = reportMapper.getLaminating(process);
        return reportMapper.exportTeamOutputMp(date,process,laminating);
    }
}