|
@@ -44,7 +44,7 @@ import java.util.stream.Collectors;
|
|
|
@Service
|
|
|
public class GanttServiceImpl implements GanttService {
|
|
|
public static final String GANTT_ITEM_NAME = "%s %d卷 %s %s %tF";
|
|
|
-// public static final String GANTT_ITEM_NAME_PREFIX = "%s %s";
|
|
|
+ // public static final String GANTT_ITEM_NAME_PREFIX = "%s %s";
|
|
|
// public static final String GANTT_DESC_PREFIX = " 计划时间:%s-%s </br>" +
|
|
|
// "实际时间:%s-%s </br>" +
|
|
|
// "加工设备:%s/%s </br>";
|
|
@@ -63,7 +63,7 @@ public class GanttServiceImpl implements GanttService {
|
|
|
public static final String COMBINED_PROCESSING = "合并加工";
|
|
|
public static final String SCHEDULING_STR = "%s-正在排程";
|
|
|
public static final String SCHEDULING_TO_BE_PUBLISHED_STR = "%s-排程结束待发布";
|
|
|
- public static final String DEFAULT_SPLIT="-;-";
|
|
|
+ public static final String DEFAULT_SPLIT = "-;-";
|
|
|
private final Logger log = LoggerFactory.getLogger(this.getClass().getName());
|
|
|
@Autowired
|
|
|
private ApsProcessOperationProcessEquDao apsProcessOperationProcessEquDao;
|
|
@@ -77,6 +77,7 @@ public class GanttServiceImpl implements GanttService {
|
|
|
private ApsProcessOperationBackupService apsProcessOperationBackupService;
|
|
|
@Autowired
|
|
|
private ApsReportRecordsDao apsReportRecordsDao;
|
|
|
+
|
|
|
/**
|
|
|
* 根据条件获取gantt
|
|
|
*
|
|
@@ -93,7 +94,6 @@ public class GanttServiceImpl implements GanttService {
|
|
|
List<String> workShopIdList, List<String> orderNoList,
|
|
|
List<String> productionLineId, List<String> equId,
|
|
|
String productionLineName, String equName) {
|
|
|
- log.info("甘特图查询开始时间:" + DateUtil.now());
|
|
|
if (endDate == null && startDate != null) {
|
|
|
List<Date> searchDateList = getSearchDate(startDate);
|
|
|
startDate = searchDateList.get(0);
|
|
@@ -105,63 +105,13 @@ public class GanttServiceImpl implements GanttService {
|
|
|
startDate, endDate, factoryId, workShopIdList, orderNoList,
|
|
|
null, productionLineId, equId, null, productionLineName, equName);
|
|
|
stopWatch.stop();
|
|
|
- log.error("甘特图查询用时:{}",stopWatch.getTotalTimeSeconds());
|
|
|
+ log.error("甘特图查询用时:{}", stopWatch.getTotalTimeSeconds());
|
|
|
StopWatch stopWatch1 = new StopWatch();
|
|
|
stopWatch1.start();
|
|
|
List<ScheduleGanttVo> scheduleGanttVos = assembleGanttData(apsProcessOperationProcessEquDos);
|
|
|
stopWatch1.stop();
|
|
|
- log.error("甘特图组装数据用时:{}",stopWatch1.getTotalTimeSeconds());
|
|
|
-
|
|
|
+ log.error("甘特图组装数据用时:{}", stopWatch1.getTotalTimeSeconds());
|
|
|
return R.ok(scheduleGanttVos);
|
|
|
-// dataMap.forEach((k, v) -> {
|
|
|
-// ScheduleGanttVo vo = new ScheduleGanttVo();
|
|
|
-//
|
|
|
-// List<ScheduleGanttProcessVo> processVos = new ArrayList<>();
|
|
|
-// // 对数据按照时间进行+设备进行分组
|
|
|
-// LinkedHashMap<String, List<GanttVos>> processMap = v.stream().collect(Collectors.groupingBy(info -> info.getProcessdeviceid(),
|
|
|
-// LinkedHashMap::new, Collectors.toList()));
|
|
|
-// processMap.forEach((date, processs) -> {
|
|
|
-// ScheduleGanttProcessVo processVo = new ScheduleGanttProcessVo();
|
|
|
-// processVo.setProcessdevice(processs.get(0).getProcessdevice());
|
|
|
-// processVo.setProcessdeviceid(processs.get(0).getProcessdeviceid());
|
|
|
-// processVo.setPlanstartdate(processs.get(0).getPlanstartdate());
|
|
|
-// processVo.setPlanenddate(processs.get(0).getPlanenddate());
|
|
|
-// processVo.setProcessids(processs.stream().map(GanttVos::getProcessid).distinct().collect(Collectors.joining(",")));
|
|
|
-// processVo.setProcessdetailids(processs.stream().map(GanttVos::getId).distinct().collect(Collectors.joining(",")));
|
|
|
-//
|
|
|
-// List<String> itemNames=new ArrayList<>();
|
|
|
-// // 按照工序作业ID分组
|
|
|
-// LinkedHashMap<String, List<GanttVos>> groupByProcessId = processs.stream().collect(Collectors.groupingBy(GanttVos::getProcessid, LinkedHashMap::new, Collectors.toList()));
|
|
|
-// groupByProcessId.forEach((processId,data2)->{
|
|
|
-// // 按照工序作业明细ID 进行分组
|
|
|
-// LinkedHashMap<String, List<GanttVos>> collect = data2.stream().collect(Collectors.groupingBy(GanttVos::getId, LinkedHashMap::new, Collectors.toList()));
|
|
|
-// String itemName = collect.values().stream().map(info -> {
|
|
|
-// String prefix = info.stream().map(data -> String.format(GANTT_ITEM_NAME_PREFIX, data.getCustomerabbreviation(), data.getProductname()))
|
|
|
-// .collect(Collectors.joining(","));
|
|
|
-// return String.format(GANTT_ITEM_NAME, prefix, info.get(0).getPlanprocessrall(), info.get(0).getDeliverydate());
|
|
|
-// }).collect(Collectors.joining("</br>"));
|
|
|
-// itemNames.add(itemName);
|
|
|
-// });
|
|
|
-// String itemPrefix=String.format(GANTT_DESC_PREFIX,
|
|
|
-// dateFormat(processs.get(0).getPlanstartdate()),
|
|
|
-// dateFormat(processs.get(0).getPlanenddate()),
|
|
|
-// dateFormat(processs.get(0).getActualstartdate()),
|
|
|
-// dateFormat(processs.get(0).getActualfinishdate()),
|
|
|
-// processs.get(0).getProcessworkshop(),processs.get(0).getProcessdevice());
|
|
|
-// String itemDesc= processs.stream().map(info->{
|
|
|
-// return String.format(GANTT_DESC, info.getProductname(),info.getDeliverydate(),
|
|
|
-// info.getProcessname(),info.getPlanprocessrall(),info.getStartingroll(),info.getReportroll(),
|
|
|
-// info.getCheckoutroll(),info.getUnfinishroll(),info.getWorkstatus() );
|
|
|
-// }).collect(Collectors.joining("</br>"));
|
|
|
-// processVo.setItemname(StringUtils.join(itemNames,"</br>"));
|
|
|
-// processVo.setItemdesc(itemPrefix+itemDesc);
|
|
|
-// processVos.add(processVo);
|
|
|
-// });
|
|
|
-// vo.setProcessList(processVos);
|
|
|
-// vo.setProcessworkshop(v.get(0).getProcessworkshop());
|
|
|
-// resultVo.add(vo);
|
|
|
-// });
|
|
|
-
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -213,6 +163,60 @@ public class GanttServiceImpl implements GanttService {
|
|
|
return R.ok(String.format(SCHEDULING_TO_BE_PUBLISHED_STR, backupDo == null ? "" : backupDo.getBackupuser()));
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 获取设备和车间信息
|
|
|
+ *
|
|
|
+ * @param factoryId
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public R getWorkshopAndDevice(String factoryId) {
|
|
|
+ if (StringUtils.isBlank(factoryId)) {
|
|
|
+ log.error("工厂信息为空");
|
|
|
+ return R.error("请选择需要获取排程信息的工厂");
|
|
|
+ }
|
|
|
+ List<GanttVos> workshopAndDeviceByFactoryId = apsProcessOperationProcessEquDao.getWorkshopAndDeviceByFactoryId(factoryId);
|
|
|
+ // 需要返回给前端的数据
|
|
|
+ List<ScheduleGanttVo> resultVo = new ArrayList<>();
|
|
|
+
|
|
|
+ // 对数据按照加工车间分组
|
|
|
+ LinkedHashMap<String, List<GanttVos>> dataMap = workshopAndDeviceByFactoryId.stream()
|
|
|
+ .collect(Collectors.groupingBy(GanttVos::getProcessworkshopid,
|
|
|
+ LinkedHashMap::new, Collectors.toList()));
|
|
|
+ /**
|
|
|
+ * 工序的对象
|
|
|
+ */
|
|
|
+ ScheduleGanttVo workShopVo;
|
|
|
+ // 设备的对象
|
|
|
+ ScheduleGanttVo deviceVo;
|
|
|
+ for (Map.Entry<String, List<GanttVos>> workShopEntry : dataMap.entrySet()) {
|
|
|
+ workShopVo = new ScheduleGanttVo();
|
|
|
+ workShopVo.setId(workShopEntry.getValue().get(0).getProcessworkshopid());
|
|
|
+ workShopVo.setText(workShopEntry.getValue().get(0).getProcessworkshop());
|
|
|
+ workShopVo.setOpen(true);
|
|
|
+ workShopVo.setType(DEFAULT_TYPE);
|
|
|
+ workShopVo.setStart_date(workShopEntry.getValue().get(0).getPlanstartdate());
|
|
|
+ resultVo.add(workShopVo);
|
|
|
+ // 对数据按照设备进行分组
|
|
|
+ LinkedHashMap<String, List<GanttVos>> processMap = workShopEntry.getValue().stream().collect(Collectors.groupingBy(GanttVos::getProcessdeviceid,
|
|
|
+ LinkedHashMap::new, Collectors.toList()));
|
|
|
+ // 循环设备数据
|
|
|
+ for (GanttVos ganttVos : workShopEntry.getValue()) {
|
|
|
+ deviceVo = new ScheduleGanttVo();
|
|
|
+ deviceVo.setId(ganttVos.getProcessdeviceid());
|
|
|
+ deviceVo.setText(ganttVos.getProcessdevice());
|
|
|
+ deviceVo.setOpen(true);
|
|
|
+ deviceVo.setType(DEFAULT_TYPE);
|
|
|
+ deviceVo.setParent(workShopVo.getId());
|
|
|
+ deviceVo.setRender(DEFAULT_RENDER);
|
|
|
+ deviceVo.setProductlineid(ganttVos.getProductlineid());
|
|
|
+ deviceVo.setProductlinename(ganttVos.getProductlinename());
|
|
|
+ resultVo.add(deviceVo);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return R.ok(resultVo);
|
|
|
+ }
|
|
|
+
|
|
|
public String dateFormat(Date date) {
|
|
|
if (date == null) {
|
|
|
return "";
|
|
@@ -297,7 +301,7 @@ public class GanttServiceImpl implements GanttService {
|
|
|
*/
|
|
|
public List<ScheduleGanttVo> assembleGanttData(List<GanttVos> apsProcessOperationProcessEquDos) {
|
|
|
// 需要返回给前端的数据
|
|
|
- List<ScheduleGanttVo> resultVo=new ArrayList<>();
|
|
|
+ List<ScheduleGanttVo> resultVo = new ArrayList<>();
|
|
|
if (apsProcessOperationProcessEquDos.isEmpty()) {
|
|
|
return resultVo;
|
|
|
}
|
|
@@ -306,75 +310,66 @@ public class GanttServiceImpl implements GanttService {
|
|
|
// 工序作业对应的输入和输出批次号
|
|
|
Map<String, String> processAndNumberMap = apsReportRecordsDao.selectInputAndOutputNumByProcessId(processId).stream().collect(Collectors.toMap(ProcessOutputAndInputNumber::getProcessId, ProcessOutputAndInputNumber::getNumber));
|
|
|
|
|
|
-
|
|
|
- // 对数据按照加工车间分组
|
|
|
- LinkedHashMap<String, List<GanttVos>> dataMap = apsProcessOperationProcessEquDos.stream()
|
|
|
- .collect(Collectors.groupingBy(GanttVos::getProcessworkshopid,
|
|
|
- LinkedHashMap::new, Collectors.toList()));
|
|
|
- /**
|
|
|
- * 工序的对象
|
|
|
- */
|
|
|
- ScheduleGanttVo workShopVo;
|
|
|
- // 设备的对象
|
|
|
- ScheduleGanttVo deviceVo;
|
|
|
// 具体工序作业的对象
|
|
|
ScheduleGanttVo dateVo;
|
|
|
int workShopIndex = 1;
|
|
|
- String inputNumber;
|
|
|
- for (Map.Entry<String, List<GanttVos>> workShopEntry : dataMap.entrySet()) {
|
|
|
- workShopVo = new ScheduleGanttVo();
|
|
|
- workShopVo.setId(workShopIndex++);
|
|
|
- workShopVo.setText(workShopEntry.getValue().get(0).getProcessworkshop());
|
|
|
- workShopVo.setOpen(true);
|
|
|
- workShopVo.setType(DEFAULT_TYPE);
|
|
|
- workShopVo.setStart_date(workShopEntry.getValue().get(0).getPlanstartdate());
|
|
|
- resultVo.add(workShopVo);
|
|
|
- // 对数据按照设备进行分组
|
|
|
- LinkedHashMap<String, List<GanttVos>> processMap = workShopEntry.getValue().stream().collect(Collectors.groupingBy(GanttVos::getProcessdeviceid,
|
|
|
- LinkedHashMap::new, Collectors.toList()));
|
|
|
- // 对数据按照 设备进行分组
|
|
|
- for (Map.Entry<String, List<GanttVos>> deviceEntry : processMap.entrySet()) {
|
|
|
- deviceVo = new ScheduleGanttVo();
|
|
|
- deviceVo.setId(workShopIndex++);
|
|
|
- deviceVo.setText(deviceEntry.getValue().get(0).getProcessdevice());
|
|
|
- deviceVo.setOpen(true);
|
|
|
- deviceVo.setType(DEFAULT_TYPE);
|
|
|
- deviceVo.setParent(workShopVo.getId());
|
|
|
-// deviceVo.setDevicetype(deviceEntry.getValue().get(0).getDevicetype());
|
|
|
- deviceVo.setRender(DEFAULT_RENDER);
|
|
|
- deviceVo.setStart_date(deviceEntry.getValue().get(0).getPlanstartdate());
|
|
|
- deviceVo.setProductlineid(deviceEntry.getValue().get(0).getProductlineid());
|
|
|
- deviceVo.setProductlinename(deviceEntry.getValue().get(0).getProductlinename());
|
|
|
- resultVo.add(deviceVo);
|
|
|
- // 对数据按照 计划开始时间+计划结束时间 分组
|
|
|
- LinkedHashMap<String, List<GanttVos>> planDataMap = deviceEntry.getValue().stream().collect(Collectors.groupingBy(info -> {
|
|
|
- if (COMBINED_PROCESSING.equals(info.getProcessway())) {
|
|
|
- return info.getPlanstartdate().toString() + info.getPlanenddate().toString();
|
|
|
- }
|
|
|
- return info.getUuid();
|
|
|
- },
|
|
|
- LinkedHashMap::new, Collectors.toList()));
|
|
|
- for (Map.Entry<String, List<GanttVos>> planDateEntry : planDataMap.entrySet()) {
|
|
|
- List<GanttVos> ganttVos = planDateEntry.getValue();
|
|
|
- ganttVos.forEach(data->{
|
|
|
- String number = processAndNumberMap.getOrDefault(data.getProcessid(), "");
|
|
|
- if(StringUtils.isNotBlank(number) && number.split(DEFAULT_SPLIT).length==2){
|
|
|
- data.setInputnumber(number.split(DEFAULT_SPLIT)[0]);
|
|
|
- data.setOutputnumber(number.split(DEFAULT_SPLIT)[1]);
|
|
|
- }
|
|
|
- });
|
|
|
- List<String> itemNames = new ArrayList<>();
|
|
|
- // 按照工序作业明细ID 进行分组 并且获取 图列的 名称和描述
|
|
|
- LinkedHashMap<String, List<GanttVos>> collect = ganttVos.stream().collect(Collectors.groupingBy(GanttVos::getId, LinkedHashMap::new, Collectors.toList()));
|
|
|
+ // 对数据按照 计划开始时间+计划结束时间 分组
|
|
|
+ LinkedHashMap<String, List<GanttVos>> planDataMap = apsProcessOperationProcessEquDos.stream().collect(Collectors.groupingBy(info -> {
|
|
|
+ if (COMBINED_PROCESSING.equals(info.getProcessway())) {
|
|
|
+ return info.getPlanstartdate().toString() + info.getPlanenddate().toString();
|
|
|
+ }
|
|
|
+ return info.getUuid();
|
|
|
+ },
|
|
|
+ LinkedHashMap::new, Collectors.toList()));
|
|
|
+ for (Map.Entry<String, List<GanttVos>> planDateEntry : planDataMap.entrySet()) {
|
|
|
+ List<GanttVos> ganttVos = planDateEntry.getValue();
|
|
|
+ ganttVos.forEach(data -> {
|
|
|
+ String number = processAndNumberMap.getOrDefault(data.getProcessid(), "");
|
|
|
+ if (StringUtils.isNotBlank(number) && number.split(DEFAULT_SPLIT).length == 2) {
|
|
|
+ data.setInputnumber(number.split(DEFAULT_SPLIT)[0]);
|
|
|
+ data.setOutputnumber(number.split(DEFAULT_SPLIT)[1]);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ List<String> itemNames = new ArrayList<>();
|
|
|
+ // 按照工序作业明细ID 进行分组 并且获取 图列的 名称和描述
|
|
|
+ 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 -> {
|
|
|
+ return String.format(GANTT_ITEM_NAME, info.get(0).getInmatercondition(), info.get(0).getPlanprocessrall(),
|
|
|
+ info.get(0).getCustomorderno(), info.get(0).getCustomerabbreviation(), info.get(0).getDeliverydate());
|
|
|
+ }).collect(Collectors.joining("</br>"));
|
|
|
+ itemNames.add(itemName);
|
|
|
+ dateVo = new ScheduleGanttVo();
|
|
|
+ dateVo.setId(String.valueOf(workShopIndex++));
|
|
|
+ dateVo.setParent(planDateEntry.getValue().get(0).getProcessdeviceid());
|
|
|
+ dateVo.setText(StringUtils.join(itemNames, "</br>"));
|
|
|
+ dateVo.setOpen(false);
|
|
|
+ dateVo.setStart_date(planDateEntry.getValue().get(0).getPlanstartdate());
|
|
|
+ dateVo.setEnd_date(planDateEntry.getValue().get(0).getPlanenddate());
|
|
|
+ dateVo.setName(StringUtils.join(itemNames, "</br>"));
|
|
|
+ dateVo.setProcessdetailids(ganttVos.stream().map(GanttVos::getId).distinct().collect(Collectors.joining(",")));
|
|
|
+ dateVo.setProcessids(ganttVos.stream().map(GanttVos::getProcessid).distinct().collect(Collectors.joining(",")));
|
|
|
+ dateVo.setGanttVos(ganttVos);
|
|
|
+ dateVo.setWorkstatus(ganttVos.stream().map(GanttVos::getWorkstatus).distinct().collect(Collectors.joining(",")));
|
|
|
+ dateVo.setLockmark(ganttVos.stream().map(GanttVos::getLockmark).distinct().collect(Collectors.joining(",")));
|
|
|
+ dateVo.setProductionorderid(ganttVos.stream().map(GanttVos::getProductionorderid).collect(Collectors.joining(",")));
|
|
|
+ // 冲突描述
|
|
|
+ List<GanttVos> conflictdes = ganttVos.stream().filter(v -> StringUtils.isNotBlank(v.getConflictdes())).collect(Collectors.toList());
|
|
|
+ if (!conflictdes.isEmpty()) {
|
|
|
+ String desc = conflictdes.stream().map(GanttVos::getConflictdes).collect(Collectors.joining(";"));
|
|
|
+ dateVo.setConflictdes(desc);
|
|
|
+ dateVo.setSoftconflictdes(conflictdes.stream().map(GanttVos::getSoftconflictdes).collect(Collectors.joining(";")));
|
|
|
+ // 有冲突描述时
|
|
|
+ dateVo.setConflict(StringUtils.isBlank(dateVo.getConflictdes()) && StringUtils.isBlank(dateVo.getSoftconflictdes()));
|
|
|
+ }
|
|
|
+ resultVo.add(dateVo);
|
|
|
+ }
|
|
|
+ return resultVo;
|
|
|
+ // dateVo.setTooltip(itemPrefix + itemDesc);
|
|
|
+// dateVo.setDesc(itemPrefix + itemDesc);
|
|
|
+// dateVo.setConflict(ganttVos.get(0).getConflict());
|
|
|
// String prefix = info.stream().map(data -> String.format(GANTT_ITEM_NAME_PREFIX, data.getCustomerabbreviation(), data.getProductname()))
|
|
|
// .collect(Collectors.joining(","));
|
|
|
- return String.format(GANTT_ITEM_NAME, info.get(0).getInmatercondition(), info.get(0).getPlanprocessrall(),
|
|
|
- info.get(0).getCustomorderno(), info.get(0).getCustomerabbreviation(), info.get(0).getDeliverydate());
|
|
|
- }).collect(Collectors.joining("</br>"));
|
|
|
- itemNames.add(itemName);
|
|
|
-
|
|
|
// String itemPrefix = String.format(GANTT_DESC_PREFIX,
|
|
|
// dateFormat(ganttVos.get(0).getPlanstartdate()),
|
|
|
// dateFormat(ganttVos.get(0).getPlanenddate()),
|
|
@@ -389,39 +384,47 @@ public class GanttServiceImpl implements GanttService {
|
|
|
// info.getCustomorderno(), info.getCustomerabbreviation(),
|
|
|
// info.getDeliverydate(), info.getOutputorderproduct());
|
|
|
// }).collect(Collectors.joining("</br>"));
|
|
|
- dateVo = new ScheduleGanttVo();
|
|
|
- dateVo.setId(workShopIndex++);
|
|
|
- dateVo.setParent(deviceVo.getId());
|
|
|
- dateVo.setText(StringUtils.join(itemNames, "</br>"));
|
|
|
-// dateVo.setTooltip(itemPrefix + itemDesc);
|
|
|
- dateVo.setOpen(false);
|
|
|
- dateVo.setStart_date(planDateEntry.getValue().get(0).getPlanstartdate());
|
|
|
- dateVo.setEnd_date(planDateEntry.getValue().get(0).getPlanenddate());
|
|
|
- dateVo.setName(StringUtils.join(itemNames, "</br>"));
|
|
|
-// dateVo.setDesc(itemPrefix + itemDesc);
|
|
|
- dateVo.setProcessdetailids(ganttVos.stream().map(GanttVos::getId).distinct().collect(Collectors.joining(",")));
|
|
|
- dateVo.setProcessids(ganttVos.stream().map(GanttVos::getProcessid).distinct().collect(Collectors.joining(",")));
|
|
|
- dateVo.setGanttVos(ganttVos);
|
|
|
- dateVo.setWorkstatus(ganttVos.stream().map(GanttVos::getWorkstatus).distinct().collect(Collectors.joining(",")));
|
|
|
- dateVo.setLockmark(ganttVos.stream().map(GanttVos::getLockmark).distinct().collect(Collectors.joining(",")));
|
|
|
-// dateVo.setConflict(ganttVos.get(0).getConflict());
|
|
|
- dateVo.setProductionorderid(ganttVos.stream().map(GanttVos::getProductionorderid).collect(Collectors.joining(",")));
|
|
|
- // 冲突描述
|
|
|
- List<GanttVos> conflictdes = ganttVos.stream().filter(v -> StringUtils.isNotBlank(v.getConflictdes())).collect(Collectors.toList());
|
|
|
- if (!conflictdes.isEmpty()) {
|
|
|
- String desc = conflictdes.stream().map(GanttVos::getConflictdes).collect(Collectors.joining(";"));
|
|
|
- dateVo.setConflictdes(desc);
|
|
|
- dateVo.setSoftconflictdes(conflictdes.stream().map(GanttVos::getSoftconflictdes).collect(Collectors.joining(";")));
|
|
|
- // 有冲突描述时
|
|
|
- dateVo.setConflict(StringUtils.isBlank(dateVo.getConflictdes()) && StringUtils.isBlank(dateVo.getSoftconflictdes()));
|
|
|
- }
|
|
|
-
|
|
|
- resultVo.add(dateVo);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- return resultVo;
|
|
|
+// // 对数据按照加工车间分组
|
|
|
+// LinkedHashMap<String, List<GanttVos>> dataMap = apsProcessOperationProcessEquDos.stream()
|
|
|
+// .collect(Collectors.groupingBy(GanttVos::getProcessworkshopid,
|
|
|
+// LinkedHashMap::new, Collectors.toList()));
|
|
|
+// for (Map.Entry<String, List<GanttVos>> workShopEntry : dataMap.entrySet()) {
|
|
|
+// workShopVo = new ScheduleGanttVo();
|
|
|
+// workShopVo.setId(workShopEntry.getValue().get(0).getProcessworkshopid());
|
|
|
+// workShopVo.setText(workShopEntry.getValue().get(0).getProcessworkshop());
|
|
|
+// workShopVo.setOpen(true);
|
|
|
+// workShopVo.setType(DEFAULT_TYPE);
|
|
|
+// workShopVo.setStart_date(workShopEntry.getValue().get(0).getPlanstartdate());
|
|
|
+// resultVo.add(workShopVo);
|
|
|
+// // 对数据按照设备进行分组
|
|
|
+// LinkedHashMap<String, List<GanttVos>> processMap = workShopEntry.getValue().stream().collect(Collectors.groupingBy(GanttVos::getProcessdeviceid,
|
|
|
+// LinkedHashMap::new, Collectors.toList()));
|
|
|
+// // 对数据按照 设备进行分组
|
|
|
+// for (Map.Entry<String, List<GanttVos>> deviceEntry : processMap.entrySet()) {
|
|
|
+// deviceVo = new ScheduleGanttVo();
|
|
|
+// deviceVo.setId(deviceEntry.getValue().get(0).getProcessdeviceid());
|
|
|
+// deviceVo.setText(deviceEntry.getValue().get(0).getProcessdevice());
|
|
|
+// deviceVo.setOpen(true);
|
|
|
+// deviceVo.setType(DEFAULT_TYPE);
|
|
|
+// deviceVo.setParent(workShopVo.getId());
|
|
|
+//// deviceVo.setDevicetype(deviceEntry.getValue().get(0).getDevicetype());
|
|
|
+// deviceVo.setRender(DEFAULT_RENDER);
|
|
|
+// deviceVo.setStart_date(deviceEntry.getValue().get(0).getPlanstartdate());
|
|
|
+// deviceVo.setProductlineid(deviceEntry.getValue().get(0).getProductlineid());
|
|
|
+// deviceVo.setProductlinename(deviceEntry.getValue().get(0).getProductlinename());
|
|
|
+// resultVo.add(deviceVo);
|
|
|
+// // 对数据按照 计划开始时间+计划结束时间 分组
|
|
|
+// LinkedHashMap<String, List<GanttVos>> planDataMap = deviceEntry.getValue().stream().collect(Collectors.groupingBy(info -> {
|
|
|
+// if (COMBINED_PROCESSING.equals(info.getProcessway())) {
|
|
|
+// return info.getPlanstartdate().toString() + info.getPlanenddate().toString();
|
|
|
+// }
|
|
|
+// return info.getUuid();
|
|
|
+// },
|
|
|
+// LinkedHashMap::new, Collectors.toList()));
|
|
|
+//
|
|
|
+// }
|
|
|
+//
|
|
|
+// }
|
|
|
}
|
|
|
|
|
|
}
|