|
|
|
@ -519,7 +519,7 @@ public class ReportServiceImpl implements ReportService {
|
|
|
|
|
String site = CommonMethods.getSite();
|
|
|
|
|
paramMap.put("site", site);
|
|
|
|
|
paramMap.put("locale", LocaleContextHolder.getLocale().getLanguage());
|
|
|
|
|
if (!StringUtils.isBlank(String.valueOf(paramMap.get("week")))){
|
|
|
|
|
if (String.valueOf(paramMap.get("week")).equals("true")){
|
|
|
|
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
|
LocalDateTime now = LocalDateTime.now();
|
|
|
|
|
DateTimeFormatter fmt = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
|
|
@ -720,7 +720,9 @@ public class ReportServiceImpl implements ReportService {
|
|
|
|
|
return "橡塑";
|
|
|
|
|
} else if (career.indexOf("非公路") != -1) {
|
|
|
|
|
return "非公路";
|
|
|
|
|
} else if (career.indexOf("塞班") != -1) {
|
|
|
|
|
}else if (career.indexOf("研究院") != -1) {
|
|
|
|
|
return "研究院";
|
|
|
|
|
}else if (career.indexOf("塞班") != -1) {
|
|
|
|
|
return "塞班";
|
|
|
|
|
} else {
|
|
|
|
|
return "外部";
|
|
|
|
@ -760,43 +762,139 @@ 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<>();
|
|
|
|
|
/*Map<String, List<Map<String, String>>> resourceListMap = capacityLoadList.stream().
|
|
|
|
|
collect(Collectors.groupingBy(e -> e.get("resourceDescription")));*/
|
|
|
|
|
//八个柱状图:计划工时list、计划产能、未完成工时、设备描述
|
|
|
|
|
/*for (String resource : resourceListMap.keySet()) {
|
|
|
|
|
HashMap<String, Object> resourceMap = new HashMap<>();
|
|
|
|
|
//计划工时
|
|
|
|
|
ArrayList<String> planList = new ArrayList<>();
|
|
|
|
|
List<Map<String, String>> mapList = resourceListMap.get(resource);
|
|
|
|
|
mapList.forEach(e -> {
|
|
|
|
|
e.
|
|
|
|
|
});*/
|
|
|
|
|
capacityLoadList.forEach(e -> {
|
|
|
|
|
HashMap<String, Object> resourceMap = new HashMap<>();
|
|
|
|
|
//计划工时
|
|
|
|
|
ArrayList<String> planList = new ArrayList<>();
|
|
|
|
|
planList.add(e.get("planCapacity1"));
|
|
|
|
|
planList.add(e.get("planCapacity2"));
|
|
|
|
|
planList.add(e.get("planCapacity3"));
|
|
|
|
|
planList.add(e.get("planCapacity4"));
|
|
|
|
|
planList.add(e.get("planCapacity5"));
|
|
|
|
|
planList.add(e.get("planCapacity6"));
|
|
|
|
|
planList.add(e.get("planCapacity7"));
|
|
|
|
|
planList.add(e.get("planCapacity8"));
|
|
|
|
|
resourceMap.put("planCapacity",planList);
|
|
|
|
|
//计划产能
|
|
|
|
|
resourceMap.put("standardWeekCapacity",e.get("standardWeekCapacity"));
|
|
|
|
|
//未完成工时
|
|
|
|
|
resourceMap.put("tardinessWork",e.get("tardinessWork"));
|
|
|
|
|
//
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<Map<String, String>> capacityLoadList = null;
|
|
|
|
|
try {
|
|
|
|
|
capacityLoadList = reportMapper.capacityLoad(workCenter);
|
|
|
|
|
Float planCapacity = 0f;
|
|
|
|
|
Float standardCapacity = 0f;
|
|
|
|
|
ArrayList<HashMap<String, Object> > eightList = new ArrayList<>();
|
|
|
|
|
ArrayList<Float> planHoursList = new ArrayList<>();
|
|
|
|
|
ArrayList<Float> planUndoneHoursList = new ArrayList<>();
|
|
|
|
|
for (Map<String, String> map : capacityLoadList) {
|
|
|
|
|
HashMap<String, Object> resourceMap = new HashMap<>();
|
|
|
|
|
//计划工时
|
|
|
|
|
ArrayList<String> planList = new ArrayList<>();
|
|
|
|
|
planList.add(String.valueOf(map.get("planCapacity1")));
|
|
|
|
|
planList.add(String.valueOf(map.get("planCapacity2")));
|
|
|
|
|
planList.add(String.valueOf(map.get("planCapacity3")));
|
|
|
|
|
planList.add(String.valueOf(map.get("planCapacity4")));
|
|
|
|
|
planList.add(String.valueOf(map.get("planCapacity5")));
|
|
|
|
|
planList.add(String.valueOf(map.get("planCapacity6")));
|
|
|
|
|
planList.add(String.valueOf(map.get("planCapacity7")));
|
|
|
|
|
planList.add(String.valueOf(map.get("planCapacity8")));
|
|
|
|
|
resourceMap.put("planCapacityList",planList);
|
|
|
|
|
//标准产能
|
|
|
|
|
resourceMap.put("standardWeekCapacity",map.get("standardWeekCapacity"));
|
|
|
|
|
//未完成工时
|
|
|
|
|
//resourceMap.put("tardinessWork",map.get("tardinessWork"));
|
|
|
|
|
//设备描述
|
|
|
|
|
resourceMap.put("resourceDescription",map.get("resourceDescription"));
|
|
|
|
|
//总标准产能、总计划产能
|
|
|
|
|
for (String et : planList) {
|
|
|
|
|
planCapacity += Float.parseFloat(et);
|
|
|
|
|
}
|
|
|
|
|
standardCapacity += Float.valueOf(String.valueOf(map.get("standardWeekCapacity")));
|
|
|
|
|
//比率 计划工时 / 标准产能 * 100
|
|
|
|
|
ArrayList<String> rateList = new ArrayList<>();
|
|
|
|
|
rateList.add(String.valueOf(Float.valueOf(String.valueOf(map.get("planCapacity1"))) / Float.valueOf(String.valueOf(Float.valueOf(map.get("standardWeekCapacity")))) * 100));
|
|
|
|
|
rateList.add(String.valueOf(Float.valueOf(String.valueOf(map.get("planCapacity2"))) / Float.valueOf(String.valueOf(Float.valueOf(map.get("standardWeekCapacity")))) * 100));
|
|
|
|
|
rateList.add(String.valueOf(Float.valueOf(String.valueOf(map.get("planCapacity3"))) / Float.valueOf(String.valueOf(Float.valueOf(map.get("standardWeekCapacity")))) * 100));
|
|
|
|
|
rateList.add(String.valueOf(Float.valueOf(String.valueOf(map.get("planCapacity4"))) / Float.valueOf(String.valueOf(Float.valueOf(map.get("standardWeekCapacity")))) * 100));
|
|
|
|
|
rateList.add(String.valueOf(Float.valueOf(String.valueOf(map.get("planCapacity5"))) / Float.valueOf(String.valueOf(Float.valueOf(map.get("standardWeekCapacity")))) * 100));
|
|
|
|
|
rateList.add(String.valueOf(Float.valueOf(String.valueOf(map.get("planCapacity6"))) / Float.valueOf(String.valueOf(Float.valueOf(map.get("standardWeekCapacity")))) * 100));
|
|
|
|
|
rateList.add(String.valueOf(Float.valueOf(String.valueOf(map.get("planCapacity7"))) / Float.valueOf(String.valueOf(Float.valueOf(map.get("standardWeekCapacity")))) * 100));
|
|
|
|
|
rateList.add(String.valueOf(Float.valueOf(String.valueOf(map.get("planCapacity8"))) / Float.valueOf(String.valueOf(Float.valueOf(map.get("standardWeekCapacity")))) * 100));
|
|
|
|
|
resourceMap.put("planCapacityRateList",rateList);
|
|
|
|
|
|
|
|
|
|
planHoursList.add(Float.valueOf(String.valueOf(map.get("planHours"))));
|
|
|
|
|
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));
|
|
|
|
|
//八个柱状图
|
|
|
|
|
result.put("eightList",eightList);
|
|
|
|
|
//中心 计划工时、未完成工时List
|
|
|
|
|
result.put("planHoursList",planHoursList);
|
|
|
|
|
result.put("planUndoneHoursList",planUndoneHoursList);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
/**
|
|
|
|
|
* 制造中心检验看板
|
|
|
|
|
* @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;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -834,7 +932,6 @@ public class ReportServiceImpl implements ReportService {
|
|
|
|
|
List<Map<String, String>> dutyCauseTypeDescription = reportMapper.dutyCauseTypeDescription();
|
|
|
|
|
List<String> descriptionList = dutyCauseTypeDescription.stream().map(e -> e.get("DESCRIPTION")).collect(Collectors.toList());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<String> numbersList = new LinkedList<>();
|
|
|
|
|
List<String> dutyCauseType = reportMapper.dutyCauseType(user);
|
|
|
|
|
for (String type : dutyCauseType) {
|
|
|
|
|