fix: 修改材料排序
This commit is contained in:
@@ -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();
|
||||
|
@@ -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;
|
||||
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user