|
|
|
@ -258,6 +258,9 @@ public class MesProductionProcessContext implements Serializable {
|
|
|
|
|
public MesProductionProcessContext equipVariableCfgJson(List<MesEquipmentVariableCfg> equipmentVariableCfgList) {
|
|
|
|
|
if (CollectionUtils.isEmpty(equipmentVariableCfgList)) return this;
|
|
|
|
|
if (!StringUtils.isEmpty(this.equipVariableCfgJson)) equipmentVariableCfgList.addAll(getEquipVariableCfgList());
|
|
|
|
|
equipmentVariableCfgList.stream().filter(o -> null != o).forEach(o -> {
|
|
|
|
|
if (StringUtils.isEmpty(o.getModifyDatetime())) o.setModifyDatetime(o.getCreateDatetime());
|
|
|
|
|
});
|
|
|
|
|
equipmentVariableCfgList = equipmentVariableCfgList.stream().filter(o -> null != o).sorted(Comparator.comparing(MesEquipmentVariableCfg::getModifyDatetime).reversed()).collect(Collectors.toList());
|
|
|
|
|
equipmentVariableCfgList = equipmentVariableCfgList.stream().filter(o -> null != o).distinct().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(MesEquipmentVariableCfg::getId))), ArrayList::new));
|
|
|
|
|
this.equipVariableCfgJson = JSONObject.toJSONString(equipmentVariableCfgList);
|
|
|
|
@ -289,6 +292,9 @@ public class MesProductionProcessContext implements Serializable {
|
|
|
|
|
equipmentVariableList = CollectionUtils.isEmpty(equipmentVariableList) ? null : equipmentVariableList.stream().filter(o -> (null != o && !StringUtils.isEmpty(o.getCategoryLevelTwo()))).collect(Collectors.toList());
|
|
|
|
|
if (CollectionUtils.isEmpty(equipmentVariableList)) return this;
|
|
|
|
|
if (!StringUtils.isEmpty(this.equipVariableJson)) equipmentVariableList.addAll(getEquipVariableList());
|
|
|
|
|
equipmentVariableList.stream().filter(o -> null != o).forEach(o -> {
|
|
|
|
|
if (StringUtils.isEmpty(o.getModifyDatetime())) o.setModifyDatetime(o.getCreateDatetime());
|
|
|
|
|
});
|
|
|
|
|
equipmentVariableList = equipmentVariableList.stream().filter(o -> null != o).sorted(Comparator.comparing(MesEquipmentVariable::getModifyDatetime).reversed()).collect(Collectors.toList());
|
|
|
|
|
equipmentVariableList = equipmentVariableList.stream().filter(o -> null != o).distinct().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(MesEquipmentVariable::getId))), ArrayList::new));
|
|
|
|
|
this.equipVariableJson = JSONObject.toJSONString(equipmentVariableList);
|
|
|
|
|