浏览代码

扶梯,sort存-1。list排序按照id倒序排序

wanghaicheng 5 年之前
父节点
当前提交
8cba6c47ba

+ 5 - 1
lift-enterprise-service/src/main/java/cn/com/ty/lift/enterprise/option/controller/MaintenanceOptionController.java

@@ -45,7 +45,8 @@ public class MaintenanceOptionController {
                         .in("mt_company_id", 10086L, req.getMtCompanyId())
                         .in(req.getType() != null, "type", type(req))
                         .eq(req.getLiftCategory() != null, "lift_category", req.getLiftCategory())
-                        .eq(req.getStatus() != null, "status", req.getStatus()));
+                        .eq(req.getStatus() != null, "status", req.getStatus())
+                        .orderByDesc("id"));
         if (page.getRecords().isEmpty()) {
             return RestResponse.success();
         }
@@ -91,6 +92,9 @@ public class MaintenanceOptionController {
      */
     @PostMapping("/add")
     public RestResponse add(@RequestBody MaintenanceOption option) {
+        if (option.getLiftCategory() == 3) {
+            option.setSort(-1);
+        }
         return RestResponse.success(optionService.save(option));
     }