|
|
|
@ -1465,6 +1465,23 @@ public class ReportServiceImpl implements ReportService {
|
|
|
|
|
public Map<String, Object> workHoursBoard(String workCenter) {
|
|
|
|
|
HashMap<String, Object> result = new HashMap<>();
|
|
|
|
|
|
|
|
|
|
LinkedHashMap<String, String> sixMap = reportMapper.sixWorkCenterHoursQTY(workCenter);
|
|
|
|
|
ArrayList<Float> sixList = new ArrayList<>();
|
|
|
|
|
for (String key : sixMap.keySet()) {
|
|
|
|
|
sixList.add(Float.valueOf(String.valueOf(sixMap.get(key))));
|
|
|
|
|
}
|
|
|
|
|
result.put("sixList",sixList);
|
|
|
|
|
|
|
|
|
|
List<Map<String, String>> thisYearMapList = reportMapper.totalWorkingHoursCompletedThisYear(workCenter);
|
|
|
|
|
ArrayList<String> monthYearList = new ArrayList<>();
|
|
|
|
|
ArrayList<Float> workHorsList = new ArrayList<>();
|
|
|
|
|
for (Map<String, String> map : thisYearMapList) {
|
|
|
|
|
monthYearList.add(map.get("MONTH_MONTH"));
|
|
|
|
|
workHorsList.add(Float.valueOf(String.valueOf(map.get("QTY"))));
|
|
|
|
|
}
|
|
|
|
|
result.put("monthYearList",monthYearList);
|
|
|
|
|
result.put("workHorsList",workHorsList);
|
|
|
|
|
|
|
|
|
|
//各车间总工时完成情况(单轴多折线图)
|
|
|
|
|
List<Map<String, String>> WorkshopList = reportMapper.workingHoursEachWorkshop(workCenter);
|
|
|
|
|
List<String> monthOldList = WorkshopList.stream().map(e -> { return e.get("MONTH"); })
|
|
|
|
@ -1504,6 +1521,30 @@ public class ReportServiceImpl implements ReportService {
|
|
|
|
|
dutyCauseMap.put("causeTypeDescription",nameList);
|
|
|
|
|
dutyCauseMap.put("distributionMapList",nameAndValueList);
|
|
|
|
|
result.put("dutyCause",dutyCauseMap);
|
|
|
|
|
|
|
|
|
|
//年度对比图(单轴多折线图)
|
|
|
|
|
List<Map<String, String>> contrastList = reportMapper.workingHoursYearContrast(workCenter);
|
|
|
|
|
List<String> yearOldList = contrastList.stream().map(e -> { return e.get("M_MONTH"); })
|
|
|
|
|
.distinct().sorted().collect(Collectors.toList());
|
|
|
|
|
ArrayList<String> yearList = new ArrayList<>();
|
|
|
|
|
yearList.addAll(yearOldList);
|
|
|
|
|
|
|
|
|
|
Map<String, List<Map<String, String>>> contrastMap = contrastList.stream().
|
|
|
|
|
collect(Collectors.groupingBy(e -> e.get("CON_YEAR")));
|
|
|
|
|
ArrayList<HashMap<String, Object>> contrastMapValueList = new ArrayList<>();
|
|
|
|
|
for (String description : contrastMap.keySet()) {
|
|
|
|
|
List<Map<String, String>> maps = contrastMap.get(description);
|
|
|
|
|
HashMap<String, Object> map = new HashMap<>();
|
|
|
|
|
ArrayList<Float> QTYList = new ArrayList<>();
|
|
|
|
|
maps.forEach(e -> {
|
|
|
|
|
QTYList.add(Float.valueOf(String.valueOf(e.get("QTY"))));
|
|
|
|
|
});
|
|
|
|
|
map.put("name",description);
|
|
|
|
|
map.put("value",QTYList);
|
|
|
|
|
contrastMapValueList.add(map);
|
|
|
|
|
}
|
|
|
|
|
result.put("yearList",yearList);
|
|
|
|
|
result.put("contrastMapValueList",contrastMapValueList);
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1929,7 +1970,7 @@ public class ReportServiceImpl implements ReportService {
|
|
|
|
|
List<String> dateList = new ArrayList<>();
|
|
|
|
|
//获取近半年月份
|
|
|
|
|
Calendar calendar = Calendar.getInstance();
|
|
|
|
|
calendar.set(Calendar.MONTH,calendar.get(Calendar.MONTH) - 5);
|
|
|
|
|
calendar.set(Calendar.MONTH,calendar.get(Calendar.MONTH) - 6);
|
|
|
|
|
for (int i = 6 ; i > 0; i--) {
|
|
|
|
|
calendar.set(Calendar.MONTH, calendar.get(Calendar.MONTH) + 1);
|
|
|
|
|
dateList.add(calendar.get(Calendar.YEAR) + "-" + (calendar.get(Calendar.MONTH) == 0 ? 12 : calendar.get(Calendar.MONTH) < 10 ? "0" + calendar.get(Calendar.MONTH) : calendar.get(Calendar.MONTH)));
|
|
|
|
|