浏览代码

区域每条项目数量,维保电梯数量重置。维保项列表根据status区分新老版本维保项

wanghaicheng 5 年之前
父节点
当前提交
01e8baf498

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

@@ -43,6 +43,8 @@ public class MaintenanceOptionController {
                 new Page<>(req.getPageNum(), req.getPageSize()), new QueryWrapper<MaintenanceOption>()
                         //10086是平台的团队id
                         .in("mt_company_id", 10086L, req.getMtCompanyId())
+                        //留1是为了兼容以前数据,2.0使用的status版本1 ,    3.0使用的status版本2
+                        .eq("status", 2)
                         .in(req.getType() != null, "type", type(req))
                         .eq(req.getLiftType() != null, "lift_type", req.getLiftType())
                         .orderByDesc("mt_company_id")
@@ -70,6 +72,8 @@ public class MaintenanceOptionController {
                 new QueryWrapper<MaintenanceOption>()
                         //10086是平台的团队id
                         .in("mt_company_id", 10086L, req.getMtCompanyId())
+                        //留1是为了兼容以前数据,2.0使用的status版本1 ,    3.0使用的status版本2
+                        .eq("status", 2)
                         .in(req.getType() != null, "type", type(req))
                         .eq(req.getLiftType() != null, "lift_type", req.getLiftType())
                         .in(sort != null, "sort", sort)
@@ -88,6 +92,8 @@ public class MaintenanceOptionController {
      */
     @PostMapping("/add")
     public RestResponse add(@RequestBody MaintenanceOption option) {
+        //留1是为了兼容以前数据,2.0使用的status版本1 ,    3.0使用的status版本2
+        option.setStatus(2);
         if (optionService.save(option)) {
             return RestResponse.success(option.getId(), "成功");
         }

+ 3 - 0
lift-enterprise-service/src/main/java/cn/com/ty/lift/enterprise/region/service/impl/RegionServiceImpl.java

@@ -91,6 +91,9 @@ public class RegionServiceImpl extends ServiceImpl<RegionMapper, Region> impleme
             }
             region.put("projectNum", projectNum);
             region.put("num", num);
+
+            projectNum = 0;
+            num = 0;
         }
         return RestResponse.success(regions, "成功");
     }