浏览代码

feature 代码提交

xiahan 1 年之前
父节点
当前提交
a12e0ddc91

+ 7 - 4
cx-aps/cx-aps-common/src/main/java/com/rongwei/bscommon/sys/service/impl/GanttServiceImpl.java

@@ -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);

+ 4 - 2
cx-aps/cx-aps-entity/src/main/java/com/rongwei/bsentity/vo/ScheduleGanttVo.java

@@ -1,6 +1,7 @@
 package com.rongwei.bsentity.vo;
 package com.rongwei.bsentity.vo;
 
 
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.annotation.JsonInclude;
 import lombok.Data;
 import lombok.Data;
 
 
 import java.util.Date;
 import java.util.Date;
@@ -13,6 +14,7 @@ import java.util.List;
  * @date 2024/03/25
  * @date 2024/03/25
  */
  */
 @Data
 @Data
+@JsonInclude(JsonInclude.Include.NON_NULL)
 public class ScheduleGanttVo {
 public class ScheduleGanttVo {
 //    /**
 //    /**
 //     * 加工车间
 //     * 加工车间
@@ -26,11 +28,11 @@ public class ScheduleGanttVo {
     /**
     /**
      * 唯一标识
      * 唯一标识
      */
      */
-    private int id;
+    private Integer id;
     /**
     /**
      * 父数据的ID
      * 父数据的ID
      */
      */
-    private int parentid;
+    private Integer parent=0;
 
 
     /**
     /**
      * 树的名称  车间/设备
      * 树的名称  车间/设备