|
@@ -81,9 +81,10 @@ public class GanttServiceImpl implements GanttService {
|
|
for (Map.Entry<String, List<GanttVos>> workShopEntry : dataMap.entrySet()) {
|
|
for (Map.Entry<String, List<GanttVos>> workShopEntry : dataMap.entrySet()) {
|
|
workShopVo = new ScheduleGanttVo();
|
|
workShopVo = new ScheduleGanttVo();
|
|
workShopVo.setId(workShopIndex++);
|
|
workShopVo.setId(workShopIndex++);
|
|
- workShopVo.setText(workShopEntry.getKey());
|
|
|
|
|
|
+ workShopVo.setText(workShopEntry.getValue().get(0).getProcessworkshop());
|
|
workShopVo.setOpen(true);
|
|
workShopVo.setOpen(true);
|
|
workShopVo.setType(DEFAULT_TYPE);
|
|
workShopVo.setType(DEFAULT_TYPE);
|
|
|
|
+ workShopVo.setStart_date(workShopEntry.getValue().get(0).getPlanstartdate());
|
|
resultVo.add(workShopVo);
|
|
resultVo.add(workShopVo);
|
|
// 对数据按照设备进行分组
|
|
// 对数据按照设备进行分组
|
|
LinkedHashMap<String, List<GanttVos>> processMap = workShopEntry.getValue().stream().collect(Collectors.groupingBy(info -> info.getProcessdeviceid(),
|
|
LinkedHashMap<String, List<GanttVos>> processMap = workShopEntry.getValue().stream().collect(Collectors.groupingBy(info -> info.getProcessdeviceid(),
|
|
@@ -92,11 +93,12 @@ public class GanttServiceImpl implements GanttService {
|
|
for (Map.Entry<String, List<GanttVos>> deviceEntry : processMap.entrySet()) {
|
|
for (Map.Entry<String, List<GanttVos>> deviceEntry : processMap.entrySet()) {
|
|
deviceVo = new ScheduleGanttVo();
|
|
deviceVo = new ScheduleGanttVo();
|
|
deviceVo.setId(workShopIndex++);
|
|
deviceVo.setId(workShopIndex++);
|
|
- deviceVo.setText(deviceEntry.getValue().get(0).getProcessworkshop());
|
|
|
|
|
|
+ deviceVo.setText(deviceEntry.getValue().get(0).getProcessdevice());
|
|
deviceVo.setOpen(true);
|
|
deviceVo.setOpen(true);
|
|
deviceVo.setType(DEFAULT_TYPE);
|
|
deviceVo.setType(DEFAULT_TYPE);
|
|
- deviceVo.setParentid(workShopVo.getId());
|
|
|
|
|
|
+ deviceVo.setParent(workShopVo.getId());
|
|
deviceVo.setRender(DEFAULT_RENDER);
|
|
deviceVo.setRender(DEFAULT_RENDER);
|
|
|
|
+ deviceVo.setStart_date(deviceEntry.getValue().get(0).getPlanstartdate());
|
|
resultVo.add(deviceVo);
|
|
resultVo.add(deviceVo);
|
|
// 对数据按照 计划开始时间+计划结束时间 分组
|
|
// 对数据按照 计划开始时间+计划结束时间 分组
|
|
LinkedHashMap<String, List<GanttVos>> planDataMap = deviceEntry.getValue().stream().collect(Collectors.groupingBy(info -> info.getPlanstartdate().toString() + info.getPlanenddate().toString(),
|
|
LinkedHashMap<String, List<GanttVos>> planDataMap = deviceEntry.getValue().stream().collect(Collectors.groupingBy(info -> info.getPlanstartdate().toString() + info.getPlanenddate().toString(),
|
|
@@ -107,6 +109,7 @@ public class GanttServiceImpl implements GanttService {
|
|
List<String> itemNames=new ArrayList<>();
|
|
List<String> itemNames=new ArrayList<>();
|
|
// 按照工序作业明细ID 进行分组 并且获取 图列的 名称和描述
|
|
// 按照工序作业明细ID 进行分组 并且获取 图列的 名称和描述
|
|
LinkedHashMap<String, List<GanttVos>> collect = ganttVos.stream().collect(Collectors.groupingBy(GanttVos::getId, LinkedHashMap::new, Collectors.toList()));
|
|
LinkedHashMap<String, List<GanttVos>> collect = ganttVos.stream().collect(Collectors.groupingBy(GanttVos::getId, LinkedHashMap::new, Collectors.toList()));
|
|
|
|
+
|
|
String itemName = collect.values().stream().map(info -> {
|
|
String itemName = collect.values().stream().map(info -> {
|
|
String prefix = info.stream().map(data -> String.format(GANTT_ITEM_NAME_PREFIX, data.getCustomerabbreviation(), data.getProductname()))
|
|
String prefix = info.stream().map(data -> String.format(GANTT_ITEM_NAME_PREFIX, data.getCustomerabbreviation(), data.getProductname()))
|
|
.collect(Collectors.joining(","));
|
|
.collect(Collectors.joining(","));
|
|
@@ -127,7 +130,7 @@ public class GanttServiceImpl implements GanttService {
|
|
}).collect(Collectors.joining("</br>"));
|
|
}).collect(Collectors.joining("</br>"));
|
|
dateVo = new ScheduleGanttVo();
|
|
dateVo = new ScheduleGanttVo();
|
|
dateVo.setId(workShopIndex++);
|
|
dateVo.setId(workShopIndex++);
|
|
- dateVo.setParentid(deviceVo.getId());
|
|
|
|
|
|
+ dateVo.setParent(deviceVo.getId());
|
|
dateVo.setText(StringUtils.join(itemNames,"</br>"));
|
|
dateVo.setText(StringUtils.join(itemNames,"</br>"));
|
|
dateVo.setTooltip(itemPrefix+itemDesc);
|
|
dateVo.setTooltip(itemPrefix+itemDesc);
|
|
dateVo.setOpen(false);
|
|
dateVo.setOpen(false);
|