| | |
| | | result.put("footSum", footSumFuture.get()); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | throw new RuntimeException("并行查询异常:" + e.getMessage(), e); |
| | | throw new RuntimeException("次破总表并行查询异常:" + e.getMessage(), e); |
| | | } |
| | | |
| | | // 回传前端的时间(现在是带时分秒的) |
| | |
| | | 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; |
| | | } |
| | | |
| | |
| | | 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; |
| | | } |
| | | |