|
|
|
@ -762,8 +762,11 @@ public class ReportServiceImpl implements ReportService {
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public Map<String, Object> capacityLoad(String workCenter) {
|
|
|
|
|
List<Map<String, String>> capacityLoadList = reportMapper.capacityLoad(workCenter);
|
|
|
|
|
HashMap<String, Object> result = new HashMap<>();
|
|
|
|
|
|
|
|
|
|
List<Map<String, String>> capacityLoadList = null;
|
|
|
|
|
try {
|
|
|
|
|
capacityLoadList = reportMapper.capacityLoad(workCenter);
|
|
|
|
|
Float planCapacity = 0f;
|
|
|
|
|
Float standardCapacity = 0f;
|
|
|
|
|
ArrayList<HashMap<String, Object> > eightList = new ArrayList<>();
|
|
|
|
@ -809,7 +812,6 @@ public class ReportServiceImpl implements ReportService {
|
|
|
|
|
planUndoneHoursList.add(Float.valueOf(String.valueOf(map.get("planUndoneHours"))));
|
|
|
|
|
eightList.add(resourceMap);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
result.put("planCapacity",String.format("%.2f", planCapacity));
|
|
|
|
|
result.put("standardCapacity",String.format("%.2f", standardCapacity));
|
|
|
|
|
//八个柱状图
|
|
|
|
@ -817,7 +819,81 @@ public class ReportServiceImpl implements ReportService {
|
|
|
|
|
//中心 计划工时、未完成工时List
|
|
|
|
|
result.put("planHoursList",planHoursList);
|
|
|
|
|
result.put("planUndoneHoursList",planUndoneHoursList);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 制造中心检验看板
|
|
|
|
|
* @param workCenter
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public Map<String, Object> manufacturingPlanning(String workCenter) {
|
|
|
|
|
HashMap<String, Object> result = new HashMap<>();
|
|
|
|
|
Map<String, String> sixMap = reportMapper.sixShopOrderQTY(workCenter);
|
|
|
|
|
ArrayList<Integer> sixList = new ArrayList<>();
|
|
|
|
|
for (String key : sixMap.keySet()) {
|
|
|
|
|
sixList.add(Integer.valueOf(String.valueOf(sixMap.get(key))));
|
|
|
|
|
}
|
|
|
|
|
result.put("sixList",sixList);
|
|
|
|
|
List<Map<String, String>> nearRateList = reportMapper.nearFifteenDayRate(workCenter);
|
|
|
|
|
ArrayList<Float> rateList = new ArrayList<>();
|
|
|
|
|
ArrayList<Float> itemsList = new ArrayList<>();
|
|
|
|
|
for (Map<String, String> nearRateMap : nearRateList) {
|
|
|
|
|
rateList.add(Float.parseFloat(String.valueOf(nearRateMap.get("qualifiedRate"))));
|
|
|
|
|
itemsList.add(Float.parseFloat(String.valueOf(nearRateMap.get("ItemsQTY"))));
|
|
|
|
|
}
|
|
|
|
|
result.put("rateList",rateList);
|
|
|
|
|
result.put("itemsList",itemsList);
|
|
|
|
|
//不合格责任部门分布
|
|
|
|
|
List<Map<String, String>> departmentList = reportMapper.departmentForNonconformity(workCenter);
|
|
|
|
|
List<String> monthOldList = departmentList.stream().map(e -> { return e.get("month"); })
|
|
|
|
|
.distinct().sorted().collect(Collectors.toList());
|
|
|
|
|
ArrayList<String> monthList = new ArrayList<>();
|
|
|
|
|
monthList.addAll(monthOldList);
|
|
|
|
|
Map<String, List<Map<String, String>>> descriptionMap = departmentList.stream().
|
|
|
|
|
collect(Collectors.groupingBy(e -> e.get("description")));
|
|
|
|
|
ArrayList<HashMap<String, Object>> descriptionValueList = new ArrayList<>();
|
|
|
|
|
for (String description : descriptionMap.keySet()) {
|
|
|
|
|
|
|
|
|
|
List<Map<String, String>> maps = descriptionMap.get(description);
|
|
|
|
|
HashMap<String, Object> map = new HashMap<>();
|
|
|
|
|
ArrayList<String> QTYList = new ArrayList<>();
|
|
|
|
|
maps.forEach(e -> {
|
|
|
|
|
QTYList.add(String.valueOf(e.get("QTY")));
|
|
|
|
|
});
|
|
|
|
|
map.put("name",description);
|
|
|
|
|
map.put("value",QTYList);
|
|
|
|
|
descriptionValueList.add(map);
|
|
|
|
|
}
|
|
|
|
|
result.put("monthList",monthList);
|
|
|
|
|
result.put("descriptionValueList",descriptionValueList);
|
|
|
|
|
//一次性交付合格率
|
|
|
|
|
List<Map<String, String>> deliveryRateList = reportMapper.workshopDeliveryRateList(workCenter);
|
|
|
|
|
HashMap<String, List<String>> deliveryRateMap = new HashMap<>();
|
|
|
|
|
ArrayList<String> xDataNameList = new ArrayList<>();
|
|
|
|
|
ArrayList<String> yDataList = new ArrayList<>();
|
|
|
|
|
for (Map<String, String> map : deliveryRateList) {
|
|
|
|
|
xDataNameList.add(String.valueOf(map.get("month")));
|
|
|
|
|
yDataList.add(String.valueOf(map.get("rate")));
|
|
|
|
|
}
|
|
|
|
|
deliveryRateMap.put("xDataName",xDataNameList);
|
|
|
|
|
deliveryRateMap.put("yData",yDataList);
|
|
|
|
|
result.put("deliveryRate",deliveryRateMap);
|
|
|
|
|
//不合格TOP5比例图
|
|
|
|
|
List<Map<String, String>> ncTop5RateOldList = reportMapper.NCTop5RateList(workCenter).subList(0,5);
|
|
|
|
|
ArrayList<Map<String, Object>> ncTop5RateList = new ArrayList<>();
|
|
|
|
|
ncTop5RateOldList.forEach(e -> {
|
|
|
|
|
HashMap<String, Object> ncMap = new HashMap<>();
|
|
|
|
|
ncMap.put("name",String.valueOf(e.get("description")));
|
|
|
|
|
ncMap.put("y",Integer.valueOf(String.valueOf(e.get("QTY"))));
|
|
|
|
|
ncMap.put("h",Integer.valueOf(String.valueOf(e.get("QTY"))));
|
|
|
|
|
ncTop5RateList.add(ncMap);
|
|
|
|
|
});
|
|
|
|
|
result.put("ncTop5Rate",ncTop5RateList);
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|