hotfix(20240617-workspace): 产品版本产品列表增加version升序排序
This commit is contained in:
parent
51b1a60a60
commit
25a41cf79f
@ -70,6 +70,11 @@ public class WorkspaceProductResp {
|
||||
*/
|
||||
private Integer maxWorkspaceCount;
|
||||
|
||||
/**
|
||||
* 版本升级序列(数字越小,版本越低,不能降级,只能升级) <企业、项目产品>
|
||||
*/
|
||||
private Integer version;
|
||||
|
||||
/**
|
||||
* SKU列表
|
||||
*/
|
||||
|
||||
@ -252,7 +252,11 @@ public class ProductServiceImpl implements ProductService {
|
||||
.build()).collect(Collectors.toList()));
|
||||
} else {
|
||||
if (ProductModuleCategoryEnum.PRODUCT_VERSION.getCode().equals(k)) {
|
||||
resp.getProductVersions().addAll(v.stream().map(this::buildRespProduct).filter(Objects::nonNull).collect(Collectors.toList()));
|
||||
List<WorkspaceProductResp.Product> products = v.stream().map(this::buildRespProduct).filter(Objects::nonNull).collect(Collectors.toList());
|
||||
if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(products)) {
|
||||
products.sort(Comparator.comparing(p -> Objects.isNull(p.getVersion()) ? 0 : p.getVersion()));
|
||||
}
|
||||
resp.getProductVersions().addAll(products);
|
||||
}
|
||||
if (ProductModuleCategoryEnum.ADD_VALUE_SERVICE.getCode().equals(k)) {
|
||||
resp.getAddValueServices().addAll(v.stream().map(this::buildRespProduct).filter(Objects::nonNull).collect(Collectors.toList()));
|
||||
@ -372,6 +376,7 @@ public class ProductServiceImpl implements ProductService {
|
||||
.productName(e.getProductName())
|
||||
.maxPersonCount(e.getMaxPersonCount())
|
||||
.maxWorkspaceCount(e.getMaxWorkspaceCount())
|
||||
.version(e.getVersion())
|
||||
.skus(CollectionUtil.isNotEmpty(e.getSkus()) ? e.getSkus().stream().map(s -> WorkspaceProductResp.Sku
|
||||
.builder()
|
||||
.skuName(s.getSkuName())
|
||||
|
||||
Loading…
Reference in New Issue
Block a user