fix: 修改材料排序

This commit is contained in:
han0
2025-03-19 11:04:54 +08:00
parent cabf30bc2e
commit a9a4f3849e
4 changed files with 4 additions and 10 deletions

View File

@@ -70,14 +70,12 @@ public class MaterialController {
@ApiParam(value = "类型") @RequestParam("type") String type
) {
LambdaQueryWrapper<Material> query = new LambdaQueryWrapper<>();
// query.eq(Material::getIsTree, 0);
// if (parentId != null) {
// query.eq(Material::getParentId, parentId);
// }
query.eq(Material::getType, type);
if (keyWord != null && ObjectUtil.isNotEmpty(keyWord)) {
query.like(Material::getName, keyWord);
}
query.orderByAsc(Material::getSort)
.orderByAsc(Material::getId);
var result = materialService.list(query);
return FuHttpResponse.Builder().dataResponse(result).build();

View File

@@ -1,13 +1,9 @@
package mjkf.xinke.main.service;
import cn.hutool.core.io.FileUtil;
import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpResponse;
import cn.hutool.json.JSONUtil;
import lombok.extern.slf4j.Slf4j;
import mjkf.xinke.common.cache.CommonCacheOperator;
import mjkf.xinke.common.exception.CommonException;
import mjkf.xinke.main.common.property.ApiHostProperty;
import org.springframework.stereotype.Service;

View File

@@ -42,7 +42,7 @@ public class PricePublishService extends ServiceImpl<BaseMapper<PricePublish>, P
query.eq(PricePublish::getSpec, spec);
}
query.orderByDesc(Material::getSort);
query.orderByAsc(Material::getSort);
return query;
}

View File

@@ -30,7 +30,7 @@ public class PriceResultService extends ServiceImpl<BaseMapper<PriceResult>, Pri
query.like(PriceResult::getName, name);
}
query.orderByDesc(Material::getSort);
query.orderByAsc(Material::getSort);
return query;
}