1
This commit is contained in:
@@ -3,6 +3,7 @@ package com.ruoyi.web.controller.jarvis;
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import com.ruoyi.jarvis.domain.SuperAdmin;
|
||||
import com.ruoyi.jarvis.service.SuperAdminService;
|
||||
@@ -37,8 +38,28 @@ public class OrderRowsController extends BaseController
|
||||
* 查询京粉订单列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(OrderRows orderRows)
|
||||
public TableDataInfo list(OrderRows orderRows, @RequestParam(required = false) String orderBy, @RequestParam(required = false) String orderSort)
|
||||
{
|
||||
// 处理排序参数:将 orderBy 和 orderSort 转换为 params 中的 orderBy 和 isAsc
|
||||
if (orderBy != null && !orderBy.isEmpty()) {
|
||||
if (orderRows.getParams() == null) {
|
||||
orderRows.setParams(new HashMap<>());
|
||||
}
|
||||
Map<String, Object> params = orderRows.getParams();
|
||||
// 将字段名转换为数据库列名
|
||||
if ("estimateCosPrice".equals(orderBy)) {
|
||||
params.put("orderBy", "estimate_cos_price");
|
||||
} else {
|
||||
params.put("orderBy", orderBy);
|
||||
}
|
||||
// 将 orderSort (asc/desc) 转换为 isAsc (asc/desc)
|
||||
if ("asc".equals(orderSort)) {
|
||||
params.put("isAsc", "asc");
|
||||
} else if ("desc".equals(orderSort)) {
|
||||
params.put("isAsc", "desc");
|
||||
}
|
||||
}
|
||||
|
||||
startPage();
|
||||
List<OrderRows> list = orderRowsService.selectOrderRowsList(orderRows);
|
||||
return getDataTable(list);
|
||||
|
||||
Reference in New Issue
Block a user