Commit 3b29d9b5 authored by 赵啸非's avatar 赵啸非

添加材料排序

parent 48872986
......@@ -160,6 +160,9 @@ public class MatterDatumServiceImpl extends AbstractCRUDServiceImpl<MatterDatumD
String prePath = "file/preview/";
String newName = genPreviewPath(rootPath, prePath, entity.getSamplePath());
entity.setPreViewPath(prePath + newName);
int sort = this.count(new MatterDatumQuery(), context);
entity.setSort(sort);
super.saveBefore(entity, context);
}
......
......@@ -67,6 +67,7 @@ public class MatterDatumController extends BaseCRUDJsonBodyMappingController<Mat
protected void doListBefore(MatterDatumEntity query, Map<String, Object> model, Context context) throws AppException {
List<OrderCol> orderColList = new ArrayList<>();
orderColList.add(new OrderCol("isRecommend", OrderCol.DESCENDING));
orderColList.add(new OrderCol("sort", OrderCol.DESCENDING));
orderColList.add(new OrderCol("createTime", OrderCol.DESCENDING));
query.setOrderColList(orderColList);
super.doListBefore(query, model, context);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment